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
|
/* $OpenBSD: port.h,v 1.2 1997/03/12 10:41:56 downsj Exp $ */
/*
** Various portability definitions.
**
** @(#)port.h e07@nikhef.nl (Eric Wassenaar) 961010
*/
#if defined(SYSV) || defined(SVR4)
#define SYSV_MALLOC
#define SYSV_MEMSET
#define SYSV_STRCHR
#define SYSV_SETVBUF
#endif
#if defined(__hpux) || defined(hpux)
#define SYSV_MALLOC
#define SYSV_SETVBUF
#endif
#if defined(RES_PRF_STATS)
#define BIND_49
#else
#define BIND_48
#endif
#if defined(BIND_49) && defined(__BIND)
#define BIND_493
#endif
/*
** Define constants for fixed sizes.
*/
#ifndef INT16SZ
#define INT16SZ 2 /* for systems without 16-bit ints */
#endif
#ifndef INT32SZ
#define INT32SZ 4 /* for systems without 32-bit ints */
#endif
#ifndef INADDRSZ
#define INADDRSZ 4 /* for sizeof(struct inaddr) != 4 */
#endif
#define IPNGSIZE 16 /* 128 bit ip v6 address size */
/*
** The following should depend on existing definitions.
*/
#if defined(BIND_49)
typedef struct __res_state res_state_t;
#else
typedef struct state res_state_t;
#endif
#if defined(BIND_48)
typedef struct rrec rrec_t;
#else
#if defined(BIND_493)
typedef u_char rrec_t;
#else
typedef char rrec_t;
#endif
#endif
#if defined(BIND_493)
typedef u_char qbuf_t;
#else
typedef char qbuf_t;
#endif
#if defined(BIND_493)
typedef char nbuf_t;
#else
typedef u_char nbuf_t;
#endif
#if defined(__alpha) || defined(BIND_49)
typedef u_int ipaddr_t;
#else
typedef u_long ipaddr_t;
#endif
#if defined(apollo) || defined(_BSD_SIGNALS)
typedef int sigtype_t;
#else
typedef void sigtype_t;
#endif
#if defined(SYSV_MALLOC)
typedef void ptr_t; /* generic pointer type */
typedef u_int siz_t; /* general size type */
typedef void free_t;
#else
typedef char ptr_t; /* generic pointer type */
typedef u_int siz_t; /* general size type */
typedef int free_t;
#endif
#ifdef SYSV_MEMSET
#define bzero(a,n) (void) memset(a,'\0',n)
#define bcopy(a,b,n) (void) memcpy(b,a,n)
#endif
#ifdef SYSV_STRCHR
#define index strchr
#define rindex strrchr
#endif
#ifdef SYSV_SETVBUF
#define linebufmode(a) (void) setvbuf(a, (char *)NULL, _IOLBF, BUFSIZ);
#else
#define linebufmode(a) (void) setlinebuf(a);
#endif
#ifdef ULTRIX_RESOLV
#define nslist(i) _res.ns_list[i].addr
#else
#define nslist(i) _res.nsaddr_list[i]
#endif
#ifdef fp_nquery
#define pr_query(a,n,f) fp_nquery(a,n,f)
#else
#define pr_query(a,n,f) fp_query(a,f)
#endif
#if defined(sun) && defined(NO_YP_LOOKUP)
#define gethostbyname (struct hostent *)res_gethostbyname
#define gethostbyaddr (struct hostent *)res_gethostbyaddr
#endif
/*
** No prototypes yet.
*/
#define PROTO(TYPES) ()
#if !defined(__STDC__) || defined(apollo)
#define const
#endif
#if defined(__STDC__) && defined(BIND_49)
#define CONST const
#else
#define CONST
#endif
|