]> git.ipfire.org Git - thirdparty/ldns.git/commitdiff
add the file
authorMiek Gieben <miekg@NLnetLabs.nl>
Mon, 27 Mar 2006 13:52:52 +0000 (13:52 +0000)
committerMiek Gieben <miekg@NLnetLabs.nl>
Mon, 27 Mar 2006 13:52:52 +0000 (13:52 +0000)
examples/ldns-resolver.c [new file with mode: 0644]

diff --git a/examples/ldns-resolver.c b/examples/ldns-resolver.c
new file mode 100644 (file)
index 0000000..6887c1b
--- /dev/null
@@ -0,0 +1,27 @@
+#include "config.h"
+
+#include <ldns/dns.h>
+
+int
+main(int argc, char **argv) {
+
+       ldns_resolver *r = NULL;
+       int line;
+       FILE *rand;
+
+       if (!(rand = fopen(argv[1], "r"))) {
+               exit(EXIT_FAILURE);
+       }
+
+       printf("Trying to read from /dev/urandom\n");
+       r = ldns_resolver_new_frm_fp_l(rand, &line);
+       if (!r) {
+               printf("Failure\n");
+       } else {
+               printf("Succes\n");
+               ldns_resolver_print(stdout, r);
+       }
+
+       fclose(rand);
+
+}