summaryrefslogtreecommitdiffhomepage
path: root/module.h
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2021-04-27 12:43:38 +0200
committerGitHub <noreply@github.com>2021-04-27 12:43:38 +0200
commit8469c4b1be228f42c46f08852f028f7801b93cc9 (patch)
treef61121e8f89e39787a960e621fc8492e57fc4bc0 /module.h
parentf360350bd874aeec0806c8df02c7a20a54c44406 (diff)
parent64eec7f90e945696572ee076b75d1f35e8f2248a (diff)
Merge pull request #5 from jow-/new-type-system
New type system
Diffstat (limited to 'module.h')
-rw-r--r--module.h15
1 files changed, 5 insertions, 10 deletions
diff --git a/module.h b/module.h
index 9885270..aa72074 100644
--- a/module.h
+++ b/module.h
@@ -18,7 +18,6 @@
#define __MODULE_H_
#include "lib.h"
-#include "object.h"
#include "vm.h"
#define register_functions(scope, functions) \
@@ -34,23 +33,19 @@
})
#define declare_type(name, proto, freefn) \
- ops->ressource.define(name, proto, freefn)
+ ucv_ressource_type_add(name, proto, freefn)
#define alloc_ressource(data, type) \
- ops->ressource.create(xjs_new_object(), type, data)
+ ucv_ressource_new(ucv_object_new(NULL), type, data)
#define register_ressource(scope, key, res) \
json_object_object_add((scope)->header.jso, key, (res)->header.jso)
-static const uc_ops *ops;
+void uc_module_init(uc_value_t *scope) __attribute__((weak));
-void uc_module_init(uc_prototype *scope) __attribute__((weak));
-
-void uc_module_entry(const uc_ops *_ops, uc_prototype *scope);
-void uc_module_entry(const uc_ops *_ops, uc_prototype *scope)
+void uc_module_entry(uc_value_t *scope);
+void uc_module_entry(uc_value_t *scope)
{
- ops = _ops;
-
if (uc_module_init)
uc_module_init(scope);
}