Expose global setTimeout from C API #1502
Answered
by
bnoordhuis
nsanmartin
asked this question in
Q&A
|
I want to use the C api to bind the quickjs runtime to a DOM for an html document in a browser. I see the quickjs-libc.c defines the js_os_setTimeout function and I would like to reuse it (since I need a global setTimeout function) setting as a property of JS_GetGlobalObject. But the function is static and not exported. Should I have to implement my own or is there a way to reuse it for the purpose I described? |
Answered by
bnoordhuis
May 20, 2026
Replies: 1 comment
|
You probably don't want to reuse it because it's basically an all-or-nothing proposition: it intertwines intimately with the event loop so then you have to design your program around the quickjs-libc event loop (js_std_loop, etc.) |
0 replies
Answer selected by
nsanmartin
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You probably don't want to reuse it because it's basically an all-or-nothing proposition: it intertwines intimately with the event loop so then you have to design your program around the quickjs-libc event loop (js_std_loop, etc.)