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

Function set_string

ccan/ccan/strset/strset.c:74–91  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 1

strset_addFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected