Initialize the gmime for upstream
[platform/upstream/gmime.git] / gmime / gmime-charset.h
1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
2 /*  GMime
3  *  Copyright (C) 2000-2012 Jeffrey Stedfast
4  *
5  *  This library is free software; you can redistribute it and/or
6  *  modify it under the terms of the GNU Lesser General Public License
7  *  as published by the Free Software Foundation; either version 2.1
8  *  of the License, or (at your option) any later version.
9  *
10  *  This library 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 GNU
13  *  Lesser General Public License for more details.
14  *
15  *  You should have received a copy of the GNU Lesser General Public
16  *  License along with this library; if not, write to the Free
17  *  Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
18  *  02110-1301, USA.
19  */
20
21
22 #ifndef __GMIME_CHARSET_H__
23 #define __GMIME_CHARSET_H__
24
25 #include <glib.h>
26 #include <sys/types.h>
27
28 G_BEGIN_DECLS
29
30 void        g_mime_charset_map_init (void);
31 void        g_mime_charset_map_shutdown (void);
32
33 const char *g_mime_locale_charset (void);
34 const char *g_mime_locale_language (void);
35
36 const char *g_mime_charset_language (const char *charset);
37
38 const char *g_mime_charset_canon_name (const char *charset);
39 const char *g_mime_charset_iconv_name (const char *charset);
40
41 #ifndef GMIME_DISABLE_DEPRECATED
42 const char *g_mime_charset_name (const char *charset);
43 const char *g_mime_charset_locale_name (void);
44 #endif
45
46 const char *g_mime_charset_iso_to_windows (const char *isocharset);
47
48
49 /**
50  * GMimeCharset:
51  * @mask: charset mask
52  * @level: charset level
53  *
54  * State used by g_mime_charset_best() and g_mime_charset_best_name().
55  **/
56 typedef struct _GMimeCharset {
57         unsigned int mask;
58         unsigned int level;
59 } GMimeCharset;
60
61 void g_mime_charset_init (GMimeCharset *charset);
62 void g_mime_charset_step (GMimeCharset *charset, const char *inbuf, size_t inlen);
63 const char *g_mime_charset_best_name (GMimeCharset *charset);
64
65 const char *g_mime_charset_best (const char *inbuf, size_t inlen);
66
67 gboolean g_mime_charset_can_encode (GMimeCharset *mask, const char *charset,
68                                     const char *text, size_t len);
69
70
71 void g_mime_set_user_charsets (const char **charsets);
72 const char **g_mime_user_charsets (void);
73
74
75 G_END_DECLS
76
77 #endif /* __GMIME_CHARSET_H__ */