From 66175fa825828d3a012c34777fd9e7916b7aa10b Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Sat, 16 May 1998 00:03:15 +0000 Subject: Update. * iconv/loop.c: Let user add code to use and set paramaters. * iconvdata/iso-2022-kr.c: Correct to-loop. * iconvdata/ksc5601.h (ksc5601_to_ucs4): Use correct value to find hanja. * iconvdata/TESTS: Add ISO-2022-KR test. * iconvdata/testdata/ISO-2022-KR: New file. * wcsmbs/btowc.c: Likewise. * wcsmbs/mbrtowcs.c: Likewise. * wcsmbs/mbsnrtowcs.c: Likewise. * wcsmbs/mbsrtowcs.c: Likewise. * wcsmbs/wcrtomb.c: Likewise. * wcsmbs/wcsnrtombs.c: Likewise. * wcsmbs/wcsrtombs.c: Likewise. * wcsmbs/wctob.c: Likewise. --- iconv/loop.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'iconv') diff --git a/iconv/loop.c b/iconv/loop.c index f8188873dc..596f8a6441 100644 --- a/iconv/loop.c +++ b/iconv/loop.c @@ -44,7 +44,10 @@ BODY this is supposed to expand to the body of the loop. The user must provide this. - EXTRA_LOOP_DECLS Extra arguments passed from converion loop call. + EXTRA_LOOP_DECLS extra arguments passed from converion loop call. + + INIT_PARAMS code to define and initialize variables from params. + UPDATE_PARAMS code to store result in params. */ #include @@ -134,6 +137,10 @@ LOOPFCT (const unsigned char **inptrp, const unsigned char *inend, size_t min_out_rounds = (outend - outptr) / MAX_NEEDED_OUTPUT; size_t min_rounds = MIN (min_in_rounds, min_out_rounds); +#ifdef INIT_PARAMS + INIT_PARAMS; +#endif + #undef NEED_LENGTH_TEST #define NEED_LENGTH_TEST 0 while (min_rounds-- > 0) @@ -195,7 +202,7 @@ LOOPFCT (const unsigned char **inptrp, const unsigned char *inend, /* Here comes the body the user provides. It can stop with RESULT set to GCONV_INCOMPLETE_INPUT (if the size of the input characters vary in size), GCONV_ILLEGAL_INPUT, or - GCONV_FULL_OUTPUT (if the output characters vary in size. */ + GCONV_FULL_OUTPUT (if the output characters vary in size). */ BODY /* If necessary count the successful conversion. */ @@ -216,6 +223,9 @@ LOOPFCT (const unsigned char **inptrp, const unsigned char *inend, /* Update the pointers pointed to by the parameters. */ *inptrp = inptr; *outptrp = outptr; +#ifdef UPDATE_PARAMS + UPDATE_PARAMS; +#endif return result; } @@ -232,3 +242,5 @@ LOOPFCT (const unsigned char **inptrp, const unsigned char *inend, #undef BODY #undef LOOPFCT #undef EXTRA_LOOP_DECLS +#undef INIT_PARAMS +#undef UPDATE_PARAMS -- cgit v1.2.3