about summary refs log tree commit diff
path: root/iconv/loop.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>1998-05-16 00:03:15 +0000
committerUlrich Drepper <drepper@redhat.com>1998-05-16 00:03:15 +0000
commit66175fa825828d3a012c34777fd9e7916b7aa10b (patch)
treeca5f75b63ac49de0183f88d90a0de25b025743cf /iconv/loop.c
parentc9fc0e2228473b03cad1f5d6e3dfb52446b24ec7 (diff)
downloadglibc-66175fa825828d3a012c34777fd9e7916b7aa10b.tar.gz
glibc-66175fa825828d3a012c34777fd9e7916b7aa10b.tar.xz
glibc-66175fa825828d3a012c34777fd9e7916b7aa10b.zip
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.
Diffstat (limited to 'iconv/loop.c')
-rw-r--r--iconv/loop.c16
1 files changed, 14 insertions, 2 deletions
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 <gconv.h>
@@ -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