File tree 1 file changed +34
-16
lines changed
1 file changed +34
-16
lines changed Original file line number Diff line number Diff line change 15
15
*
16
16
* Copyright (c) 2003, PostgreSQL Global Development Group
17
17
*
18
- * $Id: getaddrinfo.h,v 1.8 2003/08/04 00:43:29 momjian Exp $
18
+ * $Id: getaddrinfo.h,v 1.9 2003/08/07 16:45:21 tgl Exp $
19
19
*
20
20
*-------------------------------------------------------------------------
21
21
*/
28
28
#endif
29
29
30
30
31
- #ifndef HAVE_STRUCT_ADDRINFO
31
+ /* Various macros that ought to be in <netdb.h>, but might not be */
32
32
33
- struct addrinfo
34
- {
35
- int ai_flags ;
36
- int ai_family ;
37
- int ai_socktype ;
38
- int ai_protocol ;
39
- size_t ai_addrlen ;
40
- struct sockaddr * ai_addr ;
41
- char * ai_canonname ;
42
- struct addrinfo * ai_next ;
43
- };
33
+ #ifndef EAI_FAIL
44
34
45
- #define EAI_BADFLAGS -1
35
+ #define EAI_BADFLAGS -1
46
36
#define EAI_NONAME -2
47
37
#define EAI_AGAIN -3
48
38
#define EAI_FAIL -4
49
39
#define EAI_FAMILY -6
50
- #define EAI_SOCKTYPE -7
40
+ #define EAI_SOCKTYPE -7
51
41
#define EAI_SERVICE -8
52
42
#define EAI_MEMORY -10
53
43
#define EAI_SYSTEM -11
54
44
45
+ #endif
46
+
47
+ #ifndef AI_PASSIVE
55
48
#define AI_PASSIVE 0x0001
49
+ #endif
50
+ #ifndef AI_NUMERICHOST
56
51
#define AI_NUMERICHOST 0x0004
52
+ #endif
57
53
54
+ #ifndef NI_NUMERICHOST
58
55
#define NI_NUMERICHOST 1
56
+ #endif
57
+ #ifndef NI_NUMERICSERV
59
58
#define NI_NUMERICSERV 2
60
- #endif /* HAVE_STRUCT_ADDRINFO */
59
+ #endif
61
60
62
61
#ifndef NI_MAXHOST
63
62
#define NI_MAXHOST 1025
63
+ #endif
64
+ #ifndef NI_MAXSERV
64
65
#define NI_MAXSERV 32
65
66
#endif
66
67
67
68
69
+ #ifndef HAVE_STRUCT_ADDRINFO
70
+
71
+ struct addrinfo
72
+ {
73
+ int ai_flags ;
74
+ int ai_family ;
75
+ int ai_socktype ;
76
+ int ai_protocol ;
77
+ size_t ai_addrlen ;
78
+ struct sockaddr * ai_addr ;
79
+ char * ai_canonname ;
80
+ struct addrinfo * ai_next ;
81
+ };
82
+
83
+ #endif /* HAVE_STRUCT_ADDRINFO */
84
+
68
85
69
86
#ifndef HAVE_GETADDRINFO
70
87
@@ -96,6 +113,7 @@ extern const char *gai_strerror(int errcode);
96
113
extern int getnameinfo (const struct sockaddr * sa , int salen ,
97
114
char * node , int nodelen ,
98
115
char * service , int servicelen , int flags );
116
+
99
117
#endif /* HAVE_GETADDRINFO */
100
118
101
119
#endif /* GETADDRINFO_H */
You can’t perform that action at this time.
0 commit comments