chicken-users
[Top][All Lists]
Advanced

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

Re: [Chicken-users] using mmap files as strings?


From: Peter Bex
Subject: Re: [Chicken-users] using mmap files as strings?
Date: Sat, 23 Oct 2010 12:04:25 +0200
User-agent: Mutt/1.4.2.3i

On Fri, Oct 22, 2010 at 05:58:02PM -0600, Alan Post wrote:
> This is excellent, I've learned a lot more about how all of this
> works together now.
> 
> What method would I use to convert a pointer and a length to a
> string?  Even though I'm copying the memory, how do I do it at
> all?

Something like this:

{
  C_word *scheme_string;

  scheme_string = C_alloc(C_SIZEOF_STRING(the_length));
  C_string(&scheme_string, the_length, the_pointer);
  C_kontinue(the_continuation, scheme_string);
}

Cheers,
Peter
-- 
http://sjamaan.ath.cx
--
"The process of preparing programs for a digital computer
 is especially attractive, not only because it can be economically
 and scientifically rewarding, but also because it can be an aesthetic
 experience much like composing poetry or music."
                                                        -- Donald Knuth



reply via email to

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