RosettaCodeData/Task/Bitmap-Read-a-PPM-file/ATS/bitmap-read-a-ppm-file-1.ats
2023-07-01 13:44:08 -04:00

12 lines
426 B
Text

#define ATS_PACKNAME "Rosetta_Code.bitmap_read_ppm_task"
staload "bitmap_task.sats"
fn {a : t@ype}
pixmap_read_ppm :
(* On failure to read, the return is None_vt(). I do not currently
provide any indication of why the attempt failed, although in
practice you probably would wish to add that. *)
FILEref ->
Option_vt ([w, h : pos] [p : addr | null < p]
@(mfree_gc_v p | pixmap (a, w, h, p)))