diff --git a/src/xpdev/str_list.c b/src/xpdev/str_list.c index d28aa297ea5adbe78daff30e558f89a27bb9ff19..87f2539c3ef21b05e7115ac9181b2b8e9ab34840 100644 --- a/src/xpdev/str_list.c +++ b/src/xpdev/str_list.c @@ -197,6 +197,15 @@ bool strListFastDelete(str_list_t list, size_t index, size_t count) return strListFastRemove(list, index, count); } +void strListFastDeleteAll(str_list_t list) +{ + size_t i; + + for(i = 0; list[i] != NULL; ++i) + free(list[i]); + list[0] = NULL; +} + char* strListReplace(const str_list_t list, size_t index, const char* str) { char* buf; diff --git a/src/xpdev/str_list.h b/src/xpdev/str_list.h index f601cc8245b48d6ef6b73ac7e2e488b788c9e0f9..668c1e2c240a352784dbf9a11bd097f7ed6bf429 100644 --- a/src/xpdev/str_list.h +++ b/src/xpdev/str_list.h @@ -78,6 +78,7 @@ DLLEXPORT bool strListFastRemove(str_list_t, size_t index, size_t count); /* Remove and free a string at a specific index */ DLLEXPORT bool strListDelete(str_list_t*, size_t index); DLLEXPORT bool strListFastDelete(str_list_t, size_t index, size_t count); +DLLEXPORT void strListFastDeleteAll(str_list_t); /* Replace a string at a specific index */ DLLEXPORT char* strListReplace(const str_list_t, size_t index, const char* str);