$save nolist /* *============================================================================ * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE * * Permission to use for any purpose, modify, copy, and make enhancements * and derivative works of the software is granted if attribution is given to * R.M. Gillmore, dba the ACME Software Deli, as the author * * While the ACME Software Deli does not work for money, there is nonetheless * a significant amount of work involved. The ACME Software Deli maintains the * rights to all code written, though it may be used and distributed as long as * the following conditions are maintained. * * 1. The copyright statement at the top of each code block is maintained in * your distribution. * 2. You do not identify yourself as the ACME Software Deli * 3. Any changes made to the software are sent to the ACME Software Deli *============================================================================ */ /* * $Id: mem4Edit.ext 1157 2025-05-05 00:35:39Z rmgillmore $ */ $if not MEMORY_MGR_4_EDITOR_INCLUDED $set( MEMORY_MGR_4_EDITOR_INCLUDED ) /* just so the math works out nicely, each line will be a maximum of 114 char. * the remainder of the 128 bytes in a line are the items in the header * structure, including the linked list (prevLine/nextLine) and the address * of the next buffer in the memory chain */ declare MAX_LINE_LENGTH literally '125'; /* * the contents of a line is limited (as defined herein) to MAX_LINE_LENGTH * bytes. Doing the math: * MAX_LINE_LENGTH + size( currentLength ) + size( NUL ) is 128 bytes * a perfect value to yield the maximum number of blocks */ /* * in a lineRecord_t structure, the following are allocated for use: * * * nextBuffer is used in the line record managers defined herein * * prevLinePtr, nextLinePtr are going to be used in the editor * as part of the doubly-linked list of line contents * * lineContent is what the user will work with * * currentLength is the index to the last defined element in the * lineContent array */ declare lineRecord_t literally 'structure ( currentLength word, lineContent ( MAX_LINE_LENGTH ) char )'; $if not MEM_MGR_4_EDIT_IMPLEMENTATION allocateLineRecord: procedure ( lineNumber ) pointer external; declare lineNumber integer; end allocateLineRecord; getLineRecord: procedure ( lineNumber ) pointer external; declare lineNumber integer; end getLineRecord; returnLineRecord: procedure ( recordPtr ) external; declare recordPtr pointer; end returnLineRecord; clearLineRecords: procedure external; end clearLineRecords; $endif $endif $restore