]> mj.ucw.cz Git - libucw.git/commitdiff
{stk,mp}_conv --> {stk,mp}_strconv
authorPavel Charvat <pavel.charvat@netcentrum.cz>
Wed, 8 Mar 2006 21:25:04 +0000 (22:25 +0100)
committerPavel Charvat <pavel.charvat@netcentrum.cz>
Wed, 8 Mar 2006 21:25:04 +0000 (22:25 +0100)
charset/mp-charconv.c
charset/mp-charconv.h
charset/stk-charconv.c
charset/stk-charconv.h

index 6976212be5928bad1f48a5a4209df6f9aafd0f48..6615973cb4c23588ae2a6a38cccd90127911fe1f 100644 (file)
@@ -8,13 +8,12 @@
  */
 
 #include "lib/lib.h"
-#include "lib/mempool.h"
 #include "charset/mp-charconv.h"
 #include <string.h>
 #include <alloca.h>
 
 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);
index 2677c8049a1ba32fec9e93b56f717d95a79c05f8..0c34c46927eed0b636beaa01812a9f8870b70111 100644 (file)
 #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
index 2dca1c56b7ba525a190f7fc1e60ef3950facbca1..7fc2d72cbf0bf9833c9a9f3a34a28e1e3f2574ae 100644 (file)
@@ -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)
   {
index 9f01000440f0e475add4de0fa8a2cb41d1f0c6f9..01a242cdc9887d5510ee47e2f34c15e9660938ef 100644 (file)
 
 /* 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