(************************************************************************** $RCSfile: Translator.mod $ Description: Interface to translator.library Created by: fjc (Frank Copeland) $Revision: 1.2 $ $Author: fjc $ $Date: 1994/05/12 19:11:02 $ Copyright © 1994, Frank Copeland. This file is part of the Oberon-A Library. See Oberon-A.doc for conditions of use and distribution. Log entries are at the end of the file. ***************************************************************************) MODULE Translator; (* $P- allow non-portable code *) IMPORT Exec, SYSTEM; CONST trNotUsed * = -1; trNoMem * = -2; trMakeBad * = -4; (*-- Library Base variable --------------------------------------------*) TYPE TranslatorBasePtr = CPOINTER TO TranslatorBase; TranslatorBase = RECORD (Exec.Library) END; CONST Name = "translator.library"; VAR Base* : TranslatorBasePtr; cleanup : PROCEDURE (rc : LONGINT); (*-- Library Functions ------------------------------------------------*) LIBCALL (base : TranslatorBasePtr) Translate * ( inputString {8} : ARRAY OF CHAR; inputLength {0} : LONGINT; VAR outputBuffer {9} : ARRAY OF CHAR; bufferSize {1} : LONGINT ) : LONGINT; -30; (*-- Library Base variable --------------------------------------------*) (* $L- Address globals through A4 *) (*-----------------------------------*) PROCEDURE* CloseLib (rc : LONGINT); BEGIN IF Base # NIL THEN Exec.Base.CloseLibrary (Base) END; IF cleanup # NIL THEN cleanup (rc) END END CloseLib; (*-----------------------------------*) PROCEDURE OpenLib * (); BEGIN IF Base = NIL THEN Base := Exec.Base.OpenLibrary (Name, Exec.libraryMinimum); IF Base = NIL THEN HALT (100) END; SYSTEM.SETCLEANUP (CloseLib, cleanup) END; END OpenLib; BEGIN Base := NIL; cleanup := NIL END Translator. (************************************************************************** $Log: Translator.mod $ Revision 1.2 1994/05/12 19:11:02 fjc - Prepared for release Revision 1.1 1994/01/15 21:04:12 fjc - Start of revision control ***************************************************************************) (* Comments stripped by StripComments 1.0 *)