From 37d266d288410d1ead241c02a8a1dbcb0160be46 Mon Sep 17 00:00:00 2001 From: Michael Graff Date: Thu, 3 Feb 2000 01:37:29 +0000 Subject: [PATCH] decouple the lwres functions too. These really need to be cleaned up in many other ways. --- lib/lwres/assert_p.h | 5 ++++- lib/lwres/gethost.c | 7 +++++-- lib/lwres/getipnode.c | 13 +++++++++---- lib/lwres/getnameinfo.c | 15 +++++++++------ lib/lwres/getnet.c | 7 ++++--- 5 files changed, 31 insertions(+), 16 deletions(-) diff --git a/lib/lwres/assert_p.h b/lib/lwres/assert_p.h index 6b19e89298..a2cc2f68cd 100644 --- a/lib/lwres/assert_p.h +++ b/lib/lwres/assert_p.h @@ -18,10 +18,13 @@ #ifndef LWRES_ASSERT_P_H #define LWRES_ASSERT_P_H 1 -/* XXXMLG */ +#include + #define REQUIRE(x) assert(x) #define INSIST(x) assert(x) +#define UNUSED(x) ((void)(x)) + #define SPACE_OK(b, s) (LWRES_BUFFER_AVAILABLECOUNT(b) >= (s)) #define SPACE_REMAINING(b, s) (LWRES_BUFFER_REMAINING(b) >= (s)) diff --git a/lib/lwres/gethost.c b/lib/lwres/gethost.c index 77f8406278..eb12dc53c4 100644 --- a/lib/lwres/gethost.c +++ b/lib/lwres/gethost.c @@ -15,12 +15,15 @@ * SOFTWARE. */ -#include -#include +#include +#include + #include #include #include +#include + #define LWRES_ALIGNBYTES (sizeof(char *) - 1) #define LWRES_ALIGN(p) \ (((unsigned int)(p) + LWRES_ALIGNBYTES) &~ LWRES_ALIGNBYTES) diff --git a/lib/lwres/getipnode.c b/lib/lwres/getipnode.c index 1005190d19..a77601c102 100644 --- a/lib/lwres/getipnode.c +++ b/lib/lwres/getipnode.c @@ -15,15 +15,20 @@ * SOFTWARE. */ -#include -#include -#include +#include +#include + +#include -#include /* XXX #include */ #include #include #include +#include +#include /* XXX #include */ + +#include "assert_p.h" + #ifndef INADDRSZ #define INADDRSZ 4 #endif diff --git a/lib/lwres/getnameinfo.c b/lib/lwres/getnameinfo.c index cdc067d338..7db48afd18 100644 --- a/lib/lwres/getnameinfo.c +++ b/lib/lwres/getnameinfo.c @@ -37,16 +37,19 @@ * SUCH DAMAGE. */ +#include +#include + +#include + #include -#include -#include -#include +#include #include - #include -#include + +#include "assert_p.h" #define SUCCESS 0 @@ -91,7 +94,7 @@ getnameinfo(const struct sockaddr *sa, size_t salen, char *host, char numserv[sizeof("65000")]; char numaddr[sizeof("abcd:abcd:abcd:abcd:abcd:abcd:255.255.255.255")]; char *proto; - isc_uint32_t lwf = 0; + lwres_uint32_t lwf = 0; lwres_context_t *lwrctx = NULL; lwres_gnbaresponse_t *by = NULL; int result = SUCCESS; diff --git a/lib/lwres/getnet.c b/lib/lwres/getnet.c index 867a668709..1140b8360a 100644 --- a/lib/lwres/getnet.c +++ b/lib/lwres/getnet.c @@ -15,11 +15,12 @@ * SOFTWARE. */ -#include -#include +#include +#include + +#include #include -#include struct netent * getnetbyname(const char *name) {