Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/include * Since we actually only need size_t to be defined, ...
details: https://anonhg.NetBSD.org/src/rev/4361268a18e8
branches: trunk
changeset: 474313:4361268a18e8
user: kleink <kleink%NetBSD.org@localhost>
date: Sat Jul 03 13:25:21 1999 +0000
description:
* Since we actually only need size_t to be defined, nuke the previous inclusion
of <sys/types.h> and define size_t via <machine/ansi.h>.
* Various namespace protection issues, using XNS5.2 D2.0 as a reference.
diffstat:
include/netdb.h | 30 +++++++++++++++++++++++++++---
1 files changed, 27 insertions(+), 3 deletions(-)
diffs (126 lines):
diff -r d54e7202ec49 -r 4361268a18e8 include/netdb.h
--- a/include/netdb.h Sat Jul 03 13:22:06 1999 +0000
+++ b/include/netdb.h Sat Jul 03 13:25:21 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: netdb.h,v 1.12 1999/07/01 18:15:41 itojun Exp $ */
+/* $NetBSD: netdb.h,v 1.13 1999/07/03 13:25:21 kleink Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -88,10 +88,14 @@
#ifndef _NETDB_H_
#define _NETDB_H_
+#include <machine/ansi.h>
#include <sys/cdefs.h>
-#include <sys/types.h>
+#include <inttypes.h>
-#include <inttypes.h>
+#ifdef _BSD_SIZE_T_
+typedef _BSD_SIZE_T_ size_t;
+#undef _BSD_SIZE_T_
+#endif
#if !defined(_XOPEN_SOURCE)
#define _PATH_HEQUIV "/etc/hosts.equiv"
@@ -141,6 +145,7 @@
int p_proto; /* protocol # */
};
+#if !defined(_XOPEN_SOURCE)
struct addrinfo {
int ai_flags; /* AI_PASSIVE, AI_CANONNAME, AI_NUMERICHOST */
int ai_family; /* PF_xxx */
@@ -151,6 +156,7 @@
struct sockaddr *ai_addr; /* binary address */
struct addrinfo *ai_next; /* next structure in linked list */
};
+#endif
/*
* Error return codes from gethostbyname() and gethostbyaddr()
@@ -172,6 +178,7 @@
/*
* Error return codes from getaddrinfo()
*/
+#if !defined(_XOPEN_SOURCE)
#define EAI_ADDRFAMILY 1 /* address family for hostname not supported */
#define EAI_AGAIN 2 /* temporary failure in name resolution */
#define EAI_BADFLAGS 3 /* invalid value for ai_flags */
@@ -186,23 +193,33 @@
#define EAI_BADHINTS 12
#define EAI_PROTOCOL 13
#define EAI_MAX 14
+#endif /* !_XOPEN_SOURCE */
/*
* Flag values for getaddrinfo()
*/
+#if !defined(_XOPEN_SOURCE)
#define AI_PASSIVE 0x00000001 /* get address to use bind() */
#define AI_CANONNAME 0x00000002 /* fill ai_canonname */
#define AI_NUMERICHOST 0x00000004 /* prevent name resolution */
/* valid flags for addrinfo */
#define AI_MASK (AI_PASSIVE | AI_CANONNAME | AI_NUMERICHOST)
+#endif
+#if !defined(_XOPEN_SOURCE) || (_XOPEN_SOURCE - 0) >= 500
#define AI_ALL 0x00000100 /* IPv6 and IPv4-mapped (with AI_V4MAPPED) */
+#endif
+#if !defined(_XOPEN_SOURCE)
#define AI_V4MAPPED_CFG 0x00000200 /* accept IPv4-mapped if kernel supports */
+#endif
+#if !defined(_XOPEN_SOURCE) || (_XOPEN_SOURCE - 0) >= 500
#define AI_ADDRCONFIG 0x00000400 /* only if any address is assigned */
#define AI_V4MAPPED 0x00000800 /* accept IPv4-mapped IPv6 address */
/* special recommended flags for getipnodebyname */
#define AI_DEFAULT (AI_V4MAPPED_CFG | AI_ADDRCONFIG)
+#endif
+#if !defined(_XOPEN_SOURCE)
/*
* Constants for getnameinfo()
*/
@@ -217,21 +234,26 @@
#define NI_NAMEREQD 0x00000004
#define NI_NUMERICSERV 0x00000008
#define NI_DGRAM 0x00000010
+#endif /* !_XOPEN_SOURCE */
__BEGIN_DECLS
void endhostent __P((void));
void endnetent __P((void));
void endprotoent __P((void));
void endservent __P((void));
+#if !defined(_XOPEN_SOURCE) || (_XOPEN_SOURCE - 0) >= 500
void freehostent __P((struct hostent *));
+#endif
struct hostent *gethostbyaddr __P((const char *, int, int));
struct hostent *gethostbyname __P((const char *));
#if !defined(_XOPEN_SOURCE)
struct hostent *gethostbyname2 __P((const char *, int));
#endif
struct hostent *gethostent __P((void));
+#if !defined(_XOPEN_SOURCE) || (_XOPEN_SOURCE - 0) >= 500
struct hostent *getipnodebyaddr __P((const void *, size_t, int, int *));
struct hostent *getipnodebyname __P((const char *, int, int, int *));
+#endif
struct netent *getnetbyaddr __P((unsigned long, int));
struct netent *getnetbyname __P((const char *));
struct netent *getnetent __P((void));
@@ -251,12 +273,14 @@
#endif
void setnetent __P((int));
void setprotoent __P((int));
+#if !defined(_XOPEN_SOURCE)
int getaddrinfo __P((const char *, const char *,
const struct addrinfo *, struct addrinfo **));
int getnameinfo __P((const struct sockaddr *, size_t, char *,
size_t, char *, size_t, int));
void freeaddrinfo __P((struct addrinfo *));
char *gai_strerror __P((int));
+#endif
void setservent __P((int));
__END_DECLS
Home |
Main Index |
Thread Index |
Old Index