From: Erik Rozendaal Date: Tue, 14 Dec 2004 13:26:51 +0000 (+0000) Subject: Moved external include files to ldns directory. X-Git-Tag: release-0.50~695 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=cee728c452b96dcbfbc1e40c2796e97a13162158;p=thirdparty%2Fldns.git Moved external include files to ldns directory. --- diff --git a/configure.ac b/configure.ac index 7dfc26ab..d6e2a2d2 100644 --- a/configure.ac +++ b/configure.ac @@ -20,7 +20,7 @@ AC_PATH_PROG(doxygen, doxygen, "/usr/bin/doxygen") #AC_HEADER_SYS_WAIT #AC_CHECK_HEADERS([getopt.h fcntl.h stdlib.h string.h strings.h unistd.h]) # do the very minimum - we can always extend this -AC_CHECK_HEADERS([getopt.h stdlib.h stdio.h openssl/ssl.h assert.h netinet/in.h ctype.h]) +AC_CHECK_HEADERS([getopt.h stdbool.h stdlib.h stdio.h openssl/ssl.h assert.h netinet/in.h ctype.h]) AC_CHECK_HEADERS(sys/param.h sys/mount.h,,, [ [ diff --git a/ldns/common.h b/ldns/common.h new file mode 100644 index 00000000..f74b32cf --- /dev/null +++ b/ldns/common.h @@ -0,0 +1,30 @@ +/* + * common.h + * + * Common definitions for LDNS + * + * a Net::DNS like library for C + * + * (c) NLnet Labs, 2004 + * + * See the file LICENSE for the license + */ + +#ifndef _LDNS_COMMON_H +#define _LDNS_COMMON_H + +#ifdef HAVE_STDBOOL_H +#include +#else + +#ifndef __cplusplus + +typedef unsigned char bool; +#define false 0 +#define true 1 + +#endif /* !__cplusplus */ + +#endif /* !HAVE_STDBOOL_H */ + +#endif /* !_LDNS_COMMON_H */ diff --git a/ldns/ldns.h b/ldns/ldns.h new file mode 100644 index 00000000..94d8787b --- /dev/null +++ b/ldns/ldns.h @@ -0,0 +1,21 @@ +/* + * ldns.h + * + * Main include files for LDNS clients. + * + * a Net::DNS like library for C + * + * (c) NLnet Labs, 2004 + * + * See the file LICENSE for the license + */ + +#ifndef _LDNS_H +#define _LDNS_H + +#include +#include +#include +#include + +#endif /* _LDNS_H */ diff --git a/packet.h b/ldns/packet.h similarity index 96% rename from packet.h rename to ldns/packet.h index bf5c5a9c..30fe2c5c 100644 --- a/packet.h +++ b/ldns/packet.h @@ -9,10 +9,11 @@ * * See the file LICENSE for the license */ -#ifdef _PACKET_H -#else -#define _PACKET_H -#include "config.h" + +#ifndef _LDNS_PACKET_H +#define _LDNS_PACKET_H + +#include /** * \brief Header of a dns packet @@ -119,4 +120,4 @@ t_packet *dns_packet_new(); */ size_t dns_wire2packet(uint8_t *data, t_packet *packet); -#endif +#endif /* !_LDNS_PACKET_H */ diff --git a/rdata.h b/ldns/rdata.h similarity index 97% rename from rdata.h rename to ldns/rdata.h index 6e790810..dadae330 100644 --- a/rdata.h +++ b/ldns/rdata.h @@ -9,11 +9,9 @@ * * See the file LICENSE for the license */ -#ifdef _RDATA_H -#else -#define _RDATA_H -#include +#ifndef _LDNS_RDATA_H +#define _LDNS_RDATA_H /** * LibDNS DESIGN @@ -139,4 +137,5 @@ t_rd_type _ldns_rd_field_type(t_rdata_field *); t_rdata_field *_ldns_rd_field_new(uint16_t, t_rd_type, uint8_t *); uint8_t *_ldns_rd_field_data(t_rdata_field *); void _ldns_rd_field_destroy(t_rdata_field *); -#endif /* _RDATA_H */ + +#endif /* !_LDNS_RDATA_H */ diff --git a/rr.h b/ldns/rr.h similarity index 97% rename from rr.h rename to ldns/rr.h index fd74bbb0..0969af98 100644 --- a/rr.h +++ b/ldns/rr.h @@ -10,12 +10,12 @@ * * See the file LICENSE for the license */ -#ifdef _RR_H -#else -#define _RR_H -#include "rdata.h" -#include "rr.h" +#ifndef _LDNS_RR_H +#define _LDNS_RR_H + +#include "ldns/rdata.h" +#include "ldns/rr.h" /* the different RR types */ /** a host address */ @@ -168,4 +168,5 @@ void ldns_rr_push_rd_field(t_rr *, t_rdata_field *); uint8_t *ldns_rr_owner(t_rr *); uint8_t ldns_rr_ttl(t_rr *); uint16_t ldns_rr_rd_count(t_rr *); -#endif /* _RR_H */ + +#endif /* _LDNS_RR_H */ diff --git a/packet.c b/packet.c index b7f72935..bd7b6c6e 100644 --- a/packet.c +++ b/packet.c @@ -12,10 +12,8 @@ #include -#include "rdata.h" -#include "rr.h" -#include "prototype.h" -#include "packet.h" +#include + #include "util.h" /* Access functions @@ -274,4 +272,3 @@ dns_wire2packet(uint8_t *wire, t_packet *packet) return pos; } - diff --git a/prototype.h b/prototype.h deleted file mode 100644 index 6d5e1bca..00000000 --- a/prototype.h +++ /dev/null @@ -1,18 +0,0 @@ -/* - * prototype.h - * - * general prototyps - * - * a Net::DNS like library for C - * - * (c) NLnet Labs, 2004 - * - * See the file LICENSE for the license - */ -#ifdef _PROTOTYPE_H -#else -#define _PROTOTYPE_H - -/* empty for now */ - -#endif /* _PROTOTYPE_H */ diff --git a/rdata.c b/rdata.c index 3658675d..00c020b2 100644 --- a/rdata.c +++ b/rdata.c @@ -12,10 +12,9 @@ #include -#include "rdata.h" -#include "rr.h" +#include + #include "util.h" -#include "prototype.h" /* Access functions * do this as functions to get type checking diff --git a/rr.c b/rr.c index 209e64f5..7f333215 100644 --- a/rr.c +++ b/rr.c @@ -12,9 +12,8 @@ #include -#include "rdata.h" -#include "rr.h" -#include "prototype.h" +#include + #include "util.h" /** diff --git a/run-test0.c b/run-test0.c index 34a32045..b32a5a5a 100644 --- a/run-test0.c +++ b/run-test0.c @@ -5,10 +5,8 @@ #include -#include "rdata.h" -#include "rr.h" -#include "packet.h" -#include "prototype.h" +#include + #include "util.h" int diff --git a/util.c b/util.c index f53472dc..70a28c80 100644 --- a/util.c +++ b/util.c @@ -12,8 +12,8 @@ #include -#include "rdata.h" -#include "rr.h" +#include +#include /* put this here tmp. for debugging */ void diff --git a/util.h b/util.h index 67ce5f9b..4ffb8e1c 100644 --- a/util.h +++ b/util.h @@ -10,10 +10,11 @@ * See the file LICENSE for the license */ -#ifdef _UTIL_H -#else +#ifndef _UTIL_H #define _UTIL_H +#include + /** * Memory management macro's */ @@ -38,4 +39,4 @@ void xprintf_rd_field(t_rdata_field *); void xprintf_rr(t_rr *); -#endif /* _UTIL_H */ +#endif /* !_UTIL_H */