hooks: Allow to remove hooking (and/or trace)
[src/app-framework-binder.git] / src / afb-api.h
index 821bccb..d55970c 100644 (file)
@@ -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");
@@ -25,7 +25,9 @@ struct afb_api_itf
 {
        void (*call)(void *closure, struct afb_xreq *xreq);
        int (*service_start)(void *closure);
+#if WITH_AFB_HOOK
        void (*update_hooks)(void *closure);
+#endif
        int (*get_logmask)(void *closure);
        void (*set_logmask)(void *closure, int level);
        struct json_object *(*describe)(void *closure);
@@ -41,4 +43,9 @@ struct afb_api_item
 
 extern int afb_api_is_valid_name(const char *name);
 
+static inline int afb_api_is_public(const char *name)
+{
+       return *name != '.';
+}
+