summaryrefslogtreecommitdiff
path: root/src/clients/s6dns_namescanner.c
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2014-12-10 03:05:47 +0000
committerLaurent Bercot <ska-skaware@skarnet.org>2014-12-10 03:05:47 +0000
commit416ef5e2bf59bb2e45066a1d5d91ac677c0f48e5 (patch)
tree1c746d673dcec7a8488c6ac51db8245411034376 /src/clients/s6dns_namescanner.c
downloads6-dns-416ef5e2bf59bb2e45066a1d5d91ac677c0f48e5.tar.xz
Initial commit
Diffstat (limited to 'src/clients/s6dns_namescanner.c')
-rw-r--r--src/clients/s6dns_namescanner.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/clients/s6dns_namescanner.c b/src/clients/s6dns_namescanner.c
new file mode 100644
index 0000000..b23fb3d
--- /dev/null
+++ b/src/clients/s6dns_namescanner.c
@@ -0,0 +1,12 @@
+/* ISC license. */
+
+#include <s6-dns/s6dns-domain.h>
+#include <s6-dns/s6dns-generic-filter.h>
+
+unsigned int s6dns_namescanner (s6dns_domain_t *d, char const *s)
+{
+ register unsigned int pos = 0 ;
+ while (s[pos] && (s[pos] != ' ') && (s[pos] != '\t') && (s[pos] != '\r') && (s[pos] != '\n')) pos++ ;
+ if (!s6dns_domain_fromstring_noqualify_encode(d, s, pos)) return 0 ;
+ return pos ;
+}