-- RopeEditingAlloc.mesa; written by Bill Paxton, March 1981
-- edited by McGregor, February 8, 1983 11:06 am
DIRECTORY
RopeReader,
Rope;
RopeEditingAlloc: CEDAR DEFINITIONS =
BEGIN
CharsArray: TYPE = RopeReader.CharsArray;
Chars: TYPE = REF CharsArray;
ROPE: TYPE = Rope.ROPE;
AllocChars: PROC [len: NAT]
RETURNS [chars: Chars, start: NAT, base: ROPE];
-- for use by routines in RopeFrom. not for general use.
-- allocates room for len characters
-- chars is the array to hold them starting at start
-- base is rope pointing to the entire chars array
AllocWords: PROC [nwords: NAT]
RETURNS [chars: Chars, start: NAT, base: ROPE];
-- for use by routines in RopeFrom. not for general use.
-- ensures that start is even, i.e., start on word boundary
TryAllocAdjacent: PROC [base: ROPE, start: NAT, len: NAT]
RETURNS [ok: BOOLEAN, chars: Chars];
-- for use by routines in RopeFrom. not for general use.
-- if base is current CharsArray
-- and start is current next free loc in base
-- and there are at least len free chars remaining
-- then allocates those chars and returns true
-- these provide a cache of text buffers
GetBlock: PROC RETURNS [blk: REF TEXT];
FreeBlock: PROC [blk: REF TEXT];
-- ***** Initialization
END.