home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Tools / Languages / GCC 1.37.1r14 / usr / gcc-1.37.1r14 / object oriented files / CDRVRArray.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-11-03  |  1.5 KB  |  58 lines  |  [TEXT/KAHL]

  1. #pragma once
  2.  
  3. #include "CArray.h"
  4. #include <size_t.h>
  5. #define    N_UNDF    0x00        /* undefined */
  6. #define    N_ABS    0x02        /* absolute address */
  7. #define    N_TEXT    0x04        /* text segment */
  8. #define    N_DATA    0x06        /* data segment */
  9. #define    N_BSS    0x08        /* bss segment */
  10. #define    N_COMM    0x12        /* common reference */
  11. #define    N_FN    0x1e        /* file name */
  12.  
  13. #define    N_EXT    0x01        /* external (global) bit, OR'ed in */
  14. #define    N_TYPE    0x1e        /* mask for all the type bits */
  15.  
  16. struct exec 
  17.     {
  18.     unsigned short    a_mid;        /* machine ID */
  19.     unsigned short    a_magic;    /* magic number */
  20.     unsigned long    a_text;        /* text segment size */
  21.     unsigned long    a_data;        /* initialized data size */
  22.     unsigned long    a_bss;        /* uninitialized data size */
  23.     unsigned long    a_syms;        /* symbol table size */
  24.     unsigned long    a_entry;    /* entry point */
  25.     unsigned long    a_trsize;    /* text relocation size */
  26.     unsigned long    a_drsize;    /* data relocation size */
  27.     };
  28.  
  29. struct nlist 
  30.     {
  31.     union {
  32.         char *n_name;    /* symbol name (in memory) */
  33.         long n_strx;    /* file string table offset (on disk) */
  34.             }
  35.     n_un;
  36.     unsigned char n_type;    /* type defines */
  37.     char n_other;        /* spare */
  38.     short n_desc;        /* used by stab entries */
  39.     unsigned long n_value;    /* address/value of the symbol */
  40.     };
  41.  
  42. class CDRVRArray : public CArray
  43. {
  44. public:
  45.     virtual void IResHandle( Handle itsData);
  46.     virtual void Sort( Boolean);
  47.     
  48.     struct exec *execp;
  49.  
  50. protected:
  51.  
  52.     static Boolean            cCompNumerically;
  53.     static CDRVRArray        *cCurrArray;
  54.  
  55.     static void swap( size_t i, size_t j);
  56.     static int CompareStrings( size_t index1, size_t index2);
  57. };
  58.