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 = \
client-test.c
client_test_CFLAGS = $(AM_CFLAGS)
client_test_LDADD = $(AM_LDADD) libavahi-client.la
+
+endif
#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;
}
#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;
}
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
address.h \
alternative.h \
rr.h \
- util.h
-
-noinst_HEADERS = \
- cdecl.h
+ util.h \
+ cdecl.h \
+ dbus.h
noinst_PROGRAMS = \
strlst-test \
--- /dev/null
+#ifndef foodbushfoo
+/* $Id$ */
+
+/***
+ This file is part of avahi.
+
+ avahi is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ avahi is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
+ Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with avahi; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ USA.
+***/
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#define AVAHI_DBUS_NAME "org.freedesktop.Avahi"
+#define AVAHI_DBUS_INTERFACE_SERVER AVAHI_DBUS_NAME".Server"
+#define AVAHI_DBUS_PATH_SERVER "/org/freedesktop/Avahi/Server"
+#define AVAHI_DBUS_INTERFACE_ENTRY_GROUP AVAHI_DBUS_NAME".EntryGroup"
+#define AVAHI_DBUS_INTERFACE_DOMAIN_BROWSER AVAHI_DBUS_NAME".DomainBrowser"
+#define AVAHI_DBUS_INTERFACE_SERVICE_TYPE_BROWSER AVAHI_DBUS_NAME".ServiceTypeBrowser"
+#define AVAHI_DBUS_INTERFACE_SERVICE_BROWSER AVAHI_DBUS_NAME".ServiceBrowser"
+
+#endif
#include <avahi-core/llist.h>
#include <avahi-core/log.h>
#include <avahi-core/core.h>
+#include <avahi-common/dbus.h>
#include "dbus-protocol.h"
#include "main.h"
-#define AVAHI_DBUS_NAME "org.freedesktop.Avahi"
-#define AVAHI_DBUS_INTERFACE_SERVER AVAHI_DBUS_NAME".Server"
-#define AVAHI_DBUS_PATH_SERVER "/org/freedesktop/Avahi/Server"
-#define AVAHI_DBUS_INTERFACE_ENTRY_GROUP AVAHI_DBUS_NAME".EntryGroup"
-#define AVAHI_DBUS_INTERFACE_DOMAIN_BROWSER AVAHI_DBUS_NAME".DomainBrowser"
-#define AVAHI_DBUS_INTERFACE_SERVICE_TYPE_BROWSER AVAHI_DBUS_NAME".ServiceTypeBrowser"
-#define AVAHI_DBUS_INTERFACE_SERVICE_BROWSER AVAHI_DBUS_NAME".ServiceBrowser"
-
typedef struct Server Server;
typedef struct Client Client;
typedef struct EntryGroupInfo EntryGroupInfo;