This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]