(in-package :common-lisp) (defpackage :test (:use :common-lisp :header :ffi-glue) (:export :start)) (in-package :test) (def-callback my-callback (int (x int) (str c-string)) (format t "In lisp : x = ~A str = ~A~%" x str) 156) (defun start () (let ((s)) (format t "Booo~%") (format t "A_CONSTANT=~A~%" A_CONSTANT) (format t "my_var=~A~%" my_var) (format t "my_var_enum = ~A~%" my_var_enum) (format t "my_func=~A~%" (my_func)) (format t "my_func_string=~A~%" (my_func_string "BoooooMMM")) (setq s (my_div 10 20)) (format t "s.x=~A s.y=~A~%" (struct_t-x s) (struct_t-y s)) (setf (struct_t-x s) 200) (format t "s.x=~A s.y=~A~%" (struct_t-x s) (struct_t-y s)) (setq s (make-struct_t :x -150 :y -10)) (format t "s.x=~A s.y=~A~%" (struct_t-x s) (struct_t-y s)) (format t "SDL_AUDIO_PAUSED=~A~%" SDL_AUDIO_PAUSED) (format t "SDL_USEREVENT=~A~%" SDL_USEREVENT) (format t "my_func_enum=~A~%" (my_func_enum 10.5)) (my_func_with_func (callback my-callback)) (format t "Funcall a callback from lisp = ~A~%" (funcall-callback my-callback (function int int c-string) 5 "Callback from lisp"))))