]> mj.ucw.cz Git - libucw.git/blob - charset/mp-charconv.h
xtypes: bugfix in xt_bool_parse, code cleanup
[libucw.git] / charset / mp-charconv.h
1 /*
2  *      Sherlock Library -- Character Conversion with Allocation on a Memory Pool
3  *
4  *      (c) 2006 Pavel Charvat <pchar@ucw.cz>
5  *
6  *      This software may be freely distributed and used according to the terms
7  *      of the GNU Lesser General Public License.
8  */
9
10 #ifndef _CHARSET_MP_CHARCONV_H
11 #define _CHARSET_MP_CHARCONV_H
12
13 #include <ucw/mempool.h>
14 #include <charset/charconv.h>
15
16 #ifdef CONFIG_UCW_CLEAN_ABI
17 #define mp_strconv ucw_mp_strconv
18 #endif
19
20 byte *mp_strconv(struct mempool *mp, const byte *s, uint cs_in, uint cs_out);
21
22 static inline byte *mp_strconv_to_utf8(struct mempool *mp, const byte *s, uint cs_in)
23 { return mp_strconv(mp, s, cs_in, CONV_CHARSET_UTF8); }
24
25 static inline byte *mp_strconv_from_utf8(struct mempool *mp, const byte *s, uint cs_out)
26 { return mp_strconv(mp, s, CONV_CHARSET_UTF8, cs_out); }
27
28 #endif