aboutsummaryrefslogtreecommitdiff
path: root/src/gnsrecord/gnsrecord_misc.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gnsrecord/gnsrecord_misc.c')
-rw-r--r--src/gnsrecord/gnsrecord_misc.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/gnsrecord/gnsrecord_misc.c b/src/gnsrecord/gnsrecord_misc.c
index 3298168f4..54d8fb860 100644
--- a/src/gnsrecord/gnsrecord_misc.c
+++ b/src/gnsrecord/gnsrecord_misc.c
@@ -44,6 +44,22 @@ GNUNET_GNSRECORD_string_normalize (const char *src)
44 return GNUNET_STRINGS_utf8_normalize (src); 44 return GNUNET_STRINGS_utf8_normalize (src);
45} 45}
46 46
47enum GNUNET_GenericReturnValue
48GNUNET_GNSRECORD_label_check (const char*label, char **emsg)
49{
50 if (NULL == label)
51 {
52 *emsg = GNUNET_strdup (_ ("Label is NULL which is not allowed\n"));
53 return GNUNET_NO;
54 }
55 if (0 != strchr (label, '.'))
56 {
57 *emsg = GNUNET_strdup (_ ("Label contains `.' which is not allowed\n"));
58 return GNUNET_NO;
59 }
60 return GNUNET_OK;
61}
62
47/** 63/**
48 * Convert a zone key to a string (for printing debug messages). 64 * Convert a zone key to a string (for printing debug messages).
49 * This is one of the very few calls in the entire API that is 65 * This is one of the very few calls in the entire API that is