home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Source Code 1993 July / THE_SOURCE_CODE_CD_ROM.iso / bsd_srcs / usr.sbin / amd / include / config.h < prev    next >
Encoding:
C/C++ Source or Header  |  1991-05-12  |  4.3 KB  |  143 lines

  1. /*
  2.  * Copyright (c) 1990 Jan-Simon Pendry
  3.  * Copyright (c) 1990 Imperial College of Science, Technology & Medicine
  4.  * Copyright (c) 1990 The Regents of the University of California.
  5.  * 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.  * Redistribution and use in source and binary forms, with or without
  11.  * modification, are permitted provided that the following conditions
  12.  * are met:
  13.  * 1. Redistributions of source code must retain the above copyright
  14.  *    notice, this list of conditions and the following disclaimer.
  15.  * 2. Redistributions in binary form must reproduce the above copyright
  16.  *    notice, this list of conditions and the following disclaimer in the
  17.  *    documentation and/or other materials provided with the distribution.
  18.  * 3. All advertising materials mentioning features or use of this software
  19.  *    must display the following acknowledgement:
  20.  *    This product includes software developed by the University of
  21.  *    California, Berkeley and its contributors.
  22.  * 4. Neither the name of the University nor the names of its contributors
  23.  *    may be used to endorse or promote products derived from this software
  24.  *    without specific prior written permission.
  25.  *
  26.  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  27.  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  28.  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  29.  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  30.  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  31.  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  32.  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  33.  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  34.  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  35.  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  36.  * SUCH DAMAGE.
  37.  *
  38.  *    @(#)config.h    5.2 (Berkeley) 5/12/91
  39.  *
  40.  * $Id: config.h,v 5.2.1.4 91/05/07 22:19:20 jsp Alpha $
  41.  *
  42.  */
  43.  
  44. /*
  45.  * Get this in now so that OS_HDR can use it
  46.  */
  47. #ifdef __STDC__
  48. #define    P(x) x
  49. #define    P_void void
  50. #define    Const const
  51. #else
  52. #define P(x) ()
  53. #define P_void /* as nothing */
  54. #define Const /* as nothing */
  55. #endif /* __STDC__ */
  56.  
  57. #ifdef __GNUC__
  58. #define INLINE /* __inline */
  59. #else
  60. #define    INLINE
  61. #endif /* __GNUC__ */
  62.  
  63. /*
  64.  * Pick up target dependent definitions
  65.  */
  66. #include "os-defaults.h"
  67. #include OS_HDR
  68.  
  69. #ifdef VOIDP
  70. typedef void *voidp;
  71. #else
  72. typedef char *voidp;
  73. #endif /* VOIDP */
  74.  
  75. #include <stdio.h>
  76. #include <sys/types.h>
  77. #include <sys/errno.h>
  78. extern int errno;
  79. #include <sys/time.h>
  80.  
  81. #define clocktime() (clock_valid ? clock_valid : time(&clock_valid))
  82. extern time_t time P((time_t *));
  83. extern time_t clock_valid;    /* Clock needs recalculating */
  84.  
  85. extern char *progname;        /* "amd"|"mmd" */
  86. extern char hostname[];        /* "kiska" */
  87. extern int mypid;        /* Current process id */
  88.  
  89. #ifdef HAS_SYSLOG
  90. extern int syslogging;        /* Really using syslog */
  91. #endif /* HAS_SYSLOG */
  92. extern FILE *logfp;        /* Log file */
  93. extern int xlog_level;        /* Logging level */
  94. extern int xlog_level_init;
  95.  
  96. extern int orig_umask;        /* umask() on startup */
  97.  
  98. #define    XLOG_FATAL    0x0001
  99. #define    XLOG_ERROR    0x0002
  100. #define    XLOG_USER    0x0004
  101. #define    XLOG_WARNING    0x0008
  102. #define    XLOG_INFO    0x0010
  103. #define    XLOG_DEBUG    0x0020
  104. #define    XLOG_MAP    0x0040
  105. #define    XLOG_STATS    0x0080
  106.  
  107. #define XLOG_DEFSTR    "all,nomap,nostats"        /* Default log options */
  108. #define XLOG_ALL    (XLOG_FATAL|XLOG_ERROR|XLOG_USER|XLOG_WARNING|XLOG_INFO|XLOG_MAP|XLOG_STATS)
  109.  
  110. #ifdef DEBUG
  111. #define    D_ALL    (~0)
  112.  
  113. #ifdef DEBUG_MEM
  114. #define free(x) xfree(__FILE__,__LINE__,x)
  115. #endif /* DEBUG_MEM */
  116.  
  117. #define Debug(x) if (!(debug_flags & (x))) ; else
  118. #define dlog Debug(D_FULL) dplog
  119. #endif /* DEBUG */
  120.  
  121. /*
  122.  * Option tables
  123.  */
  124. struct opt_tab {
  125.     char *opt;
  126.     int flag;
  127. };
  128.  
  129. extern struct opt_tab xlog_opt[];
  130.  
  131. extern int cmdoption P((char*, struct opt_tab*, int*));
  132. extern void going_down P((int));
  133. #ifdef DEBUG
  134. extern void dplog ();
  135. /*extern void dplog P((char*, ...));*/
  136. #endif /* DEBUG */
  137. extern void plog ();
  138. /*extern void plog P((int, char*, ...));*/
  139. extern void show_opts P((int ch, struct opt_tab*));
  140. extern char* strchr P((const char*, int)); /* C */
  141. extern voidp xmalloc P((int));
  142. extern voidp xrealloc P((voidp, int));
  143.