aboutsummaryrefslogtreecommitdiffstats
path: root/include/afb
diff options
context:
space:
mode:
Diffstat (limited to 'include/afb')
-rw-r--r--include/afb/afb-binding-v1.h3
-rw-r--r--include/afb/afb-daemon-common.h6
-rw-r--r--include/afb/afb-daemon-v1.h2
-rw-r--r--include/afb/afb-daemon-v2.h2
-rw-r--r--include/afb/afb-event-itf.h6
-rw-r--r--include/afb/afb-req-itf.h9
6 files changed, 16 insertions, 12 deletions
diff --git a/include/afb/afb-binding-v1.h b/include/afb/afb-binding-v1.h
index ef03a6b0..1abd7bff 100644
--- a/include/afb/afb-binding-v1.h
+++ b/include/afb/afb-binding-v1.h
@@ -126,7 +126,8 @@ struct afb_binding_v1
/*
* 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) */
diff --git a/include/afb/afb-daemon-common.h b/include/afb/afb-daemon-common.h
index e8e1817e..e1308d6d 100644
--- a/include/afb/afb-daemon-common.h
+++ b/include/afb/afb-daemon-common.h
@@ -26,7 +26,8 @@ struct sd_bus;
/*
* 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 */
@@ -43,7 +44,8 @@ struct afb_daemon_itf {
* 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 */
};
diff --git a/include/afb/afb-daemon-v1.h b/include/afb/afb-daemon-v1.h
index 6390dd16..65b689e7 100644
--- a/include/afb/afb-daemon-v1.h
+++ b/include/afb/afb-daemon-v1.h
@@ -17,8 +17,6 @@
#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.
diff --git a/include/afb/afb-daemon-v2.h b/include/afb/afb-daemon-v2.h
index 6cfc60ba..01a620a8 100644
--- a/include/afb/afb-daemon-v2.h
+++ b/include/afb/afb-daemon-v2.h
@@ -17,8 +17,6 @@
#pragma once
-#include <stdarg.h>
-
/*
* Retrieves the common systemd's event loop of AFB
*/
diff --git a/include/afb/afb-event-itf.h b/include/afb/afb-event-itf.h
index 7b14de97..3d66a893 100644
--- a/include/afb/afb-event-itf.h
+++ b/include/afb/afb-event-itf.h
@@ -26,7 +26,8 @@ struct json_object;
* 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);
@@ -38,7 +39,8 @@ struct afb_event_itf {
/*
* 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' */
};
diff --git a/include/afb/afb-req-itf.h b/include/afb/afb-req-itf.h
index 8c18a831..dcbbb8a7 100644
--- a/include/afb/afb-req-itf.h
+++ b/include/afb/afb-req-itf.h
@@ -27,7 +27,8 @@ struct json_object;
/*
* 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 */
@@ -41,7 +42,8 @@ struct afb_arg {
* 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);
@@ -74,7 +76,8 @@ struct afb_req_itf {
/*
* 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' */
};