Commit f5f93181 authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer
Browse files

renamed newly added functions to gimp_environ_table_str_hash() and

2007-02-09  Michael Natterer  <mitch@gimp.org>

	* app/plug-in/gimpenvirontable.c: renamed newly added functions to
	gimp_environ_table_str_hash() and gimp_environ_table_str_equal()
	and always use them. Move the #ifdef G_OS_WIN32 inside the
	functions.


svn path=/trunk/; revision=21884
parent 822065c0
2007-02-09 Michael Natterer <mitch@gimp.org>
* app/plug-in/gimpenvirontable.c: renamed newly added functions to
gimp_environ_table_str_hash() and gimp_environ_table_str_equal()
and always use them. Move the #ifdef G_OS_WIN32 inside the
functions.
2007-02-09 Tor Lillqvist <tml@novell.com>
 
* app/plug-in/gimpenvirontable.c
......@@ -104,34 +104,38 @@ gimp_environ_table_new (void)
return g_object_new (GIMP_TYPE_ENVIRON_TABLE, NULL);
}
#ifdef G_OS_WIN32
static guint
gimp_environ_table_case_insensitive_hash (gconstpointer v)
gimp_environ_table_str_hash (gconstpointer v)
{
gchar *p = g_ascii_strup ((const gchar *) v, -1);
guint retval = g_str_hash (p);
#ifdef G_OS_WIN32
gchar *p = g_ascii_strup ((const gchar *) v, -1);
guint retval = g_str_hash (p);
g_free (p);
return retval;
#else
return g_str_hash (v);
#endif
}
static gboolean
gimp_environ_table_case_insensitive_equal (gconstpointer v1,
gconstpointer v2)
gimp_environ_table_str_equal (gconstpointer v1,
gconstpointer v2)
{
gchar *string1 = g_ascii_strup ((const gchar *) v1, -1);
gchar *string2 = g_ascii_strup ((const gchar *) v2, -1);
gboolean retval = g_str_equal (string1, string2);
#ifdef G_OS_WIN32
gchar *string1 = g_ascii_strup ((const gchar *) v1, -1);
gchar *string2 = g_ascii_strup ((const gchar *) v2, -1);
gboolean retval = g_str_equal (string1, string2);
g_free (string1);
g_free (string2);
return retval;
}
return retval;
#else
return g_str_equal (v1, v2);
#endif
}
void
gimp_environ_table_load (GimpEnvironTable *environ_table,
......@@ -141,16 +145,10 @@ gimp_environ_table_load (GimpEnvironTable *environ_table,
gimp_environ_table_clear (environ_table);
#ifndef G_OS_WIN32
environ_table->vars =
g_hash_table_new_full (g_str_hash, g_str_equal,
g_hash_table_new_full (gimp_environ_table_str_hash,
gimp_environ_table_str_equal,
g_free, gimp_environ_table_free_value);
#else
environ_table->vars =
g_hash_table_new_full (gimp_environ_table_case_insensitive_hash,
gimp_environ_table_case_insensitive_equal,
g_free, gimp_environ_table_free_value);
#endif
gimp_datafiles_read_directories (env_path,
G_FILE_TEST_EXISTS,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment