mirror of
https://github.com/gnif/LookingGlass.git
synced 2024-11-25 23:07:18 +00:00
[common] stringlist: implement item removal
This commit is contained in:
parent
f0beedb5ba
commit
e11246d46e
@ -28,6 +28,7 @@ typedef struct StringList * StringList;
|
|||||||
StringList stringlist_new (bool owns_strings);
|
StringList stringlist_new (bool owns_strings);
|
||||||
void stringlist_free (StringList * sl);
|
void stringlist_free (StringList * sl);
|
||||||
int stringlist_push (StringList sl, char * str);
|
int stringlist_push (StringList sl, char * str);
|
||||||
|
void stringlist_remove(StringList sl, unsigned int index);
|
||||||
unsigned int stringlist_count (StringList sl);
|
unsigned int stringlist_count (StringList sl);
|
||||||
char * stringlist_at (StringList sl, unsigned int index);
|
char * stringlist_at (StringList sl, unsigned int index);
|
||||||
|
|
||||||
|
@ -63,6 +63,11 @@ int stringlist_push(StringList sl, char * str)
|
|||||||
return index;
|
return index;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void stringlist_remove(StringList sl, unsigned int index)
|
||||||
|
{
|
||||||
|
vector_remove(&sl->vector, index);
|
||||||
|
}
|
||||||
|
|
||||||
unsigned int stringlist_count(StringList sl)
|
unsigned int stringlist_count(StringList sl)
|
||||||
{
|
{
|
||||||
return vector_size(&sl->vector);
|
return vector_size(&sl->vector);
|
||||||
|
Loading…
Reference in New Issue
Block a user