147528Spendry /* 247528Spendry * Copyright (c) 1990 Jan-Simon Pendry 347528Spendry * Copyright (c) 1990 Imperial College of Science, Technology & Medicine 4*61794Sbostic * Copyright (c) 1990, 1993 5*61794Sbostic * The Regents of the University of California. All rights reserved. 647528Spendry * 747528Spendry * This code is derived from software contributed to Berkeley by 847528Spendry * Jan-Simon Pendry at Imperial College, London. 947528Spendry * 1047528Spendry * %sccs.include.redist.c% 1147528Spendry * 12*61794Sbostic * @(#)config.h 8.1 (Berkeley) 06/06/93 1349688Spendry * 1452456Spendry * $Id: config.h,v 5.2.2.1 1992/02/09 15:09:56 jsp beta $ 1549688Spendry * 1647528Spendry */ 1747528Spendry 1847528Spendry /* 1947528Spendry * Get this in now so that OS_HDR can use it 2047528Spendry */ 2147528Spendry #ifdef __STDC__ 2247528Spendry #define P(x) x 2347528Spendry #define P_void void 2447528Spendry #define Const const 2547528Spendry #else 2647528Spendry #define P(x) () 2747528Spendry #define P_void /* as nothing */ 2847528Spendry #define Const /* as nothing */ 2947528Spendry #endif /* __STDC__ */ 3047528Spendry 3147528Spendry #ifdef __GNUC__ 3247528Spendry #define INLINE /* __inline */ 3347528Spendry #else 3447528Spendry #define INLINE 3547528Spendry #endif /* __GNUC__ */ 3647528Spendry 3747528Spendry /* 3847528Spendry * Pick up target dependent definitions 3947528Spendry */ 4047528Spendry #include "os-defaults.h" 4147528Spendry #include OS_HDR 4247528Spendry 4347528Spendry #ifdef VOIDP 4447528Spendry typedef void *voidp; 4547528Spendry #else 4647528Spendry typedef char *voidp; 4747528Spendry #endif /* VOIDP */ 4847528Spendry 4947528Spendry #include <stdio.h> 5047528Spendry #include <sys/types.h> 5147528Spendry #include <sys/errno.h> 5247528Spendry extern int errno; 5347528Spendry #include <sys/time.h> 5447528Spendry 5547528Spendry #define clocktime() (clock_valid ? clock_valid : time(&clock_valid)) 5647528Spendry extern time_t time P((time_t *)); 5747528Spendry extern time_t clock_valid; /* Clock needs recalculating */ 5847528Spendry 5947528Spendry extern char *progname; /* "amd"|"mmd" */ 6047528Spendry extern char hostname[]; /* "kiska" */ 6147528Spendry extern int mypid; /* Current process id */ 6247528Spendry 6347528Spendry #ifdef HAS_SYSLOG 6447528Spendry extern int syslogging; /* Really using syslog */ 6547528Spendry #endif /* HAS_SYSLOG */ 6647528Spendry extern FILE *logfp; /* Log file */ 6747528Spendry extern int xlog_level; /* Logging level */ 6847528Spendry extern int xlog_level_init; 6947528Spendry 7047528Spendry extern int orig_umask; /* umask() on startup */ 7147528Spendry 7247528Spendry #define XLOG_FATAL 0x0001 7347528Spendry #define XLOG_ERROR 0x0002 7447528Spendry #define XLOG_USER 0x0004 7547528Spendry #define XLOG_WARNING 0x0008 7647528Spendry #define XLOG_INFO 0x0010 7747528Spendry #define XLOG_DEBUG 0x0020 7847528Spendry #define XLOG_MAP 0x0040 7947528Spendry #define XLOG_STATS 0x0080 8047528Spendry 8147528Spendry #define XLOG_DEFSTR "all,nomap,nostats" /* Default log options */ 8247528Spendry #define XLOG_ALL (XLOG_FATAL|XLOG_ERROR|XLOG_USER|XLOG_WARNING|XLOG_INFO|XLOG_MAP|XLOG_STATS) 8347528Spendry 8447528Spendry #ifdef DEBUG 8547528Spendry #define D_ALL (~0) 8647528Spendry 8747528Spendry #ifdef DEBUG_MEM 8847528Spendry #define free(x) xfree(__FILE__,__LINE__,x) 8947528Spendry #endif /* DEBUG_MEM */ 9047528Spendry 9147528Spendry #define Debug(x) if (!(debug_flags & (x))) ; else 9247528Spendry #define dlog Debug(D_FULL) dplog 9347528Spendry #endif /* DEBUG */ 9447528Spendry 9547528Spendry /* 9647528Spendry * Option tables 9747528Spendry */ 9847528Spendry struct opt_tab { 9947528Spendry char *opt; 10047528Spendry int flag; 10147528Spendry }; 10247528Spendry 10347528Spendry extern struct opt_tab xlog_opt[]; 10447528Spendry 10547528Spendry extern int cmdoption P((char*, struct opt_tab*, int*)); 10647528Spendry extern void going_down P((int)); 10747528Spendry #ifdef DEBUG 10847528Spendry extern void dplog (); 10947528Spendry /*extern void dplog P((char*, ...));*/ 11047528Spendry #endif /* DEBUG */ 11147528Spendry extern void plog (); 11247528Spendry /*extern void plog P((int, char*, ...));*/ 11347528Spendry extern void show_opts P((int ch, struct opt_tab*)); 11447528Spendry extern char* strchr P((const char*, int)); /* C */ 11547528Spendry extern voidp xmalloc P((int)); 11647528Spendry extern voidp xrealloc P((voidp, int)); 117