summaryrefslogtreecommitdiffstats
path: root/sync/main.c
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2006-11-07 19:53:16 +0000
committerMarcel Holtmann <marcel@holtmann.org>2006-11-07 19:53:16 +0000
commit7a264576af2e7ccf599b069ee2f93c881ef82679 (patch)
tree33f07d8a3a520b8bdc04778f33ce7566b31e64a6 /sync/main.c
parentf58e401a913c642273eea06ccae64782d3a34ca8 (diff)
Add D-Bus and OpenSync skeleton
Diffstat (limited to 'sync/main.c')
-rw-r--r--sync/main.c37
1 files changed, 37 insertions, 0 deletions
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 <stdio.h>
#include <errno.h>
+#include <unistd.h>
+#include <stdlib.h>
+
+#include <opensync/opensync.h>
+#include <osengine/engine.h>
+
+#include <dbus/dbus-glib.h>
+
+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;
}