Add default api to apiset
[src/app-framework-binder.git] / src / afb-apiset.h
1 /*
2  * Copyright (C) 2016, 2017 "IoT.bzh"
3  * Author: José Bollo <jose.bollo@iot.bzh>
4  *
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
8  *
9  *   http://www.apache.org/licenses/LICENSE-2.0
10  *
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.
16  */
17
18 #pragma once
19
20 struct afb_api;
21 struct afb_apiset;
22
23 extern struct afb_apiset *afb_apiset_addref(struct afb_apiset *set);
24 extern void afb_apiset_unref(struct afb_apiset *set);
25 extern struct afb_apiset *afb_apiset_create(const char *name, int timeout);
26 extern int afb_apiset_timeout_get(struct afb_apiset *set);
27 extern void afb_apiset_timeout_set(struct afb_apiset *set, int to);
28 extern void afb_apiset_subset_set(struct afb_apiset *set, struct afb_apiset *subset);
29 extern struct afb_apiset *afb_apiset_subset_get(struct afb_apiset *set);
30 extern int afb_apiset_default_api_exist(struct afb_apiset *set);
31 extern int afb_apiset_default_api_get(struct afb_apiset *set, struct afb_api *api);
32 extern void afb_apiset_default_api_set(struct afb_apiset *set, struct afb_api api);
33 extern void afb_apiset_default_api_drop(struct afb_apiset *set);
34 extern int afb_apiset_add(struct afb_apiset *set, const char *name, struct afb_api api);
35 extern int afb_apiset_del(struct afb_apiset *set, const char *name);
36 extern int afb_apiset_get(struct afb_apiset *set, const char *name, struct afb_api *api);
37 extern int afb_apiset_start_service(struct afb_apiset *set, const char *name, int share_session, int onneed);
38 extern int afb_apiset_start_all_services(struct afb_apiset *set, int share_session);
39 extern void afb_apiset_update_hooks(struct afb_apiset *set, const char *name);
40 extern void afb_apiset_set_verbosity(struct afb_apiset *set, const char *name, int level);
41 extern int afb_apiset_get_verbosity(struct afb_apiset *set, const char *name);
42 extern const char **afb_apiset_get_names(struct afb_apiset *set);
43