1{ 2 This file is part of the Free Pascal run time library. 3 Copyright (c) 1999-2000 by the Free Pascal development team 4 5 Textrec record definition 6 7 See the file COPYING.FPC, included in this distribution, 8 for details about the copyright. 9 10 This program is distributed in the hope that it will be useful, 11 but WITHOUT ANY WARRANTY; without even the implied warranty of 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 13 14 **********************************************************************} 15 16{ 17 This file contains the definition of the textrec record. 18 It is put separately, so it is available outside the system 19 unit without sacrificing TP compatibility. 20} 21 22const 23{$ifdef CPUAVR} 24 TextRecNameLength = 16; 25 TextRecBufSize = 16; 26{$else CPUAVR} 27 TextRecNameLength = 256; 28 TextRecBufSize = 256; 29{$endif CPUAVR} 30type 31 TLineEndStr = string [3]; 32 TextBuf = array[0..TextRecBufSize-1] of ansichar; 33 TTextBuf = TextBuf; 34 35 { using packed makes the compiler to generate ugly code on some CPUs, further 36 using packed causes the compiler to handle arrays of text wrongly, see see tw0754 e.g. on arm } 37 TextRec = {$ifdef VER2_6} packed {$endif} Record 38 Handle : THandle; 39{$if defined(CPU8) or defined(CPU16)} 40 Mode : Word; 41{$else} 42 Mode : longint; 43{$endif} 44 bufsize : SizeInt; 45 _private : SizeInt; 46 bufpos, 47 bufend : SizeInt; 48 bufptr : ^textbuf; 49 openfunc, 50 inoutfunc, 51 flushfunc, 52 closefunc : codepointer; 53 UserData : array[1..32] of byte; 54 name : array[0..textrecnamelength-1] of TFileTextRecChar; 55 LineEnd : TLineEndStr; 56 buffer : textbuf; 57{$ifdef FPC_HAS_CPSTRING} 58 CodePage : TSystemCodePage; 59{$endif} 60 End; 61 62