about summary refs log tree commit diff
path: root/resolv
diff options
context:
space:
mode:
authorZack Weinberg <zackw@panix.com>2016-08-21 15:38:41 -0400
committerZack Weinberg <zackw@panix.com>2016-09-23 08:43:56 -0400
commit11160cb76f56e0a711686e34881a4eaf1ad2fa0e (patch)
tree32de3923d10cdda555e5c1d3b230ba6527b67544 /resolv
parentcb765808fbffca30a1c67cf01ffdce30f8e6df3e (diff)
downloadglibc-11160cb76f56e0a711686e34881a4eaf1ad2fa0e.tar.gz
glibc-11160cb76f56e0a711686e34881a4eaf1ad2fa0e.tar.xz
glibc-11160cb76f56e0a711686e34881a4eaf1ad2fa0e.zip
Installed-header hygiene (BZ#20366): obsolete BSD u_* types.
The types u_char, u_short, u_int, u_long, ushort, uint, ulong, u_int8_t,
u_int16_t, u_int32_t, u_int64_t, quad_t, and u_quad_t are BSDisms that
have never been standardized.  While glibc should continue to *provide*
these types for compatibility's sake, its public headers should not
use them.

The meat of this change was mechanically generated by the following
shell command:

    perl -pi~ -e '
        s/\b(__)?u_char\b/unsigned char/g;
        s/\b(__)?u_?short\b/unsigned short/g;
        s/\b(__)?u_?int\b/unsigned int/g;
        s/\b(__)?u_?long\b/unsigned long/g;
        s/\b(__)?u_int8_t\b/uint8_t/g;
        s/\b(__)?u_int16_t\b/uint16_t/g;
        s/\b(__)?u_int32_t\b/uint32_t/g;
        s/\b(__)?u_int64_t\b/uint64_t/g;
        s/\b(__)?u_quad_t\b/uint64_t/g;
        s/\b(__)?quad_t\b/uint64_t/g;
    ' $(grep -lE -e '\<((__)?(quad_t|u(short|int|long|_(char|short|int([0-9]+_t)?|long|quad_t))))\>' \
        $(grep -LE '\<(_(SYS|BITS)_TYPES_H|rpc/(rpc|rpc_msg|types|xdr)\.h)\>' \
          $(find . \( -false $(sed 's/^/-o -name /' all-installed-headers) \
                   \) -printf '%P\n' | sort -u)))

where 'all-installed-headers' was a list of the basenames of all installed
header files, manually extracted from the Makefiles.  Non-installed
wrapper headers in include/ are also adjusted, for consistency.
I then manually fixed up indentation and line-wrapping.

sys/types.h and bits/types.h are excluded because they must continue
to define the u_* types (under __USE_MISC) for compatibility with
applications.  They do not use these types themselves.

All headers that (transitively) include rpc/types.h are also excluded,
for three reasons.  First, the u_* types are defined by rpc/types.h,
unconditionally (not just under __USE_MISC) so they are logically part
of the SunRPC API.  Second, many of those headers appear to be
machine-generated.  Third, it's my understanding that we are getting
rid of as much of SunRPC as possible in the near future.

(The one file under sunrpc/ that's touched, sunrpc/rpc/rpc_des.h, does
*not* include rpc/types.h.  This may itself be a bug.)

After changing from u_intNN_t to uintNN_t, a number of headers now
need to include stdint.h to pick up those types.  It might be more
hygenic, namespace-wise, to use __uintNN_t instead, but none of these
headers are bound by ISO or POSIX to do so, and it's unlikely that
anyone using them will be bothered.  (The two files that were using
__-prefixed versions of the u_types, sysdeps/mach/hurd/net/route.h and
sysdeps/unix/sysv/linux/net/route.h, both already also contained uses of
the unprefixed versions.)

Some of these files directly included features.h and/or sys/cdefs.h,
which I removed, as the style generally seems to be to let sys/types.h
do that for us.  (This does not change the set of definitions exposed
by any header; sys/types.h unconditionally includes both features.h
and sys/cdefs.h.)

One file included asm/types.h unnecessarily.

	* bits/in.h, gmon/sys/gmon.h, inet/netinet/igmp.h
	* inet/protocols/routed.h, inet/protocols/talkd.h
	* inet/protocols/timed.h, io/fts.h, nptl_db/thread_db.h
	* resolv/arpa/nameser.h, resolv/resolv.h, sunrpc/rpc/rpc_des.h
	* sysdeps/generic/netinet/if_ether.h
	* sysdeps/generic/netinet/in_systm.h
	* sysdeps/generic/netinet/ip.h, sysdeps/generic/netinet/tcp.h
	* sysdeps/gnu/netinet/ip_icmp.h, sysdeps/gnu/netinet/tcp.h
	* sysdeps/gnu/netinet/udp.h, sysdeps/mach/hurd/net/ethernet.h
	* sysdeps/mach/hurd/net/if_arp.h
	* sysdeps/mach/hurd/net/if_ppp.h
	* sysdeps/mach/hurd/net/route.h, sysdeps/mach/sys/reboot.h
	* sysdeps/unix/sysv/linux/bits/in.h
	* sysdeps/unix/sysv/linux/net/ethernet.h
	* sysdeps/unix/sysv/linux/net/if_arp.h
	* sysdeps/unix/sysv/linux/net/if_ppp.h
	* sysdeps/unix/sysv/linux/net/if_shaper.h
	* sysdeps/unix/sysv/linux/net/route.h
	* sysdeps/unix/sysv/linux/netinet/if_ether.h
	* sysdeps/unix/sysv/linux/netinet/if_fddi.h
	* sysdeps/unix/sysv/linux/netinet/if_tr.h
	* sysdeps/unix/sysv/linux/netipx/ipx.h
	* sysdeps/unix/sysv/linux/sys/acct.h
	* include/arpa/nameser.h, include/resolv.h:
	Change all uses of u_char to unsigned char,
	u_short and ushort to unsigned short, u_int and uint to unsigned int,
	u_long and ulong to unsigned long, u_int8_t to uint8_t,
        u_int16_t to uint16_t, u_int32_t to uint32_t, quad_t to int64_t,
	and u_int64_t and u_quad_t to uint64_t.

	* mach/sys/reboot.h: Remove two casts of integer literals
	to the types they already have.

	* bits/in.h: Correct error in description of IP_MULTICAST_LOOP.
	* sysdeps/unix/sysv/linux/bits/in.h: Likewise.
	* sysdeps/unix/sysv/linux/netinet/if_ether.h: Change a comment
	from referring to 'unsigned char' to 'uint8_t' for consistency with
	the macro definition below.

	* gmon/sys/gmon.h, inet/netinet/igmp.h, inet/protocols/talkd.h
	* io/fts.h, resolv/arpa/nameser.h, resolv/resolv.h
	* sunrpc/rpc/rpc_des.h, sysdeps/generic/netinet/ip.h
	* sysdeps/gnu/netinet/tcp.h, sysdeps/gnu/netinet/udp.h
	* sysdeps/mach/hurd/net/if_ppp.h, sysdeps/unix/sysv/linux/net/if_ppp.h
	* sysdeps/unix/sysv/linux/sys/acct.h
	* include/arpa/nameser.h, include/resolv.h:
	Fix indentation disrupted by mechanical edits.

	* inet/protocols/talkd.h, resolv/arpa/nameser.h
	* sysdeps/generic/netinet/in_systm.h
	* sysdeps/gnu/netinet/ip_icmp.h, sysdeps/gnu/netinet/tcp.h
	* sysdeps/gnu/netinet/udp.h
	* sysdeps/unix/sysv/linux/net/ethernet.h
	* sysdeps/unix/sysv/linux/net/if_arp.h
	* sysdeps/unix/sysv/linux/net/if_ppp.h
	* sysdeps/unix/sysv/linux/net/if_shaper.h
	* sysdeps/unix/sysv/linux/netinet/if_fddi.h
	* sysdeps/unix/sysv/linux/netinet/if_tr.h
	* sysdeps/unix/sysv/linux/netipx/ipx.h
	* sysdeps/unix/sysv/linux/sys/acct.h
	Include stdint.h for uintNN_t definitions.
	Don't include sys/cdefs.h, features.h, or asm/types.h directly.
Diffstat (limited to 'resolv')
-rw-r--r--resolv/arpa/nameser.h120
-rw-r--r--resolv/resolv.h117
2 files changed, 129 insertions, 108 deletions
diff --git a/resolv/arpa/nameser.h b/resolv/arpa/nameser.h
index a866ce8973..80d5cdf951 100644
--- a/resolv/arpa/nameser.h
+++ b/resolv/arpa/nameser.h
@@ -50,7 +50,7 @@
 
 #include <sys/param.h>
 #include <sys/types.h>
-#include <sys/cdefs.h>
+#include <stdint.h>
 
 /*
  * Define constants based on RFC 883, RFC 1034, RFC 1035
@@ -63,9 +63,9 @@
 #define NS_HFIXEDSZ	12	/*%< #/bytes of fixed data in header */
 #define NS_QFIXEDSZ	4	/*%< #/bytes of fixed data in query */
 #define NS_RRFIXEDSZ	10	/*%< #/bytes of fixed data in r record */
-#define NS_INT32SZ	4	/*%< #/bytes of data in a u_int32_t */
-#define NS_INT16SZ	2	/*%< #/bytes of data in a u_int16_t */
-#define NS_INT8SZ	1	/*%< #/bytes of data in a u_int8_t */
+#define NS_INT32SZ	4	/*%< #/bytes of data in a uint32_t */
+#define NS_INT16SZ	2	/*%< #/bytes of data in a uint16_t */
+#define NS_INT8SZ	1	/*%< #/bytes of data in a uint8_t */
 #define NS_INADDRSZ	4	/*%< IPv4 T_A */
 #define NS_IN6ADDRSZ	16	/*%< IPv6 T_AAAA */
 #define NS_CMPRSFLGS	0xc0	/*%< Flag bits indicating name compression. */
@@ -91,12 +91,12 @@ typedef enum __ns_sect {
  * leading _'s on the member names.  Use the accessor functions, not the _'s.
  */
 typedef struct __ns_msg {
-	const u_char	*_msg, *_eom;
-	u_int16_t	_id, _flags, _counts[ns_s_max];
-	const u_char	*_sections[ns_s_max];
-	ns_sect		_sect;
-	int		_rrnum;
-	const u_char	*_msg_ptr;
+	const unsigned char	*_msg, *_eom;
+	uint16_t		_id, _flags, _counts[ns_s_max];
+	const unsigned char	*_sections[ns_s_max];
+	ns_sect			_sect;
+	int			_rrnum;
+	const unsigned char	*_msg_ptr;
 } ns_msg;
 
 /* Private data structure - do not use from outside library. */
@@ -115,12 +115,12 @@ extern const struct _ns_flagdata _ns_flagdata[];
  * This is a parsed record.  It is caller allocated and has no dynamic data.
  */
 typedef	struct __ns_rr {
-	char		name[NS_MAXDNAME];
-	u_int16_t	type;
-	u_int16_t	rr_class;
-	u_int32_t	ttl;
-	u_int16_t	rdlength;
-	const u_char *	rdata;
+	char			name[NS_MAXDNAME];
+	uint16_t		type;
+	uint16_t		rr_class;
+	uint32_t		ttl;
+	uint16_t		rdlength;
+	const unsigned char *	rdata;
 } ns_rr;
 
 /* Accessor macros - this is part of the public interface. */
@@ -317,34 +317,34 @@ typedef enum __ns_cert_types {
  * Inline versions of get/put short/long.  Pointer is advanced.
  */
 #define NS_GET16(s, cp) do { \
-	const u_char *t_cp = (const u_char *)(cp); \
-	(s) = ((u_int16_t)t_cp[0] << 8) \
-	    | ((u_int16_t)t_cp[1]) \
+	const unsigned char *t_cp = (const unsigned char *)(cp); \
+	(s) = ((uint16_t)t_cp[0] << 8) \
+	    | ((uint16_t)t_cp[1]) \
 	    ; \
 	(cp) += NS_INT16SZ; \
 } while (0)
 
 #define NS_GET32(l, cp) do { \
-	const u_char *t_cp = (const u_char *)(cp); \
-	(l) = ((u_int32_t)t_cp[0] << 24) \
-	    | ((u_int32_t)t_cp[1] << 16) \
-	    | ((u_int32_t)t_cp[2] << 8) \
-	    | ((u_int32_t)t_cp[3]) \
+	const unsigned char *t_cp = (const unsigned char *)(cp); \
+	(l) = ((uint32_t)t_cp[0] << 24) \
+	    | ((uint32_t)t_cp[1] << 16) \
+	    | ((uint32_t)t_cp[2] << 8) \
+	    | ((uint32_t)t_cp[3]) \
 	    ; \
 	(cp) += NS_INT32SZ; \
 } while (0)
 
 #define NS_PUT16(s, cp) do { \
-	u_int16_t t_s = (u_int16_t)(s); \
-	u_char *t_cp = (u_char *)(cp); \
+	uint16_t t_s = (uint16_t)(s); \
+	unsigned char *t_cp = (unsigned char *)(cp); \
 	*t_cp++ = t_s >> 8; \
 	*t_cp   = t_s; \
 	(cp) += NS_INT16SZ; \
 } while (0)
 
 #define NS_PUT32(l, cp) do { \
-	u_int32_t t_l = (u_int32_t)(l); \
-	u_char *t_cp = (u_char *)(cp); \
+	uint32_t t_l = (uint32_t)(l); \
+	unsigned char *t_cp = (unsigned char *)(cp); \
 	*t_cp++ = t_l >> 24; \
 	*t_cp++ = t_l >> 16; \
 	*t_cp++ = t_l >> 8; \
@@ -354,38 +354,46 @@ typedef enum __ns_cert_types {
 
 __BEGIN_DECLS
 int		ns_msg_getflag (ns_msg, int) __THROW;
-u_int		ns_get16 (const u_char *) __THROW;
-u_long		ns_get32 (const u_char *) __THROW;
-void		ns_put16 (u_int, u_char *) __THROW;
-void		ns_put32 (u_long, u_char *) __THROW;
-int		ns_initparse (const u_char *, int, ns_msg *) __THROW;
-int		ns_skiprr (const u_char *, const u_char *, ns_sect, int)
-     __THROW;
+unsigned int	ns_get16 (const unsigned char *) __THROW;
+unsigned long	ns_get32 (const unsigned char *) __THROW;
+void		ns_put16 (unsigned int, unsigned char *) __THROW;
+void		ns_put32 (unsigned long, unsigned char *) __THROW;
+int		ns_initparse (const unsigned char *, int, ns_msg *) __THROW;
+int		ns_skiprr (const unsigned char *, const unsigned char *,
+			   ns_sect, int) __THROW;
 int		ns_parserr (ns_msg *, ns_sect, int, ns_rr *) __THROW;
 int		ns_sprintrr (const ns_msg *, const ns_rr *,
 			     const char *, const char *, char *, size_t)
      __THROW;
-int		ns_sprintrrf (const u_char *, size_t, const char *,
-			      ns_class, ns_type, u_long, const u_char *,
-			      size_t, const char *, const char *,
-			      char *, size_t) __THROW;
-int		ns_format_ttl (u_long, char *, size_t) __THROW;
-int		ns_parse_ttl (const char *, u_long *) __THROW;
-u_int32_t	ns_datetosecs (const char *, int *) __THROW;
-int		ns_name_ntol (const u_char *, u_char *, size_t) __THROW;
-int		ns_name_ntop (const u_char *, char *, size_t) __THROW;
-int		ns_name_pton (const char *, u_char *, size_t) __THROW;
-int		ns_name_unpack (const u_char *, const u_char *,
-				const u_char *, u_char *, size_t) __THROW;
-int		ns_name_pack (const u_char *, u_char *, int,
-			      const u_char **, const u_char **) __THROW;
-int		ns_name_uncompress (const u_char *, const u_char *,
-				    const u_char *, char *, size_t) __THROW;
-int		ns_name_compress (const char *, u_char *, size_t,
-				  const u_char **, const u_char **) __THROW;
-int		ns_name_skip (const u_char **, const u_char *) __THROW;
-void		ns_name_rollback (const u_char *, const u_char **,
-				  const u_char **) __THROW;
+int		ns_sprintrrf (const unsigned char *, size_t, const char *,
+			      ns_class, ns_type, unsigned long,
+			      const unsigned char *, size_t, const char *,
+			      const char *, char *, size_t) __THROW;
+int		ns_format_ttl (unsigned long, char *, size_t) __THROW;
+int		ns_parse_ttl (const char *, unsigned long *) __THROW;
+uint32_t	ns_datetosecs (const char *, int *) __THROW;
+int		ns_name_ntol (const unsigned char *, unsigned char *, size_t)
+     __THROW;
+int		ns_name_ntop (const unsigned char *, char *, size_t) __THROW;
+int		ns_name_pton (const char *, unsigned char *, size_t) __THROW;
+int		ns_name_unpack (const unsigned char *, const unsigned char *,
+				const unsigned char *, unsigned char *, size_t)
+     __THROW;
+int		ns_name_pack (const unsigned char *, unsigned char *, int,
+			      const unsigned char **, const unsigned char **)
+     __THROW;
+int		ns_name_uncompress (const unsigned char *,
+				    const unsigned char *,
+				    const unsigned char *,
+				    char *, size_t) __THROW;
+int		ns_name_compress (const char *, unsigned char *, size_t,
+				  const unsigned char **,
+				  const unsigned char **) __THROW;
+int		ns_name_skip (const unsigned char **, const unsigned char *)
+     __THROW;
+void		ns_name_rollback (const unsigned char *,
+				  const unsigned char **,
+				  const unsigned char **) __THROW;
 int		ns_samedomain (const char *, const char *) __THROW;
 int		ns_subdomain (const char *, const char *) __THROW;
 int		ns_makecanon (const char *, char *, size_t) __THROW;
diff --git a/resolv/resolv.h b/resolv/resolv.h
index a6f4dadf12..58c3c38743 100644
--- a/resolv/resolv.h
+++ b/resolv/resolv.h
@@ -87,39 +87,39 @@
 struct __res_state {
 	int	retrans;		/* retransmition time interval */
 	int	retry;			/* number of times to retransmit */
-	u_long	options;		/* option flags - see below. */
+	unsigned long options;		/* option flags - see below. */
 	int	nscount;		/* number of name servers */
 	struct sockaddr_in
 		nsaddr_list[MAXNS];	/* address of name server */
 # define nsaddr	nsaddr_list[0]		/* for backward compatibility */
-	u_short	id;			/* current message id */
+	unsigned short id;		/* current message id */
 	/* 2 byte hole here.  */
 	char	*dnsrch[MAXDNSRCH+1];	/* components of domain to search */
 	char	defdname[256];		/* default domain (deprecated) */
-	u_long	pfcode;			/* RES_PRF_ flags - see below. */
+	unsigned long pfcode;		/* RES_PRF_ flags - see below. */
 	unsigned ndots:4;		/* threshold for initial abs. query */
 	unsigned nsort:4;		/* number of elements in sort_list[] */
 	unsigned ipv6_unavail:1;	/* connecting to IPv6 server failed */
 	unsigned unused:23;
 	struct {
 		struct in_addr	addr;
-		u_int32_t	mask;
+		uint32_t	mask;
 	} sort_list[MAXRESOLVSORT];
 	/* 4 byte hole here on 64-bit architectures.  */
 	void * __glibc_unused_qhook;
 	void * __glibc_unused_rhook;
 	int	res_h_errno;		/* last one set for this context */
 	int	_vcsock;		/* PRIVATE: for res_send VC i/o */
-	u_int	_flags;			/* PRIVATE: see below */
+	unsigned int _flags;		/* PRIVATE: see below */
 	/* 4 byte hole here on 64-bit architectures.  */
 	union {
 		char	pad[52];	/* On an i386 this means 512b total. */
 		struct {
-			u_int16_t		nscount;
-			u_int16_t		nsmap[MAXNS];
+			uint16_t		nscount;
+			uint16_t		nsmap[MAXNS];
 			int			nssocks[MAXNS];
-			u_int16_t		nscount6;
-			u_int16_t		nsinit;
+			uint16_t		nscount6;
+			uint16_t		nsinit;
 			struct sockaddr_in6	*nsaddrs[MAXNS];
 #ifdef _LIBC
 			unsigned long long int	initstamp
@@ -247,20 +247,24 @@ __END_DECLS
 #define res_send		__res_send
 
 __BEGIN_DECLS
-void		fp_nquery (const u_char *, int, FILE *) __THROW;
-void		fp_query (const u_char *, FILE *) __THROW;
+void		fp_nquery (const unsigned char *, int, FILE *) __THROW;
+void		fp_query (const unsigned char *, FILE *) __THROW;
 const char *	hostalias (const char *) __THROW;
-void		p_query (const u_char *) __THROW;
+void		p_query (const unsigned char *) __THROW;
 void		res_close (void) __THROW;
 int		res_init (void) __THROW;
 int		res_isourserver (const struct sockaddr_in *) __THROW;
-int		res_mkquery (int, const char *, int, int, const u_char *,
-			     int, const u_char *, u_char *, int) __THROW;
-int		res_query (const char *, int, int, u_char *, int) __THROW;
+int		res_mkquery (int, const char *, int, int,
+			     const unsigned char *, int, const unsigned char *,
+			     unsigned char *, int) __THROW;
+int		res_query (const char *, int, int, unsigned char *, int)
+     __THROW;
 int		res_querydomain (const char *, const char *, int, int,
-				 u_char *, int) __THROW;
-int		res_search (const char *, int, int, u_char *, int) __THROW;
-int		res_send (const u_char *, int, u_char *, int) __THROW;
+				 unsigned char *, int) __THROW;
+int		res_search (const char *, int, int, unsigned char *, int)
+     __THROW;
+int		res_send (const unsigned char *, int, unsigned char *, int)
+     __THROW;
 __END_DECLS
 
 #define b64_ntop		__b64_ntop
@@ -313,56 +317,65 @@ int		res_dnok (const char *) __THROW;
 int		sym_ston (const struct res_sym *, const char *, int *) __THROW;
 const char *	sym_ntos (const struct res_sym *, int, int *) __THROW;
 const char *	sym_ntop (const struct res_sym *, int, int *) __THROW;
-int		b64_ntop (u_char const *, size_t, char *, size_t) __THROW;
-int		b64_pton (char const *, u_char *, size_t) __THROW;
-int		loc_aton (const char *__ascii, u_char *__binary) __THROW;
-const char *	loc_ntoa (const u_char *__binary, char *__ascii) __THROW;
-int		dn_skipname (const u_char *, const u_char *) __THROW;
-void		putlong (u_int32_t, u_char *) __THROW;
-void		putshort (u_int16_t, u_char *) __THROW;
+int		b64_ntop (const unsigned char *, size_t, char *, size_t)
+     __THROW;
+int		b64_pton (char const *, unsigned char *, size_t) __THROW;
+int		loc_aton (const char *__ascii, unsigned char *__binary) __THROW;
+const char *	loc_ntoa (const unsigned char *__binary, char *__ascii) __THROW;
+int		dn_skipname (const unsigned char *, const unsigned char *)
+     __THROW;
+void		putlong (uint32_t, unsigned char *) __THROW;
+void		putshort (uint16_t, unsigned char *) __THROW;
 const char *	p_class (int) __THROW;
-const char *	p_time (u_int32_t) __THROW;
+const char *	p_time (uint32_t) __THROW;
 const char *	p_type (int) __THROW;
 const char *	p_rcode (int) __THROW;
-const u_char *	p_cdnname (const u_char *, const u_char *, int, FILE *)
-     __THROW;
-const u_char *	p_cdname (const u_char *, const u_char *, FILE *) __THROW;
-const u_char *	p_fqnname (const u_char *__cp, const u_char *__msg,
-			   int, char *, int) __THROW;
-const u_char *	p_fqname (const u_char *, const u_char *, FILE *) __THROW;
-const char *	p_option (u_long __option) __THROW;
-char *		p_secstodate (u_long) __THROW;
+const unsigned char * p_cdnname (const unsigned char *,
+				 const unsigned char *, int, FILE *) __THROW;
+const unsigned char * p_cdname (const unsigned char *, const unsigned char *,
+				FILE *) __THROW;
+const unsigned char * p_fqnname (const unsigned char *__cp,
+				 const unsigned char *__msg,
+				 int, char *, int) __THROW;
+const unsigned char * p_fqname (const unsigned char *,
+				const unsigned char *, FILE *) __THROW;
+const char *	p_option (unsigned long __option) __THROW;
+char *		p_secstodate (unsigned long) __THROW;
 int		dn_count_labels (const char *) __THROW;
-int		dn_comp (const char *, u_char *, int, u_char **, u_char **)
-     __THROW;
-int		dn_expand (const u_char *, const u_char *, const u_char *,
-			   char *, int) __THROW;
-u_int		res_randomid (void) __THROW;
+int		dn_comp (const char *, unsigned char *, int, unsigned char **,
+			 unsigned char **) __THROW;
+int		dn_expand (const unsigned char *, const unsigned char *,
+			   const unsigned char *, char *, int) __THROW;
+unsigned int	res_randomid (void) __THROW;
 int		res_nameinquery (const char *, int, int,
-				 const u_char *, const u_char *) __THROW;
-int		res_queriesmatch (const u_char *, const u_char *,
-				  const u_char *, const u_char *) __THROW;
+				 const unsigned char *,
+				 const unsigned char *) __THROW;
+int		res_queriesmatch (const unsigned char *,
+				  const unsigned char *,
+				  const unsigned char *,
+				  const unsigned char *) __THROW;
 const char *	p_section (int __section, int __opcode) __THROW;
 /* Things involving a resolver context. */
 int		res_ninit (res_state) __THROW;
 int		res_nisourserver (const res_state,
 				  const struct sockaddr_in *) __THROW;
 void		fp_resstat (const res_state, FILE *) __THROW;
-void		res_npquery (const res_state, const u_char *, int, FILE *)
-     __THROW;
+void		res_npquery (const res_state, const unsigned char *, int,
+			     FILE *) __THROW;
 const char *	res_hostalias (const res_state, const char *, char *, size_t)
      __THROW;
-int		res_nquery (res_state, const char *, int, int, u_char *, int)
-     __THROW;
-int		res_nsearch (res_state, const char *, int, int, u_char *, int)
-     __THROW;
+int		res_nquery (res_state, const char *, int, int,
+			    unsigned char *, int) __THROW;
+int		res_nsearch (res_state, const char *, int, int,
+			     unsigned char *, int) __THROW;
 int		res_nquerydomain (res_state, const char *, const char *, int,
-				  int, u_char *, int) __THROW;
+				  int, unsigned char *, int) __THROW;
 int		res_nmkquery (res_state, int, const char *, int, int,
-			      const u_char *, int, const u_char *, u_char *,
-			      int) __THROW;
-int		res_nsend (res_state, const u_char *, int, u_char *, int)
+			      const unsigned char *, int,
+			      const unsigned char *, unsigned char *, int)
      __THROW;
+int		res_nsend (res_state, const unsigned char *, int,
+			   unsigned char *, int) __THROW;
 void		res_nclose (res_state) __THROW;
 __END_DECLS
 #endif