--- psiconv/trunk/lib/psiconv/unicode.h 2004/02/21 13:24:04 216 +++ psiconv/trunk/lib/psiconv/unicode.h 2004/02/22 22:24:39 217 @@ -22,6 +22,7 @@ #include #include +#include #ifdef __cplusplus extern "C" { @@ -38,26 +39,17 @@ /* Translate a single character to a unicode character, using the translation tables in config */ -extern psiconv_ucs2 psiconv_unicode_from_char(const psiconv_config config, - psiconv_u8 input); +extern psiconv_ucs2 psiconv_unicode_read_char(const psiconv_config config, + psiconv_buffer buf, + int lev,psiconv_u32 off, + int *length, + int *status); + +extern int psiconv_unicode_write_char(const psiconv_config config, + psiconv_buffer buf, + int lev, + psiconv_ucs2 value); -/* Translate a single unicode character to a normal character, using the - translation tables in config */ -extern psiconv_u8 psiconv_unicode_to_char(psiconv_config config, - psiconv_ucs2 input); - -/* Translate a normal string to unicode. - Output is allocated by this function on success, and must be freed by - hand. */ -extern int psiconv_unicode_from_chars(const psiconv_config config, - const psiconv_u8 *input, - psiconv_ucs2 **output); -/* Translate a unicode string to a normal one. - Output is allocated by this function on success, and must be freed by - hand. */ -extern int psiconv_unicode_to_chars(const psiconv_config config, - const psiconv_ucs2 *input, - psiconv_u8 **output); /* Compute the length of a unicode string */ extern int psiconv_unicode_strlen(const psiconv_ucs2 *input); @@ -66,7 +58,11 @@ extern psiconv_ucs2 *psiconv_unicode_strdup(const psiconv_ucs2 *input); /* Compare two unicode strings. Ordering as in Unicode codepoints! */ -int psiconv_unicode_strcmp(const psiconv_ucs2 *str1, const psiconv_ucs2 *str2); +extern int psiconv_unicode_strcmp(const psiconv_ucs2 *str1, const psiconv_ucs2 *str2); + +/* Return a newly allocated empty string */ +extern psiconv_ucs2 *psiconv_unicode_empty_string(void); + #ifdef __cplusplus }