dea1eb21249597b2be5c76b6b1dd45b9f4f828ec
[src/app-framework-binder.git] / include / afb / afb-binding-postdefs.h
1 /*
2  * Copyright (C) 2018, 2019 "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 typedef enum   afb_auth_type            afb_auth_type_t;
21 typedef struct afb_auth                 afb_auth_t;
22 typedef struct afb_arg                  afb_arg_t;
23
24 #if AFB_BINDING_VERSION == 1
25
26 typedef struct afb_verb_desc_v1         afb_verb_t;
27 typedef struct afb_binding_v1           afb_binding_t;
28 typedef struct afb_binding_interface_v1 afb_binding_interface_v1;
29
30 typedef struct afb_daemon_x1            afb_daemon_t;
31 typedef struct afb_service_x1           afb_service_t;
32
33 typedef struct afb_event_x1             afb_event_t;
34 typedef struct afb_req_x1               afb_req_t;
35
36 typedef struct afb_stored_req           afb_stored_req_t;
37
38 #ifndef __cplusplus
39 typedef struct afb_event_x1             afb_event;
40 typedef struct afb_req_x1               afb_req;
41 typedef struct afb_stored_req           afb_stored_req;
42 #endif
43
44 #endif
45
46 #if AFB_BINDING_VERSION == 2
47
48 typedef struct afb_verb_v2              afb_verb_t;
49 typedef struct afb_binding_v2           afb_binding_t;
50
51 typedef struct afb_daemon               afb_daemon_t;
52 typedef struct afb_event                afb_event_t;
53 typedef struct afb_req                  afb_req_t;
54 typedef struct afb_stored_req           afb_stored_req_t;
55 typedef struct afb_service              afb_service_t;
56
57 #define afbBindingExport                afbBindingV2
58
59 #ifndef __cplusplus
60 typedef struct afb_verb_v2              afb_verb_v2;
61 typedef struct afb_binding_v2           afb_binding_v2;
62 typedef struct afb_event_x1             afb_event;
63 typedef struct afb_req_x1               afb_req;
64 typedef struct afb_stored_req           afb_stored_req;
65 #endif
66
67 #endif
68
69 #if AFB_BINDING_VERSION == 3
70
71 typedef struct afb_verb_v3              afb_verb_t;
72 typedef struct afb_binding_v3           afb_binding_t;
73
74 typedef struct afb_event_x2            *afb_event_t;
75 typedef struct afb_req_x2              *afb_req_t;
76 typedef struct afb_api_x3              *afb_api_t;
77 typedef enum afb_req_subcall_flags      afb_req_subcall_flags_t;
78
79 #define afbBindingExport                afbBindingV3
80 #define afbBindingRoot                  afbBindingV3root
81 #define afbBindingEntry                 afbBindingV3entry
82
83 /* compatibility with previous versions */
84
85 typedef struct afb_api_x3              *afb_daemon_t;
86 typedef struct afb_api_x3              *afb_service_t;
87
88 #endif
89
90
91 #if defined(AFB_BINDING_WANT_DYNAPI)
92 typedef struct afb_dynapi              *afb_dynapi_t;
93 typedef struct afb_request             *afb_request_t;
94 typedef struct afb_eventid             *afb_eventid_t;
95 #endif