summaryrefslogtreecommitdiffstats
path: root/avahi-client
diff options
context:
space:
mode:
Diffstat (limited to 'avahi-client')
-rw-r--r--avahi-client/Makefile.am8
-rw-r--r--avahi-client/client-test.c10
-rw-r--r--avahi-client/client.c13
-rw-r--r--avahi-client/client.h13
4 files changed, 35 insertions, 9 deletions
diff --git a/avahi-client/Makefile.am b/avahi-client/Makefile.am
index 8f9dce0..2d5a654 100644
--- a/avahi-client/Makefile.am
+++ b/avahi-client/Makefile.am
@@ -23,9 +23,15 @@ AM_CFLAGS=-I$(top_srcdir)
AM_CFLAGS+=$(GLIB20_CFLAGS)
AM_LDADD=$(GLIB20_LIBS)
+# DBUS
+AM_CFLAGS+=$(DBUS_CFLAGS)
+AM_LDADD+=$(DBUS_LIBS)
+
# This cool debug trap works on i386/gcc only
AM_CFLAGS+='-DDEBUG_TRAP=__asm__("int $$3")'
+if ENABLE_DBUS
+
avahi_clientincludedir=$(includedir)/avahi-client
avahi_clientinclude_HEADERS = \
@@ -44,3 +50,5 @@ client_test_SOURCES = \
client-test.c
client_test_CFLAGS = $(AM_CFLAGS)
client_test_LDADD = $(AM_LDADD) libavahi-client.la
+
+endif
diff --git a/avahi-client/client-test.c b/avahi-client/client-test.c
index 72a8e65..71d5096 100644
--- a/avahi-client/client-test.c
+++ b/avahi-client/client-test.c
@@ -1,11 +1,15 @@
#include <avahi-client/client.h>
+#include <stdio.h>
int
main (int argc, char *argv[])
{
- AvahiClient *avahi;
+ AvahiClient *avahi;
+
+ avahi = avahi_client_new ();
- avahi = avahi_client_new ();
+ if (avahi != NULL)
+ free (avahi);
- g_message ("Got server ID %d", avahi->serverid);
+ return 0;
}
diff --git a/avahi-client/client.c b/avahi-client/client.c
index 949e5ef..3643403 100644
--- a/avahi-client/client.c
+++ b/avahi-client/client.c
@@ -1,11 +1,18 @@
#include <avahi-client/client.h>
+#include <avahi-common/dbus.h>
+#include <glib.h>
+
+#define DBUS_API_SUBJECT_TO_CHANGE
+#include <dbus/dbus.h>
+
+#include <stdlib.h>
AvahiClient *
avahi_client_new ()
{
- AvahiClient *tmp;
+ AvahiClient *tmp;
- tmp = g_new0 (AvahiClient, 1);
+ tmp = malloc (sizeof (AvahiClient));
- return tmp;
+ return tmp;
}
diff --git a/avahi-client/client.h b/avahi-client/client.h
index a33f1d2..91f5af5 100644
--- a/avahi-client/client.h
+++ b/avahi-client/client.h
@@ -22,12 +22,19 @@
USA.
***/
-#include <glib.h>
+#include <avahi-common/cdecl.h>
-typedef struct AvahiClient {
- gint serverid;
+/** \file client.h Definitions and functions for the client API over D-Bus */
+
+AVAHI_C_DECL_BEGIN
+
+typedef struct {
+ int serverid;
} AvahiClient;
+/** Creates a new client instance */
AvahiClient* avahi_client_new ();
+AVAHI_C_DECL_END
+
#endif