make syllable chain doubly-linked

This commit is contained in:
Vlasta Vesely 2018-04-29 08:42:11 +02:00
parent b187c13cbc
commit 7fdbf8ada8
2 changed files with 3 additions and 0 deletions

View file

@ -13,6 +13,7 @@ struct syllable *syllable_alloc(const char *data)
return NULL;
ptr->data = strdup(data);
ptr->prev = NULL;
ptr->next = NULL;
return ptr;
@ -28,6 +29,7 @@ struct syllable *syllable_append(struct syllable *tail, const char *data)
struct syllable *ptr;
ptr = syllable_alloc(data);
ptr->prev = tail;
tail->next = ptr;
return ptr;

View file

@ -5,6 +5,7 @@
struct syllable {
char *data;
struct syllable *prev;
struct syllable *next;
};