summaryrefslogtreecommitdiffstats
path: root/lib/libc/stdio/local.h
diff options
context:
space:
mode:
authortjr <tjr@FreeBSD.org>2004-05-22 15:19:41 +0000
committertjr <tjr@FreeBSD.org>2004-05-22 15:19:41 +0000
commitf5a461b2700c74383086e755fdaed26dc05d848c (patch)
treef6b3a5846b5b7d1a722dc68d0c48e70c32df2e55 /lib/libc/stdio/local.h
parent90c5701a2cddfda7b43823be60c581ef7dbd9bf0 (diff)
downloadFreeBSD-src-f5a461b2700c74383086e755fdaed26dc05d848c.zip
FreeBSD-src-f5a461b2700c74383086e755fdaed26dc05d848c.tar.gz
Associate a multibyte conversion state object with each stream. Reset it
to the initial state when a stream is opened or seeked upon. Use the stream's conversion state object instead of a freshly-zeroed one in fgetwc(), fputwc() and ungetwc(). This is only a performance improvement for now, but it would also be required in order to support state-dependent encodings.
Diffstat (limited to 'lib/libc/stdio/local.h')
-rw-r--r--lib/libc/stdio/local.h13
1 files changed, 2 insertions, 11 deletions
diff --git a/lib/libc/stdio/local.h b/lib/libc/stdio/local.h
index 9e1cad4..b8bf81a 100644
--- a/lib/libc/stdio/local.h
+++ b/lib/libc/stdio/local.h
@@ -89,15 +89,7 @@ struct __sFILEX {
pthread_t fl_owner; /* current owner */
int fl_count; /* recursive lock count */
int orientation; /* orientation for fwide() */
-#ifdef notdef
- /*
- * XXX These are not used yet -- they will be used to store the
- * multibyte conversion state for writing and reading when
- * stateful encodings are supported by the locale framework.
- */
- mbstate_t wstate; /* write conversion state */
- mbstate_t rstate; /* read conversion state */
-#endif
+ mbstate_t mbstate; /* multibyte conversion state */
};
/*
@@ -134,8 +126,7 @@ struct __sFILEX {
(fp)->_extra->fl_owner = NULL; \
(fp)->_extra->fl_count = 0; \
(fp)->_extra->orientation = 0; \
- /* memset(&(fp)->_extra->wstate, 0, sizeof(mbstate_t)); */ \
- /* memset(&(fp)->_extra->rstate, 0, sizeof(mbstate_t)); */ \
+ memset(&(fp)->_extra->mbstate, 0, sizeof(mbstate_t)); \
}
/*
OpenPOWER on IntegriCloud