summaryrefslogtreecommitdiff
path: root/src/reply.h
blob: 4b16204da3dc6af6a0e2fd6f5d3853f561a976dd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// Copyright 2018 the Deno authors. All rights reserved. MIT license.

// TODO(ry) This library handles parsing and sending Flatbuffers. It's written
// in C++ because flatbuffer support for Rust is not quite there. However, once
// flatbuffers are supported in Rust, all of this code should be ported back to
// Rust.

#ifndef REPLY_H_
#define REPLY_H_

#include <stdint.h>
#include "deno.h"

extern "C" {

void deno_reply_null(Deno* d, uint32_t cmd_id);
void deno_reply_error(Deno* d, uint32_t cmd_id, const char* error_msg);

void deno_reply_start(Deno* d, uint32_t cmd_id, int argc, char* argv[],
                      char* cwd);
void deno_reply_code_fetch(Deno* d, uint32_t cmd_id, const char* module_name,
                           const char* filename, const char* source_code,
                           const char* output_code);

// Parse incoming messages with C++ Flatbuffers, call into rust handlers.
void deno_handle_msg_from_js(Deno* d, deno_buf buf);
}
#endif  // REPLY_H_