diff options
author | John Beppu <beppu@lbox.org> | 1999-12-22 20:57:31 +0300 |
---|---|---|
committer | John Beppu <beppu@lbox.org> | 1999-12-22 20:57:31 +0300 |
commit | 019513a59ffd966cca51d6616757295a46869e4a (patch) | |
tree | 5d03c4e7c4ba676fef529c52a4a55c46e246259e /sort.c | |
parent | 38efa7902e7d266fbc78e1d39780ca0866d98dad (diff) |
added hooks for sort
Diffstat (limited to 'sort.c')
-rw-r--r-- | sort.c | 24 |
1 files changed, 22 insertions, 2 deletions
@@ -90,6 +90,17 @@ line_newFromFile(FILE *src) return NULL; } +/* Line destructor */ +static Line * +line_release(Line *self) +{ + if (self->data) { + free(self->data); + free(self); + } + return self; +} + /* Comparison */ @@ -148,7 +159,16 @@ list_writeToFile(List *self, FILE* dst) static List * list_release(List *self) { - return self; + Line *i; + Line *die; + + i = self->head; + while (i) { + die = i; + i = die->next; + line_delete(die); + } + return self; /* bad poetry? */ } @@ -195,4 +215,4 @@ sort_main(int argc, char **argv) exit(0); } -/* $Id: sort.c,v 1.2 1999/12/22 00:30:29 beppu Exp $ */ +/* $Id: sort.c,v 1.3 1999/12/22 17:57:31 beppu Exp $ */ |