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

Function json_add_escaped_string

common/json_stream.c:321–333  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

319}
320
321void json_add_escaped_string(struct json_stream *result, const char *fieldname,
322 const struct json_escape *esc TAKES)
323{
324 /* Already escaped, don't re-escape! */
325 char *dest = json_member_direct(result, fieldname,
326 1 + strlen(esc->s) + 1);
327
328 dest[0] = '"';
329 memcpy(dest + 1, esc->s, strlen(esc->s));
330 dest[1+strlen(esc->s)] = '"';
331 if (taken(esc))
332 tal_free(esc);
333}
334
335void json_add_timeabs(struct json_stream *result, const char *fieldname,
336 struct timeabs t)

Callers 3

invoice_paymentFunction · 0.50
sign_invoiceFunction · 0.50
json_add_nodeFunction · 0.50

Calls 3

json_member_directFunction · 0.85
takenFunction · 0.85
tal_freeFunction · 0.85

Tested by

no test coverage detected