home *** CD-ROM | disk | FTP | other *** search
/ Hall of Fame / HallofFameCDROM.cdr / proglc / zoo141_c.lzh / OPTIONS.H < prev    next >
C/C++ Source or Header  |  1987-02-07  |  7KB  |  245 lines

  1. /* options.h */
  2.  
  3. /*
  4. The contents of this file are hereby released to the public domain.
  5.  
  6.                            -- Rahul Dhesi 1986/11/14
  7. */
  8.  
  9. /* 
  10. This file defines various symbols and macros that are needed to ensure
  11. system-independence.  The basic philosophy is to use a distinct symbol for
  12. each attribute that varies from machine to machine.  Then, for each new
  13. system, we define symbols corresponding to its attributes.  Thus, ideally,
  14. the only place in Zoo code that we actually use the name of a machine is in
  15. this file, portable.h, and possibly in machine.h and options.c.  Everywhere
  16. else in the code we only use names of attributes.  If you need to define a
  17. new machine name, please refer first to the guidelines in the implementor's 
  18. documentation.
  19.  
  20. Machine names:
  21.  
  22. MSC      Microsoft C under MS-DOS
  23. SYS_V    UNIX System V release 2.1
  24. XENIX    Xenix release 3.0
  25. VMS      VAX/VMS 4.4
  26. BSD4_3    4.3BSD
  27.  
  28. Attributes of systems:
  29.  
  30. CHEKDIR
  31.    Test each supplied filename and if it is a directory or other special
  32.    type of file, do not try to add it to an archive.  If CHEKDIR is
  33.    defined, then machine.c must also include function isadir() that
  34.    tests a supplied handle and returns 1 if it corresponds to a
  35.    directory or other special type of file.
  36. CHEKUDIR
  37.    Like CHEKDIR but use function isuadir() that tests a pathname, not
  38.    a handle.  Only one of CHEKDIR, CHEKUDIR may be defined.
  39. LINT_ARGS
  40.    Use ANSI-style function argument lists in declarations
  41. FLAT
  42.    include files are all in one place (no sys/anything)
  43. FOLD
  44.    fold filenames to lowercase.  Define this for case-insensitive filesystems
  45. PORTABLE
  46.    use portable functions --- define for every system except MS-DOS
  47. DONT_SORT
  48.    don't sort filename arguments (already sorted by shell).
  49. NOENUM
  50.    compiler does not support enumerations
  51. DUMB_ASS
  52.    dumb assertions must be used because the preprocessor doesn't define 
  53.    the symbols __FILE__ and __LINE__  (which hold the name of the current
  54.    file and the number of the current line)
  55. FNLIMIT
  56.    filename length limit for this system
  57. NEEDCTYP
  58.    the header file ctype.h is needed because functions such as tolower() are
  59.    defined only as macros
  60. NIXTIME
  61.    If defined, a function setutime() must be defined that will set the
  62.    date and time of a file whose pathname is supplied.  If not defined,
  63.    a function settime() must be defined that will do the same for
  64.    a file handle.
  65. GETUTIME
  66.    If defined, a function getutime() must be defined that will return
  67.    the MS-DOS format date and time of the specified filename.  If this
  68.    symbol is not defined, then a function gettime() must be defined
  69.    that will do the same for a supplied handle instead of a filename.
  70. NOFCNTL
  71.    if defined, system expects "file.h" to be included rather than "fcntl.h"
  72. NOSIGNAL
  73.    don't use signals because library doesn't support them
  74. PATH_CH
  75.    the character that should separate the directory name from the filename
  76.    in the listing of the contents of an archive.  String value.
  77. PATH_SEP 
  78.    the set of characters that may separate preceding directory/device 
  79.    information from the filename.  String value.
  80. EXT_SEP is the union of PATH_SEP and the set of characters separating a 
  81.    filename extension from the rest of the filename.  String value.
  82. EXT_CH
  83.    character that separates base part of filename from extension.  Char value.
  84. EXT_DFLT
  85.    default extension for archives.  String.  Usually ".zoo"
  86. NIXFNAME
  87.    if defined, PATH_CH, PATH_SEP, EXT_SEP, EXT_CH, and EXT_DFLT get defined 
  88.    to conform to UNIX conventions and should not be separately defined
  89. FORCESLASH
  90.    if defined any backslashes in names of files will be converted to
  91.    slashes before the files are added to an archive.  This is useful
  92.    for MSDOS-like systems that accept both slashes and backslashes,
  93.    since the standard archive format allows only slashes as directory
  94.    separators.
  95. REN_LINK
  96.    rename a file by using link() followed by unlink() (e.g. Xenix, System V)
  97. REN_NORM
  98.    use normal rename function:  "int rename(new, old)" (e.g. Microsoft C)
  99. REN_REV
  100.    use reverse rename function:  "int rename(old, new)" (e.g. 4.2BSD)
  101.    Note:  define exactly one of REN_LINK, REN_NORM, and REN_REV.
  102. SETMODE
  103.    change mode of standard output to binary when piping output, then change
  104.    it back to text.  Macros MODE_BIN(handle) and MODE_TEXT(handle) must also
  105.    be defined.
  106. SETBUF
  107.    standard output should be set to be unbuffered so output shows up
  108.    quickly.
  109. SPECNEXT
  110.    If defined, a machine-dependent function nextfile() must be defined that
  111.    will expand wildcards in a supplied pathname.  If not defined, a null
  112.    nextfile() is automatically used and any wildcard expansion must
  113.    have been done before the command line parameters are supplied to
  114.    the program.
  115. */
  116.  
  117. /* ZOO is always defined currently */
  118. #define ZOO
  119.  
  120. #ifdef XENIX
  121. #define FNLIMIT 14
  122. #define NIXTIME
  123. #define NIXFNAME
  124. #define LINT_ARGS
  125. #define PORTABLE
  126. #define REN_LINK
  127. #endif
  128.  
  129. #ifdef SYS_V
  130. #define FNLIMIT 14
  131. #define CHEKDIR
  132. #define NIXTIME
  133. #define NIXFNAME
  134. #define NEEDCTYP
  135. #define NOENUM
  136. #define PORTABLE
  137. #define REN_LINK
  138. #define SETBUF
  139. #endif
  140.  
  141. #ifdef MSC
  142. #define IGNORECASE
  143. #define WILDCARDS
  144. #define FOLD
  145. #define FORCESLASH
  146. #define FNLIMIT 12
  147. #define NEEDCTYP
  148. #define CUR_DIR "."
  149. #define PATH_CH "/"
  150. #define PATH_SEP ":/\\"
  151. #define EXT_CH '.'
  152. #define EXT_SEP  ":/\\."
  153. #define EXT_DFLT ".zoo"
  154. #define SETMODE
  155. #define MODE_BIN(handle)      setmode(handle, O_BINARY)
  156. #define MODE_TEXT(handle)     setmode(handle, O_TEXT)
  157. #define LINT_ARGS
  158. #define REN_NORM
  159.  
  160. #ifdef  PORTABLE
  161. #define SPECNEXT
  162. #define NIXTIME
  163. #endif
  164.  
  165. #endif  /* MSC */
  166.  
  167. #ifdef BSD4_3
  168. #define FNLIMIT 1023
  169. #define CHEKDIR
  170. #define NIXTIME
  171. #define NIXFNAME
  172. #define NEEDCTYP
  173. #define PORTABLE
  174. #define NOENUM
  175. #define REN_REV
  176. #define SETBUF
  177. #endif
  178.  
  179. #ifdef VMS
  180. #define FNLIMIT 78
  181. #define PATH_SEP ":]"
  182. #define EXT_CH '.'
  183. #define EXT_SEP ":]."
  184. #define EXT_DFLT ".zoo"
  185. #define NOENUM
  186. #define FLAT
  187. #define PORTABLE
  188. #define DUMB_ASS
  189. #define NOFCNTL
  190. #endif
  191.  
  192. #ifdef MCH_AMIGA
  193. #define SPECNEXT
  194. #define IGNORECASE
  195. #define FNLIMIT 30
  196. #define NEEDCTYP
  197. #define CUR_DIR "."
  198. #define PATH_CH "/"
  199. #define PATH_SEP ":/"
  200. #define EXT_CH   '.'
  201. #define EXT_SEP  ":/."
  202. #define EXT_DFLT ".zoo"
  203. #define PORTABLE
  204. #define NOSIGNAL
  205. #define REN_REV
  206. /* #define FLAT */
  207. #define NOENUM
  208. #define SETBUF
  209. #define CHEKUDIR
  210. #define GETUTIME
  211. #define NIXTIME
  212. #endif
  213.  
  214. #ifdef NIXFNAME
  215. #define CUR_DIR "."
  216. #define PATH_CH "/"
  217. #define PATH_SEP "/"
  218. #define EXT_CH '.'
  219. #define EXT_SEP  "/."
  220. #define EXT_DFLT ".zoo"
  221. #endif
  222.  
  223. #ifdef GENERIC
  224. /* #define SPECNEXT */
  225. #define IGNORECASE
  226. #define FNLIMIT 11
  227. #define NEEDCTYP
  228. #define CUR_DIR "."
  229. #define PATH_CH "/"
  230. #define PATH_SEP ":/"
  231. #define EXT_CH   '.'
  232. #define EXT_SEP  ":/."
  233. #define EXT_DFLT ".zoo"
  234. #define PORTABLE
  235. #define NOSIGNAL
  236. /* REN_LINK is UNIX-specific.  Can't find a generic rename() function */
  237. #define REN_LINK
  238. /* #define FLAT */
  239. #define NOENUM
  240. #define SETBUF
  241. #define CHEKUDIR
  242. #define GETUTIME
  243. #define NIXTIME
  244. #endif
  245.