{Specs for Routines for handling IFF plus files. Full code is in IFFUTILS} {Full documentation commented in at the end of IFFUTILS.} {J. Butler 12 Jan 86} %constinteger %c iff not magic=16_81, iff no file = 16_82, iff wrong length = 16_83, iff header too short = 16_84, iff last one = 16_84 %constinteger iff read=0, iff write=1 %conststring (31) %array iff error(iff not magic:iff last one)= %c "File has wrong magic number", "File does not exist", "File length inconsistent", "Header too short" %recordformat context fm( %c %integer filstart, filptr, readwrite, imaddr, %byte colour,screen,file,d1, %integer xoff,yoff) %constinteger context size = 28 %recordformat iffhdr fm(%integer hlen, datatype, ht, wid, signed, fov ht, fov wid, stereo, baseline, vergence, gaze, id, processed, fstop, %integer focus, appno, images, subs, xoff, yoff, aspect, mapaddr, mapwid, maplen, %record (context fm) %name context, %record (*) %name app, %string (255) title, %string (8) date, time) %externalintegerfnspec IFF OPEN FILE %alias "IFF_OPEN_FILE" %c (%string (255) filename, %record (iffhdr fm) %name iffh, %integer readwrite) {opens an IFF file for input or output. Result=0 if it succeeds #0 otherwise} {Note uses stream 1 for output} %externalroutinespec IFF CLOSE FILE %alias "IFF_CLOSE_FILE" %c (%record (iffhdr fm) iffh) {closes an IFF OPENed file} %externalintegerfnspec IFF READ HEADER %alias "IFF_READ_HEADER" %c (%record (iffhdr fm) %name iffh) {read header from an IFF OPENed file and puts field values in IFFH} %externalintegerfnspec IFF WRITE HEADER %alias "IFF_WRITE_HEADER" %c (%record (iffhdr fm) %name iffh) {writes a valid IFF header from values supplied in IFFH. Uses sensible defaults} %externalroutinespec IFF SHOW HEADER %alias "IFF_SHOW_HEADER" %c (%record (iffhdr fm) iffh, %integer detail) {Dumps some of the more interesting IFF header values to current o/p stream} %externalintegerfnspec IFF READ IMAGE %alias "IFF_READ_IMAGE"( %c %record (iffhdr fm) %name iffh, %integer address) {reads the image from an IFF OPENed file which has had the header read by} {IFF READ HEADER (normally). Will expand the image if compressed} %externalintegerfnspec IFF WRITE IMAGE %alias "IFF_WRITE_IMAGE"( %c %record (iffhdr fm) %name iffh, %integer address) {writes the image to an IFF OPENed file which has had the header written by} {IFF WRITE HEADER (normally). Will compress the image if IFFHDR_DATATYPE has} {the compress bits set} %externalintegerfnspec iff readin %alias "IFF_READIN" (%string (255) file, %record (iffhdr fm) %name iffh, %integername ad) %externalintegerfnspec iff writeout %alias "IFF_WRITEOUT" (%string (255) file, %record (iffhdr fm) %name iffh, %integer ad) %endoffile