/*
- * Copyright (C) 2017 "IoT.bzh"
- * Author José Bollo <jose.bollo@iot.bzh>
+ * Copyright (C) 2017-2019 "IoT.bzh"
+ * Author: José Bollo <jose.bollo@iot.bzh>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
#pragma once
-struct afb_perm;
+#include <sys/types.h>
-extern struct afb_perm *afb_perm_parse(const char *desc);
-extern void afb_perm_addref(struct afb_perm *perm);
-extern void afb_perm_unref(struct afb_perm *perm);
-extern int afb_perm_check(struct afb_perm *perm, int (*check)(void *closure, const char *name), void *closure);
+struct afb_context;
+extern int afb_perm_check(struct afb_context *context, const char *permission);
+
+extern void afb_perm_check_async(
+ struct afb_context *context,
+ const char *permission,
+ void (*callback)(void *closure, int status),
+ void *closure
+);