From 98d4644e8f9445fa4cf7395b05a9f860b8f3cb9c Mon Sep 17 00:00:00 2001 From: Trent Lloyd Date: Mon, 1 Aug 2005 21:51:44 +0000 Subject: * Work on avahi-client git-svn-id: file:///home/lennart/svn/public/avahi/trunk@208 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe --- avahi-client/client-test.c | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) (limited to 'avahi-client/client-test.c') diff --git a/avahi-client/client-test.c b/avahi-client/client-test.c index 71d5096..cc41f49 100644 --- a/avahi-client/client-test.c +++ b/avahi-client/client-test.c @@ -1,15 +1,32 @@ #include #include +#include int main (int argc, char *argv[]) { + GMainLoop *loop; AvahiClient *avahi; + char *ret; + + loop = g_main_loop_new (NULL, FALSE); avahi = avahi_client_new (); - if (avahi != NULL) - free (avahi); + g_assert (avahi != NULL); + + ret = avahi_client_get_version_string (avahi); + printf ("Avahi Server Version: %s\n", ret); + + ret = avahi_client_get_host_name (avahi); + printf ("Host Name: %s\n", ret); + + ret = avahi_client_get_alternative_host_name (avahi, "ubuntu"); + printf ("Alternative Host Name: %s\n", ret); + + g_free (avahi); + + g_main_loop_run (loop); return 0; } -- cgit