size_t size;
};
+static int sort_callback (const void *v0, const void *v1) /* {{{ */
+{
+ const char *c0 = v0;
+ const char *c1 = v1;
+
+ return (strcmp (c0, c1));
+} /* }}} int sort_callback */
+
str_array_t *array_create (void) /* {{{ */
{
str_array_t *a;
return (array_append (a, buffer));
} /* }}} int array_append_format */
+int array_sort (str_array_t *a) /* {{{ */
+{
+ if (a == NULL)
+ return (EINVAL);
+
+ qsort (a->ptr, a->size, sizeof (*a->ptr), sort_callback);
+
+ return (0);
+} /* }}} int array_sort */
+
int array_argc (str_array_t *a) /* {{{ */
{
if (a == NULL)
int array_append_format (str_array_t *a, const char *format, ...)
__attribute__((format(printf,2,3)));
+int array_sort (str_array_t *a);
+
int array_argc (str_array_t *);
char **array_argv (str_array_t *);