Code Review
/
src
/
app-framework-binder.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
afb-api-dbus: Fix broken broadcast in dbus apis
[src/app-framework-binder.git]
/
src
/
afb-api-so.c
diff --git
a/src/afb-api-so.c
b/src/afb-api-so.c
index
8728197
..
74305c6
100644
(file)
--- a/
src/afb-api-so.c
+++ b/
src/afb-api-so.c
@@
-1,5
+1,5
@@
/*
/*
- * Copyright (C) 2016
, 2017, 2018
"IoT.bzh"
+ * Copyright (C) 2016
-2019
"IoT.bzh"
* Author José Bollo <jose.bollo@iot.bzh>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* Author José Bollo <jose.bollo@iot.bzh>
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@
-15,6
+15,8
@@
* limitations under the License.
*/
* limitations under the License.
*/
+#if WITH_DYNAMIC_BINDING
+
#define _GNU_SOURCE
#include <stdio.h>
#define _GNU_SOURCE
#include <stdio.h>
@@
-25,17
+27,19
@@
#include <sys/stat.h>
#include "afb-api-so.h"
#include <sys/stat.h>
#include "afb-api-so.h"
-#include "afb-api-so-v2.h"
#include "afb-api-so-v3.h"
#include "verbose.h"
#include "sig-monitor.h"
#include "afb-api-so-v3.h"
#include "verbose.h"
#include "sig-monitor.h"
-#if
defined(WITH_LEGACY_BINDING_V1)
+#if
WITH_LEGACY_BINDING_V1
# include "afb-api-so-v1.h"
#endif
# include "afb-api-so-v1.h"
#endif
-#if
defined(WITH_LEGACY_BINDING_VDYN)
+#if
WITH_LEGACY_BINDING_VDYN
# include "afb-api-so-vdyn.h"
#endif
# include "afb-api-so-vdyn.h"
#endif
+#if WITH_LEGACY_BINDING_V2
+# include "afb-api-so-v2.h"
+#endif
struct safe_dlopen
{
struct safe_dlopen
{
@@
-91,6
+95,7
@@
static int load_binding(const char *path, int force, struct afb_apiset *declare_
if (rc)
return 0; /* yes version 3 */
if (rc)
return 0; /* yes version 3 */
+#if WITH_LEGACY_BINDING_V2
/* try the version 2 */
rc = afb_api_so_v2_add(path, handle, declare_set, call_set);
if (rc < 0) {
/* try the version 2 */
rc = afb_api_so_v2_add(path, handle, declare_set, call_set);
if (rc < 0) {
@@
-99,8
+104,14
@@
static int load_binding(const char *path, int force, struct afb_apiset *declare_
}
if (rc)
return 0; /* yes version 2 */
}
if (rc)
return 0; /* yes version 2 */
+#else
+ if (dlsym(handle, "afbBindingV2")) {
+ WARNING("binding [%s]: version 2 not supported", path);
+ obsolete = 1;
+ }
+#endif
-#if
defined(WITH_LEGACY_BINDING_VDYN)
+#if
WITH_LEGACY_BINDING_VDYN
/* try the version dyn */
rc = afb_api_so_vdyn_add(path, handle, declare_set, call_set);
if (rc < 0) {
/* try the version dyn */
rc = afb_api_so_vdyn_add(path, handle, declare_set, call_set);
if (rc < 0) {
@@
-116,7
+127,7
@@
static int load_binding(const char *path, int force, struct afb_apiset *declare_
}
#endif
}
#endif
-#if
defined(WITH_LEGACY_BINDING_V1)
+#if
WITH_LEGACY_BINDING_V1
/* try the version 1 */
rc = afb_api_so_v1_add(path, handle, declare_set, call_set);
if (rc < 0) {
/* try the version 1 */
rc = afb_api_so_v1_add(path, handle, declare_set, call_set);
if (rc < 0) {
@@
-313,3
+324,4
@@
int afb_api_so_add_pathset_nofails(const char *pathset, struct afb_apiset *decla
return afb_api_so_add_pathset(pathset, declare_set, call_set, 0);
}
return afb_api_so_add_pathset(pathset, declare_set, call_set, 0);
}
+#endif