Initial import from FreeBSD RELENG_4:
[games.git] / kerberosIV / include / roken.h
1 /* This is an OS dependent, generated file */
2 /* Generated by Mark Murray */
3
4 #ifndef __ROKEN_H__
5 #define __ROKEN_H__
6
7 /* -*- C -*- */
8 /*
9  * Copyright (c) 1995, 1996, 1997, 1998, 1999 Kungliga Tekniska Högskolan
10  * (Royal Institute of Technology, Stockholm, Sweden).
11  * All rights reserved.
12  * 
13  * Redistribution and use in source and binary forms, with or without
14  * modification, are permitted provided that the following conditions
15  * are met:
16  * 
17  * 1. Redistributions of source code must retain the above copyright
18  *    notice, this list of conditions and the following disclaimer.
19  * 
20  * 2. Redistributions in binary form must reproduce the above copyright
21  *    notice, this list of conditions and the following disclaimer in the
22  *    documentation and/or other materials provided with the distribution.
23  * 
24  * 3. Neither the name of the Institute nor the names of its contributors
25  *    may be used to endorse or promote products derived from this software
26  *    without specific prior written permission.
27  * 
28  * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
29  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
30  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
31  * ARE DISCLAIMED.  IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
32  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
33  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
34  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
35  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
36  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
37  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
38  * SUCH DAMAGE.
39  */
40
41 /* $Id: roken.h.in,v 1.125 1999/12/02 16:58:52 joda Exp $ */
42 /* $FreeBSD: src/kerberosIV/include/roken.h,v 1.2 2000/01/09 08:59:34 markm Exp $ */
43
44 #include <stdio.h>
45 #include <stdlib.h>
46 #include <stdarg.h>
47 #include <string.h>
48 #include <signal.h>
49 #include <sys/param.h>
50 #include <sys/types.h>
51 #include <unistd.h>
52 #include <sys/socket.h>
53 #include <sys/uio.h>
54 #include <grp.h>
55 #include <sys/stat.h>
56 #include <netinet/in.h>
57 #include <netdb.h>
58 #include <syslog.h>
59 #include <fcntl.h>
60 #include <errno.h>
61 #include <err.h>
62 #include <termios.h>
63 #include <sys/ioctl.h>
64 #include <sys/time.h>
65 #include <time.h>
66
67 #include <paths.h>
68
69
70 #define ROKEN_LIB_FUNCTION
71
72 #include <roken-common.h>
73
74
75
76
77
78
79
80
81
82
83 int asnprintf (char **ret, size_t max_sz, const char *format, ...)
84      __attribute__ ((format (printf, 3, 4)));
85
86 int vasnprintf (char **ret, size_t max_sz, const char *format, va_list ap)
87      __attribute__((format (printf, 3, 0)));
88
89
90 char * strndup(const char *old, size_t sz);
91
92 char * strlwr(char *);
93
94 size_t strnlen(const char*, size_t);
95
96
97
98
99
100 char * strupr(char *);
101
102
103
104
105
106
107
108
109
110
111
112 #include <pwd.h>
113 struct passwd *k_getpwnam (const char *user);
114 struct passwd *k_getpwuid (uid_t uid);
115
116 const char *get_default_username (void);
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136 time_t tm2time (struct tm tm, int local);
137
138 int unix_verify_user(char *user, char *password);
139
140 void inaddr2str(struct in_addr addr, char *s, size_t len);
141
142 void mini_inetd (int port);
143
144 int roken_concat (char *s, size_t len, ...);
145
146 size_t roken_mconcat (char **s, size_t max_len, ...);
147
148 int roken_vconcat (char *s, size_t len, va_list args);
149
150 size_t roken_vmconcat (char **s, size_t max_len, va_list args);
151
152 ssize_t net_write (int fd, const void *buf, size_t nbytes);
153
154 ssize_t net_read (int fd, void *buf, size_t nbytes);
155
156 int issuid(void);
157
158
159 int get_window_size(int fd, struct winsize *);
160
161
162
163 extern const char *__progname;
164
165 extern char **environ;
166
167
168
169
170 struct hostent *
171 copyhostent (const struct hostent *h);
172
173
174 /*
175  * kludges and such
176  */
177
178 int roken_gethostby_setup(const char*, const char*);
179 struct hostent* roken_gethostbyname(const char*);
180 struct hostent* roken_gethostbyaddr(const void*, size_t, int);
181
182 #define roken_getservbyname(x,y) getservbyname(x,y)
183
184 #define roken_openlog(a,b,c) openlog(a,b,c)
185
186 void set_progname(char *argv0);
187
188 #endif /* __ROKEN_H__ */