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;
|
return NULL;
|
||||||
|
|
||||||
ptr->data = strdup(data);
|
ptr->data = strdup(data);
|
||||||
|
ptr->prev = NULL;
|
||||||
ptr->next = NULL;
|
ptr->next = NULL;
|
||||||
|
|
||||||
return ptr;
|
return ptr;
|
||||||
|
@ -28,6 +29,7 @@ struct syllable *syllable_append(struct syllable *tail, const char *data)
|
||||||
struct syllable *ptr;
|
struct syllable *ptr;
|
||||||
|
|
||||||
ptr = syllable_alloc(data);
|
ptr = syllable_alloc(data);
|
||||||
|
ptr->prev = tail;
|
||||||
tail->next = ptr;
|
tail->next = ptr;
|
||||||
|
|
||||||
return ptr;
|
return ptr;
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
|
|
||||||
struct syllable {
|
struct syllable {
|
||||||
char *data;
|
char *data;
|
||||||
|
struct syllable *prev;
|
||||||
struct syllable *next;
|
struct syllable *next;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue