gconvert.h

Go to the documentation of this file.
00001 /* GLIB - Library of useful routines for C programming
00002  * Copyright (C) 1995-1997  Peter Mattis, Spencer Kimball and Josh MacDonald
00003  *
00004  * This library is free software; you can redistribute it and/or
00005  * modify it under the terms of the GNU Lesser General Public
00006  * License as published by the Free Software Foundation; either
00007  * version 2 of the License, or (at your option) any later version.
00008  *
00009  * This library is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012  * Lesser General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU Lesser General Public
00015  * License along with this library; if not, write to the
00016  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
00017  * Boston, MA 02111-1307, USA.
00018  */
00019 
00020 /*
00021  * Modified by the GLib Team and others 1997-2000.  See the AUTHORS
00022  * file for a list of people on the GLib Team.  See the ChangeLog
00023  * files for a list of changes.  These files are distributed with
00024  * GLib at ftp://ftp.gtk.org/pub/gtk/. 
00025  */
00026 
00027 #ifndef __G_CONVERT_H__
00028 #define __G_CONVERT_H__
00029 
00030 #include <stddef.h>      /* For size_t */
00031 #include <gerror.h>
00032 
00033 G_BEGIN_DECLS
00034 
00035 typedef enum 
00036 {
00037   G_CONVERT_ERROR_NO_CONVERSION,
00038   G_CONVERT_ERROR_ILLEGAL_SEQUENCE,
00039   G_CONVERT_ERROR_FAILED,
00040   G_CONVERT_ERROR_PARTIAL_INPUT
00041 } GConvertError;
00042 
00043 #define G_CONVERT_ERROR g_convert_error_quark()
00044 GQuark g_convert_error_quark();
00045 
00046 /* Thin wrappers around iconv
00047  */
00048 typedef struct _GIConv *GIConv;
00049 
00050 GIConv g_iconv_open   (const gchar  *to_codeset,
00051                        const gchar  *from_codeset);
00052 size_t g_iconv        (GIConv        converter,
00053                        gchar       **inbuf,
00054                        size_t       *inbytes_left,
00055                        gchar       **outbuf,
00056                        size_t       *outbytes_left);
00057 gint   g_iconv_close  (GIConv        converter);
00058 
00059 
00060 gchar* g_convert               (const gchar  *str,
00061                                 gint          len,
00062                                 const gchar  *to_codeset,
00063                                 const gchar  *from_codeset,
00064                                 gint         *bytes_read,
00065                                 gint         *bytes_written,
00066                                 GError      **error);
00067 gchar* g_convert_with_fallback (const gchar  *str,
00068                                 gint          len,
00069                                 const gchar  *to_codeset,
00070                                 const gchar  *from_codeset,
00071                                 gchar        *fallback,
00072                                 gint         *bytes_read,
00073                                 gint         *bytes_written,
00074                                 GError      **error);
00075 
00076 
00077 /* Convert between libc's idea of strings and UTF-8.
00078  */
00079 gchar*   g_locale_to_utf8 (const gchar *opsysstring, GError **error);
00080 gchar*   g_locale_from_utf8 (const gchar *utf8string, GError **error);
00081 
00082 /* Convert between the operating system (or C runtime)
00083  * representation of file names and UTF-8.
00084  */
00085 gchar*   g_filename_to_utf8 (const gchar *opsysstring, GError **error);
00086 gchar*   g_filename_from_utf8 (const gchar *utf8string, GError **error);
00087 
00088 G_END_DECLS
00089 
00090 #endif /* __G_CONVERT_H__ */

Generated on Tue Jul 5 14:14:41 2011 for ROOT_528-00b_version by  doxygen 1.5.1