summaryrefslogtreecommitdiff
path: root/deno2/include/deno.h
diff options
context:
space:
mode:
authorRyan Dahl <ry@tinyclouds.org>2018-06-11 22:19:34 +0200
committerRyan Dahl <ry@tinyclouds.org>2018-06-11 22:24:06 +0200
commite89a49490c3109d42d29d6b9f57eaa373bb80b58 (patch)
tree396653a06b2b6e3eb7310f4a1b9d28a77833f3a4 /deno2/include/deno.h
parent7242f2b5a5118ee5b5cd2295761a703b54cee771 (diff)
Clarify memory guarantees of deno_buf
Diffstat (limited to 'deno2/include/deno.h')
-rw-r--r--deno2/include/deno.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/deno2/include/deno.h b/deno2/include/deno.h
index 63f26ba8c..b8d4e59a4 100644
--- a/deno2/include/deno.h
+++ b/deno2/include/deno.h
@@ -10,14 +10,16 @@ extern "C" {
// Data that gets transmitted.
typedef struct {
- void* data;
+ const char* data;
size_t len;
} deno_buf;
struct deno_s;
typedef struct deno_s Deno;
-// The callback from V8 when data is sent.
+// A callback to receive a message from deno_pub javascript call.
+// buf is valid only for the lifetime of the call.
+// The returned deno_buf is returned from deno_pub in javascript.
typedef deno_buf (*deno_sub_cb)(Deno* d, const char* channel, deno_buf buf);
void deno_init();