[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: FFI questions
From: |
Matt Wette |
Subject: |
Re: FFI questions |
Date: |
Fri, 15 May 2020 16:59:02 -0700 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 |
On 5/15/20 4:52 PM, Matt Wette wrote:
On 5/15/20 1:09 PM, Taylan Kammer wrote:
The FFI Helper is by Matt Wette who also hangs around on this mailing
list I believe.
I think Taylan's suggestion on your first part is probably correct.
Bytestructures allows you to access and change structure members by name.
Matt
And by the way, the FFI Helper has a "x11-xcb.ffi" file included.
Here is the code generated for your procedure:
(My converter says this returns int not void, btw.)
;; xcb_void_cookie_t xcb_change_window_attributes(xcb_connection_t *c,
;; xcb_window_t window, uint32_t value_mask, const void *value_list);
(define xcb_change_window_attributes
(let ((~xcb_change_window_attributes
(delay (fh-link-proc
(list ffi:unsigned-int)
"xcb_change_window_attributes"
(list ffi-void* ffi:uint32 ffi:uint32 ffi-void*)
ffi-x11-xcb-llibs))))
(lambda (c window value_mask value_list)
(let ((~c ((fht-unwrap xcb_connection_t*) c))
(~window (unwrap~fixed window))
(~value_mask (unwrap~fixed value_mask))
(~value_list (unwrap~pointer value_list)))
((fht-wrap xcb_void_cookie_t)
((force ~xcb_change_window_attributes)
~c
~window
~value_mask
~value_list))))))