From 4de3df3db7df43474176533d0b5fac851dd4a9b4 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Fri, 20 May 2005 14:54:00 +0000 Subject: Add support for server state change callbacks git-svn-id: file:///home/lennart/svn/public/avahi/trunk@78 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe --- avahi-core/conformance-test.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'avahi-core/conformance-test.c') diff --git a/avahi-core/conformance-test.c b/avahi-core/conformance-test.c index 74c3833..4bcd691 100644 --- a/avahi-core/conformance-test.c +++ b/avahi-core/conformance-test.c @@ -31,6 +31,7 @@ #include "core.h" #include "util.h" +#include "alternative.h" static gchar *name = NULL; static AvahiEntryGroup *group = NULL; @@ -68,7 +69,6 @@ static void create_service(gchar *t) { static gboolean rename_timeout(gpointer data) { - if (access("flag", F_OK) == 0) { create_service("New - Bonjour Service Name"); return FALSE; @@ -77,8 +77,6 @@ static gboolean rename_timeout(gpointer data) { return TRUE; } - - static void entry_group_callback(AvahiServer *s, AvahiEntryGroup *g, AvahiEntryGroupState state, gpointer userdata) { if (state == AVAHI_ENTRY_GROUP_COLLISION) create_service(NULL); @@ -88,10 +86,14 @@ static void entry_group_callback(AvahiServer *s, AvahiEntryGroup *g, AvahiEntryG } } +static void server_callback(AvahiServer *s, AvahiServerState state, gpointer userdata) { + g_message("server state: %i", state); +} + int main(int argc, char *argv[]) { GMainLoop *loop = NULL; - avahi = avahi_server_new(NULL, NULL); + avahi = avahi_server_new(NULL, NULL, server_callback, NULL); create_service("gurke"); avahi_server_dump(avahi, stdout); -- cgit