]> git.meshlink.io Git - catta/blobdiff - avahi-common/domain-test.c
Add avahi_service_name_snprint()
[catta] / avahi-common / domain-test.c
index a9ad0b66da8f8d33f8551f6e5475a3c45cff1bce..35ce6d6a1d86f4461aa4e1cb176766185298ace3 100644 (file)
 
 #include <stdio.h>
 
-#include "util.h"
+#include "domain.h"
 #include "malloc.h"
 
 int main(int argc, char *argv[]) {
     char *s;
+    char t[256];
     
     printf("host name: %s\n", s = avahi_get_host_name());
     avahi_free(s);
 
     printf("%s\n", s = avahi_normalize_name("foo.foo."));
     avahi_free(s);
+
+    printf("%s\n", s = avahi_normalize_name("foo\.foo."));
+    avahi_free(s);
+
     
     printf("%s\n", s = avahi_normalize_name("\\f\\o\\\\o\\..\\f\\ \\o\\o."));
     avahi_free(s);
@@ -45,7 +50,16 @@ int main(int argc, char *argv[]) {
 
     printf("%i\n", avahi_domain_equal("a", "aaa"));
 
-    printf("%u = %u\n", avahi_domain_hash("\\Aaaab\\\\."), avahi_domain_hash("aaaa\\b\\\\"));
+    printf("%u = %u\n", avahi_domain_hash("\\Aaaab\\\\."), avahi_domain_hash("aaaa\\b\\\\")); 
+
+
+    avahi_service_name_snprint(t, sizeof(t), "foo.foo.foo \.", "_http._tcp", "test.local");
+    printf("<%s>\n", t);
+
+
+    avahi_service_name_snprint(t, sizeof(t), NULL, "_http._tcp", "one.two\. .local");
+    printf("<%s>\n", t);
+
     
     return 0;
 }