diff options
author | Manuel Bachmann <manuel.bachmann@iot.bzh> | 2016-06-13 13:15:17 +0200 |
---|---|---|
committer | Yannick Gicquel <yannick.gicquel@iot.bzh> | 2016-10-11 17:09:07 +0200 |
commit | 9dc64e1e291d6518da0a918105c5bf7b1c603dd5 (patch) | |
tree | ffc30b09fc92696376ce4a6dec1367201ab3c7d4 /module.c | |
parent | 6fc3e02df9de8347eb76fdfd26ed781686d37b6c (diff) |
Add basic configuration logic, builtin configuration
There is now a default routing configuration provided at
startup (config file parsing is stubbed, decide if we need
it for routing purposes, or just for very basic things).
Change-Id: Ib824b63c663355ed80d0e6823d5f9aec8cb093d5
Signed-off-by: Manuel Bachmann <manuel.bachmann@iot.bzh>
Diffstat (limited to 'module.c')
-rw-r--r-- | module.c | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -34,6 +34,7 @@ $ pactl load-module mypamodule #include <pulsecore/modargs.h> /* for "pa_modargs" */ #include "userdata.h" /* for "struct userdata" */ +#include "config.h" /* for "pa_config_...()" */ #include "utils.h" /* for "struct pa_null_sink", "pa_utils_create_null_sink()"... */ #include "loopback.h" /* for "struct pa_loopback/loopnode" */ #include "zone.h" /* for "struct pa_zoneset" */ @@ -80,6 +81,8 @@ int pa__init (pa_module *m) const char *amsocktype; /* Optional external routing daemon: socket type ("unix"/"tcp") */ const char *amaddr; /* Optional external routing daemon: socket address (path/ip address) */ const char *amport; /* Optional external routing daemon: socket port ("tcp" type only) */ + const char *cfgpath; + char buf[4096]; pa_assert (m); @@ -115,6 +118,11 @@ int pa__init (pa_module *m) m->userdata = u; + /* apply the config file */ + + cfgpath = pa_config_file_get_path (cfgdir, cfgfile, buf, sizeof(buf)); + pa_config_parse_file (u, cfgpath); + /* really initialize the module's core logic */ pa_tracker_synchronize (u); |