#include <unistd.h>
#include <limits.h>
+#include <signal.h>
#include <sys/param.h>
#include <string.h>
#include <glib/gprintf.h>
+#include <glib-unix.h>
#include "localed-gen.h"
+#include "localed.h"
GPtrArray *localed_freeable;
Locale1 *localed_interf;
-/* --- begin method/property/signal code --- */
+GMainLoop *localed_loop;
+
+guint bus_descriptor;
+gboolean dbus_interface_exported; /* reliable because of gdbus operational guarantees */
+
+/* --- begin method/property/dbus signal code --- */
/*static gboolean
on_handle_set_hostname(Locale1 *hn1_passed_interf,
return strncpy(ret, hostname_buf, hostname_divider);
}*/
-/* --- end method/property/signal code, begin bus/name handlers --- */
+/* --- end method/property/dbus signal code, begin bus/name handlers --- */
static void localed_on_bus_acquired(GDBusConnection *conn,
const gchar *name,
}
-/* --- end bus/name handlers, begin misc functions --- */
-
-/* free()'s */
-void localed_mem_clean() {
-
- g_ptr_array_foreach(localed_freeable, (GFunc) g_free, NULL);
- g_ptr_array_free(localed_freeable, TRUE);
-}
-
static void localed_on_name_lost(GDBusConnection *conn,
const gchar *name,
gpointer user_data) {
}
-int main() {
+/* --- end bus/name handlers, begin misc unix functions --- */
- guint bus_descriptor;
- GMainLoop *localed_loop;
+/* free()'s */
+void localed_mem_clean() {
+
+ g_ptr_array_foreach(localed_freeable, (GFunc) g_free, NULL);
+ g_ptr_array_free(localed_freeable, TRUE);
+}
+
+int main() {
localed_loop = g_main_loop_new(NULL, TRUE);
localed_freeable = g_ptr_array_new();