diff options
| author | 2021-07-18 09:39:37 -0500 | |
|---|---|---|
| committer | 2021-07-18 09:39:37 -0500 | |
| commit | 55b8563c085190aa04fb2e43c979f202857a1864 (patch) | |
| tree | 1a60989389d02f350c7677cb1c2218fe5652f620 /src/include/janet.h | |
| parent | Add option to build janet without thread library. (diff) | |
Add janet_loop_fiber C function to run a fiber to completion from C.
This is mainly meant for use as the entry point to a C wrapper for a
janet program. This maeans the programmer doesn't need to use an ifdef
to handle if the event loop is enabled.
Diffstat (limited to 'src/include/janet.h')
| -rw-r--r-- | src/include/janet.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/include/janet.h b/src/include/janet.h index 8573772a..c14aacdb 100644 --- a/src/include/janet.h +++ b/src/include/janet.h @@ -1424,9 +1424,13 @@ JANET_API JanetCompileResult janet_compile_lint( JANET_API JanetTable *janet_core_env(JanetTable *replacements); JANET_API JanetTable *janet_core_lookup_table(JanetTable *replacements); +/* Execute strings */ JANET_API int janet_dobytes(JanetTable *env, const uint8_t *bytes, int32_t len, const char *sourcePath, Janet *out); JANET_API int janet_dostring(JanetTable *env, const char *str, const char *sourcePath, Janet *out); +/* Run the entrypoint of a wrapped program */ +JANET_API int janet_loop_fiber(JanetFiber *fiber); + /* Number scanning */ JANET_API int janet_scan_number(const uint8_t *str, int32_t len, double *out); JANET_API int janet_scan_int64(const uint8_t *str, int32_t len, int64_t *out); |
