[Top][All Lists]

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

Re: [Chicken-users] Help with tokyocabinet, C const

From: Peter Bex
Subject: Re: [Chicken-users] Help with tokyocabinet, C const
Date: Thu, 31 Dec 2009 13:57:53 +0100
User-agent: Mutt/

On Thu, Dec 31, 2009 at 01:26:40AM -0600, Evan E. wrote:
> Using easyffi, I've declared the foreign type and procedure. TCMAP is
> a hash map struct, tcmapget returns a value for a given key from the
> map object:
> ___declare(type, "MAP;(nonnull-c-pointer \"TCMAP\");tc-map-ptr")
> const void *tcmapget(MAP map, ___scheme_pointer kbuf, int ksiz,  
> ___pointer int *sp);

It returns a pointer to the value as it's stored in the hashmap.
It does not make a copy of the value.  That means you shouldn't free it!

"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]