************************************************************* * * * VMP$MAPFILE - Vicki Woolf's file mapping procedures * * * * Software specification * * (02-FEB-80) * * * ************************************************************* VICKI WOOLF PROGRAM OF COMPUTER GRAPHICS - CORNELL UNIVERSITY 120 RAND HALL ITHACA NEW YORK 14853 1) Mapping to a file: Calling format: retstatus = VMP$MAP_FILE(id,spec,type,access, 2 windowsize,filelength) Inputs: spec = CHARACTER file specification type = CHARACTER file type ('OLD','NEW') access = CHARACTER file access ('R/O','R/W') windowsize = INTEGER*4 number of bytes in mapping window Outputs: id = INTEGER*4 file identification number filelength = INTEGER*4 number of bytes in file retstatus = INTEGER*4 return status (to be defined) Action: Open the specified file, returning a unique identification number and the total number of bytes in the file to the caller (return filelength of zero if new file). No mapping is performed by this procedure. 2) Unmapping from a file: Calling format: retstatus = VMP$UNMAP_FILE(id,filelength) Inputs: id = INTEGER*4 file identification number filelength = INTEGER*4 number of bytes in file Outputs: retstatus = INTEGER*4 return status (to be defined) Action: Update, unmap and close the file, either extending or truncating the file to the specified number of bytes. 3) Finding a record: Calling format: retstatus = VMP$MAP_RECORD(id,recposition,reclength,address) Inputs: id = INTEGER*4 file identification number recposition = INTEGER*4 byte position of record in file (0...) reclength = INTEGER*4 number of bytes in record (1..windowsize) Outputs: address = INTEGER*4 virtual address of record retstatus = INTEGER*4 return status (to be defined) Action: For any specified recposition, this procedure returns a virtual address through which at least reclength bytes starting at that position may be accessed by the caller. For file reading, this length is set by the caller to the largest record expected to occur in the file. For writing, it is set to the actual length of the record being written. If the specified position is beyond the current end-of-file, the file is extended as necessary (subject to access flag).