qsort (sa->strings, sa->n, sizeof *sa->strings, compare_strings);
}
+/* Divides STRING into tokens at DELIMITERS and adds each token to SA. */
+void
+string_array_parse (struct string_array *sa, struct substring string,
+ struct substring delimiters)
+{
+ size_t save_idx = 0;
+ struct substring token;
+ while (ss_tokenize (string, delimiters, &save_idx, &token))
+ string_array_append_nocopy (sa, ss_xstrdup (token));
+}
+
/* Returns a single string that consists of each of the strings in SA
concatenated, separated from each other with SEPARATOR.
#include <stdbool.h>
#include <stddef.h>
+#include "libpspp/str.h"
/* An unordered array of strings.
void string_array_sort (struct string_array *);
+void string_array_parse (struct string_array *, struct substring string,
+ struct substring delimiters);
char *string_array_join (const struct string_array *, const char *separator);
/* Macros for conveniently iterating through a string_array, e.g. to print all