home *** CD-ROM | disk | FTP | other *** search
/ RISC DISC 2 / RISC_DISC_2.iso / pd_share / utilities / cli / pgp2 / src / h / ztailor < prev    next >
Encoding:
Text File  |  1995-06-06  |  3.9 KB  |  184 lines

  1. /* tailor.h -- Not copyrighted 1991 Mark Adler */
  2.  
  3. /* Use prototypes and ANSI libraries if __STDC__ */
  4. #ifdef __STDC__
  5. #  ifndef PROTO
  6. #    define PROTO
  7. #  endif /* !PROTO */
  8. #  define MODERN
  9. #endif /* __STDC__ */
  10.  
  11.  
  12. /* Use prototypes and ANSI libraries */
  13. #if defined(sgi) || defined(mips)
  14. #  ifndef PROTO
  15. #    define PROTO
  16. #  endif /* !PROTO */
  17. #  define MODERN
  18. #endif /* sgi */
  19.  
  20.  
  21. /* Define MSDOS for Turbo C as well as Microsoft C */
  22. #ifdef __POWERC                 /* For Power C too */
  23. #  define __TURBOC__
  24. #endif /* __POWERC */
  25.  
  26.  
  27. /* Use prototypes and ANSI libraries if Microsoft or Borland C */
  28. #ifdef MSDOS
  29. #  ifndef PROTO
  30. #    define PROTO
  31. #  endif /* !PROTO */
  32. #  define MODERN
  33. #endif /* MSDOS */
  34.  
  35.  
  36. /* Turn off prototypes if requested */
  37. #ifdef NOPROTO
  38. #  ifdef PROTO
  39. #    undef PROTO
  40. #  endif /* PROTO */
  41. #endif /* NOPROT */
  42.  
  43.  
  44. /* Used to remove arguments in function prototypes for non-ANSI C */
  45. #ifdef PROTO
  46. #  define OF(a) a
  47. #else /* !PROTO */
  48. #  define OF(a) ()
  49. #endif /* ?PROTO */
  50.  
  51.  
  52. /* Allow far and huge allocation for small model (Microsoft C or Turbo C) */
  53. /* unless NOFAR defined (needed for ANSI mode compilations) */
  54. /* But if we're using DJGPP, and want to use the optimized 386 assembler  */
  55. /* zmatch routines, we can't use DYN_ALLOC. But gcc has virtual memory... */
  56. #ifdef MSDOS
  57. #  ifndef __GNUC__
  58. #    ifndef DYN_ALLOC
  59. #      define DYN_ALLOC
  60. #    endif
  61. #  endif
  62. #  ifdef __TURBOC__
  63. #    include <alloc.h>
  64. #    define fcalloc   calloc  /* Assumes that all arrays are < 64K for MSDOS */
  65. #    define fcfree    free
  66. #  else /* !__TURBOC__ */
  67. #    ifndef __GNUC__
  68. #     include <malloc.h>
  69. #     define farmalloc _fmalloc
  70. #     define farfree   _ffree
  71. #     define fcalloc(nitems,itemsize) halloc((long)(nitems),(itemsize))
  72. #     define fcfree hfree
  73. #    endif /* __GNUC__ */
  74. #  endif /* ?__TURBOC__ */
  75. #  ifdef NOFAR
  76. #  define huge
  77. #  define far
  78. #  define near
  79. #  endif
  80. #else /* !MSDOS */
  81. #  ifdef __QNX__
  82. #  undef huge
  83. #  undef far
  84. #  undef near
  85. #  undef farmalloc
  86. #  undef farfree
  87. #  undef fcalloc
  88. #  endif /* __QNX__ */
  89. #  define huge
  90. #  define far
  91. #  define near
  92. #  define farmalloc malloc
  93. #  define farfree   free
  94. #  define fcalloc   calloc
  95. #  define fcfree    free
  96. #endif /* ?MSDOS */
  97. #ifdef __GNUC__
  98. #  ifdef MSDOS /* MSDOS GNU C == DJGPP */
  99. #    define huge
  100. #    define far
  101. #    define near
  102. #    define farmalloc malloc
  103. #    define farfree   free
  104. #    define fcalloc   calloc
  105. #    define fcfree    free
  106. #  endif /* MSDOS */
  107. #endif /* __GNUC__ */
  108.  
  109. /* Define MSVMS if either MSDOS or VMS defined */
  110. #ifdef MSDOS
  111. #  define MSVMS
  112. #else /* !MSDOS */
  113. #  ifdef VMS
  114. #    define MSVMS
  115. #  endif /* VMS */
  116. #endif /* ?MSDOS */
  117.  
  118.  
  119. #include <stdio.h>
  120. #include <stdlib.h>
  121. typedef unsigned int extent;
  122.  
  123. /* Get types and stat */
  124. #ifdef VMS
  125. #  include <types.h>
  126. #  include <stat.h>
  127. #else /* !VMS */
  128. #ifndef RISC_OS
  129. /* We don't have these -- GJM */
  130. #  include <sys/types.h>
  131. #  include <sys/stat.h>
  132. #endif
  133. #endif /* ?VMS */
  134.  
  135.  
  136. /* Cheap fix for unlink on VMS */
  137. #ifdef VMS
  138. #  define unlink delete
  139. #endif /* VMS */
  140.  
  141.  
  142. /* For Pyramid */
  143. #ifdef pyr
  144. #  define strrchr rindex
  145. #endif /* pyr */
  146.  
  147.  
  148. /* File operations--use "b" for binary if allowed */
  149. #ifdef MODERN
  150. #  define FOPR "rb"
  151. #  define FOPM "r+b"
  152. #  define FOPW "w+b"
  153. #else /* !MODERN */
  154. #  define FOPR "r"
  155. #  define FOPM "r+"
  156. #  define FOPW "w+"
  157. #endif /* ?MODERN */
  158.  
  159.  
  160. /* Define this symbol if your target allows access to unaligned data.
  161.  * This is not mandatory, just a speed optimization. The compressed
  162.  * output is strictly identical.
  163.  */
  164. #if defined(MSDOS) || defined(M_XENIX) || defined(i386) || defined(mc68020) || defined(vax)
  165. #   define UNALIGNED_OK
  166. #endif
  167.  
  168.  
  169. /* Under MSDOS we may run out of memory when processing a large number
  170.  * of files. Compile with MEDIUM_MEM to reduce the memory requirements or
  171.  * with MIN_MEM to use as little memory as possible.
  172.  */
  173. #ifdef SMALL_MEM
  174. #   define BSZ 2048   /* Buffer size for files */
  175. #else
  176. #ifdef MEDIUM_MEM
  177. #   define BSZ 8192
  178. #else
  179. #   define BSZ 16384
  180. #endif
  181. #endif
  182.  
  183. /* end of tailor.h */
  184.