g-wrap-dev
[Top][All Lists]
Advanced

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

Re: C error-returning functions and Guile exceptions


From: Andreas Rottmann
Subject: Re: C error-returning functions and Guile exceptions
Date: Fri, 11 Mar 2005 19:02:59 +0100
User-agent: Gnus/5.1002 (Gnus v5.10.2) Emacs/21.3 (gnu/linux)

address@hidden (Ludovic Courtès) writes:

>   1.  Write a C function that wraps `read_stuff ()', checks the
>       error code returned and calls `scm_throw ()' if necessary;
>
OK, this can be done in G-Wrap without any modification. I've added a
test for this behaviour - see
address@hidden/g-wrap--dev--0--patch-14 [0]. This works by
creating a new type that does the aproriate checking on the result of
the function. A few important points:

(needs-result-var? TYPE) must return false, so no value is returned in 
                         the Scheme wrapper.

The appropriate "hook" to implement return value checking is in
call-cg; for details see the changeset[0].

[0] For quick browsing, you can use
      
http://rotty-ipv4.yi.org/cgi-bin/archzoom.cgi/address@hidden/g-wrap--dev--0--patch-14?log

Cheers, Rotty
-- 
Andreas Rottmann         | address@hidden      | address@hidden | address@hidden
http://yi.org/rotty      | GnuPG Key: http://yi.org/rotty/gpg.asc
Fingerprint              | DFB4 4EB4 78A4 5EEE 6219  F228 F92F CFC5 01FD 5B62

I have a truly elegant proof of the  above, but it is too long to
fit into this .signature file.




reply via email to

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