From 0781d5363fb6fd723a2316fc7558aef6439b2f71 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Fri, 21 Jan 2005 00:16:08 +0000 Subject: massive work git-svn-id: file:///home/lennart/svn/public/avahi/trunk@8 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe --- main.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'main.c') diff --git a/main.c b/main.c index d7a0f2f..d8c2065 100644 --- a/main.c +++ b/main.c @@ -5,35 +5,35 @@ #include "flx.h" #include "server.h" -static GMainLoop *loop = NULL; - static gboolean timeout(gpointer data) { - g_main_loop_quit(loop); + g_main_loop_quit(data); return FALSE; } int main(int argc, char *argv[]) { flxServer *flx; gchar *r; - flxQuery q; + flxKey *k; + GMainLoop *loop = NULL; flx = flx_server_new(NULL); - flx_server_add_text(flx, 0, 0, AF_UNSPEC, NULL, "hallo"); - - q.name = "campari.local."; - q.class = FLX_DNS_CLASS_IN; - q.type = FLX_DNS_TYPE_A; - flx_server_post_query_job(flx, 0, AF_UNSPEC, NULL, &q); + flx_server_add_text(flx, 0, 0, AF_UNSPEC, FALSE, NULL, "hallo"); + + k = flx_key_new("cocaine.local.", FLX_DNS_CLASS_IN, FLX_DNS_TYPE_A); + flx_server_send_query(flx, 0, AF_UNSPEC, k); + flx_key_unref(k); + + loop = g_main_loop_new(NULL, FALSE); - g_timeout_add(5000, timeout, NULL); + g_timeout_add(5000, timeout, loop); - loop = g_main_loop_new(NULL, FALSE); g_main_loop_run(loop); g_main_loop_unref(loop); flx_server_dump(flx, stdout); flx_server_free(flx); + return 0; } -- cgit