[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: need: scm_from_{utf8,latin1}_{string,symbol,keyword}

From: Ludovic Courtès
Subject: Re: need: scm_from_{utf8,latin1}_{string,symbol,keyword}
Date: Wed, 08 Sep 2010 14:11:25 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux)

Hi Mike,

Mike Gran <address@hidden> writes:

>> From: Ludovic Courtès <address@hidden>
>> >>  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!

> address@hidden {C type} scm_t_string_failed_conversion_handler

Should be “C Type”...


> address@hidden {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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]