What is the equivalent of "void" in CFFI?

Luís Oliveira luismbo at gmail.com
Tue Jul 28 13:24:38 UTC 2020


On Tue, 28 Jul 2020 at 12:53, oleg harput <olegharput at gmail.com> wrote:
>
> void InitWindow(int width, int height, const char *title);              in C
>
> (cffi:defcfun ("InitWindow" init-window)                                      in CFFI
>     :void                       <==== This void is true or not?
>   (width (:pointer :int))
>   (heigh (:pointer :int))
>   (title (:pointer :char)))
>
> please help.

Yes, :void is correct there. (:pointer :int) should be :int instead
and :string should be more convenient than (:pointer :char) since
it'll convert Lisp strings to C strings for you. You may find
https://common-lisp.net/project/cffi/manual/html_node/Tutorial.html
useful.

Cheers,

-- 
Luís Oliveira
http://kerno.org/~luis/



More information about the cffi-devel mailing list