]> git.sur5r.net Git - glabels/blob - glabels2/libglabels/str.c
2007-11-18 Jim Evins <evins@snaught.com>
[glabels] / glabels2 / libglabels / str.c
1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
2
3 /*
4  *  (LIBGLABELS) Template library for GLABELS
5  *
6  *  str.c:  libGLabels string utilities
7  *
8  *  Copyright (C) 2007  Jim Evins <evins@snaught.com>.
9  *
10  *  This file is part of the LIBGLABELS library.
11  *
12  *  This library is free software; you can redistribute it and/or
13  *  modify it under the terms of the GNU Library General Public
14  *  License as published by the Free Software Foundation; either
15  *  version 2 of the License, or (at your option) any later version.
16  *
17  *  This library is distributed in the hope that it will be useful,
18  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
19  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
20  *  Library General Public License for more details.
21  *
22  *  You should have received a copy of the GNU Library General Public
23  *  License along with this library; if not, write to the Free
24  *  Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
25  *  MA 02111-1307, USA
26  */
27 #include <config.h>
28
29 #include "str.h"
30
31
32 /*===========================================*/
33 /* Private types                             */
34 /*===========================================*/
35
36
37 /*===========================================*/
38 /* Private globals                           */
39 /*===========================================*/
40
41
42 /*===========================================*/
43 /* Local function prototypes                 */
44 /*===========================================*/
45
46
47 /*===========================================*/
48 /* Functions.                                */
49 /*===========================================*/
50
51 gint
52 lgl_str_utf8_casecmp (const gchar *s1,
53                       const gchar *s2)
54 {
55         gchar *folded_s1;
56         gchar *folded_s2;
57         gint   result;
58
59         folded_s1 = g_utf8_casefold (s1, -1);
60         folded_s2 = g_utf8_casefold (s2, -1);
61
62         result = g_utf8_collate (folded_s1, folded_s2);
63
64         g_free (folded_s1);
65         g_free (folded_s2);
66
67         return result;
68 }
69
70