home *** CD-ROM | disk | FTP | other *** search
/ RISC DISC 2 / RISC_DISC_2.iso / pd_share / program / language / as / source / h / ChunkFile < prev    next >
Encoding:
Text File  |  1992-07-20  |  2.0 KB  |  63 lines

  1. /* 
  2.  * H.ChunkFile - Definitions for Arm Chunk files 
  3.  * Borrowed from Gustav (pmoore@cix.compulink.co.uk) C utilities
  4.  */
  5.  
  6. #ifndef __chunkfile_h
  7. #define __chunkfile_h
  8.  
  9. /* Format of a chunk file header - first few bytes of a chunk file */
  10.  
  11. typedef struct {
  12.         unsigned ChunkIDPrefix;
  13.         unsigned ChunkIDType;
  14.         unsigned FileOffset;
  15.         unsigned Size;
  16. }  ChunkFileHeaderEntry;
  17.  
  18. typedef struct {             
  19.         unsigned ChunkField;
  20.         unsigned maxChunks;
  21.         unsigned noChunks;
  22.         ChunkFileHeaderEntry entry[1];  /* E.g. entry[maxCunks] */
  23. }ChunkFileHeader;
  24.  
  25. #define ChunkFileID (0xC3CBC6C5)
  26. #define ChunkID_LIB (0x5F42494C)        /* (unsigned)('LIB_') */
  27. #define ChunkID_OFL (0x5F4C464F)        /* (unsigned)('OFL_') */
  28. #define ChunkID_OBJ (0x5F4A424F)        /* (unsigned)('OBJ_') */
  29. #define ChunkID_LIB_DIRY (0x59524944)   /* (unsigned)('DIRY') */
  30. #define ChunkID_LIB_TIME (0x454D4954)   /* (unsigned)('TIME') */
  31. #define ChunkID_LIB_VRSN (0x4E535256)   /* (unsigned)('VRSN') */
  32. #define ChunkID_LIB_DATA (0x41544144)   /* (unsigned)('DATA') */
  33. #define ChunkID_OFL_SYMT (0x544D5953)   /* (unsigned)('SYMT') */
  34. #define ChunkID_OFL_TIME (0x454D4954)   /* (unsigned)('TIME') */
  35. #define ChunkID_OBJ_HEAD (0x44414548)   /* (unsigned)('HEAD') */
  36. #define ChunkID_OBJ_AREA (0x41455241)   /* (unsigned)('AREA') */
  37. #define ChunkID_OBJ_IDFN (0x4E464449)   /* (unsigned)('IDFN') */
  38. #define ChunkID_OBJ_SYMT (0x544D5953)   /* (unsigned)('SYMT') */
  39. #define ChunkID_OBJ_STRT (0x54525453)   /* (unsigned)('STRT') */
  40.  
  41. #define chunkFileHeaderSize(max) \
  42.         (sizeof (ChunkFileHeader) + \
  43.         (max - 1) * sizeof (ChunkFileHeaderEntry))
  44.  
  45. typedef struct
  46. {
  47.         unsigned ChunkIndex;
  48.         unsigned EntryLength;
  49.         unsigned DataLength;
  50.         char LibData[1];
  51. } LibDirectoryEntry;
  52.  
  53. #define Lib_DataName(ptr) (char *)((ptr)->LibData)
  54. #define Lib_DataTime(ptr) ((struct lib_TimeStamp *)((ptr)->LibData + \
  55.                           ( (strlen((ptr)->LibData)+4) & ~0x03 ) ) )
  56.  
  57. typedef struct 
  58. {
  59.         char t[8];
  60. } LibTimeStamp;
  61.  
  62. #endif
  63.