(bind-func fits-image-y
(lambda (f:fitsfile*)
(let ((status:i32* (salloc))
(err:i8* (salloc 40))
(dims:i32* (salloc))
(val:i32* (salloc))
(comment:i8* (salloc 256))
(hdu:i32* (salloc)))
(pset! status 0 0)
(ffgky f TINT "NAXIS2" (bitcast val i8*) comment status)
(if (<> (pref status 0) 0)
(begin (printf "error reading y dimension: %s\n" err)
(i64toi32 1))
(pref val 0)))))