00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #ifndef __G_CONVERT_H__
00029 #define __G_CONVERT_H__
00030
00031 #include <_ansi.h>
00032 #include <stddef.h>
00033 #include <glib/gerror.h>
00034
00035 G_BEGIN_DECLS
00036
00037 typedef enum
00038 {
00039 G_CONVERT_ERROR_NO_CONVERSION,
00040 G_CONVERT_ERROR_ILLEGAL_SEQUENCE,
00041 G_CONVERT_ERROR_FAILED,
00042 G_CONVERT_ERROR_PARTIAL_INPUT,
00043 G_CONVERT_ERROR_BAD_URI,
00044 G_CONVERT_ERROR_NOT_ABSOLUTE_PATH
00045 } GConvertError;
00046
00047 #define G_CONVERT_ERROR g_convert_error_quark()
00048 IMPORT_C GQuark g_convert_error_quark (void);
00049
00050
00051
00052 typedef struct _GIConv *GIConv;
00053
00054 IMPORT_C GIConv g_iconv_open (const gchar *to_codeset,
00055 const gchar *from_codeset);
00056 IMPORT_C size_t g_iconv (GIConv converter,
00057 gchar **inbuf,
00058 gsize *inbytes_left,
00059 gchar **outbuf,
00060 gsize *outbytes_left);
00061 IMPORT_C gint g_iconv_close (GIConv converter);
00062
00063
00064 IMPORT_C gchar* g_convert (const gchar *str,
00065 gssize len,
00066 const gchar *to_codeset,
00067 const gchar *from_codeset,
00068 gsize *bytes_read,
00069 gsize *bytes_written,
00070 GError **error) G_GNUC_MALLOC;
00071 IMPORT_C gchar* g_convert_with_iconv (const gchar *str,
00072 gssize len,
00073 GIConv converter,
00074 gsize *bytes_read,
00075 gsize *bytes_written,
00076 GError **error) G_GNUC_MALLOC;
00077 IMPORT_C gchar* g_convert_with_fallback (const gchar *str,
00078 gssize len,
00079 const gchar *to_codeset,
00080 const gchar *from_codeset,
00081 gchar *fallback,
00082 gsize *bytes_read,
00083 gsize *bytes_written,
00084 GError **error) G_GNUC_MALLOC;
00085
00086
00087
00088
00089 IMPORT_C gchar* g_locale_to_utf8 (const gchar *opsysstring,
00090 gssize len,
00091 gsize *bytes_read,
00092 gsize *bytes_written,
00093 GError **error) G_GNUC_MALLOC;
00094 IMPORT_C gchar* g_locale_from_utf8 (const gchar *utf8string,
00095 gssize len,
00096 gsize *bytes_read,
00097 gsize *bytes_written,
00098 GError **error) G_GNUC_MALLOC;
00099
00100
00101
00102
00103 #ifdef G_OS_WIN32
00104 #define g_filename_to_utf8 g_filename_to_utf8_utf8
00105 #define g_filename_from_utf8 g_filename_from_utf8_utf8
00106 #define g_filename_from_uri g_filename_from_uri_utf8
00107 #define g_filename_to_uri g_filename_to_uri_utf8
00108 #endif
00109
00110 IMPORT_C gchar* g_filename_to_utf8 (const gchar *opsysstring,
00111 gssize len,
00112 gsize *bytes_read,
00113 gsize *bytes_written,
00114 GError **error) G_GNUC_MALLOC;
00115 IMPORT_C gchar* g_filename_from_utf8 (const gchar *utf8string,
00116 gssize len,
00117 gsize *bytes_read,
00118 gsize *bytes_written,
00119 GError **error) G_GNUC_MALLOC;
00120
00121 IMPORT_C gchar *g_filename_from_uri (const gchar *uri,
00122 gchar **hostname,
00123 GError **error) G_GNUC_MALLOC;
00124
00125 IMPORT_C gchar *g_filename_to_uri (const gchar *filename,
00126 const gchar *hostname,
00127 GError **error) G_GNUC_MALLOC;
00128 IMPORT_C gchar *g_filename_display_name (const gchar *filename) G_GNUC_MALLOC;
00129 IMPORT_C gboolean g_get_filename_charsets (G_CONST_RETURN gchar ***charsets);
00130
00131 IMPORT_C gchar *g_filename_display_basename (const gchar *filename) G_GNUC_MALLOC;
00132
00133 IMPORT_C gchar **g_uri_list_extract_uris (const gchar *uri_list) G_GNUC_MALLOC;
00134
00135 G_END_DECLS
00136
00137 #endif