home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / misc / volume39 / enh-du2 / part02 / config.h next >
Encoding:
C/C++ Source or Header  |  1993-08-21  |  8.1 KB  |  199 lines

  1. /* @(#) config.h 1.14 93/08/18 00:08:58 
  2.  *
  3.  * "du" enhanced disk usage summary - version 2.
  4.  *
  5.  * Copyright 1990-1993, Unicom Systems Development.  All rights reserved.
  6.  * See accompanying README file for terms of distribution and use.
  7.  *
  8.  * Edit at tabstops=8.
  9.  *
  10.  * This file must be configured for the target system.  Warning -- a lot
  11.  * of this stuff is pretty obscure and esoteric.  That's unavoidable.
  12.  * After all, we are dealing with some very low-level system facilities.
  13.  * Moreover, some vendors take it upon themself to "value add" their Unix
  14.  * to death, which just makes this task more difficult.
  15.  *
  16.  * With patience (and a good file pager) you will persevere!  I've tried
  17.  * to provide hints and assistance wherever possible.  Nonetheless, chances
  18.  * are very good that you will need to trawl through your /usr/include
  19.  * directory to determine which selections are correct.
  20.  *
  21.  * If you get stuck, consult the README.  You'll find some hints for a
  22.  * handful of systems that I have personally used.  If you have any
  23.  * suggestions on how to make this task easier, let me know.
  24.  */
  25.  
  26. /*
  27.  * Select one of the following.  It says how to read directories.
  28.  */
  29. #define USE_DIR_DIRENT        /* use <dirent.h>, struct dirent       common */
  30. /*#define USE_DIR_SYSDIR    /* use <sys/dir.h>, struct direct     old BSD */
  31. /*#define USE_DIR_SYSNDIR    /* use <sys/ndir.h>, struct direct  old XENIX */
  32.  
  33. /*
  34.  * Select one of the following.  It says how to look for mounted filesystems.
  35.  */
  36. #define USE_MOUNT_MNTTAB    /* use <mnttab.h>, use /etc/mnttab       SysV */
  37. /*#define USE_MOUNT_R4MNTTAB    /* use <sys/mnttab.h>, /etc/mnttab     SysVr4 */
  38. /*#define USE_MOUNT_MNTENT    /* use <mntent.h>, use /etc/mtab   SunOS,HPUX */
  39. /*#define USE_MOUNT_FSTAB    /* use <fstab.h>, use /etc/fstab          BSD */
  40. /*#define USE_MOUNT_MNTCTL    /* use <sys/mntctl.h>, use mntctl()       AIX */
  41.  
  42. /*
  43.  * Select one of the following.  It says where your "struct statfs" is
  44.  * defined -- or that your system doesn't support the "statfs()" call.
  45.  */
  46. #define USE_STATFS_SYSV        /* include <sys/statfs.h>                     */
  47. /*#define USE_STATFS_BSD    /* include <sys/mount.h>              */
  48. /*#define USE_STATFS_SUN    /* include <sys/vfs.h>, SysV-style stafs()    */
  49. /*#define USE_STATFS_HPUX    /* include <sys/vfs.h>, BSD-style statfs()    */
  50. /*#define USE_STATFS_NONE    /* statfs() call not available, e.g. S5R2     */
  51.  
  52. /*
  53.  * Enable USE_SYMLINKS if you have symbolic links, else comment it out.
  54.  *
  55.  * It is important you enable this if appropriate.  It prevents "du" from
  56.  * following symlinks that point to directories, and thus reporting bogus
  57.  * results or ending up in strange twisted loops.
  58.  */
  59. /*#define USE_SYMLINKS         /* enable for SysVr4, Sun, etc. */
  60.  
  61. /*
  62.  * Enable USE_STBLOCKS if the "stat" structure in your <sys/stat.h> file
  63.  * has an "st_blocks" member, else comment it out.
  64.  *
  65.  * It is important to enable this if appropriate for two reasons.  First,
  66.  * performance of "du" is *significantly* improved if "st_blocks"
  67.  * information can be used.  Second, it will avoid reporting errors on
  68.  * so-called "sparse" files.
  69.  */
  70. /*#define USE_STBLOCKS        /* enable for SysVr4, Sun, etc. */
  71.  
  72. /*
  73.  * Leave BROKE_STBLOCKS undefined unless you really need it.
  74.  *
  75.  * If you didn't define USE_STBLOCKS above then don't even bother
  76.  * reading this -- just leave BROKE_STBLOCKS undefined.
  77.  *
  78.  * This definition is provided as a workaround for certain vendors who
  79.  * are a little confused about how Unix is supposed to work.  The
  80.  * "st_blocks" information returned by stat(2) is supposed to be in
  81.  * 512-byte blocks.  Some vendors botch this.  AIX, for example, properly
  82.  * reports local filesystems in 512-byte blocks, but across the network
  83.  * reports in 1024-byte blocks.  HPUX does the exact opposite.
  84.  *
  85.  * If you define BROKE_STBLOCKS, then "du" will try to calculate how
  86.  * "st_blocks" should be interpreted rather than assuming 512-byte blocks.
  87.  * This calculation, unfortunately, will fail for filesystems that use
  88.  * fragments and the "f_bsize" value reported by statfs(2) is the block
  89.  * size instead of the fragment size (e.g. Solaris, BSDI).
  90.  *
  91.  * So, enable BROKE_STBLOCKS only if all the following is true:
  92.  *
  93.  *    - You have defined USE_STBLOCKS.  If you haven't, BROKE_STBLOCKS
  94.  *      is ignored anyway.
  95.  *
  96.  *    - "du" is reporting wrong values, usually either twice or half
  97.  *      the correct size.
  98.  *
  99.  *    - Either you do not have a fast filesystem with fragments or
  100.  *      "f_bsize" indicates the size of the fragment.
  101.  *
  102.  * (Please send a note to the author if you wish you could use
  103.  * BROKE_STBLOCKS but can't because your system uses fragments.)
  104.  */
  105. /*#define BROKE_STBLOCKS    /* enable for HPUX, networked AIX */
  106.  
  107. /*
  108.  * If your system has the ANSI <stdarg.h> facility then enable USE_STDARG.
  109.  * If your system only has the older <varargs.h> then disable it.
  110.  */
  111. #define USE_STDARG        /* enable on ANSI-compliant systems */
  112.  
  113. /*
  114.  * Enable USE_UNISTD if your system has a <unistd.h> file.
  115.  * If you don't have this header file then disable it.
  116.  */
  117. #define USE_UNISTD        /* enable on ANSI-compliant systems */
  118.  
  119. /*
  120.  * Enable USE_PATHCONF if your system has the POSIX pathconf() facility,
  121.  * else comment it out.
  122.  *
  123.  * ===>    For some reason, this is the definition people seem to flub up
  124.  *    most frequently.  If your system is an older, pre-POSIX system
  125.  *    that lacks pathconf() then do NOT enable this.  If you ain't
  126.  *    got it, I can't use it!
  127.  *
  128.  * If you enable USE_PATHCONF you *must* also have enabled USE_UNISTD.
  129.  * If you disable USE_PATHCONF then we will make a (usually reasonable)
  130.  * guess at how much space to reserve to hold pathnames.
  131.  */
  132. #define USE_PATHCONF        /* enable on POSIX-compliant systems */
  133.  
  134. /*
  135.  * PTRTYPE indicates what your compiler uses as a generic pointer type.
  136.  * Most modern compilers will accept "void".  Crufty compilers use "char".
  137.  */
  138. #ifndef PTRTYPE
  139. #define PTRTYPE void        /* use (void *) as a generic pointer    */
  140. /*#define PTRTYPE char        /* use (char *) as a generic pointer    */
  141. #endif
  142.  
  143. /*
  144.  * ### YOU ARE NOW FINISHED WITH THE ESSENTIAL CONFIGURATIONS ###
  145.  * 
  146.  * Congratulations!  You made it.  You are now ready to roll.
  147.  *
  148.  * You might, however, want to glance through the following definitions.
  149.  * These allow you to tailor "du" behavior according to your site-specific
  150.  * preferences.
  151.  */
  152.  
  153. /*
  154.  * REPORT_BLOCKSIZE specifies default block size to use for reporting
  155.  * disk usage, usually either "512" or "1024".  Most versions of "du"
  156.  * (including POSIX conformant versions) use 512.  Others, such as SunOS,
  157.  * use 1024.  Pick whatever you prefer.  This choice does not effect the
  158.  * usage calculations or accuracy, only how the results are displayed,
  159.  * and there are command line switches that will override the default
  160.  * selected here.
  161.  */
  162. #define REPORT_BLKSIZE        512    /* report in 512-byte blocks    */
  163. /*#define REPORT_BLKSIZE    1024    /* report in 1024-byte blocks   */
  164.  
  165. /*
  166.  * PRINT_ERRORS controls whether or not error messages (e.g. "permission
  167.  * denied", etc.) are displayed.  When defined, these error messages are
  168.  * displayed.  When disabled, the errors are silently ignored -- which
  169.  * is traditional "du" behavior.  I think it makes more sense to print
  170.  * the errors (i.e. enable PRINT_ERRORS).  If, however, you disable this
  171.  * to obtain backward compatibility, you will get a "-r" command line
  172.  * option that will turn error messages back on.
  173.  */
  174. #define PRINT_ERRORS        /* display errors by default if enabled */
  175.  
  176. /*
  177.  * TIMEOUT is a release hatch for hung NFS servers.  If you define
  178.  * this value, "du" will unceremoniously kill itself after this many
  179.  * seconds of inactivity.
  180.  */
  181. /*#define TIMEOUT    300    /* timeout value in seconds        */
  182.  
  183. /*
  184.  * MAX_BREAK is maximum number of columns which can be requested by the
  185.  * "-c" option (breakdown usage by age).  Increasing this value will
  186.  * increase the memory usage, but not by much.
  187.  */
  188. #define MAX_BREAK    64    /* max columns in breakdown by age    */
  189.  
  190. /*
  191.  * OBSOLETEOPT enables "-d" which was present in the original "enh-du"
  192.  * release.  This prevents "du" from descending into directories
  193.  * entirely, which in retrospect seems like a pretty useless thing.
  194.  * If you really need it, enable OBSOLETEOPT.  And let me know, because
  195.  * it is slated for removal if and when another release is done.
  196.  */
  197. /*#define OBSOLETEOPT        /* if you want old "-d" option        */
  198.  
  199.