TexSysdepInline:
DEFINITIONS
IMPORTS Basics, SirPress, TexSysdep
= BEGIN OPEN PascalBasic, TexTypes;
PressSetX:
PROCEDURE [
X:
INT] =
INLINE {
xCoord ← LOOPHOLE[Basics.LowHalf[LOOPHOLE[X]]];
IF NOT pyping THEN StartPyping[xCoord]
ELSE
IF pypePosnsCount = pypePosnsLimit
THEN
{TexSysdep.FlushPype[]; StartPyping[xCoord]}
ELSE {pypePosnsCount ← pypePosnsCount + 1; SirPress.PipePosition[pype, xCoord]};
};
PressSetY:
PROCEDURE [
Y:
INT] =
INLINE {
newY: INTEGER ← LOOPHOLE[Basics.LowHalf[LOOPHOLE[Y]]];
IF pyping AND yCoord # newY THEN TexSysdep.FlushPype[];
yCoord ← newY};
PressShowChar:
PROCEDURE [C: Quarterword] =
INLINE {
IF pypeCharsCount = pypeCharsLimit
THEN
{TexSysdep.FlushPype[]; StartPyping[xCoord]};
pypeCharsCount ← pypeCharsCount+1;
SirPress.PipeChar[pype, LOOPHOLE[C]];
};
StartPyping:
PROCEDURE [x:
INTEGER] =
INLINE {
SirPress.OpenPipe[pressHandle, pype];
pyping ← TRUE;
pypeCharsLimit ← pype.text.maxLength - pype.text.length;
pypeCharsCount ← 0;
SirPress.PipePosition[pype, x];
pypePosnsCount ← 1;
};
Mem:
PROCEDURE [First: PascalInteger]
RETURNS [LONG POINTER TO TexTypes.MemoryWord] = INLINE {
RETURN [memStart+First+First];
};
-- now, for the definitions of new globals
memStart: LONG POINTER;
pressFileStream: IO.STREAM;
pressHandle: SirPress.PressHandle;
pype: SirPress.Pipe;
xCoord, yCoord: INTEGER;
pyping: BOOLEAN;
pypePosnsLimit: INTEGER = 200;
pypePosnsCount: INTEGER;
pypeCharsLimit: INTEGER;
pypeCharsCount: INTEGER;
END.