about summary refs log tree commit diff
path: root/iconv
diff options
context:
space:
mode:
Diffstat (limited to 'iconv')
-rw-r--r--iconv/gconv.h3
-rw-r--r--iconv/gconv_builtin.c3
-rw-r--r--iconv/skeleton.c6
3 files changed, 12 insertions, 0 deletions
diff --git a/iconv/gconv.h b/iconv/gconv.h
index cd0e3de1dc..b359c92c62 100644
--- a/iconv/gconv.h
+++ b/iconv/gconv.h
@@ -87,6 +87,9 @@ struct gconv_step
   int min_needed_to;
   int max_needed_to;
 
+  /* Flag whether this is a stateful encoding or not.  */
+  int stateful;
+
   void *data;		/* Pointer to step-local data.  */
 };
 
diff --git a/iconv/gconv_builtin.c b/iconv/gconv_builtin.c
index a970fcc8f2..4f3ca565ac 100644
--- a/iconv/gconv_builtin.c
+++ b/iconv/gconv_builtin.c
@@ -81,4 +81,7 @@ __gconv_get_builtin_trans (const char *name, struct gconv_step *step)
   step->max_needed_from = map[cnt].max_needed_from;
   step->min_needed_to = map[cnt].min_needed_to;
   step->max_needed_to = map[cnt].max_needed_to;
+
+  /* None of the builtin converters handles stateful encoding.  */
+  step->stateful = 0;
 }
diff --git a/iconv/skeleton.c b/iconv/skeleton.c
index f905bcdaea..36cc33c9be 100644
--- a/iconv/skeleton.c
+++ b/iconv/skeleton.c
@@ -143,6 +143,12 @@ gconv_init (struct gconv_step *step)
   step->min_needed_to = MIN_NEEDED_TO;
   step->max_needed_to = MAX_NEEDED_TO;
 
+#ifdef RESET_STATE
+  step->stateful = 1;
+#else
+  step->stateful = 0;
+#endif
+
   return GCONV_OK;
 }
 #endif