2 * Copyright 2016 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.
20 #include "afb-req-itf.h"
21 #include "afb-pollmgr-itf.h"
22 #include "afb-evmgr-itf.h"
27 AFB_PLUGIN_JSON = 123456789,
28 /* AFB_PLUGIN_JSCRIPT = 987654321, */
29 AFB_PLUGIN_RAW = 987123546
32 /* Enum for Session/Token/Authentication middleware */
46 enum AFB_sessionE session;
47 void (*callback)(struct afb_req req);
51 /* Plugin definition */
54 enum AFB_pluginE type;
57 const struct AFB_restapi *apis;
67 struct afb_daemon_itf {
68 struct afb_evmgr (*get_evmgr)(void *closure);
69 struct afb_pollmgr (*get_pollmgr)(void *closure);
73 const struct afb_daemon_itf *itf;
81 struct afb_daemon daemon;
84 extern const struct AFB_plugin *pluginRegister (const struct AFB_interface *interface);
86 static inline struct afb_evmgr afb_daemon_get_evmgr(struct afb_daemon daemon)
88 return daemon.itf->get_evmgr(daemon.closure);
91 static inline struct afb_pollmgr afb_daemon_get_pollmgr(struct afb_daemon daemon)
93 return daemon.itf->get_pollmgr(daemon.closure);