66 lines
998 B
C
66 lines
998 B
C
|
|
#include <assert.h>
|
|
|
|
#include <debug.h>
|
|
|
|
#include <string/struct.h>
|
|
|
|
#include "struct.h"
|
|
#include "print.h"
|
|
|
|
void stringtree_print(
|
|
const struct stringtree* this,
|
|
FILE* stream)
|
|
{
|
|
ENTER;
|
|
|
|
for (struct child* child = this->head; child; child = child->next)
|
|
{
|
|
switch (child->kind)
|
|
{
|
|
case ck_cstr:
|
|
{
|
|
fputs(child->cstr, stream);
|
|
|
|
break;
|
|
}
|
|
|
|
case ck_string:
|
|
{
|
|
fputs((void*) child->string->data, stream);
|
|
|
|
break;
|
|
}
|
|
|
|
case ck_stringtree:
|
|
{
|
|
stringtree_print(
|
|
/* subtree: */ child->stringtree,
|
|
/* stream: */ stream);
|
|
|
|
break;
|
|
}
|
|
|
|
default:
|
|
TODO;
|
|
break;
|
|
}
|
|
}
|
|
|
|
EXIT;
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|