-- TexFileDefs.mesa

-- last written by Doug Wyatt, January 18, 1980  11:50 PM

DIRECTORY
	AltoFileDefs: FROM "AltoFileDefs",
	SegmentDefs: FROM "SegmentDefs";

TexFileDefs: DEFINITIONS =
BEGIN

filenamesize: CARDINAL=60;

FileHandle: TYPE = SegmentDefs.FileHandle;

LookupFailed: SIGNAL[name: STRING];

ReadWrite: TYPE = {read,write};

-- open the given file; SIGNALs FileError if lookup fails
OpenFile: PROCEDURE[filename: STRING, rw: ReadWrite]
	RETURNS[FileHandle];

OpenFileFromFP: PROCEDURE[fp: POINTER TO AltoFileDefs.FP, rw: ReadWrite]
	RETURNS[FileHandle];

-- if filename has no extension, append a "." and the given extension
DefaultExtension: PROCEDURE[filename,extension: STRING];

-- strip filename's extension, if any
StripExtension: PROCEDURE[filename: STRING];

-- append filename's name and extension to name and ext respectively
NameAndExtension: PROCEDURE[filename,name,ext: STRING];


TexFile: PROGRAM;

END.