Files
cKit/Foundation/c_StringList.h
T

31 lines
1.0 KiB
C
Raw Normal View History

2026-08-29 01:50:50 +08:00
#ifndef INCLUDED_C_STRINGLIST_H
#define INCLUDED_C_STRINGLIST_H
#ifndef INCLUDED_C_TYPES_H
#include <c_Types.h>
#endif /*INCLUDED_C_TYPES_H*/
/* ------------------------------------------------------------------------------------------------------------------ */
/* */
typedef struct {
char** strings; // Dynamic array of self-owned null-terminated strings
c_size_t size; // Current active string rows stored
c_size_t capacity; // Max allocated capacity bounds of the internal pointer matrix
} c_StringList;
/* ------------------------------------------------------------------------------------------------------------------ */
/* */
c_err_t c_StringList_Init(c_StringList* list, c_size_t initial_capacity);
void c_StringList_Destroy(c_StringList* list);
c_err_t c_StringList_Append(c_StringList* list, const char* str);
c_err_t c_StringList_Prepend(c_StringList* list, const char* str);
c_err_t c_StringList_Remove(c_StringList* list, const char* str);
#endif /*INCLUDED_C_STRINGLIST_H*/