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

Function set_string

ccan/ccan/strset/strset.c:75–92  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

73}
74
75static bool set_string(struct strset *set,
76 struct strset *n, const char *member)
77{
78 /* Substitute magic empty node if this is the empty string */
79 if (unlikely(!member[0])) {
80 n->u.n = malloc(sizeof(*n->u.n));
81 if (unlikely(!n->u.n)) {
82 errno = ENOMEM;
83 return false;
84 }
85 n->u.n->nul_byte = '\0';
86 n->u.n->byte_num = (size_t)-1;
87 /* Attach the string to child[0] */
88 n = &n->u.n->child[0];
89 }
90 n->u.s = member;
91 return true;
92}
93
94bool strset_add(struct strset *set, const char *member)
95{

Callers 1

strset_addFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected