character sets and Unicode, with no interpolation.
{
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];
+}
CONV_NUM_CHARSETS
};
+/* Conversion of a single character between current charset to Unicode */
+int conv_in_to_ucs(struct conv_context *c, unsigned int y);
+int conv_ucs_to_out(struct conv_context *c, unsigned int ucs);
+
/* For those brave ones who want to mess with charconv internals */
unsigned int conv_x_to_ucs(unsigned int x);
unsigned int conv_ucs_to_x(unsigned int ucs);