From: ben Date: Sun, 18 Sep 2005 12:49:44 +0000 (+0000) Subject: Make read_utf8(), like read_sbcs(), accessible to the rest of the library, X-Git-Url: https://git.distorted.org.uk/~mdw/sgt/charset/commitdiff_plain/7a7dc0a794235868318c60726f42e175766045e8 Make read_utf8(), like read_sbcs(), accessible to the rest of the library, so it can be used directly in iso2022.c. git-svn-id: svn://svn.tartarus.org/sgt/charset@6326 cda61777-01e9-0310-a592-d414129be87e --- diff --git a/internal.h b/internal.h index df5996f..e7ed8da 100644 --- a/internal.h +++ b/internal.h @@ -94,6 +94,10 @@ int write_sbcs(charset_spec const *charset, long int input_chr, long int sbcs_to_unicode(const struct sbcs_data *sd, long int input_chr); long int sbcs_from_unicode(const struct sbcs_data *sd, long int input_chr); +void read_utf8(charset_spec const *charset, long int input_chr, + charset_state *state, + void (*emit)(void *ctx, long int output), void *emitctx); + long int big5_to_unicode(int r, int c); int unicode_to_big5(long int unicode, int *r, int *c); long int cp949_to_unicode(int r, int c); diff --git a/iso2022.c b/iso2022.c index 87317b5..642475c 100644 --- a/iso2022.c +++ b/iso2022.c @@ -144,8 +144,7 @@ static void do_utf8(long int input_chr, ustate.s1 = 0; ustate.s0 = state->s0 & 0x03ffffffL; - utf8 = charset_find_spec(CS_UTF8); - utf8->read(utf8, input_chr, &ustate, emit, emitctx); + read_utf8(NULL, input_chr, &ustate, emit, emitctx); state->s0 = (state->s0 & ~0x03ffffffL) | (ustate.s0 & 0x03ffffffL); } diff --git a/utf8.c b/utf8.c index 90856e9..c9a9685 100644 --- a/utf8.c +++ b/utf8.c @@ -11,9 +11,9 @@ * UTF-8 has no associated data, so `charset' may be ignored. */ -static void read_utf8(charset_spec const *charset, long int input_chr, - charset_state *state, - void (*emit)(void *ctx, long int output), void *emitctx) +void read_utf8(charset_spec const *charset, long int input_chr, + charset_state *state, + void (*emit)(void *ctx, long int output), void *emitctx) { UNUSEDARG(charset);