home *** CD-ROM | disk | FTP | other *** search
/ Meeting Pearls 1 / Meeting Pearls Vol 1 (1994).iso / installed_progs / linux / tools / amiga / gzip-1.1.2.lha / gzip-1.1.2 / tailor.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-06-04  |  5.9 KB  |  272 lines

  1. /* tailor.h -- target dependent definitions
  2.  * Copyright (C) 1992-1993 Jean-loup Gailly.
  3.  * This is free software; you can redistribute it and/or modify it under the
  4.  * terms of the GNU General Public License, see the file COPYING.
  5.  */
  6.  
  7. /* The target dependent definitions should be defined here only.
  8.  * The target dependent functions should be defined in tailor.c.
  9.  */
  10.  
  11. /* $Id: tailor.h,v 0.16 1993/06/01 12:46:03 jloup Exp $ */
  12.  
  13. #if defined(__MSDOS__) && !defined(MSDOS)
  14. #  define MSDOS
  15. #endif
  16.  
  17. #if defined(OS2) && defined(MSDOS) /* MS C under OS/2 */
  18. #  undef MSDOS
  19. #endif
  20.  
  21. #ifdef MSDOS
  22. #  ifdef __GNUC__
  23.      /* DJGPP version 1.09+ on MS-DOS.
  24.       * The DJGPP 1.09 stat() function must be upgraded before gzip will
  25.       * fully work.
  26.       * No need for DIRENT, since <unistd.h> defines POSIX_SOURCE which
  27.       * implies DIRENT.
  28.       */
  29. #    define near
  30. #  else
  31. #    define MAXSEG_64K
  32. #    ifdef __TURBOC__
  33. #      define NO_UTIME
  34. #    else /* MSC */
  35. #      define HAVE_SYS_UTIME_H
  36. #      define NO_UTIME_H
  37. #    endif
  38. #  endif
  39. #  define PATH_SEP2 '\\'
  40. #  define PATH_SEP3 ':'
  41. #  define MAX_PATH_LEN  128
  42. #  define NO_MULTIPLE_DOTS
  43. #  define MAX_EXT_CHARS 3
  44. #  define Z_SUFFIX "z"
  45. #  define NO_CHOWN
  46. #  define PROTO
  47. #  define STDC_HEADERS
  48. #  define NO_SIZE_CHECK
  49. #  define casemap(c) tolow(c) /* Force file names to lower case */
  50. #  include <io.h>
  51. #  define OS_CODE  0x00
  52. #  define SET_BINARY_MODE(fd) setmode(fd, O_BINARY)
  53. #  if !defined(NO_ASM) && !defined(ASMV)
  54. #    define ASMV
  55. #  endif
  56. #else
  57. #  define near
  58. #endif
  59.  
  60. #ifdef OS2
  61. #  define PATH_SEP2 '\\'
  62. #  define PATH_SEP3 ':'
  63. #  define MAX_PATH_LEN  260
  64. #  ifdef OS2FAT
  65. #    define NO_MULTIPLE_DOTS
  66. #    define MAX_EXT_CHARS 3
  67. #    define Z_SUFFIX "z"
  68. #  endif
  69. #  define NO_CHOWN
  70. #  define PROTO
  71. #  define STDC_HEADERS
  72. #  define HAVE_SYS_UTIME_H
  73. #  define NO_UTIME_H
  74. #  define casemap(c) tolow(c)
  75. #  include <io.h>
  76. #  define OS_CODE  0x06
  77. #  define SET_BINARY_MODE(fd) setmode(fd, O_BINARY)
  78. #  ifdef _MSC_VER
  79. #    define MAXSEG_64K
  80. #    undef near
  81. #    define near _near
  82. #  endif
  83. #  ifdef __EMX__
  84. #    define DIRENT
  85. #    define EXPAND(argc,argv) \
  86.        {_response(&argc, &argv); _wildcard(&argc, &argv);}
  87. #  endif
  88. #endif
  89.  
  90. #ifdef MSDOS
  91. #  ifdef __TURBOC__
  92. #    include <alloc.h>
  93. #    define DYN_ALLOC
  94.      /* Turbo C 2.0 does not accept static allocations of large arrays */
  95.      void * fcalloc (unsigned items, unsigned size);
  96.      void fcfree (void *ptr);
  97. #  else /* MSC */
  98. #    include <malloc.h>
  99. #    define fcalloc(nitems,itemsize) halloc((long)(nitems),(itemsize))
  100. #    define fcfree(ptr) hfree(ptr)
  101. #  endif
  102. #else
  103. #  ifdef MAXSEG_64K
  104. #    define fcalloc(items,size) calloc((items),(size))
  105. #  else
  106. #    define fcalloc(items,size) malloc((size_t)(items)*(size_t)(size))
  107. #  endif
  108. #  define fcfree(ptr) free(ptr)
  109. #endif
  110.  
  111. #if defined(VAXC) || defined(VMS)
  112. #  define PATH_SEP ']'
  113. #  define PATH_SEP2 ':'
  114. #  define SUFFIX_SEP ';'
  115. #  define NO_MULTIPLE_DOTS
  116. #  define Z_SUFFIX "-gz"
  117. #  define RECORD_IO 1
  118. #  define casemap(c) tolow(c)
  119. #  define OS_CODE  0x02
  120. #  define OPTIONS_VAR "GZIP_OPT"
  121. #  define STDC_HEADERS
  122. #  define NO_UTIME
  123. #  define EXPAND(argc,argv) vms_expand_args(&argc,&argv);
  124. #  include <file.h>
  125. #  define unlink delete
  126. #  ifdef VAXC
  127. #    define NO_FCNTL_H
  128. #    include <unixio.h>
  129. #  endif
  130. #endif
  131.  
  132. #ifdef AMIGA
  133. #  define PATH_SEP2 ':'
  134. #  define STDC_HEADERS
  135. #  define casemap(c) tolow(c) /* Force file names to lower case */
  136. #  define OS_CODE  0x01
  137. #  define ASMV
  138. #  ifdef __GNUC__
  139. #    define DIRENT
  140. #    define HAVE_UNISTD_H
  141. #    define RETSIGTYPE int
  142. #  else /* SASC */
  143. #    define NO_STDIN_FSTAT
  144. #    define SYSDIR
  145. #    define NO_SYMLINK
  146. #    define NO_CHOWN
  147. #    define NO_FCNTL_H
  148. #    include <fcntl.h> /* for read() and write() */
  149. #    define direct dirent
  150.      extern void _expand_args(int *argc, char ***argv);
  151. #    define EXPAND(argc,argv) _expand_args(&argc,&argv);
  152. #    undef  O_BINARY /* disable useless --ascii option */
  153. #  endif
  154. #endif
  155.  
  156. #if defined(ATARI) || defined(atarist)
  157. #  ifndef STDC_HEADERS
  158. #    define STDC_HEADERS
  159. #    define HAVE_UNISTD_H
  160. #    define DIRENT
  161. #  endif
  162. #  define ASMV
  163. #  define OS_CODE  0x05
  164. #  ifdef TOSFS
  165. #    define NO_SYMLINK
  166. #    define NO_MULTIPLE_DOTS
  167. #    define MAX_EXT_CHARS 3
  168. #    define Z_SUFFIX "z"
  169. #    define NO_CHOWN
  170. #  endif
  171. #endif
  172.  
  173. #ifdef MACOS
  174. #  define PATH_SEP ':'
  175. #  define DYN_ALLOC
  176. #  define PROTO
  177. #  define NO_STDIN_FSTAT
  178. #  define NO_CHOWN
  179. #  define NO_UTIME
  180. #  define chmod(file, mode) (0)
  181. #  define OPEN(name, flags, mode) open(name, flags)
  182. #  define OS_CODE  0x07
  183. #  ifdef MPW
  184. #    define isatty(fd) ((fd) <= 2)
  185. #  endif
  186. #endif
  187.  
  188. #ifdef __50SERIES /* Prime/PRIMOS */
  189. #  define PATH_SEP '>'
  190. #  define STDC_HEADERS
  191. #  define NO_MEMORY_H
  192. #  define NO_UTIME_H
  193. #  define NO_UTIME
  194. #  define NO_CHOWN 
  195. #  define NO_STDIN_FSTAT 
  196. #  define NO_SIZE_CHECK 
  197. #  define NO_SYMLINK
  198. #  define RECORD_IO  1
  199. #  define casemap(c)  tolow(c) /* Force file names to lower case */
  200. #  define put_char(c) put_byte((c) & 0x7F)
  201. #  define get_char(c) ascii2pascii(get_byte())
  202. #  define OS_CODE  0x0F    /* temporary, subject to change */
  203. #  ifdef SIGTERM
  204. #    undef SIGTERM         /* We don't want a signal handler for SIGTERM */
  205. #  endif
  206. #endif
  207.  
  208. #ifdef WIN32
  209. #  define OS_CODE  0x0b
  210. #endif
  211.  
  212. #ifdef TOPS20
  213. #  define OS_CODE  0x0a
  214. #endif
  215.  
  216. #ifndef unix
  217. #  define NO_ST_INO /* don't rely on inode numbers */
  218. #endif
  219.  
  220.  
  221.     /* Common defaults */
  222.  
  223. #ifndef OS_CODE
  224. #  define OS_CODE  0x03  /* assume Unix */
  225. #endif
  226.  
  227. #ifndef PATH_SEP
  228. #  define PATH_SEP '/'
  229. #endif
  230.  
  231. #ifndef casemap
  232. #  define casemap(c) (c)
  233. #endif
  234.  
  235. #ifndef OPTIONS_VAR
  236. #  define OPTIONS_VAR "GZIP"
  237. #endif
  238.  
  239. #ifndef Z_SUFFIX
  240. #  define Z_SUFFIX ".gz"
  241. #endif
  242.  
  243. #ifdef MAX_EXT_CHARS
  244. #  define MAX_SUFFIX  MAX_EXT_CHARS
  245. #else
  246. #  define MAX_SUFFIX  30
  247. #endif
  248.  
  249. #ifndef EXPAND
  250. #  define EXPAND(argc,argv)
  251. #endif
  252.  
  253. #ifndef RECORD_IO
  254. #  define RECORD_IO 0
  255. #endif
  256.  
  257. #ifndef SET_BINARY_MODE
  258. #  define SET_BINARY_MODE(fd)
  259. #endif
  260.  
  261. #ifndef OPEN
  262. #  define OPEN(name, flags, mode) open(name, flags, mode)
  263. #endif
  264.  
  265. #ifndef get_char
  266. #  define get_char() get_byte()
  267. #endif
  268.  
  269. #ifndef put_char
  270. #  define put_char(c) put_byte(c)
  271. #endif
  272.