2 * Copyright (C) 2016, 2017, 2018 "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.
24 extern struct afb_apiset *afb_apiset_create(const char *name, int timeout);
25 extern struct afb_apiset *afb_apiset_create_subset_last(struct afb_apiset *set, const char *name, int timeout);
26 extern struct afb_apiset *afb_apiset_create_subset_first(struct afb_apiset *set, const char *name, int timeout);
27 extern struct afb_apiset *afb_apiset_addref(struct afb_apiset *set);
28 extern void afb_apiset_unref(struct afb_apiset *set);
30 extern const char *afb_apiset_name(struct afb_apiset *set);
32 extern int afb_apiset_timeout_get(struct afb_apiset *set);
33 extern void afb_apiset_timeout_set(struct afb_apiset *set, int to);
35 extern void afb_apiset_onlack_set(
36 struct afb_apiset *set,
37 int (*callback)(void *closure, struct afb_apiset *set, const char *name),
39 void (*cleanup)(void*closure));
41 extern void afb_apiset_subset_set(struct afb_apiset *set, struct afb_apiset *subset);
42 extern struct afb_apiset *afb_apiset_subset_get(struct afb_apiset *set);
44 extern int afb_apiset_add(struct afb_apiset *set, const char *name, struct afb_api_item api);
45 extern int afb_apiset_del(struct afb_apiset *set, const char *name);
47 extern int afb_apiset_add_alias(struct afb_apiset *set, const char *name, const char *alias);
48 extern int afb_apiset_is_alias(struct afb_apiset *set, const char *name);
49 extern const char *afb_apiset_unalias(struct afb_apiset *set, const char *name);
51 extern const struct afb_api_item *afb_apiset_lookup(struct afb_apiset *set, const char *name, int rec);
52 extern const struct afb_api_item *afb_apiset_lookup_started(struct afb_apiset *set, const char *name, int rec);
54 extern int afb_apiset_start_service(struct afb_apiset *set, const char *name);
55 extern int afb_apiset_start_all_services(struct afb_apiset *set);
57 extern void afb_apiset_update_hooks(struct afb_apiset *set, const char *name);
58 extern void afb_apiset_set_logmask(struct afb_apiset *set, const char *name, int mask);
59 extern int afb_apiset_get_logmask(struct afb_apiset *set, const char *name);
61 extern struct json_object *afb_apiset_describe(struct afb_apiset *set, const char *name);
63 extern const char **afb_apiset_get_names(struct afb_apiset *set, int rec, int type);
64 extern void afb_apiset_enum(
65 struct afb_apiset *set,
67 void (*callback)(void *closure, struct afb_apiset *set, const char *name, int isalias),
70 extern int afb_apiset_require(struct afb_apiset *set, const char *name, const char *required);
71 extern int afb_apiset_require_class(struct afb_apiset *set, const char *apiname, const char *classname);
72 extern int afb_apiset_provide_class(struct afb_apiset *set, const char *apiname, const char *classname);
73 extern int afb_apiset_class_start(const char *classname);