summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFulup Ar Foll <fulup@iot.bzh>2017-10-23 18:05:33 +0200
committerFulup Ar Foll <fulup@iot.bzh>2017-10-23 18:05:33 +0200
commitfd86e75feab42c0d0676a80e9aa415fa507e9a5f (patch)
treeb752a8b83813eb896f367bffc0caa4722959ba31
parent49a99fef3e1e1ea0ecd7f131fd56da4c54bcd146 (diff)
Prepare for future API-V3
-rw-r--r--filescan-utils.c2
-rw-r--r--filescan-utils.h13
2 files changed, 13 insertions, 2 deletions
diff --git a/filescan-utils.c b/filescan-utils.c
index 819efb2..7e45133 100644
--- a/filescan-utils.c
+++ b/filescan-utils.c
@@ -121,6 +121,7 @@ PUBLIC const char *GetBinderName() {
return binderName;
}
+#ifndef USE_API_DYN
PUBLIC char *GetBindingDirPath()
{
// A file description should not be greater than 999.999.999
@@ -142,3 +143,4 @@ PUBLIC char *GetBindingDirPath()
return strndup(retdir, sizeof(retdir));
}
+#endif
diff --git a/filescan-utils.h b/filescan-utils.h
index e17867e..940eafd 100644
--- a/filescan-utils.h
+++ b/filescan-utils.h
@@ -26,8 +26,17 @@
extern "C" {
#endif
-#define AFB_BINDING_VERSION 2
-#include <afb/afb-binding.h>
+// hack waiting for official V3 API
+#ifdef USE_API_DYN
+ #define AFB_BINDING_VERSION dyn
+ #include <afb/afb-binding.h>
+ extern afb_dynapi *AFB_default;
+ #define AFB_DEBUG(...) AFB_DYNAPI_DEBUG(AFB_default, __VA_ARGS__)
+#else
+ #define AFB_BINDING_VERSION 2
+ #include <afb/afb-binding.h>
+#endif
+
#include <json-c/json.h>
#ifndef PUBLIC