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

Function json_add_escaped_string

common/json_stream.c:335–348  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

333}
334
335void json_add_escaped_string(struct json_stream *result, const char *fieldname,
336 const struct json_escape *esc TAKES)
337{
338 if (json_filter_ok(result->filter, fieldname)) {
339 /* Already escaped, don't re-escape! */
340 char *dest = json_member_direct(result, fieldname,
341 1 + strlen(esc->s) + 1);
342
343 dest[0] = '"';
344 memcpy(dest + 1, esc->s, strlen(esc->s));
345 dest[1+strlen(esc->s)] = '"';
346 }
347 tal_free_if_taken(esc);
348}
349
350void json_add_timeabs(struct json_stream *result, const char *fieldname,
351 struct timeabs t)

Callers 11

json_populate_offerFunction · 0.85
json_populate_invreqFunction · 0.85
json_add_invoice_fieldsFunction · 0.85
test_json_escapeFunction · 0.85
invoice_paymentFunction · 0.85
sign_invoiceFunction · 0.85
json_add_nodeFunction · 0.85
do_injectFunction · 0.85

Calls 3

json_member_directFunction · 0.85
tal_free_if_takenFunction · 0.85
json_filter_okFunction · 0.70

Tested by 1

test_json_escapeFunction · 0.68