home *** CD-ROM | disk | FTP | other *** search
/ Frozen Fish 1: Amiga / FrozenFish-Apr94.iso / bbs / gnu / gzip-1.2.4-src.lha / src / amiga / gzip-1.2.4 / tailor.h < prev    next >
C/C++ Source or Header  |  1994-02-23  |  7KB  |  328 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.18 1993/06/14 19:32:20 jloup Exp $ */
  12.  
  13. #if defined(__MSDOS__) && !defined(MSDOS)
  14. #  define MSDOS
  15. #endif
  16.  
  17. #if defined(__OS2__) && !defined(OS2)
  18. #  define OS2
  19. #endif
  20.  
  21. #if defined(OS2) && defined(MSDOS) /* MS C under OS/2 */
  22. #  undef MSDOS
  23. #endif
  24.  
  25. #ifdef MSDOS
  26. #  ifdef __GNUC__
  27.      /* DJGPP version 1.09+ on MS-DOS.
  28.       * The DJGPP 1.09 stat() function must be upgraded before gzip will
  29.       * fully work.
  30.       * No need for DIRENT, since <unistd.h> defines POSIX_SOURCE which
  31.       * implies DIRENT.
  32.       */
  33. #    define near
  34. #  else
  35. #    define MAXSEG_64K
  36. #    ifdef __TURBOC__
  37. #      define NO_OFF_T
  38. #      ifdef __BORLANDC__
  39. #        define DIRENT
  40. #      else
  41. #        define NO_UTIME
  42. #      endif
  43. #    else /* MSC */
  44. #      define HAVE_SYS_UTIME_H
  45. #      define NO_UTIME_H
  46. #    endif
  47. #  endif
  48. #  define PATH_SEP2 '\\'
  49. #  define PATH_SEP3 ':'
  50. #  define MAX_PATH_LEN  128
  51. #  define NO_MULTIPLE_DOTS
  52. #  define MAX_EXT_CHARS 3
  53. #  define Z_SUFFIX "z"
  54. #  define NO_CHOWN
  55. #  define PROTO
  56. #  define STDC_HEADERS
  57. #  define NO_SIZE_CHECK
  58. #  define casemap(c) tolow(c) /* Force file names to lower case */
  59. #  include <io.h>
  60. #  define OS_CODE  0x00
  61. #  define SET_BINARY_MODE(fd) setmode(fd, O_BINARY)
  62. #  if !defined(NO_ASM) && !defined(ASMV)
  63. #    define ASMV
  64. #  endif
  65. #else
  66. #  define near
  67. #endif
  68.  
  69. #ifdef OS2
  70. #  define PATH_SEP2 '\\'
  71. #  define PATH_SEP3 ':'
  72. #  define MAX_PATH_LEN  260
  73. #  ifdef OS2FAT
  74. #    define NO_MULTIPLE_DOTS
  75. #    define MAX_EXT_CHARS 3
  76. #    define Z_SUFFIX "z"
  77. #    define casemap(c) tolow(c)
  78. #  endif
  79. #  define NO_CHOWN
  80. #  define PROTO
  81. #  define STDC_HEADERS
  82. #  include <io.h>
  83. #  define OS_CODE  0x06
  84. #  define SET_BINARY_MODE(fd) setmode(fd, O_BINARY)
  85. #  ifdef _MSC_VER
  86. #    define HAVE_SYS_UTIME_H
  87. #    define NO_UTIME_H
  88. #    define MAXSEG_64K
  89. #    undef near
  90. #    define near _near
  91. #  endif
  92. #  ifdef __EMX__
  93. #    define HAVE_SYS_UTIME_H
  94. #    define NO_UTIME_H
  95. #    define DIRENT
  96. #    define EXPAND(argc,argv) \
  97.        {_response(&argc, &argv); _wildcard(&argc, &argv);}
  98. #  endif
  99. #  ifdef __BORLANDC__
  100. #    define DIRENT
  101. #  endif
  102. #  ifdef __ZTC__
  103. #    define NO_DIR
  104. #    define NO_UTIME_H
  105. #    include <dos.h>
  106. #    define EXPAND(argc,argv) \
  107.        {response_expand(&argc, &argv);}
  108. #  endif
  109. #endif
  110.  
  111. #ifdef WIN32 /* Windows NT */
  112. #  define HAVE_SYS_UTIME_H
  113. #  define NO_UTIME_H
  114. #  define PATH_SEP2 '\\'
  115. #  define PATH_SEP3 ':'
  116. #  define MAX_PATH_LEN  260
  117. #  define NO_CHOWN
  118. #  define PROTO
  119. #  define STDC_HEADERS
  120. #  define SET_BINARY_MODE(fd) setmode(fd, O_BINARY)
  121. #  include <io.h>
  122. #  include <malloc.h>
  123. #  ifdef NTFAT
  124. #    define NO_MULTIPLE_DOTS
  125. #    define MAX_EXT_CHARS 3
  126. #    define Z_SUFFIX "z"
  127. #    define casemap(c) tolow(c) /* Force file names to lower case */
  128. #  endif
  129. #  define OS_CODE  0x0b
  130. #endif
  131.  
  132. #ifdef MSDOS
  133. #  ifdef __TURBOC__
  134. #    include <alloc.h>
  135. #    define DYN_ALLOC
  136.      /* Turbo C 2.0 does not accept static allocations of large arrays */
  137.      void * fcalloc (unsigned items, unsigned size);
  138.      void fcfree (void *ptr);
  139. #  else /* MSC */
  140. #    include <malloc.h>
  141. #    define fcalloc(nitems,itemsize) halloc((long)(nitems),(itemsize))
  142. #    define fcfree(ptr) hfree(ptr)
  143. #  endif
  144. #else
  145. #  ifdef MAXSEG_64K
  146. #    define fcalloc(items,size) calloc((items),(size))
  147. #  else
  148. #    define fcalloc(items,size) malloc((size_t)(items)*(size_t)(size))
  149. #  endif
  150. #  define fcfree(ptr) free(ptr)
  151. #endif
  152.  
  153. #if defined(VAXC) || defined(VMS)
  154. #  define PATH_SEP ']'
  155. #  define PATH_SEP2 ':'
  156. #  define SUFFIX_SEP ';'
  157. #  define NO_MULTIPLE_DOTS
  158. #  define Z_SUFFIX "-gz"
  159. #  define RECORD_IO 1
  160. #  define casemap(c) tolow(c)
  161. #  define OS_CODE  0x02
  162. #  define OPTIONS_VAR "GZIP_OPT"
  163. #  define STDC_HEADERS
  164. #  define NO_UTIME
  165. #  define EXPAND(argc,argv) vms_expand_args(&argc,&argv);
  166. #  include <file.h>
  167. #  define unlink delete
  168. #  ifdef VAXC
  169. #    define NO_FCNTL_H
  170. #    include <unixio.h>
  171. #  endif
  172. #endif
  173.  
  174. /* The Amiga version using gcc can just use the normal configure to
  175.    set ASMV, HAVE_UNISTD_H, and DIRENT */
  176.  
  177. #ifdef AMIGA
  178. #  define PATH_SEP2 ':'
  179. #  define STDC_HEADERS
  180. #  define OS_CODE  0x01
  181. #  ifndef __GNUC__ /* SASC */
  182. #    define NO_STDIN_FSTAT
  183. #    define SYSDIR
  184. #    define NO_SYMLINK
  185. #    define NO_CHOWN
  186. #    define NO_FCNTL_H
  187. #    include <fcntl.h> /* for read() and write() */
  188. #    define direct dirent
  189.      extern void _expand_args(int *argc, char ***argv);
  190. #    define EXPAND(argc,argv) _expand_args(&argc,&argv);
  191. #    undef  O_BINARY /* disable useless --ascii option */
  192. #  endif
  193. #endif
  194.  
  195. #if defined(ATARI) || defined(atarist)
  196. #  ifndef STDC_HEADERS
  197. #    define STDC_HEADERS
  198. #    define HAVE_UNISTD_H
  199. #    define DIRENT
  200. #  endif
  201. #  define ASMV
  202. #  define OS_CODE  0x05
  203. #  ifdef TOSFS
  204. #    define PATH_SEP2 '\\'
  205. #    define PATH_SEP3 ':'
  206. #    define MAX_PATH_LEN  128
  207. #    define NO_MULTIPLE_DOTS
  208. #    define MAX_EXT_CHARS 3
  209. #    define Z_SUFFIX "z"
  210. #    define NO_CHOWN
  211. #    define casemap(c) tolow(c) /* Force file names to lower case */
  212. #    define NO_SYMLINK
  213. #  endif
  214. #endif
  215.  
  216. #ifdef MACOS
  217. #  define PATH_SEP ':'
  218. #  define DYN_ALLOC
  219. #  define PROTO
  220. #  define NO_STDIN_FSTAT
  221. #  define NO_CHOWN
  222. #  define NO_UTIME
  223. #  define chmod(file, mode) (0)
  224. #  define OPEN(name, flags, mode) open(name, flags)
  225. #  define OS_CODE  0x07
  226. #  ifdef MPW
  227. #    define isatty(fd) ((fd) <= 2)
  228. #  endif
  229. #endif
  230.  
  231. #ifdef __50SERIES /* Prime/PRIMOS */
  232. #  define PATH_SEP '>'
  233. #  define STDC_HEADERS
  234. #  define NO_MEMORY_H
  235. #  define NO_UTIME_H
  236. #  define NO_UTIME
  237. #  define NO_CHOWN 
  238. #  define NO_STDIN_FSTAT 
  239. #  define NO_SIZE_CHECK 
  240. #  define NO_SYMLINK
  241. #  define RECORD_IO  1
  242. #  define casemap(c)  tolow(c) /* Force file names to lower case */
  243. #  define put_char(c) put_byte((c) & 0x7F)
  244. #  define get_char(c) ascii2pascii(get_byte())
  245. #  define OS_CODE  0x0F    /* temporary, subject to change */
  246. #  ifdef SIGTERM
  247. #    undef SIGTERM         /* We don't want a signal handler for SIGTERM */
  248. #  endif
  249. #endif
  250.  
  251. #if defined(pyr) && !defined(NOMEMCPY) /* Pyramid */
  252. #  define NOMEMCPY /* problem with overlapping copies */
  253. #endif
  254.  
  255. #ifdef TOPS20
  256. #  define OS_CODE  0x0a
  257. #endif
  258.  
  259. #ifndef unix
  260. #  define NO_ST_INO /* don't rely on inode numbers */
  261. #endif
  262.  
  263.  
  264.     /* Common defaults */
  265.  
  266. #ifndef OS_CODE
  267. #  define OS_CODE  0x03  /* assume Unix */
  268. #endif
  269.  
  270. #ifndef PATH_SEP
  271. #  define PATH_SEP '/'
  272. #endif
  273.  
  274. #ifndef casemap
  275. #  define casemap(c) (c)
  276. #endif
  277.  
  278. #ifndef OPTIONS_VAR
  279. #  define OPTIONS_VAR "GZIP"
  280. #endif
  281.  
  282. #ifndef Z_SUFFIX
  283. #  define Z_SUFFIX ".gz"
  284. #endif
  285.  
  286. #ifdef MAX_EXT_CHARS
  287. #  define MAX_SUFFIX  MAX_EXT_CHARS
  288. #else
  289. #  define MAX_SUFFIX  30
  290. #endif
  291.  
  292. #ifndef MAKE_LEGAL_NAME
  293. #  ifdef NO_MULTIPLE_DOTS
  294. #    define MAKE_LEGAL_NAME(name)   make_simple_name(name)
  295. #  else
  296. #    define MAKE_LEGAL_NAME(name)
  297. #  endif
  298. #endif
  299.  
  300. #ifndef MIN_PART
  301. #  define MIN_PART 3
  302.    /* keep at least MIN_PART chars between dots in a file name. */
  303. #endif
  304.  
  305. #ifndef EXPAND
  306. #  define EXPAND(argc,argv)
  307. #endif
  308.  
  309. #ifndef RECORD_IO
  310. #  define RECORD_IO 0
  311. #endif
  312.  
  313. #ifndef SET_BINARY_MODE
  314. #  define SET_BINARY_MODE(fd)
  315. #endif
  316.  
  317. #ifndef OPEN
  318. #  define OPEN(name, flags, mode) open(name, flags, mode)
  319. #endif
  320.  
  321. #ifndef get_char
  322. #  define get_char() get_byte()
  323. #endif
  324.  
  325. #ifndef put_char
  326. #  define put_char(c) put_byte(c)
  327. #endif
  328.