Add a function to calculate the length of a NULL-terminated string array.

Thu Sep  9 00:10:40 2004  Matthias Clasen  <maclas@gmx.de>

	* glib/gstrfuncs.h:
	* glib/gstrfuncs.c (g_strv_length): Add a function to
	calculate the length of a NULL-terminated string
	array.  (#150455, Tim-Philipp Müller)

	* tests/strfunc-test.c (main): Add a test for g_strv_length().
This commit is contained in:
Matthias Clasen
2004-09-09 04:12:19 +00:00
committed by Matthias Clasen
parent cbadee0812
commit 6ec4724399
10 changed files with 79 additions and 0 deletions

View File

@@ -551,5 +551,7 @@ main (int argc,
TEST (NULL, 9 == g_snprintf (buf, 5, "%s", "abcdefghi"));
}
TEST (NULL, g_strv_length (g_strsplit ("1,2,3,4", ",", -1)) == 4);
return any_failed;
}