Rework dbus handling

Remove the Daemon object and remove all dbus code from the main
objects. We can use the signals in a separate module to create and
destroy the DBus interfaces.
Move the dbus protocol in a module
Move the autolink policy to a module
This commit is contained in:
Wim Taymans 2016-11-16 16:57:47 +01:00
parent b9e2b1c0e3
commit dfbfb4c9ee
28 changed files with 1122 additions and 1007 deletions

View file

@ -18,7 +18,7 @@
*/
#include <pinos/client/pinos.h>
#include <pinos/server/daemon.h>
#include <pinos/server/core.h>
#include <pinos/server/module.h>
#include "daemon-config.h"
@ -27,37 +27,30 @@ int
main (int argc, char *argv[])
{
PinosCore *core;
PinosDaemon *daemon;
PinosMainLoop *loop;
PinosDaemonConfig *config;
PinosProperties *props;
char *err = NULL;
pinos_init (&argc, &argv);
loop = pinos_main_loop_new (NULL);
core = pinos_core_new (loop);
/* parse configuration */
config = pinos_daemon_config_new ();
if (!pinos_daemon_config_load (config, &err)) {
g_error ("failed to parse config: %s", err);
free (err);
return -1;
}
props = pinos_properties_new ("test", "test", NULL);
daemon = pinos_daemon_new (core,
props);
loop = pinos_main_loop_new ();
core = pinos_core_new (loop);
pinos_daemon_config_run_commands (config, daemon);
pinos_daemon_start (daemon);
pinos_daemon_config_run_commands (config, core);
pinos_main_loop_run (loop);
pinos_properties_free (props);
pinos_main_loop_destroy (loop);
pinos_daemon_destroy (daemon);
pinos_core_destroy (core);
return 0;
}