[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Converting C strings to Guile strings?
From: |
rm |
Subject: |
Re: Converting C strings to Guile strings? |
Date: |
Mon, 21 Oct 2002 11:58:07 +0200 |
User-agent: |
Mutt/1.3.24i |
On Mon, Oct 21, 2002 at 09:39:39AM +0000, Dr William Bland wrote:
> Hello all,
> I'm sure this should be simple, but I can't find it anywhere
> in the documentation. I need to construct a Guile string from a null
> terminated C string (i.e. a char*). All I can find is constructors
> that construct a Guile string filled with a specified character.
>
Would 'SCM_API SCM scm_makfrom0str (const char *src);' be your function?
You can find it in '$GUILE_CORE/libguile/strings.h'.
> Also, asuming such a constructor exists, it would be helpful to know if
> it copies the contents of the C string, or if the memory is shared between
> the C string and the Guile string.
Reading 'string.c' shows that that the function unses 'scm_mem2string' which
allocates new memory.
hth'ed Ralf Mattes
> Thanks in advance.
> Best wishes,
> Bill.
>
>
> _______________________________________________
> Guile-devel mailing list
> address@hidden
> http://mail.gnu.org/mailman/listinfo/guile-devel