From: Pavel Charvat Date: Wed, 8 Mar 2006 21:25:04 +0000 (+0100) Subject: {stk,mp}_conv --> {stk,mp}_strconv X-Git-Tag: holmes-import~661 X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=86853b9855a18d6d75fd48cc1c466db7fb4984e1;p=libucw.git {stk,mp}_conv --> {stk,mp}_strconv --- diff --git a/charset/mp-charconv.c b/charset/mp-charconv.c index 6976212b..6615973c 100644 --- a/charset/mp-charconv.c +++ b/charset/mp-charconv.c @@ -8,13 +8,12 @@ */ #include "lib/lib.h" -#include "lib/mempool.h" #include "charset/mp-charconv.h" #include #include byte * -mp_conv(struct mempool *mp, byte *s, uns in_cs, uns out_cs) +mp_strconv(struct mempool *mp, byte *s, uns in_cs, uns out_cs) { if (in_cs == out_cs) return mp_strdup(mp, s); diff --git a/charset/mp-charconv.h b/charset/mp-charconv.h index 2677c804..0c34c469 100644 --- a/charset/mp-charconv.h +++ b/charset/mp-charconv.h @@ -13,14 +13,14 @@ #include "lib/mempool.h" #include "charset/charconv.h" -byte *mp_conv(struct mempool *mp, byte *s, uns cs_in, uns cs_out); +byte *mp_strconv(struct mempool *mp, byte *s, uns cs_in, uns cs_out); static inline byte * -mp_conv_to_utf8(struct mempool *mp, byte *s, uns cs_in) -{ return mp_conv(mp, s, cs_in, CONV_CHARSET_UTF8); } +mp_strconv_to_utf8(struct mempool *mp, byte *s, uns cs_in) +{ return mp_strconv(mp, s, cs_in, CONV_CHARSET_UTF8); } static inline byte * -mp_conv_from_utf8(struct mempool *mp, byte *s, uns cs_out) -{ return mp_conv(mp, s, CONV_CHARSET_UTF8, cs_out); } +mp_strconv_from_utf8(struct mempool *mp, byte *s, uns cs_out) +{ return mp_strconv(mp, s, CONV_CHARSET_UTF8, cs_out); } #endif diff --git a/charset/stk-charconv.c b/charset/stk-charconv.c index 2dca1c56..7fc2d72c 100644 --- a/charset/stk-charconv.c +++ b/charset/stk-charconv.c @@ -15,7 +15,7 @@ #define INITIAL_SCALE 2 uns -stk_conv_init(struct conv_context *c, byte *s, uns in_cs, uns out_cs) +stk_strconv_init(struct conv_context *c, byte *s, uns in_cs, uns out_cs) { uns l = strlen(s); if (in_cs == out_cs) @@ -35,7 +35,7 @@ stk_conv_init(struct conv_context *c, byte *s, uns in_cs, uns out_cs) } uns -stk_conv_step(struct conv_context *c, byte *buf, uns len) +stk_strconv_step(struct conv_context *c, byte *buf, uns len) { if (!c->source_end) { diff --git a/charset/stk-charconv.h b/charset/stk-charconv.h index 9f010004..01a242cd 100644 --- a/charset/stk-charconv.h +++ b/charset/stk-charconv.h @@ -15,16 +15,16 @@ /* The following macros convert strings between given charsets (CONV_CHARSET_x). */ -#define stk_conv(s, cs_in, cs_out) \ - ({ struct conv_context _c; uns _l=stk_conv_init(&_c, (s), (cs_in), (cs_out)); \ - while (_l) _l=stk_conv_step(&_c, alloca(_l), _l); _c.dest_start; }) +#define stk_strconv(s, cs_in, cs_out) \ + ({ struct conv_context _c; uns _l=stk_strconv_init(&_c, (s), (cs_in), (cs_out)); \ + while (_l) _l=stk_strconv_step(&_c, alloca(_l), _l); _c.dest_start; }) -#define stk_conv_to_utf8(s, cs_in) stk_conv(s, cs_in, CONV_CHARSET_UTF8) -#define stk_conv_from_utf8(s, cs_out) stk_conv(s, CONV_CHARSET_UTF8, cs_out) +#define stk_strconv_to_utf8(s, cs_in) stk_strconv(s, cs_in, CONV_CHARSET_UTF8) +#define stk_strconv_from_utf8(s, cs_out) stk_strconv(s, CONV_CHARSET_UTF8, cs_out) /* Internals */ -uns stk_conv_init(struct conv_context *c, byte *s, uns cs_in, uns cs_out); -uns stk_conv_step(struct conv_context *c, byte *buf, uns len); +uns stk_strconv_init(struct conv_context *c, byte *s, uns cs_in, uns cs_out); +uns stk_strconv_step(struct conv_context *c, byte *buf, uns len); #endif