From: Miek Gieben Date: Wed, 8 Dec 2004 13:49:42 +0000 (+0000) Subject: comiles again - fixes header include stuff X-Git-Tag: release-0.50~746 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=6d87cef109bd0653c074a2ea8dd76fed6a9deddb;p=thirdparty%2Fldns.git comiles again - fixes header include stuff --- diff --git a/Makefile b/Makefile index 06b03dca..0b4fc7c0 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,7 @@ CC = gcc CFLAGS = -g -Wall -Wwrite-strings -Wunused-value -Wunused-parameter LIBOBJ=rdata.o util.o -HEADER=rdata.h prototype.h +HEADER=rdata.h prototype.h rr.h packet.h COMPILE = $(CC) $(CFLAGS) LINK = $(CC) $(CFLAGS) $(LDFLAGS) diff --git a/main.c b/main.c index 257f5117..7bc8ae08 100644 --- a/main.c +++ b/main.c @@ -5,10 +5,10 @@ #include -#include "prototype.h" #include "rdata.h" #include "rr.h" #include "packet.h" +#include "prototype.h" int main(void) diff --git a/packet.h b/packet.h index 77473f9d..3132f219 100644 --- a/packet.h +++ b/packet.h @@ -9,22 +9,13 @@ * * See the file LICENSE for the license */ -#ifndef _PACKET_H -#define _PACKET_H +#ifdef _PACKET_H #else +#define _PACKET_H #include -#include "prototype.h" - -struct struct_packet_type -{ - header_t *header /* header section */ - rrset_t *question; /* question section */ - rrset_t *answer; /* answer section */ - rrset_t *authority; /* auth section */ - rrset_t *additional; /* add section */ -}; -typedef struct struct_packet_type packet_t; +#include "rdata.h" +#include "rr.h" struct struct_header_type { @@ -44,5 +35,15 @@ struct struct_header_type uint8_t acount; /* add sec */ }; typedef struct struct_header_type header_t; + +struct struct_packet_type +{ + header_t *header; /* header section */ + rrset_t *question; /* question section */ + rrset_t *answer; /* answer section */ + rrset_t *authority; /* auth section */ + rrset_t *additional; /* add section */ +}; +typedef struct struct_packet_type packet_t; #endif /* _PACKET_H */ diff --git a/prototype.h b/prototype.h index ef848cab..9243b472 100644 --- a/prototype.h +++ b/prototype.h @@ -9,35 +9,15 @@ * * See the file LICENSE for the license */ -#ifndef _PROTOTYPE_H -#define _PROTOTYPE_H +#ifdef _PROTOTYPE_H #else +#define _PROTOTYPE_H #include #include -#ifndef _RDATA_H -#include "rdata.h" -#endif /* _RDATA_H */ -#ifndef _RR_H -#include "rr.h" -#endif /* _RR_H */ -#ifndef _PACKET_H -#include "packet.h" -#endif /* _PACKET_H */ - /* util.c */ void *xmalloc(size_t); void xprintf_rd(rdata_t *); -/* rdata.c */ -uint16_t rd_size(rdata_t *); -uint8_t *rd_data(rdata_t *); -void rd_set_size(rdata_t *, uint16_t); -void rd_set_type(rdata_t *, rd_type_t); -void rd_set_data(rdata_t *, uint8_t *, uint16_t); -rd_type_t rd_type(rdata_t *); -rdata_t *rd_new(uint16_t, rd_type_t, uint8_t *); -void rd_destroy(rdata_t *); - #endif /* _PROTOTYPE_H */ diff --git a/rdata.c b/rdata.c index 93f2cd41..db3e58e4 100644 --- a/rdata.c +++ b/rdata.c @@ -13,6 +13,7 @@ #include #include +#include "rdata.h" #include "prototype.h" /* Access functions diff --git a/rdata.h b/rdata.h index 0e22ed57..6b3e85d1 100644 --- a/rdata.h +++ b/rdata.h @@ -9,9 +9,9 @@ * * See the file LICENSE for the license */ -#ifndef _RDATA_H -#define _RDATA_H +#ifdef _RDATA_H #else +#define _RDATA_H #include @@ -63,4 +63,15 @@ struct struct_rdata_t uint8_t *_data; }; typedef struct struct_rdata_t rdata_t; + +/* prototypes */ +uint16_t rd_size(rdata_t *); +uint8_t *rd_data(rdata_t *); +void rd_set_size(rdata_t *, uint16_t); +void rd_set_type(rdata_t *, rd_type_t); +void rd_set_data(rdata_t *, uint8_t *, uint16_t); +rd_type_t rd_type(rdata_t *); +rdata_t *rd_new(uint16_t, rd_type_t, uint8_t *); +void rd_destroy(rdata_t *); #endif /* _RDATA_H */ + diff --git a/rr.h b/rr.h index c05d054d..d9d2f7e1 100644 --- a/rr.h +++ b/rr.h @@ -9,13 +9,14 @@ * * See the file LICENSE for the license */ -#ifndef _RR_H -#define _RR_H +#ifdef _RR_H #else +#define _RR_H #include #include -#include "prototype.h" +#include "rdata.h" +#include "rr.h" /* the different RR types */ #define TYPE_A 1 /* a host address */ diff --git a/util.c b/util.c index 6ffc2d9b..04ac0183 100644 --- a/util.c +++ b/util.c @@ -14,7 +14,8 @@ #include #include -#include "prototype.h" +#include "rdata.h" +#include "rr.h" void * xmalloc(size_t s)