home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / dosdisas.zip / dccsrcoo.zip / types.h < prev    next >
C/C++ Source or Header  |  1997-04-09  |  2KB  |  55 lines

  1. /**** Common definitions and macros ****/
  2. #ifdef __MSDOS__            /* Intel: 16 bit integer        */
  3. typedef long    Int;        /* Int: 0x80000000..0x7FFFFFFF  */
  4. typedef unsigned long flags32;  /* 32 bits  */
  5. typedef unsigned long dword;    /* 32 bits  */
  6. #define MAX 0x7FFFFFFF
  7. #else                       /* Unix: 32 bit integer         */
  8. typedef int Int;            /* Int: 0x80000000..0x7FFFFFFF  */
  9. typedef unsigned int flags32;  /* 32 bits  */
  10. typedef unsigned int dword;    /* 32 bits  */
  11. #define MAX 0x7FFFFFFF
  12. #endif
  13.  
  14. /* Type definitions used in the program */
  15. typedef unsigned char byte; /* 8 bits   */ 
  16. typedef unsigned short word;/* 16 bits  */
  17. typedef short int16;        /* 16 bits  */
  18. typedef unsigned char boolT; /* 8 bits   */
  19.  
  20. #if defined(__MSDOS__) | defined(WIN32)
  21. #define unlink _unlink        // Compiler is picky about non Ansi names
  22. #endif
  23.  
  24.  
  25. #define TRUE    1
  26. #define FALSE   0
  27.  
  28. #define SYNTHESIZED_MIN 0x100000    /* Synthesized labs use bits 21..32 */
  29.  
  30. /* These are for C library signature detection */
  31. #define SYMLEN  16                  /* Length of proc symbols, incl null */
  32. #define PATLEN  23                  /* Length of proc patterns  */
  33. #define WILD    0xF4                /* The wild byte            */
  34.  
  35. /****** MACROS *******/
  36.  
  37. /* Macro to allocate a node of size sizeof(structType). */
  38. #define allocStruc(structType)  (structType *)allocMem(sizeof(structType))
  39.  
  40. /* Macro reads a LH word from the image regardless of host convention */
  41. /* Returns a 16 bit quantity, e.g. C000 is read into an Int as C000 */
  42. //#define LH(p)  ((int16)((byte *)(p))[0] + ((int16)((byte *)(p))[1] << 8))
  43. #define LH(p)    ((word)((byte *)(p))[0]  + ((word)((byte *)(p))[1] << 8))
  44.  
  45. /* Macro reads a LH word from the image regardless of host convention */
  46. /* Returns a signed quantity, e.g. C000 is read into an Int as FFFFC000 */
  47. #define LHS(p) (((byte *)(p))[0] + (((char *)(p))[1] << 8))
  48.  
  49. /* Macro tests bit b for type t in prog.map */
  50. #define BITMAP(b, t)  (prog.map[(b) >> 2] & ((t) << (((b) & 3) << 1)))
  51.  
  52. /* Macro to convert a segment, offset definition into a 20 bit address */
  53. #define opAdr(seg,off)  ((seg << 4) + off)
  54.  
  55.