#include #include #include #include #include "struct.h" #include "free.h" void free_stringtree( struct stringtree* this) { ENTER; if (this && !--this->refcount) { struct child* c = this->head; struct child* n = c->next; for (; c; c = n) { n = c->next; switch (c->kind) { case ck_cstr: { break; } case ck_string: { free_string(c->string); break; } case ck_stringtree: { free_stringtree(c->stringtree); break; } default: TODO; break; } free(c); } free(this); } EXIT; }