From 7a264576af2e7ccf599b069ee2f93c881ef82679 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Tue, 7 Nov 2006 19:53:16 +0000 Subject: Add D-Bus and OpenSync skeleton --- sync/Makefile.am | 4 ++-- sync/main.c | 37 +++++++++++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+), 2 deletions(-) (limited to 'sync') diff --git a/sync/Makefile.am b/sync/Makefile.am index 4b5b48af..196d0527 100644 --- a/sync/Makefile.am +++ b/sync/Makefile.am @@ -4,9 +4,9 @@ noinst_PROGRAMS = bt.syncd bt_syncd_SOURCES = main.c -bt_syncd_LDADD = @DBUS_LIBS@ @OPENSYNC_LIBS@ @BLUEZ_LIBS@ $(top_builddir)/common/libhelper.a +bt_syncd_LDADD = @GLIB_LIBS@ @OPENSYNC_LIBS@ @BLUEZ_LIBS@ $(top_builddir)/common/libhelper.a -AM_CFLAGS = @BLUEZ_CFLAGS@ @OPENSYNC_CFLAGS@ @DBUS_CFLAGS@ +AM_CFLAGS = @BLUEZ_CFLAGS@ @OPENSYNC_CFLAGS@ @GLIB_CFLAGS@ INCLUDES = -I$(top_srcdir)/common endif diff --git a/sync/main.c b/sync/main.c index c04bb251..1a04bd21 100644 --- a/sync/main.c +++ b/sync/main.c @@ -27,8 +27,45 @@ #include #include +#include +#include + +#include +#include + +#include + +static DBusGConnection *conn; int main(int argc, char *argv[]) { + GMainLoop *mainloop; + GError *error = NULL; + OSyncEnv *env; + + g_type_init(); + + mainloop = g_main_loop_new(NULL, FALSE); + + conn = dbus_g_bus_get(DBUS_BUS_SYSTEM, &error); + if (error != NULL) { + g_printerr("Connecting to system bus failed: %s\n", + error->message); + g_error_free(error); + exit(EXIT_FAILURE); + } + + env = osync_env_new(); + + osync_env_initialize(env, NULL); + + g_main_loop_run(mainloop); + + osync_env_finalize(env, NULL); + + osync_env_free(env); + + dbus_g_connection_unref(conn); + return 0; } -- cgit