Thu, 15 Sep 2011 13:38:03 +0200
Merge with 1dd63a32ffc486b71399045cf8443ec6ac9d7bf5
10 | 1 | /* |
2 | * suffix_list.c | |
3 | * | |
4 | * Created on: 15.09.2011 | |
5 | * Author: beckermi | |
6 | */ | |
7 | ||
8 | #include "suffix_list.h" | |
9 | ||
10 | suffix_list_t* new_suffix_list_t() { | |
11
06cbd0ec003d
Merge with 1dd63a32ffc486b71399045cf8443ec6ac9d7bf5
Mike Becker <universe@uap-core.de>
parents:
10
diff
changeset
|
11 | suffix_list_t* suffixList = malloc(sizeof(suffix_list_t)); |
10 | 12 | suffixList->count = 0; |
13 | suffixList->items = NULL; | |
14 | ||
15 | return suffixList; | |
16 | } | |
17 | ||
18 | void add_suffix(suffix_list_t* list, char* item) { | |
19 | char** reallocated_list = | |
11
06cbd0ec003d
Merge with 1dd63a32ffc486b71399045cf8443ec6ac9d7bf5
Mike Becker <universe@uap-core.de>
parents:
10
diff
changeset
|
20 | realloc(list->items, sizeof(char*) * list->count + 1); |
10 | 21 | if (reallocated_list != NULL) { |
22 | list->items = reallocated_list; | |
23 | list->items[list->count] = item; | |
24 | list->count++; | |
25 | } | |
26 | } | |
27 |