home *** CD-ROM | disk | FTP | other *** search
- /* config.h - Configuration and portability definitions
- *
- * Copyright (c) 1991 Tim Cook.
- * Non-profit distribution allowed. See README for details.
- *
- * $Header: config.h 1.3 91/08/21 $
- */
-
- #ifndef _CONFIG_H_
- #define _CONFIG_H_
-
- /*
- * Date orientation. For those who prefer seeing the month before the
- * day of the month in dates, define US_DATE_FORMAT.
- */
-
- /* #define US_DATE_FORMAT /* */
-
- /*
- * DBM library. If you have an NDBM-compatible library, define NDBM,
- * otherwise, you will need DBM. If you have a version of DBM that
- * does not include the dbmclose(3) routine, define NO_DBMCLOSE.
- */
-
- #define NDBM /* */
- /* #define NO_DBMCLOSE /* */
-
- /*
- * Directory reading routines. Check your man page for readdir(3) and
- * define one of DIRENT, SYS_DIR or SYS_NDIR to denote where the
- * necessary include file is. If your readdir(3) returns a
- * "struct direct" pointer, define DIRECT, otherwise it will be
- * assumed that readdir(3) returns a "struct dirent" pointer.
- */
-
- #define SYS_DIR /* to include <sys/dir.h> */
- /* #define SYS_NDIR /* to include <sys/ndir.h> */
- /* #define DIRENT /* to include <dirent.h> */
-
- #define DIRECT /* readdir(3) returns "struct direct *" */
-
- /*
- * Uid/gid types. Define these to what is returned by getuid(2) and
- * getgid(2) (check the man pages).
- */
-
- #define UID_T int /* */
- #define GID_T int /* */
-
- /*
- * Data alignment. If your architecture requires particular data
- * items to be aligned, you may need to define this (you will if you
- * get a "bus error" when you attempt a "dl -t"). Define it to 2
- * for word alignment or 4 for longword alignment.
- */
-
- #ifdef sparc
- #define ALIGN 4 /* Longword alignment */
- #endif
-
- /* #define ALIGN 2 /* Word alignment */
-
- /*
- * strings.h/string.h. If you have no <string.h> on your system,
- * define STRINGS and <strings.h> will be included instead.
- */
-
- /* #define STRINGS /* */
-
- /*
- * str(r)chr/(r)index. If you have no str(r)chr(3) on your system, define
- * INDEX and (r)index(3) will be used instead.
- */
-
- /* #define INDEX /* */
-
- /*
- * memcpy/bcopy. If you have no memcpy(3), but you do have bcopy(3),
- * define BCOPY.
- */
-
- /* #define BCOPY /* */
-
- /*
- * Void types. If your compiler does not handle any of these types,
- * define them to something it will handle. The recognised types will
- * be used if these macros are not defined.
- */
-
- /* #define VOID int /* replacement for "void" */
- /* #define VOID_PTR char * /* replacement for "void *" */
- /* #define VOID_PTR_PTR char ** /* replacement for "void **" */
-
- /*
- * SYSV. If you have a System-V or System-V-based system, define
- * SYSV. This will activate the following assumptions:
- *
- * - Include <time.h> instead of <sys/time.h>.
- * - File names may not exceed 14 characters.
- * - No "d_namlen" field in DIRENT structure.
- * - Include <fcntl.h> to get O_CREAT, etc.
- */
-
- /* #define SYSV /* */
-
-
- /************************************************
- * NOTHING PAST HERE SHOULD NEED TO BE MODIFIED *
- ************************************************/
-
- #ifdef NDBM
-
- # include <ndbm.h>
- # define DBM_fetch(db, key) dbm_fetch (db, key)
- # define DBM_store(db, key, val) \
- dbm_store(db, key, val, DBM_REPLACE)
- # define DBM_delete(db, key) dbm_delete (db, key)
- # define DBM_firstkey(db) dbm_firstkey (db)
- # define DBM_nextkey(db, key) dbm_nextkey (db)
-
- # define DBM_close(db) if (! (db)) ; else dbm_close (db)
-
- #else
-
- # include <dbm.h>
- # define DBM_fetch(db, key) fetch (key)
- # define DBM_store(db, key, val) \
- store(key, val)
- # define DBM_delete(db, key) dbm_delete (key)
- # define DBM_firstkey(db) dbm_firstkey ()
- # define DBM_nextkey(db, key) dbm_nextkey (key)
-
- # ifdef NO_DBMCLOSE
- # define DBM_close(db)
- # else
- # define DBM_close(db) dbmclose ()
- # endif
-
- # ifdef NULL
- # undef NULL /* Aaaaaaarrrrgghhh! */
- # endif
- #endif
-
- /* This will probably be needed by one of the next three */
- #include <sys/types.h>
-
- #ifdef DIRENT
- # include <dirent.h>
- # undef DIRENT
- #else
- # ifdef SYS_DIR
- # include <sys/dir.h>
- # undef SYS_DIR
- # else
- # ifdef SYS_NDIR
- # include <sys/ndir.h>
- # undef SYS_NDIR
- # endif
- # endif
- #endif
-
- #ifdef DIRECT
- # define DIRENT struct direct
- # undef DIRECT
- #else
- # define DIRENT struct dirent
- #endif
-
- #ifdef ALIGN
- # if ALIGN == 1
- # undef ALIGN
- # endif
- #endif
-
- #ifdef STRINGS
- # include <strings.h>
- # undef STRINGS
- #else
- # include <string.h>
- #endif
-
- #ifdef INDEX
- # define strchr index
- # define strrchr rindex
- # undef INDEX
- #endif
-
- #ifdef BCOPY
- # define memcpy(d,s,c) bcopy(s,d,c)
- # undef BCOPY
- #endif
-
- #ifndef VOID
- # define VOID void
- #endif
- #ifndef VOID_PTR
- # define VOID_PTR void *
- #endif
- #ifndef VOID_PTR_PTR
- # define VOID_PTR_PTR void **
- #endif
-
- /* Miscellaneous */
- #ifndef TRUE
- #define TRUE 1
- #define FALSE 0
- #endif
-
- #ifndef EOS
- #define EOS '\0'
- #endif
-
- #ifndef NULL_CP
- #define NULL_CP ((char *) 0)
- #endif
-
- #ifndef print
- #define print(s) fputs (s, stdout)
- #define printc(c) putc (c, stdout)
- #endif
-
- #endif /* _CONFIG_H_ */
-