From: Miek Gieben Date: Mon, 27 Mar 2006 13:52:52 +0000 (+0000) Subject: add the file X-Git-Tag: release-1.1.0~274 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0e9ed249f21f726dedbbab68ca015fb457cf5a99;p=thirdparty%2Fldns.git add the file --- diff --git a/examples/ldns-resolver.c b/examples/ldns-resolver.c new file mode 100644 index 00000000..6887c1b2 --- /dev/null +++ b/examples/ldns-resolver.c @@ -0,0 +1,27 @@ +#include "config.h" + +#include + +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); + +}