]> mj.ucw.cz Git - libucw.git/blob - charset/mp-charconv.h
Conversion between charsets with allocation on the stack
[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
7 #ifndef _MP_CHARCONV_H
8 #define _MP_CHARCONV_H
9
10 #include "lib/mempool.h"
11 #include "charset/charconv.h"
12
13 byte *
14 mp_conv(struct mempool *mp, byte *s, uns cs_in, uns cs_out);
15
16 static inline byte *
17 mp_conv_to_utf8(struct mempool *mp, byte *s, uns cs_in) 
18 { return mp_conv(mp, s, cs_in, CONV_CHARSET_UTF8); }
19
20 static inline byte *
21 mp_conv_from_utf8(struct mempool *mp, byte *s, uns cs_out)
22 { return mp_conv(mp, s, CONV_CHARSET_UTF8, cs_out); }
23
24 #endif