Merge from vendor branch GROFF:
[dragonfly.git] / lib / libbind / port_before.h
1 /* $DragonFly: src/lib/libbind/port_before.h,v 1.1 2004/05/27 18:15:40 dillon Exp $ */
2 #ifndef port_before_h
3 #define port_before_h
4 #include <config.h>
5
6 struct group;           /* silence warning */
7 struct passwd;          /* silence warning */
8 struct timeval;         /* silence warning */
9 struct timezone;        /* silence warning */
10
11 #ifdef HAVE_SYS_TIMERS_H
12 #include <sys/timers.h>
13 #endif
14 #include <limits.h>
15
16
17 #undef WANT_IRS_GR
18 #undef WANT_IRS_NIS
19 #undef WANT_IRS_PW
20
21 #undef BSD_COMP
22
23 #undef DO_PTHREADS
24 #define GETGROUPLIST_ARGS const char *name, int basegid, int *groups, int *ngroups
25 #define GETNETBYADDR_ADDR_T long
26 #define SETPWENT_VOID 1
27 #undef SETGRENT_VOID
28
29 #define NET_R_ARGS char *buf, int buflen
30 #define NET_R_BAD NULL
31 #define NET_R_COPY buf, buflen
32 #define NET_R_COPY_ARGS NET_R_ARGS
33 #define NET_R_END_RESULT(x) /*empty*/
34 #define NET_R_END_RETURN void
35 #undef NET_R_ENT_ARGS /*empty*/
36 #define NET_R_OK nptr
37 #define NET_R_RETURN struct netent *
38 #undef NET_R_SET_RESULT /*empty*/
39 #undef NET_R_SETANSWER
40 #define NET_R_SET_RETURN void
41 #undef NETENT_DATA
42
43 #define GROUP_R_RETURN struct group *
44 #define GROUP_R_SET_RETURN void
45 #undef GROUP_R_SET_RESULT /*empty*/
46 #define GROUP_R_END_RETURN void
47 #define GROUP_R_END_RESULT(x) /*empty*/
48 #define GROUP_R_ARGS char *buf, int buflen
49 #define GROUP_R_ENT_ARGS void
50 #define GROUP_R_OK gptr
51 #define GROUP_R_BAD NULL
52
53 #define HOST_R_ARGS char *buf, int buflen, int *h_errnop
54 #define HOST_R_BAD NULL
55 #define HOST_R_COPY buf, buflen
56 #define HOST_R_COPY_ARGS char *buf, int buflen
57 #define HOST_R_END_RESULT(x) /*empty*/
58 #define HOST_R_END_RETURN void
59 #undef HOST_R_ENT_ARGS /*empty*/
60 #define HOST_R_ERRNO *h_errnop = h_errno
61 #define HOST_R_OK hptr
62 #define HOST_R_RETURN struct hostent *
63 #undef HOST_R_SETANSWER
64 #undef HOST_R_SET_RESULT
65 #define HOST_R_SET_RETURN void
66 #undef HOSTENT_DATA
67
68 #define NGR_R_ARGS char *buf, int buflen
69 #define NGR_R_BAD (0)
70 #define NGR_R_COPY buf, buflen
71 #define NGR_R_COPY_ARGS NGR_R_ARGS
72 #define NGR_R_END_RESULT(x)  /*empty*/
73 #define NGR_R_END_RETURN void
74 #undef NGR_R_ENT_ARGS /*empty*/
75 #define NGR_R_OK 1
76 #define NGR_R_RETURN int
77 #undef NGR_R_SET_RESULT /*empty*/
78 #define NGR_R_SET_RETURN void
79
80
81 #define PROTO_R_ARGS char *buf, int buflen
82 #define PROTO_R_BAD NULL
83 #define PROTO_R_COPY buf, buflen
84 #define PROTO_R_COPY_ARGS PROTO_R_ARGS
85 #define PROTO_R_END_RESULT(x) /*empty*/
86 #define PROTO_R_END_RETURN void
87 #undef PROTO_R_ENT_ARGS /*empty*/
88 #define PROTO_R_OK pptr
89 #undef PROTO_R_SETANSWER
90 #define PROTO_R_RETURN struct protoent *
91 #undef PROTO_R_SET_RESULT
92 #define PROTO_R_SET_RETURN void
93
94 #define PASS_R_ARGS char *buf, int buflen
95 #define PASS_R_BAD NULL
96 #define PASS_R_COPY buf, buflen
97 #define PASS_R_COPY_ARGS PASS_R_ARGS
98 #define PASS_R_END_RESULT(x) /*empty*/
99 #define PASS_R_END_RETURN void
100 #undef PASS_R_ENT_ARGS
101 #define PASS_R_OK pwptr
102 #define PASS_R_RETURN struct passwd *
103 #undef PASS_R_SET_RESULT /*empty*/
104 #define PASS_R_SET_RETURN void
105
106 #define SERV_R_ARGS char *buf, int buflen
107 #define SERV_R_BAD NULL
108 #define SERV_R_COPY buf, buflen
109 #define SERV_R_COPY_ARGS SERV_R_ARGS
110 #define SERV_R_END_RESULT(x) /*empty*/
111 #define SERV_R_END_RETURN void 
112 #undef SERV_R_ENT_ARGS /*empty*/
113 #define SERV_R_OK sptr
114 #undef SERV_R_SETANSWER
115 #define SERV_R_RETURN struct servent *
116 #undef SERV_R_SET_RESULT
117 #define SERV_R_SET_RETURN void
118
119
120 #define DE_CONST(konst, var) \
121         do { \
122                 union { const void *k; void *v; } _u; \
123                 _u.k = konst; \
124                 var = _u.v; \
125         } while (0)
126
127 #define UNUSED(x) (x) = (x)
128
129 #undef NEED_SOLARIS_BITTYPES
130 #define ISC_SOCKLEN_T socklen_t
131
132 #ifdef __GNUC__
133 #define ISC_FORMAT_PRINTF(fmt, args) \
134         __attribute__((__format__(__printf__, fmt, args)))
135 #else
136 #define ISC_FORMAT_PRINTF(fmt, args)
137 #endif
138
139 #endif