afb-api: Enforce api names to be hookable
[src/app-framework-binder.git] / src / afb-api.h
index c8cb2d6..ff1bc10 100644 (file)
@@ -35,6 +35,12 @@ struct afb_api
 {
        void *closure;
        struct afb_api_itf *itf;
+       const void *group;
 };
 
-extern int afb_api_is_valid_name(const char *name);
+extern int afb_api_is_valid_name(const char *name, int hookable);
+
+#define AFB_API_UNHOOKABLE_PREFIX_CHAR    '$'
+#define AFB_API_UNHOOKABLE_PREFIX_STRING  "$"
+#define afb_api_is_hookable(api)          ((api)[0] != AFB_API_UNHOOKABLE_PREFIX_CHAR)
+