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