]> git.ipfire.org Git - thirdparty/ldns.git/commitdiff
comiles again - fixes header include stuff
authorMiek Gieben <miekg@NLnetLabs.nl>
Wed, 8 Dec 2004 13:49:42 +0000 (13:49 +0000)
committerMiek Gieben <miekg@NLnetLabs.nl>
Wed, 8 Dec 2004 13:49:42 +0000 (13:49 +0000)
Makefile
main.c
packet.h
prototype.h
rdata.c
rdata.h
rr.h
util.c

index 06b03dca15400e2d8913905b7685fa825301ba08..0b4fc7c064e4782327ed6f02cc61b867397a8047 100644 (file)
--- 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 257f5117e82417d4c2738947013e1f8e61c084f7..7bc8ae08dc5bc8437f00de260c10226353e4fb0f 100644 (file)
--- a/main.c
+++ b/main.c
@@ -5,10 +5,10 @@
 
 #include <stdio.h>
 
-#include "prototype.h"
 #include "rdata.h"
 #include "rr.h"
 #include "packet.h"
+#include "prototype.h"
 
 int
 main(void)
index 77473f9d1bc41c8905147f4f615f68e2dbac1eaf..3132f2196a52bdb37543c730a0bb591b92435c28 100644 (file)
--- 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 <stdint.h>
-#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 */
index ef848cabf07cce84e903f7895ff3adef86c80202..9243b472fc3ff3da22dd6e106c240e6b60322594 100644 (file)
@@ -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 <stdint.h>
 #include <stdlib.h>
 
-#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 93f2cd410fa16eeebf840f676ad47a86e55b7511..db3e58e4d00905ee8200d87ac2f316d3781424da 100644 (file)
--- a/rdata.c
+++ b/rdata.c
@@ -13,6 +13,7 @@
 #include <stdint.h>
 #include <string.h>
 
+#include "rdata.h"
 #include "prototype.h"
 
 /* Access functions 
diff --git a/rdata.h b/rdata.h
index 0e22ed57ff8730022d26930d8d846d1dca8c5b4c..6b3e85d139e38aa4da11048dfd1102e311c9416f 100644 (file)
--- 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 <stdint.h>
 
@@ -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 c05d054d94d9915bae6af574f4d86c4d3bee3a4a..d9d2f7e156f187c67e07504f3cacb83f3d7c4da2 100644 (file)
--- 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 <stdint.h>
 #include <string.h>
-#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 6ffc2d9b8dfecec027485e70dfe05fb1b6f4f77f..04ac0183636713f996470cd851eff94d8128edf5 100644 (file)
--- a/util.c
+++ b/util.c
@@ -14,7 +14,8 @@
 #include <stdlib.h>
 #include <stdio.h>
 
-#include "prototype.h"
+#include "rdata.h"
+#include "rr.h"
 
 void *
 xmalloc(size_t s)