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