guile-devel
[Top][All Lists]
Advanced

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

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


From: Andy Wingo
Subject: Re: need: scm_from_{utf8,latin1}_{string,symbol,keyword}
Date: Wed, 08 Sep 2010 21:20:55 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux)

Hi Mike,

On Wed 08 Sep 2010 05:26, Mike Gran <address@hidden> writes:

> Perhaps something like the attached?

Yes that's fantastic. I only have a couple of comments.

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



reply via email to

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