From 368ed1a2a0d95964b3f88c70c9a8c5516367f3f7 Mon Sep 17 00:00:00 2001 From: Trent Lloyd Date: Fri, 29 Jul 2005 02:03:26 +0000 Subject: * Move dbus service #defines to avahi-common/dbus.h * Move cdecl.h to installed common headers * Remove glib use from avahi-client * Only build avahi-client if dbus is enabled git-svn-id: file:///home/lennart/svn/public/avahi/trunk@190 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe --- avahi-client/Makefile.am | 8 ++++++++ avahi-client/client-test.c | 10 +++++++--- avahi-client/client.c | 13 ++++++++++--- avahi-client/client.h | 13 ++++++++++--- 4 files changed, 35 insertions(+), 9 deletions(-) (limited to 'avahi-client') 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 +#include 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 +#include +#include + +#define DBUS_API_SUBJECT_TO_CHANGE +#include + +#include 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 +#include -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 -- cgit