Reformated comments and long lines
[mmh] / h / nmh.h
1 /*
2 ** nmh.h -- system configuration header file
3 */
4
5 #include <config.h>
6
7 #ifdef HAVE_UNISTD_H
8 # include <sys/types.h>
9 # include <unistd.h>
10 #endif
11
12 #include <stdio.h>
13 #include <ctype.h>
14 #include <sys/stat.h>
15
16 #if HAVE_DIRENT_H
17 # include <dirent.h>
18 # define NLENGTH(dirent) strlen((dirent)->d_name)
19 #else
20 # define dirent direct
21 # define NLENGTH(dirent) (dirent)->d_namlen
22 # if HAVE_SYS_NDIR_H
23 #  include <sys/ndir.h>
24 # endif
25 # if HAVE_SYS_DIR_H
26 #  include <sys/dir.h>
27 # endif
28 # if HAVE_NDIR_H
29 #  include <ndir.h>
30 # endif
31 #endif
32
33 #ifdef HAVE_STDLIB_H
34 # include <stdlib.h>
35 #endif
36
37 #include <stdarg.h>
38
39 #if STDC_HEADERS || HAVE_STRING_H
40 # include <string.h>
41 /* An ANSI string.h and pre-ANSI memory.h might conflict.  */
42 # if !STDC_HEADERS && HAVE_MEMORY_H
43 #  include <memory.h>
44 # endif /* not STDC_HEADERS and HAVE_MEMORY_H */
45 #else   /* not STDC_HEADERS and not HAVE_STRING_H */
46 # include <strings.h>
47 /* memory.h and strings.h conflict on some systems.  */
48 #endif /* not STDC_HEADERS and not HAVE_STRING_H */
49
50 #ifdef HAVE_SYS_PARAM_H
51 # include <sys/param.h>
52 #endif
53
54 #ifdef HAVE_LOCALE_H
55 # include <locale.h>
56 #endif
57
58 #ifdef HAVE_LIMITS_H
59 # include <limits.h>
60 #endif
61
62 /*
63 ** symbolic constants for lseek and fseek
64 */
65 #ifndef SEEK_SET
66 # define SEEK_SET 0
67 #endif
68 #ifndef SEEK_CUR
69 # define SEEK_CUR 1
70 #endif
71 #ifndef SEEK_END
72 # define SEEK_END 2
73 #endif
74
75 /*
76 ** we should be getting this value from pathconf(_PC_PATH_MAX)
77 */
78 #ifndef PATH_MAX
79 # ifdef MAXPATHLEN
80 #  define PATH_MAX MAXPATHLEN
81 # else
82    /* so we will just pick something */
83 #  define PATH_MAX 1024
84 # endif
85 #endif
86
87 /*
88 ** we should get this value from sysconf(_SC_NGROUPS_MAX)
89 */
90 #ifndef NGROUPS_MAX
91 # ifdef NGROUPS
92 #  define NGROUPS_MAX NGROUPS
93 # else
94 #  define NGROUPS_MAX 16
95 # endif
96 #endif
97
98 /*
99 ** we should be getting this value from sysconf(_SC_OPEN_MAX)
100 */
101 #ifndef OPEN_MAX
102 # ifdef NOFILE
103 #  define OPEN_MAX NOFILE
104 # else
105    /* so we will just pick something */
106 #  define OPEN_MAX 64
107 # endif
108 #endif
109
110 #include <signal.h>
111
112 #define bcmp(b1,b2,length)      memcmp(b1, b2, length)
113 #define bcopy(b1,b2,length)     memcpy (b2, b1, length)
114 #define bcpy(b1,b2,length)      memcmp (b1, b2, length)
115 #define bzero(b,length)         memset (b, 0, length)
116
117 #ifdef HAVE_KILLPG
118 # define KILLPG(pgrp,sig) killpg(pgrp,sig);
119 #else
120 # define KILLPG(pgrp,sig) kill((-pgrp),sig);
121 #endif
122
123 /*
124 ** If your stat macros are broken,
125 ** we will just undefine them.
126 */
127 #ifdef STAT_MACROS_BROKEN
128 # ifdef S_ISBLK
129 #  undef S_ISBLK
130 # endif
131 # ifdef S_ISCHR
132 #  undef S_ISCHR
133 # endif
134 # ifdef S_ISDIR
135 #  undef S_ISDIR
136 # endif
137 # ifdef S_ISFIFO
138 #  undef S_ISFIFO
139 # endif
140 # ifdef S_ISLNK
141 #  undef S_ISLNK
142 # endif
143 # ifdef S_ISMPB
144 #  undef S_ISMPB
145 # endif
146 # ifdef S_ISMPC
147 #  undef S_ISMPC
148 # endif
149 # ifdef S_ISNWK
150 #  undef S_ISNWK
151 # endif
152 # ifdef S_ISREG
153 #  undef S_ISREG
154 # endif
155 # ifdef S_ISSOCK
156 #  undef S_ISSOCK
157 # endif
158 #endif  /* STAT_MACROS_BROKEN.  */