"Johann 'Myrkraverk' Oskarsson" <johann@xxxxxxxxxxxxxx> writes:
> Zajcev Evgeny <lg@xxxxxxxx> writes:
>
>> Here is small example of how you could use FFI currently:
>
> [snip]
>
>> ;; Create foreign integer variable and set its value to 0x0100007f -
>> ;; numeric name for 127.0.0.1 IP address
>> (ffi-set (setq v1 (make-ffi-object 'int)) #x0100007f)
>> ==> 16777343
>
> Does this mean we have 32 bit ints as ffi objects? AFAICT, there is
> no 32 bit int in lisp...
>
Definitely, 32bits ints are possible as ffi objects. However it is
not quite defined how to convert emacs lisp data from/into them. We
might have two aproaches:
(setq v1 (make-ffi-object 'int))
(ffi-set v1 10) ; [1]
(ffi-set v1 2147483646.0) ; [2]
(ffi-get v1)
==> 10 ; [1] fits into elisp int
(ffi-get v1)
==> 2147483646.0 ; [2] does not fit into elisp int
Currently only [1] will work i think ..
Any ideas are very encouraged!
--
lg
|