GnuCash  2.6.99
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
gnc-glib-utils.h
Go to the documentation of this file.
1 /********************************************************************\
2  * gnc-glib-utils.c -- utility functions based on glib functions *
3  * Copyright (C) 2006 David Hampton <[email protected]> *
4  * *
5  * This program is free software; you can redistribute it and/or *
6  * modify it under the terms of the GNU General Public License as *
7  * published by the Free Software Foundation; either version 2 of *
8  * the License, or (at your option) any later version. *
9  * *
10  * This program is distributed in the hope that it will be useful, *
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13  * GNU General Public License for more details. *
14  * *
15  * You should have received a copy of the GNU General Public License*
16  * along with this program; if not, contact: *
17  * *
18  * Free Software Foundation Voice: +1-617-542-5942 *
19  * 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652 *
20  * Boston, MA 02110-1301, USA [email protected] *
21  * *
22 \********************************************************************/
23 
37 #ifndef GNC_GLIB_UTILS_H
38 #define GNC_GLIB_UTILS_H
39 
40 #include <glib.h>
41 
56 int safe_utf8_collate (const char *str1, const char *str2);
57 
84 gboolean gnc_utf8_validate(const gchar *str, gssize max_len, const gchar **end);
85 
95 void gnc_utf8_strip_invalid (gchar *str);
96 
109 gchar *gnc_utf8_strip_invalid_strdup (const gchar* str);
110 
123 gchar *gnc_locale_from_utf8(const gchar* str);
124 
137 gchar *gnc_locale_to_utf8(const gchar* str);
138 
144 typedef gpointer (*GncGMapFunc)(gpointer data, gpointer user_data);
145 
149 GList* gnc_g_list_map(GList* list, GncGMapFunc fn, gpointer user_data);
150 
156 void gnc_g_list_cut(GList **list, GList *cut_point);
157 
163 void gnc_scm_log_warn(const gchar *msg);
164 void gnc_scm_log_error(const gchar *msg);
165 void gnc_scm_log_msg(const gchar *msg);
166 void gnc_scm_log_debug(const gchar *msg);
167 
177 void gnc_gpid_kill(GPid pid);
178 
181 #endif /* GNC_GLIB_UTILS_H */
182 
GList * gnc_g_list_map(GList *list, GncGMapFunc fn, gpointer user_data)
int safe_utf8_collate(const char *str1, const char *str2)
gchar * gnc_locale_from_utf8(const gchar *str)
Converts a string from UTF-8 to the encoding used for strings in the current locale.
gboolean gnc_utf8_validate(const gchar *str, gssize max_len, const gchar **end)
Validates UTF-8 encoded text for use in GnuCash.
void gnc_g_list_cut(GList **list, GList *cut_point)
void gnc_utf8_strip_invalid(gchar *str)
gchar * gnc_locale_to_utf8(const gchar *str)
Converts a string to UTF-8 from the encoding used for strings in the current locale.
void gnc_gpid_kill(GPid pid)
gchar * gnc_utf8_strip_invalid_strdup(const gchar *str)