From: Andy Wingo <wingo@pobox.com>
To: Mike Gran <spk121@yahoo.com>
Cc: "Ludovic Courtès" <ludo@gnu.org>, guile-devel@gnu.org
Subject: Re: need: scm_from_{utf8,latin1}_{string,symbol,keyword}
Date: Wed, 08 Sep 2010 21:20:55 +0200 [thread overview]
Message-ID: <m3bp88hwiw.fsf@unquote.localdomain> (raw)
In-Reply-To: <124542.89753.qm@web37904.mail.mud.yahoo.com> (Mike Gran's message of "Tue, 7 Sep 2010 20:26:06 -0700 (PDT)")
Hi Mike,
On Wed 08 Sep 2010 05:26, Mike Gran <spk121@yahoo.com> writes:
> Perhaps something like the attached?
Yes that's fantastic. I only have a couple of comments.
> +@deftypefn {C function} char *scm_to_stringn (SCM str, size_t *lenp, const char *encoding, scm_t_string_failed_conversion_handler handler)
How do you feel about scm_to_encoded_stringn as a name? Also
scm_from_encoded_stringn.
> +If @var{lenp} is NULL, this function will return a null-terminated C
> +string. It will thrown an error if the string contains a null
> +character.
Will scm_to_stringn return a null-terminated string if LENP is not null?
> +Since Latin-1 encodings are common, the following two functions are
> +provided.
> +
> +@deftypefn {C function} SCM scm_from_iso88591_stringn (const char *str, size_t len)
Ooh, my hands... can we call this one scm_from_latin1_stringn? And the
_to_ variant obviously.
> +This function may be implemented as a macro.
I think it's best to implement these as functions. The overhead is
minimal, and this gives us more deprecation flexibility in the future
should something be wrong with these functions.
What do you think?
Andy
--
http://wingolog.org/
prev parent reply other threads:[~2010-09-08 19:20 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-09-06 11:23 need: scm_from_{utf8,latin1}_{string,symbol,keyword} Andy Wingo
2010-09-06 16:28 ` Mike Gran
2010-09-06 16:58 ` Andy Wingo
2010-09-06 17:02 ` Ludovic Courtès
2010-09-07 15:21 ` Mike Gran
2010-09-07 17:11 ` Ludovic Courtès
2010-09-07 22:05 ` Andy Wingo
2010-09-08 12:35 ` Ludovic Courtès
2010-09-08 3:26 ` Mike Gran
2010-09-08 12:11 ` Ludovic Courtès
2010-09-08 19:33 ` Andy Wingo
2010-09-08 21:04 ` Ludovic Courtès
2010-09-08 19:20 ` Andy Wingo [this message]
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
List information: https://www.gnu.org/software/guile/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m3bp88hwiw.fsf@unquote.localdomain \
--to=wingo@pobox.com \
--cc=guile-devel@gnu.org \
--cc=ludo@gnu.org \
--cc=spk121@yahoo.com \
/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).