1 /* 2 * Copyright (c) 1990 Jan-Simon Pendry 3 * Copyright (c) 1990 Imperial College of Science, Technology & Medicine 4 * Copyright (c) 1990, 1993 5 * The Regents of the University of California. All rights reserved. 6 * 7 * This code is derived from software contributed to Berkeley by 8 * Jan-Simon Pendry at Imperial College, London. 9 * 10 * %sccs.include.redist.c% 11 * 12 * @(#)config.h 8.1 (Berkeley) 06/06/93 13 * 14 * $Id: config.h,v 5.2.2.1 1992/02/09 15:09:56 jsp beta $ 15 * 16 */ 17 18 /* 19 * Get this in now so that OS_HDR can use it 20 */ 21 #ifdef __STDC__ 22 #define P(x) x 23 #define P_void void 24 #define Const const 25 #else 26 #define P(x) () 27 #define P_void /* as nothing */ 28 #define Const /* as nothing */ 29 #endif /* __STDC__ */ 30 31 #ifdef __GNUC__ 32 #define INLINE /* __inline */ 33 #else 34 #define INLINE 35 #endif /* __GNUC__ */ 36 37 /* 38 * Pick up target dependent definitions 39 */ 40 #include "os-defaults.h" 41 #include OS_HDR 42 43 #ifdef VOIDP 44 typedef void *voidp; 45 #else 46 typedef char *voidp; 47 #endif /* VOIDP */ 48 49 #include <stdio.h> 50 #include <sys/types.h> 51 #include <sys/errno.h> 52 extern int errno; 53 #include <sys/time.h> 54 55 #define clocktime() (clock_valid ? clock_valid : time(&clock_valid)) 56 extern time_t time P((time_t *)); 57 extern time_t clock_valid; /* Clock needs recalculating */ 58 59 extern char *progname; /* "amd"|"mmd" */ 60 extern char hostname[]; /* "kiska" */ 61 extern int mypid; /* Current process id */ 62 63 #ifdef HAS_SYSLOG 64 extern int syslogging; /* Really using syslog */ 65 #endif /* HAS_SYSLOG */ 66 extern FILE *logfp; /* Log file */ 67 extern int xlog_level; /* Logging level */ 68 extern int xlog_level_init; 69 70 extern int orig_umask; /* umask() on startup */ 71 72 #define XLOG_FATAL 0x0001 73 #define XLOG_ERROR 0x0002 74 #define XLOG_USER 0x0004 75 #define XLOG_WARNING 0x0008 76 #define XLOG_INFO 0x0010 77 #define XLOG_DEBUG 0x0020 78 #define XLOG_MAP 0x0040 79 #define XLOG_STATS 0x0080 80 81 #define XLOG_DEFSTR "all,nomap,nostats" /* Default log options */ 82 #define XLOG_ALL (XLOG_FATAL|XLOG_ERROR|XLOG_USER|XLOG_WARNING|XLOG_INFO|XLOG_MAP|XLOG_STATS) 83 84 #ifdef DEBUG 85 #define D_ALL (~0) 86 87 #ifdef DEBUG_MEM 88 #define free(x) xfree(__FILE__,__LINE__,x) 89 #endif /* DEBUG_MEM */ 90 91 #define Debug(x) if (!(debug_flags & (x))) ; else 92 #define dlog Debug(D_FULL) dplog 93 #endif /* DEBUG */ 94 95 /* 96 * Option tables 97 */ 98 struct opt_tab { 99 char *opt; 100 int flag; 101 }; 102 103 extern struct opt_tab xlog_opt[]; 104 105 extern int cmdoption P((char*, struct opt_tab*, int*)); 106 extern void going_down P((int)); 107 #ifdef DEBUG 108 extern void dplog (); 109 /*extern void dplog P((char*, ...));*/ 110 #endif /* DEBUG */ 111 extern void plog (); 112 /*extern void plog P((int, char*, ...));*/ 113 extern void show_opts P((int ch, struct opt_tab*)); 114 extern char* strchr P((const char*, int)); /* C */ 115 extern voidp xmalloc P((int)); 116 extern voidp xrealloc P((voidp, int)); 117