diff options
author | Trent Lloyd <lathiat@bur.st> | 2005-08-01 21:51:44 +0000 |
---|---|---|
committer | Trent Lloyd <lathiat@bur.st> | 2005-08-01 21:51:44 +0000 |
commit | 98d4644e8f9445fa4cf7395b05a9f860b8f3cb9c (patch) | |
tree | 665ac55039b217a1b112ea712ca283ceec783ea1 /avahi-client/client-test.c | |
parent | dec8671fa47e8a6f9b92072e1ad5055b8cd5df27 (diff) |
* Work on avahi-client
git-svn-id: file:///home/lennart/svn/public/avahi/trunk@208 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe
Diffstat (limited to 'avahi-client/client-test.c')
-rw-r--r-- | avahi-client/client-test.c | 21 |
1 files changed, 19 insertions, 2 deletions
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 <avahi-client/client.h> #include <stdio.h> +#include <glib.h> 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; } |