From 6e47268c14ef1285fb8c9f4d2d3748c2bd84335f Mon Sep 17 00:00:00 2001 From: Owen Taylor Date: Thu, 29 Jun 2000 20:09:36 +0000 Subject: updated Thu Jun 29 15:57:28 2000 Owen Taylor * NEWS: updated * Makefile.am: added snapcheck target to go along with snapshot * gstring.c glib.h (g_string_hash): Add g_string_hash to go along with g_string_equal. Tue Jun 27 12:40:23 EDT 2000 David A. Wheeler * glib.h: Added g_string_equal for comparing GStrings; changed g_str_equal so it returns gboolean (instead of gint). * gstring.c: Modified GString implementation to support embedded ASCII NUL ('\0') characters, and implemented g_string_equal. * testglib.c tests/string-test.c: Added tests for g_string_equal and tests for proper handling of embedded ASCII NUL characters. --- glib.h | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'glib.h') diff --git a/glib.h b/glib.h index 7baeb485f..c894690f7 100644 --- a/glib.h +++ b/glib.h @@ -1865,6 +1865,9 @@ GString* g_string_new (const gchar *init); GString* g_string_sized_new (guint dfl_size); void g_string_free (GString *string, gboolean free_segment); +gboolean g_string_equal (const GString *v, + const GString *v2); +guint g_string_hash (const GString *str); GString* g_string_assign (GString *string, const gchar *rval); GString* g_string_truncate (GString *string, @@ -1989,13 +1992,13 @@ GByteArray* g_byte_array_remove_index_fast (GByteArray *array, /* Hash Functions */ -gint g_str_equal (gconstpointer v, - gconstpointer v2); -guint g_str_hash (gconstpointer v); +gboolean g_str_equal (gconstpointer v, + gconstpointer v2); +guint g_str_hash (gconstpointer v); -gint g_int_equal (gconstpointer v, - gconstpointer v2); -guint g_int_hash (gconstpointer v); +gint g_int_equal (gconstpointer v, + gconstpointer v2); +guint g_int_hash (gconstpointer v); /* This "hash" function will just return the key's adress as an * unsigned integer. Useful for hashing on plain adresses or -- cgit v1.2.3-70-g09d2