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

Function dump_token

common/splice_script.c:187–206  ·  view source on GitHub ↗

Returns the indent used */

Source from the content-addressed store, hash-verified

185#if SCRIPT_DUMP_TOKENS
186/* Returns the indent used */
187static int dump_token(char **str, struct token *token, int indent, char *prefix)
188{
189 if (token->left)
190 indent = dump_token(str, token->left, indent, "l ") + 1;
191
192 for (int i = 0; i < indent; i++)
193 tal_append_fmt(str, " ");
194
195 dump_token_shallow(str, token, prefix);
196
197 tal_append_fmt(str, "\n");
198
199 if (token->middle)
200 dump_token(str, token->middle, indent, "m ");
201
202 if (token->right)
203 dump_token(str, token->right, indent + 1, "r ");
204
205 return indent;
206}
207
208static struct splice_script_error *debug_dump(const tal_t *ctx,
209 struct token **tokens)

Callers 1

debug_dumpFunction · 0.85

Calls 2

tal_append_fmtFunction · 0.85
dump_token_shallowFunction · 0.85

Tested by

no test coverage detected