chicken-users
[Top][All Lists]
Advanced

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

Re: [Chicken-users] error message question


From: Peter Keller
Subject: Re: [Chicken-users] error message question
Date: Mon, 12 Aug 2002 02:12:58 -0500
User-agent: Mutt/1.2i

On Mon, Aug 12, 2002 at 01:49:03AM -0500, Peter Keller wrote:
> Here are the references to that symbol name:

Here's another reference I forgot:

;; if there is a return char *, then manually copy it into a c-string, and
;; free the real c-pointer returned by the function. This should make garbage
;; collection happy.
(define mpf_get_str
    (let (  (alloc
                (foreign-lambda 
                    c-pointer "mpf_get_str" c-pointer mp_exp_t_p int size_t 
mpf_t))
            (free (foreign-lambda void "free" c-pointer)))
    (lambda (ptr exp base n_digits mpf)
        (let ((c-ptr (alloc ptr exp base n_digits mpf)))
            (if (not ptr)
                (let ((str (c-pointer->c-string c-ptr))) ;; copy the string...
                    (free c-ptr) ;; remove the mem alloced by mpf_get_str
                    str)
                ptr)))))

Thanks.

-pete




reply via email to

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