X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;ds=inline;f=charset%2Fstk-charconv.c;h=e296c73bcfa04a8eec59c6fdb1df2f38fd60bd9b;hb=d9e2a686f0f9200d07c7ff6c65ec40bd7a7b876c;hp=2dca1c56b7ba525a190f7fc1e60ef3950facbca1;hpb=ee58c363f2df512f649ac2837ee06c3cdbc75a03;p=libucw.git diff --git a/charset/stk-charconv.c b/charset/stk-charconv.c index 2dca1c56..e296c73b 100644 --- a/charset/stk-charconv.c +++ b/charset/stk-charconv.c @@ -1,5 +1,5 @@ /* - * Sherlock Library -- Character Conversion with Allocation on the Stack + * Sherlock Library -- Character Conversion with Allocation on the Stack * * (c) 2006 Pavel Charvat * @@ -7,17 +7,17 @@ * of the GNU Lesser General Public License. */ -#include "lib/lib.h" -#include "charset/stk-charconv.h" +#include +#include #include #define INITIAL_MIN_SIZE 16 #define INITIAL_SCALE 2 -uns -stk_conv_init(struct conv_context *c, byte *s, uns in_cs, uns out_cs) +uint +stk_strconv_init(struct conv_context *c, const byte *s, uint in_cs, uint out_cs) { - uns l = strlen(s); + uint l = strlen(s); if (in_cs == out_cs) { c->source = s; @@ -34,8 +34,8 @@ stk_conv_init(struct conv_context *c, byte *s, uns in_cs, uns out_cs) return l * INITIAL_SCALE + 1; } -uns -stk_conv_step(struct conv_context *c, byte *buf, uns len) +uint +stk_strconv_step(struct conv_context *c, byte *buf, uint len) { if (!c->source_end) { @@ -45,7 +45,7 @@ stk_conv_step(struct conv_context *c, byte *buf, uns len) } if (c->dest_start) { - uns l = c->dest_end - c->dest_start; + uint l = c->dest_end - c->dest_start; memcpy(buf, c->dest_start, l); c->dest = buf + l; }