/*
- * Sherlock Library -- Character Conversion with Allocation on the Stack
+ * Sherlock Library -- Character Conversion with Allocation on the Stack
*
* (c) 2006 Pavel Charvat <pchar@ucw.cz>
*
* of the GNU Lesser General Public License.
*/
-#include "lib/lib.h"
-#include "charset/stk-charconv.h"
+#include <ucw/lib.h>
+#include <charset/stk-charconv.h>
#include <string.h>
#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;
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)
{
}
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;
}