Fix new strfuncs back up (again) - No, incrementing pointers in a loop is

Fix new strfuncs back up (again)
	- No, incrementing pointers in a loop is not any faster than
	  indexing an array in a loop with a good compiler, but it is
	  harder to read.
	- strconcat doesn't allow a separator - added g_str_array_join,
	  renamed g_str_array_join to g_str_array_joinv
	- join routines take separator as first argument, as is customary.
This commit is contained in:
Elliot Lee
1998-10-21 20:14:16 +00:00
parent 634e4a58c6
commit daf46f9550
4 changed files with 158 additions and 46 deletions

8
glib.h
View File

@@ -1377,15 +1377,17 @@ gchar* g_strconcat (const gchar *string1,
/* NULL terminated string arrays.
* g_str_array_split() splits up string into max_tokens tokens at delim and
* returns a newly allocated string array.
* g_str_array_join() concatenates all of str_array's strings, sliding in an
* g_str_array_joinv() concatenates all of str_array's strings, sliding in an
* optional separator, the returned string is newly allocated.
* g_str_array_free() frees the array itself and all of its strings.
*/
gchar** g_str_array_split (const gchar *string,
const gchar *delimiter,
gint max_tokens);
gchar* g_str_array_join (gchar **str_array,
const gchar *separator);
gchar* g_str_array_joinv (const gchar *separator,
const gchar **str_array);
gchar* g_str_array_join (const gchar *separator,
...);
void g_str_array_free (gchar **str_array);