]> git.ipfire.org Git - thirdparty/ldns.git/commitdiff
main.c test proggel - access functions in rdata.c
authorMiek Gieben <miekg@NLnetLabs.nl>
Tue, 7 Dec 2004 10:12:06 +0000 (10:12 +0000)
committerMiek Gieben <miekg@NLnetLabs.nl>
Tue, 7 Dec 2004 10:12:06 +0000 (10:12 +0000)
main.c [new file with mode: 0644]
rdata.c [new file with mode: 0644]

diff --git a/main.c b/main.c
new file mode 100644 (file)
index 0000000..95fa2ac
--- /dev/null
+++ b/main.c
@@ -0,0 +1,13 @@
+/* 
+ * test main.c
+ *
+ */
+
+#include "rdata.h"
+
+int
+main(void)
+{
+
+       printf("Hallo\n");
+}
diff --git a/rdata.c b/rdata.c
new file mode 100644 (file)
index 0000000..e68a662
--- /dev/null
+++ b/rdata.c
@@ -0,0 +1,57 @@
+/*
+ * rdata.c
+ *
+ * rdata implementation
+ *
+ * a Net::DNS like library for C
+ *
+ * (c) NLnet Labs, 2004
+ *
+ * See the file LICENSE for the license
+ */
+
+#include <stdint.h>
+
+#include "rdata.h"
+
+/* Access functions 
+ * do this as functions to get type checking
+ */
+
+/* read */
+uint16_t
+rd_size(rdata_t *rd)
+{
+       return rd->_size;
+}
+
+rd_type_t
+rd_type(rdata_t *rd)
+{
+       return rd->_type;
+}
+
+uint8_t *
+rd_data(rdata_t *rd)
+{
+       return rd->_data;
+}
+
+/* write */
+void
+rd_set_size(rdata_t *rd, uint16_t s)
+{
+       rd->_size = s;
+}
+
+void
+rd_type(rdata_t *rd, rd_type_t t)
+{
+       rd->_type = t;
+}
+
+void
+rd_data(rdata_t *rd, uint8_t *d)
+{
+       rd->_data = d;
+}