X-Git-Url: https://uglyman.kremlin.cc/gitweb/gitweb.cgi?p=systembsd.git;a=blobdiff_plain;f=src%2Finterfaces%2Fhostnamed%2Fhostnamed.c;h=3d1b3d2305d98d553ca9bae1811b5b136fcbb24f;hp=e1614978c1cb03309ac61ed3ffb49f1576282b3d;hb=4c04b514283b9d35d0e7693bd4e2a40545ec89ab;hpb=d15318db3e7290d10cca372000cbdd0bdbc9fc6a diff --git a/src/interfaces/hostnamed/hostnamed.c b/src/interfaces/hostnamed/hostnamed.c index e161497..3d1b3d2 100644 --- a/src/interfaces/hostnamed/hostnamed.c +++ b/src/interfaces/hostnamed/hostnamed.c @@ -19,11 +19,9 @@ #include -#include -#include +#include -#include "hostnamed.h" -#include "hostnamed-gen.c" +#include "hostnamed-gen.h" GPtrArray *hostnamed_freeable; GDBusNodeInfo *spect_data; @@ -191,6 +189,12 @@ static void hostnamed_on_name_acquired(GDBusConnection *conn, } +/* free()'s */ +void hostnamed_mem_clean() { + + g_ptr_array_foreach(hostnamed_freeable, (GFunc) g_free, NULL); +} + static void hostnamed_on_name_lost(GDBusConnection *conn, const gchar *name, gpointer user_data) { @@ -220,10 +224,19 @@ void hostnamed_init() { /* TODO: malloc and return reference as if a main() closed */ } -/* free()'s */ -void hostnamed_mem_clean() { +int main() { - g_ptr_array_foreach(hostnamed_freeable, (GFunc) g_free, NULL); + GMainLoop *hostnamed_loop; + hostnamed_loop = g_main_loop_new(NULL, TRUE); + + /* config stuff here */ + + + hostnamed_init(); + g_main_loop_run(hostnamed_loop); + g_main_loop_unref(hostnamed_loop); + + return 0; } /* TODO figure out DMI variables on obsd */ @@ -271,3 +284,4 @@ void hostnamed_mem_clean() { g_free (filebuf); return ret; }*/ +