On Mar 29, 2011, at 9:46 AM, Cosme Enmanuel Zamudio Salazar wrote:
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 ?
The Chicken FFI maps a c-pointer NULL to #f as an argument & as a
return value. The `pointer' field is #f above.
I must be missing something.
Thanks :)
_______________________________________________
Chicken-users mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/chicken-users
_______________________________________________
Chicken-users mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/chicken-users