+ oldstrings = list->strings;
+ list->maxstrings += 4096;
+ list->strings = Z_Malloc(list->maxstrings * sizeof(*list->strings));
+ if (list->numstrings)
+ memcpy(list->strings, oldstrings, list->numstrings * sizeof(*list->strings));
+ if (oldstrings)
+ Z_Free(oldstrings);
+ }
+ textlen = strlen(text) + 1;
+ list->strings[list->numstrings] = Z_Malloc(textlen);
+ memcpy(list->strings[list->numstrings], text, textlen);
+ list->numstrings++;
+}
+
+void stringlistsort(stringlist_t *list)
+{
+ int i, j;
+ char *temp;
+ // this is a selection sort (finds the best entry for each slot)
+ for (i = 0;i < list->numstrings - 1;i++)
+ {
+ for (j = i + 1;j < list->numstrings;j++)