public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Florian Weimer <fweimer@redhat.com>
To: GNU C Library <libc-alpha@sourceware.org>
Cc: Arjun Shankar <ashankar@redhat.com>
Subject: Deprecate ,ccs= parameter for fopen
Date: Fri, 15 Jun 2018 06:41:00 -0000	[thread overview]
Message-ID: <fe663b3a-cd82-8dc5-a949-c979d0bfc015@redhat.com> (raw)

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

                 reply	other threads:[~2018-06-15  6:41 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=fe663b3a-cd82-8dc5-a949-c979d0bfc015@redhat.com \
    --to=fweimer@redhat.com \
    --cc=ashankar@redhat.com \
    --cc=libc-alpha@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).