2 * Copyright (C) 2016, 2017 "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 * Definition of the facilities provided by the daemon.
34 int (*event_broadcast)(void *closure, const char *name, struct json_object *object); /* broadcasts evant 'name' with 'object' */
35 struct sd_event *(*get_event_loop)(void *closure); /* gets the common systemd's event loop */
36 struct sd_bus *(*get_user_bus)(void *closure); /* gets the common systemd's user d-bus */
37 struct sd_bus *(*get_system_bus)(void *closure); /* gets the common systemd's system d-bus */
38 void (*vverbose_v1)(void*closure, int level, const char *file, int line, const char *fmt, va_list args);
39 struct afb_event (*event_make)(void *closure, const char *name); /* creates an event of 'name' */
40 int (*rootdir_get_fd)(void *closure);
41 int (*rootdir_open_locale)(void *closure, const char *filename, int flags, const char *locale);
42 int (*queue_job)(void *closure, void (*callback)(int signum, void *arg), void *argument, void *group, int timeout);
43 void (*vverbose_v2)(void*closure, int level, const char *file, int line, const char * func, const char *fmt, va_list args);
44 struct afb_req (*unstore_req)(void*closure, struct afb_stored_req *sreq);
45 int (*require_api)(void*closure, const char *name, int initialized);
46 int (*rename_api)(void*closure, const char *name);
47 int (*new_api)(void *closure, const char *api, const char *info, int noconcurrency, int (*preinit)(void*, struct afb_dynapi *), void *preinit_closure);
51 * Structure for accessing daemon.
52 * See also: afb_daemon_get_event_sender, afb_daemon_get_event_loop, afb_daemon_get_user_bus, afb_daemon_get_system_bus
56 const struct afb_daemon_itf *itf; /* the interfacing functions */
57 void *closure; /* the closure when calling these functions */