I'm trying to use wayland-client from lisp side, this is my code:
(define-foreign-library wayland-client
(:unix (:or "libwayland-client.so.0.20.0" "libwayland-client.so"))
(t (:default "libwayland-client")))
(use-foreign-library wayland-client)
(defcfun "wl_display_connect" :pointer
(name :string))
(wl-display-connect (null-pointer));;return NULL
Code in C, come from here
#include <stdio.h>
#include <stdlib.h>
#include <wayland-client.h>
struct wl_display *display = NULL;
int main(int argc, char **argv) {
display = wl_display_connect(NULL);
if (display == NULL) {
fprintf(stderr, "Can't connect to display\n");
exit(1);
}
printf("connected to display\n");
wl_display_disconnect(display);
printf("disconnected from display\n");
exit(0);
}
I have test the C one and it worked, how should the lisp one be correct?
How wl_display_connect been defined from here
struct wl_display* wl_display_connect(const char *name)