Eliminate '#ifdef HAVE_FOO' for Posix-mandated FOOs.
[mmh] / h / nmh.h
1 /*
2 ** nmh.h -- system configuration header file
3 */
4
5 #include <config.h>
6
7 #include <unistd.h>
8 #include <stdio.h>
9 #include <ctype.h>
10 #include <sys/stat.h>
11
12 #if HAVE_DIRENT_H
13 # include <dirent.h>
14 # define NLENGTH(dirent) strlen((dirent)->d_name)
15 #else
16 # define dirent direct
17 # define NLENGTH(dirent) (dirent)->d_namlen
18 # if HAVE_SYS_NDIR_H
19 #  include <sys/ndir.h>
20 # endif
21 # if HAVE_SYS_DIR_H
22 #  include <sys/dir.h>
23 # endif
24 # if HAVE_NDIR_H
25 #  include <ndir.h>
26 # endif
27 #endif
28
29 #include <stdlib.h>
30 #include <stdarg.h>
31 #include <string.h>
32
33 #ifdef HAVE_SYS_PARAM_H
34 # include <sys/param.h>
35 #endif
36
37 #include <locale.h>
38 #include <limits.h>
39
40 /*
41 ** symbolic constants for lseek and fseek
42 */
43 #ifndef SEEK_SET
44 # define SEEK_SET 0
45 #endif
46 #ifndef SEEK_CUR
47 # define SEEK_CUR 1
48 #endif
49 #ifndef SEEK_END
50 # define SEEK_END 2
51 #endif
52
53 /*
54 ** we should be getting this value from pathconf(_PC_PATH_MAX)
55 */
56 #ifndef PATH_MAX
57 # ifdef MAXPATHLEN
58 #  define PATH_MAX MAXPATHLEN
59 # else
60    /* so we will just pick something */
61 #  define PATH_MAX 1024
62 # endif
63 #endif
64
65 /*
66 ** we should be getting this value from sysconf(_SC_OPEN_MAX)
67 */
68 #ifndef OPEN_MAX
69 # ifdef NOFILE
70 #  define OPEN_MAX NOFILE
71 # else
72    /* so we will just pick something */
73 #  define OPEN_MAX 64
74 # endif
75 #endif
76
77 #include <signal.h>
78
79 /*
80 ** If your stat macros are broken,
81 ** we will just undefine them.
82 */
83 #ifdef STAT_MACROS_BROKEN
84 # ifdef S_ISBLK
85 #  undef S_ISBLK
86 # endif
87 # ifdef S_ISCHR
88 #  undef S_ISCHR
89 # endif
90 # ifdef S_ISDIR
91 #  undef S_ISDIR
92 # endif
93 # ifdef S_ISFIFO
94 #  undef S_ISFIFO
95 # endif
96 # ifdef S_ISLNK
97 #  undef S_ISLNK
98 # endif
99 # ifdef S_ISMPB
100 #  undef S_ISMPB
101 # endif
102 # ifdef S_ISMPC
103 #  undef S_ISMPC
104 # endif
105 # ifdef S_ISNWK
106 #  undef S_ISNWK
107 # endif
108 # ifdef S_ISREG
109 #  undef S_ISREG
110 # endif
111 # ifdef S_ISSOCK
112 #  undef S_ISSOCK
113 # endif
114 #endif  /* STAT_MACROS_BROKEN.  */