home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / warptlk3.zip / TOOLKIT / H / EXE.H < prev    next >
C/C++ Source or Header  |  1995-08-30  |  3KB  |  91 lines

  1. /*static char *SCCSID = "@(#)exe.h    6.3 92/03/15";*/
  2. /*static char *SCCSID = "@(#)exe.h    6.3 92/03/15";*/
  3. /****************************** Module Header ******************************\
  4. *                                                                          *
  5. * Copyright (c) 1987  - 1992 IBM Corporation                               *
  6. *                                                                          *
  7. * Module Name: EXE.H                                                       *
  8. *                                                                          *
  9. * EXE header format.                                                       *
  10. *                                                                          *
  11. \***************************************************************************/
  12.  
  13. #if __IBMC__ || __IBMCPP__
  14. #pragma info( none )
  15.    #ifndef __CHKHDR__
  16.       #pragma info( none )
  17.    #endif
  18. #pragma info( restore )
  19. #endif
  20. #ifdef __cplusplus
  21.       extern "C" {
  22. #endif
  23.  
  24. #ifndef __EXE__
  25. #define __EXE__
  26.  
  27. #ifndef BYTE
  28. #ifdef __cplusplus
  29. typedef char BYTE;
  30. #else
  31. typedef unsigned char BYTE;
  32. #endif
  33. #endif
  34.  
  35. #ifndef WORD
  36. typedef unsigned short WORD;
  37. #endif
  38.  
  39. typedef WORD bbmask;
  40.  
  41. struct exe {
  42.         WORD eid;                       /* contains EXEID, below */
  43.         WORD elast;                     /* # of bytes in last page */
  44.         WORD epagsiz;                   /* # of pages in whole file */
  45.         WORD erelcnt;                   /* # of relocation entrys */
  46.         WORD ehdrsiz;                   /* size of header, in paragraphs */
  47.         WORD eminfre;                   /* min # of free paragraphs needed */
  48.         WORD emaxfre;                   /* max # of free paragraphs needed */
  49.         WORD eiSS;                      /* initial SS value */
  50.         WORD eiSP;                      /* initial SP value */
  51.         WORD enegsum;                   /* negative sum of entire file */
  52.         WORD eiIP;                      /* initial IP value */
  53.         WORD eiCS;                      /* initial CS value */
  54.         WORD ereloff;                   /* offset in file of relocation table */
  55.         WORD eovlnum;                   /* number of the overlay */
  56.  
  57. /*      the following fields may not be present.
  58.  *              ereloff = 28            not present
  59.  *                      = 30            exe.ever present and valid
  60.  *                      = 32            exe.ever field contains garbage
  61.  *              ereloff > 32            exe.ever present and valid
  62.  *                                              = 0 if "don't know"
  63.  */
  64.  
  65.         WORD ever;                      /* version # of producing linker */
  66.         WORD dumy;                      /* unused */
  67.  
  68. /*      the following fields may not be present - if the exe.ereloff
  69.  *      value encompasses the fields then they are present and valid.
  70.  */
  71.  
  72.         bbmask  ebb;                    /* behavior bits */
  73.         WORD dumy2[7];                  /* must be 0 until defined */
  74. };
  75.  
  76.  
  77. #define EXEID 0x5a4d                    /* magic ID value */
  78.  
  79. #endif /* __EXE__ */
  80.  
  81. #ifdef __cplusplus
  82.         }
  83. #endif
  84. #if __IBMC__ || __IBMCPP__
  85. #pragma info( none )
  86.    #ifndef __CHKHDR__
  87.       #pragma info( restore )
  88.    #endif
  89. #pragma info( restore )
  90. #endif
  91.