#include "afb-apiset.h"
#include "afb-api-dyn.h"
#include "afb-common.h"
+#include "afb-systemd.h"
#include "afb-cred.h"
#include "afb-evt.h"
#include "afb-export.h"
static struct afb_eventid *eventid_make_cb(void *closure, const char *name)
{
- size_t plen, nlen;
- char *event;
struct afb_export *export = closure;
/* check daemon state */
return NULL;
}
- /* makes the event name */
- plen = strlen(export->apiname);
- nlen = strlen(name);
- event = alloca(nlen + plen + 2);
- memcpy(event, export->apiname, plen);
- event[plen] = '/';
- memcpy(event + plen + 1, name, nlen + 1);
-
/* create the event */
- return afb_evt_eventid_create(event);
+ return afb_evt_eventid_create2(export->apiname, name);
}
static struct afb_event event_make_cb(void *closure, const char *name)
static struct sd_event *hooked_get_event_loop(void *closure)
{
struct afb_export *export = closure;
- struct sd_event *r = afb_common_get_event_loop();
+ struct sd_event *r = afb_systemd_get_event_loop();
return afb_hook_ditf_get_event_loop(export, r);
}
static struct sd_bus *hooked_get_user_bus(void *closure)
{
struct afb_export *export = closure;
- struct sd_bus *r = afb_common_get_user_bus();
+ struct sd_bus *r = afb_systemd_get_user_bus();
return afb_hook_ditf_get_user_bus(export, r);
}
static struct sd_bus *hooked_get_system_bus(void *closure)
{
struct afb_export *export = closure;
- struct sd_bus *r = afb_common_get_system_bus();
+ struct sd_bus *r = afb_systemd_get_system_bus();
return afb_hook_ditf_get_system_bus(export, r);
}
.vverbose_v2 = vverbose_cb,
.event_make = event_make_cb,
.event_broadcast = event_broadcast_cb,
- .get_event_loop = afb_common_get_event_loop,
- .get_user_bus = afb_common_get_user_bus,
- .get_system_bus = afb_common_get_system_bus,
+ .get_event_loop = afb_systemd_get_event_loop,
+ .get_user_bus = afb_systemd_get_user_bus,
+ .get_system_bus = afb_systemd_get_system_bus,
.rootdir_get_fd = afb_common_rootdir_get_fd,
.rootdir_open_locale = rootdir_open_locale_cb,
.queue_job = queue_job_cb,
.vverbose = (void*)vverbose_cb,
- .get_event_loop = afb_common_get_event_loop,
- .get_user_bus = afb_common_get_user_bus,
- .get_system_bus = afb_common_get_system_bus,
+ .get_event_loop = afb_systemd_get_event_loop,
+ .get_user_bus = afb_systemd_get_user_bus,
+ .get_system_bus = afb_systemd_get_system_bus,
.rootdir_get_fd = afb_common_rootdir_get_fd,
.rootdir_open_locale = rootdir_open_locale_cb,
.queue_job = queue_job_cb,