home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / misc / volume36 / unpost / part06 / compiler.h next >
Encoding:
C/C++ Source or Header  |  1993-04-18  |  4.5 KB  |  160 lines

  1. /******************************************************************************
  2. * Module    :   Compiler include files, separated out to make configuration
  3. *               different systems a little easier (I hate this, I really
  4. *               hate this, but it has been requested, so here it is).
  5. *
  6. * Author    :   John W. M. Stevens
  7. ******************************************************************************/
  8.  
  9. #include    <stdio.h>
  10. #include    <stdlib.h>
  11. #include    <ctype.h>
  12. #include    <errno.h>
  13. #include    <string.h>
  14.  
  15. /*=============================================================================
  16. *   Configure the program. . .
  17. *
  18. *   WARNING!  Be sure what you are doing here. . .
  19. =============================================================================*/
  20.  
  21. /*  Debug macro.  Uncomment to get debug output.    */
  22. /*  #define UNPOST_DEBUG    1   */
  23.  
  24. /*  Uncomment to give you different file name munging under OS/2
  25. *   on the basis of the File System.
  26. *
  27. *   Suggestions and help courtesy of:
  28. *
  29. *   Darrel R Hankerson <hankedr@mail.auburn.edu>
  30. *
  31. *   Without whose help and discussion, this would not have been done.
  32. *   In other words, blame it all on him. . . :-)
  33. */
  34. /*  #define     MUNGE_FILE_NAMES_PER_FS     1   */
  35.  
  36. /*  Change the one to a zero to make file name mungling default to
  37. *   being off.
  38. */
  39. #define     MUNGE_FILE_NMS      1
  40.  
  41. /*  Change the one to a zero to make description file dumping
  42. *   default to being off.
  43. */
  44. #define     DUMP_DESC_FILES     1
  45.  
  46. /*  Change zero to one to make incompletes separation be turned on
  47. *   by default.
  48. */
  49. #define     SEP_INCOMPLETES     0
  50.  
  51. /*-----------------------------------------------------------------------------
  52. *   Compiler specific stuff below.
  53. *
  54. *   The first set is for the Lattice C compiler on the Amiga.
  55. -----------------------------------------------------------------------------*/
  56. #if     defined(LATTICE_C_COMPILER)
  57.  
  58. /*  Defines for fopen calls.    */
  59. #define     TXT_APPEND  "at"
  60. #define     TXT_READ    "rt"
  61. #define     BIN_READ    "rb"
  62. #define     TXT_WRITE   "wt"
  63. #define     BIN_WRITE   "wb"
  64.  
  65. #define     SEEK_SET    0
  66.  
  67. /*-----------------------------------------------------------------------------
  68. *   This set is for the GCC compiler on Unix systems.
  69. -----------------------------------------------------------------------------*/
  70. #elif   defined(GCC_COMPILER)
  71.  
  72. /*  Defines for fopen calls.    */
  73. #define     TXT_APPEND  "at"
  74. #define     TXT_READ    "rt"
  75. #define     BIN_READ    "rb"
  76. #define     TXT_WRITE   "wt"
  77. #define     BIN_WRITE   "wb"
  78.  
  79. #include    <malloc.h>
  80. #include    <unistd.h>
  81.  
  82. extern  char    *sys_errlist[];
  83.  
  84. /*-----------------------------------------------------------------------------
  85. *   The GCC compiler on OS/2.
  86. -----------------------------------------------------------------------------*/
  87. #elif   defined(EMX_GCC_COMPILER)
  88.  
  89. /*  Defines for fopen calls.    */
  90. #define     TXT_APPEND  "at"
  91. #define     TXT_READ    "rt"
  92. #define     BIN_READ    "rb"
  93. #define     TXT_WRITE   "wt"
  94. #define     BIN_WRITE   "wb"
  95.  
  96. #include    <sys/types.h>
  97. #include    <sys/stat.h>
  98.  
  99. #if defined(SYSTEM_OS_2)
  100. #define INCL_DOSFILEMGR
  101. #include    <os2.h>
  102. #else
  103. #include    <dos.h>
  104. #endif
  105.  
  106. #include    <malloc.h>
  107. #include    <unistd.h>
  108.  
  109. /*-----------------------------------------------------------------------------
  110. *   The MSC compiler on OS/2.
  111. -----------------------------------------------------------------------------*/
  112. #elif   defined(OS_2_MSC_COMPILER)
  113.  
  114. /*  Defines for fopen calls.    */
  115. #define     TXT_APPEND  "at"
  116. #define     TXT_READ    "rt"
  117. #define     BIN_READ    "rb"
  118. #define     TXT_WRITE   "wt"
  119. #define     BIN_WRITE   "wb"
  120.  
  121. #include    <sys/types.h>
  122. #include    <sys/stat.h>
  123.  
  124. #if defined(SYSTEM_OS_2)
  125. #define INCL_DOSFILEMGR
  126. #include    <os2.h>
  127. #else
  128. #include    <dos.h>
  129. #endif
  130.  
  131. /*-----------------------------------------------------------------------------
  132. *   The BCC compiler on MS-DOS.
  133. -----------------------------------------------------------------------------*/
  134. #elif   defined(BCC_COMPILER)
  135.  
  136. /*  Defines for fopen calls.    */
  137. #define     TXT_APPEND  "at"
  138. #define     TXT_READ    "rt"
  139. #define     BIN_READ    "rb"
  140. #define     TXT_WRITE   "wt"
  141. #define     BIN_WRITE   "wb"
  142.  
  143. #include    <malloc.h>
  144.  
  145. /*-----------------------------------------------------------------------------
  146. *   All others (Non-ANSI compatible).
  147. -----------------------------------------------------------------------------*/
  148. #else
  149.  
  150. /*  Defines for fopen calls.    */
  151. #define     TXT_APPEND  "a"
  152. #define     TXT_READ    "r"
  153. #define     BIN_READ    "r"
  154. #define     TXT_WRITE   "w"
  155. #define     BIN_WRITE   "w"
  156.  
  157. #include    <malloc.h>
  158.  
  159. #endif
  160.