88 }
else if (!
psv->vec) {
113 if (
size == (
size_t) -1) {
169 for (
i = 0, p =
psv->vec;
i <
psv->size;
i++, p++) {
181 int (*
cmp_func) (
const char *,
const char *))
186 if (!
psv->vec || 1 ==
psv->size) {
190 for (
i = 1;
i <
psv->size;
i++) {
192 for (j = 0; j <
i; j++) {
217 for (
i = 0;
i <
psv->size;) {
226 if (
str[0] ==
'\0') {
250 for (
i = 0, p = dest->
vec,
l = src->
vec;
i < dest->
size;
i++, p++,
l++) {
260 const char *
const *))
263 (
int (*) (
const void *,
const void *)) sort_func);
326 if (
psv->size == 1) {
335 psv->vec[
psv->size - 1] =
nullptr;
375 return (
const char **)
psv->vec;
const char * astr_build_or_list(struct astring *astr, const char *const *items, size_t number)
const char * astr_build_and_list(struct astring *astr, const char *const *items, size_t number)
static gint cmp_func(gconstpointer a_p, gconstpointer b_p)
#define fc_calloc(n, esz)
#define fc_realloc(ptr, sz)
void remove_leading_trailing_spaces(char *s)
void strvec_destroy(struct strvec *psv)
void strvec_sort(struct strvec *psv, int(*sort_func)(const char *const *, const char *const *))
void strvec_to_str(const struct strvec *psv, char separator, char *buf, size_t buf_len)
bool strvec_set(struct strvec *psv, size_t svindex, const char *string)
bool strvec_index_valid(const struct strvec *psv, size_t svindex)
const char *const * strvec_data(const struct strvec *psv)
void strvec_store(struct strvec *psv, const char *const *vec, size_t size)
static void string_free(char *string)
void strvec_append(struct strvec *psv, const char *string)
void strvec_from_str(struct strvec *psv, char separator, const char *str)
void strvec_reserve(struct strvec *psv, size_t reserve)
const char * strvec_to_or_list(const struct strvec *psv, struct astring *astr)
static char * string_duplicate(const char *string)
const char * strvec_get(const struct strvec *psv, size_t svindex)
void strvec_prepend(struct strvec *psv, const char *string)
void strvec_copy(struct strvec *dest, const struct strvec *src)
struct strvec * strvec_new(void)
void strvec_clear(struct strvec *psv)
size_t strvec_size(const struct strvec *psv)
const char * strvec_to_and_list(const struct strvec *psv, struct astring *astr)
void strvec_remove_duplicate(struct strvec *psv, int(*cmp_func)(const char *, const char *))
bool are_strvecs_equal(const struct strvec *stv1, const struct strvec *stv2)
bool strvec_remove(struct strvec *psv, size_t svindex)
void strvec_remove_empty(struct strvec *psv)
void strvec_insert(struct strvec *psv, size_t svindex, const char *string)
#define strvec_iterate(psv, str)
#define strvec_iterate_end
int fc_snprintf(char *str, size_t n, const char *format,...)