home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 23 / CU Amiga - Super CD-ROM 23 (June 1998).iso / CreatingGames / Utilities / Misc / GMS / GMSDev / Includes / files / files.h < prev    next >
Encoding:
C/C++ Source or Header  |  1997-11-30  |  4.1 KB  |  143 lines

  1. #ifndef FILES_FILES_H
  2. #define FILES_FILES_H TRUE
  3.  
  4. /*
  5. **   $VER: files.h V0.9B
  6. **
  7. **   File definitions.
  8. **
  9. **   (C) Copyright 1996-1997 DreamWorld Productions.
  10. **       All Rights Reserved.
  11. */
  12.  
  13. #ifndef DPKERNEL_H
  14. #include <games/dpkernel.h>
  15. #endif
  16.  
  17. /****************************************************************************
  18. ** Module information.
  19. */
  20.  
  21. #define FileModVersion  0
  22. #define FileModRevision 9
  23.  
  24. /****************************************************************************
  25. ** Mini structures for source and destination operations.
  26. */
  27.  
  28. struct Source {      /* Source structure, for internal use only */
  29.   WORD ID;
  30.   APTR Src;
  31. };
  32.  
  33. struct FileName {    /* Filename structure */
  34.   WORD ID;           /* ID_FILENAME */
  35.   BYTE *Name;        /* Pointer to filename */
  36. };
  37.  
  38. struct MemPtr {      /* Memory location structure */
  39.   WORD ID;           /* ID_MEMPTR */
  40.   APTR Address;      /* Pointer to memory area */
  41.   LONG Size;         /* Must supply a size unless you are a MemBlock */
  42. };
  43.  
  44. /****************************************************************************
  45. ** File Object.
  46. */
  47.  
  48. #define FILEVERSION 1
  49. #define TAGS_FILE   ((ID_SPCTAGS<<16)|ID_FILE)
  50.  
  51. struct File {
  52.   struct Head Head;       /* 00: Standard structure header */
  53.   LONG   BytePos;         /* 12: Current position in file */
  54.   LONG   Size;            /* 16: Total size of the file */
  55.   LONG   Flags;           /* 20: File opening flags */
  56.   struct Head *Source;    /* 24: Direct pointer to the original Source structure */
  57.   struct File *Prev;      /* 28: Previous file in chain */
  58.   struct File *Next;      /* 32: Next file in chain */
  59.   BYTE   *Comment;        /* 36: Pointer to comment string */
  60.   struct Time *Date;      /* 40: Set at time of creation */
  61.   LONG   Permissions;     /* 44: User permission flags */
  62.  
  63.   /*** Private fields start now ***/
  64.  
  65.   LONG   prvHandle;
  66.   LONG   prvKey;
  67.   LONG   prvLastPos;
  68.   WORD   prvAFlags;
  69. };
  70.  
  71. /* File tags */
  72.  
  73. #define FLA_BytePos (TLONG|12)
  74. #define FLA_Size    (TLONG|16)
  75. #define FLA_Flags   (TLONG|20)
  76. #define FLA_Source  (TAPTR|24)
  77. #define FLA_Prev    (TAPTR|28)
  78. #define FLA_Next    (TAPTR|32)
  79. #define FLA_Comment (TAPTR|36)
  80. #define FLA_Date    (TAPTR|40)
  81.  
  82. /****************************************************************************
  83. ** Opening flags for Files and Directories.
  84. */
  85.  
  86. #define FL_OLDFILE 0
  87. #define FL_WRITE    (1L<<0)
  88. #define FL_LOCK     (1L<<1)
  89. /*#define FL_NEW    (1L<<2)*/
  90. #define FL_FIND     (1L<<3)
  91. #define FL_NOUNPACK (1L<<4)
  92. #define FL_NOPACK   (1L<<4)
  93. #define FL_NOBUFFER (1L<<5)
  94. #define FL_NEWFILE  (1L<<6)
  95. #define FL_READ     ((0)|FL_OLDFILE)
  96.  
  97. /****************************************************************************
  98. ** Permission flags for Files and Directories.
  99. */
  100.  
  101. #define FPT_READ     0x00000001
  102. #define FPT_WRITE    0x00000002
  103. #define FPT_EXECUTE  0x00000004
  104. #define FPT_DELETE   0x00000008
  105. #define FPT_SCRIPT   0x00000010
  106. #define FPT_HIDDEN   0x00000020
  107. #define FPT_ARCHIVE  0x00000040
  108. #define FPT_PASSWORD 0x00000080
  109.  
  110. /****************************************************************************
  111. ** Directory Object.  The format/version of the DirEntry and FileEntry
  112. ** structures is dependent on the directory version.
  113. */
  114.  
  115. #define DIRVERSION     1
  116. #define TAGS_DIRECTORY (ID_SPCTAGS<<16)|ID_DIRECTORY
  117.  
  118. struct Directory {
  119.   struct Head Head;             /* 00: Standard header */
  120.   struct Directory *ChildDir;   /* 12: First directory in list */
  121.   struct File      *ChildFile;  /* 16: First file in list */
  122.   struct FileName  *Source;     /* 20: Location and Name of this directory */
  123.   LONG   Flags;                 /* 24: Opening Flags (see file flags) */
  124.   BYTE   *Comment;              /* 28: Pointer to comment string */
  125.   LONG   Permissions;           /* 32: User Flags */
  126.   struct Time *Date;            /* 36: Set to time of creation */
  127.   struct Directory *Next;       /* 40: Next directory in this list */
  128.   struct Directory *Prev;       /* 44: Previous directory in this list */
  129.  
  130.   /*** Private fields ***/
  131.  
  132.   WORD   prvAFlags;
  133. };
  134.  
  135. #define DIRA_Source      (TAPTR|20)
  136. #define DIRA_Flags       (TLONG|24)
  137. #define DIRA_Comment     (TAPTR|28)
  138. #define DIRA_Permissions (TLONG|32)
  139. #define DIRA_Date        (TAPTR|36)
  140.  
  141. #endif /* FILES_FILES_H */
  142.  
  143.