decouple the lwres functions too. These really need to be cleaned up in many other ways.

This commit is contained in:
Michael Graff 2000-02-03 01:37:29 +00:00
parent 2cc3f12861
commit 37d266d288
5 changed files with 31 additions and 16 deletions

View file

@ -18,10 +18,13 @@
#ifndef LWRES_ASSERT_P_H
#define LWRES_ASSERT_P_H 1
/* XXXMLG */
#include <assert.h>
#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))

View file

@ -15,12 +15,15 @@
* SOFTWARE.
*/
#include <isc/net.h>
#include <lwres/netdb.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <lwres/netdb.h>
#define LWRES_ALIGNBYTES (sizeof(char *) - 1)
#define LWRES_ALIGN(p) \
(((unsigned int)(p) + LWRES_ALIGNBYTES) &~ LWRES_ALIGNBYTES)

View file

@ -15,15 +15,20 @@
* SOFTWARE.
*/
#include <isc/net.h>
#include <isc/assertions.h>
#include <lwres/lwres.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <lwres/netdb.h> /* XXX #include <netdb.h> */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <lwres/lwres.h>
#include <lwres/netdb.h> /* XXX #include <netdb.h> */
#include "assert_p.h"
#ifndef INADDRSZ
#define INADDRSZ 4
#endif

View file

@ -37,16 +37,19 @@
* SUCH DAMAGE.
*/
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <config.h>
#include <isc/assertions.h>
#include <isc/net.h>
#include <isc/print.h>
#include <string.h>
#include <lwres/lwres.h>
#include <lwres/netdb.h>
#include <string.h>
#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;

View file

@ -15,11 +15,12 @@
* SOFTWARE.
*/
#include <isc/net.h>
#include <isc/util.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <stdio.h>
#include <lwres/netdb.h>
#include <stdio.h>
struct netent *
getnetbyname(const char *name) {