make syllable chain doubly-linked
This commit is contained in:
parent
b187c13cbc
commit
7fdbf8ada8
2 changed files with 3 additions and 0 deletions
|
@ -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;
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
|
||||
struct syllable {
|
||||
char *data;
|
||||
struct syllable *prev;
|
||||
struct syllable *next;
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue