home *** CD-ROM | disk | FTP | other *** search
/ Mac Power 1999 February / MACPOWER-1999-02.ISO.7z / MACPOWER-1999-02.ISO / 9902⁄AMUG / UTILITY / mac06-0.95.sit / mac06-0.95 / usr / include / coff / syms.h < prev    next >
Text File  |  1997-11-01  |  3KB  |  155 lines

  1. /* mac06ゥ1997 by HNS/DSITRI hns@computer.org
  2. ** syms.h
  3. */
  4.  
  5. #ifdef __SC__    /* Symantec C++ for PowerPC 8.0 */
  6. #pragma options align=mac68k
  7. #endif
  8.  
  9. #define SYMNMLEN    8
  10.  
  11. struct syment
  12.     {
  13.     union
  14.         {
  15.         char _n_name[SYMNMLEN];        /* symbol name or */
  16.         struct
  17.             {
  18.             long    _n_zeroes;        /* if n_name[0..3] == 0 */
  19.             long    _n_offset;        /* then offset into string table */
  20.             } _n_n;
  21.         char *_n_nptr[2];            /* offset as pointer */
  22.         } _n;                        /* symbol name */
  23.     long                n_value;    /* the symbol's value */
  24.     short                n_scnum;    /* section number */
  25.     unsigned short    n_type;        /* type and derived type */
  26.     char                n_sclass;    /* storage class */
  27.     char                n_numaux;    /* number of aux entries */
  28.     };
  29.     
  30. #define n_name        _n._n_name
  31. #define n_nptr        _n._nptr[1]
  32. #define n_zeroes    _n._n_n._n_zeroes
  33. #define n_offset    _n._n_n._n_offset
  34.  
  35. enum sym_n_scnum
  36.     {
  37.     N_DEBUG = -2,
  38.     N_ABS = -1,
  39.     N_UNDEF = 0,
  40.     N_SCNUM = 1
  41.     };
  42.  
  43. enum sym_n_type
  44.     {
  45.     T_NULL = 0,
  46.     T_VOID = 1,
  47.     T_CHAR = 2,
  48.     T_SHORT = 3,
  49.     T_INT = 4,
  50.     T_LONG = 5,
  51.     T_FLOAT = 6,
  52.     T_DOUBLE = 7,
  53.     T_STRUCT = 8,
  54.     T_UNION = 9,
  55.     T_ENUM = 10,
  56.     T_MOE = 11,
  57.     T_UCHAR = 12,
  58.     T_USHORT = 13,
  59.     T_UINT = 14,
  60.     T_ULONG = 15
  61.     };
  62.  
  63. enum sym_n_type_derived
  64.     {
  65.     DT_NON = 0,
  66.     DT_PTR = 1,
  67.     DT_FCN = 2,
  68.     DT_ARY = 3
  69.     };
  70.  
  71. #define ISNON(X) (((X)&3) == DT_NON)
  72. #define ISFCN(X) (((X)&3) == DT_FCN)
  73. #define ISPTR(X) (((X)&3) == DT_PTR)
  74. #define ISARY(X) (((X)&3) == DT_ARY)
  75.  
  76. enum sym_n_class
  77.     {
  78.     C_NULL = 0,
  79.     C_STAT = 1,
  80.     C_EXT = 2,
  81.     C_AUTO = 3,
  82.     C_FILE = 0x67,
  83.     C_SECTION,
  84.     C_STRTAG,
  85.     C_EOS,
  86.     C_FCN,
  87.     C_EFCN,
  88.     C_MOU,
  89.     C_UNTAG,
  90.     C_TYPDEF,
  91.     C_ENTAG,
  92.     C_MOE,
  93.     C_REGPARAM,
  94.     C_FIELD,
  95.     C_BLOCK,
  96.     C_REG,
  97.     C_LABEL,
  98.     C_MOS,
  99.     C_ARG
  100.     };
  101.  
  102. #define SYMENT    struct syment
  103. #define SYMSZ    sizeof(SYMENT)
  104.  
  105. union auxent
  106.     {
  107.     char bytes[SYMSZ];
  108.     char filename[14];    /* .file */
  109.     struct
  110.         {
  111.         long length;
  112.         long nreloc;
  113.         short nline;
  114.         } section;        /* .bss, .text, .data */
  115.     struct
  116.         {
  117.         long tagndx;    /* tag index */
  118.         long size;        /* size of struct/union/enum */
  119.         } tagdef;        /* tagname, .eos, array, .bb, .bf */
  120.     struct
  121.         {
  122.         unsigned short size;        /* size of struct/union/enum */
  123.         long endndx;    /* index to next structore, union ... */
  124.         } tagdecl;        /* tagname, .eos, array, .bb, .bf */
  125.     struct
  126.         {
  127.         long tagndx;    /* tag index */
  128.         unsigned short size;        /* size of struct/union/enum */
  129.         } eos;        /* tagname, .eos, array, .bb, .bf */
  130.     struct
  131.         {
  132.         long tagndx;
  133.         long fsize;
  134.         long lnnoptr;
  135.         long endndx;
  136.         } function;
  137.     struct
  138.         {
  139.         unsigned short lnno;
  140.         long endndx;
  141.         } bf;
  142.     struct
  143.         {
  144.         unsigned short lnno;
  145.         } ef;
  146.     };
  147.  
  148. #define AUXENT    union auxent
  149. #define AUXESZ    sizeof(AUXENT)    /* should be == SYMSZ */
  150.  
  151. #ifdef __SC__    /* Symantec C++ for PowerPC 8.0 */
  152. #pragma options align=reset
  153. #endif
  154.  
  155. /* EOF */