]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - crypto/kerberosIV/lib/roken/roken.h
This commit was generated by cvs2svn to compensate for changes in r50764,
[FreeBSD/FreeBSD.git] / crypto / kerberosIV / lib / roken / roken.h
1 /*
2  * Copyright (c) 1995, 1996, 1997 Kungliga Tekniska Högskolan
3  * (Royal Institute of Technology, Stockholm, Sweden).
4  * All rights reserved.
5  * 
6  * Redistribution and use in source and binary forms, with or without
7  * modification, are permitted provided that the following conditions
8  * are met:
9  * 
10  * 1. Redistributions of source code must retain the above copyright
11  *    notice, this list of conditions and the following disclaimer.
12  * 
13  * 2. Redistributions in binary form must reproduce the above copyright
14  *    notice, this list of conditions and the following disclaimer in the
15  *    documentation and/or other materials provided with the distribution.
16  * 
17  * 3. All advertising materials mentioning features or use of this software
18  *    must display the following acknowledgement:
19  *      This product includes software developed by the Kungliga Tekniska
20  *      Högskolan and its contributors.
21  * 
22  * 4. Neither the name of the Institute nor the names of its contributors
23  *    may be used to endorse or promote products derived from this software
24  *    without specific prior written permission.
25  * 
26  * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
27  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
28  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
29  * ARE DISCLAIMED.  IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
30  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
31  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
32  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
33  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
34  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
35  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
36  * SUCH DAMAGE.
37  */
38
39 /* $Id: roken.h,v 1.63 1997/05/28 05:38:09 assar Exp $ */
40
41 #ifndef __ROKEN_H__
42 #define __ROKEN_H__
43
44 #include <stdlib.h>
45 #include <stdarg.h>
46 #include <string.h>
47 #include <signal.h>
48 #ifdef HAVE_SYS_TYPES_H
49 #include <sys/types.h>
50 #endif
51 #ifdef HAVE_UNISTD_H
52 #include <unistd.h>
53 #endif
54 #ifdef HAVE_GRP_H
55 #include <grp.h>
56 #endif
57 #ifdef HAVE_SYS_STAT_H
58 #include <sys/stat.h>
59 #endif
60 #ifdef HAVE_NETINET_IN_H
61 #include <netinet/in.h>
62 #endif
63
64 #ifdef HAVE_TERMIOS_H
65 #include <termios.h>
66 #endif
67
68 #if defined(HAVE_SYS_IOCTL_H) && SunOS != 4
69 #include <sys/ioctl.h>
70 #endif
71
72 #include "protos.h"
73
74 #if !defined(HAVE_SETSID) && defined(HAVE__SETSID)
75 #define setsid _setsid
76 #endif
77
78 #ifndef HAVE_PUTENV
79 int putenv(const char *string);
80 #endif
81
82 #ifndef HAVE_SETENV
83 int setenv(const char *var, const char *val, int rewrite);
84 #endif
85
86 #ifndef HAVE_UNSETENV
87 void unsetenv(const char *name);
88 #endif
89
90 #ifndef HAVE_GETUSERSHELL
91 char *getusershell(void);
92 #endif
93
94 #if !defined(__GNUC__) && !defined(__attribute__)
95 #define __attribute__(x)
96 #endif
97
98 #ifndef HAVE_SNPRINTF
99 int snprintf (char *str, size_t sz, const char *format, ...)
100      __attribute__ ((format (printf, 3, 4)));
101 #endif
102
103 #ifndef HAVE_VSNPRINTF
104 int vsnprintf (char *str, size_t sz, const char *format, va_list ap)
105      __attribute__((format (printf, 3, 0)));
106 #endif
107
108 #ifndef HAVE_ASPRINTF
109 int asprintf (char **ret, const char *format, ...)
110      __attribute__ ((format (printf, 2, 3)));
111 #endif
112
113 #ifndef HAVE_VASPRINTF
114 int vasprintf (char **ret, const char *format, va_list ap)
115      __attribute__((format (printf, 2, 0)));
116 #endif
117
118 #ifndef HAVE_ASNPRINTF
119 int asnprintf (char **ret, size_t max_sz, const char *format, ...)
120      __attribute__ ((format (printf, 3, 4)));
121 #endif
122
123 #ifndef HAVE_VASNPRINTF
124 int vasnprintf (char **ret, size_t max_sz, const char *format, va_list ap)
125      __attribute__((format (printf, 3, 0)));
126 #endif
127
128 #ifndef HAVE_STRDUP
129 char * strdup(const char *old);
130 #endif
131
132 #ifndef HAVE_STRLWR
133 char * strlwr(char *);
134 #endif
135
136 #ifndef HAVE_STRNLEN
137 int strnlen(char*, int);
138 #endif
139
140 #ifndef HAVE_STRTOK_R
141 char *strtok_r(char *s1, const char *s2, char **lasts);
142 #endif
143
144 #ifndef HAVE_STRUPR
145 char * strupr(char *);
146 #endif
147
148 #ifndef HAVE_GETDTABLESIZE
149 int getdtablesize(void);
150 #endif
151
152 #if IRIX != 4 /* fix for compiler bug */
153 #ifdef RETSIGTYPE
154 typedef RETSIGTYPE (*SigAction)(/* int??? */);
155 SigAction signal(int iSig, SigAction pAction); /* BSD compatible */
156 #endif
157 #endif
158
159 #ifndef SIG_ERR
160 #define SIG_ERR ((RETSIGTYPE (*)())-1)
161 #endif
162
163 #if !defined(HAVE_STRERROR) && !defined(strerror)
164 char *strerror(int eno);
165 #endif
166
167 #ifndef HAVE_HSTRERROR
168 char *hstrerror(int herr);
169 #endif
170
171 #ifndef HAVE_H_ERRNO_DECLARATION
172 extern int h_errno;
173 #endif
174
175 #ifndef HAVE_INET_ATON
176 /* Minimal implementation of inet_aton. Doesn't handle hex numbers. */
177 int inet_aton(const char *cp, struct in_addr *adr);
178 #endif
179
180 #if !defined(HAVE_GETCWD)
181 char* getcwd(char *path, size_t size);
182 #endif
183
184 #ifndef HAVE_GETENT
185 int getent(char *cp, char *name);
186 #endif
187
188 #ifdef HAVE_PWD_H
189 #include <pwd.h>
190 struct passwd *k_getpwnam (char *user);
191 struct passwd *k_getpwuid (uid_t uid);
192 #endif
193
194 #ifndef HAVE_SETEUID
195 int seteuid(int euid);
196 #endif
197
198 #ifndef HAVE_SETEGID
199 int setegid(int egid);
200 #endif
201
202 #ifndef HAVE_LSTAT
203 int lstat(const char *path, struct stat *buf);
204 #endif
205
206 #ifndef HAVE_MKSTEMP
207 int mkstemp(char *);
208 #endif
209
210 #ifndef HAVE_INITGROUPS
211 int initgroups(const char *name, gid_t basegid);
212 #endif
213
214 #ifndef HAVE_FCHOWN
215 int fchown(int fd, uid_t owner, gid_t group);
216 #endif
217
218 #ifndef HAVE_CHOWN
219 int chown(const char *path, uid_t owner, gid_t group);
220 #endif
221
222 #ifndef HAVE_RCMD
223 int rcmd(char **ahost, unsigned short inport, const char *locuser,
224          const char *remuser, const char *cmd, int *fd2p);
225 #endif
226
227 #ifdef TIME_WITH_SYS_TIME
228 #include <sys/time.h>
229 #include <time.h>
230 #elif defined(HAVE_SYS_TIME_H)
231 #include <sys/time.h>
232 #else
233 #include <time.h>
234 #endif
235
236 time_t tm2time (struct tm tm, int local);
237
238 int unix_verify_user(char *user, char *password);
239
240 void inaddr2str(struct in_addr addr, char *s, size_t len);
241
242 void mini_inetd (int port);
243
244 #ifndef HAVE_STRUCT_WINSIZE
245 struct winsize {
246         unsigned short ws_row, ws_col;
247         unsigned short ws_xpixel, ws_ypixel;
248 };
249 #endif
250
251 int get_window_size(int fd, struct winsize *);
252
253 #ifndef INADDR_NONE
254 #define INADDR_NONE 0xffffffff
255 #endif
256
257 #ifndef SOMAXCONN
258 #define SOMAXCONN 5
259 #endif
260
261 #ifndef STDIN_FILENO
262 #define STDIN_FILENO 0
263 #endif
264
265 #ifndef STDOUT_FILENO
266 #define STDOUT_FILENO 1
267 #endif
268
269 #ifndef STDERR_FILENO
270 #define STDERR_FILENO 2
271 #endif
272
273 #ifndef max
274 #define max(a,b) (((a)>(b))?(a):(b))
275 #endif
276
277 #ifndef min
278 #define min(a,b) (((a)<(b))?(a):(b))
279 #endif
280
281 #ifndef TRUE
282 #define TRUE 1
283 #endif
284
285 #ifndef FALSE
286 #define FALSE 0
287 #endif
288
289 #ifdef HAVE_SYSLOG_H
290 #include <syslog.h>
291 /* Misc definitions for old syslogs */
292
293 #ifndef LOG_DAEMON
294 #define openlog(id,option,facility) openlog((id),(option))
295 #define LOG_DAEMON      0
296 #endif
297 #ifndef LOG_ODELAY
298 #define LOG_ODELAY 0
299 #endif
300 #ifndef LOG_NDELAY
301 #define LOG_NDELAY 0x08
302 #endif
303 #ifndef LOG_CONS
304 #define LOG_CONS 0
305 #endif
306 #ifndef LOG_AUTH
307 #define LOG_AUTH 0
308 #endif
309 #ifndef LOG_AUTHPRIV
310 #define LOG_AUTHPRIV LOG_AUTH
311 #endif
312 #endif
313
314 #ifndef HAVE_OPTARG_DECLARATION
315 extern char *optarg;
316 #endif
317 #ifndef HAVE_OPTIND_DECLARATION
318 extern int optind;
319 #endif
320 #ifndef HAVE_OPTERR_DECLARATION
321 extern int opterr;
322 #endif
323
324 #ifndef HAVE___PROGNAME_DECLARATION
325 extern const char *__progname;
326 #endif
327
328 void set_progname(char *argv0);
329
330 #ifdef HAVE_PATHS_H
331 #include <paths.h>
332 #endif
333
334 #ifndef _PATH_DEVNULL
335 #define _PATH_DEVNULL "/dev/null"
336 #endif
337
338 #endif /*  __ROKEN_H__ */