From d70b04c6d7f5fec2d3cd9584362a9675a5196531 Mon Sep 17 00:00:00 2001 From: Ryan Dahl Date: Tue, 4 Dec 2018 15:06:20 -0800 Subject: Add deno_config struct for isolate creation. (#1277) In preperation for adding other callbacks to libdeno. --- libdeno/deno.h | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'libdeno/deno.h') 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); -- cgit v1.2.3