2 * Copyright (C) 2015-2020 "IoT.bzh"
3 * Author: José Bollo <jose.bollo@iot.bzh>
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
9 * http://www.apache.org/licenses/LICENSE-2.0
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
22 /* declaration of features of libsystemd */
25 struct afb_stored_req;
30 /** @defgroup AFB_DAEMON
34 * @deprecated use bindings version 3
36 * Definition of the facilities provided by the daemon.
38 struct afb_daemon_itf_x1
40 /** broadcasts evant 'name' with 'object' */
41 int (*event_broadcast)(struct afb_api_x3 *closure, const char *name, struct json_object *object);
43 /** gets the common systemd's event loop */
44 struct sd_event *(*get_event_loop)(struct afb_api_x3 *closure);
46 /** gets the common systemd's user d-bus */
47 struct sd_bus *(*get_user_bus)(struct afb_api_x3 *closure);
49 /** gets the common systemd's system d-bus */
50 struct sd_bus *(*get_system_bus)(struct afb_api_x3 *closure);
52 /** logging messages */
53 void (*vverbose_v1)(struct afb_api_x3*closure, int level, const char *file, int line, const char *fmt, va_list args);
55 /** creates an event of 'name' */
56 struct afb_event_x1 (*event_make)(struct afb_api_x3 *closure, const char *name);
58 /** get the file descriptor of the install directory */
59 int (*rootdir_get_fd)(struct afb_api_x3 *closure);
61 /** opens a file of the install directory */
62 int (*rootdir_open_locale)(struct afb_api_x3 *closure, const char *filename, int flags, const char *locale);
65 int (*queue_job)(struct afb_api_x3 *closure, void (*callback)(int signum, void *arg), void *argument, void *group, int timeout);
67 /** logging messages */
68 void (*vverbose_v2)(struct afb_api_x3*closure, int level, const char *file, int line, const char * func, const char *fmt, va_list args);
70 /** retrieve a stored request */
71 struct afb_req_x1 (*unstore_req)(struct afb_api_x3*closure, struct afb_stored_req *sreq);
74 int (*require_api)(struct afb_api_x3*closure, const char *name, int initialized);
77 int (*add_alias)(struct afb_api_x3*closure, const char *name, const char *as_name);
79 /** creates a new api */
80 struct afb_api_x3 *(*new_api)(struct afb_api_x3 *closure, const char *api, const char *info, int noconcurrency, int (*preinit)(void*, struct afb_api_x3 *), void *preinit_closure);
84 * @deprecated use bindings version 3
86 * Structure for accessing daemon.
87 * See also: afb_daemon_get_event_sender, afb_daemon_get_event_loop, afb_daemon_get_user_bus, afb_daemon_get_system_bus
91 const struct afb_daemon_itf_x1 *itf; /**< the interfacing functions */
92 struct afb_api_x3 *closure; /**< the closure when calling these functions */