home *** CD-ROM | disk | FTP | other *** search
/ Stars of Shareware: Programmierung / SOURCE.mdf / programm / msdos / c / zoo_src / z201src1 / options.doc < prev    next >
Encoding:
Text File  |  1988-08-22  |  14.6 KB  |  300 lines

  1. /* @(#) options.doc 1.4 88/08/22 15:24:59 */
  2.  
  3. Documentation about the file options.h.
  4.  
  5. The file options.h defines various symbols and macros that are needed
  6. to ensure system-independence.  The basic philosophy is to use a
  7. distinct symbol for each attribute that varies from machine to machine.
  8. Then, for each new system, we define symbols corresponding to its
  9. attributes. Thus, ideally, the only place in Zoo code that we actually
  10. use the name of a machine is in this file, in portable.h, and possibly in
  11. machine.h and options.c.  Everywhere else in the code we only use
  12. names of attributes.
  13.  
  14. Machine names:
  15.  
  16. MSC         Microsoft C 3.0 under MS-DOS  (not currently in use)
  17. TURBOC      Turbo C 1.0 under MS-DOS      (works, compiled version is
  18.                                           separately distributed)
  19. DLC         Datalight C under MS-DOS      (not currently in use*)
  20. FLEX        FlexDOS                       (not currently in use*)
  21. SYS_V       UNIX System V release 2       (works)
  22. VMS         VAX/VMS 4.4 through 4.6       (works, stream-LF files only)
  23. BSD4_3      4.3BSD                        (works)
  24. MCH_AMIGA   AmigaDOS Aztec/Manx C         (compiled version is separately
  25.                                           distributed)
  26. -----
  27. *Mark Alexander provided me with changes to allow compilation using
  28. FlexDOS and also Datalight's Optimum C under MSDOS but they have not
  29. yet been incorporated into this release.
  30.  
  31. NOTE:  The term "zoofile" below refers to an open file of type
  32. ZOOFILE.  Currently this is defined to be equivalent to a standard
  33. buffered file pointer of type "ZOOFILE *" but this may change in the
  34. future.  Dependence on exact definition of ZOOFILE is localized to a
  35. few files:  options.h, portable.h, portable.c, and machine.c.
  36.  
  37. Attributes of systems:
  38.  
  39. CHEKDIR
  40.    Test each supplied filename and if it is a directory or other special
  41.    type of file, do not try to add it to an archive.  If CHEKDIR is
  42.    defined, then machine.c must also contain function isadir() that
  43.    tests a supplied zoofile and returns 1 if it corresponds to a
  44.    directory or other special type of file, else 0.
  45. CHEKUDIR
  46.    Like CHEKDIR but use function isuadir() that tests a pathname, not
  47.    a zoofile.  Both CHEKDIR and CHEKUDIR may be defined, if both
  48.    functions isadir() and isuadir() are available;  in this case
  49.    zoo code will use both and will execute slightly faster.
  50.    (However, simultaneous definition of CHEKDIR and CHEKUDIR has
  51.    not been tested.)
  52. DISK_CH
  53.    If defined, must hold the value of a character that separates a
  54.    disk name from the rest of the pathname.  All characters up to and
  55.    including this character will be removed from a pathname before it
  56.    is stored in an archive.  Usually a colon (':').
  57. EXISTS
  58.    If defined, is assumed to be a macro that accepts a filename and
  59.    returns an int value of 1 if the file exists and 0 if it doesn't.
  60.    If not defined, existence of files is tested by attempting to open
  61.    them for read or write access.
  62. FATTR
  63.    If defined, file attributes will be preserved.  A function
  64.    getfattr(f) must also exist that returns the attributes of a
  65.    zoofile f (or of a pathname f, if the symbol FATTR_FNAME is
  66.    also defined); and a function setfattr(f, a) must exist that
  67.    sets the attributes of a file with pathname f to the value a.
  68.    For more details see the source code in sysv.c and bsd.c.  Currently
  69.    the attribute value a is required to be in the zoo portable
  70.    format.  The lowest nine bits of this format correspond to
  71.    the **IX mode bits described for chmod(2) and these are the only
  72.    bits currently used.
  73. FATTR_FNAME
  74.    If defined, and if FATTR is also defined, zoo code will
  75.    obtain the attributes of a file by calling the function
  76.    getfattr(f) and supplying it with filename f.  If FATTR_FNAME
  77.    is not defined, then getfattr(f) is supplied a zoofile f.
  78. LINT_ARGS
  79.    Use ANSI-style function argument lists in declarations.  The symbols
  80.    MORE, NOTHING, and VOIDPTR must also be defined.
  81. MORE
  82.    In function prototypes, a variable number of trailing arguments
  83.    is specified with the symbol MORE following a trailing comma.
  84.    For ANSI-conformant compilers, MORE will be defined to be three
  85.    dots (...);  for others, it can be defined as necessary
  86.    (empty string for Microsoft C 3.0).
  87. NOTHING
  88.    In a prototype for a function that takes no parameters, NOTHING is
  89.    used as the parameter.  For ANSI-compatible compilers NOTHING should
  90.    be defined to be `void'.  For other compilers it should be defined
  91.    to be empty.
  92. VOIDPTR
  93.    VOIDPTR should be defined as void * if the compiler supports this
  94.    (e.g. Turbo C), else it should be defined as char * (e.g. Microsoft
  95.    C).
  96. LINT
  97.    If defined, SCCS identifier strings will not be included in the
  98.    generated code.  This will make the code smaller and will also
  99.    avoid complaints from lint about unused variables.  This symbol
  100.    should be defined in the Makefile, NOT in `options.h', otherwise
  101.    it will not be fully effective.
  102. FOLD
  103.    Fold filenames to lowercase.  Define this for case-insensitive filesystems
  104. FPUTCHAR
  105.    If defined, a library function fputchar() is assumed available
  106.    that is like fput() but is a function, not a macro, to save
  107.    space.  If not defined Zoo uses its own fputchar() function.
  108. PORTABLE
  109.    Use portable functions --- define for every system except MS-DOS
  110. PURIFY
  111.    When filenames are being read from standard input, ignore all
  112.    characters begining with the first blank or tab encountered.
  113.    This will allow filenames to be fed from a program that produces
  114.    lines containing filenames followed by other information that
  115.    should be ignored.  Should be defined for most non-**IX systems.
  116. DONT_SORT
  117.    Don't sort filename arguments -- files will be stored in the
  118.    exact order in which names are supplied on the command line.
  119.    Not currently used for any system, but could be used if memory
  120.    is really tight.
  121. NOENUM
  122.    Compiler does not support enumerations
  123. DUMB_ASS
  124.    Dumb assertions must be used because the preprocessor doesn't define
  125.    the symbols __FILE__ and __LINE__  (which hold the name of the current
  126.    file and the number of the current line)
  127. FNLIMIT
  128.    Pathname length limit for this system
  129. NEEDCTYP
  130.    If defined, tells the code to include the header file ctype.h for
  131.    use by character conversion macros.  If and only if NEEDCTYP is not
  132.    defined, macros or appropriate function declarations can be put in
  133.    portable.h.  Zoo uses isupper(), isdigit(), toascii(), and tolower().
  134.    If NEEDCTYP is not defined, the symbol USE_ASCII can be defined to
  135.    cause zoo to assume the ASCII character set and use its own isupper(),
  136.    isdigit(), toascii(), and tolower() functions, possibly making the
  137.    executable code smaller.
  138. USE_ASCII
  139.    See description of NEEDCTYP.  USE_ASCII should not be defined if
  140.    NEEDCTYP is defined, else there may be conflicts between macro
  141.    and function names.
  142. NIXTIME
  143.    If defined, a function setutime() must be defined that will set the
  144.    date and time of a file whose pathname is supplied.  If not defined,
  145.    a function settime() must be defined that will do the same for
  146.    a zoofile.
  147. GETUTIME
  148.    If defined, a function getutime() must be defined that will return
  149.    the MS-DOS format date and time of the specified filename.  If this
  150.    symbol is not defined, then a function gettime() must be defined
  151.    that will do the same for a zoofile instead of a filename.
  152. NOSIGNAL
  153.    don't use signals because library doesn't support them
  154. PATH_CH
  155.    The character that separates the directory name from the filename
  156.    in a pathname.  String value.
  157. PATH_SEP
  158.    The set of characters that may separate preceding directory/device
  159.    information from the filename.  String value.
  160. EXT_SEP is the union of PATH_SEP and the set of characters separating a
  161.    filename extension from the rest of the filename.  String value.
  162. EXT_CH
  163.    Character that separates base part of filename from extension.
  164.    Char value.
  165. MEMSET
  166.    If defined, a library function memset() is assumed available that
  167.    conforms to that available under System V.  If not defined, Zoo uses
  168.    its own memset() function.
  169. EXT_DFLT
  170.    default extension for archives.  String.  Currently ".zoo".
  171. NIXFNAME
  172.    If defined, PATH_CH, PATH_SEP, EXT_SEP, EXT_CH, and EXT_DFLT get defined
  173.    to conform to **IX conventions and should not be separately defined
  174. MSFNAME
  175.    if defined, PATH_CH, PATH_SEP, EXT_SEP, EXT_CH, EXT_DFLT, and
  176.    DISK_CH get defined to conform to MS-DOS conventions and should
  177.    not be separately defined (not currently implemented)
  178. FORCESLASH
  179.    If defined any backslashes in names of files will be converted to
  180.    slashes before the files are added to an archive.  This is useful
  181.    for MSDOS-like systems that accept both slashes and backslashes,
  182.    since the standard archive format allows only slashes as directory
  183.    separators.
  184. REN_LINK
  185.    Rename a file by using link() followed by unlink() (e.g. Xenix, System V)
  186. REN_NORM
  187.    Use normal rename function:  "int rename(new, old)" (e.g. Microsoft C)
  188. REN_REV
  189.    Use reverse rename function:  "int rename(old, new)" (e.g. 4.3BSD,
  190.    Turbo C).  Note:  define exactly one of REN_LINK, REN_NORM, and REN_REV.
  191. SETMODE
  192.    Change mode of standard output to binary when piping output, then change
  193.    it back to text.  Macros MODE_BIN(zoofile) and MODE_TEXT(zoofile) must
  194.    also be defined.
  195. SETBUF
  196.    Standard output should be set to be unbuffered so output shows up
  197.    quickly.  Currently used only in Fiz, not in Zoo.
  198. SPECNEXT
  199.    If defined, a machine-dependent function nextfile() must be defined that
  200.    will expand wildcards in a supplied pathname. If not defined, any
  201.    wildcard expansion must have been done before the command line parameters
  202.    are supplied to the program.  For details see the file nextfile.c.
  203. STRLWR
  204.    If defined, a library function strlwr() is assumed available that converts
  205.    a supplied string to lowercase and returns a pointer it.  If not
  206.    defined, Zoo uses its own strlwr() function.
  207. STRDUP
  208.    If defined, a library function strdup() is assumed available that
  209.    returns a pointer to a copy of a supplied string.  If not defined,
  210.    Zoo uses its own strdup() function.
  211. SPECEXIT
  212.    Custom exit handler is needed.  A function called zooexit()
  213.    must be defined.  If SPECEXIT is not defined, zoo uses its
  214.    own zooexit() function which simply calls exit().
  215. SPECINIT
  216.    If defined, zoo's main() function will call spec_init() before
  217.    doing anything else.  Any system-specific initialization may be
  218.    done at this point.
  219. GETTZ
  220.    If defined, a function gettz() must also be defined that will
  221.    return the current timezone, in seconds west of GMT, as a long
  222.    value.  Currently such a function is already defined in files
  223.    bsd.c and sysv.c.  If and only if GETTZ is defined, zoo will
  224.    store the current timezone for each file that is archived,
  225.    and will list the timezone for each file that has one when it
  226.    lists archive contents.
  227. ALWAYS_INT
  228.    In function prototypes for fgetc(), fread(), and fwrite(),
  229.    traditional practice made certain arguments int, though
  230.    they ought to be char and unsigned respectively.  If
  231.    ALWAYS_INT is defined, prototypes will use int only,
  232.    else the correct types are used.
  233. IO_MACROS
  234.    If defined, some portable I/O functions are defined as macros,
  235.    saving space.
  236. ZOOCOMMENT
  237.    If defined, archive comments are fully enabled.  If not defined,
  238.    zoo code will be smaller at the cost that archive comments will
  239.    be listed but cannot be updated.  COMPILATION WITHOUT ZOOCOMMENT
  240.    DEFINED HAS NOT YET BEEN TESTED.
  241. TRACE_IO
  242.    This is for debugging.  If defined, it will cause code to
  243.    be compiled that will trace all archive header and directory
  244.    entry I/O by showing it on the screen in human-readable format.
  245.    The tracing will then occur if any Expert command given to zoo
  246.    is preceded by a colon.  E.g., if compiled with TRACE_IO on and
  247.    given the command "zoo :l xyz", zoo will give a directory
  248.    listing of xyz.zoo exactly as it would with "zoo l xyz" except
  249.    that all archive header and directory entry reads and writes
  250.    will be shown on the screen.  The tracing code is localized
  251.    to the files zoo.c and portable.c, so just these two files
  252.    can be compiled afresh when TRACE_IO is turned on or switched
  253.    off.  NOTE:  The symbol TRACE_LIST, internal to the file
  254.    "zoolist.c", enables debugging information too.  Do not define
  255.    both TRACE_IO and TRACE_LIST because (a) a symbol conflict will
  256.    occur and (b) the debugging information will be duplicated.
  257. UNBUF_IO
  258.    If defined, some I/O is done using low-level system calls read() and
  259.    write().  To do this, the low-level file descriptor is synchronized with
  260.    the buffered zoofile before such I/O is done.  To do this, read(),
  261.    write(), and lseek() system calls must be available and the fileno()
  262.    macro must return the file descriptor for a buffered file.  This is
  263.    not portable and should definitely not be done by most end users.  If
  264.    UNBUF_IO is defined, also defined must be a symbol UNBUF_LIMIT with a
  265.    numerical value that specifies the threshold over which unbuffered I/O
  266.    should be used.  For example, if the value of UNBUF_LIMIT is 512, then
  267.    any I/O on a zoofile that reads or writes more than 512 bytes will be
  268.    done using read() or write() system calls.  The use of unbuffered I/O
  269.    with a threshold in the range 512 to 1024 can enhance performance by up
  270.    to 50%.  The corruption of data is a serious matter.  Do not define
  271.    UNBUF_IO unless you are willing to exhaustively test the compiled code
  272.    on your system to make sure it works, and accept full responsibility for
  273.    any adverse consequences.  Some standard I/O libraries may attempt to
  274.    optimize the working of fseek() on files opened for read access only,
  275.    and cause UNBUF_IO to fail.
  276. UNBUF_LIMIT
  277.    Needed if and only if UNBUF_IO is defined.  Holds a numeric value.
  278.    All I/O done in blocks that are larger than UNBUF_LIMIT bytes
  279.    will be done unbuffered.  See UNBUF_IO.
  280. FILTER
  281.    If defined, code will be compiled in to enable the fc and fd
  282.    commands (compress or decompress, reading standard input and
  283.    writing to standard output).  These commands are useful only
  284.    on systems that allow programs to easily act as filters.
  285. VER_DISPLAY
  286.    The character that will separate filenames from generation numbers
  287.    in listings of archive contents.  Must be a single character
  288.    in double quotes.
  289. VER_INPUT
  290.    The characters that will be accepted as separating filenames
  291.    from generation numbers when typed as an argument to select
  292.    specific files from an archive.  String value.  May include
  293.    one or more characters;  any of them may then be typed and
  294.    will work.
  295. NOSTRCHR
  296.    Although 4.3BSD as distributed from Berkeley includes strchr()
  297.    and strrchr() library functions, 4.2BSD and similar systems
  298.    may not.  If so, defining NOSTRCHR will cause zoo to use
  299.    index() and rindex() instead.
  300.