projects
/
systembsd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
(3) add needed GLib headers, move loop and bus descr out of main into global
[systembsd.git]
/
src
/
interfaces
/
localed
/
localed.c
diff --git
a/src/interfaces/localed/localed.c
b/src/interfaces/localed/localed.c
index 9638a7c9643877069242d331345dd1eac7ba8e3a..c11ae36b2c5be0f8a2bb6aaaa00070bd83abc8cf 100644
(file)
--- a/
src/interfaces/localed/localed.c
+++ b/
src/interfaces/localed/localed.c
@@
-16,6
+16,7
@@
#include <unistd.h>
#include <limits.h>
#include <unistd.h>
#include <limits.h>
+#include <signal.h>
#include <sys/param.h>
#include <string.h>
#include <sys/param.h>
#include <string.h>
@@
-24,10
+25,16
@@
#include <glib-unix.h>
#include "localed-gen.h"
#include <glib-unix.h>
#include "localed-gen.h"
+#include "localed.h"
GPtrArray *localed_freeable;
Locale1 *localed_interf;
GPtrArray *localed_freeable;
Locale1 *localed_interf;
+GMainLoop *localed_loop;
+
+guint bus_descriptor;
+gboolean dbus_interface_exported; /* reliable because of gdbus operational guarantees */
+
/* --- begin method/property/dbus signal code --- */
/*static gboolean
/* --- begin method/property/dbus signal code --- */
/*static gboolean
@@
-91,15
+98,6
@@
static void localed_on_name_acquired(GDBusConnection *conn,
}
}
-/* --- 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) {
static void localed_on_name_lost(GDBusConnection *conn,
const gchar *name,
gpointer user_data) {
@@
-111,10
+109,16
@@
static void localed_on_name_lost(GDBusConnection *conn,
}
}
-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();
localed_loop = g_main_loop_new(NULL, TRUE);
localed_freeable = g_ptr_array_new();