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

Function tpl_reset

app/wizard/tpllib.cpp:511–542  ·  view source on GitHub ↗

Recursively clear added content */

Source from the content-addressed store, hash-verified

509
510/* Recursively clear added content */
511void tpl_reset(tpl_t* tpl)
512{
513 int i = HASH_TABLE_SIZE;
514 tpl_tcell_t* section;
515
516 /* Clear fields */
517 while (i != 0)
518 {
519 tpl_fcell_t* field = tpl->fields[--i];
520 while (field != NULL)
521 {
522 field->len = 0;
523 *field->val = 0;
524 field = field->next;
525 }
526 }
527 /* Clear sections */
528 for (section = tpl->first; section != NULL; section = section->next)
529 {
530 /* Clear added content */
531 while (section->tpl->added_head != NULL)
532 {
533 tpl_node_t* n = section->tpl->added_head;
534 section->tpl->added_head = section->tpl->added_head->next;
535 destroy_node(n);
536 }
537 section->tpl->added_tail = &section->tpl->added_head;
538
539 /* Clear this section */
540 tpl_reset(section->tpl);
541 }
542}
543
544
545/* Set up the selected section pointer to correspond to

Callers

nothing calls this directly

Calls 1

destroy_nodeFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…