diff options
author | bptato <nincsnevem662@gmail.com> | 2023-05-24 09:51:37 +0200 |
---|---|---|
committer | bptato <nincsnevem662@gmail.com> | 2023-05-24 09:51:37 +0200 |
commit | 1b7f6849b945e28fc6418c42d8799a899d667a81 (patch) | |
tree | bda1cd5a313b2d86f6c017e4c23c56e6cd07ef9d /src/bindings | |
parent | addea03eb7f5d9caee2f20c3b81685da75afceec (diff) | |
download | chawan-1b7f6849b945e28fc6418c42d8799a899d667a81.tar.gz |
Some bindings
Diffstat (limited to 'src/bindings')
-rw-r--r-- | src/bindings/quickjs.nim | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/bindings/quickjs.nim b/src/bindings/quickjs.nim index 94b3c46e..ed2cc15d 100644 --- a/src/bindings/quickjs.nim +++ b/src/bindings/quickjs.nim @@ -87,6 +87,7 @@ else: type JSRuntime* = ptr object JSContext* = ptr object + JSModuleDef* = ptr object JSCFunction* = proc (ctx: JSContext, this_val: JSValue, argc: cint, argv: ptr JSValue): JSValue {.cdecl.} JSCFunctionData* = proc (ctx: JSContext, this_val: JSValue, argc: cint, argv: ptr JSValue, magic: cint, func_data: ptr JSValue): JSValue {.cdecl.} JSGetterFunction* = proc(ctx: JSContext, this_val: JSValue): JSValue {.cdecl.} @@ -99,7 +100,11 @@ type JSClassFinalizer* = proc (rt: JSRuntime, val: JSValue) {.cdecl.} JSClassGCMark* = proc (rt: JSRuntime, val: JSValue, mark_func: JS_MarkFunc) {.cdecl.} JS_MarkFunc* = proc (rt: JSRuntime, gp: ptr JSGCObjectHeader) {.cdecl.} - JSJobFunc* = proc (ctx: JSContext, argc: cint, argv: ptr JSValue): JSValue + JSModuleNormalizeFunc* = proc(ctx: JSContext, module_base_name, + module_name: cstring, opaque: pointer): cstring {.cdecl.} + JSModuleLoaderFunc* = proc(ctx: JSContext, module_name: cstring, + opaque: pointer): JSModuleDef {.cdecl.} + JSJobFunc* = proc (ctx: JSContext, argc: cint, argv: ptr JSValue): JSValue {.cdecl.} JSGCObjectHeader* {.importc, header: qjsheader.} = object JSPropertyDescriptor* {.importc, header: qjsheader.} = object @@ -424,6 +429,10 @@ proc JS_ThrowReferenceError*(ctx: JSContext, fmt: cstring): JSValue {.varargs, d proc JS_ThrowRangeError*(ctx: JSContext, fmt: cstring): JSValue {.varargs, discardable.} proc JS_ThrowInternalError*(ctx: JSContext, fmt: cstring): JSValue {.varargs, discardable.} +proc JS_SetModuleLoaderFunc*(rt: JSRuntime, + module_normalize: JSModuleNormalizeFunc, module_loader: JSModuleLoaderFunc, + opaque: pointer) + proc JS_EnqueueJob*(ctx: JSContext, job_func: JSJobFunc, argc: cint, argv: ptr JSValue): cint proc JS_IsJobPending*(rt: JSRuntime): JS_BOOL proc JS_ExecutePendingJob*(rt: JSRuntime, pctx: ptr JSContext): cint |