textrec.inc 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. {
  2. $Id$
  3. This file is part of the Free Pascal run time library.
  4. Copyright (c) 1993-98 by the Free Pascal development team
  5. Textrec record definition
  6. See the file COPYING.FPC, included in this distribution,
  7. for details about the copyright.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  11. **********************************************************************}
  12. {
  13. This file contains the definition of the textrec record.
  14. It is put separately, so it is available outside the system
  15. unit without sacrificing TP compatibility.
  16. }
  17. {$ifndef VER0_99_5}
  18. {$ifndef VER0_99_6}
  19. {$define UNIFORM_TEXTREC}
  20. {$endif}
  21. {$endif}
  22. {$ifdef UNIFORM_TEXTREC}
  23. const
  24. TextRecNameLength = 255;
  25. type
  26. TextBuf = array[0..255] of char;
  27. TextRec = Packed Record
  28. Handle,
  29. Mode,
  30. bufsize,
  31. _private,
  32. bufpos,
  33. bufend : longint;
  34. bufptr : ^textbuf;
  35. openfunc,
  36. inoutfunc,
  37. flushfunc,
  38. closefunc : pointer;
  39. UserData : array[1..16] of byte;
  40. name : array[0..textrecnamelength] of char;
  41. buffer : textbuf;
  42. End;
  43. {$else UNIFORM_TEXTREC}
  44. {**********************************
  45. Old style for 0.99.5/0.99.6
  46. **********************************}
  47. Const
  48. {$ifdef linux}
  49. textrecnamelength = 255;
  50. {$endif}
  51. {$ifdef Win32}
  52. textrecnamelength = 255;
  53. {$endif}
  54. {$ifdef MACOS}
  55. textrecnamelength = 255;
  56. {$endif}
  57. {$ifdef AMIGA}
  58. textrecnamelength = 255;
  59. {$endif}
  60. {$ifdef OS2}
  61. textrecnamelength = 79;
  62. {$endif}
  63. {$ifdef Go32v1}
  64. textrecnamelength = 79;
  65. {$endif Go32v1}
  66. {$ifdef Go32v2}
  67. textrecnamelength = 79;
  68. {$endif Go32v2}
  69. {$ifdef ATARI}
  70. textrecnamelength = 79;
  71. {$endif}
  72. type
  73. textbuf = array[0..127] of char;
  74. {$PACKRECORDS 2}
  75. textrec = record
  76. {$ifdef win32}
  77. handle : longint;
  78. {$endif win32}
  79. {$ifdef amiga}
  80. handle : longint;
  81. {$endif amiga}
  82. {$ifdef macos}
  83. handle : longint;
  84. {$endif macos}
  85. {$ifdef linux}
  86. handle : word;
  87. {$endif}
  88. {$ifdef Go32v1}
  89. handle : word;
  90. {$endif Go32v1}
  91. {$ifdef Go32v2}
  92. handle : word;
  93. {$endif Go32v2}
  94. {$ifdef atari}
  95. handle : word;
  96. {$endif atari}
  97. {$ifdef os2}
  98. handle : word;
  99. {$endif os2}
  100. mode : word;
  101. bufsize,
  102. _private,
  103. bufpos,
  104. bufend : word;
  105. bufptr : ^textbuf;
  106. openfunc,
  107. inoutfunc,
  108. flushfunc,
  109. closefunc : pointer;
  110. userdata : array[1..16] of byte;
  111. name : array[0..textrecnamelength] of char;
  112. buffer : textbuf;
  113. end;
  114. {$endif UNIFORM_TEXTREC}
  115. {
  116. $Log$
  117. Revision 1.4 1998-09-04 18:16:15 peter
  118. * uniform filerec/textrec (with recsize:longint and name:0..255)
  119. Revision 1.3 1998/05/21 15:37:19 carl
  120. + working version now ok
  121. }