4 author: José Bollo <jose.bollo@iot.bzh>
6 Licensed under the Apache License, Version 2.0 (the "License");
7 you may not use this file except in compliance with the License.
8 You may obtain a copy of the License at
10 http://www.apache.org/licenses/LICENSE-2.0
12 Unless required by applicable law or agreed to in writing, software
13 distributed under the License is distributed on an "AS IS" BASIS,
14 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 See the License for the specific language governing permissions and
16 limitations under the License.
23 extern struct jbus *create_jbus(const char *path, int session);
24 extern struct jbus *create_jbus_session(const char *path);
25 extern struct jbus *create_jbus_system(const char *path);
27 extern void jbus_addref(struct jbus *jbus);
28 extern void jbus_unref(struct jbus *jbus);
30 extern int jbus_fill_pollfds(
35 extern int jbus_dispatch_pollfds(
41 extern int jbus_read_write_dispatch_multiple(
47 extern int jbus_dispatch_multiple(
52 extern int jbus_read_write_dispatch(
57 /* verbs for the clients */
58 extern int jbus_call_ss(
62 void (*onresp) (int, const char *, void *),
65 extern int jbus_call_js(
68 struct json_object *query,
69 void (*onresp) (int, const char *, void *),
72 extern int jbus_call_sj(
76 void (*onresp) (int, struct json_object *, void *),
79 extern int jbus_call_jj(
82 struct json_object *query,
83 void (*onresp) (int, struct json_object *, void *),
86 extern char *jbus_call_ss_sync(
91 extern char *jbus_call_js_sync(
94 struct json_object *query);
96 extern struct json_object *jbus_call_sj_sync(
101 extern struct json_object *jbus_call_jj_sync(
104 struct json_object *query);
106 extern int jbus_on_signal_s(
109 void (*onsignal) (const char *, void *),
112 extern int jbus_on_signal_j(
115 void (*onsignal) (struct json_object *, void *),
118 /* verbs for servers */
119 extern int jbus_reply_s(
123 extern int jbus_reply_j(
125 struct json_object *reply);
127 extern int jbus_reply_error_s(
131 extern int jbus_reply_error_j(
133 struct json_object *reply);
135 extern int jbus_add_service_s(
138 void (*oncall) (struct jreq *, const char *, void *),
141 extern int jbus_add_service_j(
144 void (*oncall) (struct jreq *, struct json_object *, void *),
147 extern int jbus_start_serving(
150 extern int jbus_send_signal_s(
153 const char *content);
155 extern int jbus_send_signal_j(
158 struct json_object *content);