This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Deprecate ,ccs= parameter for fopen
- From: Florian Weimer <fweimer at redhat dot com>
- To: GNU C Library <libc-alpha at sourceware dot org>
- Cc: Arjun Shankar <ashankar at redhat dot com>
- Date: Fri, 15 Jun 2018 08:41:32 +0200
- Subject: Deprecate ,ccs= parameter for fopen
I suggest that we deprecate the ,ccs= parameter for fopen, and
eventually disable it for new programs.
The benefit of doing that is that in the future, statically linked
programs calling fopen will not have to link in the gconv machinery
(which, currently, includes the dynamic loader).
Instead, I would like to see a function like this one:
int fwide_charset (FILE *fp, const char *charset, unsigned int flags);
Mark the stream FP as wide-character orientation, and set the external
file encoding to CHARSET. CHARSET must be a character set name as used
by the iconv_open function. The FLAGS argument is for future extension
and must currently be specified as zero.
Return value: 0 on success, -1 on error. Error codes:
EINVAL flags is not zero.
EBUSY The stream is already wide-oriented or narrow-oriented.
I propose to add the FLAGS argument right away. We eventually want to
specify error handling both on input and output (error, ignore,
replacement character) and transliteration, but this requires
gconv/iconv cleanups which do not currently exist.
With a separate fwide_charset function, only that function and the
wide-character stream functions will pull in the gconv implementation
(which still we be a bit clunky even if we no longer need the dynamic
loader as part of it).
Comments?
Thanks,
Florian