From 06382af9092babedbf56aa1c00b3bd7cb0b86cda Mon Sep 17 00:00:00 2001 From: José Bollo Date: Tue, 17 May 2016 15:12:11 +0200 Subject: provides developper files MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I0e41a0db778c69b5f5ce71115d495b2bb8b4cffe Signed-off-by: José Bollo --- CMakeLists.txt | 1 + include/CMakeLists.txt | 1 + include/afb-evmgr-itf.h | 35 ------ include/afb-plugin.h | 111 ------------------- include/afb-req-itf.h | 175 ------------------------------ include/afb/afb-evmgr-itf.h | 35 ++++++ include/afb/afb-plugin.h | 111 +++++++++++++++++++ include/afb/afb-req-itf.h | 175 ++++++++++++++++++++++++++++++ plugins/afm-main-plugin/afm-main-plugin.c | 2 +- plugins/audio/audio-api.c | 4 +- plugins/media/media-api.c | 4 +- plugins/radio/radio-api.c | 4 +- plugins/samples/ClientCtx.c | 2 +- plugins/samples/HelloWorld.c | 2 +- plugins/samples/SamplePost.c | 2 +- plugins/session/token-api.c | 2 +- src/afb-api-dbus.c | 4 +- src/afb-api-so.c | 6 +- src/afb-apis.c | 2 +- src/afb-hreq.c | 3 +- src/afb-hsrv.c | 2 +- src/afb-hswitch.c | 2 +- src/afb-ws-json1.c | 2 +- src/main.c | 2 +- 24 files changed, 346 insertions(+), 343 deletions(-) create mode 100644 include/CMakeLists.txt delete mode 100644 include/afb-evmgr-itf.h delete mode 100644 include/afb-plugin.h delete mode 100644 include/afb-req-itf.h create mode 100644 include/afb/afb-evmgr-itf.h create mode 100644 include/afb/afb-plugin.h create mode 100644 include/afb/afb-req-itf.h diff --git a/CMakeLists.txt b/CMakeLists.txt index 12e4be95..76000105 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -121,5 +121,6 @@ SET(plugin_install_dir ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}/afb) ADD_DEFINITIONS(-DPLUGIN_INSTALL_DIR="${plugin_install_dir}") ADD_SUBDIRECTORY(src) +ADD_SUBDIRECTORY(include) ADD_SUBDIRECTORY(plugins) diff --git a/include/CMakeLists.txt b/include/CMakeLists.txt new file mode 100644 index 00000000..07cbb04b --- /dev/null +++ b/include/CMakeLists.txt @@ -0,0 +1 @@ +INSTALL(DIRECTORY afb DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) diff --git a/include/afb-evmgr-itf.h b/include/afb-evmgr-itf.h deleted file mode 100644 index 90b1e0a9..00000000 --- a/include/afb-evmgr-itf.h +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (C) 2016 "IoT.bzh" - * Author: José Bollo - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#pragma once - -struct json_object; - -struct afb_evmgr_itf { - void (*push)(void *evmgr, const char *name, struct json_object *object); -}; - -struct afb_evmgr { - const struct afb_evmgr_itf *itf; - void *closure; -}; - -static inline void afb_evmgr_push(struct afb_evmgr mgr, const char *name, struct json_object *object) -{ - return mgr.itf->push(mgr.closure, name, object); -} - diff --git a/include/afb-plugin.h b/include/afb-plugin.h deleted file mode 100644 index 40b26cfa..00000000 --- a/include/afb-plugin.h +++ /dev/null @@ -1,111 +0,0 @@ -/* - * Copyright (C) 2016 "IoT.bzh" - * Author: José Bollo - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#pragma once - -#include "afb-req-itf.h" -#include "afb-evmgr-itf.h" - -/* Plugin Type */ -enum AFB_pluginE -{ - AFB_PLUGIN_JSON = 123456789, -/* AFB_PLUGIN_JSCRIPT = 987654321, */ - AFB_PLUGIN_RAW = 987123546 -}; - -/* Enum for Session/Token/Authentication middleware */ -enum AFB_sessionE -{ - AFB_SESSION_NONE = 0, - AFB_SESSION_CREATE = 1, - AFB_SESSION_CLOSE = 2, - AFB_SESSION_RENEW = 4, - AFB_SESSION_CHECK = 8, - AFB_SESSION_MASK = 15 -}; - -/* API definition */ -struct AFB_restapi -{ - const char *name; - enum AFB_sessionE session; - void (*callback)(struct afb_req req); - const char *info; -}; - -/* Plugin definition */ -struct AFB_plugin -{ - enum AFB_pluginE type; - const char *info; - const char *prefix; - const struct AFB_restapi *apis; -}; - -/* config mode */ -enum AFB_Mode { - AFB_MODE_LOCAL = 0, - AFB_MODE_REMOTE, - AFB_MODE_GLOBAL -}; - -struct sd_event; -struct sd_bus; - -struct afb_daemon_itf { - struct afb_evmgr (*get_evmgr)(void *closure); - struct sd_event *(*get_event_loop)(void *closure); - struct sd_bus *(*get_user_bus)(void *closure); - struct sd_bus *(*get_system_bus)(void *closure); -}; - -struct afb_daemon { - const struct afb_daemon_itf *itf; - void *closure; -}; - -struct AFB_interface -{ - int verbosity; - enum AFB_Mode mode; - struct afb_daemon daemon; -}; - -extern const struct AFB_plugin *pluginRegister (const struct AFB_interface *interface); - -static inline struct afb_evmgr afb_daemon_get_evmgr(struct afb_daemon daemon) -{ - return daemon.itf->get_evmgr(daemon.closure); -} - -static inline struct sd_event *afb_daemon_get_event_loop(struct afb_daemon daemon) -{ - return daemon.itf->get_event_loop(daemon.closure); -} - -static inline struct sd_bus *afb_daemon_get_user_bus(struct afb_daemon daemon) -{ - return daemon.itf->get_user_bus(daemon.closure); -} - -static inline struct sd_bus *afb_daemon_get_system_bus(struct afb_daemon daemon) -{ - return daemon.itf->get_system_bus(daemon.closure); -} - - diff --git a/include/afb-req-itf.h b/include/afb-req-itf.h deleted file mode 100644 index a8980ffc..00000000 --- a/include/afb-req-itf.h +++ /dev/null @@ -1,175 +0,0 @@ -/* - * Copyright (C) 2016 "IoT.bzh" - * Author: José Bollo - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#pragma once - -struct json_object; - -struct afb_arg { - const char *name; - const char *value; - const char *path; -}; - -struct afb_req_itf { - struct json_object *(*json)(void *closure); - struct afb_arg (*get)(void *closure, const char *name); - - void (*success)(void *closure, struct json_object *obj, const char *info); - void (*fail)(void *closure, const char *status, const char *info); - - const char *(*raw)(void *closure, size_t *size); - void (*send)(void *closure, const char *buffer, size_t size); - - void *(*context_get)(void *closure); - void (*context_set)(void *closure, void *value, void (*free_value)(void*)); - - void (*addref)(void *closure); - void (*unref)(void *closure); -}; - -struct afb_req { - const struct afb_req_itf *itf; - void *closure; -}; - -static inline struct afb_arg afb_req_get(struct afb_req req, const char *name) -{ - return req.itf->get(req.closure, name); -} - -static inline const char *afb_req_value(struct afb_req req, const char *name) -{ - return afb_req_get(req, name).value; -} - -static inline const char *afb_req_path(struct afb_req req, const char *name) -{ - return afb_req_get(req, name).path; -} - -static inline struct json_object *afb_req_json(struct afb_req req) -{ - return req.itf->json(req.closure); -} - -static inline void afb_req_success(struct afb_req req, struct json_object *obj, const char *info) -{ - req.itf->success(req.closure, obj, info); -} - -static inline void afb_req_fail(struct afb_req req, const char *status, const char *info) -{ - req.itf->fail(req.closure, status, info); -} - -static inline const char *afb_req_raw(struct afb_req req, size_t *size) -{ - return req.itf->raw(req.closure, size); -} - -static inline void afb_req_send(struct afb_req req, const char *buffer, size_t size) -{ - req.itf->send(req.closure, buffer, size); -} - -static inline void *afb_req_context_get(struct afb_req req) -{ - return req.itf->context_get(req.closure); -} - -static inline void afb_req_context_set(struct afb_req req, void *value, void (*free_value)(void*)) -{ - return req.itf->context_set(req.closure, value, free_value); -} - -static inline void afb_req_context_clear(struct afb_req req) -{ - afb_req_context_set(req, NULL, NULL); -} - -static inline void afb_req_addref(struct afb_req req) -{ - return req.itf->addref(req.closure); -} - -static inline void afb_req_unref(struct afb_req req) -{ - return req.itf->unref(req.closure); -} - -#include - -static inline struct afb_req *afb_req_store(struct afb_req req) -{ - struct afb_req *result = malloc(sizeof *result); - if (result != NULL) { - *result = req; - afb_req_addref(req); - } - return result; -} - -static inline struct afb_req afb_req_unstore(struct afb_req *req) -{ - struct afb_req result = *req; - free(req); - afb_req_unref(result); - return result; -} - -#if !defined(_GNU_SOURCE) -# error "_GNU_SOURCE must be defined for using vasprintf" -#endif - -#include -#include - -static inline void afb_req_fail_v(struct afb_req req, const char *status, const char *info, va_list args) -{ - char *message; - if (info == NULL || vasprintf(&message, info, args) < 0) - message = NULL; - afb_req_fail(req, status, message); - free(message); -} - -static inline void afb_req_fail_f(struct afb_req req, const char *status, const char *info, ...) -{ - va_list args; - va_start(args, info); - afb_req_fail_v(req, status, info, args); - va_end(args); -} - -static inline void afb_req_success_v(struct afb_req req, struct json_object *obj, const char *info, va_list args) -{ - char *message; - if (info == NULL || vasprintf(&message, info, args) < 0) - message = NULL; - afb_req_success(req, obj, message); - free(message); -} - -static inline void afb_req_success_f(struct afb_req req, struct json_object *obj, const char *info, ...) -{ - va_list args; - va_start(args, info); - afb_req_success_v(req, obj, info, args); - va_end(args); -} - diff --git a/include/afb/afb-evmgr-itf.h b/include/afb/afb-evmgr-itf.h new file mode 100644 index 00000000..90b1e0a9 --- /dev/null +++ b/include/afb/afb-evmgr-itf.h @@ -0,0 +1,35 @@ +/* + * Copyright (C) 2016 "IoT.bzh" + * Author: José Bollo + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +struct json_object; + +struct afb_evmgr_itf { + void (*push)(void *evmgr, const char *name, struct json_object *object); +}; + +struct afb_evmgr { + const struct afb_evmgr_itf *itf; + void *closure; +}; + +static inline void afb_evmgr_push(struct afb_evmgr mgr, const char *name, struct json_object *object) +{ + return mgr.itf->push(mgr.closure, name, object); +} + diff --git a/include/afb/afb-plugin.h b/include/afb/afb-plugin.h new file mode 100644 index 00000000..2cfe6289 --- /dev/null +++ b/include/afb/afb-plugin.h @@ -0,0 +1,111 @@ +/* + * Copyright (C) 2016 "IoT.bzh" + * Author: José Bollo + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include +#include + +/* Plugin Type */ +enum AFB_pluginE +{ + AFB_PLUGIN_JSON = 123456789, +/* AFB_PLUGIN_JSCRIPT = 987654321, */ + AFB_PLUGIN_RAW = 987123546 +}; + +/* Enum for Session/Token/Authentication middleware */ +enum AFB_sessionE +{ + AFB_SESSION_NONE = 0, + AFB_SESSION_CREATE = 1, + AFB_SESSION_CLOSE = 2, + AFB_SESSION_RENEW = 4, + AFB_SESSION_CHECK = 8, + AFB_SESSION_MASK = 15 +}; + +/* API definition */ +struct AFB_restapi +{ + const char *name; + enum AFB_sessionE session; + void (*callback)(struct afb_req req); + const char *info; +}; + +/* Plugin definition */ +struct AFB_plugin +{ + enum AFB_pluginE type; + const char *info; + const char *prefix; + const struct AFB_restapi *apis; +}; + +/* config mode */ +enum AFB_Mode { + AFB_MODE_LOCAL = 0, + AFB_MODE_REMOTE, + AFB_MODE_GLOBAL +}; + +struct sd_event; +struct sd_bus; + +struct afb_daemon_itf { + struct afb_evmgr (*get_evmgr)(void *closure); + struct sd_event *(*get_event_loop)(void *closure); + struct sd_bus *(*get_user_bus)(void *closure); + struct sd_bus *(*get_system_bus)(void *closure); +}; + +struct afb_daemon { + const struct afb_daemon_itf *itf; + void *closure; +}; + +struct AFB_interface +{ + int verbosity; + enum AFB_Mode mode; + struct afb_daemon daemon; +}; + +extern const struct AFB_plugin *pluginRegister (const struct AFB_interface *interface); + +static inline struct afb_evmgr afb_daemon_get_evmgr(struct afb_daemon daemon) +{ + return daemon.itf->get_evmgr(daemon.closure); +} + +static inline struct sd_event *afb_daemon_get_event_loop(struct afb_daemon daemon) +{ + return daemon.itf->get_event_loop(daemon.closure); +} + +static inline struct sd_bus *afb_daemon_get_user_bus(struct afb_daemon daemon) +{ + return daemon.itf->get_user_bus(daemon.closure); +} + +static inline struct sd_bus *afb_daemon_get_system_bus(struct afb_daemon daemon) +{ + return daemon.itf->get_system_bus(daemon.closure); +} + + diff --git a/include/afb/afb-req-itf.h b/include/afb/afb-req-itf.h new file mode 100644 index 00000000..a8980ffc --- /dev/null +++ b/include/afb/afb-req-itf.h @@ -0,0 +1,175 @@ +/* + * Copyright (C) 2016 "IoT.bzh" + * Author: José Bollo + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +struct json_object; + +struct afb_arg { + const char *name; + const char *value; + const char *path; +}; + +struct afb_req_itf { + struct json_object *(*json)(void *closure); + struct afb_arg (*get)(void *closure, const char *name); + + void (*success)(void *closure, struct json_object *obj, const char *info); + void (*fail)(void *closure, const char *status, const char *info); + + const char *(*raw)(void *closure, size_t *size); + void (*send)(void *closure, const char *buffer, size_t size); + + void *(*context_get)(void *closure); + void (*context_set)(void *closure, void *value, void (*free_value)(void*)); + + void (*addref)(void *closure); + void (*unref)(void *closure); +}; + +struct afb_req { + const struct afb_req_itf *itf; + void *closure; +}; + +static inline struct afb_arg afb_req_get(struct afb_req req, const char *name) +{ + return req.itf->get(req.closure, name); +} + +static inline const char *afb_req_value(struct afb_req req, const char *name) +{ + return afb_req_get(req, name).value; +} + +static inline const char *afb_req_path(struct afb_req req, const char *name) +{ + return afb_req_get(req, name).path; +} + +static inline struct json_object *afb_req_json(struct afb_req req) +{ + return req.itf->json(req.closure); +} + +static inline void afb_req_success(struct afb_req req, struct json_object *obj, const char *info) +{ + req.itf->success(req.closure, obj, info); +} + +static inline void afb_req_fail(struct afb_req req, const char *status, const char *info) +{ + req.itf->fail(req.closure, status, info); +} + +static inline const char *afb_req_raw(struct afb_req req, size_t *size) +{ + return req.itf->raw(req.closure, size); +} + +static inline void afb_req_send(struct afb_req req, const char *buffer, size_t size) +{ + req.itf->send(req.closure, buffer, size); +} + +static inline void *afb_req_context_get(struct afb_req req) +{ + return req.itf->context_get(req.closure); +} + +static inline void afb_req_context_set(struct afb_req req, void *value, void (*free_value)(void*)) +{ + return req.itf->context_set(req.closure, value, free_value); +} + +static inline void afb_req_context_clear(struct afb_req req) +{ + afb_req_context_set(req, NULL, NULL); +} + +static inline void afb_req_addref(struct afb_req req) +{ + return req.itf->addref(req.closure); +} + +static inline void afb_req_unref(struct afb_req req) +{ + return req.itf->unref(req.closure); +} + +#include + +static inline struct afb_req *afb_req_store(struct afb_req req) +{ + struct afb_req *result = malloc(sizeof *result); + if (result != NULL) { + *result = req; + afb_req_addref(req); + } + return result; +} + +static inline struct afb_req afb_req_unstore(struct afb_req *req) +{ + struct afb_req result = *req; + free(req); + afb_req_unref(result); + return result; +} + +#if !defined(_GNU_SOURCE) +# error "_GNU_SOURCE must be defined for using vasprintf" +#endif + +#include +#include + +static inline void afb_req_fail_v(struct afb_req req, const char *status, const char *info, va_list args) +{ + char *message; + if (info == NULL || vasprintf(&message, info, args) < 0) + message = NULL; + afb_req_fail(req, status, message); + free(message); +} + +static inline void afb_req_fail_f(struct afb_req req, const char *status, const char *info, ...) +{ + va_list args; + va_start(args, info); + afb_req_fail_v(req, status, info, args); + va_end(args); +} + +static inline void afb_req_success_v(struct afb_req req, struct json_object *obj, const char *info, va_list args) +{ + char *message; + if (info == NULL || vasprintf(&message, info, args) < 0) + message = NULL; + afb_req_success(req, obj, message); + free(message); +} + +static inline void afb_req_success_f(struct afb_req req, struct json_object *obj, const char *info, ...) +{ + va_list args; + va_start(args, info); + afb_req_success_v(req, obj, info, args); + va_end(args); +} + diff --git a/plugins/afm-main-plugin/afm-main-plugin.c b/plugins/afm-main-plugin/afm-main-plugin.c index 95767307..705efcb0 100644 --- a/plugins/afm-main-plugin/afm-main-plugin.c +++ b/plugins/afm-main-plugin/afm-main-plugin.c @@ -21,7 +21,7 @@ #include #include -#include "afb-plugin.h" +#include #include "utils-jbus.h" diff --git a/plugins/audio/audio-api.c b/plugins/audio/audio-api.c index 00f81001..c486d1c1 100644 --- a/plugins/audio/audio-api.c +++ b/plugins/audio/audio-api.c @@ -25,8 +25,8 @@ #include "audio-pulse.h" #endif -#include "afb-plugin.h" -#include "afb-req-itf.h" +#include +#include /* ------ BACKEND FUNCTIONS ------- */ diff --git a/plugins/media/media-api.c b/plugins/media/media-api.c index 7b4fa18f..91676d4c 100644 --- a/plugins/media/media-api.c +++ b/plugins/media/media-api.c @@ -24,8 +24,8 @@ #include "media-api.h" #include "media-rygel.h" -#include "afb-plugin.h" -#include "afb-req-itf.h" +#include +#include json_object* _rygel_list (mediaCtxHandleT *); diff --git a/plugins/radio/radio-api.c b/plugins/radio/radio-api.c index edeb9786..e4a89ba6 100644 --- a/plugins/radio/radio-api.c +++ b/plugins/radio/radio-api.c @@ -22,8 +22,8 @@ #include "radio-api.h" #include "radio-rtlsdr.h" -#include "afb-plugin.h" -#include "afb-req-itf.h" +#include +#include /* ******************************************************** diff --git a/plugins/samples/ClientCtx.c b/plugins/samples/ClientCtx.c index 4d8e7205..bf26937f 100644 --- a/plugins/samples/ClientCtx.c +++ b/plugins/samples/ClientCtx.c @@ -19,7 +19,7 @@ #include #include -#include "afb-plugin.h" +#include typedef struct { /* diff --git a/plugins/samples/HelloWorld.c b/plugins/samples/HelloWorld.c index 6f9d01d8..4795dd36 100644 --- a/plugins/samples/HelloWorld.c +++ b/plugins/samples/HelloWorld.c @@ -19,7 +19,7 @@ #include #include -#include "afb-plugin.h" +#include const struct AFB_interface *interface; diff --git a/plugins/samples/SamplePost.c b/plugins/samples/SamplePost.c index 25e73f93..1d3069e8 100644 --- a/plugins/samples/SamplePost.c +++ b/plugins/samples/SamplePost.c @@ -20,7 +20,7 @@ #include #include -#include "afb-plugin.h" +#include // Sample Generic Ping Debug API diff --git a/plugins/session/token-api.c b/plugins/session/token-api.c index 80289486..fd312608 100644 --- a/plugins/session/token-api.c +++ b/plugins/session/token-api.c @@ -19,7 +19,7 @@ #include #include -#include "afb-plugin.h" +#include // Dummy sample of Client Application Context typedef struct { diff --git a/src/afb-api-dbus.c b/src/afb-api-dbus.c index 3a882a56..52d449f0 100644 --- a/src/afb-api-dbus.c +++ b/src/afb-api-dbus.c @@ -25,8 +25,8 @@ #include #include -#include "afb-plugin.h" -#include "afb-req-itf.h" +#include +#include #include "afb-common.h" diff --git a/src/afb-api-so.c b/src/afb-api-so.c index 6ac5070f..72599e5b 100644 --- a/src/afb-api-so.c +++ b/src/afb-api-so.c @@ -27,9 +27,9 @@ #include #include -#include "afb-plugin.h" -#include "afb-req-itf.h" -#include "afb-evmgr-itf.h" +#include +#include +#include #include "session.h" #include "afb-common.h" diff --git a/src/afb-apis.c b/src/afb-apis.c index 834850f2..5ebc96ff 100644 --- a/src/afb-apis.c +++ b/src/afb-apis.c @@ -26,7 +26,7 @@ #include "verbose.h" #include "afb-apis.h" #include "afb-context.h" -#include "afb-req-itf.h" +#include struct api_desc { struct afb_api api; diff --git a/src/afb-hreq.c b/src/afb-hreq.c index 0f2f0ffb..a1c750b4 100644 --- a/src/afb-hreq.c +++ b/src/afb-hreq.c @@ -33,7 +33,7 @@ #endif #include "afb-method.h" -#include "afb-req-itf.h" +#include #include "afb-msg-json.h" #include "afb-context.h" #include "afb-hreq.h" @@ -471,6 +471,7 @@ int afb_hreq_reply_file(struct afb_hreq *hreq, int dirfd, const char *filename) int afb_hreq_redirect_to(struct afb_hreq *hreq, const char *url) { + /* TODO: append the query part! */ afb_hreq_reply_static(hreq, MHD_HTTP_MOVED_PERMANENTLY, 0, NULL, MHD_HTTP_HEADER_LOCATION, url, NULL); DEBUG("redirect from [%s] to [%s]", hreq->url, url); diff --git a/src/afb-hsrv.c b/src/afb-hsrv.c index 743315cb..46e61a01 100644 --- a/src/afb-hsrv.c +++ b/src/afb-hsrv.c @@ -33,7 +33,7 @@ #include "afb-context.h" #include "afb-hreq.h" #include "afb-hsrv.h" -#include "afb-req-itf.h" +#include #include "verbose.h" #include "afb-common.h" diff --git a/src/afb-hswitch.c b/src/afb-hswitch.c index bdded7fb..8dee80b3 100644 --- a/src/afb-hswitch.c +++ b/src/afb-hswitch.c @@ -23,7 +23,7 @@ #include -#include "afb-req-itf.h" +#include #include "afb-context.h" #include "afb-hreq.h" #include "afb-apis.h" diff --git a/src/afb-ws-json1.c b/src/afb-ws-json1.c index fe7514d9..85dc0259 100644 --- a/src/afb-ws-json1.c +++ b/src/afb-ws-json1.c @@ -29,7 +29,7 @@ #include "afb-ws-json1.h" #include "afb-msg-json.h" #include "session.h" -#include "afb-req-itf.h" +#include #include "afb-apis.h" #include "afb-context.h" diff --git a/src/main.c b/src/main.c index fdea9079..dbfbac5d 100644 --- a/src/main.c +++ b/src/main.c @@ -41,7 +41,7 @@ #include "verbose.h" #include "afb-common.h" -#include "afb-plugin.h" +#include #if !defined(PLUGIN_INSTALL_DIR) #error "you should define PLUGIN_INSTALL_DIR" -- cgit 1.2.3-korg