896786f54cbf0d8ed82e04340e8b3bc07837259c
[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 be getting this value from sysconf(_SC_OPEN_MAX)
89 */
90 #ifndef OPEN_MAX
91 # ifdef NOFILE
92 #  define OPEN_MAX NOFILE
93 # else
94    /* so we will just pick something */
95 #  define OPEN_MAX 64
96 # endif
97 #endif
98
99 #include <signal.h>
100
101 /*
102 ** If your stat macros are broken,
103 ** we will just undefine them.
104 */
105 #ifdef STAT_MACROS_BROKEN
106 # ifdef S_ISBLK
107 #  undef S_ISBLK
108 # endif
109 # ifdef S_ISCHR
110 #  undef S_ISCHR
111 # endif
112 # ifdef S_ISDIR
113 #  undef S_ISDIR
114 # endif
115 # ifdef S_ISFIFO
116 #  undef S_ISFIFO
117 # endif
118 # ifdef S_ISLNK
119 #  undef S_ISLNK
120 # endif
121 # ifdef S_ISMPB
122 #  undef S_ISMPB
123 # endif
124 # ifdef S_ISMPC
125 #  undef S_ISMPC
126 # endif
127 # ifdef S_ISNWK
128 #  undef S_ISNWK
129 # endif
130 # ifdef S_ISREG
131 #  undef S_ISREG
132 # endif
133 # ifdef S_ISSOCK
134 #  undef S_ISSOCK
135 # endif
136 #endif  /* STAT_MACROS_BROKEN.  */