diff options
author | Ryan Dahl <ry@tinyclouds.org> | 2018-12-04 15:06:20 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-12-04 15:06:20 -0800 |
commit | d70b04c6d7f5fec2d3cd9584362a9675a5196531 (patch) | |
tree | 1820dd24196bbe0e82c9d5b4d8f8e55feeebcb37 /libdeno/deno.h | |
parent | 30420ad3174e232b74146ad09af448407f252685 (diff) |
Add deno_config struct for isolate creation. (#1277)
In preperation for adding other callbacks to libdeno.
Diffstat (limited to 'libdeno/deno.h')
-rw-r--r-- | libdeno/deno.h | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/libdeno/deno.h b/libdeno/deno.h index 4941709a9..fb0b13746 100644 --- a/libdeno/deno.h +++ b/libdeno/deno.h @@ -29,11 +29,16 @@ void deno_init(); const char* deno_v8_version(); void deno_set_v8_flags(int* argc, char** argv); -Deno* deno_new(deno_buf snapshot, deno_buf shared, deno_recv_cb cb); +typedef struct { + deno_buf shared; // Shared buffer to be mapped to libdeno.shared + deno_recv_cb recv_cb; // Maps to libdeno.send() calls. +} deno_config; + +Deno* deno_new(deno_buf snapshot, deno_config config); + +Deno* deno_new_snapshotter(deno_config config, const char* js_filename, + const char* js_source, const char* source_map); -Deno* deno_new_snapshotter(deno_buf shared, deno_recv_cb cb, - const char* js_filename, const char* js_source, - const char* source_map); // Generate a snapshot. The resulting buf can be used with deno_new. // The caller must free the returned data by calling delete[] buf.data_ptr. deno_buf deno_get_snapshot(Deno* d); |