]> mj.ucw.cz Git - libucw.git/blobdiff - charset/charconv.c
Don't forget to increase run counter.
[libucw.git] / charset / charconv.c
index 67e84555f76d862f5fb84acd8fd546d3f9e61a6d..fcd8680c438af7d7b847089149db4cf82657737b 100644 (file)
@@ -412,3 +412,18 @@ conv_x_count(void)
 {
   return sizeof(x_to_uni) / sizeof(x_to_uni[0]);
 }
+
+int
+conv_in_to_ucs(struct conv_context *c, unsigned int y)
+{
+  return x_to_uni[c->in_to_x[y]];
+}
+
+int conv_ucs_to_out(struct conv_context *c, unsigned int ucs)
+{
+  uns x = uni_to_x[ucs >> 8U][ucs & 0xff];
+  if (x == 256 || c->x_to_out[x] >= 256)
+    return -1;
+  else
+    return c->x_to_out[x];
+}