home *** CD-ROM | disk | FTP | other *** search
/ Aminet 18 / aminetcdnumber181997.iso / Aminet / misc / emu / AROSdev.lha / AROS / compiler / aros / include / structdesc.h < prev    next >
Encoding:
C/C++ Source or Header  |  1997-02-07  |  2.4 KB  |  69 lines

  1. #ifndef AROS_STRUCTDESC_H
  2. #define AROS_STRUCTDESC_H
  3. /*
  4.     (C) 1995-96 AROS - The Amiga Replacement OS
  5.     $Id: structdesc.h,v 1.1 1997/01/09 18:21:17 digulla Exp $
  6.  
  7.     Desc: Read and write big endian structures from and to a file
  8.     Lang: english
  9. */
  10. #ifndef EXEC_TYPES_H
  11. #   include <exec/types.h>
  12. #endif
  13. #ifndef DOS_DOS_H
  14. #   include <dos/dos.h>
  15. #endif
  16. #ifndef UTILITY_HOOKS_H
  17. #   include <utility/hooks.h>
  18. #endif
  19. #include <stddef.h>
  20.  
  21. #define SDT_END     0 /* Read one  8bit byte */
  22. #define SDT_UBYTE    1 /* Read one  8bit byte */
  23. #define SDT_UWORD    2 /* Read one 16bit word */
  24. #define SDT_ULONG    3 /* Read one 32bit long */
  25. #define SDT_FLOAT    4 /* Read one 32bit IEEE */
  26. #define SDT_DOUBLE    5 /* Read one 64bit IEEE */
  27. #define SDT_STRING    6 /* Read a string */
  28. #define SDT_STRUCT    7 /* Read a structure */
  29. #define SDT_PTR     8 /* Follow a pointer */
  30. #define SDT_IGNORE    9 /* Ignore x bytes */
  31. #define SDT_FILL_BYTE  10 /* Fill x bytes */
  32. #define SDT_FILL_LONG  11 /* Fill x longs */
  33. #define SDT_IFILL_BYTE 12 /* Ignore and fill x bytes */
  34. #define SDT_IFILL_LONG 13 /* Ignore and fill x longs */
  35. #define SDT_SPECIAL    14 /* Call user routine */
  36.  
  37. struct SDData
  38. {
  39.     APTR sdd_Dest;
  40.     WORD sdd_Mode;
  41. };
  42.  
  43. #define SDV_SPECIALMODE_READ    0  /* Function was called to read from file */
  44. #define SDV_SPECIALMODE_WRITE    1  /* Function was called to write to file */
  45. #define SDV_SPECIALMODE_FREE    2  /* Function was called to free memory */
  46.  
  47. #define SDM_END             SDT_END
  48. #define SDM_UBYTE(offset)               SDT_UBYTE, offset
  49. #define SDM_UWORD(offset)               SDT_UWORD, offset
  50. #define SDM_ULONG(offset)               SDT_ULONG, offset
  51. #define SDM_FLOAT(offset)               SDT_FLOAT, offset
  52. #define SDM_DOUBLE(offset)              SDT_DOUBLE, offset
  53. #define SDM_STRING(offset)              SDT_STRING, offset
  54. #define SDM_STRUCT(offset,sd)           SDT_STRUCT, offset, ((IPTR)sd)
  55. #define SDM_PTR(offset,sd)              SDT_PTR, offset, ((IPTR)sd)
  56. #define SDM_IGNORE(n)                   SDT_IGNORE, n
  57. #define SDM_FILL_BYTE(offset,v,n)       SDT_FILL_BYTE, offset, v, n
  58. #define SDM_FILL_LONG(offset,v,n)       SDT_FILL_LONG, offset, v, n
  59. #define SDM_IFILL_BYTE(offset,v,n)      SDT_FILL_BYTE, offset, v, n
  60. #define SDM_IFILL_LONG(offset,v,n)      SDT_FILL_LONG, offset, v, n
  61. #define SDM_SPECIAL(offset,sdhook)      SDT_SPECIAL, offset, ((IPTR)sdhook)
  62.  
  63. #define SDM_BYTE    SDM_UBYTE
  64. #define SDM_WORD    SDM_UWORD
  65. #define SDM_LONG    SDM_ULONG
  66.  
  67. #endif /* AROS_STRUCTDESC_H */
  68.  
  69.