/*
* config mode
*/
-enum afb_mode_v1 {
+enum afb_mode_v1
+{
AFB_MODE_LOCAL = 0, /* run locally */
AFB_MODE_REMOTE, /* run remotely */
AFB_MODE_GLOBAL /* run either remotely or locally (DONT USE! reserved for future) */
/*
* Definition of the facilities provided by the daemon.
*/
-struct afb_daemon_itf {
+struct afb_daemon_itf
+{
int (*event_broadcast)(void *closure, const char *name, struct json_object *object); /* broadcasts evant 'name' with 'object' */
struct sd_event *(*get_event_loop)(void *closure); /* gets the common systemd's event loop */
struct sd_bus *(*get_user_bus)(void *closure); /* gets the common systemd's user d-bus */
* Structure for accessing daemon.
* See also: afb_daemon_get_event_sender, afb_daemon_get_event_loop, afb_daemon_get_user_bus, afb_daemon_get_system_bus
*/
-struct afb_daemon {
+struct afb_daemon
+{
const struct afb_daemon_itf *itf; /* the interfacing functions */
void *closure; /* the closure when calling these functions */
};
#pragma once
-#include <stdarg.h>
-
/*
* Retrieves the common systemd's event loop of AFB
* 'daemon' MUST be the daemon given in interface when activating the binding.
#pragma once
-#include <stdarg.h>
-
/*
* Retrieves the common systemd's event loop of AFB
*/
* Don't use this structure directly.
* Use the helper functions documented below.
*/
-struct afb_event_itf {
+struct afb_event_itf
+{
/* CAUTION: respect the order, add at the end */
int (*broadcast)(void *closure, struct json_object *obj);
/*
* Describes the request of afb-daemon for bindings
*/
-struct afb_event {
+struct afb_event
+{
const struct afb_event_itf *itf; /* the interface to use */
void *closure; /* the closure argument for functions of 'itf' */
};
/*
* Describes an argument (or parameter) of a request
*/
-struct afb_arg {
+struct afb_arg
+{
const char *name; /* name of the argument or NULL if invalid */
const char *value; /* string representation of the value of the argument */
/* original filename of the argument if path != NULL */
* Don't use this structure directly.
* Use the helper functions documented below.
*/
-struct afb_req_itf {
+struct afb_req_itf
+{
/* CAUTION: respect the order, add at the end */
struct json_object *(*json)(void *closure);
/*
* Describes the request by bindings from afb-daemon
*/
-struct afb_req {
+struct afb_req
+{
const struct afb_req_itf *itf; /* the interface to use */
void *closure; /* the closure argument for functions of 'itf' */
};