From: ludo@gnu.org (Ludovic Courtès)
To: Mike Gran <spk121@yahoo.com>
Cc: guile-devel@gnu.org
Subject: Re: need: scm_from_{utf8,latin1}_{string,symbol,keyword}
Date: Wed, 08 Sep 2010 14:11:25 +0200 [thread overview]
Message-ID: <87aanso2oi.fsf@gnu.org> (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,
Mike Gran <spk121@yahoo.com> writes:
>> From: Ludovic Courtès <ludo@gnu.org>
>
>> >> Besides, there’s the undocumented ‘scm_from_stringn’ and the internal
>> >> ‘scm_to_stringn’, which can convert from/to any encoding. I think they
>> >> were initially kept internal because we weren’t quite sure about the
>> >> API. Mike?
>> >
>> > Also, I think we were trying to avoid compilation problems based on
>> > having to expose the libunistring's enum iconv_ilseq_handle to the world.
>> > But later, we ended up creating the analogous
>> > scm_t_string_failed_conversion_handler type to work around that problem.
>>
>> Right. So I guess they can now be made public & documented. Would you
>> like to do it? :-)
>
> Perhaps something like the attached?
Yes, excellent!
> +@deftp {C type} scm_t_string_failed_conversion_handler
Should be “C Type”...
[...]
> +@deftypefn {C function} char *scm_to_stringn (SCM str, size_t *lenp, const char *encoding, scm_t_string_failed_conversion_handler handler)
... and “C Function”.
> +Returns a newly allocated C string from the Guile string @var{str}. The
Should be “Return”.
[...]
> +/* Macros */
> +#define scm_to_iso88591_stringn(s,lenp) \
> + scm_to_stringn ((s), (lenp), NULL, SCM_FAILED_CONVERSION_ERROR)
> +#define scm_from_iso88591_stringn(s,len) \
> + scm_from_stringn ((s), (len), NULL, SCM_FAILED_CONVERSION_ERROR)
Please make them functions so that the implementation can eventually be
changed without breaking the ABI.
Apart from that, if Andy agrees, you can go ahead and push.
Thanks!
Ludo’.
next prev parent reply other threads:[~2010-09-08 12:11 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 [this message]
2010-09-08 19:33 ` Andy Wingo
2010-09-08 21:04 ` Ludovic Courtès
2010-09-08 19:20 ` Andy Wingo
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=87aanso2oi.fsf@gnu.org \
--to=ludo@gnu.org \
--cc=guile-devel@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).