lisp-take-1/stringtree/prepend.c

38 lines
552 B
C

#include <assert.h>
#include <debug.h>
#include <memory/smalloc.h>
#include "struct.h"
#include "prepend.h"
void stringtree_prepend_string_const(
struct stringtree* this,
const char* cstr)
{
ENTER;
struct child* new = smalloc(sizeof(*new));
new->kind = ck_cstr;
new->cstr = cstr;
new->prev = NULL;
new->next = NULL;
if (this->head)
{
new->next = this->head;
this->head->prev = new;
this->head = new;
}
else
{
TODO;
}
EXIT;
}