fix error return value while loading environment
[barebox-mini2440.git] / include / stringlist.h
blob3453e9a4f6ce548dc9d2da0824cc7456378c13a9
1 #ifndef __STRING_H
2 #define __STRING_H
4 #include <linux/list.h>
6 struct string_list {
7 struct list_head list;
8 char str[0];
9 };
11 int string_list_add(struct string_list *sl, char *str);
12 void string_list_print_by_column(struct string_list *sl);
14 static inline void string_list_init(struct string_list *sl)
16 INIT_LIST_HEAD(&sl->list);
19 static inline void string_list_free(struct string_list *sl)
21 struct string_list *entry, *safe;
23 list_for_each_entry_safe(entry, safe, &sl->list, list)
24 free(entry);
27 #endif /* __STRING_H */