]> git.meshlink.io Git - catta/blobdiff - avahi-core/avahi-test.c
* progress on python port of avahi-discover basic things are in place
[catta] / avahi-core / avahi-test.c
index 61d3ea16f6af8d5e06043169b1cda704706da731..595393717c8f78879dc1a2e3c06770cac299f4c4 100644 (file)
@@ -40,9 +40,13 @@ static gboolean quit_timeout(gpointer data) {
     return FALSE;
 }
 
+static void dump_line(const gchar *text, gpointer userdata) {
+    printf("%s\n", text);
+}
+
 static gboolean dump_timeout(gpointer data) {
     AvahiServer *Avahi = data;
-    avahi_server_dump(Avahi, stdout);
+    avahi_server_dump(Avahi, dump_line, NULL);
     return TRUE;
 }
 
@@ -115,17 +119,17 @@ static void create_entries(gboolean new_name) {
         service_name = n;
     }
     
-    if (avahi_server_add_service(server, group, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, "_http._tcp", service_name, NULL, NULL, 80, "foo", NULL) < 0) {
+    if (avahi_server_add_service(server, group, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, service_name, "_http._tcp", NULL, NULL, 80, "foo", NULL) < 0) {
         avahi_log_error("Failed to add HTTP service");
         goto fail;
     }
 
-    if (avahi_server_add_service(server, group, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, "_ftp._tcp", service_name, NULL, NULL, 21, "foo", NULL) < 0) {
+    if (avahi_server_add_service(server, group, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, service_name, "_ftp._tcp", NULL, NULL, 21, "foo", NULL) < 0) {
         avahi_log_error("Failed to add FTP service");
         goto fail;
     }
 
-    if (avahi_server_add_service(server, group, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, "_webdav._tcp", service_name, NULL, NULL, 80, "foo", NULL) < 0) {
+    if (avahi_server_add_service(server, group, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, service_name, "_webdav._tcp", NULL, NULL, 80, "foo", NULL) < 0) {
         avahi_log_error("Failed to add WEBDAV service");
         goto fail;
     }