MCPcopy Create free account
hub / github.com/acl-dev/acl / tpl_produce_section

Function tpl_produce_section

app/wizard/tpllib.cpp:241–263  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

239
240
241static tpl_tcell_t* tpl_produce_section(tpl_t *tpl,
242 const char* key,
243 int key_len,
244 int must_create)
245{
246 tpl_tcell_t **psection = &tpl->sections[tpl_hash(key, key_len)];
247
248 while (*psection != NULL)
249 {
250 if (memcmp((*psection)->key, key, key_len) == 0)
251 return (must_create) ? NULL : *psection;
252
253 psection = &(*psection)->_next;
254 }
255 if (*psection == NULL && must_create)
256 {
257 *psection = create_tcell(key, key_len);
258 (*psection)->tpl->parent = tpl;
259 return *psection;
260 }
261
262 return NULL;
263}
264
265#define tpl_get_section(tpl, key) \
266 tpl_produce_section(tpl, key, (int) strlen(key), 0)

Callers

nothing calls this directly

Calls 2

tpl_hashFunction · 0.70
create_tcellFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…