diff options
Diffstat (limited to 'e-util')
-rw-r--r-- | e-util/e-util.c | 31 | ||||
-rw-r--r-- | e-util/e-util.h | 2 |
2 files changed, 24 insertions, 9 deletions
diff --git a/e-util/e-util.c b/e-util/e-util.c index c425050c4e..6c50331011 100644 --- a/e-util/e-util.c +++ b/e-util/e-util.c @@ -45,27 +45,40 @@ #endif int -g_str_compare(const void *x, const void *y) +g_str_compare (const void *x, const void *y) { if (x == NULL || y == NULL) { if (x == y) return 0; else return x ? -1 : 1; - } + } + + return strcmp (x, y); +} +int +g_collate_compare (const void *x, const void *y) +{ + if (x == NULL || y == NULL) { + if (x == y) + return 0; + else + return x ? -1 : 1; + } + return g_utf8_collate (x, y); } int -g_int_compare(const void *x, const void *y) +g_int_compare (const void *x, const void *y) { - if ( GPOINTER_TO_INT(x) < GPOINTER_TO_INT(y) ) - return -1; - else if ( GPOINTER_TO_INT(x) == GPOINTER_TO_INT(y) ) - return 0; - else - return 1; + if (GPOINTER_TO_INT (x) < GPOINTER_TO_INT (y)) + return -1; + else if (GPOINTER_TO_INT (x) == GPOINTER_TO_INT (y)) + return 0; + else + return 1; } char * diff --git a/e-util/e-util.h b/e-util/e-util.h index 1d5850ccf2..2937265f6b 100644 --- a/e-util/e-util.h +++ b/e-util/e-util.h @@ -139,6 +139,8 @@ typedef enum { } EFocus; int g_str_compare (const void *x, const void *y); +int g_collate_compare (const void *x, + const void *y); int g_int_compare (const void *x, const void *y); char *e_strdup_strip (const char *string); |