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.
23 * @section brief Brief introduction
25 * This is part of the AGL framework micro-service binder and is provided as the
26 * API for writing bindings.
28 * The normal usage is to include only one file as below:
31 * #define AFB_BINDING_VERSION 3
32 * #include <afb/afb-binding.h>
39 * @file afb/afb-binding.h
47 * @def AFB_BINDING_INTERFACE_VERSION
49 * * Version of the binding interface.
51 * This is intended to be test for tuning condition code.
52 * It is of the form MAJOR * 1000 + REVISION.
54 * @see AFB_BINDING_UPPER_VERSION that should match MAJOR
56 #define AFB_BINDING_INTERFACE_VERSION 3000
59 * @def AFB_BINDING_LOWER_VERSION
61 * Lowest binding API version supported.
63 * @see AFB_BINDING_VERSION
64 * @see AFB_BINDING_UPPER_VERSION
66 #define AFB_BINDING_LOWER_VERSION 1
69 * @def AFB_BINDING_UPPER_VERSION
71 * Upper binding API version supported.
73 * @see AFB_BINDING_VERSION
74 * @see AFB_BINDING_LOWER_VERSION
76 #define AFB_BINDING_UPPER_VERSION 3
79 * @def AFB_BINDING_VERSION
81 * This macro must be defined before including <afb/afb-binding.h> to set
82 * the required binding API.
85 #ifndef AFB_BINDING_VERSION
89 AFB_BINDING_VERSION should be defined before including <afb/afb-binding.h>\n\
90 AFB_BINDING_VERSION defines the version of binding that you use.\n\
91 Currently the version to use is 3 (older versions: 1 is obsolete, 2 is legacy).\n\
92 Consider to add one of the following define before including <afb/afb-binding.h>:\n\
94 #define AFB_BINDING_VERSION 3\n\
98 # if AFB_BINDING_VERSION == 1
99 # warning "Using binding version 1, consider to switch to version 3"
101 # if AFB_BINDING_VERSION == 2
102 # warning "Using binding version 2, consider to switch to version 3"
106 #if AFB_BINDING_VERSION != 0
107 # if AFB_BINDING_VERSION < AFB_BINDING_LOWER_VERSION || AFB_BINDING_VERSION > AFB_BINDING_UPPER_VERSION
108 # error "Unsupported binding version AFB_BINDING_VERSION"
112 /***************************************************************************************************/
113 #include "afb-binding-predefs.h"
114 #include "afb-binding-v1.h"
115 #include "afb-binding-v2.h"
116 #include "afb-binding-v3.h"
117 #if defined(AFB_BINDING_WANT_DYNAPI)
118 # include "afb-dynapi-legacy.h"
120 #include "afb-binding-postdefs.h"