157e4188dSpendry /* 257e4188dSpendry * Copyright (c) 1990 Jan-Simon Pendry 357e4188dSpendry * Copyright (c) 1990 Imperial College of Science, Technology & Medicine 4*7ef864c8Sbostic * Copyright (c) 1990, 1993 5*7ef864c8Sbostic * The Regents of the University of California. All rights reserved. 657e4188dSpendry * 757e4188dSpendry * This code is derived from software contributed to Berkeley by 857e4188dSpendry * Jan-Simon Pendry at Imperial College, London. 957e4188dSpendry * 1057e4188dSpendry * %sccs.include.redist.c% 1157e4188dSpendry * 12*7ef864c8Sbostic * @(#)config.h 8.1 (Berkeley) 06/06/93 137bdb2592Spendry * 14b7538d8bSpendry * $Id: config.h,v 5.2.2.1 1992/02/09 15:09:56 jsp beta $ 157bdb2592Spendry * 1657e4188dSpendry */ 1757e4188dSpendry 1857e4188dSpendry /* 1957e4188dSpendry * Get this in now so that OS_HDR can use it 2057e4188dSpendry */ 2157e4188dSpendry #ifdef __STDC__ 2257e4188dSpendry #define P(x) x 2357e4188dSpendry #define P_void void 2457e4188dSpendry #define Const const 2557e4188dSpendry #else 2657e4188dSpendry #define P(x) () 2757e4188dSpendry #define P_void /* as nothing */ 2857e4188dSpendry #define Const /* as nothing */ 2957e4188dSpendry #endif /* __STDC__ */ 3057e4188dSpendry 3157e4188dSpendry #ifdef __GNUC__ 3257e4188dSpendry #define INLINE /* __inline */ 3357e4188dSpendry #else 3457e4188dSpendry #define INLINE 3557e4188dSpendry #endif /* __GNUC__ */ 3657e4188dSpendry 3757e4188dSpendry /* 3857e4188dSpendry * Pick up target dependent definitions 3957e4188dSpendry */ 4057e4188dSpendry #include "os-defaults.h" 4157e4188dSpendry #include OS_HDR 4257e4188dSpendry 4357e4188dSpendry #ifdef VOIDP 4457e4188dSpendry typedef void *voidp; 4557e4188dSpendry #else 4657e4188dSpendry typedef char *voidp; 4757e4188dSpendry #endif /* VOIDP */ 4857e4188dSpendry 4957e4188dSpendry #include <stdio.h> 5057e4188dSpendry #include <sys/types.h> 5157e4188dSpendry #include <sys/errno.h> 5257e4188dSpendry extern int errno; 5357e4188dSpendry #include <sys/time.h> 5457e4188dSpendry 5557e4188dSpendry #define clocktime() (clock_valid ? clock_valid : time(&clock_valid)) 5657e4188dSpendry extern time_t time P((time_t *)); 5757e4188dSpendry extern time_t clock_valid; /* Clock needs recalculating */ 5857e4188dSpendry 5957e4188dSpendry extern char *progname; /* "amd"|"mmd" */ 6057e4188dSpendry extern char hostname[]; /* "kiska" */ 6157e4188dSpendry extern int mypid; /* Current process id */ 6257e4188dSpendry 6357e4188dSpendry #ifdef HAS_SYSLOG 6457e4188dSpendry extern int syslogging; /* Really using syslog */ 6557e4188dSpendry #endif /* HAS_SYSLOG */ 6657e4188dSpendry extern FILE *logfp; /* Log file */ 6757e4188dSpendry extern int xlog_level; /* Logging level */ 6857e4188dSpendry extern int xlog_level_init; 6957e4188dSpendry 7057e4188dSpendry extern int orig_umask; /* umask() on startup */ 7157e4188dSpendry 7257e4188dSpendry #define XLOG_FATAL 0x0001 7357e4188dSpendry #define XLOG_ERROR 0x0002 7457e4188dSpendry #define XLOG_USER 0x0004 7557e4188dSpendry #define XLOG_WARNING 0x0008 7657e4188dSpendry #define XLOG_INFO 0x0010 7757e4188dSpendry #define XLOG_DEBUG 0x0020 7857e4188dSpendry #define XLOG_MAP 0x0040 7957e4188dSpendry #define XLOG_STATS 0x0080 8057e4188dSpendry 8157e4188dSpendry #define XLOG_DEFSTR "all,nomap,nostats" /* Default log options */ 8257e4188dSpendry #define XLOG_ALL (XLOG_FATAL|XLOG_ERROR|XLOG_USER|XLOG_WARNING|XLOG_INFO|XLOG_MAP|XLOG_STATS) 8357e4188dSpendry 8457e4188dSpendry #ifdef DEBUG 8557e4188dSpendry #define D_ALL (~0) 8657e4188dSpendry 8757e4188dSpendry #ifdef DEBUG_MEM 8857e4188dSpendry #define free(x) xfree(__FILE__,__LINE__,x) 8957e4188dSpendry #endif /* DEBUG_MEM */ 9057e4188dSpendry 9157e4188dSpendry #define Debug(x) if (!(debug_flags & (x))) ; else 9257e4188dSpendry #define dlog Debug(D_FULL) dplog 9357e4188dSpendry #endif /* DEBUG */ 9457e4188dSpendry 9557e4188dSpendry /* 9657e4188dSpendry * Option tables 9757e4188dSpendry */ 9857e4188dSpendry struct opt_tab { 9957e4188dSpendry char *opt; 10057e4188dSpendry int flag; 10157e4188dSpendry }; 10257e4188dSpendry 10357e4188dSpendry extern struct opt_tab xlog_opt[]; 10457e4188dSpendry 10557e4188dSpendry extern int cmdoption P((char*, struct opt_tab*, int*)); 10657e4188dSpendry extern void going_down P((int)); 10757e4188dSpendry #ifdef DEBUG 10857e4188dSpendry extern void dplog (); 10957e4188dSpendry /*extern void dplog P((char*, ...));*/ 11057e4188dSpendry #endif /* DEBUG */ 11157e4188dSpendry extern void plog (); 11257e4188dSpendry /*extern void plog P((int, char*, ...));*/ 11357e4188dSpendry extern void show_opts P((int ch, struct opt_tab*)); 11457e4188dSpendry extern char* strchr P((const char*, int)); /* C */ 11557e4188dSpendry extern voidp xmalloc P((int)); 11657e4188dSpendry extern voidp xrealloc P((voidp, int)); 117