chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Chicken-users] Check for NULL struct


From: Cosme Enmanuel Zamudio Salazar
Subject: [Chicken-users] Check for NULL struct
Date: Tue, 29 Mar 2011 09:46:53 -0700

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 :)

reply via email to

[Prev in Thread] Current Thread [Next in Thread]