]> git.meshlink.io Git - catta/blob - main.c
b366eb5e293a54370579c51c9f49ef17935a4036
[catta] / main.c
1 #include <sys/socket.h>
2 #include <netinet/in.h>
3 #include <arpa/inet.h>
4
5 #include "flx.h"
6 #include "server.h"
7
8 static gboolean timeout(gpointer data) {
9     g_main_loop_quit(data);
10     return FALSE;
11 }
12
13 int main(int argc, char *argv[]) {
14     flxServer *flx;
15     gchar *r;
16     flxKey *k;
17     GMainLoop *loop = NULL;
18
19     flx = flx_server_new(NULL);
20
21     flx_server_add_text(flx, 0, 0, AF_UNSPEC, FALSE, NULL, "hallo");
22
23     loop = g_main_loop_new(NULL, FALSE);
24     
25     g_timeout_add(1000, timeout, loop);
26     
27     g_main_loop_run(loop);
28
29     k = flx_key_new("cocaine.local.", FLX_DNS_CLASS_IN, FLX_DNS_TYPE_A);
30     flx_server_send_query(flx, 0, AF_UNSPEC, k);
31     flx_key_unref(k);
32
33     g_main_loop_unref(loop);
34
35     flx_server_dump(flx, stdout);
36
37     flx_server_free(flx);
38     
39     return 0;
40 }