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