MCPcopy Create free account
hub / github.com/ElementsProject/lightning / jsonrpc_io_new

Function jsonrpc_io_new

common/jsonrpc_io.c:22–37  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

20};
21
22struct jsonrpc_io *jsonrpc_io_new(const tal_t *ctx)
23{
24 struct jsonrpc_io *json_in;
25 const size_t bufsize = READ_CHUNKSIZE * 2;
26
27 json_in = tal(ctx, struct jsonrpc_io);
28 json_in->bytes_read = 0;
29
30 membuf_init(&json_in->membuf,
31 tal_arr(json_in, char, bufsize),
32 bufsize, membuf_tal_resize);
33 json_in->toks = toks_alloc(json_in);
34 jsmn_init(&json_in->parser);
35
36 return json_in;
37}
38
39/* Empty new bytes read into our unparsed buffer */
40static void add_newly_read(struct jsonrpc_io *json_in)

Callers 5

plugin_send_getmanifestFunction · 0.85
jcon_connectedFunction · 0.85
mk_readerFunction · 0.85
sync_reqFunction · 0.85
new_pluginFunction · 0.85

Calls 1

toks_allocFunction · 0.85

Tested by 1

mk_readerFunction · 0.68