Recursively clear added content */
| 509 | |
| 510 | /* Recursively clear added content */ |
| 511 | void 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 = §ion->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 |
nothing calls this directly
no test coverage detected
searching dependent graphs…