On 10/30/05, Pupeno <[EMAIL PROTECTED]> wrote: > > So, when I try to wrap XNextEvent I end up with two procedures: > > (define x-next-event-raw > (foreign-lambda void "XNextEvent" display x-event)) > > (define (x-next-event d) > (let ((e (foreign-value "malloc(sizeof(XEvent))" c-pointer))) > (x-next-event-raw d e) > e)) > > Is that the right way to do it ? If not, how should I do it ?
This is fine, just make sure to free the malloced structure again. > > Now, the real question: How do I access XEvent's members and XEvent's members' > members ? You might also look into `define-foreign-record'. The xlib egg uses accessor-procedures for each and every structure member, which is ok, too (define-foreign-record does essentially the same). cheers, felix _______________________________________________ Chicken-users mailing list [email protected] http://lists.nongnu.org/mailman/listinfo/chicken-users
