File: os.h

package info (click to toggle)
yiff 2.06-3
  • links: PTS
  • area: main
  • in suites: potato
  • size: 3,464 kB
  • ctags: 3,028
  • sloc: ansic: 47,463; makefile: 218; sh: 77
file content (300 lines) | stat: -rw-r--r-- 5,816 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
/*
          Operating System Specific and `Make Up' Definations


	Most of these definations are assumptions, compiled in
	if the system is missing any ANSI C standard definations.

	In ADDITION there are program specific definations here
	for system level values.

 */


#ifndef OS_H
#define OS_H

#include <limits.h>


/* *******************************************************************
 *
 *                         Terminal sizes
 *
 *	These are not standards but some default must be set for
 *	them.
 */
#ifndef STD_TERMINAL_COLUMS
# define STD_TERMINAL_COLUMS	80
#endif

#ifndef STD_TERMINAL_ROWS
# define STD_TERMINAL_ROWS 	23	/* or should this be 25? */
#endif




/* *******************************************************************
 *
 *                          Object Paths
 *
 *	These should be defined for UNIXes, standard UNIX paths.
 */
#ifndef __PATH_ETC_INET
# define __PATH_ETC_INET	"/etc"
#endif

#ifndef _PATH_DEVNULL
# define _PATH_DEVNULL		"/dev/null"
#endif

#ifndef _PATH_MAILDIR
# define _PATH_MAILDIR		"/var/spool/mail"
#endif

/* Apparently VI has become the standard editor for UNIX. */
#ifndef _PATH_VI
# define _PATH_VI		"/usr/bin/vi"
#endif


/*
 *	Directories (UNIX standard):
 *
 *	Note: tailing slash should exist under rule of standard.
 */
#ifndef _PATH_ETC
# define _PATH_ETC		"/etc/"
#endif

#ifndef _PATH_DEV
# define _PATH_DEV		"/dev/"
#endif

#ifndef _PATH_TMP
# define _PATH_TMP		"/tmp/"
#endif

#ifndef _PATH_VARRUN
# define _PATH_VARRUN		"/var/run/"
#endif

#ifndef _PATH_VARTMP
# define _PATH_VARTMP		"/var/tmp/"
#endif


/* *******************************************************************
 *
 *                         Size limits
 *
 *	Limits based on Linux i386.
 *
 *	YOUR SYSTEM SHOULD ALREADY HAVE THESE DEFINED UNDER
 *	ANSI C STANDARD!
 */
/*
#ifndef NR_OPEN
# define NR_OPEN	256	
#endif
*/

#ifndef NGROUPS_MAX
# define NGROUPS_MAX	32	/* supplemental group IDs are available */
#endif

#ifndef ARG_MAX
# define ARG_MAX	131072    /* # bytes of args + environ for exec() */
#endif

#ifndef CHILD_MAX
# define CHILD_MAX	999    /* no limit :-) */
#endif

#ifndef OPEN_MAX
# define OPEN_MAX	256    /* # open files a process may have */
#endif

#ifndef LINK_MAX
# define LINK_MAX	127    /* # links a file may have */
#endif

#ifndef MAX_CANON
# define MAX_CANON	255    /* size of the canonical input queue */
#endif

#ifndef MAX_INPUT
# define MAX_INPUT	255    /* size of the type-ahead buffer */
#endif

#ifndef NAME_MAX
# define NAME_MAX	255	/* # chars in a file name */
#endif

#ifndef PATH_MAX
# define PATH_MAX	1024	/* # chars in a path name */
#endif

#ifndef PIPE_BUF
# define PIPE_BUF	4096	/* # bytes in atomic write to a pipe */
#endif

#ifndef CMD_MAX
# define CMD_MAX	ARG_MAX	/* Same as ARG_MAX. */
#endif


/*
 *      Network limits (not ANSI C standard, but BSD standard).
 */
#ifndef HOST_NAME_MAX
# define HOST_NAME_MAX          128
#endif

#ifndef MAX_URL_LEN
# define MAX_URL_LEN            1024
#endif



/* *********************************************************************
 *
 *                             Bit Types
 *
 *	These are defaulted to the i386 archatecture.
 *
 *	Byte orderings are in `Intel notation'.
 */
#if defined(__SOLARIS__)

/* Robin Lee Powell: rlpowell at solect.com
 * Solaris apparently has uint*_t defined instead of u_int*_t defined.
 */

#include <sys/types.h>

# ifdef uint8_t
#  define u_int8_t	uint8_t
# endif
# ifndef u_int8_t
#  define u_int8_t	unsigned char
# endif

# ifdef uint16_t
#  define u_int16_t	uint16_t
# endif
# ifndef u_int16_t
#  define u_int16_t	unsigned short
# endif

# ifdef uint32_t
#  define u_int32_t	uint32_t
# endif
# ifndef u_int32_t
#  define u_int32_t     unsigned int
# endif

# ifdef uint64_t
#  define u_int64_t	uint64_t
# endif
# ifndef u_int64_t
#  define u_int64_t	unsigned long long
# endif

# ifndef int64_t
#  define int64_t	long long
# endif

#endif	/* __SOLARIS__ */


#ifndef __BIT_TYPES_DEFINED__
#define __BIT_TYPES_DEFINED__
#ifndef __FreeBSD__

#warning Bit types not defined, will attempt to define according to i386.

typedef char			int8_t;
typedef unsigned char           u_int8_t;
typedef short                   int16_t;
typedef unsigned short          u_int16_t;
typedef int                     int32_t;
typedef unsigned int            u_int32_t;

# if __GNUC__ >= 2

#  ifndef int64_t
typedef long long               int64_t;
#  endif

#  ifndef u_int64_t
typedef unsigned long long      u_int64_t;
#  endif

# endif	/* __GNUC__ >= 2 */

#endif	/* __FreeBSD__ */
#endif	/* __BIT_TYPES_DEFINED__ */


/* *******************************************************************
 *
 *                   stat() structure sizes
 *
 *	These are data types for the members of the struct stat
 *	used in stat().
 *
 *	Although this is SVID, AT&T, POSIX, X/OPEN, and BSD 4.3
 *	standard, apparently it is still undefined on some UNIXes
 *	(bad distribution?)
 */
/* UNCOMMENT THIS CHUNK IF YOU GET PARSE ERRORS FOR ANY OF THESE TYPES
typedef unsigned short	dev_t;
typedef unsigned long	ino_t;
typedef unsigned short	mode_t;
typedef unsigned short	nlink_t;
typedef long		off_t;
typedef int		pid_t;
typedef unsigned short	uid_t;
typedef unsigned short	gid_t;
typedef unsigned int	size_t;
typedef int		ssize_t;
typedef int		ptrdiff_t;
typedef long		time_t;
typedef long		clock_t;
typedef int		daddr_t;
typedef char *		caddr_t;
*/

#if defined(_AIX_) || defined(__SOLARIS__) || defined(__CYGWIN32__)
/* **************************************************************
 *
 *	AIX ctype makeup functions
 */
/* In global/ctype.c */
extern int isblank(char c);



#endif


/*
 *	Codes for socket IO function shutdown().
 */
#ifndef SHUT_RD
# define SHUT_RD	0
#endif

#ifndef SHUT_WR
# define SHUT_WR	1
#endif

#ifndef SHUT_RDWR
# define SHUT_RDWR	2
#endif



#endif /* OS_H */