Is there a way to check for a NULL structure returned from a C function?

this is the structure

(define-record sdl-surface pointer)

(define-record-printer (sdl-surface s out)
  (for-each (lambda (x) (display x out))
    (list "#<sdl-surface "(sdl-surface-pointer s)">")))

(define-foreign-type SDL_Surface (c-pointer "SDL_Surface")
  sdl-surface-pointer
  make-sdl-surface)


the NULL can be returned when i try to load an image that doesnt exists:

#;12> (img-load "test.png")
#<sdl-surface #f>

but how do i check if its NULL ?

Thanks :)
_______________________________________________
Chicken-users mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/chicken-users

Reply via email to