浏览代码

+ Initial check-in

michael 21 年之前
父节点
当前提交
b941c2d82f
共有 7 个文件被更改,包括 9390 次插入0 次删除
  1. 667 0
      docs/crt.xml
  2. 1418 0
      docs/dos.xml
  3. 1060 0
      docs/keyboard.xml
  4. 527 0
      docs/mouse.xml
  5. 3264 0
      docs/objects.xml
  6. 1453 0
      docs/sockets.xml
  7. 1001 0
      docs/video.xml

+ 667 - 0
docs/crt.xml

@@ -0,0 +1,667 @@
+<?xml version="1.0" encoding="ISO8859-1"?>
+<fpdoc-descriptions>
+<!--  
+
+   $Id$ 
+   This file is part of the FPC documentation. 
+   Copyright (C) 1997, by Michael Van Canneyt 
+ 
+   The FPC documentation is free text; you can redistribute it and/or 
+   modify it under the terms of the GNU Library General Public License as 
+   published by the Free Software Foundation; either version 2 of the 
+   License, or (at your option) any later version. 
+ 
+   The FPC Documentation 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.  See the GNU 
+   Library General Public License for more details. 
+ 
+   You should have received a copy of the GNU Library General Public 
+   License along with the FPC documentation; see the file COPYING.LIB.  If not, 
+   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 
+   Boston, MA 02111-1307, USA. 
+ -->
+<package name="rtl">
+<module name="crt">
+<short>CRT - Turbo Pascal screen and keyboard handling unit</short>
+<!-- \FPCexampledir{crtex} -->
+<descr>
+<p>
+This chapter describes the <var>CRT</var> unit for Free Pascal, both under dos
+linux and Windows. The unit was first written for dos by Florian klaempfl. 
+The unit was ported to linux by Mark May and enhanced by Michael Van Canneyt
+and Peter Vreman. It works on the linux console, and in xterm and rxvt windows
+under X-Windows. The functionality for both is the same, except that under
+linux the use of an early implementation (versions 0.9.1 and earlier of the
+compiler) the crt unit automatically cleared the screen at program startup.
+</p>
+<p>
+There are some caveats when using the CRT unit:
+</p>
+<ul>
+<li> Programs using the CRT unit will <em> not</em> be usable when input/output 
+is being redirected on the command-line.
+</li>
+<li> For similar reasons they are not usable as CGI-scripts for use with a 
+webserver. 
+</li>
+<li> The use of the CRT unit and the graph unit may not always be supported. 
+</li>
+<li> On linux or other unix OSes , executing other programs that expect 
+special terminal behaviour (using one of the special functions in the linux
+unit) will not work. The terminal is set in RAW mode, which will destroy
+most terminal emulation settings.
+</li>
+</ul>
+</descr>
+
+<element name="Black">
+<short>Black color attribute</short>
+</element>
+
+<element name="Blue">
+<short>Blue color attribute</short>
+</element>
+
+<element name="Green">
+<short>Green color attribute</short>
+</element>
+
+<element name="Cyan">
+<short>Cyan color attribute</short>
+</element>
+
+<element name="Red">
+<short>Red color attribute</short>
+</element>
+
+<element name="Magenta">
+<short>Magenta color attribute</short>
+</element>
+
+<element name="Brown">
+<short>Brown color attribute</short>
+</element>
+
+<element name="LightGray">
+<short>Light gray color attribute</short>
+</element>
+
+<element name="DarkGray">
+<short>Dark gray color attribute</short>
+</element>
+
+<element name="LightBlue">
+<short>Light Blue color attribute</short>
+</element>
+
+<element name="LightGreen">
+<short>Light green color attribute</short>
+</element>
+
+<element name="LightCyan">
+<short>Light cyan color attribute</short>
+</element>
+
+<element name="LightRed">
+<short>Light red color attribute</short>
+</element>
+
+<element name="LightMagenta">
+<short>Light magenta color attribute</short>
+</element>
+
+<element name="Yellow">
+<short>Yellow color attribute</short>
+</element>
+
+<element name="White">
+<short>White color attribute</short>
+</element>
+
+<element name="Blink">
+<short>Blink attribute</short>
+</element>
+
+<element name="TextAttr">
+<short>Mask to filter text attribute</short>
+<descr>
+The <var>TextAttr</var> variable controls the attributes with which characters
+are written to screen.
+</descr>
+</element>
+
+<element name="TextChar">
+<short>Text character used when filling</short>
+</element>
+
+<element name="CheckBreak">
+<short>Check for CTRL-Break keystroke. Not used.</short>
+</element>
+
+<element name="CheckEOF">
+<short>Check for EOF on standard input. Not used.</short>
+</element>
+
+<element name="CheckSnow">
+<short>Check snow on CGA screens. Not used.</short>
+</element>
+
+<element name="DirectVideo">
+<short>Use direct video access. DOS only</short>
+<descr>
+The <var>DirectVideo</var> variable controls the writing to the screen. If it is
+<var>True</var>, the the cursor is set via direct port access. If <var>False</var>,
+then the BIOS is used. This is defined under dos only.
+</descr>
+</element>
+
+<element name="LastMode">
+<short>Last screen mode.</short>
+<descr>
+The <var>Lastmode</var> variable tells you which mode was last selected for the
+screen. It is defined on DOS only.
+</descr>
+</element>
+
+<element name="WindMin">
+<short>Minimum window dimension</short>
+</element>
+
+<element name="WindMax">
+<short>Maximum window dimension</short>
+</element>
+
+<element name="WindMaxX">
+<short>Maximum window X size</short>
+</element>
+
+<element name="WindMaxY">
+<short>Maximum window Y size</short>
+</element>
+
+<element name="WindMinX">
+<short>Minimum window X size</short>
+</element>
+
+<element name="WindMinY">
+<short>Minimum window Y size</short>
+</element>
+
+<element name="ScreenWidth">
+<short>Current screen width</short>
+</element>
+
+<element name="ScreenHeight">
+<short>Current screen height.</short>
+</element>
+
+<element name="bw40">
+<short>40 columns black and white screen mode.</short>
+</element>
+
+<element name="co40">
+<short>40 columns color screen mode.</short>
+</element>
+
+<element name="c40">
+<short>40 columns color screen mode.</short>
+</element>
+
+<element name="bw80">
+<short>80 columns black and white screen mode.</short>
+</element>
+
+<element name="co80">
+<short>80 columns color screen mode.</short>
+</element>
+
+<element name="c80">
+<short>80 columns color screen mode.</short>
+</element>
+
+<element name="mono">
+<short>Monochrome screen mode (hercules screens)</short>
+</element>
+
+<element name="Font8x8">
+<short>Internal ROM font mode</short>
+</element>
+
+<element name="ConsoleMaxX" skip="1"/>
+<element name="ConsoleMaxY" skip="1"/>
+<element name="Flushing" skip="1"/>
+<element name="PConsoleBuf" skip="1"/>
+<element name="TCharAttr" skip="1"/>
+<element name="TConsoleBuf" skip="1"/>
+<element name="ConsoleBuf" skip="1"/>
+
+
+<element name="AssignCrt">
+<short>Assign file to CRT.</short>
+<descr>
+<var>AssignCrt</var> Assigns a file <var>F</var> to the console. Everything written to 
+the file <var>F</var> goes to the console instead. If the console contains a window, 
+everything is written to the window instead.
+</descr>
+<errors>
+None.
+</errors>
+<seealso>
+<link id="Window"/>
+</seealso>
+<example file="crtex/ex1"/>
+</element>
+
+ 
+<element name="CursorBig">
+<short>Show big cursor</short>
+<descr>
+<var>CursorBig</var> makes the cursor a big rectangle. 
+Not implemented on unixes.
+</descr>
+<errors>
+None.
+</errors>
+<seealso>
+<link id="CursorOn"/>
+<link id="CursorOff"/>
+</seealso>
+</element>
+
+<element name="ClrEol">
+<short>Clear from cursor position till end of line.</short>
+<descr>
+<var>ClrEol</var> clears the current line, starting from the cursor position, to the
+end of the window. The cursor doesn't move
+</descr>
+<errors>
+None.
+</errors>
+<seealso>
+<link id="DelLine"/>
+<link id="InsLine"/>
+<link id="ClrScr"/>
+</seealso>
+<example file="crtex/ex9"/>
+</element>
+
+ 
+<element name="ClrScr">
+<short>Clear current window.</short>
+<descr>
+<var>ClrScr</var> clears the current window (using the current colors), 
+and sets the cursor in the top left
+corner of the current window.
+</descr>
+<errors>
+None.
+</errors>
+<seealso>
+<link id="Window"/> 
+</seealso>
+<example file="crtex/ex8"/>
+</element>
+
+ 
+<element name="CursorOff">
+<short>Hide cursor</short>
+<descr>
+<var>CursorOff</var> switches the cursor off (i.e. the cursor is no
+longer visible).  Not implemented on unixes.
+</descr>
+<errors>
+None.
+</errors>
+<seealso>
+<link id="CursorOn"/>
+<link id="CursorBig"/>
+</seealso>
+</element>
+
+<element name="CursorOn">
+<short>Display cursor</short>
+<descr>
+<var>CursorOn</var> switches the cursor on. Not implemented on unixes.
+</descr>
+<errors>
+None.
+</errors>
+<seealso>
+<link id="CursorBig"/>
+<link id="CursorOff"/>
+</seealso>
+</element>
+
+<element name="Delay">
+<short>Delay program execution.</short>
+<descr>
+<var>Delay</var> waits a specified number of milliseconds. The number of specified
+seconds is an approximation, and may be off a lot, if system load is high.
+</descr>
+<errors>
+None
+</errors>
+<seealso>
+<link id="Sound"/>
+<link id="NoSound"/>
+</seealso>
+<example file="crtex/ex15"/>
+</element>
+
+ 
+<element name="DelLine">
+<short>Delete line at cursor position.</short>
+<descr>
+<var>DelLine</var> removes the current line. Lines following the current line are 
+scrolled 1 line up, and an empty line is inserted at the bottom of the
+current window. The cursor doesn't move.
+</descr>
+<errors>
+None.
+</errors>
+<seealso>
+<link id="ClrEol"/>
+<link id="InsLine"/>
+<link id="ClrScr"/>
+</seealso>
+<example file="crtex/ex11"/>
+</element>
+
+ 
+<element name="GotoXY">
+<short>Set cursor position on screen.</short>
+<descr>
+<var>GotoXY</var> positions the cursor at <var>(X,Y)</var>, <var>X</var> in horizontal, <var>Y</var> in
+vertical direction relative to the origin of the current window. The origin
+is located at <var>(1,1)</var>, the upper-left corner of the window.
+</descr>
+<errors>
+None.
+</errors>
+<seealso>
+<link id="WhereX"/>
+<link id="WhereY"/>
+<link id="Window"/> 
+</seealso>
+<example file="crtex/ex6"/>
+</element>
+
+ 
+<element name="HighVideo">
+<short>Switch to highlighted text mode</short>
+<descr>
+<var>HighVideo</var> switches the output to highlighted text. (It sets the high
+intensity bit of the video attribute)
+</descr>
+<errors>
+None.
+</errors>
+<seealso>
+<link id="TextColor"/>
+<link id="TextBackground"/>
+<link id="LowVideo"/>
+<link id="NormVideo"/>
+</seealso>
+<example file="crtex/ex14"/>
+</element>
+
+ 
+<element name="InsLine">
+<short>Insert an empty line at cursor position</short>
+<descr>
+<var>InsLine</var> inserts an empty line at the current cursor position. 
+Lines following the current line are scrolled 1 line down, 
+causing the last line to disappear from the window. 
+The cursor doesn't move.
+</descr>
+<errors>
+None.
+</errors>
+<seealso>
+<link id="ClrEol"/>
+<link id="DelLine"/>
+<link id="ClrScr"/>
+</seealso>
+<example file="crtex/ex10"/>
+</element>
+
+
+<element name="KeyPressed">
+<short>Check if there is a keypress in the keybuffer</short>
+<descr>
+<var>Keypressed</var> scans the keyboard buffer and sees if a key has
+been pressed. If this is the case, <var>True</var> is returned. If not,
+<var>False</var> is returned. The <var>Shift, Alt, Ctrl</var> keys are not reported.
+The key is not removed from the buffer, and can hence still be read after
+the <var>KeyPressed</var> function has been called.
+</descr>
+<errors>
+None.
+</errors>
+<seealso>
+<link id="ReadKey"/>
+</seealso>
+<example file="crtex/ex2"/>
+</element>
+
+ 
+<element name="LowVideo">
+<short>Switch to low intensity colors.</short>
+<descr>
+<p>
+<var>LowVideo</var> switches the output to non-highlighted text. (It clears the high
+intensity bit of the video attribute)
+</p>
+<p>
+For an example, see <link id="HighVideo"/>
+</p>
+</descr>
+<errors>
+None.
+</errors>
+<seealso>
+<link id="TextColor"/>
+<link id="TextBackground"/>
+<link id="HighVideo"/>
+<link id="NormVideo"/>
+</seealso>
+</element>
+
+<element name="NormVideo">
+<short>Return to normal (startup) modus</short>
+<descr>
+<p>
+<var>NormVideo</var> switches the output to the defaults, read at startup. (The
+defaults are read from the cursor position at startup)
+</p>
+<p>
+For an example, see <link id="HighVideo"/>
+</p>
+</descr>
+<errors>
+None.
+</errors>
+<seealso>
+<link id="TextColor"/>
+<link id="TextBackground"/>
+<link id="LowVideo"/>
+<link id="HighVideo"/>
+</seealso>
+</element>
+
+<element name="NoSound">
+<short>Stop system speaker</short>
+<descr>
+<var>NoSound</var> stops the speaker sound. 
+This call is not supported on all operating systems.
+</descr>
+<errors>
+None.
+</errors>
+<seealso>
+<link id="Sound"/>
+</seealso>
+<example file="crtex/ex16"/>
+</element>
+
+<element name="ReadKey">
+<short>Read key from keybuffer</short>
+<descr>
+<p>
+<var>ReadKey</var> reads 1 key from the keyboard buffer, and returns this.
+If an extended or function key has been pressed, then the zero ASCII code is 
+returned. You can then read the scan code of the key with a second ReadKey
+call.
+</p>
+<p>
+Key mappings under Linux can cause the wrong key to be
+reported by <var>ReadKey</var>, so caution is needed when using
+<var>ReadKey</var>. 
+</p>
+</descr>
+<errors>
+None.
+</errors>
+<seealso>
+<link id="KeyPressed"/>
+</seealso>
+<example file="crtex/ex3"/>
+</element>
+
+
+<element name="Sound">
+<short>Sound system speaker</short>
+<descr>
+<var>Sound</var> sounds the speaker at a frequency of <var>hz</var>. Under Windows,
+a system sound is played and the frequency parameter is ignored.
+On other operating systems, this routine may not be implemented.
+</descr>
+<errors>
+None.
+</errors>
+<seealso>
+<link id="NoSound"/>
+</seealso>
+</element>
+
+<element name="TextBackground">
+<short>Set text background</short>
+<descr>
+<var>TextBackground</var> sets the background color to <var>CL</var>. <var>CL</var> can be one of the
+predefined color constants.
+</descr>
+<errors>
+None.
+</errors>
+<seealso>
+<link id="TextColor"/>
+<link id="HighVideo"/>
+<link id="LowVideo"/>
+<link id="NormVideo"/>
+</seealso>
+<example file="crtex/ex13"/>
+</element>
+
+ 
+<element name="TextColor">
+<short>Set text color</short>
+<descr>
+<var>TextColor</var> sets the foreground color to <var>CL</var>. <var>CL</var> can be one of the
+predefined color constants.
+</descr>
+<errors>
+None.
+</errors>
+<seealso>
+<link id="TextBackground"/>
+<link id="HighVideo"/>
+<link id="LowVideo"/>
+<link id="NormVideo"/>
+</seealso>
+<example file="crtex/ex12"/>
+</element>
+
+<element name="TextMode">
+<short>Set screen mode.</short>
+<descr>
+<p>
+<var>TextMode</var> sets the textmode of the screen (i.e. the number of lines
+and columns of the screen). The lower byte is use to set the VGA text mode.
+</p>
+<p>
+This procedure is only implemented on dos.
+</p>
+</descr>
+<errors>
+None.
+</errors>
+<seealso>
+<link id="Window"/>
+</seealso>
+</element>
+ 
+<element name="WhereX">
+<short>Return X (horizontal) cursor position</short>
+<descr>
+<var>WhereX</var> returns the current X-coordinate of the cursor, relative to the
+current window. The origin is <var>(1,1)</var>, in the upper-left corner of the
+window.
+</descr>
+<errors>
+None.
+</errors>
+<seealso>
+<link id="GotoXY"/>
+<link id="WhereY"/>
+<link id="Window"/> 
+</seealso>
+<example file="crtex/ex7"/>
+</element>
+ 
+<element name="WhereY">
+<short>Return Y (vertical) cursor position</short>
+<descr>
+<var>WhereY</var> returns the current Y-coordinate of the cursor, relative to the
+current window. The origin is <var>(1,1)</var>, in the upper-left corner of the
+window.
+
+</descr>
+<errors>
+None.
+</errors>
+<seealso>
+ <link id="GotoXY"/>
+<link id="WhereX"/>
+<link id="Window"/> 
+</seealso>
+<example file="crtex/ex7"/>
+</element>
+
+ 
+<element name="Window">
+<short>Create new window on screen.</short>
+<descr>
+<var>Window</var> creates a window on the screen, to which output will be sent.
+<var>(X1,Y1)</var> are the coordinates of the upper left corner of the window,
+<var>(X2,Y2)</var> are the coordinates of the bottom right corner of the window.
+These coordinates are relative to the entire screen, with the top left
+corner equal to <var>(1,1)</var>.
+Further coordinate operations, except for the next Window call,
+are relative to the window's top left corner.
+</descr>
+<errors>
+None.
+</errors>
+<seealso>
+<link id="GotoXY"/>
+<link id="WhereX"/>
+<link id="WhereY"/>
+<link id="ClrScr"/>
+</seealso>
+<example file="crtex/ex5"/>
+</element>
+
+</module>
+</package>
+</fpdoc-descriptions>

+ 1418 - 0
docs/dos.xml

@@ -0,0 +1,1418 @@
+<?xml version="1.0" encoding="ISO8859-1"?>
+<fpdoc-descriptions>
+<!--  
+
+   $Id$ 
+   This file is part of the FPC documentation. 
+   Copyright (C) 1997, by Michael Van Canneyt 
+ 
+   The FPC documentation is free text; you can redistribute it and/or 
+   modify it under the terms of the GNU Library General Public License as 
+   published by the Free Software Foundation; either version 2 of the 
+   License, or (at your option) any later version. 
+ 
+   The FPC Documentation 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.  See the GNU 
+   Library General Public License for more details. 
+ 
+   You should have received a copy of the GNU Library General Public 
+   License along with the FPC documentation; see the file COPYING.LIB.  If not, 
+   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 
+   Boston, MA 02111-1307, USA. 
+ -->
+<package name="rtl">
+<module name="DOS">
+<short>DOS - Turbo Pascal MS-DOS interface</short>
+<!-- \FPCexampledir{dosex} -->
+<descr>
+<p>
+The <file>DOS</file> unit gives access to some operating system calls 
+related to files, the file system, date and time. Except for the 
+PalmOS target, this unit is available to all supported platforms.
+</p>
+<p>
+The unit was first written for dos by Florian Klaempfl. It was ported to 
+linux by Mark May and enhanced by Michael Van Canneyt. 
+The Amiga version was ported by Nils Sjoholm.
+</p>
+<p>
+Under non-DOS systems, some of the functionality is lost, as it is either impossible 
+or meaningless to implement it. Other than that, the functionality for all 
+operating systems is the same.
+</p>
+</descr>
+
+<topic name="fileattributes">
+<short>File attributes</short>
+<descr>
+<p>
+The File Attribute constants are used in <link id="FindFirst"/>,
+<link id="FindNext"/> to
+determine what type of special file to search for in addition to normal files. 
+These flags are also used in the <link id="SetFAttr"/> and <link id="GetFAttr"/> routines to 
+set and retrieve attributes of files. For their definitions consult 
+<link id="fileattributes"/>.
+</p>
+<table>
+<caption>Possible file attributes</caption>
+<th><td>Constant</td><td>Description</td><td>Value</td></th>
+<tr><td><var>readonly</var></td><td><printshort id="readonly"/></td><td> $01</td></tr>
+<tr><td><var>hidden</var> </td><td> <printshort id="hidden"/> </td><td> $02 </td></tr>
+<tr><td><var>sysfile</var> </td><td> <printshort id="sysfile"/> </td><td> $04</td></tr>
+<tr><td><var>volumeid</var> </td><td>  <printshort id="volumeid"/> </td><td> $08</td></tr>
+<tr><td><var>directory</var> </td><td> <printshort id="directory"/> </td><td> $10</td></tr>
+<tr><td><var>archive</var> </td><td> <printshort id="archive"/> </td><td> $20</td></tr> 
+<tr><td><var>anyfile</var> </td><td> <printshort id="anyfile"/> </td><td> $3F</td></tr>
+</table>
+</descr>
+</topic>
+
+<topic name="filemodes">
+<short>File open mode constants.</short>
+<descr>
+<p>
+These constants are used in the <var>Mode</var> field of the <var>TextRec</var>
+record. Gives information on the filemode of the text I/O. For their
+definitions consult the following table:
+</p>
+<table>
+<caption>Possible mode constants</caption>
+<th><td>Constant</td><td>Description</td><td>Value</td></th> 
+<tr><td><var>fmclosed</var></td><td><printshort id="fmclosed"/></td><td>$D7B0</td></tr>
+<tr><td><var>fminput</var></td><td><printshort id="fminput"/></td><td>$D7B1 </td></tr>
+<tr><td><var>fmoutput</var></td><td><printshort id="fmoutput"/></td><td>$D7B2</td></tr>
+<tr><td><var>fminout</var></td><td><printshort id="fminout"/></td><td>$D7B3</td></tr>
+</table>
+</descr>
+</topic>
+
+<topic name="filehandling">
+<short>File handling</short>
+<descr>
+<p>
+Routines to handle files on disk.
+</p>
+<table>
+<th><td>Name</td><td>Description</td></th>
+<tr><td><link id="FExpand"/></td><td>Expand filename to full path</td></tr>
+<tr><td><link id="FindClose"/></td><td>Close finfirst/findnext session</td></tr>
+<tr><td><link id="FindFirst"/></td><td>Start find of file</td></tr>
+<tr><td><link id="FindNext"/></td><td>Find next file</td></tr>
+<tr><td><link id="FSearch"/></td><td>Search for file in a path</td></tr>
+<tr><td><link id="FSplit"/></td><td>Split filename in parts</td></tr>
+<tr><td><link id="GetFAttr"/></td><td>Return file attributes</td></tr>
+<tr><td><link id="GetFTime"/></td><td>Return file time</td></tr>
+<tr><td><link id="GetLongName"/></td><td>Convert short filename to long filename (DOS only)</td></tr>
+<tr><td><link id="GetShortName"/></td><td>Convert long filename to short filename (DOS only)</td></tr>
+<tr><td><link id="SetFAttr"/></td><td>Set file attributes</td></tr>
+<tr><td><link id="SetFTime"/></td><td>Set file time</td></tr>
+</table>
+</descr>
+</topic>
+
+<topic name="diskhandling">
+<short>Directory and disk handling</short>
+<descr>
+<p>
+Routines to handle disk information.
+</p>
+<table>
+<th><td>Name</td><td>Description</td></th>
+<tr><td><link id="AddDisk"/></td><td>Add disk to list of disks (UNIX only)</td></tr>
+<tr><td><link id="DiskFree"/></td><td>Return size of free disk space</td></tr>
+<tr><td><link id="DiskSize"/></td><td>Return total disk size</td></tr>
+</table>
+</descr>
+</topic>
+
+<topic name="process">
+<short>Process handling</short>
+<descr>
+<p>
+Functions to handle process information and starting new processes.
+</p>
+<table>
+<th><td>Name</td><td>Description</td></th>
+<tr><td><link id="DosExitCode"/></td><td>Exit code of last executed program</td></tr>
+<tr><td><link id="EnvCount"/></td><td>Return number of environment variables</td></tr>
+<tr><td><link id="EnvStr"/></td><td>Return environment string pair</td></tr>
+<tr><td><link id="Exec"/></td><td>Execute program</td></tr>
+<tr><td><link id="GetEnv"/></td><td>Return specified environment string</td></tr>
+</table>
+</descr>
+</topic>
+
+<topic name="sysinfo">
+<short>System information</short>
+<descr>
+<p>
+Functions for retrieving and setting general system information such as date
+and time.
+</p>
+<table>
+<th><td>Name</td><td>Description</td></th>
+<tr><td><link id="DosVersion"/></td><td>Get OS version</td></tr>
+<tr><td><link id="GetCBreak"/></td><td>Get setting of control-break handling flag</td></tr>
+<tr><td><link id="GetDate"/></td><td>Get system date</td></tr>
+<tr><td><link id="GetIntVec"/></td><td>Get interrupt vector status</td></tr>
+<tr><td><link id="GetTime"/></td><td>Get system time</td></tr>
+<tr><td><link id="GetVerify"/></td><td>Get verify flag</td></tr>
+<tr><td><link id="Intr"/></td><td>Execute an interrupt</td></tr>
+<tr><td><link id="Keep"/></td><td>Keep process in memory and exit</td></tr>
+<tr><td><link id="MSDos"/></td><td>Execute MS-dos function call</td></tr>
+<tr><td><link id="PackTime"/></td><td>Pack time for file time</td></tr>
+<tr><td><link id="SetCBreak"/></td><td>Set control-break handling flag</td></tr>
+<tr><td><link id="SetDate"/></td><td>Set system date</td></tr>
+<tr><td><link id="SetIntVec"/></td><td>Set interrupt vectors</td></tr>
+<tr><td><link id="SetTime"/></td><td>Set system time</td></tr>
+<tr><td><link id="SetVerify"/></td><td>Set verify flag</td></tr>
+<tr><td><link id="SwapVectors"/></td><td>Swap interrupt vectors</td></tr>
+<tr><td><link id="UnPackTime"/></td><td>Unpack file time</td></tr>
+</table>
+</descr>
+</topic>
+
+
+<element name="fmclosed">
+<short>File is closed</short>
+</element>
+
+<element name="fminput">
+<short>File is read only</short>
+</element>
+
+<element name="fmoutput">
+<short>File is write only</short>
+</element>
+
+<element name="fminout">
+<short>File is read and write</short>
+</element>
+
+<element name="fcarry">
+<short>CPU carry flag. Not used.</short>
+</element>
+
+<element name="fparity">
+<short>CPU parity flag. Not used.</short>
+</element>
+
+<element name="fauxiliary">
+<short>CPU auxiliary flag. Not used.</short>
+</element>
+
+<element name="fzero">
+<short>CPU zero flag. Not used.</short>
+</element>
+
+<element name="fsign">
+<short>CPU sign flag. Not used.</short>
+</element>
+
+<element name="foverflow">
+<short>CPU overflow flag. Not used.</short>
+</element>
+
+<element name="readonly">
+<short>Read-Only file attribute</short>
+</element>
+
+<element name="hidden">
+<short>Hidden file attribute</short>
+</element>
+
+<element name="sysfile">
+<short>System file attribute</short>
+</element>
+
+<element name="volumeid">
+<short>Volumd ID file attribute</short>
+</element>
+
+<element name="directory">
+<short>Directory file attribute</short>
+</element>
+
+<element name="archive">
+<short>Archive file attribute</short>
+</element>
+
+<element name="FileNameLen">
+<short>Maximum length of a filename</short>
+</element>
+
+<element name="anyfile">
+<short>Match any file attribute</short>
+</element>
+
+<element name="ComStr">
+<short>Command-line string type</short>  
+</element>
+
+<element name="PathStr">
+<short>Full File path string type.</short>  
+</element>
+
+<element name="DirStr">
+<short>Full directory string type.</short>  
+</element>
+
+<element name="NameStr">
+<short>Fill filename string type.</short>  
+</element>
+
+<element name="ExtStr">
+<short>Filename extension string type.</short>  
+</element>
+
+<element name="SearchRec">
+<short>File Search Results record</short>
+<descr>
+<p>
+<var>SearchRec</var> is filled by the <link id="FindFirst"/> call and can be
+used in subsequent <link id="FindNext"/> calls to search for files. The
+structure of this record depends on the platform. Only the following
+fields are present on all platforms: 
+</p>
+<dl>
+<dt>Attr</dt><dd>File attributes.</dd>
+<dt>Time</dt><dd>File modification time.</dd>
+<dt>Size</dt><dd>File size</dd>
+<dt>Name</dt><dd>File name (name part only, no path)</dd>
+</dl>
+</descr>
+</element>
+
+<element name="filerecnamelength">
+<short>Maximum length of FileName part in <link id="FileRec"/></short>
+</element>
+
+<element name="FileRec">
+<short>Record describing an untyped file</short>
+<descr>
+<var>FileRec</var> is used for internal representation of typed and untyped files.
+</descr>
+</element>
+
+<element name="FileRec.Handle">
+<short>OS file handle</short>
+</element>
+
+<element name="FileRec.Mode">
+<short>File open mode</short>
+</element>
+
+<element name="FileRec.RecSize">
+<short>Size of a record (in bytes)</short>
+</element>
+
+<element name="FileRec._Private">
+<short>Private data, do not use</short>
+</element>
+
+<element name="FileRec.UserData">
+<short>User data, for implementing a user driver.</short>
+</element>
+
+<element name="FileRec.Name">
+<short>File name</short>
+</element>
+
+<element name="TextRecNameLength">
+<short>Maximum length of filename in <link id="TextRec"/></short>
+</element>
+
+<element name="TextRecBufSize">
+<short>Size of default buffer in <link id="TextRec"/></short>
+</element>
+
+<element name="TextBuf">
+<short>Type for default buffer in <link id="TextRec"/></short>
+</element>
+
+<element name="TextRec">
+<short>Record describing Text files</short>
+<descr>
+<p>
+<var>TextRec</var> describes the internal working of a <var>Text</var> file.
+</p>
+<p>
+Remark that this is not binary compatible with the Turbo Pascal definition
+of <var>TextRec</var>, since the sizes of the different fields are different.
+</p>
+</descr>
+</element>
+
+<element name="Handle">
+<short>OS file handle for this record</short>
+</element>
+
+<element name="Mode">
+<short>File open mode</short>
+</element>
+
+<element name="bufsize">
+<short>Current buffer size.</short>
+</element>
+
+<element name="bufpos">
+<short>Current buffer position.</short>
+</element>
+
+<element name="bufend">
+<short>Current length of data in buffer</short>
+</element>
+
+<element name="bufptr">
+<short>Pointer tuo buffer.</short>
+</element>
+
+<element name="openfunc">
+<short>Called when file needs to be opened.</short>
+</element>
+
+<element name="inoutfunc">
+<short>Called when an I/O operation needs to be performed.</short>
+</element>
+
+<element name="flushfunc">
+<short>Called when buffer must be flushed.</short>
+</element>
+
+<element name="closefunc">
+<short>Called when file must be closed.</short>
+</element>
+
+<element name="UserData">
+<short>Room for user data when implementing custom text file.</short>
+</element>
+
+<element name="name">
+<short>File name.</short>
+</element>
+
+<element name="buffer">
+<short>Default buffer.</short>
+</element>
+
+<element name="Registers">
+<short>Record to keep CPU registers for <link id="MSDos"/> call. Unused.</short>
+</element>
+<element name="DateTime">
+<short>Record containing a date/time description</short>
+<descr>
+The <var>DateTime</var> type is used in <link id="PackTime"/> and <link id="UnPackTime"/> for
+setting/reading file times with <link id="GetFTime"/> and <link id="SetFTime"/>.
+</descr>
+</element>
+
+<element name="DateTime.Year">
+<short>Year part</short>
+</element>
+<element name="DateTime.Month">
+<short>Month of the year</short>
+</element>
+<element name="DateTime.Day">
+<short>Day of the month</short>
+</element>
+<element name="DateTime.Hour">
+<short>Hour of the day</short>
+</element>
+<element name="DateTime.Min">
+<short>Minute of the hour</short>
+</element>
+<element name="DateTime.Sec">
+<short>Second in the minute</short>
+</element>
+
+<element name="DosError">
+<short>Last OS (MS-DOS) error</short>
+<descr>
+<p>
+The <var>DosError</var> variable is used by the procedures in the dos unit to 
+report errors. It can have the following values :
+</p>
+<table>
+<caption>Dos error codes</caption>
+<th><td>Value</td><td>Meaning</td></th>
+<tr><td>2 </td><td> File not found. </td></tr>
+<tr><td>3 </td><td> path not found. </td></tr>
+<tr><td>5 </td><td> Access denied. </td></tr>
+<tr><td>6 </td><td> Invalid handle. </td></tr>
+<tr><td>8 </td><td> Not enough memory. </td></tr>
+<tr><td>10 </td><td> Invalid environment. </td></tr>
+<tr><td>11 </td><td> Invalid format. </td></tr>
+<tr><td>18 </td><td> No more files.</td></tr>
+</table>
+<p>
+Other values are possible, but are not documented.
+</p>
+</descr>
+</element>
+
+<element name="drivestr">
+<short>Pathnames representing drives.</short>
+<descr>
+This variable is defined in the linux version of the dos unit. It is used
+in the <link id="DiskFree"/> and <link id="DiskSize"/> calls.
+</descr>
+</element>
+
+<element name="AddDisk">
+<short>Add disk definition to list if drives (Unix only)</short>
+<descr>
+<p>
+<var>AddDisk</var> adds a filename <var>S</var> to the internal list of disks. It is
+implemented for systems which do not use DOS type drive letters.
+ This list is used to determine which disks to use in the <link id="DiskFree"/>
+and <link id="DiskSize"/> calls. 
+The <link id="DiskFree"/> and <link id="DiskSize"/> functions need a file on the 
+specified drive, since this is required for the <var>statfs</var> system call.
+The names are added sequentially. The dos
+initialization code presets the first three disks to:
+</p>
+<ul>
+<li> <var>'.'</var> for the current drive, </li>
+<li> <var>'/fd0/.'</var> for the first floppy-drive (linux only).</li>
+<li> <var>'/fd1/.'</var> for the second floppy-drive (linux only).</li>
+<li> <var>'/'</var> for the first hard disk.</li>
+</ul>
+<p>
+The first call to <var>AddDisk</var> will therefore add a name for the second
+harddisk, The second call for the third drive, and so on until 23 drives
+have been added (corresponding to drives <var>'D:'</var> to <var>'Z:'</var>)
+</p>
+</descr>
+<errors>
+None
+</errors>
+<seealso>
+<link id="DiskFree"/>
+<link id="DiskSize"/> 
+</seealso>
+</element>
+
+
+<element name="DiskFree">
+<short>Get free size on Disk.</short>
+<descr>
+<p>
+<var>DiskFree</var> returns the number of free bytes on a disk. The parameter
+<var>Drive</var> indicates which disk should be checked. This parameter is 1 for
+floppy <var>a:</var>, 2 for floppy <var>b:</var>, etc. A value of 0 returns the free
+space on the current drive. 
+</p>
+<remark>
+For Unices:
+The <var>diskfree</var> and <var>disksize</var> functions need a file on the 
+specified drive, since this is required for the <var>statfs</var> system call.
+These filenames are set in the initialization of the dos unit, and have 
+been preset to :
+</remark>
+<ul>
+<li> <var>'.'</var> for the current drive, </li>
+<li> <var>'/fd0/.'</var> for the first floppy-drive (linux only).</li>
+<li> <var>'/fd1/.'</var> for the second floppy-drive (linux only).</li>
+<li> <var>'/'</var> for the first hard disk.</li>
+</ul>
+<p>
+There is room for 1-26 drives. You can add a drive with the
+<link id="AddDisk"/> procedure.
+These settings can be coded in <var>dos.pp</var>, in the initialization part.
+</p>
+</descr>
+<errors>
+-1 when a failure occurs, or an invalid drive number is given.
+</errors>
+<seealso>
+<link id="DiskSize"/>
+<link id="AddDisk"/>
+</seealso>
+<example file="dosex/ex6"/>
+</element>
+
+
+<element name="DiskSize">
+<short>Get total size of disk.</short>
+<descr>
+<p>
+<var>DiskSize</var> returns the total size (in bytes) of a disk. The parameter
+<var>Drive</var> indicates which disk should be checked. This parameter is 1 for
+floppy <var>a:</var>, 2 for floppy <var>b:</var>, etc. A value of 0 returns the size
+of the current drive. 
+</p>
+<remark>
+For unix only:
+The <var>diskfree</var> and <var>disksize</var> functions need a file on the specified drive, since this
+is required for the <var>statfs</var> system call.
+These filenames are set in the initialization of the dos unit, and have 
+been preset to :
+</remark>
+<ul>
+<li> <var>'.'</var> for the current drive, </li>
+<li> <var>'/fd0/.'</var> for the first floppy-drive (linux only).</li>
+<li> <var>'/fd1/.'</var> for the second floppy-drive (linux only).</li>
+<li> <var>'/'</var> for the first hard disk.</li>
+</ul>
+<p>
+There is room for 1-26 drives. You can add a drive with the
+<link id="AddDisk"/> procedure.
+These settings can be coded in <var>dos.pp</var>, in the initialization part.
+</p>
+<p>
+For an example, see <link id="DiskFree"/>.
+</p>
+</descr>
+<errors>
+-1 when a failure occurs, or an invalid drive number is given.
+</errors>
+<seealso>
+<link id="DiskFree"/>
+<link id="AddDisk"/>
+</seealso>
+</element>
+
+<element name="DosExitCode">
+<short>Exit code of last executed program.</short>
+<descr>
+<var>DosExitCode</var> contains (in the low byte) the exit-code of a program 
+executed with the <var>Exec</var> call.
+</descr>
+<errors>
+None.
+</errors>
+<seealso>
+<link id="Exec"/>
+</seealso>
+<example file="dosex/ex5"/>
+</element>
+
+<element name="DosVersion">
+<short>Current OS version</short>
+<descr>
+<p>
+<var>DosVersion</var> returns the operating system or kernel version. The
+low byte contains the major version number, while the high byte 
+contains the minor version number.
+</p>
+<remark>
+On systems where versions consists of more then two numbers, 
+only the first two numbers will be returned. For example Linux version 2.1.76 
+will give you DosVersion 2.1. Some operating systems, such as FreeBSD, do not
+have system calls to return the kernel version, in that case a value of 0 will
+be returned.
+</remark>
+</descr>
+<errors>
+None.
+</errors>
+<seealso>
+</seealso>
+<example file="dosex/ex1"/>
+</element>
+
+<element name="EnvCount">
+<short>Return the number of environment variables</short>
+<descr>
+<var>EnvCount</var> returns the number of environment variables.
+</descr>
+<errors>
+None.
+</errors>
+<seealso>
+<link id="EnvStr"/>
+<link id="GetEnv"/>
+</seealso>
+</element>
+
+<element name="EnvStr">
+<short>Return environment variable by index</short>
+<descr>
+
+<var>EnvStr</var> returns the <var>Index</var>-th <var>Name=Value</var> pair from the list
+of environment variables. 
+The index of the first pair is zero.
+</descr>
+<errors>
+The length is limited to 255 characters. 
+</errors>
+<seealso>
+<link id="EnvCount"/>
+<link id="GetEnv"/>
+</seealso>
+<example file="dosex/ex13"/>
+</element>
+
+
+<element name="Exec">
+<short>Execute another program, and wait for it to finish.</short>
+<descr>
+<p>
+<var>Exec</var> executes the program in <var>Path</var>, with the options given by
+<var>ComLine</var>.
+</p>
+<p>
+After the program has terminated, the procedure returns. The Exit value of
+the program can be consulted with the <var>DosExitCode</var> function.
+</p>
+<p>
+For an example, see <link id="DosExitCode"/>
+</p>
+</descr>
+<errors>
+Errors are reported in <var>DosError</var>.
+</errors>
+<seealso>
+<link id="DosExitCode"/>
+</seealso>
+</element>
+
+<element name="FExpand">
+<short>Expand a relative path to an absolute path</short>
+<descr>
+<p>
+<var>FExpand</var> takes its argument and expands it to a complete filename, i.e.
+a filename starting from the root directory of the current drive, prepended
+with the drive-letter or volume name (when supported).
+</p>
+<remark>
+On case sensitive file systems (such as unix and linux), the resulting
+name is left as it is, otherwise it is converted to uppercase.
+</remark>
+</descr>
+<errors>
+<link id="FSplit"/>
+</errors>
+<seealso>
+</seealso>
+<example file="dosex/ex5"/>
+</element>
+
+
+<element name="FindClose">
+<short>Dispose resources allocated by a <link id="FindFirst"/>/<link
+id="FindNext"/> sequence.</short>
+<descr>
+<p>
+<var>FindClose</var> frees any resources associated with the search record
+<var>F</var>.
+</p>
+<p>
+This call is needed to free any internal resources allocated by the 
+<link id="FindFirst"/> or <link id="FindNext"/> calls.
+</p>
+<p>
+The unix implementation of the dos unit therefore keeps a table of open
+directories, and when the table is full, closes one of the directories, and
+reopens another. This system is adequate but slow if you use a lot of
+<var>searchrecs</var>.
+</p>
+<p>
+So, to speed up the findfirst/findnext system, the <var>FindClose</var> call was
+implemented. When you don't need a <var>searchrec</var> any more, you can tell
+this to the dos unit by issuing a <var>FindClose</var> call. The directory
+which is kept open for this <var>searchrec</var> is then closed, and the table slot
+freed.
+</p>
+<remark>
+It is recommended to use the linux call <var>Glob</var> when looking for files 
+on linux.
+</remark>
+</descr>
+<errors>
+Errors are reported in DosError.
+</errors>
+<seealso>
+<link id="FindFirst"/>
+<link id="FindNext"/>
+</seealso>
+</element>
+
+<element name="FindFirst">
+<short>Start search for one or more files.</short>
+<descr>
+<p>
+<var>FindFirst</var> searches the file specified in <var>Path</var>. Normal files,
+as well as all special files which have the attributes specified in
+<var>Attr</var> will be returned.
+</p>
+<p>
+It returns a <var>SearchRec</var> record for further searching in <var>F</var>.
+<var>Path</var> can contain the wildcard characters <var>?</var> (matches any single
+character) and <var>*</var> (matches 0 ore more arbitrary characters). In this
+case <var>FindFirst</var> will return the first file which matches the specified
+criteria.
+If <var>DosError</var> is different from zero, no file(s) matching the criteria 
+was(were) found.
+</p>
+<remark>
+On os/2, you cannot issue two different <var>FindFirst</var> calls. That is,
+you must close any previous search operation with <link id="FindClose"/> before
+starting a new one. Failure to do so will end in a Run-Time Error 6 
+(Invalid file handle)
+</remark>
+</descr>
+<errors>
+Errors are reported in DosError.
+</errors>
+<seealso>
+<link id="FindNext"/>,
+<link id="FindClose"/>
+</seealso>
+<example file="dosex/ex7"/>
+</element>
+
+
+<element name="FindNext">
+<short>Find next matching file after <link id="FindFirst"/></short>
+<descr>
+<p>
+<var>FindNext</var> takes as an argument a <var>SearchRec</var> from a previous
+<var>FindNext</var> call, or a <var>FindFirst</var> call, and tries to find another
+file which matches the criteria, specified in the <var>FindFirst</var> call.
+If <var>DosError</var> is different from zero, no more files matching the
+criteria were found.
+</p>
+<p>
+For an example, see <link id="FindFirst"/>.
+</p>
+</descr>
+<errors>
+<var>DosError</var> is used to report errors.
+</errors>
+<seealso>
+<link id="FindFirst"/>
+<link id="FindClose"/>
+</seealso>
+</element>
+
+<element name="FSearch">
+<short>Search a file in searchpath</short>
+<descr>
+<p>
+<var>FSearch</var> searches the file <var>Path</var> in all directories listed in
+<var>DirList</var>. The full name of the found file is returned.
+<var>DirList</var> must be a list of directories, separated by semi-colons.
+When no file is found, an empty string is returned.
+</p>
+<remark>
+On unix systems, <var>DirList</var> can also be separated by colons, as is
+customary on those environments.
+</remark>
+</descr>
+<errors>
+None.
+</errors>
+<seealso>
+<link id="FExpand">FExpand</link>
+</seealso>
+<example file="dosex/ex10"/>
+</element>
+
+
+ 
+<element name="FSplit">
+<short>Split a full-path filename in parts.</short>
+<descr>
+<var>FSplit</var> splits a full file name into 3 parts : A <var>Path</var>, a
+<var>Name</var> and an extension  (in <var>ext</var>.) 
+The extension is taken to be all letters after the <em> last</em> dot (.). For 
+dos, however, an exception is made when <var>LFNSupport=False</var>, then
+the extension is defined as all characters after the <em> first</em> dot.
+</descr>
+<errors>
+None.
+</errors>
+<seealso>
+<link id="FSearch">FSearch</link>
+</seealso>
+<example file="dosex/ex12"/>
+</element>
+
+
+<element name="GetCBreak">
+<short>Get control-Break flag</short>
+<descr>
+<p>
+<var>GetCBreak</var> gets the status of CTRL-Break checking under dos and Amiga.
+When <var>BreakValue</var> is <var>false</var>, then dos only checks for the 
+CTRL-Break key-press when I/O is performed. When it is set to <var>True</var>,
+then a check is done at every system call.
+</p>
+<remark>
+Under non-dos and non-Amiga operating systems, <var>BreakValue</var> always returns 
+<var>True</var>.
+</remark>
+</descr>
+<errors> 
+None
+</errors>
+<seealso>
+<link id="SetCBreak"/>
+</seealso>
+</element>
+
+<element name="GetDate">
+<short>Get the current date</short>
+<descr>
+<var>GetDate</var> returns the system's date. <var>Year</var> is a number in the range
+1980..2099.<var>mday</var> is the day of the month,
+<var>wday</var> is the day of the week, starting with Sunday as day 0.
+</descr>
+<errors>
+None.
+</errors>
+<seealso>
+<link id="GetTime"/>
+<link id="SetDate"/>
+</seealso>
+<example file="dosex/ex2"/>
+</element>
+
+
+<element name="GetEnv">
+<short>Get environment variable by name.</short>
+<descr>
+<p>
+<var>Getenv</var> returns the value of the environment variable <var>EnvVar</var>.
+When there is no environment variable <var>EnvVar</var> defined, an empty
+string is returned.
+</p>
+<remark>
+Under some operating systems (such as unix), case is important when looking
+for <var>EnvVar</var>.
+</remark>
+</descr>
+<errors>
+None.
+</errors>
+<seealso>
+<link id="EnvCount"/>
+<link id="EnvStr"/>
+</seealso>
+<example file="dosex/ex14"/>
+</element>
+
+<element name="GetFAttr">
+<short>Get file attributes</short>
+<descr>
+<p>
+<var>GetFAttr</var> returns the file attributes of the file-variable <var>f</var>.
+ <var>F</var> can be a untyped or typed file, or of type <var>Text</var>. <var>f</var> must
+have been assigned, but not opened. The attributes can be examined with the
+following constants :
+</p>
+<ul>
+<li> <var>ReadOnly</var></li>
+<li> <var>Hidden</var></li>
+<li> <var>SysFile</var></li>
+<li> <var>VolumeId</var></li>
+<li> <var>Directory</var></li>
+<li> <var>Archive</var></li>
+</ul>
+<p>
+Under linux, supported attributes are:
+</p>
+<ul>
+<li> <var>Directory</var></li>
+<li> <var>ReadOnly</var> if the current process doesn't have access to the file.</li>
+<li> <var>Hidden</var> for files whose name starts with a dot <var>('.')</var>.</li>
+</ul>
+</descr>
+<errors>
+Errors are reported in <var>DosError</var>
+</errors>
+<seealso>
+<link id="SetFAttr"/>
+</seealso>
+<example file="dosex/ex8"/>
+</element>
+
+
+<element name="GetFTime">
+<short>Get file last modification time.</short>
+<descr>
+<var>GetFTime</var> returns the modification time of a file.
+This time is encoded and must be decoded with <var>UnPackTime</var>. 
+<var>F</var> must be a file type, which has been assigned, and
+opened.
+</descr>
+<errors>
+Errors are reported in <var>DosError</var>
+</errors>
+<seealso>
+<link id="SetFTime"/>
+<link id="PackTime"/>
+<link id="UnPackTime"/>
+</seealso>
+<example file="dosex/ex9"/>
+</element>
+
+
+<element name="GetIntVec">
+<short>Get interrupt vector</short>
+<descr>
+<p>
+<var>GetIntVec</var> returns the address of interrupt vector
+<var>IntNo</var>.
+</p>
+<remark>
+This call does nothing, it is present for compatibility only. Modern systems
+do not allow low level access to the hardware.
+</remark>
+</descr>
+<errors>
+None.
+</errors>
+<seealso>
+<link id="SetIntVec"/>
+</seealso>
+</element>
+
+<element name="GetLongName">
+<short>Get the long filename of a DOS 8.3 filename.</short>
+<descr>
+<p>
+This function is only implemented in the GO32V2 version of Free Pascal.
+</p>
+<p>
+<var>GetLongName</var> changes the filename <var>p</var> to a long filename
+if the dos call to do this is successful. The resulting string
+is the long  file name corresponding to the short filename <var>p</var>.
+</p>
+<p>
+The function returns <var>True</var> if the dos call was successful, 
+<var>False</var> otherwise.
+</p>
+<p>
+This function should only be necessary when using the DOS extender
+under Windows 95 and higher.
+</p>
+</descr>
+<errors>
+If the dos call was not succesfull, <var>False</var> is returned.
+</errors>
+<seealso>
+<link id="GetShortName"/>
+</seealso>
+</element>
+
+<element name="GetShortName">
+<short>Get the short (8.3) filename of a long filename.</short>
+<descr>
+<p>
+This function is only implemented in the GO32V2 version of Free Pascal.
+</p>
+<p>
+<var>GetShortName</var> changes the filename <var>p</var> to a short filename
+if the dos call to do this is successful. The resulting string
+is the short file name corresponding to the long filename <var>p</var>.
+</p>
+<p>
+The function returns <var>True</var> if the dos call was successful, 
+<var>False</var> otherwise.
+</p>
+<p>
+This function should only be necessary when using the DOS extender
+under Windows 95 and higher.
+</p>
+</descr>
+<errors>
+If the dos call was not successful, <var>False</var> is returned.
+</errors>
+<seealso>
+<link id="GetLongName"/>
+</seealso>
+</element>
+
+<element name="GetTime">
+<short>Return the current time</short>
+<descr>
+<p>
+<var>GetTime</var> returns the system's time. <var>Hour</var> is a on a 24-hour time
+scale. <var>sec100</var> is in hundredth of a
+second.
+</p>
+<remark>
+Certain operating systems (such as Amiga), always set the <var>sec100</var> field
+to zero.
+</remark>
+</descr>
+<errors>
+None.
+</errors>
+<seealso>
+<link id="GetDate"/>
+<link id="SetTime"/>
+</seealso>
+<example file="dosex/ex3"/>
+</element>
+
+
+<element name="GetVerify">
+<short>Get verify flag</short>
+<descr>
+<p>
+<var>GetVerify</var> returns the status of the verify flag under dos. When
+<var>Verify</var> is <var>True</var>, then dos checks data which are written to disk,
+by reading them after writing. If <var>Verify</var> is <var>False</var>, then data
+written to disk are not verified.
+</p>
+<remark>
+Under non-dos systems (excluding os/2 applications running under vanilla DOS),  
+Verify is always <var>True</var>.
+</remark>
+</descr>
+<errors>
+None.
+</errors>
+<seealso>
+<link id="SetVerify"/>
+</seealso>
+</element>
+
+<element name="Intr">
+<short>Execute interrupt</short>
+<descr>
+<p>
+<var>Intr</var> executes a software interrupt number <var>IntNo</var> (must be between
+0 and 255), with processor registers set to <var>Regs</var>. After the interrupt call
+returned, the processor registers are saved in <var>Regs</var>.
+</p>
+<remark>
+Under non-dos operating systems, this call does nothing.
+</remark>
+</descr>
+<errors>
+None.
+</errors>
+<seealso>
+<link id="MSDos"/>
+</seealso>
+</element>
+
+<element name="Keep">
+<short>Terminate and stay resident.</short>
+<descr>
+<p>
+<var>Keep</var> terminates the program, but stays in memory. This is used for TSR
+(Terminate Stay Resident) programs which catch some interrupt.
+<var>ExitCode</var> is the same parameter as the <var>Halt</var> function takes.
+</p>
+<remark>
+This call does nothing, it is present for compatibility only.
+</remark>
+</descr>
+<errors>
+None.
+</errors>
+<seealso>
+</seealso>
+</element>
+
+<element name="weekday">
+<short>Return the day of the week</short>
+<descr>
+<var>WeekDay</var> returns the day of the week on which the day
+<var>Y/M/D</var> falls. Sunday is represented by 0, Saturday is 6.
+</descr>
+<errors>
+On error, -1 is returned.
+</errors>
+<seealso>
+<link id="PackTime"/>
+<link id="UnpackTime"/>
+<link id="GetTime"/>
+<link id="SetTime"/>
+</seealso>
+</element>
+
+<element name="DTToUnixDate">
+<short>Convert a DateTime to unix timestamp</short>
+<descr>
+<var>DTToUnixDate</var> converts the DateTime value in <var>DT</var> to a
+unix timestamp. It is an internal function, implemented on Unix platforms,
+and should not be used.
+</descr>
+<errors>
+None.
+</errors>
+<seealso>
+<link id="UnixDateToDT"/>
+<link id="PackTime"/>
+<link id="UnpackTime"/>
+<link id="GetTime"/>
+<link id="SetTime"/>
+</seealso>
+</element>
+
+<element name="UnixDateToDT">
+<short>Convert a unix timestamp to a DateTime record </short>
+<descr>
+<var>DTToUnixDate</var> converts the unix timestamp value in <var>SecsPast</var> to a
+DateTime representation in <var>DT</var>. It is an internal function, implemented on Unix platforms,
+and should not be used.
+</descr>
+<errors>
+None.
+</errors>
+<seealso>
+<link id="DTToUnixDate"/>
+<link id="PackTime"/>
+<link id="UnpackTime"/>
+<link id="GetTime"/>
+<link id="SetTime"/>
+</seealso>
+</element>
+
+
+<element name="MSDos">
+<short>Execute MS-DOS system call</short>
+<descr>
+<p>
+<var>MSDos</var> executes an operating system call. This is the same as doing a
+<var>Intr</var> call with the interrupt number for an os call.
+</p>
+<remark>
+Under non-dos operating systems, this call does nothing. On DOS systems,
+this calls interrupt $21.
+</remark>
+</descr>
+<errors>
+None.
+</errors>
+<seealso>
+<link id="Intr"/>
+</seealso>
+</element>
+
+<element name="PackTime">
+<short>Pack DateTime value to a packed-time format.</short>
+<descr>
+<var>UnPackTime</var> converts the date and time specified in <var>T</var>
+to a packed-time format which can be fed to <var>SetFTime</var>.
+</descr>
+<errors>
+None.
+</errors>
+<seealso>
+<link id="SetFTime"/>
+<link id="FindFirst"/>
+<link id="FindNext"/>
+<link id="UnPackTime"/>
+</seealso>
+<example file="dosex/ex4"/>
+</element>
+
+
+<element name="SetCBreak">
+<short>Set Control-Break flag status</short>
+<descr>
+<p>
+<var>SetCBreak</var> sets the status of CTRL-Break checking. When 
+<var>BreakValue</var> is <var>false</var>, then dos only checks for the CTRL-Break 
+key-press when I/O is performed. When it is set to <var>True</var>, then a 
+check is done at every system call.
+</p>
+<remark>
+Under non-dos and non-Amiga operating systems, this call does nothing.
+</remark>
+</descr>
+<errors>
+None.
+</errors>
+<seealso>
+<link id="GetCBreak"/>
+</seealso>
+</element>
+
+<element name="SetDate">
+<short>Set system date</short>
+<descr>
+<p>
+<var>SetDate</var> sets the system's internal date. <var>Year</var> is a number
+between 1980 and 2099.
+</p>
+<remark>
+On a unix machine, there must be root privileges, otherwise this
+routine will do nothing. On other unix systems, this call currently
+does nothing.
+</remark>
+</descr>
+<errors>
+None.
+</errors>
+<seealso>
+<link id="GetDate"/>
+<link id="SetTime"/>
+</seealso>
+</element>
+
+<element name="SetFAttr">
+<short>Set file attributes</short>
+<descr>
+<p>
+<var>SetFAttr</var> sets the file attributes of the file-variable <var>F</var>.
+ <var>F</var> can be a untyped or typed file, or of type <var>Text</var>. <var>F</var> must
+have been assigned, but not opened. The attributes can be a sum of the
+following constants:
+</p>
+<ul>
+<li> <var>ReadOnly</var></li>
+<li> <var>Hidden</var></li>
+<li> <var>SysFile</var></li>
+<li> <var>VolumeId</var></li>
+<li> <var>Directory</var></li>
+<li> <var>Archive</var></li>
+</ul>
+<remark>
+Under unix like systems (such as linux and BeOS) the call exists, but is not implemented, 
+i.e. it does nothing.
+</remark>
+</descr>
+<errors>
+Errors are reported in <var>DosError</var>.
+</errors>
+<seealso>
+<link id="GetFAttr"/>
+</seealso>
+</element>
+
+
+<element name="SetFTime">
+<short>Set file modification time.</short>
+<descr>
+<p>
+<var>SetFTime</var> sets the modification time of a file,
+this time is encoded and must be encoded with <var>PackTime</var>. 
+<var>F</var> must be a file type, which has been assigned, and
+opened.
+</p>
+<remark>
+Under unix like systems (such as linux and BeOS) the call exists, but is not implemented, 
+i.e. it does nothing.
+</remark>
+</descr>
+<errors>
+Errors are reported in <var>DosError</var>
+</errors>
+<seealso>
+<link id="GetFTime"/>
+<link id="PackTime"/>
+<link id="UnPackTime"/>
+</seealso>
+</element>
+
+<element name="SetIntVec">
+<short>Set interrupt vector</short>
+<descr>
+<p>
+<var>SetIntVec</var> sets interrupt vector <var>IntNo</var> to <var>Vector</var>.
+<var>Vector</var> should point to an interrupt procedure.
+</p>
+<remark>
+This call does nothing, it is present for compatibility only.
+</remark>
+</descr>
+<errors>
+None.
+</errors>
+<seealso>
+<link id="GetIntVec"/>
+</seealso>
+</element>
+
+<element name="SetTime">
+<short>Set system time</short>
+<descr>
+<p>
+<var>SetTime</var> sets the system's internal clock. The <var>Hour</var> parameter is
+on a 24-hour time scale.
+</p>
+<remark>
+On a linux machine, there must be root privileges, otherwise this
+routine will do nothing. On other unix systems, this call currently
+does nothing.
+</remark>
+</descr>
+<errors>
+None.
+</errors>
+<seealso>
+<link id="GetTime"/>
+<link id="SetDate"/>
+</seealso>
+</element>
+
+<element name="SetVerify">
+<short>Set verify flag</short>
+<descr>
+<p>
+<var>SetVerify</var> sets the status of the verify flag under dos. When
+<var>Verify</var> is <var>True</var>, then dos checks data which are written to disk,
+by reading them after writing. If <var>Verify</var> is <var>False</var>, then data
+written to disk are not verified.
+</p>
+<remark>
+Under non-dos operating systems (excluding os/2 applications running
+under vanilla dos), Verify is always <var>True</var>.
+</remark>
+</descr>
+<errors>
+None.
+</errors>
+<seealso>
+<link id="SetVerify"/>
+</seealso>
+</element>
+
+<element name="SwapVectors">
+<short>Swap interrupt vectors</short>
+<descr>
+<p>
+<var>SwapVectors</var> swaps the contents of the internal table of interrupt 
+vectors with the current contents of the interrupt vectors.
+This is called typically in before and after an <var>Exec</var> call.
+</p>
+<remark>
+Under certain operating systems, this routine may be implemented
+as an empty stub.
+</remark>
+</descr>
+<errors>
+None.
+</errors>
+<seealso>
+<link id="Exec"/>
+<link id="SetIntVec"/>
+</seealso>
+
+</element>
+<element name="UnPackTime">
+<short>Unpack packed file time to a DateTime value</short>
+<descr>
+<p>
+<var>UnPackTime</var> converts the file-modification time in <var>p</var>
+to a <var>DateTime</var> record. The file-modification time can be 
+returned by <var>GetFTime</var>, <var>FindFirst</var> or <var>FindNext</var> calls.
+</p>
+<p>
+For an example, see <link id="PackTime"/>.
+</p>
+</descr>
+<errors>
+None.
+</errors>
+<seealso>
+<link id="GetFTime"/>
+<link id="FindFirst"/>
+<link id="FindNext"/>
+<link id="PackTime"/>
+</seealso>
+</element>
+
+
+</module>
+</package>
+</fpdoc-descriptions>

+ 1060 - 0
docs/keyboard.xml

@@ -0,0 +1,1060 @@
+<?xml version="1.0" encoding="ISO8859-1"?>
+<fpdoc-descriptions>
+<!--  
+
+   $Id$ 
+   This file is part of the FPC documentation. 
+   Copyright (C) 1997, by Michael Van Canneyt 
+ 
+   The FPC documentation is free text; you can redistribute it and/or 
+   modify it under the terms of the GNU Library General Public License as 
+   published by the Free Software Foundation; either version 2 of the 
+   License, or (at your option) any later version. 
+ 
+   The FPC Documentation 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.  See the GNU 
+   Library General Public License for more details. 
+ 
+   You should have received a copy of the GNU Library General Public 
+   License along with the FPC documentation; see the file COPYING.LIB.  If not, 
+   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 
+   Boston, MA 02111-1307, USA. 
+ -->
+<package name="rtl">
+<module name="keyboard">
+<short>The KEYBOARD unit</short>
+<!-- \FPCexampledir{kbdex} -->
+<descr>
+<p>
+The <file>KeyBoard</file> unit implements a keyboard access layer which is system
+independent. It can be used to poll the keyboard state and wait for certain
+events. Waiting for a keyboard event can be done with the <link id="GetKeyEvent"/>
+function, which will return a driver-dependent key event. This key event can
+be translated to a interpretable event by the <link id="TranslateKeyEvent"/>
+function. The result of this function can be used in the other event
+examining functions.
+</p>
+<p>
+A custom keyboard driver can be installed using the <link id="SetKeyboardDriver"/>
+function. The current keyboard driver can be retrieved using the
+<link id="GetKeyboardDriver"/> function. The last section of this chapter
+demonstrates how to make a keyboard driver.
+</p>
+</descr>
+
+<element name="errKbdBase">
+<short>Base of keyboard routine error reporting constants.</short>
+</element>
+
+<element name="errKbdInitError">
+<short>Failed to initialize keyboard driver</short>
+</element>
+
+<element name="errKbdNotImplemented">
+<short>Keyboard driver not implemented.</short>
+</element>
+
+<element name="kbdF1">
+<short>F1 function key pressed.</short>
+</element>
+
+<element name="kbdF2">
+<short>F2 function key pressed.</short>
+</element>
+
+<element name="kbdF3">
+<short>F3 function key pressed.</short>
+</element>
+
+<element name="kbdF4">
+<short>F4 function key pressed.</short>
+</element>
+
+<element name="kbdF5">
+<short>F5 function key pressed.</short>
+</element>
+
+<element name="kbdF6">
+<short>F6 function key pressed.</short>
+</element>
+
+<element name="kbdF7">
+<short>F7 function key pressed.</short>
+</element>
+
+<element name="kbdF8">
+<short>F8 function key pressed.</short>
+</element>
+
+<element name="kbdF9">
+<short>F9 function key pressed.</short>
+</element>
+
+<element name="kbdF10">
+<short>F10 function key pressed.</short>
+</element>
+
+<element name="kbdF11">
+<short>F12 function key pressed.</short>
+</element>
+
+<element name="kbdF12">
+<short>F12 function key pressed.</short>
+</element>
+
+<element name="kbdF13">
+<short>F13 function key pressed.</short>
+</element>
+
+<element name="kbdF14">
+<short>F14 function key pressed.</short>
+</element>
+
+<element name="kbdF15">
+<short>F15 function key pressed.</short>
+</element>
+
+<element name="kbdF16">
+<short>F16 function key pressed.</short>
+</element>
+
+<element name="kbdF17">
+<short>F17 function key pressed.</short>
+</element>
+
+<element name="kbdF18">
+<short>F18 function key pressed.</short>
+</element>
+
+<element name="kbdF19">
+<short>F19 function key pressed.</short>
+</element>
+
+<element name="kbdF20">
+<short>F20 function key pressed.</short>
+</element>
+
+<element name="kbFnKey">
+<short>function key pressed.</short>
+</element>
+
+<element name="ShiftPrefix">
+<short>Shift key name index.</short>
+</element>
+
+<element name="AltPrefix">
+<short>Alt key name index.</short>
+</element>
+
+
+<element name="CtrlPrefix">
+<short>Alt key name index.</short>
+</element>
+
+
+
+<element name="ShiftPrefix">
+<short>Shift key name index.</short>
+</element>
+
+
+
+<element name="kbdHome">
+<short>Home key pressed</short>
+</element>
+
+<element name="kbdUp">
+<short>Arrow up key pressed</short>
+</element>
+
+<element name="kbdDown">
+<short>Arrow down key pressed</short>
+</element>
+
+<element name="kbdPgUp">
+<short>Page Up key pressed</short>
+</element>
+
+<element name="kbdLeft">
+<short>Arrow left key pressed</short>
+</element>
+
+<element name="kbdMiddle">
+<short>Middle key pad key pressed (numerical 5)</short>
+</element>
+
+<element name="kbdRight">
+<short>Arrow right key pressed</short>
+</element>
+
+<element name="kbdEnd">
+<short>End key pressed</short>
+</element>
+
+<element name="kbdPgDn">
+<short>Page down key pressed</short>
+</element>
+
+
+<element name="kbdInsert">
+<short>Insert key pressed</short>
+</element>
+
+<element name="kbdDelete">
+<short>Delete key pressed</short>
+</element>
+
+<element name="kbASCII">
+<short>Ascii code key event</short>
+</element>
+
+<element name="kbUniCode">
+<short>Unicode code key event</short>
+</element>
+
+<element name="kbPhys">
+<short>Physical key code event</short>
+</element>
+
+<element name="kbReleased">
+<short>Key release event</short>
+</element>
+
+<element name="kbLeftShift">
+<short>Left shift key modifier</short>
+</element>
+
+<element name="kbRightShift">
+<short>Right shift key modifier</short>
+</element>
+
+<element name="kbShift">
+<short>Shift key modifier</short>
+</element>
+
+<element name="kbCtrl">
+<short>Control key modifier</short>
+</element>
+
+<element name="kbAlt">
+<short>Alt key modifier</short>
+</element>
+
+<element name="SShift">
+<short>Names of modifier keys</short>
+<descr>
+This constant describes the various modifier keys.
+This constant is used by the key event description routines.
+It can be changed to localize the key descriptions when needed.
+</descr>
+<seealso>
+<link id="KeyEventToString"/>
+<link id="FunctionKeyName"/>
+</seealso>
+</element>
+
+<element name="SLeftRight">
+<short>Names for left-right keys</short>
+<descr>
+This constant contains strings to describe left and right keys.
+This constant is used by the key event description routines.
+It can be changed to localize the key descriptions when needed.
+</descr>
+<seealso>
+<link id="KeyEventToString"/>
+<link id="FunctionKeyName"/>
+</seealso>
+</element>
+
+<element name="SUnicodeChar">
+<short>Unicode character string.</short>
+<descr>
+This constant contains a string to denote a unicode key event.
+This constant is used by the key event description routines.
+It can be changed to localize the key descriptions when needed.
+</descr>
+<seealso>
+<link id="KeyEventToString"/>
+<link id="FunctionKeyName"/>
+</seealso>
+</element>
+
+<element name="SScanCode">
+<short>Scancode key</short>
+<descr>
+This constant contains a string to denote a scancode key event.
+This constant is used by the key event description routines.
+It can be changed to localize the key descriptions when needed.
+</descr>
+<seealso>
+<link id="KeyEventToString"/>
+<link id="FunctionKeyName"/>
+</seealso>
+</element>
+
+<element name="SUnknownFunctionKey">
+<short>Unknown function key</short>
+<descr>
+This constant contains a string to denote that an  unknown function key was
+found. This constant is used by the key event description routines.
+It can be changed to localize the key descriptions when needed.
+</descr>
+<seealso>
+<link id="KeyEventToString"/>
+<link id="FunctionKeyName"/>
+</seealso>
+</element>
+
+<element name="SAnd">
+<short>'And' description string</short>
+<descr>
+This constant is used as the 'And' word in key descriptions.
+This constant is used by the key event description routines.
+It can be changed to localize the key descriptions when needed.
+</descr>
+<seealso>
+<link id="KeyEventToString"/>
+<link id="FunctionKeyName"/>
+</seealso>
+</element>
+
+<element name="SKeyPad">
+<short>Names of keypad keys</short>
+<descr>
+This constant describes all keypad keys.
+This constant is used by the key event description routines.
+It can be changed to localize the key descriptions when needed.
+</descr>
+<seealso>
+<link id="KeyEventToString"/>
+<link id="FunctionKeyName"/>
+</seealso>
+</element>
+
+<element name="TKeyEvent">
+<short>Base type to describe all key events.</short>
+<descr>
+<p>
+The <var>TKeyEvent</var> type is the base type for all keyboard events.
+</p>
+<p>
+The key stroke is encoded in the 4 bytes of the <var>TKeyEvent</var> type. 
+The various fields of the key stroke encoding can be obtained by typecasting
+the <var>TKeyEvent</var> type to the <link id="TKeyRecord"/> type.
+</p>
+</descr>
+</element>
+
+<element name="TKeyRecord">
+<short>Key event decoding type.</short>
+<descr>
+<p>
+The structure of a <var>TKeyRecord</var> structure is explained in the
+following table:
+</p>
+<table>
+<caption>Structure of TKeyRecord</caption>
+<th><td>Field</td><td>Meaning</td></th>
+<tr><td>KeyCode</td><td>
+Depending on <var>flags</var> either the physical representation of a key
+(under DOS scancode, ascii code pair), or the translated
+ASCII/unicode character.
+</td></tr>
+<tr>
+<td>ShiftState</td>
+<td>
+Shift-state when this key was pressed (or shortly after) 
+</td></tr>
+<tr><td>Flags</td>
+<td>
+Determine how to interpret <var>KeyCode</var>
+</td></tr>
+</table>
+<p>
+The shift-state can be checked using the various shift-state constants, 
+and the flags in the last byte can be checked using one of the
+kbASCII, kbUniCode, kbFnKey, kbPhys, kbReleased constants.
+</p>
+<p>
+If there are two keys returning the same char-code, there's no way to find
+out which one was pressed (Gray+ and Simple+). If it needs to be known which
+was pressed, the untranslated keycodes must be used, but these are system
+dependent. System dependent constants may be defined to cover those, with
+possibily having the same name (but different value).
+</p>
+</descr>
+<seealso>
+<link id="kbdscancode"/>
+<link id="TKeyEvent"/>
+</seealso>
+</element>
+
+<element name="TKeyboardDriver">
+<short>Keyboard driver structure</short>
+<descr>
+<p>
+The <var>TKeyboardDriver</var> record can be used to install a custom keyboard
+driver with the <link id="SetKeyboardDriver"/> function.
+</p>
+<p>
+The various fields correspond to the different functions of the keyboard unit 
+interface. For more information about this record see <link id="kbddriver"/>
+</p>
+</descr>
+<seealso>
+<link id="SetKeyboardDriver"/>
+<link id="kbddriver"/>
+</seealso>
+</element>
+
+<element name="DoneKeyboard">
+<short>Deactivate keyboard driver.</short>
+<descr>
+<p>
+<var>DoneKeyboard</var> de-initializes the keyboard interface if the keyboard
+driver is active. If the keyboard driver is not active, the function does
+nothing.
+</p>
+<p>
+This will cause the keyboard driver to clear up any allocated memory, 
+or restores the console or terminal the program was running in to its 
+initial state before the call to <link id="InitKeyBoard"/>. This function should 
+be called on program exit. Failing to do so may leave the terminal or
+console window in an unusable state. Its exact action depends on the 
+platform on which the program is running.
+</p>
+<p>
+For an example, see most other functions.
+</p>
+</descr>
+<errors>
+None.
+</errors>
+<seealso>
+<link id="InitKeyBoard"/>
+</seealso>
+</element>
+
+
+<element name="FunctionKeyName">
+<short>Return string representation of a function key code.</short>
+<descr>
+<var>FunctionKeyName</var> returns a string representation of the function key
+with code <var>KeyCode</var>. This can be an actual function key, or one of the
+cursor movement keys.
+</descr>
+<errors>
+In case <var>KeyCode</var> does not contain a function code, the
+<var>SUnknownFunctionKey</var> string is returned, appended with the
+<var>KeyCode</var>.
+</errors>
+<seealso>
+<link id="ShiftStateToString"/>
+<link id="KeyEventToString"/>
+</seealso>
+<example file="kbdex/ex8"/>
+</element>
+
+
+<element name="GetKeyboardDriver">
+<short>Return the current keyboard driver record.</short>
+<descr>
+<p>
+<var>GetKeyBoardDriver</var> returns in <var>Driver</var> the currently active
+keyboard driver. This function can be used to enhance an existing
+keyboarddriver.
+</p>
+<p>
+For more information on getting and setting the keyboard driver
+<link id="kbddriver"/>.
+</p>
+</descr>
+<errors>
+None.
+</errors>
+<seealso>
+<link id="SetKeyboardDriver"/>
+</seealso>
+</element>
+
+<element name="GetKeyEvent">
+<short>Get the next raw key event, wait if needed.</short>
+<descr>
+<p>
+<var>GetKeyEvent</var> returns the last keyevent if one was stored in
+<var>PendingKeyEvent</var>, or waits for one if none is available.
+A non-blocking version is available in <link id="PollKeyEvent"/>.
+</p>
+<p>
+The returned key is encoded as a <var>TKeyEvent</var> type variable, and
+is normally the physical key scan code, (the scan code is driver 
+dependent) which can be translated with one of the translation 
+functions <link id="TranslateKeyEvent"/> or <link id="TranslateKeyEventUniCode"/>. 
+See the types section for a description of how the key is described.
+</p>
+</descr>
+<errors>
+If no key became available, 0 is returned.
+</errors>
+<seealso>
+<link id="PutKeyEvent"/>
+<link id="PollKeyEvent"/>
+<link id="TranslateKeyEvent"/>,
+<link id="TranslateKeyEventUniCode"/>
+</seealso>
+<example file="kbdex/ex1"/>
+</element>
+
+
+<element name="GetKeyEventChar">
+<short>Get the character key part of a key event.</short>
+<descr>
+<p>
+<var>GetKeyEventChar</var> returns the charcode part of the given 
+<var>KeyEvent</var>, if it contains a translated character key 
+keycode. The charcode is simply the ascii code of the 
+character key that was pressed.
+</p>
+<p>
+It returns the null character if the key was not a character key, but e.g. a
+function key.
+</p>
+<p>
+For an example, see <link id="GetKeyEvent"/>
+</p>
+</descr>
+<errors>
+None.
+</errors>
+<seealso>
+<link id="GetKeyEventUniCode"/>,
+<link id="GetKeyEventShiftState"/>, 
+<link id="GetKeyEventFlags"/>,
+<link id="GetKeyEventCode"/>,
+<link id="GetKeyEvent"/>
+</seealso>
+</element>
+
+
+<element name="GetKeyEventCode">
+<short>Translate function key  part of a key event code.</short>
+<descr>
+<p>
+<var>GetKeyEventCode</var> returns the translated function keycode part of 
+the given KeyEvent, if it contains a translated function key.
+</p>
+<p>
+If the key pressed was not a function key, the null character is returned.
+</p>
+</descr>
+<errors>
+None.
+</errors>
+<seealso>
+<link id="GetKeyEventUniCode"/>,
+<link id="GetKeyEventShiftState"/>, 
+<link id="GetKeyEventFlags"/>,
+<link id="GetKeyEventChar"/>,
+<link id="GetKeyEvent"/>
+</seealso>
+<example file="kbdex/ex2"/>
+</element>
+
+<element name="GetKeyEventFlags">
+<short>Extract the flags from a key event.</short>
+<descr>
+<p>
+<var>GetKeyEventFlags</var> returns the flags part of the given 
+<var>KeyEvent</var>. 
+</p>
+<p>
+For an example, see <link id="GetKeyEvent"/>
+</p>
+</descr>
+<errors>
+None.
+</errors>
+<seealso>
+<link id="GetKeyEventUniCode"/>,
+<link id="GetKeyEventShiftState"/>, 
+<link id="GetKeyEventCode"/>,
+<link id="GetKeyEventChar"/>,
+<link id="GetKeyEvent"/>
+</seealso>
+</element>
+
+
+<element name="GetKeyEventShiftState">
+<short>Return the current state of the shift keys.</short>
+<descr>
+<p>
+<var>GetKeyEventShiftState</var> returns the shift-state values of 
+the given <var>KeyEvent</var>. This can be used to detect which of the modifier
+keys <var>Shift</var>, <var>Alt</var> or <var>Ctrl</var> were pressed. If none were
+pressed, zero is returned.
+</p>
+<p>
+Note that this function does not always return expected results;
+In a unix X-Term, the modifier keys do not always work.
+</p>
+</descr>
+<errors>
+None.
+</errors>
+<seealso>
+<link id="GetKeyEventUniCode"/>,
+<link id="GetKeyEventFlags"/>, 
+<link id="GetKeyEventCode"/>,
+<link id="GetKeyEventChar"/>,
+<link id="GetKeyEvent"/>
+</seealso>
+<example file="kbdex/ex3"/>
+</element>
+
+
+<element name="GetKeyEventUniCode">
+<short>Return the unicode key event.</short>
+<descr>
+<var>GetKeyEventUniCode</var> returns the unicode part of the 
+given <var>KeyEvent</var> if it contains a translated unicode 
+character.
+</descr>
+<errors>
+None.
+</errors>
+<seealso>
+<link id="GetKeyEventShiftState"/>,
+<link id="GetKeyEventFlags"/>, 
+<link id="GetKeyEventCode"/>,
+<link id="GetKeyEventChar"/>,
+<link id="GetKeyEvent"/>
+</seealso>
+</element>
+
+<element name="InitKeyBoard">
+<short>Initialize the keyboard driver.</short>
+<descr>
+<p>
+<var>InitKeyboard</var> initializes the keyboard driver. 
+If the driver is already active, it does nothing. When the driver is
+initialized, it will do everything necessary to ensure the functioning of
+the keyboard, including allocating memory, initializing the terminal etc.
+</p>
+<p>
+This function should be called once, before using any of the
+keyboard functions. When it is called, the <link id="DoneKeyboard"/> function
+should also be called before exiting the program or changing the keyboard
+driver with <link id="SetKeyboardDriver"/>.
+</p>
+<p>
+For an example, see most other functions.
+</p>
+</descr>
+<errors>
+None.
+</errors>
+<seealso>
+<link id="DoneKeyboard"/>
+<link id="SetKeyboardDriver"/>
+</seealso>
+</element>
+
+<element name="AddSequence" skip="1"/>
+<element name="FindSequence" skip="1"/>
+<element name="RawReadKey" skip="1"/>
+<element name="RawReadString" skip="1"/>
+<element name="RestoreStartMode" skip="1"/>
+
+
+<element name="IsFunctionKey">
+<short>Check whether a given event is a function key event.</short>
+<descr>
+<var>IsFunctionKey</var> returns <var>True</var> if the given key event
+in <var>KeyEvent</var> was a function key or not.
+</descr>
+<errors>
+None.
+</errors>
+<seealso>
+<link id="GetKeyEvent"/>
+</seealso>
+<example file="kbdex/ex7"/>
+</element>
+
+
+<element name="KeyEventToString">
+<short>Return a string describing the key event.</short>
+<descr>
+<p>
+<var>KeyEventToString</var> translates the key event in <var>KeyEvent</var> to a
+human-readable description of the pressed key. It will use the constants
+described in the constants section to do so.
+</p>
+<p>
+For an example, see most other functions.
+</p>
+</descr>
+<errors>
+If an unknown key is passed, the scancode is returned, prefixed with the 
+<var>SScanCode</var> string.
+</errors>
+<seealso>
+<link id="FunctionKeyName"/>
+<link id="ShiftStateToString"/>
+</seealso>
+</element>
+
+<element name="KeyPressed">
+<short>Check event queue for key press</short>
+<descr>
+<var>KeyPressed</var> checks the keyboard event queue to see whether a key
+event is present, and returns <var>True</var> if a key event is available.
+This function simply calls <link id="PollKeyEvent"/> and checks for a valid
+result.
+</descr>
+<errors>
+None.
+</errors>
+<seealso>
+<link id="PollKeyEvent"/>
+<link id="GetKeyEvent"/>
+</seealso>
+</element>
+
+
+
+<element name="PollKeyEvent">
+<short>Get next key event, but does not wait.</short>
+<descr>
+<p>
+<var>PollKeyEvent</var> checks whether a key event is available, 
+and returns it if one is found. If no event is pending, 
+it returns 0. 
+</p>
+<p>
+Note that this does not remove the key from the pending keys. 
+The key should still be retrieved from the pending key events 
+list with the <link id="GetKeyEvent"/> function.
+</p>
+</descr>
+<errors>
+None.
+</errors>
+<seealso>
+<link id="PutKeyEvent"/>
+<link id="GetKeyEvent"/>
+</seealso>
+<example file="kbdex/ex4"/>
+</element>
+
+
+<element name="PollShiftStateEvent">
+<short>Check current shift state. </short>
+<descr>
+<var>PollShiftStateEvent</var> returns the current shiftstate in a 
+keyevent. This will return 0 if there is no key event pending.
+</descr>
+<errors>
+None.
+</errors>
+<seealso>
+<link id="PollKeyEvent"/>
+<link id="GetKeyEvent"/>
+</seealso>
+<example file="kbdex/ex6"/>
+</element>
+
+
+<element name="PutKeyEvent">
+<short>Put a key event in the event queue.</short>
+<descr>
+<var>PutKeyEvent</var> adds the given <var>KeyEvent</var> to the input 
+queue. Please note that depending on the implementation this 
+can hold only one value, i.e. when calling <var>PutKeyEvent</var>
+multiple times, only the last pushed key will be remembered.
+</descr>
+<errors>
+None
+</errors>
+<seealso>
+<link id="PollKeyEvent"/>
+<link id="GetKeyEvent"/>
+</seealso>
+<example file="kbdex/ex5"/>
+</element>
+
+
+<element name="SetKeyboardDriver">
+<short>Set a new keyboard driver.</short>
+<descr>
+<p>
+<var>SetKeyBoardDriver</var> sets the keyboard driver to <var>Driver</var>, if the
+current keyboard driver is not yet initialized. If the current
+keyboard driver is initialized, then <var>SetKeyboardDriver</var> does 
+nothing. Before setting the driver, the currently active driver should
+be disabled with a call to <link id="DoneKeyboard"/>.
+</p>
+<p>
+The function returns <var>True</var> if the driver was set, <var>False</var> if not.
+</p>
+<p>
+For more information on setting the keyboard driver, see <link id="kbddriver"/>.
+</p>
+</descr>
+<errors>
+None.
+</errors>
+<seealso>
+<link id="GetKeyboardDriver"/>
+<link id="DoneKeyboard"/>.
+</seealso>
+</element>
+
+<element name="ShiftStateToString">
+<short>Return description of key event shift state</short>
+<descr>
+<p>
+<var>ShiftStateToString</var> returns a string description of the shift state
+of the key event <var>KeyEvent</var>. This can be an empty string. 
+</p>
+<p>
+The shift state is described using the strings in the <var>SShift</var> constant.
+</p>
+<p>
+For an example, see <link id="PollShiftStateEvent"/>.
+</p>
+</descr>
+<errors>
+None.
+</errors>
+<seealso>
+<link id="FunctionKeyName"/>
+<link id="KeyEventToString"/>
+</seealso>
+</element>
+
+
+<element name="TranslateKeyEvent">
+<short>Translate raw event to ascii key event</short>
+<descr>
+<p>
+<var>TranslateKeyEvent</var> performs ASCII translation of the <var>KeyEvent</var>.
+It translates a physical key to a function key if the key is a function key,
+and translates the physical key to the ordinal of the ascii character if 
+there is an equivalent character key.
+</p>
+<p>
+For an example, see <link id="GetKeyEvent"/>
+</p>
+</descr>
+<errors>
+None.
+</errors>
+<seealso>
+<link id="TranslateKeyEventUniCode"/>
+</seealso>
+</element>
+
+
+<element name="TranslateKeyEventUniCode">
+<short>Translate raw event to UNICode key event</short>
+<descr>
+<var>TranslateKeyEventUniCode</var> performs Unicode translation of the 
+<var>KeyEvent</var>. It is not yet implemented for all platforms.
+</descr>
+<errors>
+If the function is not yet implemented, then the <var>ErrorCode</var> of the 
+<file>system</file> unit will be set to <var>errKbdNotImplemented</var>
+</errors>
+<seealso>
+<link id="TranslateKeyEvent"/>
+</seealso>
+</element>
+
+<topic name="kbdscancode">
+<short>Keyboard scan codes</short>
+<descr>
+<p>
+Special physical keys are encoded with the DOS scan codes for these keys
+in the second byte of the <link id="TKeyEvent"/> type.
+A complete list of scan codes can be found in the below table. 
+This is the list of keys that is used by the default key event translation mechanism.
+When writing a keyboard driver, either these constants should be returned
+by the various key event functions, or the <var>TranslateKeyEvent</var> hook
+should be implemented by the driver.
+</p>
+<table border="1">
+<caption>Key Scancodes</caption>
+<th><td>Code</td><td>Key</td><td>Code</td><td>Key</td><td>Code</td><td>Key</td></th>
+<tr><td>00 </td><td> NoKey </td><td> 3D </td><td> F3 </td><td> 70 </td><td> ALT-F9 </td></tr>
+<tr><td>01 </td><td> ALT-Esc </td><td> 3E </td><td> F4 </td><td> 71 </td><td> ALT-F10 </td></tr>
+<tr><td>02 </td><td> ALT-Space </td><td> 3F </td><td> F5 </td><td> 72 </td><td> CTRL-PrtSc </td></tr>
+<tr><td>04 </td><td> CTRL-Ins </td><td> 40 </td><td> F6 </td><td> 73 </td><td> CTRL-Left </td></tr>
+<tr><td>05 </td><td> SHIFT-Ins </td><td> 41 </td><td> F7 </td><td> 74 </td><td> CTRL-Right </td></tr>
+<tr><td>06 </td><td> CTRL-Del </td><td> 42 </td><td> F8 </td><td> 75 </td><td> CTRL-end </td></tr>
+<tr><td>07 </td><td> SHIFT-Del </td><td> 43 </td><td> F9 </td><td> 76 </td><td> CTRL-PgDn </td></tr>
+<tr><td>08 </td><td> ALT-Back </td><td> 44 </td><td> F10 </td><td> 77 </td><td> CTRL-Home </td></tr>
+<tr><td>09 </td><td> ALT-SHIFT-Back </td><td> 47 </td><td> Home </td><td> 78 </td><td> ALT-1 </td></tr>
+<tr><td>0F </td><td> SHIFT-Tab </td><td> 48 </td><td> Up </td><td> 79 </td><td> ALT-2 </td></tr>
+<tr><td>10 </td><td> ALT-Q </td><td> 49 </td><td> PgUp </td><td> 7A </td><td> ALT-3 </td></tr>
+<tr><td>11 </td><td> ALT-W </td><td> 4B </td><td> Left </td><td> 7B </td><td> ALT-4 </td></tr>
+<tr><td>12 </td><td> ALT-E </td><td> 4C </td><td> Center </td><td> 7C </td><td> ALT-5 </td></tr>
+<tr><td>13 </td><td> ALT-R </td><td> 4D </td><td> Right </td><td> 7D </td><td> ALT-6 </td></tr>
+<tr><td>14 </td><td> ALT-T </td><td> 4E </td><td> ALT-GrayPlus </td><td> 7E </td><td> ALT-7 </td></tr>
+<tr><td>15 </td><td> ALT-Y </td><td> 4F </td><td> end </td><td> 7F </td><td> ALT-8 </td></tr>
+<tr><td>16 </td><td> ALT-U </td><td> 50 </td><td> Down </td><td> 80 </td><td> ALT-9 </td></tr>
+<tr><td>17 </td><td> ALT-I </td><td> 51 </td><td> PgDn </td><td> 81 </td><td> ALT-0 </td></tr>
+<tr><td>18 </td><td> ALT-O </td><td> 52 </td><td> Ins </td><td> 82 </td><td> ALT-Minus </td></tr>
+<tr><td>19 </td><td> ALT-P </td><td> 53 </td><td> Del </td><td> 83 </td><td> ALT-Equal </td></tr>
+<tr><td>1A </td><td> ALT-LftBrack </td><td> 54 </td><td> SHIFT-F1 </td><td> 84 </td><td> CTRL-PgUp </td></tr>
+<tr><td>1B </td><td> ALT-RgtBrack </td><td> 55 </td><td> SHIFT-F2 </td><td> 85 </td><td> F11 </td></tr>
+<tr><td>1E </td><td> ALT-A </td><td> 56 </td><td> SHIFT-F3 </td><td> 86 </td><td> F12 </td></tr>
+<tr><td>1F </td><td> ALT-S </td><td> 57 </td><td> SHIFT-F4 </td><td> 87 </td><td> SHIFT-F11 </td></tr>
+<tr><td>20 </td><td> ALT-D </td><td> 58 </td><td> SHIFT-F5 </td><td> 88 </td><td> SHIFT-F12 </td></tr>
+<tr><td>21 </td><td> ALT-F </td><td> 59 </td><td> SHIFT-F6 </td><td> 89 </td><td> CTRL-F11 </td></tr>
+<tr><td>22 </td><td> ALT-G </td><td> 5A </td><td> SHIFT-F7 </td><td> 8A </td><td> CTRL-F12 </td></tr>
+<tr><td>23 </td><td> ALT-H </td><td> 5B </td><td> SHIFT-F8 </td><td> 8B </td><td> ALT-F11 </td></tr>
+<tr><td>24 </td><td> ALT-J </td><td> 5C </td><td> SHIFT-F9 </td><td> 8C </td><td> ALT-F12 </td></tr>
+<tr><td>25 </td><td> ALT-K </td><td> 5D </td><td> SHIFT-F10 </td><td> 8D </td><td> CTRL-Up </td></tr>
+<tr><td>26 </td><td> ALT-L </td><td> 5E </td><td> CTRL-F1 </td><td> 8E </td><td> CTRL-Minus </td></tr>
+<tr><td>27 </td><td> ALT-SemiCol </td><td> 5F </td><td> CTRL-F2 </td><td> 8F </td><td> CTRL-Center </td></tr>
+<tr><td>28 </td><td> ALT-Quote </td><td> 60 </td><td> CTRL-F3 </td><td> 90 </td><td> CTRL-GreyPlus </td></tr>
+<tr><td>29 </td><td> ALT-OpQuote </td><td> 61 </td><td> CTRL-F4 </td><td> 91 </td><td> CTRL-Down </td></tr>
+<tr><td>2B </td><td> ALT-BkSlash </td><td> 62 </td><td> CTRL-F5 </td><td> 94 </td><td> CTRL-Tab </td></tr>
+<tr><td>2C </td><td> ALT-Z </td><td> 63 </td><td> CTRL-F6 </td><td> 97 </td><td> ALT-Home </td></tr>
+<tr><td>2D </td><td> ALT-X </td><td> 64 </td><td> CTRL-F7 </td><td> 98 </td><td> ALT-Up </td></tr>
+<tr><td>2E </td><td> ALT-C </td><td> 65 </td><td> CTRL-F8 </td><td> 99 </td><td> ALT-PgUp </td></tr>
+<tr><td>2F </td><td> ALT-V </td><td> 66 </td><td> CTRL-F9 </td><td> 9B </td><td> ALT-Left </td></tr>
+<tr><td>30 </td><td> ALT-B </td><td> 67 </td><td> CTRL-F10 </td><td> 9D </td><td> ALT-Right </td></tr>
+<tr><td>31 </td><td> ALT-N </td><td> 68 </td><td> ALT-F1 </td><td> 9F </td><td> ALT-end </td></tr>
+<tr><td>32 </td><td> ALT-M </td><td> 69 </td><td> ALT-F2 </td><td> A0 </td><td> ALT-Down </td></tr>
+<tr><td>33 </td><td> ALT-Comma </td><td> 6A </td><td> ALT-F3 </td><td> A1 </td><td> ALT-PgDn </td></tr>
+<tr><td>34 </td><td> ALT-Period </td><td> 6B </td><td> ALT-F4 </td><td> A2 </td><td> ALT-Ins </td></tr>
+<tr><td>35 </td><td> ALT-Slash </td><td> 6C </td><td> ALT-F5 </td><td> A3 </td><td> ALT-Del </td></tr>
+<tr><td>37 </td><td> ALT-GreyAst </td><td> 6D </td><td> ALT-F6 </td><td> A5 </td><td> ALT-Tab </td></tr>
+<tr><td>3B </td><td> F1 </td><td> 6E </td><td> ALT-F7 </td><td> </td><td>  </td></tr>
+<tr><td>3C </td><td> F2 </td><td> 6F </td><td> ALT-F8 </td><td> </td><td>  </td></tr> 
+</table>
+<p>
+A list of scan codes for special keys and combinations with the SHIFT, ALT
+and CTRL keys can be found in the following table: They are for quick reference
+only.
+</p>
+<table border="1">
+<caption>Special keys scan codes</caption>
+<th><td>Key  </td><td> Code </td><td> SHIFT-Key </td><td> CTRL-Key </td><td> Alt-Key</td></th>
+<tr><td>NoKey </td><td> 00 </td><td> </td><td> </td><td> </td></tr>
+<tr><td>F1  </td><td> 3B </td><td> 54 </td><td> 5E </td><td> 68 </td></tr>
+<tr><td>F2  </td><td> 3C </td><td> 55 </td><td> 5F </td><td> 69 </td></tr>
+<tr><td>F3  </td><td> 3D </td><td> 56 </td><td> 60 </td><td> 6A </td></tr>
+<tr><td>F4  </td><td> 3E </td><td> 57 </td><td> 61 </td><td> 6B </td></tr>
+<tr><td>F5  </td><td> 3F </td><td> 58 </td><td> 62 </td><td> 6C </td></tr>
+<tr><td>F6  </td><td> 40 </td><td> 59 </td><td> 63 </td><td> 6D </td></tr>
+<tr><td>F7  </td><td> 41 </td><td> 5A </td><td> 64 </td><td> 6E </td></tr>
+<tr><td>F8  </td><td> 42 </td><td> 5A </td><td> 65 </td><td> 6F </td></tr>
+<tr><td>F9  </td><td> 43 </td><td> 5B </td><td> 66 </td><td> 70 </td></tr>
+<tr><td>F10  </td><td> 44 </td><td> 5C </td><td> 67 </td><td> 71 </td></tr>
+<tr><td>F11  </td><td> 85 </td><td> 87 </td><td> 89 </td><td> 8B </td></tr>
+<tr><td>F12  </td><td> 86 </td><td> 88 </td><td> 8A </td><td> 8C </td></tr>
+<tr><td>Home </td><td> 47 </td><td> </td><td> 77 </td><td> 97 </td></tr> 
+<tr><td>Up  </td><td> 48 </td><td> </td><td> 8D </td><td> 98 </td></tr>
+<tr><td>PgUp </td><td> 49 </td><td> </td><td> 84 </td><td> 99 </td></tr>
+<tr><td>Left </td><td> 4B </td><td> </td><td> 73 </td><td> 9B </td></tr>
+<tr><td>Center </td><td> 4C </td><td> </td><td> 8F </td><td> </td></tr>
+<tr><td>Right </td><td> 4D </td><td> </td><td> 74 </td><td> 9D </td></tr>
+<tr><td>end  </td><td> 4F </td><td> </td><td> 75 </td><td> 9F </td></tr>
+<tr><td>Down </td><td> 50 </td><td> </td><td> 91 </td><td> A0 </td></tr>
+<tr><td>PgDn </td><td> 51 </td><td> </td><td> 76 </td><td> A1 </td></tr>
+<tr><td>Ins  </td><td> 52 </td><td> 05 </td><td> 04 </td><td> A2 </td></tr>
+<tr><td>Del  </td><td> 53 </td><td> 07 </td><td> 06 </td><td> A3 </td></tr>
+<tr><td>Tab  </td><td> 8 </td><td> 0F </td><td> 94 </td><td> A5 </td></tr>
+<tr><td>GreyPlus </td><td> </td><td> </td><td> 90 </td><td> 4E </td></tr>
+</table>
+</descr>
+</topic>
+
+<topic name="kbddriver">
+<short>Writing a keyboard driver</short>
+<descr>
+<p>
+Writing a keyboard driver means that hooks must be created for most of the 
+keyboard unit functions. The <var>TKeyBoardDriver</var> record contains a field
+for each of the possible hooks:
+</p>
+<code>
+TKeyboardDriver = Record
+  InitDriver : Procedure;
+  DoneDriver : Procedure;
+  GetKeyEvent : Function : TKeyEvent;
+  PollKeyEvent : Function : TKeyEvent;
+  GetShiftState : Function : Byte;
+  TranslateKeyEvent : Function (KeyEvent: TKeyEvent): TKeyEvent;
+  TranslateKeyEventUniCode: Function (KeyEvent: TKeyEvent): TKeyEvent;
+end;
+</code>
+<p>
+The meaning of these hooks is explained below:
+</p>
+<dl>
+<dt>InitDriver</dt>
+<dd> Called to initialize and enable the driver. 
+Guaranteed to be called only once. This should initialize all needed things
+for the driver.
+</dd>
+<dt>DoneDriver</dt>
+<dd> Called to disable and clean up the driver. Guaranteed to be
+called after a call to <var>initDriver</var>. This should clean up all
+things initialized by <var>InitDriver</var>.
+</dd>
+<dt>GetKeyEvent</dt>
+<dd> Called by <link id="GetKeyEvent"/>. Must wait for and return the
+next key event. It should NOT store keys.
+</dd>
+<dt>PollKeyEvent</dt>
+<dd> Called by <link id="PollKeyEvent"/>. It must return the next key
+event if there is one. Should not store keys. 
+</dd>
+<dt>GetShiftState</dt>
+<dd> Called by <link id="PollShiftStateEvent"/>.  Must return the current
+shift state.
+</dd>
+<dt>TranslateKeyEvent</dt>
+<dd> Should translate a raw key event to a cOrrect
+key event, i.e. should fill in the shiftstate and convert function key
+scancodes to function key keycodes. If the
+<var>TranslateKeyEvent</var> is not filled in, a default translation function
+will be called which converts the known scancodes from the tables in the
+previous section to a correct keyevent.
+</dd>
+<dt>TranslateKeyEventUniCode</dt>
+<dd> Should translate a key event to a unicode key
+representation. 
+</dd>
+</dl>
+<p>
+Strictly speaking, only the <var>GetKeyEvent</var> and <var>PollKeyEvent</var>
+hooks must be implemented for the driver to function correctly. 
+</p>
+<p>
+The example unit demonstrates how a keyboard driver can be installed.
+It takes the installed driver, and hooks into the <var>GetKeyEvent</var>
+function to register and log the key events in a file. This driver
+can work on top of any other driver, as long as it is inserted in the 
+<var>uses</var> clause <em> after</em> the real driver unit, and the real driver unit
+should set the driver record in its initialization section.
+</p>
+<p>
+Note that with a simple extension of this unit could be used to make a
+driver that is capable of recording and storing a set of keyboard strokes,
+and replaying them at a later time, so a 'keyboard macro' capable driver.
+This driver could sit on top of any other driver.
+</p>
+</descr>
+<example file="kbdex/logkeys"/>
+<example file="kbdex/ex9"/>
+</topic>
+
+</module>
+</package>
+</fpdoc-descriptions>

+ 527 - 0
docs/mouse.xml

@@ -0,0 +1,527 @@
+<?xml version="1.0" encoding="ISO8859-1"?>
+<fpdoc-descriptions>
+<!--  
+
+   $Id$ 
+   This file is part of the FPC documentation. 
+   Copyright (C) 1997, by Michael Van Canneyt 
+ 
+   The FPC documentation is free text; you can redistribute it and/or 
+   modify it under the terms of the GNU Library General Public License as 
+   published by the Free Software Foundation; either version 2 of the 
+   License, or (at your option) any later version. 
+ 
+   The FPC Documentation 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.  See the GNU 
+   Library General Public License for more details. 
+ 
+   You should have received a copy of the GNU Library General Public 
+   License along with the FPC documentation; see the file COPYING.LIB.  If not, 
+   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 
+   Boston, MA 02111-1307, USA. 
+ -->
+<package name="rtl">
+<module name="mouse">
+<short>Mouse event handling unit</short>
+<!-- \FPCexampledir{mouseex} -->
+<descr>
+The <file>Mouse</file> unit implements a platform independent mouse handling 
+interface. It is implemented identically on all platforms supported by 
+Free Pascal and can be enhanced with custom drivers, should this be needed.
+It is intended to be used only in text-based screens, for instance in 
+conjunction with the keyboard and video unit. No support for graphical
+screens is implemented, and there are (currently) no plans to implement
+this.
+</descr>
+
+<element name="errMouseBase">
+<short>Base for mouse error codes.</short>
+</element>
+
+<element name="errMouseInitError">
+<short>Mouse initialization error</short>
+</element>
+
+<element name="errMouseNotImplemented">
+<short>Mouse driver not implemented.</short>
+</element>
+
+<element name="MouseActionDown">
+<short>Mouse button down event signal.</short>
+</element>
+
+<element name="MouseActionUp">
+<short>Mouse button up event signal.</short>
+</element>
+
+<element name="MouseActionMove">
+<short>Mouse cursor move event signal.</short>
+</element>
+
+<element name="MouseLeftButton">
+<short>Left mouse button event.</short>
+</element>
+
+<element name="MouseRightButton">
+<short>Right mouse button event.</short>
+</element>
+
+<element name="MouseMiddleButton">
+<short>Middle mouse button event.</short>
+</element>
+
+<element name="MouseEventBufSize">
+<short>Mouse event buffer size</short>
+<descr>
+The mouse unit has a mechanism to buffer mouse events. This
+constant defines the size of the event buffer.
+</descr>
+</element> 
+
+<element name="PMouseEvent">
+<short>Pointer to <link id="TMouseEvent"/> record.</short>
+</element>
+
+<element name="TMouseEvent">
+<short>Mouse event reporting record.</short>
+<descr>
+<p>
+The <var>TMouseEvent</var> is the central type of the mouse unit, it is used
+to describe all mouse events.
+</p>
+<p>
+The <var>Buttons</var> field describes which buttons were down when the event
+occurred. The <var>x,y</var> fields describe where the event occurred on the
+screen. The <var>Action</var> describes what action was going on when the event
+occurred. The <var>Buttons</var> and <var>Action</var> field can be examined using the
+constants defined in the unit interface.
+</p>
+</descr>
+<seealso>
+<link id="GetMouseEvent"/>
+<link id="PollMouseEvent"/>
+<link id="PutMouseEvent"/>
+</seealso>
+</element>
+
+<element name="TMouseEvent.X">
+<short>Horizontal position of mouse cursor.</short>
+</element>
+<element name="TMouseEvent.Y">
+<short>Vertical position of mouse cursor.</short>
+</element>
+<element name="TMouseEvent.Buttons">
+<short>Pressed buttons at time of event.
+</short>
+</element>
+<element name="TMouseEvent.Action">
+<short>Type of event.</short>
+</element>
+
+<element name="TMouseDriver">
+<short>Mouse driver structure</short>
+<descr>
+The <var>TMouseDriver</var> record is used to implement a mouse driver in the
+<link id="SetMouseDriver"/> function. Its fields must be filled in before
+calling the <link id="SetMouseDriver"/> function.
+</descr>
+<seealso>
+<link id="SetMouseDriver"/>
+</seealso>
+</element>
+
+<element name="TMouseDriver.UseDefaultQueue">
+<short>Should the default event queue mechanism be used.</short>
+</element>
+<element name="TMouseDriver.InitDriver">
+<short>Called when the driver must be initialized</short>
+</element>
+<element name="TMouseDriver.DoneDriver">
+<short>Called when the driver will be unloaded.</short>
+</element>
+<element name="TMouseDriver.DetectMouse">
+<short>Function called when the mouse must be detected.</short>
+</element>
+<element name="TMouseDriver.ShowMouse">
+<short>Function called when the mouse cursor must be shown.</short>
+</element>
+<element name="TMouseDriver.HideMouse">
+<short>Function called when the mouse cursor must be hidden.</short>
+</element>
+<element name="TMouseDriver.GetMouseX">
+<short>Called to get the mouse cursors horizontal position.</short>
+</element>
+<element name="TMouseDriver.GetMouseY">
+<short>Called to get the mouse cursors vertical position.</short>
+</element>
+<element name="TMouseDriver.GetMouseButtons">
+<short>Called to get the currently pressed mouse buttons.</short>
+</element>
+<element name="TMouseDriver.SetMouseXY">
+<short>Called when the current mouse position must be set.</short>
+</element>
+<element name="TMouseDriver.GetMouseEvent">
+<short>Called to get the next mouse event. Waits if needed.</short>
+</element>
+<element name="TMouseDriver.PollMouseEvent">
+<short>Called to get the next mouse event. Does not wait.</short>
+</element>
+<element name="TMouseDriver.PutMouseEvent">
+<short>Called to put a mouse event back in the queue.</short>
+</element>
+
+<element name="MouseIntFlag">
+<short>Internal mouse flag</short>
+<descr>This variable keeps track of the last known internal mouse state. Do not use.</descr>
+</element>
+
+<element name="MouseButtons">
+<short>Mouse button state</short>
+<descr>This variable keeps track of the last known mouse button state. Do not use.</descr>
+</element>
+
+<element name="MouseWhereX">
+<short>Mouse cursor horizontal position</short>
+<descr>This variable keeps track of the last known cursor position. Do not use.</descr>
+</element>
+
+<element name="MouseWhereY">
+<short>Mouse cursor vertical position</short>
+<descr>This variable keeps track of the last known cursor position. Do not use.</descr>
+</element>
+
+<element name="DetectMouse">
+<short>Detect the presence of a mouse.</short>
+<descr>
+<p>
+<var>DetectMouse</var> detects whether a mouse is attached to the system or not.
+If there is no mouse, then zero is returned. If a mouse is attached, then
+the number of mouse buttons is returnead.
+</p>
+<p>
+This function should be called after the mouse driver was initialized.
+</p>
+</descr>
+<errors>
+None.
+</errors>
+<seealso>
+<link id="InitMouse"/>
+<link id="DoneMouse"/>,
+</seealso>
+<example file="mouseex/ex1"/>
+</element>
+
+<element name="DoneMouse">
+<short>Deinitialize mouse driver.</short>
+<descr>
+<p>
+<var>DoneMouse</var> De-initializes the mouse driver. It cleans up any memory
+allocated when the mouse was initialized, or removes possible mouse hooks
+from memory. The mouse functions will not work after <var>DoneMouse</var> was
+called. If <var>DoneMouse</var> is called a second time, it will exit at once.
+<var>InitMouse</var> should be called before <var>DoneMouse</var> can be called again.
+</p>
+<p>
+For an example, see most other mouse functions.
+</p>
+</descr>
+<errors>
+None.
+</errors>
+<seealso>
+<link id="DetectMouse"/>
+<link id="InitMouse"/>
+</seealso>
+</element>
+
+
+<element name="GetMouseButtons">
+<short>Get the state of the mouse buttons</short>
+<descr>
+<p>
+<var>GetMouseButtons</var> returns the current button state of the mouse, i.e.
+it returns a or-ed combination of the following constants:
+</p>
+<dl>
+<dt>MouseLeftButton</dt>
+<dd> When the left mouse button is held down.
+</dd>
+<dt>MouseRightButton</dt>
+<dd> When the right mouse button is held down.
+</dd>
+<dt>MouseMiddleButton</dt>
+<dd> When the middle mouse button is held down.
+</dd>
+</dl>
+</descr>
+<errors>
+None.
+</errors>
+<seealso>
+<link id="GetMouseEvent"/>
+<link id="GetMouseX"/>
+<link id="GetMouseY"/>
+</seealso>
+<example file="mouseex/ex2"/>
+</element>
+
+<element name="GetMouseDriver">
+<short>Get a copy of the currently active mouse driver.</short>
+<descr>
+<p>
+<var>GetMouseDriver</var> returns the currently set mouse driver. It can be used
+to retrieve the current mouse driver, and override certain callbacks.
+</p>
+<p>
+A more detailed explanation about getting and setting mouse drivers can be found in
+<link id="mousedrv"/>.
+</p>
+<p>
+For an example, see the section on writing a custom mouse driver,
+<link id="mousedrv"/>
+</p>
+</descr>
+<errors>
+None.
+</errors>
+<seealso>
+<link id="SetMouseDriver"/>
+</seealso>
+</element>
+
+
+<element name="GetMouseEvent">
+<short>Get next mouse event from the queue.</short>
+<descr>
+<p>
+<var>GetMouseEvent</var> returns the next mouse event (a movement, button press or
+button release), and waits for one if none is available in the queue.
+</p>
+<p>
+Some mouse drivers can implement a mouse event queue which can hold multiple
+events till they are fetched. Others don't, and in that case, a one-event
+queue is implemented for use with <link id="PollMouseEvent"/>.
+</p>
+</descr>
+<errors>
+None.
+</errors>
+<seealso>
+<link id="GetMouseButtons"/>
+<link id="GetMouseX"/>
+<link id="GetMouseY"/>
+</seealso>
+</element>
+
+<element name="GetMouseX">
+<short>Query the current horizontal position of the mouse cursor.</short>
+<descr>
+<var>GetMouseX</var> returns the current <var>X</var> position of the mouse. <var>X</var> is
+measured in characters, starting at 0 for the left side of the screen.
+</descr>
+<errors>
+None.
+</errors>
+<seealso>
+<link id="GetMouseButtons"/>
+<link id="GetMouseEvent"/>
+<link id="GetMouseY"/>
+</seealso>
+<example file="mouseex/ex4"/>
+</element>
+
+<element name="GetMouseY">
+<short>Query the current vertical position of the mouse cursor.</short>
+<descr>
+<p>
+<var>GetMouseY</var> returns the current <var>Y</var> position of the mouse. <var>Y</var> is
+measured in characters, starting at 0 for the top of the screen.
+</p>
+<p>
+For an example, see <link id="GetMouseX"/>
+</p>
+</descr>
+<errors>
+None.
+</errors>
+<seealso>
+<link id="GetMouseButtons"/>
+<link id="GetMouseEvent"/>
+<link id="GetMouseX"/>
+</seealso>
+</element>
+
+
+<element name="HideMouse">
+<short>Hide the mouse cursor.</short>
+<descr>
+<var>HideMouse</var> hides the mouse cursor. This may or may not be implemented
+on all systems, and depends on the driver.
+</descr>
+<errors>
+None.
+</errors>
+<seealso>
+<link id="ShowMouse"/>
+</seealso>
+<example file="mouseex/ex5"/>
+</element>
+
+
+<element name="InitMouse">
+<short>Initialize the FPC mouse driver.</short>
+<descr>
+<p>
+<var>InitMouse</var> Initializes the mouse driver. This will allocate any data
+structures needed for the mouse to function. All mouse functions can be
+used after a call to <var>InitMouse</var>.
+</p>
+<p>
+A call to <var>InitMouse</var> must always be followed by a call to <link id="DoneMouse"/>
+at program exit. Failing to do so may leave the mouse in an unusable state,
+or may result in memory leaks.
+</p>
+<p>
+For an example, see most other functions.
+</p>
+</descr>
+<errors>
+None.
+</errors>
+<seealso>
+<link id="DoneMouse"/>
+<link id="DetectMouse"/>
+</seealso>
+</element>
+
+
+<element name="PollMouseEvent">
+<short>Query next mouse event. Do not wait if none available.</short>
+<descr>
+<p>
+<var>PollMouseEvent</var> checks whether a mouse event is available, and 
+returns it in <var>MouseEvent</var> if one is found. The function result is
+<var>True</var> in that case. If no mouse event is pending, the function result
+is <var>False</var>, and the contents of <var>MouseEvent</var> is undefined.
+</p>
+<p>
+Note that after a call to <var>PollMouseEvent</var>, the event should still 
+be removed from the mouse event queue with a call to <var>GetMouseEvent</var>.
+</p>
+</descr>
+<errors>
+None.
+</errors>
+<seealso>
+<link id="GetMouseEvent"/>
+<link id="PutMouseEvent"/>
+</seealso>
+</element>
+
+<element name="PutMouseEvent">
+<short>Put a mouse event in the venet queue.</short>
+<descr>
+<p>
+<var>PutMouseEvent</var> adds <var>MouseEvent</var> to the input queue. The next
+call to <link id="GetMouseEvent"/> or <var>PollMouseEvent</var> will then return
+<var>MouseEvent</var>. 
+</p>
+<p>
+Please note that depending on the implementation the mouse event queue
+can hold only one value.
+</p>
+</descr>
+<errors>
+None.
+</errors>
+<seealso>
+<link id="GetMouseEvent"/>
+<link id="PollMouseEvent"/>
+</seealso>
+</element>
+
+<element name="SetMouseDriver">
+<short>Set a new mouse driver.</short>
+<descr>
+<p>
+<var>SetMouseDriver</var> sets the mouse driver to <var>Driver</var>. This function
+should be called before <link id="InitMouse"/> is called, or after <var>DoneMouse</var>
+is called. If it is called after the mouse has been initialized, it does
+nothing.
+</p>
+<p>
+For more information on setting the mouse driver, <link id="mousedrv"/>.
+</p>
+<p>
+For an example, see <link id="mousedrv"/>
+</p>
+</descr>
+<errors>
+</errors>
+<seealso>
+<link id="InitMouse"/>
+<link id="DoneMouse"/>
+<link id="GetMouseDriver"/>
+</seealso>
+</element>
+
+
+<element name="SetMouseXY">
+<short>Set the mouse cursor position.</short>
+<descr>
+<var>SetMouseXY</var> places the mouse cursor on <var>X,Y</var>. X and Y are zero
+based character coordinates: <var>0,0</var> is the top-left corner of the screen,
+and the position is in character cells (i.e. not in pixels).
+</descr>
+<errors>
+None.
+</errors>
+<seealso>
+<link id="GetMouseX"/>
+<link id="GetMouseY"/>
+</seealso>
+<example file="mouseex/ex7"/>
+</element>
+
+
+<element name="ShowMouse">
+<short>Show the mouse cursor.</short>
+<descr>
+<p>
+<var>ShowMouse</var> shows the mouse cursor if it was previously hidden. The
+capability to hide or show the mouse cursor depends on the driver.
+</p>
+<p>
+For an example, see <link id="HideMouse"/>
+</p>
+</descr>
+<errors>
+None.
+</errors>
+<seealso>
+<link id="HideMouse"/>
+</seealso>
+</element>
+
+<topic name="mousedrv">
+<short>Writing a custom mouse driver</short>
+<descr>
+<p>
+The <file>mouse</file> unit has support for adding a custom mouse driver. This can be
+used to add support for mouses not supported by the standard Free Pascal driver,
+but also to enhance an existing driver for instance to log mouse events or
+to implement a record and playback function. 
+</p>
+<p>
+The following unit shows how a mouse driver can be enhanced by adding some
+logging capabilities to the driver.
+</p>
+</descr>
+<example file="mouseex/logmouse"/>
+</topic>
+
+</module>
+</package>
+</fpdoc-descriptions>

+ 3264 - 0
docs/objects.xml

@@ -0,0 +1,3264 @@
+<?xml version="1.0" encoding="ISO8859-1"?>
+<fpdoc-descriptions>
+<!--
+
+   $Id$
+   This file is part of the FPC documentation.
+   Copyright (C) 1997, by Michael Van Canneyt
+
+   The FPC documentation is free text; you can redistribute it and/or
+   modify it under the terms of the GNU Library General Public License as
+   published by the Free Software Foundation; either version 2 of the
+   License, or (at your option) any later version.
+
+   The FPC Documentation 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.  See the GNU
+   Library General Public License for more details.
+
+   You should have received a copy of the GNU Library General Public
+   License along with the FPC documentation; see the file COPYING.LIB.  If not,
+   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.
+ -->
+<package name="rtl">
+<module name="objects">
+<short>The Objects unit.</short>
+<!-- \FPCexampledir{objectex} -->
+<descr>
+<p>
+This document documents the <file>objects</file> unit. The unit was implemented by
+many people, and was mainly taken from the FreeVision sources. It has been
+ported to all supported platforms.
+</p>
+<p>
+The methods and fields that are in a <var>Private</var> part of an object
+declaration have been left out of this documentation.
+</p>
+</descr>
+
+<element name="stOk">
+<short>Stream error codes: No error</short>
+</element>
+
+<element name="stError">
+<short>Stream error codes: Access error</short>
+</element>
+
+<element name="stInitError">
+<short>Stream error codes: Initialize error</short>
+</element>
+
+<element name="stReadError">
+<short>Stream error codes: Stream read error</short>
+</element>
+
+<element name="stWriteError">
+<short>Stream error codes: Stream write error</short>
+</element>
+
+<element name="stGetError">
+<short>Stream error codes: Get object error</short>
+</element>
+
+<element name="stPutError">
+<short>Stream error codes: Put object error</short>
+</element>
+
+<element name="stSeekError">
+<short>Stream error codes: Seek error in stream</short>
+</element>
+
+<element name="stOpenError">
+<short>Stream error codes: Error opening stream</short>
+</element>
+
+<element name="stCreate">
+<short>Stream initialization mode: Create new file</short>
+</element>
+
+<element name="stOpenRead">
+<short>Stream initialization mode: Read access only</short>
+</element>
+
+<element name="stOpenWrite">
+<short>Stream initialization mode: Write access only</short>
+</element>
+
+<element name="stOpen">
+<short>Stream initialization mode: Read/write access</short>
+</element>
+
+<element name="coIndexError">
+<short>Collection list error: Index out of range</short>
+</element>
+
+<element name="coOverflow">
+<short>Collection list error: Overflow</short>
+</element>
+
+<element name="MaxBytes">
+<short>Maximum data size (in bytes)</short>
+</element>
+
+<element name="MaxWords">
+<short>Maximum data size (in words)</short>
+</element>
+
+<element name="MaxPtrs">
+<short>Maximum data size (in pointers)</short>
+</element>
+
+<element name="MaxReadBytes">
+<short>Maximum data that can be read from a stream (not used)</short>
+</element>
+
+<element name="MaxCollectionSize">
+<short>Maximum collection size (in items)</short>
+</element>
+
+<element name="DefaulTPCompatible">
+<short>Is the default stream content TP compatible</short>
+<descr>
+This variable determines whether the default stream is filled or read in a
+TP compatible way. The <var>TPCompatible</var> field can be set on a
+per-stream basis, and is initialized with the <var>DefaulTPCompatible</var>
+value.
+</descr>
+</element>
+
+<element name="RCollection">
+<short>Default stream record for the <link id="TCollection"/> object.</short>
+</element>
+
+<element name="RStrCollection">
+<short>Default stream record for the <link id="TStrCollection"/> object.</short>
+</element>
+
+<element name="RStringCollection">
+<short>Default stream record for the <link id="TStringCollection"/> object.</short>
+</element>
+
+<element name="RStringList">
+<short>Default stream record for the <link id="TStringList"/> object.</short>
+</element>
+
+<element name="RStrListMaker">
+<short>Default stream record for the <link id="TStrListMaker"/> object.</short>
+</element>
+
+<element name="StreamError">
+<short>Pointer to default stream error handler.</short>
+</element>
+
+<element name="vmtHeaderSize">
+<short>Size of the VMT header in an object (not used).</short>
+</element>
+
+
+<element name="MaxTPCompatibleCollectionSize">
+<short>Maximum collection size (in items, same value as in TP)</short>
+</element>
+
+
+<element name="TCharSet">
+<short>Generic set of characters type.</short>
+</element>
+
+<element name="PCharSet">
+<short>Pointer to <link id="TCharSet"/>.</short>
+</element>
+
+<element name="TByteArray">
+<short>Array with maxmimum allowed number of bytes.</short>
+</element>
+
+<element name="PByteArray">
+<short>Pointer to <link id="TByteArray"/></short>
+</element>
+
+<element name="TWordArray">
+<short>Array with maxmimum allowed number of words.</short>
+</element>
+
+<element name="PWordArray">
+<short>Pointer to <link id="TWordArray"/></short>
+</element>
+
+<element name="TPointerArray">
+<short>Array with maxmimum allowed number of pointers</short>
+</element>
+
+<element name="PPointerArray">
+<short>Pointer to <link id="TPointerArray"/></short>
+</element>
+
+<element name="PString">
+<short>Pointer to a shortstring.</short>
+</element>
+
+<element name="AsciiZ">
+<short>Filename - null terminated array of characters.</short>
+</element>
+
+<element name="FNameStr">
+<short>Filename - shortstring version.</short>
+</element>
+
+<element name="Sw_Word">
+<short>Alias for Cardinal</short>
+</element>
+
+<element name="Sw_Integer">
+<short>Alias for longint</short>
+</element>
+
+<element name="WordRec">
+<short>Record describing a Word (in bytes)</short>
+</element>
+
+<element name="WordRec.Hi">
+<short>High byte of a word</short>
+</element>
+
+<element name="WordRec.Lo">
+<short>Low byte of a word</short>
+</element>
+
+<element name="LongRec">
+<short>Record describing a longint (in Words)</short>
+</element>
+
+<element name="LongRec.Lo">
+<short>Lower word of longint</short>
+</element>
+
+<element name="LongRec.Hi">
+<short>High word of longint</short>
+</element>
+
+<element name="PtrRec">
+<short>Record describing a pointer to a memory location.</short>
+</element>
+
+<element name="PtrRec.Ofs">
+<short>Pointer offset</short>
+</element>
+
+<element name="PtrRec.Seg">
+<short>Pointer segment</short>
+</element>
+
+<element name="PStreamRec">
+<short>Pointer to <link id="TStreamRec"/></short>
+</element>
+
+<element name="TStreamRec">
+<short>Record used in streaming mechanism. </short>
+<descr>
+<var>TSreamRec</var> is used by the <file>Objects</file> unit streaming
+mechanism: when an object is registered, a <var>TStreamRec</var> record is
+added to a list of records. This list is used when objects need to be
+streamed from/streamed to a stream. It contains all the information needed
+to stream the object.
+</descr>
+</element>
+
+<element name="TStreamRec.ObjType">
+<short>Unique identifier for this object type.</short>
+</element>
+
+<element name="TStreamRec.VmtLink">
+<short>Pointer to object VMT</short>
+</element>
+
+<element name="TStreamRec.Load">
+<short>Procedure to call when object must be loaded from a stream</short>
+</element>
+
+<element name="TStreamRec.Store">
+<short>Procedure to call when object must be stored in a stream.</short>
+</element>
+
+<element name="TStreamRec.Next">
+<short>Next item in list</short>
+</element>
+
+<element name="PPoint">
+<short>Pointer to <link id="TPoint"/> record.</short>
+</element>
+
+<element name="TPoint">
+<short>Record describing a point in a 2 dimensional plane.</short>
+</element>
+
+<element name="TPoint.X">
+<short>X coordinate</short>
+</element>
+
+<element name="TPoint.Y">
+<short>Y coordinate</short>
+</element>
+
+<element name="TItemList">
+<short>Pointer array type used in a <link id="TCollection"/></short>
+</element>
+
+<element name="TStrIndex">
+<short>Pointer array type used in a <link id="TStringList"/></short>
+</element>
+
+<element name="TStrIndexRec">
+<short>Record type used in a <link id="TStringList"/> to store the strings</short>
+</element>
+
+<element name="TStrIndexRec.Key">
+<short>String key value</short>
+</element>
+
+<element name="TStrIndexRec.Count">
+<short>String character count</short>
+</element>
+
+<element name="TStrIndexRec.Offset">
+<short>String offset in stream</short>
+</element>
+
+<element name="NewStr">
+<short>Allocate a copy of a shortstring on the heap.</short>
+<descr>
+<p>
+<var>NewStr</var> makes a copy of the string <var>S</var> on the heap,
+and returns a pointer to this copy. If the string is empty then
+<var>Nil</var> is returned.
+</p>
+<p>
+The allocated memory is not based on the declared size of the string passed
+to <var>NewStr</var>, but is baed on the actual length of the string.
+</p>
+</descr>
+<errors>
+If not enough memory is available, an 'out of memory' error will occur.
+</errors>
+<seealso>
+<link id="DisposeStr"/>
+<link id="SetStr"/>
+</seealso>
+<example file="objectex/ex40"/>
+</element>
+
+<element name="SetStr">
+<short>Allocate a copy of a shortstring on the heap.</short>
+<descr>
+<p>
+<var>SetStr</var> makes a copy of the string <var>S</var> on the heap and
+returns the pointer to this copy in <var>P</var>. If <var>P</var> pointed to
+another string (i.e. was not <var>Nil</var>, the memory is released first.
+Contrary to <link id="NewStr"/>, if the string is empty then a pointer to 
+an empty string is returned.
+</p>
+<p>
+The allocated memory is not based on the declared size of the string passed
+to <var>NewStr</var>, but is based on the actual length of the string.
+</p>
+</descr>
+<errors>
+If not enough memory is available, an 'out of memory' error will occur.
+</errors>
+<seealso>
+<link id="DisposeStr"/>
+<link id="NewStr"/>
+</seealso>
+</element>
+
+
+
+<element name="DisposeStr">
+<short>Dispose of a shortstring which was allocated on the heap.</short>
+<descr>
+<p>
+<var>DisposeStr</var> removes a dynamically allocated string from the heap.
+</p>
+<p>
+For an example, see <link id="NewStr"/>.
+</p>
+</descr>
+<errors>
+None.
+</errors>
+<seealso>
+<link id="NewStr"/>
+<link id="SetStr"/>
+</seealso>
+</element>
+
+
+<element name="Abstract">
+<short>Abstract error handler.</short>
+<descr>
+<p>
+When implementing abstract methods, do not declare them as <var>abstract</var>.
+Instead, define them simply as <var>virtual</var>. In the implementation of such
+abstract methods, call the <var>Abstract</var> procedure. This allows explicit
+control of what happens when an abstract method is called.
+</p>
+<p>
+The current implementation of <var>Abstract</var> terminates the program with
+a run-time error 211.
+</p>
+</descr>
+<errors>
+None.
+</errors>
+</element>
+
+<element name="RegisterObjects">
+<short>Register standard objects.</short>
+<descr>
+<p>
+<var>RegisterObjects</var> registers the following objects for streaming:
+</p>
+<ol>
+<li> <var>TCollection</var>, see <link id="TCollection"/>.</li>
+<li> <var>TStringCollection</var>, see <link id="TStringCollection"/>.</li>
+<li> <var>TStrCollection</var>, see <link id="TStrCollection"/>.</li>
+</ol>
+</descr>
+<errors>
+None.
+</errors>
+<seealso>
+<link id="RegisterType"/>
+</seealso>
+</element>
+
+<element name="RegisterType">
+<short>Register new object for streaming.</short>
+<descr>
+<p>
+<var>RegisterType</var> registers a new type for streaming. An object cannot
+be streamed unless it has been registered first.
+The stream record <var>S</var> needs to have the following fields set:
+</p>
+<dl>
+<dt>ObjType: Sw_Word</dt>
+<dd> This should be a unique identifier. Each possible
+type should have it's own identifier.
+</dd>
+<dt>VmtLink: pointer</dt>
+<dd>This should contain a pointer to the VMT (Virtual
+Method Table) of the object you try to register.
+</dd>
+<dt>Load : Pointer</dt>
+<dd> is a pointer to a method that initializes an instance
+of that object, and reads the initial values from a stream. This method
+should accept as it's sole argument a <var>PStream</var> type variable.
+</dd>
+<dt>Store: Pointer</dt>
+<dd>is a pointer to a method that stores an instance of the
+object to a stream. This method should accept as it's sole argument
+ a <var>PStream</var> type variable.
+</dd>
+</dl>
+<p>
+The VMT of the object can be retrieved with the
+following expression:
+</p>
+<code>
+  VmtLink: Ofs(TypeOf(MyType)^);
+</code>
+</descr>
+<errors>
+In case of error (if a object with the same <var>ObjType</var>) is already
+registered), run-time error 212 occurs.
+</errors>
+<example file="objectex/myobject"/>
+</element>
+
+
+<element name="LongMul">
+<short>Overflow safe multiply.</short>
+<descr>
+<var>LongMul</var> multiplies <var>X</var> with <var>Y</var>. The result is of
+type <var>Longint</var>. This avoids possible overflow errors you would normally
+get when multiplying <var>X</var> and <var>Y</var> that are too big.
+</descr>
+<errors>
+None.
+</errors>
+<seealso>
+<link id="LongDiv"/>
+</seealso>
+</element>
+
+<element name="LongDiv">
+<short>Overflow safe divide</short>
+<descr>
+<var>LongDiv</var> divides <var>X</var> by <var>Y</var>. The result is of
+type <var>Integer</var> instead of type <var>Longint</var>, as you would get 
+normally. 
+</descr>
+<errors>
+If Y is zero, a run-time error will be generated.
+</errors>
+<seealso>
+<link id="LongMul"/>
+</seealso>
+</element>
+
+<element name="TRect">
+<short>Describes a rectangular region in a plane.</short>
+</element>
+
+<element name="TRect.A">
+<short>Top left corner of rectangle</short>
+</element>
+
+<element name="TRect.B">
+<short>Bottom right corner of rectangle</short>
+</element>
+
+<element name="TRect.Empty">
+<short>Is the surface of the rectangle zero</short>
+<descr>
+<var>Empty</var> returns <var>True</var> if the rectangle defined by the corner points
+<var>A</var>, <var>B</var> has zero or negative surface.
+</descr>
+<errors>
+None.
+</errors>
+<seealso>
+<link id="TRect.Equals"/>
+<link id="TRect.Contains"/>
+</seealso>
+<example file="objectex/ex1"/>
+</element>
+
+
+<element name="TRect.Equals">
+<short>Do the corners of the rectangles match</short>
+<descr>
+<p>
+<var>Equals</var> returns <var>True</var> if the rectangle has the 
+same corner points <var>A,B</var> as the rectangle R, and <var>False</var>
+otherwise.
+</p>
+<p>
+For an example, see <link id="TRect.Empty"/>
+</p>
+</descr>
+<errors>
+None.
+</errors>
+<seealso>
+<link id="TRect.Empty"/>
+<link id="TRect.Contains"/>
+</seealso>
+</element>
+
+
+<element name="TRect.Contains">
+<short>Determine if a point is inside the rectangle</short>
+<descr>
+<var>Contains</var> returns <var>True</var> if the point <var>P</var> is contained
+in the rectangle (including borders), <var>False</var> otherwise.
+</descr>
+<errors>
+None.
+</errors>
+<seealso>
+<link id="TRect.Intersect"/>
+<link id="TRect.Equals"/>
+</seealso>
+</element>
+
+<element name="TRect.Copy">
+<short>Copy cornerpoints from another rectangle.</short>
+<descr>
+Assigns the rectangle R to the object. After the call to <var>Copy</var>, the
+rectangle R has been copied to the object that invoked <var>Copy</var>.
+</descr>
+<errors>
+None.
+</errors>
+<seealso>
+<link id="TRect.Assign"/>
+</seealso>
+<example file="objectex/ex2"/>
+</element>
+
+
+<element name="TRect.Union">
+<short>Enlarges rectangle to encompas another rectangle.</short>
+<descr>
+<var>Union</var> enlarges the current rectangle so that it becomes the union
+of the current rectangle with the rectangle <var>R</var>.
+</descr>
+<errors>
+None.
+</errors>
+<seealso>
+<link id="TRect.Intersect"/>
+</seealso>
+<example file="objectex/ex3"/>
+</element>
+
+
+<element name="TRect.Intersect">
+<short>Reduce rectangle to intersection with another rectangle</short>
+<descr>
+<var>Intersect</var> makes the intersection of the current rectangle with
+<var>R</var>. If the intersection is empty, then the rectangle is set to the empty
+rectangle at coordinate (0,0).
+</descr>
+<errors>
+None.
+</errors>
+<seealso>
+<link id="TRect.Union"/>
+</seealso>
+<example file="objectex/ex4"/>
+</element>
+
+<element name="TRect.Move">
+<short>Move rectangle along a vector.</short>
+<descr>
+<var>Move</var> moves the current rectangle along a vector with components
+<var>(ADX,ADY)</var>. It adds <var>ADX</var> to the X-coordinate of both corner
+points, and <var>ADY</var> to both end points.
+</descr>
+<errors>
+None.
+</errors>
+<seealso>
+<link id="TRect.Grow"/>
+</seealso>
+<example file="objectex/ex5"/>
+</element>
+
+
+<element name="TRect.Grow">
+<short>Expand rectangle with certain size.</short>
+<descr>
+<p>
+<var>Grow</var> expands the rectangle with an amount <var>ADX</var> in the <var>X</var>
+direction (both on the left and right side of the rectangle, thus adding a 
+length 2*ADX to the width of the rectangle), and an amount <var>ADY</var> in 
+the <var>Y</var> direction (both on the top and the bottom side of the rectangle,
+adding a length 2*ADY to the height of the rectangle. 
+</p>
+<p>
+<var>ADX</var> and <var>ADY</var> can be negative. If the resulting rectangle is empty, it is set 
+to the empty rectangle at <var>(0,0)</var>.
+</p>
+</descr>
+<errors>
+None.
+</errors>
+<seealso>
+<link id="TRect.Move"/>
+</seealso>
+<example file="objectex/ex6"/>
+</element>
+
+<element name="TRect.Assign">
+<short>Set rectangle corners.</short>
+<descr>
+<p>
+<var>Assign</var> sets the corner points of the rectangle to <var>(XA,YA)</var> and
+<var>(Xb,Yb)</var>.
+</p>
+<p>
+For an example, see <link id="TRect.Copy"/>.
+</p>
+</descr>
+<errors>
+None.
+</errors>
+<seealso>
+<link id="TRect.Copy"/>
+</seealso>
+</element>
+
+<element name="TObject">
+<short>Basis of all objects</short>
+<descr>
+This type serves as the basic object for all other objects in the
+<file>Objects</file> unit.
+</descr>
+</element>
+
+<element name="TObject.Init">
+<short>Construct (initialize) a new object</short>
+<descr>
+<p>
+Instantiates a new object of type <var>TObject</var>. It fills the instance up
+with Zero bytes.
+</p>
+<p>
+For an example, see <link id="TObject.Free">Free</link>
+</p>
+</descr>
+<errors>
+None.
+</errors>
+<seealso>
+<link id="TObject.Free"/>
+<link id="TObject.Done"/>
+</seealso>
+</element>
+
+
+<element name="TObject.Free">
+<short>Destroy an object and release all memory.</short>
+<descr>
+<var>Free</var> calls the destructor of the object, and releases the memory
+occupied by the instance of the object.
+</descr>
+<errors>
+No checking is performed to see whether <var>self</var> is <var>nil</var> and whether
+the object is indeed allocated on the heap.
+</errors>
+<seealso>
+<link id="TObject.Init"/>
+<link id="TObject.Done"/>
+</seealso>
+<example file="objectex/ex7"/>
+</element>
+
+
+<element name="TObject.Done">
+<short>Destroy an object.</short>
+<descr>
+<p>
+<var>Done</var>, the destructor of <var>TObject</var> does nothing. It is mainly
+intended to be used in the <link id="TObject.Free"/> method.
+</p>
+<p>
+The destructore Done does not free the memory occupied by the object.
+</p>
+</descr>
+<errors>
+None.
+</errors>
+<seealso>
+<link id="TObject.Free"/>
+<link id="TObject.Init"/>
+</seealso>
+<example file="objectex/ex8"/>
+</element>
+
+
+<element name="TStream">
+<short>Base stream class</short>
+<descr>
+<p>
+The <var>TStream</var> object is the ancestor for all streaming objects, i.e.
+objects that have the capability to store and retrieve data.
+</p>
+<p>
+It defines a number of methods that are common to all objects that implement
+streaming, many of them are virtual, and are only implemented in the
+descendent types.
+</p>
+<p>
+Programs should not instantiate objects of type TStream directly, but
+instead instantiate a descendant type, such as <var>TDosStream</var>,
+<var>TMemoryStream</var>.
+</p>
+</descr>
+<seealso>
+<link id="PStream"/>
+<link id="TDosStream"/>
+<link id="TMemoryStream"/>
+</seealso>
+</element>
+
+<element name="PStream">
+<short>Pointer type to <link id="TStream"/></short>
+</element>
+
+<element name="TStream.Status">
+<short>Current stream status</short>
+</element>
+
+<element name="TStream.ErrorInfo">
+<short>Additional error info when there is an error.</short>
+</element>
+
+<element name="TStream.StreamSize">
+<short>Current size of the stream</short>
+</element>
+
+<element name="TStream.Position">
+<short>Current Stream position</short>
+</element>
+
+<element name="TStream.TPCompatible">
+<short>If set to <var>True</var> streamed data is written in a TP compatible format.</short>
+</element>
+
+<element name="TStream.Get">
+<short>Read an object definition from the stream.</short>
+<descr>
+<var>Get</var> reads an object definition  from a stream, and returns
+a pointer to an instance of this object.
+</descr>
+<errors>
+On error, <link id="TStream.Status"/> is set, and <var>NIL</var> is returned.
+</errors>
+<seealso> 
+<link id="TStream.Put"/>
+</seealso>
+<example file="objectex/ex9"/>
+</element>
+
+
+<element name="TStream.StrRead">
+<short>Read a null-terminated string from the stream.</short>
+<descr>
+<var>StrRead</var> reads a string from the stream, allocates memory
+for it, and returns a pointer to a null-terminated copy of the string
+on the heap.
+</descr>
+<errors>
+On error, <var>Nil</var> is returned.
+</errors>
+<seealso>
+<link id="TStream.StrWrite"/>
+<link id="TStream.ReadStr"/>
+</seealso>
+<example file="objectex/ex10"/>
+</element>
+
+
+
+<element name="TStream.GetPos">
+<short>Return current position in the stream</short>
+<descr>
+If the stream's status is <var>stOk</var>, <var>GetPos</var> returns the current 
+position in the stream. Otherwise it returns <var>-1</var>
+</descr>
+<errors>
+<var>-1</var> is returned if the status is an error condition.
+</errors>
+<seealso>
+<link id="TStream.Seek"/>
+<link id="TStream.GetSize"/>
+</seealso>
+<example file="objectex/ex11"/>
+</element>
+
+
+
+<element name="TStream.GetSize">
+<short>Return the size of the stream.</short>
+<descr>
+If the stream's status is <var>stOk</var> then <var>GetSize</var> returns
+the size of the stream, otherwise it returns <var>-1</var>.
+</descr>
+<errors>
+<var>-1</var> is returned if the status is an error condition.
+</errors>
+<seealso>
+<link id="TStream.Seek"/>
+<link id="TStream.GetPos"/>
+</seealso>
+<example file="objectex/ex12"/>
+</element>
+
+<element name="TStream.ReadStr">
+<short>Read a shortstring from the stream.</short>
+<descr>
+<var>ReadStr</var> reads a string from the stream, copies it to the heap
+and returns a pointer to this copy. The string is saved as a pascal
+string, and hence is NOT null terminated.
+</descr>
+<errors>
+On error (e.g. not enough memory), <var>Nil</var> is returned.
+</errors>
+<seealso>
+<link id="TStream.StrRead"/>
+</seealso>
+<example file="objectex/ex13"/>
+</element>
+
+<element name="TStream.Open">
+<short>Open the stream</short>
+<descr>
+<p>
+<var>Open</var> is an abstract method, that should be overridden by descendent
+objects. Since opening a stream depends on the stream's type this is not
+surprising.
+</p>
+<p>
+For an example, see <link id="TDosStream.Open"/>.
+</p>
+</descr>
+<errors>
+None.
+</errors>
+<seealso>
+<link id="TStream.Close"/>
+<link id="TStream.Reset"/>
+</seealso>
+</element>
+
+
+<element name="TStream.Close">
+<short>Close the stream</short>
+<descr>
+<p>
+<var>Close</var> is an abstract method, that should be overridden by descendent
+objects. Since Closing a stream depends on the stream's type this is not
+surprising.
+</p>
+<p>
+for an example, see <link id="TDosStream.Open"/>.
+</p>
+</descr>
+<errors>
+None.
+</errors>
+<seealso>
+<link id="TStream.Open"/>
+<link id="TStream.Reset"/>
+</seealso>
+</element>
+
+<element name="TStream.Reset">
+<short>Reset the stream</short>
+<descr>
+<var>Reset</var> sets the stream's status to <var>0</var>, as well as the ErrorInfo
+</descr>
+<errors>
+None.
+</errors>
+<seealso>
+<link id="TStream.Open"/>
+<link id="TStream.Close"/>
+</seealso>
+</element>
+
+<element name="TStream.Flush">
+<short>Flush the stream data from the buffer, if any.</short>
+<descr>
+<p>
+<var>Flush</var> is an abstract method that should be overridden by descendent
+objects. It serves to enable the programmer to tell streams that implement 
+a buffer to clear the buffer.
+</p>
+<p>
+for an example, see <link id="TBufStream.Flush"/>.
+</p>
+</descr>
+<errors>
+None.
+</errors>
+<seealso>
+<link id="TStream.Truncate"/>
+</seealso>
+</element>
+
+
+<element name="TStream.Truncate">
+<short>Truncate the stream size on current position.</short>
+<descr>
+<p>
+<var>Truncate</var> is an abstract procedure that should be overridden by
+descendent objects. It serves to enable the programmer to truncate the
+size of the stream to the current file position.
+</p>
+<p>
+For an example, see <link id="TDosStream.Truncate"/>.
+</p>
+</descr>
+<errors>
+None.
+</errors>
+<seealso>
+<link id="TStream.Seek"/>
+</seealso>
+</element>
+
+
+<element name="TStream.Put">
+<short>Write an object to the stream.</short>
+<descr>
+<p>
+<var>Put</var> writes the object pointed to by <var>P</var>. <var>P</var> should be
+non-nil. The object type must have been registered with <link id="RegisterType"/>.
+</p>
+<p>
+After the object has been written, it can be read again with <link id="TStream.Get">Get</link>.
+</p>
+<p>
+For an example, see <link id="TStream.Get"/>;
+</p>
+</descr>
+<errors>
+No check is done whether P is <var>Nil</var> or not. Passing <var>Nil</var> will cause
+a run-time error 216 to be generated. If the object has not been registered,
+the status of the stream will be set to <var>stPutError</var>.
+</errors>
+<seealso>
+<link id="TStream.Get"/>
+</seealso>
+</element>
+
+
+<element name="TStream.StrWrite">
+<short>Write a null-terminated string to the stream.</short>
+<descr>
+<p>
+<var>StrWrite</var> writes the null-terminated string <var>P</var> to the stream.
+<var>P</var> can only be 65355 bytes long.
+</p>
+<p>
+For an example, see <link id="TStream.StrRead"/>.
+</p>
+</descr>
+<errors>
+None.
+</errors>
+<seealso>
+<link id="TStream.WriteStr"/>
+<link id="TStream.StrRead"/>
+<link id="TStream.ReadStr"/>
+</seealso>
+</element>
+
+
+<element name="TStream.WriteStr">
+<short>Write a pascal string to the stream.</short>
+<descr>
+<p>
+<var>StrWrite</var> writes the pascal string pointed to by <var>P</var> to the stream.
+</p>
+<p>
+For an example, see <link id="TStream.ReadStr"/>.
+</p>
+</descr>
+<errors>
+None.
+</errors>
+<seealso>
+<link id="TStream.StrWrite"/>
+<link id="TStream.StrRead"/>
+<link id="TStream.ReadStr"/>
+</seealso>
+</element>
+
+<element name="TStream.Seek">
+<short>Set stream position.</short>
+<descr>
+<p>
+Seek sets the position to <var>Pos</var>. This position is counted
+from the beginning, and is zero based. (i.e. seeek(0) sets the position
+pointer on the first byte of the stream)
+</p>
+<p>
+For an example, see <link id="TDosStream.Seek"/>.
+</p>
+</descr>
+<errors>
+If <var>Pos</var> is larger than the stream size, <var>Status</var> is set to
+<var>StSeekError</var>.
+</errors>
+<seealso>
+<link id="TStream.GetPos"/>
+<link id="TStream.GetSize"/>
+</seealso>
+</element>
+
+
+
+<element name="TStream.Error">
+<short>Set stream status</short>
+<descr>
+<p>
+<var>Error</var> sets the stream's status to <var>Code</var> and <var>ErrorInfo</var>
+to <var>Info</var>. If the <var>StreamError</var> procedural variable is set,
+<var>Error</var> executes it, passing <var>Self</var> as an argument.
+</p>
+<p>
+This method should not be called directly from a program. It is intended to
+be used in descendent objects.
+</p>
+</descr>
+<errors>
+None.
+</errors>
+</element>
+
+<element name="TStream.Read">
+<short>Read data from stream to buffer.</short>
+<descr>
+<p>
+<var>Read</var> is an abstract method that should be overridden by descendent
+objects.
+</p>
+<p>
+<var>Read</var> reads <var>Count</var> bytes from the stream into <var>Buf</var>.
+It updates the position pointer, increasing it's value with <var>Count</var>. 
+<var>Buf</var> must be large enough to contain <var>Count</var> bytes.
+</p>
+</descr>
+<errors>
+No checking is done to see if <var>Buf</var> is large enough to contain
+<var>Count</var> bytes. 
+</errors>
+<seealso>
+<link id="TStream.Write"/>
+<link id="TStream.ReadStr"/>
+<link id="TStream.StrRead"/>
+</seealso>
+<example file="objectex/ex18"/>
+</element>
+
+
+
+<element name="TStream.Write">
+<short>Write a number of bytes to the stream.</short>
+<descr>
+<p>
+<var>Write</var> is an abstract method that should be overridden by descendent
+objects.
+</p>
+<p>
+<var>Write</var> writes <var>Count</var> bytes to the stream from <var>Buf</var>.
+It updates the position pointer, increasing it's value with <var>Count</var>.
+</p>
+<p>
+For an example, see <link id="TStream.Read"/>.
+</p>
+</descr>
+<errors>
+No checking is done to see if <var>Buf</var> actually contains <var>Count</var> bytes.
+</errors>
+<seealso>
+<link id="TStream.Read"/>
+<link id="TStream.WriteStr"/>
+<link id="TStream.StrWrite"/>
+</seealso>
+</element>
+
+
+<element name="TStream.CopyFrom">
+<short>Copy data from another stream. </short>
+<descr>
+<var>CopyFrom</var> reads Count bytes from stream <var>S</var> and stores them
+in the current stream. It uses the <link id="TStream.Read">Read</link> method
+to read the data, and the <link id="TStream.Write">Write</link> method to
+write in the current stream.
+</descr>
+<errors>
+None.
+</errors>
+<seealso>
+<link id="TStream.Read">Read</link>
+<link id="TStream.Write">Write</link>
+</seealso>
+<example file="objectex/ex19"/>
+</element>
+
+
+
+<element name="TDosStream">
+<short>DOS file stream</short>
+<descr>
+<p>
+<var>TDosStream</var> is a stream that stores it's contents in a file.
+it overrides a couple of methods of <link id="TStream"/> for this.
+</p>
+<p>
+In addition to the fields inherited from <var>TStream</var> (see <link id="TStream"/>),
+there are some extra fields, that describe the file. (mainly the name and
+the OS file handle)
+</p>
+<p>
+No buffering in memory is done when using <var>TDosStream</var>.
+All data are written directly to the file. For a stream that buffers
+in memory, see <link id="TBufStream"/>.
+</p>
+</descr>
+</element>
+
+<element name="TDosStream.Handle">
+<short>OS file handle for stream</short>
+</element>
+
+<element name="TDosStream.FName">
+<short>File name</short>
+</element>
+
+<element name="TDosStream.Init">
+<short>Instantiate a new instance of TDosStream.</short>
+<descr>
+<p>
+<var>Init</var> instantiates an instance of <var>TDosStream</var>. The name of the
+file that contains (or will contain) the data of the stream is given in
+<var>FileName</var>. The <var>Mode</var> parameter determines whether a new file 
+should be created and what access rights you have on the file. 
+It can be one of the following constants:
+</p>
+<dl>
+<dt>stCreate</dt><dd> Creates a new file.</dd>
+<dt>stOpenRead</dt><dd> Read access only.</dd>
+<dt>stOpenWrite</dt><dd> Write access only.</dd>
+<dt>stOpen</dt><dd> Read and write access.</dd>
+</dl>
+<p>
+For an example, see <link id="TDosStream.Truncate"/>.
+</p>
+</descr>
+<errors>
+On error, <link id="TStream.Status">Status</link> is set to <var>stInitError</var>, and <var>ErrorInfo</var>
+is set to the dos error code.
+</errors>
+<seealso>
+<link id="TDosStream.Done"/>
+</seealso>
+</element>
+
+
+<element name="TDosStream.Done">
+<short>Closes the file and cleans up the instance.</short>
+<descr>
+<p>
+<var>Done</var> closes the file if it was open and cleans up the 
+instance of <var>TDosStream</var>. 
+</p>
+<p>
+for an example, see e.g. <link id="TDosStream.Truncate"/>.
+</p>
+</descr>
+<errors>
+None.
+</errors>
+<seealso>
+<link id="TDosStream.Init"/>
+<link id="TDosStream.Close"/>
+</seealso>
+</element>
+
+
+<element name="TDosStream.Close">
+<short>Close the file.</short>
+<descr>
+<p>
+<var>Close</var> closes the file if it was open, and sets <var>Handle</var> to -1. 
+Contrary to <link id="TDosStream.Done">Done</link> it does not clean up the instance
+of <var>TDosStream</var>
+</p>
+<p>
+For an example, see <link id="TDosStream.Open"/>.
+</p>
+</descr>
+<errors>
+None.
+</errors>
+<seealso>
+<link id="TStream.Close"/>
+<link id="TDosStream.Init"/>
+<link id="TDosStream.Done"/>
+</seealso>
+</element>
+
+
+<element name="TDosStream.Truncate">
+<short>Truncate the file on the current position.</short>
+<descr>
+If the status of the stream is <var>stOK</var>, then <var>Truncate</var> tries to
+truncate the stream size to the current file position.
+</descr>
+<errors>
+If an error occurs, the stream's status is set to <var>stError</var> and
+<var>ErrorInfo</var> is set to the OS error code.
+</errors>
+<seealso>
+<link id="TStream.Truncate"/>
+<link id="TStream.GetSize"/>
+</seealso>
+<example file="objectex/ex16"/>
+</element>
+
+
+
+<element name="TDosStream.Seek">
+<short>Set file position.</short>
+<descr>
+If the stream's status is <var>stOK</var>, then <var>Seek</var> sets the 
+file position to <var>Pos</var>. <var>Pos</var> is a zero-based offset, counted from
+the beginning of the file.
+</descr>
+<errors>
+In case an error occurs, the stream's status is set to <var>stSeekError</var>,
+and the OS error code is stored in <var>ErrorInfo</var>.
+</errors>
+<seealso>
+<link id="TStream.Seek"/>
+<link id="TStream.GetPos"/>
+</seealso>
+<example file="objectex/ex17"/>
+</element>
+
+
+
+<element name="TDosStream.Open">
+<short>Open the file stream</short>
+<descr>
+If the stream's status is <var>stOK</var>, and the stream is closed then
+<var>Open</var> re-opens the file stream with mode <var>OpenMode</var>.
+This call can be used after a <link id="TDosStream.Close">Close</link> call.
+</descr>
+<errors>
+If an error occurs when re-opening the file, then <var>Status</var> is set
+to <var>stOpenError</var>, and the OS error code is stored in <var>ErrorInfo</var>
+</errors>
+<seealso>
+<link id="TStream.Open"/>
+<link id="TDosStream.Close"/>
+</seealso>
+<example file="objectex/ex14"/>
+</element>
+
+<element name="TDosStream.Read">
+<short>Read data from the stream to a buffer.</short>
+<descr>
+<p>
+If the Stream is open and the stream status is <var>stOK</var> then 
+<var>Read</var> will read <var>Count</var> bytes from the stream and place them
+in  <var>Buf</var>.
+</p>
+<p>
+For an example, see <link id="TStream.Read"/>.
+</p>
+</descr>
+<errors>
+In case of an error, <var>Status</var> is set to <var>StReadError</var>, and
+<var>ErrorInfo</var> gets the OS specific error, or 0 when an attempt was
+made to read beyond the end of the stream.
+</errors>
+<seealso>
+<link id="TStream.Read"/>
+<link id="TDosStream.Write"/>
+</seealso>
+</element>
+
+<element name="TDosStream.Write">
+<short>Write data from a buffer to the stream.</short>
+<descr>
+<p>
+If the Stream is open and the stream status is <var>stOK</var> then 
+<var>Write</var> will write <var>Count</var> bytes from <var>Buf</var> and place them
+in the stream.
+</p>
+<p>
+For an example, see <link id="TStream.Read"/>.
+</p>
+</descr>
+<errors>
+In case of an error, <var>Status</var> is set to <var>StWriteError</var>, and
+<var>ErrorInfo</var> gets the OS specific error.
+</errors>
+<seealso>
+<link id="TStream.Write"/>
+<link id="TDosStream.Read"/>
+</seealso>
+</element>
+
+
+<element name="PBufStream">
+<short>Pointer to <link id="TBufStream"/> object.</short>
+</element>
+
+<element name="PDosStream">
+<short>Pointer to <link id="TDosStream"/> object.</short>
+</element>
+
+<element name="PMemoryStream">
+<short>Pointer to <link id="TMemoryStream"/> object.</short>
+</element>
+
+
+<element name="PCollection">
+<short>Pointer to <link id="TCollection"/> object.</short>
+</element>
+
+
+<element name="PItemList">
+<short>Pointer to <link id="TItemList"/> object.</short>
+</element>
+
+
+<element name="PObject">
+<short>Pointer to <link id="TObject"/> object.</short>
+</element>
+
+<element name="PRect">
+<short>Pointer to <link id="TRect"/> object.</short>
+</element>
+
+<element name="PResourceCollection">
+<short>Pointer to <link id="TResourceCollection"/> object.</short>
+</element>
+
+<element name="PSortedCollection">
+<short>Pointer to <link id="TSortedCollection"/> object.</short>
+</element>
+
+<element name="PSTrCollection">
+<short>Pointer to <link id="TStrCollection"/> object.</short>
+</element>
+
+<element name="PSTrListMaker">
+<short>Pointer to <link id="TStrListMaker"/> object.</short>
+</element>
+
+<element name="PStringCollection">
+<short>Pointer to <link id="TStringCollection"/> object.</short>
+</element>
+
+<element name="PStringList">
+<short>Pointer to <link id="TStringList"/> object.</short>
+</element>
+
+<element name="PUnsortedStrCollection">
+<short>Pointer to <link id="TUnsortedStrCollection"/> object.</short>
+</element>
+
+
+<element name="PResourceFile">
+<short>Pointer to <link id="TResourceFile"/> object.</short>
+</element>
+
+
+<element name="PStrIndex">
+<short>Pointer to <link id="TStrIndex"/> array.</short>
+</element>
+
+
+
+<element name="PObject">
+<short>Pointer to <link id="TObject"/> object.</short>
+</element>
+
+
+<element name="TBufStream">
+<short>Buffered file stream</short>
+<descr>
+<p>
+<var>Bufstream</var> implements a buffered file stream. That is, all data written
+to the stream is written to memory first. Only when the buffer is full, or
+on explicit request, the data is written to disk.
+</p>
+<p>
+Also, when reading from the stream, first the buffer is checked if there is
+any unread data in it. If so, this is read first. If not the buffer is
+filled again, and then the data is read from the buffer.
+</p>
+<p>
+The size of the buffer is fixed and is set when constructing the file.
+</p>
+<p>
+This is useful if you need heavy throughput for your stream, because it
+speeds up operations.
+</p>
+</descr>
+<seealso>
+link id
+</seealso>
+</element>
+
+<element name="TBufStream.LastMode">
+<short>Last file open mode</short>
+</element>
+
+<element name="TBufStream.BufSize">
+<short>Size of buffer</short>
+</element>
+
+<element name="TBufStream.BufPtr">
+<short>Pointer to current position in buffer</short>
+</element>
+
+<element name="TBufStream.Bufend">
+<short>End of data in buffer.</short>
+</element>
+
+<element name="TBufStream.Buffer">
+<short>Actual buffer</short>
+</element>
+
+<element name="TBufStream.Init">
+<short>Initialize an instance of <var>TBufStream</var> and open the file.</short>
+<descr>
+<p>
+<var>Init</var> instantiates an instance of <var>TBufStream</var>. The name of the 
+file that contains (or will contain) the data of the stream is given in
+<var>FileName</var>. The <var>Mode</var> parameter determines whether a new file 
+should be created and what access rights you have on the file. 
+It can be one of the following constants:
+</p>
+<dl>
+<dt>stCreate</dt><dd> Creates a new file.</dd>
+<dt>stOpenRead</dt><dd> Read access only.</dd>
+<dt>stOpenWrite</dt><dd> Write access only.</dd>
+<dt>stOpen</dt><dd> Read and write access.</dd>
+</dl>
+<p>
+The <var>Size</var> parameter determines the size of the buffer that will be
+created. It should be different from zero.
+</p>
+<p>
+For an example see <link id="TBufStream.Flush"/>.
+</p>
+</descr>
+<errors>
+On error, <var>Status</var> is set to <var>stInitError</var>, and <var>ErrorInfo</var>
+is set to the dos error code.
+</errors>
+<seealso>
+<link id="TDosStream.Init"/>
+<link id="TBufStream.Done"/>
+</seealso>
+</element>
+
+
+<element name="TBufStream.Done">
+<short>Close the file and cleans up the instance.</short>
+<descr>
+<p>
+<var>Done</var> flushes and closes the file if it was open and cleans up the 
+instance of <var>TBufStream</var>. 
+</p>
+<p>
+For an example see <link id="TBufStream.Flush"/>.
+</p>
+</descr>
+<errors>
+None.
+</errors>
+<seealso>
+<link id="TDosStream.Done"/>
+<link id="TBufStream.Init"/>
+<link id="TBufStream.Close"/>
+</seealso>
+</element>
+
+
+<element name="TBufStream.Close">
+<short>Flush data and Close the file.</short>
+<descr>
+<p>
+<var>Close</var> flushes and closes the file if it was open, and sets <var>Handle</var> to -1. 
+Contrary to <link id="TBufStream.Done">Done</link> it does not clean up the instance
+of <var>TBufStream</var>
+</p>
+<p>
+For an example see <link id="TBufStream.Flush"/>.
+</p>
+</descr>
+<errors>
+None.
+</errors>
+<seealso>
+<link id="TStream.Close"/>
+<link id="TBufStream.Init"/>
+<link id="TBufStream.Done"/>
+</seealso>
+</element>
+
+
+<element name="TBufStream.Flush">
+<short>FLush data from buffer, and write it to stream.</short>
+<descr>
+When the stream is in write mode, the contents of the buffer are written to
+disk, and the buffer position is set to zero.
+
+When the stream is in read mode, the buffer position is set to zero.
+</descr>
+<errors>
+Write errors may occur if the file was in write mode.
+see <link id="TBufStream.Write">Write</link> for more info on the errors.
+</errors>
+<seealso>
+<link id="TStream.Close"/>
+<link id="TBufStream.Init"/>
+<link id="TBufStream.Done"/>
+</seealso>
+<example file="objectex/ex15"/>
+</element>
+
+
+
+<element name="TBufStream.Truncate">
+<short>Flush buffer, and truncate the file at current position.</short>
+<descr>
+<p>
+If the status of the stream is <var>stOK</var>, then <var>Truncate</var> tries to
+flush the buffer, and then truncates the stream size to the current 
+file position.
+</p>
+<p>
+For an example, see <link id="TDosStream.Truncate"/>.
+</p>
+</descr>
+<errors>
+Errors can be those of <link id="TBufStream.Flush">Flush</link> or
+<link id="TDosStream.Truncate"/>.
+</errors>
+<seealso>
+<link id="TStream.Truncate"/>
+<link id="TDosStream.Truncate"/>
+<link id="TStream.GetSize"/>
+</seealso>
+</element>
+
+
+<element name="TBufStream.Seek">
+<short>Set current position in file.</short>
+<descr>
+<p>
+If the stream's status is <var>stOK</var>, then <var>Seek</var> sets the 
+file position to <var>Pos</var>. <var>Pos</var> is a zero-based offset, counted from
+the beginning of the file.
+</p>
+<p>
+For an example, see <link id="TStream.Seek"/>;
+</p>
+</descr>
+<errors>
+In case an error occurs, the stream's status is set to <var>stSeekError</var>,
+and the OS error code is stored in <var>ErrorInfo</var>.
+</errors>
+<seealso>
+<link id="TStream.Seek"/>
+<link id="TStream.GetPos"/>
+</seealso>
+</element>
+
+
+<element name="TBufStream.Open">
+<short>Open the file if it is closed.</short>
+<descr>
+<p>
+If the stream's status is <var>stOK</var>, and the stream is closed then
+<var>Open</var> re-opens the file stream with mode <var>OpenMode</var>.
+This call can be used after a <link id="TBufStream.Close">Close</link> call.
+</p>
+<p>
+For an example, see <link id="TDosStream.Open"/>.
+</p>
+</descr>
+<errors>
+If an error occurs when re-opening the file, then <var>Status</var> is set
+to <var>stOpenError</var>, and the OS error code is stored in <var>ErrorInfo</var>
+</errors>
+<seealso>
+<link id="TStream.Open"/>
+<link id="TBufStream.Close"/>
+</seealso>
+</element>
+
+
+<element name="TBufStream.Read">
+<short>Read data from the file to a buffer in memory.</short>
+<descr>
+<p>
+If the Stream is open and the stream status is <var>stOK</var> then 
+<var>Read</var> will read <var>Count</var> bytes from the stream and place them
+in  <var>Buf</var>.
+</p>
+<p>
+<var>Read</var> will first try to read the data from the stream's internal
+buffer. If insufficient data is available, the buffer will be filled before
+contiunuing to read. This process is repeated until all needed data
+has been read.
+</p>
+<p>
+For an example, see <link id="TStream.Read"/>.
+</p>
+</descr>
+<errors>
+In case of an error, <var>Status</var> is set to <var>StReadError</var>, and
+<var>ErrorInfo</var> gets the OS specific error, or 0 when an attempt was
+made to read beyond the end of the stream.
+</errors>
+<seealso>
+<link id="TStream.Read"/>
+<link id="TBufStream.Write"/>
+</seealso>
+</element>
+
+
+<element name="TBufStream.Write">
+<short>Write data to the file from a buffer in memory.</short>
+<descr>
+<p>
+If the Stream is open and the stream status is <var>stOK</var> then 
+<var>Write</var> will write <var>Count</var> bytes from <var>Buf</var> and place them
+in the stream.
+</p>
+<p>
+<var>Write</var> will first try to write the data to the stream's internal
+buffer. When the internal buffer is full, then the contents will be written
+to disk. This process is repeated until all data has been written.
+</p>
+<p>
+For an example, see <link id="TStream.Read"/>.
+</p>
+</descr>
+<errors>
+In case of an error, <var>Status</var> is set to <var>StWriteError</var>, and
+<var>ErrorInfo</var> gets the OS specific error.
+</errors>
+<seealso>
+<link id="TStream.Write"/>
+<link id="TBufStream.Read"/>
+</seealso>
+</element>
+
+
+<element name="TMemoryStream">
+<short>Stream which keeps data in memory.</short>
+<descr>
+<p>
+The <var>TMemoryStream</var> object implements a stream that stores it's data
+in memory. The data is stored on the heap, with the possibility to specify
+the maximum amout of data, and the the size of the memory blocks being used.
+</p>
+</descr>
+<seealso>
+<link id="TStream"/>
+</seealso>
+</element>
+
+<element name="TMemoryStream.BlkCount">
+<short>Number of allocated memory blocks</short>
+</element>
+
+<element name="TMemoryStream.BlkSize">
+<short>Size of one memory block</short>
+</element>
+
+<element name="TMemoryStream.MemSize">
+<short>Total memory size</short>
+</element>
+
+<element name="TMemoryStream.BlkList">
+<short>Pointer to list of allocated blocks.</short>
+</element>
+
+<element name="TMemoryStream.Init">
+<short>Initialize memory stream, reserves memory for stream data.</short>
+<descr>
+<p>
+<var>Init</var> instantiates a new <var>TMemoryStream</var> object. The
+memorystreamobject will initially allocate at least <var>ALimit</var> bytes memory, 
+divided into memory blocks of size <var>ABlockSize</var>. 
+The number of blocks needed to get to <var>ALimit</var> bytes is rounded up.
+</p>
+<p>
+By default, the number of blocks is 1, and the size of a block is 8192. This
+is selected if you specify 0 as the blocksize.
+</p>
+<p>
+For an example, see e.g <link id="TStream.CopyFrom"/>.
+</p>
+</descr>
+<errors>
+If the stream cannot allocate the initial memory needed for the memory blocks, then
+the stream's status is set to <var>stInitError</var>.
+</errors>
+<seealso>
+<link id="TMemoryStream.Done"/>
+</seealso>
+</element>
+
+
+<element name="TMemoryStream.Done">
+<short>Clean up memory and destroy the object instance.</short>
+<descr>
+<p>
+<var>Done</var> releases the memory blocks used by the stream, and then cleans up
+the memory used by the stream object itself.
+</p>
+<p>
+For an example, see e.g <link id="TStream.CopyFrom"/>.
+</p>
+</descr>
+<errors>
+None.
+</errors>
+<seealso>
+<link id="TMemoryStream.Init"/>
+</seealso>
+</element>
+
+
+<element name="TMemoryStream.Truncate">
+<short>Set the stream size to the current position.</short>
+<descr>
+<var>Truncate</var> sets the size of the memory stream equal to the current
+position. It de-allocates any memory-blocks that are no longer needed, so
+that the new size of the stream is the current position in the stream,
+rounded up to the first multiple of the stream blocksize.
+</descr>
+<errors> 
+If an error occurs during memory de-allocation, the stream's status is set
+to <var>stError</var>
+</errors>
+<seealso>
+<link id="TStream.Truncate"/>
+</seealso>
+<example file="objectex/ex20"/>
+</element>
+
+
+
+<element name="TMemoryStream.Read">
+<short>Read data from the stream to a location in memory.</short>
+<descr>
+<p>
+<var>Read</var> reads <var>Count</var> bytes from the stream to <var>Buf</var>. It updates
+the position of the stream.
+</p>
+<p>
+For an example, see <link id="TStream.Read"/>.
+</p>
+</descr>
+<errors>
+If there is not enough data available, no data is read, and the stream's
+status is set to <var>stReadError</var>.
+</errors>
+<seealso>
+<link id="TStream.Read"/>
+<link id="TMemoryStream.Write"/>
+</seealso>
+</element>
+
+
+<element name="TMemoryStream.Write">
+<short>Write data to the stream.</short>
+<descr>
+<p>
+<var>Write</var> copies <var>Count</var> bytes from <var>Buf</var> to the stream. It
+updates the position of the stream. 
+</p>
+<p>
+If not enough memory is available to hold the extra <var>Count</var> bytes, 
+then the stream will try to expand, by allocating as much blocks with 
+size <var>BlkSize</var> (as specified in the constuctor call
+<link id="TMemoryStream.Init">Init</link>) as needed. 
+</p>
+<p>
+For an example, see <link id="TStream.Read"/>.
+</p>
+</descr>
+<errors>
+If the stream cannot allocate more memory, then the status is set to
+<var>stWriteError</var>
+</errors>
+<seealso>
+<link id="TStream.Write"/>
+<link id="TMemoryStream.Read"/>
+</seealso>
+</element>
+
+
+<element name="TCollection">
+<short>Manage a collection of pointers of objects</short>
+<descr>
+<p>
+The <var>TCollection</var> object manages a collection of pointers or objects.
+It also provides a series of methods to manipulate these pointers or
+objects.
+</p>
+<p>
+Whether or not objects are used depends on the kind of calls you use.
+All kinds come in 2 flavors, one for objects, one for pointers.
+</p>
+</descr>
+</element>
+
+<element name="TCollection.Items">
+<short>Pointer to list of items.</short>
+</element>
+
+<element name="TCollection.Count">
+<short>Current count of items</short>
+</element>
+
+<element name="TCollection.Limit">
+<short>Max number of items</short>
+</element>
+
+<element name="TCollection.Delta">
+<short>Number of pointers to allocate when adding items.</short>
+</element>
+
+<element name="TCollection.Init">
+<short>Instantiate a new collection.</short>
+<descr>
+<p>
+<var>Init</var> initializes a new instance of a collection. It sets the (initial) maximum number
+of items in the collection to <var>ALimit</var>. <var>ADelta</var> is the increase
+size : The number of memory places that will be allocatiod in case <var>ALimit</var> is reached,
+and another element is added to the collection.
+</p>
+<p>
+For an example, see <link id="TCollection.ForEach"/>.
+</p>
+</descr>
+<errors>
+None.
+</errors>
+<seealso>
+<link id="TCollection.Load"/>
+<link id="TCollection.Done"/>
+</seealso>
+</element>
+
+
+<element name="TCollection.Load">
+<short>Initialize a new collection and load collection from a stream.</short>
+<descr>
+<var>Load</var> initializes a new instance of a collection. It reads from stream
+<var>S</var> the item count, the item limit count, and the increase size. After
+that, it reads the specified number of items from the stream. 
+<!--  Do not call this method if you intend to use only pointers in your collection. -->
+</descr>
+<errors>
+Errors returned can be those of <link id="TCollection.GetItem">GetItem</link>.
+</errors>
+<seealso>
+<link id="TCollection.Init"/>
+<link id="TCollection.GetItem"/>
+<link id="TCollection.Done"/>
+</seealso>
+<example file="objectex/ex22"/>
+</element>
+
+
+
+<element name="TCollection.Done">
+<short>Clean up collection, release all memory.</short>
+<descr>
+<p>
+<var>Done</var> frees all objects in the collection, and then releases all memory
+occupied by the instance.
+</p>
+<p>
+For an example, see <link id="TCollection.ForEach"/>.
+</p>
+<!--  Do not call this method if you intend to use only pointers in your collection. -->
+</descr>
+<errors>
+None.
+</errors>
+<seealso>
+<link id="TCollection.Init"/>
+<link id="TCollection.FreeAll"/>
+</seealso>
+</element>
+
+
+<element name="TCollection.At">
+<short>Return the item at a certain index.</short>
+<descr>
+<var>At</var> returns the item at position <var>Index</var>.
+</descr>
+<errors>
+If <var>Index</var> is less than zero or larger than the number of items
+in the collection, seepl{Error}{TCollection.Error} is called with
+<var>coIndexError</var> and <var>Index</var> as arguments, resulting in a run-time
+error.
+</errors>
+<seealso>
+<link id="TCollection.Insert"/>
+</seealso>
+<example file="objectex/ex23"/>
+</element>
+
+
+
+<element name="TCollection.IndexOf">
+<short>Find the position of a certain item.</short>
+<descr>
+<var>IndexOf</var> returns the index of <var>Item</var> in the collection.
+If <var>Item</var> isn't present in the collection, -1 is returned.
+</descr>
+<errors>
+If the item is not present, -1 is returned.
+</errors>
+<seealso>
+<link id="TCollection.At"/>
+<link id="TCollection.GetItem"/>
+<link id="TCollection.Insert"/>
+</seealso>
+<example file="objectex/ex24"/>
+</element>
+
+
+
+<element name="TCollection.GetItem">
+<short>Read one item off the stream.</short>
+<descr>
+<var>GetItem</var> reads a single item off the stream <var>S</var>, and
+returns a pointer to this item. This method is used internally by the Load
+method, and should not be used directly.
+</descr>
+<errors>
+Possible errors are the ones from <link id="TStream.Get"/>.
+</errors>
+<seealso>
+<link id="TStream.Get"/>, 
+<link id="TCollection.Store"/>
+</seealso>
+</element>
+
+<element name="TCollection.LastThat">
+<short>Return last item which matches a test.</short>
+<descr>
+This function returns the last item in the collection for which <var>Test</var>
+returns a non-nil result. <var>Test</var> is a function that accepts 1 argument:
+a pointer to an object, and that returns a pointer as a result.
+</descr>
+<errors>
+None.
+</errors>
+<seealso>
+<link id="TCollection.FirstThat"/>
+</seealso>
+<example file="objectex/ex25"/>
+</element>
+
+
+
+<element name="TCollection.FirstThat">
+<short>Return first item which matches a test.</short>
+<descr>
+This function returns the first item in the collection for which <var>Test</var>
+returns a non-nil result. <var>Test</var> is a function that accepts 1 argument:
+a pointer to an object, and that returns a pointer as a result.
+</descr>
+<errors>
+None.
+</errors>
+<seealso>
+<link id="TCollection.LastThat"/>
+</seealso>
+<example file="objectex/ex26"/>
+</element>
+
+
+
+<element name="TCollection.Pack">
+<short>Remove all <var>>Nil</var> pointers from the collection.</short>
+<descr>
+<var>Pack</var> removes all <var>Nil</var> pointers from the collection, and adjusts
+<var>Count</var> to reflect this change. No memory is freed as a result of this
+call. In order to free any memory, you can call <var>SetLimit</var> with an
+argument of <var>Count</var> after a call to <var>Pack</var>.
+</descr>
+<errors>
+None.
+</errors>
+<seealso>
+<link id="TCollection.SetLimit"/>
+</seealso>
+<example file="objectex/ex26"/>
+</element>
+
+
+
+<element name="TCollection.FreeAll">
+<short>Release all objects from the collection.</short>
+<descr>
+<var>FreeAll</var> calls the destructor of each object in the collection.
+It doesn't release any memory occumpied by the collection itself, but it
+does set <var>Count</var> to zero.
+</descr>
+<errors>
+</errors>
+<seealso>
+<link id="TCollection.DeleteAll"/>
+<link id="TCollection.FreeItem"/>
+</seealso>
+<example file="objectex/ex28"/>
+</element>
+
+<element name="TCollection.DeleteAll">
+<short>Delete all elements from the collection. Objects are not destroyed.</short>
+<descr>
+<var>DeleteAll</var> deletes all elements from the collection. It just sets 
+the <var>Count</var> variable to zero. Contrary to
+<link id="TCollection.FreeAll">FreeAll</link>, <var>DeletAll</var> doesn't call the
+destructor of the objects.
+</descr>
+<errors>
+None.
+</errors>
+<seealso>
+<link id="TCollection.FreeAll"/>
+<link id="TCollection.Delete"/>
+</seealso>
+<example file="objectex/ex29"/>
+</element>
+
+
+
+<element name="TCollection.Free">
+<short>Free item from collection, calling it's destructor.</short>
+<descr>
+<var>Free</var> Deletes <var>Item</var> from the collection, and calls the destructor
+<var>Done</var> of the object.
+</descr>
+<errors>
+If the <var>Item</var> is not in the collection, <var>Error</var> will be called with
+<var>coIndexError</var>.
+</errors>
+<seealso>
+<link id="TCollection.FreeItem"/>
+</seealso>
+<example file="objectex/ex30"/>
+</element>
+
+
+
+<element name="TCollection.Insert">
+<short>Insert a new item in the collection at the end.</short>
+<descr>
+<var>Insert</var> inserts <var>Item</var> in the collection. <var>TCollection</var>
+inserts this item at the end, but descendent objects may insert it at
+another place.
+</descr>
+<errors>
+None.
+</errors>
+<seealso>
+<link id="TCollection.AtInsert"/>
+<link id="TCollection.AtPut"/>
+</seealso>
+</element>
+
+
+<element name="TCollection.Delete">
+<short>Delete an item from the collection, but does not destroy it.</short>
+<descr>
+<var>Delete</var> deletes <var>Item</var> from the collection. It doesn't call the
+item's destructor, though. For this the <link id="TCollection.Free">Free</link>
+call is provided.
+</descr>
+<errors>
+If the <var>Item</var> is not in the collection, <var>Error</var> will be called with
+<var>coIndexError</var>.
+</errors>
+<seealso>
+<link id="TCollection.AtDelete"/>
+<link id="TCollection.Free"/>
+</seealso>
+<example file="objectex/ex31"/>
+</element>
+
+
+
+<element name="TCollection.AtFree">
+<short>Free an item at the indicates position, calling it's destructor.</short>
+<descr>
+<var>AtFree</var> deletes the item at position <var>Index</var> in the collection,
+and calls the item's destructor if it is not <var>Nil</var>. 
+</descr>
+<errors>
+If <var>Index</var> isn't valid then <link id="TCollection.Error">Error</link> is called
+with <var>CoIndexError</var>.
+</errors>
+<seealso>
+<link id="TCollection.Free"/>
+<link id="TCollection.AtDelete"/>
+</seealso>
+<example file="objectex/ex32"/>
+</element>
+
+
+<element name="TCollection.FreeItem">
+<short>Destroy a non-nil item.</short>
+<descr>
+<p>
+<var>FreeItem</var> calls the destructor of <var>Item</var> if it is not
+nil.
+</p>
+<remark>
+This function is used internally by the TCollection object, and should not be
+called directly.
+</remark>
+</descr>
+<errors>
+None.
+</errors>
+<seealso>
+<link id="TCollection.Free"/>
+<link id="TCollection.AtFree"/>
+</seealso>
+</element>
+
+
+<element name="TCollection.AtDelete">
+<short>Delete item at certain position.</short>
+<descr>
+<var>AtDelete</var> deletes the pointer at position <var>Index</var> in the
+collection. It doesn't call the object's destructor.
+</descr>
+<errors>
+If <var>Index</var> isn't valid then <link id="TCollection.Error">Error</link> is called
+with <var>CoIndexError</var>.
+</errors>
+<seealso>
+<link id="TCollection.Delete"/>
+</seealso>
+<example file="objectex/ex33"/>
+</element>
+
+
+<element name="TCollection.ForEach">
+<short>Execute procedure for each item in the list.</short>
+<descr>
+<p>
+<var>ForEach</var> calls <var>Action</var> for each element in the collection,
+and passes the element as an argument to <var>Action</var>.
+</p>
+<p>
+<var>Action</var> is a procedural type variable that accepts a pointer as an 
+argument.
+</p>
+</descr>
+<errors>
+None.
+</errors>
+<seealso>
+<link id="TCollection.FirstThat"/>
+<link id="TCollection.LastThat"/>
+</seealso>
+<example file="objectex/ex21"/>
+</element>
+
+
+
+<element name="TCollection.SetLimit">
+<short>Set maximum number of elements in the collection.</short>
+<descr>
+<p>
+<var>SetLimit</var> sets the maximum number of elements in the collection.
+<var>ALimit</var> must not be less than <var>Count</var>, and should not be larger
+than <var>MaxCollectionSize</var>
+</p>
+<p>
+For an example, see <link id="TCollection.Pack">Pack</link>.
+</p>
+</descr>
+<errors>
+None.
+</errors>
+<seealso>
+<link id="TCollection.Init"/>
+</seealso>
+</element>
+
+
+<element name="TCollection.Error">
+<short>Set error code.</short>
+<descr>
+<p>
+<var>Error</var> is called by the various <var>TCollection</var> methods
+in case of an error condition. The default behaviour is to make
+a call to <var>RunError</var> with an error of <var>212-Code</var>.
+</p>
+<p>
+This method can be overridden by descendent objects to implement
+a different error-handling.
+</p>
+</descr>
+<errors>
+</errors>
+<seealso>
+<link id="Abstract"/>
+</seealso>
+</element>
+
+<element name="TCollection.AtPut">
+<short>Set collection item, overwriting an existing value.</short>
+<descr>
+<p>
+<var>AtPut</var> sets the element at position <var>Index</var> in the collection
+to <var>Item</var>. Any previous value is overwritten.
+</p>
+<p>
+For an example, see <link id="TCollection.Pack">Pack</link>.
+</p>
+</descr>
+<errors>
+If <var>Index</var> isn't valid then <link id="TCollection.Error">Error</link> is called
+with <var>CoIndexError</var>.
+</errors>
+<seealso>
+</seealso>
+</element>
+
+
+<element name="TCollection.AtInsert">
+<short>Insert an element at a certain position in the collection.</short>
+<descr>
+<var>AtInsert</var> inserts <var>Item</var> in the collection at position <var>Index</var>,
+shifting all elements by one position. In case the current limit is reached,
+the collection will try to expand with a call to <var>SetLimit</var>
+</descr>
+<errors>
+If <var>Index</var> isn't valid then <link id="TCollection.Error">Error</link> is called
+with <var>CoIndexError</var>. If the collection fails to expand, then
+<var>coOverFlow</var> is passd to <var>Error</var>.
+</errors>
+<seealso>
+<link id="TCollection.Insert"/>
+</seealso>
+<example file="objectex/ex34"/>
+</element>
+
+
+
+<element name="TCollection.Store">
+<short>Write collection to a stream.</short>
+<descr>
+<p>
+<var>Store</var> writes the collection to the stream <var>S</var>. It does
+this by writeing the current <var>Count</var>, <var>Limit</var> and <var>Delta</var>
+to the stream, and then writing each item to the stream.
+</p>
+<p>
+The contents of the stream are then suitable for instantiating another
+collection with <link id="TCollection.Load">Load</link>.
+</p>
+<p>
+For an example, see <link id="TCollection.Load"/>.
+</p>
+</descr>
+<errors>
+Errors returned are those by <link id="TStream.Put"/>.
+</errors>
+<seealso>
+<link id="TCollection.Load"/>
+<link id="TCollection.PutItem"/>
+</seealso>
+</element>
+
+
+<element name="TCollection.PutItem">
+<short>Put one item on the stream</short>
+<descr>
+<var>PutItem</var> writes <var>Item</var> to stream <var>S</var>. This method is used
+internaly by the <var>TCollection</var> object, and should not be called
+directly.
+</descr>
+<errors>
+Errors are those returned by <link id="TStream.Put"/>.
+</errors>
+<seealso>
+<link id="TCollection.Store">Store</link>
+<link id="TCollection.GetItem">GetItem</link>
+</seealso>
+</element>
+
+<element name="TSortedCollection">
+<short>Abstract sorted collection.</short>
+<descr>
+<p>
+<var>TSortedCollection</var> is an abstract class, implementing a sorted
+collection. You should never use an instance of <var>TSortedCollection</var>
+directly, instead you should declare a descendent type, and override the
+<link id="TSortedCollection.Compare">Compare</link> method.
+</p>
+<p>
+Because the collection is ordered, <var>TSortedCollection</var> overrides some
+<var>TCollection</var> methods, to provide faster routines for lookup.
+</p>
+<p>
+The <link id="TSortedCollection.Compare">Compare</link> method decides how elements
+in the collection should be ordered. Since <var>TCollection</var> has no way
+of knowing how to order pointers, you must override the compare method.
+</p>
+<p>
+Additionally, <var>TCollection</var> provides a means to filter out duplicates.
+if you set <var>Duplicates</var> to <var>False</var> (the default) then duplicates
+will not be allowed.
+</p>
+<p>
+The example below defines a descendent of <var>TSortedCollection</var> which
+is used in the examples.
+</p>
+</descr>
+<example file="objectex/mysortc"/>
+</element>
+
+<element name="TSortedCollection.Duplicates">
+<short>If <var>True</var> duplicate strings are allowed in the collection.</short>
+</element>
+
+<element name="TSortedCollection.Init">
+<short>Instantiates a new instance of a <var>TSortedCollection</var></short>
+<descr>
+<p>
+<var>Init</var> calls the inherited constuctor (see <link id="TCollection.Init"/>) and
+sets the <var>Duplicates</var> flag to false.
+</p>
+<p>
+You should not call this method directly, since <var>TSortedCollection</var> is a
+abstract class. Instead, the descendent classes should call it via the
+<var>inherited</var> keyword.
+</p>
+</descr>
+<errors>
+None.
+</errors>
+<seealso> 
+<link id="TSortedCollection.Load"/>
+<link id="TCollection.Done"/>
+</seealso>
+</element>
+
+<element name="TSortedCollection.Load">
+<short>Instantiates a new instance of a <var>TSortedCollection</var> and
+loads it from stream.</short>
+<descr>
+<p>
+<var>Load</var> calls the inherited constuctor (see <link id="TCollection.Load"/>) and
+reads the <var>Duplicates</var> flag from the stream..
+</p>
+<p>
+You should not call this method directly, since <var>TSortedCollection</var> is a
+abstract class. Instead, the descendent classes should call it via the
+<var>inherited</var> keyword.
+</p>
+<p>
+For an example, see <link id="TCollection.Load"/>.
+</p>
+</descr>
+<errors>
+None.
+</errors>
+<seealso> 
+<link id="TSortedCollection.Init"/>
+<link id="TCollection.Done"/>
+</seealso>
+</element>
+
+
+<element name="TSortedCollection.KeyOf">
+<short>Return the key of an item</short>
+<descr>
+<p>
+<var>KeyOf</var> returns the key associated with <var>Item</var>.
+<var>TSortedCollection</var> returns the item itself as the key, descendent
+objects can override this method to calculate a (unique) key based on the
+item passed (such as hash values).
+</p>
+<p>
+<var>Keys</var> are used to sort the objects, they are used to search and sort
+the items in the collection. If descendent types override this method then
+it allows possibly for faster search/sort methods based on keys rather than
+on the objects themselves.
+</p>
+</descr>
+<errors>
+None.
+</errors>
+<seealso>
+<link id="TSortedCollection.IndexOf"/>
+<link id="TSortedCollection.Compare"/>
+</seealso>
+</element>
+
+<element name="TSortedCollection.IndexOf">
+<short>Return index of an item in the collection.</short>
+<descr>
+<p>
+<var>IndexOf</var> returns the index of <var>Item</var> in the collection. It searches
+for the object based on it's key. If duplicates are allowed, then it returns 
+the index of last object that matches <var>Item</var>.
+</p>
+<p>
+In case <var>Item</var> is not found in the collection, -1 is returned.
+</p>
+<p>
+For an example, see <link id="TCollection.IndexOf"/>
+</p>
+</descr>
+<errors>
+None.
+</errors>
+<seealso>
+<link id="TSortedCollection.Search"/>
+<link id="TSortedCollection.Compare"/>
+</seealso>
+</element>
+
+
+<element name="TSortedCollection.Compare">
+<short>Compare two items in the collection.</short>
+<descr>
+<p>
+<var>Compare</var> is an abstract method that should be overridden by descendent
+objects in order to compare two items in the collection. This method is used
+in the <link id="TSortedCollection.Search">Search</link> method and in the
+<link id="TSortedCollection.Insert">Insert</link> method to determine the ordering of
+the objects.
+</p>
+<p>
+The function should compare the two keys of items and return the following
+function results:
+</p>
+<dl>
+<dt>Result &lt; 0</dt><dd>If <var>Key1</var> is logically before <var>Key2</var> (<var>Key1&lt;Key2</var>)</dd>
+<dt>Result = 0</dt><dd> If <var>Key1</var> and <var>Key2</var> are equal. (<var>Key1=Key2</var>)</dd>
+<dt>Result &gt; 0</dt><dd> If <var>Key1</var> is logically after <var>Key2</var> (<var>Key1&gt;Key2</var>)</dd>
+</dl>
+</descr>
+<errors>
+An 'abstract run-time error' will be generated if you call
+<var>TSortedCollection.Compare</var> directly.
+</errors>
+<seealso>
+<link id="TSortedCollection.IndexOf"/>
+<link id="TSortedCollection.Search"/>
+</seealso>
+<example file="objectex/mysortc"/>
+</element>
+
+
+<element name="TSortedCollection.Search">
+<short>Search for item with given key.</short>
+<descr>
+<p>
+<var>Search</var> looks for the item with key <var>Key</var> and returns the position
+of the item (if present) in the collection in <var>Index</var>.
+</p>
+<p>
+Instead of a linear search as <var>TCollection</var> does, <var>TSortedCollection</var>
+uses a binary search based on the keys of the objects. It uses the
+<link id="TSortedCollection.Compare">Compare</link> function to implement this
+search.
+</p>
+<p>
+If the item is found, <var>Search</var> returns <var>True</var>, otherwise <var>False</var>
+is returned.
+</p>
+</descr>
+<errors>
+None.
+</errors>
+<seealso>
+<link id="TCollection.IndexOf"/>
+</seealso>
+<example file="objectex/ex36"/>
+</element>
+
+
+<element name="TSortedCollection.Insert">
+<short>Insert new item in collection.</short>
+<descr>
+<p>
+<var>Insert</var> inserts an item in the collection at the correct position, such
+that the collection is ordered at all times. You should never use
+<link id="TCollection.AtInsert">Atinsert</link>, since then the collection ordering
+is not guaranteed.
+</p>
+<p>
+If <var>Item</var> is already present in the collection, and <var>Duplicates</var> is
+<var>False</var>, the item will not be inserted.
+</p>
+</descr>
+<errors>
+None.
+</errors>
+<seealso>
+<link id="TCollection.AtInsert"/>
+</seealso>
+<example file="objectex/ex35"/>
+</element>
+
+
+
+<element name="TSortedCollection.Store">
+<short>Write the collection to the stream.</short>
+<descr>
+<p>
+<var>Store</var> writes the collection to the stream <var>S</var>. It does this by
+calling the inherited <link id="TCollection.Store"/>, and then writing the
+<var>Duplicates</var> flag to the stream.
+</p>
+<p>
+After a <var>Store</var>, the collection can be loaded from the stream with the
+constructor <link id="TSortedCollection.Load">Load</link>
+</p>
+<p>
+For an example, see <link id="TCollection.Load"/>.
+</p>
+</descr>
+<errors>
+Errors can be those of <link id="TStream.Put"/>.
+</errors>
+<seealso>
+<link id="TSortedCollection.Load"/>
+</seealso>
+</element>
+
+
+<element name="TStringCollection">
+<short>Collection of pascal strings.</short>
+<descr>
+<p>
+The <var>TStringCollection</var> object manages a sorted collection of pascal
+strings.
+To this end, it overrides the <link id="TSortedCollection.Compare">Compare</link>
+method of <var>TSortedCollection</var>, and it introduces methods to read/write
+strings from a stream.
+</p>
+</descr>
+</element>
+
+<element name="TStringCollection.GetItem">
+<short>Get string from the stream.</short>
+<descr>
+<p>
+<var>GetItem</var> reads a string from the stream <var>S</var> and returns a pointer
+to it. It doesn't insert the string in the collection.
+</p>
+<p>
+This method is primarily introduced to be able to load and store the
+collection from and to a stream.
+</p>
+</descr>
+<errors>
+The errors returned are those of <link id="TStream.ReadStr"/>.
+</errors>
+<seealso>
+<link id="TStringCollection.PutItem"/>
+</seealso>
+</element>
+
+<element name="TStringCollection.Compare">
+<short>Compare two strings in the collection.</short>
+<descr>
+<p>
+<var>TStringCollection</var> overrides the <var>Compare</var> function so it compares
+the two keys as if they were pointers to strings. The compare is done case
+sensitive. It returns the following results:
+</p>
+<dl>
+<dt>-1</dt><dd> if the first string is alphabetically earlier  than the second string.</dd>
+<dt>0</dt><dd> if the two strings are equal.</dd>
+<dt>1</dt><dd> if the first string is alphabetically later than the second string.</dd>
+</dl>
+</descr>
+<errors>
+None.
+</errors>
+<seealso>
+<link id="TSortedCollection.Compare"/>
+</seealso>
+<example file="objectex/ex37"/>
+</element>
+
+
+
+<element name="TStringCollection.FreeItem">
+<short>Dispose a string in the collection from memory.</short>
+<descr>
+<var>TStringCollection</var> overrides <var>FreeItem</var> so that the string pointed
+to by <var>Item</var> is disposed from memory.
+</descr>
+<errors>
+None.
+</errors>
+<seealso>
+<link id="TCollection.FreeItem"/>
+</seealso>
+</element>
+
+<element name="TStringCollection.PutItem">
+<short>Write a string to the stream.</short>
+<descr>
+<p>
+<var>PutItem</var> writes the string pointed to by <var>Item</var> to the stream
+<var>S</var>.
+</p>
+<p>
+This method is primarily used in the <var>Load</var> and <var>Store</var> methods,
+and should not be used directly.
+</p>
+</descr>
+<errors>
+Errors are those of <link id="TStream.WriteStr"/>.
+</errors>
+<seealso>
+<link id="TStringCollection.GetItem"/>
+</seealso>
+</element>
+
+
+<element name="TStrCollection">
+<short>Collection of null-terminated strings</short>
+<descr>
+<p>
+The <var>TStrCollection</var> object manages a sorted collection
+of null-terminated strings (pchar strings).
+To this end, it overrides the <link id="TSortedCollection.Compare">Compare</link>
+method of <var>TSortedCollection</var>, and it introduces methods to read/write
+strings from a stream.
+</p>
+</descr>
+</element>
+
+<element name="TStrCollection.GetItem">
+<short>Read a null-terminated string from the stream.</short>
+<descr>
+<p>
+<var>GetItem</var> reads a null-terminated string from the stream <var>S</var>
+and returns a pointer  to it. It doesn't insert the string in the
+collection.
+</p>
+<p>
+This method is primarily introduced to be able to load and store the
+collection from and to a stream.
+</p>
+</descr>
+<errors>
+The errors returned are those of <link id="TStream.StrRead"/>.
+</errors>
+<seealso>
+<link id="TStrCollection.PutItem"/>
+</seealso>
+</element>
+
+<element name="TStrCollection.Compare">
+<short>Compare two strings in the collection.</short>
+<descr>
+<p>
+<var>TStrCollection</var> overrides the <var>Compare</var> function so it compares
+the two keys as if they were pointers to strings. The compare is done case
+sensitive. It returns
+</p>
+<dl>
+<dt>-1</dt><dd> if the first string is alphabetically earlier  than the second string. </dd>
+<dt>0</dt><dd> if the two strings are equal. </dd>
+<dt>1</dt><dd> if the first string is alphabetically later than the second string.</dd>
+</dl>
+</descr>
+<errors>
+None.
+</errors>
+<seealso>
+<link id="TSortedCollection.Compare"/>
+</seealso>
+<example file="objectex/ex38"/>
+</element>
+
+<element name="TStrCollection.FreeItem">
+<short>Free null-terminated string from the collection.</short>
+<descr>
+<var>TStrCollection</var> overrides <var>FreeItem</var> so that the string pointed
+to by <var>Item</var> is disposed from memory.
+</descr>
+<errors>
+None.
+</errors>
+<seealso>
+<link id="TCollection.FreeItem"/>
+</seealso>
+</element>
+
+<element name="TStrCollection.PutItem">
+<short>Write a null-terminated string to the stream.</short>
+<descr>
+<p>
+<var>PutItem</var> writes the string pointed to by <var>Item</var> to the stream
+<var>S</var>.
+</p>
+<p>
+This method is primarily used in the <var>Load</var> and <var>Store</var> methods,
+and should not be used directly.
+</p>
+</descr>
+<errors>
+Errors are those of <link id="TStream.StrWrite"/>.
+</errors>
+<seealso>
+<link id="TStrCollection.GetItem"/>
+</seealso>
+</element>
+
+<element name="TUnSortedStrCollection">
+<short>Unsorted string collection</short>
+<descr>
+<p>
+The <var>TUnSortedStrCollection</var> object manages an unsorted list of strings.
+To this end, it overrides the <link id="TStringCollection.Insert"/> method to add
+strings at the end of the collection, rather than in the alphabetically
+correct position.
+</p>
+<p>
+Take care, the <link id="TSortedCollection.Search">Search</link> and
+<link id="TCollection.IndexOf">IndexOf</link> methods will not work on an unsorted
+string collection.
+</p>
+</descr>
+</element>
+
+<element name="TUnSortedStrCollection.Insert">
+<short>Insert a new string in the collection.</short>
+<descr>
+<var>Insert</var> inserts a string at the end of the collection, instead
+of on it's alphabetical place, resulting in an unsorted collection of
+strings.
+</descr>
+<errors>
+None.
+</errors>
+<seealso>
+<link id="TCollection.Insert"/>
+</seealso>
+<example file="objectex/ex39"/>
+</element>
+
+
+
+<element name="TResourceCollection">
+<short>Collection of resource names</short>
+<descr>
+<p>
+A <var>TResourceCollection</var> manages a collection of resource names.
+It stores the position and the size of a resource, as well as the name of
+the resource. It stores these items in records that look like this:
+</p>
+<code>
+TYPE
+   TResourceItem = packed RECORD
+      Posn: LongInt;
+      Size: LongInt;
+      Key : String;
+   End;
+   PResourceItem = ^TResourceItem;
+</code>
+<p>
+It overrides some methods of <var>TStringCollection</var> in order to accomplish
+this.
+</p>
+<remark>
+Remark that the <var>TResourceCollection</var> manages the names of the
+resources and their assiciated positions and sizes, it doesn't manage
+the resources themselves.
+</remark>
+</descr>
+</element>
+
+<element name="TResourceCollection.KeyOf">
+<short>Return the key of an item in the collection.</short>
+<descr>
+<var>KeyOf</var> returns the key of an item in the collection. For resources, the
+key is a pointer to the string with the resource name.
+</descr>
+<errors>
+None.
+</errors>
+<seealso>
+<link id="TStringCollection.Compare"/>
+</seealso>
+</element>
+
+<element name="TResourceCollection.GetItem">
+<short>Read an item from the stream.</short>
+<descr>
+<p>
+<var>GetItem</var> reads a resource item from the stream <var>S</var>. It reads the
+position, size and name from the stream, in that order. It DOES NOT read the
+resource itself from the stream.
+</p>
+<p>
+The resulting item is not inserted in the collection. This call is manly for
+internal use by the <link id="TCollection.Load"/> method.
+</p>
+</descr>
+<errors>
+Errors returned are those by <link id="TStream.Read"/>
+</errors>
+<seealso>
+<link id="TCollection.Load"/>
+<link id="TStream.Read"/>
+</seealso>
+</element>
+
+<element name="TResourceCollection.FreeItem">
+<short>Release memory occupied by item.</short>
+<descr>
+<p>
+<var>FreeItem</var> releases the memory occupied by <var>Item</var>. It de-allocates
+the name, and then the resourceitem record.
+</p>
+<p>
+It does NOT remove the item from the collection.
+</p>
+</descr>
+<errors>
+None.
+</errors>
+<seealso>
+<link id="TCollection.FreeItem"/>
+</seealso>
+</element>
+
+<element name="TResourceCollection.PutItem">
+<short>Write an item to the stream.</short>
+<descr>
+<p>
+<var>PutItem</var> writes <var>Item</var> to the stream <var>S</var>. It does this by
+writing the position and size and name of the resource item to the stream.
+</p>
+<p>
+This method is used primarily by the <link id="TCollection.Store">Store</link>
+method.
+</p>
+</descr>
+<errors>
+Errors returned are those by <link id="TStream.Write"/>.
+</errors>
+<seealso>
+<link id="TCollection.Store"/>
+</seealso>
+</element>
+
+
+<element name="TResourceFile">
+<short>Resource file</short>
+<descr>
+<link id="TResourceFile"/> represents the resources in a binary file image.
+</descr>
+</element>
+
+<element name="TResourceFile.Stream">
+<short>Actual file stream</short>
+<descr>
+contains the (file) stream that has the executable image and
+the resources. It can be initialized by the <link id="TResourceFile.Init">Init</link>
+constructor call.
+</descr>
+</element>
+
+<element name="TResourceFile.Modified">
+<short>Have resources changed ?</short>
+<descr>
+<var>Modified</var> is set to <var>True</var> if one of the resources has been changed.
+It is set by the <link id="TResourceFile.Init">SwitchTo</link>,
+<link id="TResourceFile.Delete">Delete</link> and <link id="TResourceFile.Put">Put</link>
+methods. Calling <link id="TResourceFile.Flush">Flush</link> will clear the
+<var>Modified</var> flag.
+</descr>
+</element>
+
+<element name="TResourceFile.Init">
+<short>Instantiate a new instance.</short>
+<descr>
+<p>
+<var>Init</var> instantiates a new instance of a <var>TResourceFile</var> object.
+If <var>AStream</var> is not nil then it is considered as a stream describing an
+executable image on disk.
+</p>
+<p>
+<var>Init</var> will try to position the stream on the start of the resources section,
+and read all resources from the stream.
+</p>
+</descr>
+<errors>
+None.
+</errors>
+<seealso>
+<link id="TResourceFile.Done"/>
+</seealso>
+</element>
+
+<element name="TResourceFile.Done">
+<short>Destroy the instance and remove it from memory.</short>
+<descr>
+<var>Done</var> cleans up the instance of the <var>TResourceFile</var> Object.
+If <var>Stream</var> was specified at initialization, then <var>Stream</var> is
+disposed of too.
+</descr>
+<errors>
+None.
+</errors>
+<seealso>
+<link id="TResourceFile.Init"/>
+</seealso>
+</element>
+
+<element name="TResourceFile.Count">
+<short>Number of resources in the file</short>
+<descr>
+<var>Count</var> returns the number of resources. If no resources were
+read, zero is returned.
+</descr>
+<errors>
+None.
+</errors>
+<seealso>
+<link id="TResourceFile.Init"/>
+</seealso>
+</element>
+
+<element name="TResourceFile.KeyAt">
+<short>Return the key of the item at a certain position.</short>
+<descr>
+<var>KeyAt</var> returns the key (the name) of the <var>I</var>-th resource.
+</descr>
+<errors>
+In case <var>I</var> is invalid, <var>TCollection.Error</var> will be executed.
+</errors>
+<seealso>
+<link id="TResourceFile.Get"/>
+</seealso>
+</element>
+
+<element name="TResourceFile.Get">
+<short>Return a resource by key name.</short>
+<descr>
+<var>Get</var> returns a pointer to a instance of a resource identified by
+<var>Key</var>. If <var>Key</var> cannot be found in the list of resources, then
+<var>Nil</var> is returned.
+</descr>
+<errors>
+Errors returned may be those by <var>TStream.Get</var>
+</errors>
+<seealso>
+</seealso>
+</element>
+
+<element name="TResourceFile.SwitchTo">
+<short>Write resources to a new stream.</short>
+<descr>
+<p>
+<var>SwitchTo</var> switches to a new stream to hold the resources in.
+<var>AStream</var> will be the new stream after the call to <var>SwitchTo</var>.
+</p>
+<p>
+If <var>Pack</var> is true, then all the known resources will be copied from
+the current stream to the new stream (<var>AStream</var>). If <var>Pack</var> is
+<var>False</var>, then only the current resource is copied.
+</p>
+<p>
+The return value is the value of the original stream: <var>Stream</var>.
+</p>
+<p>
+The <var>Modified</var> flag is set as a consequence of this call.
+</p>
+</descr>
+<errors>
+Errors returned can be those of <link id="TStream.Read"/> and
+<link id="TStream.Write"/>.
+</errors>
+<seealso>
+<link id="TResourceFile.Flush"/>
+</seealso>
+</element>
+
+<element name="TResourceFile.Flush">
+<short>Writes the resources to the stream.</short>
+<descr>
+If the <var>Modified</var> flag is set to <var>True</var>, then <var>Flush</var>
+writes the resources to the stream <var>Stream</var>. It sets the <var>Modified</var>
+flag to true after that.
+</descr>
+<errors>
+Errors can be those by <link id="TStream.Seek"/> and <link id="TStream.Write"/>.
+</errors>
+<seealso>
+<link id="TResourceFile.SwitchTo"/>
+</seealso>
+</element>
+
+<element name="TResourceFile.Delete">
+<short>Delete a resource from the file</short>
+<descr>
+<var>Delete</var> deletes the resource identified by <var>Key</var> from the
+collection. It sets the <var>Modified</var> flag to true.
+</descr>
+<errors>
+None.
+</errors>
+<seealso>
+<link id="TResourceFile.Flush"/>
+</seealso>
+</element>
+
+<element name="TResourceFile.Put">
+<short>Set a resource by key name.</short>
+<descr>
+<var>Put</var> sets the resource identified by <var>Key</var> to <var>Item</var>.
+If no such resource exists, a new one is created. The item is written
+to the stream.
+</descr>
+<errors>
+Errors returned may be those by <link id="TStream.Put"/> and <var>TStream.Seek</var>
+</errors>
+<seealso>
+<link id="TResourceFile.Get">Get</link>
+</seealso>
+</element>
+
+<element name="TStringList">
+<short>Collection of strings</short>
+<descr>
+<p>
+A <var>TStringList</var> object can be used to read a collection of strings
+stored in a stream. If you register this object with the <link id="RegisterType"/>
+function, you cannot register the <var>TStrListMaker</var> object.
+</p>
+</descr>
+</element>
+
+<element name="TStringList.Load">
+<short>Load stringlist from stream.</short>
+<descr>
+The <var>Load</var> constructor reads the <var>TStringList</var> object from the
+stream <var>S</var>. It also reads the descriptions of the strings from the
+stream. The string descriptions are stored as an array of
+<var>TstrIndexrec</var> records, where each record describes a string on the
+stream. These records are kept in memory.
+</descr>
+<errors>
+If an error occurs, a stream error is triggered.
+</errors>
+<seealso>
+<link id="TStringList.Done"/>
+</seealso>
+</element>
+
+<element name="TStringList.Done">
+<short>Clean up the instance</short>
+<descr>
+The <var>Done</var> destructor frees the memory occupied by the string
+descriptions, and destroys the object.
+</descr>
+<errors>
+None.
+</errors>
+<seealso>
+<link id="TStringList.Load">Load</link>
+<link id="TObject.Done"/>
+</seealso>
+</element>
+
+<element name="TStringList.Get">
+<short>Return a string by key name</short>
+<descr>
+<var>Get</var> reads the string with key <var>Key</var> from the list of strings on the
+stream, and returns this string. If there is no string with such a key, an
+empty string is returned.
+</descr>
+<errors>
+If no string with key <var>Key</var> is found, an empty string is returned.
+A stream error may result if the stream doesn't contain the needed strings.
+</errors>
+<seealso>
+<link id="TStrListMaker.Put"/>
+</seealso>
+</element>
+
+<element name="TStrListMaker">
+<short>Generate a stream with strings, readable by <link id="TStringList"/></short>
+<descr>
+<p>
+The <var>TStrListMaker</var> object can be used to generate a stream with
+strings, which can be read with the <var>TStringList</var> object.
+If you register this object with the <link id="RegisterType"/>
+function, you cannot register the <var>TStringList</var> object.
+</p>
+</descr>
+</element>
+
+<element name="TStrListMaker.Init">
+<short>Instantiate a new instance of <var>TStrListMaker</var></short>
+<descr>
+<p>
+The <var>Init</var> constructor creates a new instance of the <var>TstrListMaker</var>
+object. It allocates <var>AStrSize</var> bytes on the heap to hold all the
+strings you wish to store. It also allocates enough room for
+<var>AIndexSize</var> key description entries (of the type <var>TStrIndexrec</var>).
+</p>
+<p>
+<var>AStrSize</var> must be large enough to contain all the strings you wish to
+store. If not enough memory is allocated, other memory will be overwritten.
+The same is true for <var>AIndexSize</var> : maximally <var>AIndexSize</var> strings
+can be written to the stream.
+</p>
+</descr>
+<errors>
+None.
+</errors>
+<seealso>
+<link id="TObject.Init"/>
+<link id="TStrListMaker.Done"/>
+</seealso>
+</element>
+
+<element name="TStrListMaker.Done">
+<short>Clean up the instance and free all related memory.</short>
+<descr>
+The <var>Done</var> destructor de-allocates the memory for the index description
+records and the string data, and then destroys the object.
+</descr>
+<errors>
+None.
+</errors>
+<seealso>
+<link id="TObject.Done"/>
+<link id="TStrListMaker.Init"/>
+</seealso>
+</element>
+
+<element name="TStrListMaker.Put">
+<short>Add a new string to the list with associated key.</short>
+<descr>
+<var>Put</var> adds they string <var>S</var> with key <var>Key</var> to the collection of
+strings. This action doesn't write the string to a stream. To write the
+strings to the stream, see the <link id="TStrListMaker.Store">Store</link> method.
+</descr>
+<errors>
+None.
+</errors>
+<seealso>
+<link id="TStrListMaker.Store"/>
+</seealso>
+</element>
+
+<element name="TStrListMaker.Store">
+<short>Write the strings to the stream.</short>
+<descr>
+<var>Store</var> writes the collection of strings to the stream <var>S</var>.
+The collection can then be read with the <var>TStringList</var> object.
+</descr>
+<errors>
+A stream error may occur when writing the strings to the stream.
+</errors>
+<seealso>
+<link id="TStringList.Load"/>
+<link id="TStrListMaker.Put"/>
+</seealso>
+</element>
+
+<element name="InvalidHandle">
+<short>Value for invalid handle. Initial value for file stream handles or when the stream is closed.</short>
+</element>
+
+
+</module>
+</package>
+</fpdoc-descriptions>

+ 1453 - 0
docs/sockets.xml

@@ -0,0 +1,1453 @@
+<?xml version="1.0" encoding="ISO8859-1"?>
+<fpdoc-descriptions>
+<!--  
+
+   $Id$ 
+   This file is part of the FPC documentation. 
+   Copyright (C) 1997, by Michael Van Canneyt 
+ 
+   The FPC documentation is free text; you can redistribute it and/or 
+   modify it under the terms of the GNU Library General Public License as 
+   published by the Free Software Foundation; either version 2 of the 
+   License, or (at your option) any later version. 
+ 
+   The FPC Documentation 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.  See the GNU 
+   Library General Public License for more details. 
+ 
+   You should have received a copy of the GNU Library General Public 
+   License along with the FPC documentation; see the file COPYING.LIB.  If not, 
+   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 
+   Boston, MA 02111-1307, USA. 
+ -->
+<package name="rtl">
+<module name="sockets">
+<!-- \FPCexampledir{sockex/} -->
+<short>TCP/IP Sockets functionality unit</short>
+<descr>
+This document describes the SOCKETS unit for Free Pascal. 
+it was written for linux by Michael Van Canneyt, and ported to Windows
+by Florian Klaempfl.
+</descr>
+
+<element name="SOCK_STREAM">
+<short>Type of socket: stream (connection) type socket (TCP)</short>
+</element>
+<element name="SOCK_DGRAM">
+<short>Type of socket: datagram (conn.less) socket (UDP)</short>
+</element>
+<element name="SOCK_RAW">
+<short>Type of socket:  raw socket</short>
+</element>
+<element name="SOCK_RDM">
+<short>Type of socket: reliably-delivered message</short>
+</element>
+<element name="SOCK_SEQPACKET">
+<short>Type of socket: sequential packet socket</short>
+</element>
+<element name="SOCK_PACKET">
+<short>Type of socket: Packet</short>
+</element>
+
+<element name="AF_UNSPEC">
+<short>Socket domain: Not specified</short>
+</element>
+<element name="AF_UNIX">
+<short>Socket domain: Unix domain sockets</short>
+</element>
+<element name="AF_INET">
+<short>Socket domain: Internet IP Protocol</short>
+</element>
+<element name="AF_AX25">
+<short>Socket domain: Amateur Radio AX.25</short>
+</element>
+<element name="AF_IPX">
+<short>Socket domain: Novell IPX</short>
+</element>
+<element name="AF_APPLETALK">
+<short>Socket domain: Appletalk DDP</short>
+</element>
+<element name="AF_NETROM">
+<short>Socket domain: Amateur radio NetROM</short>
+</element>
+<element name="AF_BRIDGE">
+<short>Socket domain: Multiprotocol bridge</short>
+</element>
+<element name="AF_AAL5">
+<short>Socket domain: Reserved for Werner's ATM</short>
+</element>
+<element name="AF_X25">
+<short>Socket domain: Reserved for X.25 project</short>
+</element>
+<element name="AF_INET6">
+<short>Socket domain: IP version 6</short>
+</element>
+<element name="AF_MAX">
+<short>Socket domain: Maximum value</short>
+</element>
+<element name="PF_UNSPEC">
+<short>Protocol family: Unspecified </short>
+</element>
+<element name="PF_INET">
+<short>Protocol family: Internet IP Protocol</short>
+</element>
+<element name="PF_AX25">
+<short>Protocol family: Amateur Radio AX.25</short>
+</element>
+<element name="PF_IPX">
+<short>Protocol family: Novell IPX</short>
+</element>
+<element name="PF_APPLETALK">
+<short>Protocol family: Appletalk DDP</short>
+</element>
+<element name="PF_UNIX">
+<short>Protocol family: Unix domain sockets</short>
+</element>
+<element name="PF_NETROM">
+<short>Protocol family:Amateur radio NetROM </short>
+</element>
+<element name="PF_BRIDGE">
+<short>Protocol family: Multiprotocol bridge</short>
+</element>
+<element name="PF_AAL5">
+<short>Protocol family: Reserved for Werner's ATM</short>
+</element>
+<element name="PF_X25">
+<short>Protocol family: Reserved for X.25 project</short>
+</element>
+<element name="PF_INET6">
+<short>Protocol family: IP version 6</short>
+</element>
+<element name="PF_MAX">
+<short>Protocol family: Maximum value</short>
+</element>
+
+<element name="TSockAddr">
+<short>General socket adress record</short>
+<descr>
+<var>TUnixSockAddr</var> is used to store a general socket addres for the
+<link id="Bind"/>, <link id="Recv"/> and <link id="Send"/> calls.
+</descr>
+</element>
+<element name="TSockAddr.family">
+<short>Address family</short>
+</element>
+<element name="TSockAddr.data">
+<short>Addres data</short>
+</element>
+
+<element name="TUnixSockAddr">
+<short>Unix socket address record.</short>
+<descr>
+<var>TUnixSockAddr</var> is used to store a UNIX socket addres for the
+<link id="Bind"/>, <link id="Recv"/> and <link id="Send"/> calls.
+</descr>
+</element>
+
+<element name="TUnixSockAddr.family">
+<short>Address family</short>
+</element>
+<element name="TUnixSockAddr.Path">
+<short>File name</short>
+</element>
+
+<element name="TInetSockAddr">
+<short>Internet socket address record</short>
+<descr>
+<var>TUnixSockAddr</var> is used to store a INET socket addres for the
+<link id="Bind"/>, <link id="Recv"/> and <link id="Send"/> calls.
+</descr>
+</element>
+
+<element name="TInetSockAddr.family">
+<short>Address family</short>
+</element>
+<element name="TInetSockAddr.port">
+<short>Port number</short>
+</element>
+<element name="TInetSockAddr.addr">
+<short>IP address</short>
+</element>
+<element name="TInetSockAddr.pad">
+<short>Pad data. Do not use.</short>
+</element>
+
+<element name="TSockArray">
+<short>Type returned by the <link id="SocketPair"/> call.</short>
+</element>
+
+<element name="AF_IMPLINK">
+<short>Address family: ?</short>
+</element>
+
+<!-- constant Visibility: default -->
+<element name="AF_PUP">
+<short>Address family: ?</short>
+</element>
+
+<!-- constant Visibility: default -->
+<element name="AF_CHAOS">
+<short>Address family: ?</short>
+</element>
+
+<!-- constant Visibility: default -->
+<element name="AF_NS">
+<short>Address family: ?</short>
+</element>
+
+<!-- constant Visibility: default -->
+<element name="AF_ISO">
+<short>Address family: ?</short>
+</element>
+
+<!-- constant Visibility: default -->
+<element name="AF_OSI">
+<short>Address family: ?</short>
+</element>
+
+<!-- constant Visibility: default -->
+<element name="AF_ECMA">
+<short>Address family: ?</short>
+</element>
+
+<!-- constant Visibility: default -->
+<element name="AF_DATAKIT">
+<short>Address family: ?</short>
+</element>
+
+<!-- constant Visibility: default -->
+<element name="AF_CCITT">
+<short>Address family: ?</short>
+</element>
+
+<!-- constant Visibility: default -->
+<element name="AF_SNA">
+<short>Addresss family: Linux SNA project</short>
+</element>
+
+<!-- constant Visibility: default -->
+<element name="AF_DECnet">
+<short>Address family: Reserved for DECnet project.</short>
+</element>
+
+<!-- constant Visibility: default -->
+<element name="AF_DLI">
+<short>Address family: ?</short>
+</element>
+
+<!-- constant Visibility: default -->
+<element name="AF_LAT">
+<short>Address family: ?</short>
+</element>
+
+<!-- constant Visibility: default -->
+<element name="AF_HYLINK">
+<short>Address family: ?</short>
+</element>
+
+<!-- constant Visibility: default -->
+<element name="AF_ROUTE">
+<short>Address family: Alias to emulate 4.4BSD.</short>
+</element>
+
+<!-- constant Visibility: default -->
+<element name="AF_LINK">
+<short>Address family: ?</short>
+</element>
+
+<!-- constant Visibility: default -->
+<element name="pseudo_AF_XTP">
+<short>Address family: ?</short>
+</element>
+
+<!-- constant Visibility: default -->
+<element name="AF_COIP">
+<short>Address family: ?</short>
+</element>
+
+<!-- constant Visibility: default -->
+<element name="AF_CNT">
+<short>Address family: ?</short>
+</element>
+
+<!-- constant Visibility: default -->
+<element name="pseudo_AF_RTIP">
+<short>Address family: ?</short>
+</element>
+
+<!-- constant Visibility: default -->
+<element name="AF_SIP">
+<short>Address family: ?</short>
+</element>
+
+<!-- constant Visibility: default -->
+<element name="pseudo_AF_PIP">
+<short>Address family: ?</short>
+</element>
+
+<!-- constant Visibility: default -->
+<element name="AF_ISDN">
+<short>Address family: ?</short>
+</element>
+
+<!-- constant Visibility: default -->
+<element name="AF_E164">
+<short>Address family: ?</short>
+</element>
+
+<!-- constant Visibility: default -->
+<element name="pseudo_AF_KEY">
+<short>Address family: key management API.</short>
+</element>
+
+<!-- constant Visibility: default -->
+<element name="AF_NATM">
+<short>Address family: ?</short>
+</element>
+
+<!-- constant Visibility: default -->
+<element name="AF_ATM">
+<short>Address family: ?</short>
+</element>
+
+<!-- constant Visibility: default -->
+<element name="pseudo_AF_HDRCMPLT">
+<short>Address family: ?</short>
+</element>
+
+<!-- constant Visibility: default -->
+<element name="AF_NETGRAPH">
+<short>Address family: ?</short>
+</element>
+
+<!-- constant Visibility: default -->
+<element name="SOCK_MAXADDRLEN">
+<short>Maximum socket address length for <link id="Bind"/> call.</short>
+<descr>
+</descr>
+<seealso>
+</seealso>
+</element>
+
+<!-- constant Visibility: default -->
+<element name="PF_IMPLINK">
+<short>Protocol Family: ?</short>
+</element>
+
+<!-- constant Visibility: default -->
+<element name="PF_PUP">
+<short>Protocol Family: ?</short>
+</element>
+
+<!-- constant Visibility: default -->
+<element name="PF_CHAOS">
+<short>Protocol Family: ?</short>
+</element>
+
+<!-- constant Visibility: default -->
+<element name="PF_NS">
+<short>Protocol Family: ?</short>
+</element>
+
+<!-- constant Visibility: default -->
+<element name="PF_ISO">
+<short>Protocol Family: ?</short>
+</element>
+
+<!-- constant Visibility: default -->
+<element name="PF_OSI">
+<short>Protocol Family: ?</short>
+</element>
+
+<!-- constant Visibility: default -->
+<element name="PF_ECMA">
+<short>Protocol Family: ?</short>
+</element>
+
+<!-- constant Visibility: default -->
+<element name="PF_DATAKIT">
+<short>Protocol Family: ?</short>
+</element>
+
+<!-- constant Visibility: default -->
+<element name="PF_CCITT">
+<short>Protocol Family: ?</short>
+</element>
+
+<!-- constant Visibility: default -->
+<element name="PF_SNA">
+<short>Protocol Family: Linux SNA project</short>
+</element>
+
+<!-- constant Visibility: default -->
+<element name="PF_DECnet">
+<short>Protocol Family: DECNET project</short>
+</element>
+
+<!-- constant Visibility: default -->
+<element name="PF_DLI">
+<short>Protocol Family: ?</short>
+</element>
+
+<!-- constant Visibility: default -->
+<element name="PF_LAT">
+<short>Protocol Family: ?</short>
+</element>
+
+<!-- constant Visibility: default -->
+<element name="PF_HYLINK">
+<short>Protocol Family: ?</short>
+</element>
+
+<!-- constant Visibility: default -->
+<element name="PF_ROUTE">
+<short>Protocol Family: ?</short>
+</element>
+
+<!-- constant Visibility: default -->
+<element name="PF_LINK">
+<short>Protocol Family: ?</short>
+</element>
+
+<!-- constant Visibility: default -->
+<element name="PF_XTP">
+<short>Protocol Family: ?</short>
+</element>
+
+<!-- constant Visibility: default -->
+<element name="PF_COIP">
+<short>Protocol Family: ?</short>
+</element>
+
+<!-- constant Visibility: default -->
+<element name="PF_CNT">
+<short>Protocol Family: ?</short>
+</element>
+
+<!-- constant Visibility: default -->
+<element name="PF_SIP">
+<short>Protocol Family: ?</short>
+</element>
+
+<!-- constant Visibility: default -->
+<element name="PF_RTIP">
+<short>Protocol Family: ?</short>
+</element>
+
+<!-- constant Visibility: default -->
+<element name="PF_PIP">
+<short>Protocol Family: ?</short>
+</element>
+
+<!-- constant Visibility: default -->
+<element name="PF_ISDN">
+<short>Protocol Family: ?</short>
+</element>
+
+<!-- constant Visibility: default -->
+<element name="PF_KEY">
+<short>Protocol family: Key management API</short>
+</element>
+
+<!-- constant Visibility: default -->
+<element name="PF_NATM">
+<short>Protocol Family: ?</short>
+</element>
+
+<!-- constant Visibility: default -->
+<element name="PF_ATM">
+<short>Protocol Family: ?</short>
+</element>
+
+<!-- constant Visibility: default -->
+<element name="PF_NETGRAPH">
+<short>Protocol Family: ?</short>
+</element>
+
+<!-- constant Visibility: default -->
+<element name="SOL_SOCKET">
+<short>Socket option level: Socket level</short>
+</element>
+
+<!-- constant Visibility: default -->
+<element name="SO_DEBUG">
+<short>Socket option level: debug</short>
+</element>
+
+<!-- constant Visibility: default -->
+<element name="SO_REUSEADDR">
+<short>Socket option: Reuse address</short>
+</element>
+
+<!-- constant Visibility: default -->
+<element name="SO_TYPE">
+<short>Socket option: Type</short>
+</element>
+
+<!-- constant Visibility: default -->
+<element name="SO_ERROR">
+<short>Socket option: Error</short>
+</element>
+
+<!-- constant Visibility: default -->
+<element name="SO_DONTROUTE">
+<short>Socket option: Don't route</short>
+</element>
+
+<!-- constant Visibility: default -->
+<element name="SO_BROADCAST">
+<short>Socket option: Broadcast</short>
+</element>
+
+<!-- constant Visibility: default -->
+<element name="SO_SNDBUF">
+<short>Socket option: Send buffer</short>
+</element>
+
+<!-- constant Visibility: default -->
+<element name="SO_RCVBUF">
+<short>Socket option: receive buffer</short>
+</element>
+
+<!-- constant Visibility: default -->
+<element name="SO_KEEPALIVE">
+<short>Socket option: keep alive</short>
+</element>
+
+<!-- constant Visibility: default -->
+<element name="SO_OOBINLINE">
+<short>Socket option: ?</short>
+</element>
+
+<!-- constant Visibility: default -->
+<element name="SO_NO_CHECK">
+<short>Socket option: ?</short>
+</element>
+
+<!-- constant Visibility: default -->
+<element name="SO_PRIORITY">
+<short>Socket option: ?</short>
+</element>
+
+<!-- constant Visibility: default -->
+<element name="SO_LINGER">
+<short>Socket option: ?</short>
+</element>
+
+<!-- constant Visibility: default -->
+<element name="SO_BSDCOMPAT">
+<short>Socket option: ?</short>
+</element>
+
+<!-- constant Visibility: default -->
+<element name="SO_PASSCRED">
+<short>Socket option: ?</short>
+</element>
+
+<!-- constant Visibility: default -->
+<element name="SO_PEERCRED">
+<short>Socket option: ?</short>
+</element>
+
+<!-- constant Visibility: default -->
+<element name="SO_RCVLOWAT">
+<short>Socket option: ?</short>
+</element>
+
+<!-- constant Visibility: default -->
+<element name="SO_SNDLOWAT">
+<short>Socket option: ?</short>
+</element>
+
+<!-- constant Visibility: default -->
+<element name="SO_RCVTIMEO">
+<short>Socket option: ?</short>
+</element>
+
+<!-- constant Visibility: default -->
+<element name="SO_SNDTIMEO">
+<short>Socket option: ?</short>
+</element>
+
+<!-- constant Visibility: default -->
+<element name="SO_SECURITY_AUTHENTICATION">
+<short>Socket option: ?</short>
+</element>
+
+<!-- constant Visibility: default -->
+<element name="SO_SECURITY_ENCRYPTION_TRANSPORT">
+<short>Socket option: ?</short>
+</element>
+
+<!-- constant Visibility: default -->
+<element name="SO_SECURITY_ENCRYPTION_NETWORK">
+<short>Socket option: ?</short>
+</element>
+
+<!-- constant Visibility: default -->
+<element name="SO_BINDTODEVICE">
+<short>Socket option: ?</short>
+</element>
+
+<!-- constant Visibility: default -->
+<element name="SO_ATTACH_FILTER">
+<short>Socket option: ?</short>
+</element>
+
+<!-- constant Visibility: default -->
+<element name="SO_DETACH_FILTER">
+<short>Socket option: ?</short>
+</element>
+
+<!-- constant Visibility: default -->
+<element name="SO_PEERNAME">
+<short>Socket option: ?</short>
+</element>
+
+<!-- constant Visibility: default -->
+<element name="SO_TIMESTAMP">
+<short>Socket option: ?</short>
+</element>
+
+<!-- constant Visibility: default -->
+<element name="SCM_TIMESTAMP">
+<short>Socket option: ?</short>
+</element>
+
+<!-- constant Visibility: default -->
+<element name="SO_ACCEPTCONN">
+<short>Socket option: ?</short>
+</element>
+
+<!-- constant Visibility: default -->
+<element name="SHUT_RD">
+<short>Shutdown read part of full duplex socket</short>
+</element>
+
+<!-- constant Visibility: default -->
+<element name="SHUT_WR">
+<short>Shutdown write part of full duplex socket</short>
+</element>
+
+<!-- constant Visibility: default -->
+<element name="SHUT_RDWR">
+<short>Shutdown read and write part of full duplex socket</short>
+</element>
+
+<!-- alias type Visibility: default -->
+<element name="sa_family_t">
+<short>Address family type</short>
+</element>
+
+<!-- constant Visibility: default -->
+<element name="PF_LOCAL">
+<short>Protocol family: Unix socket</short>
+</element>
+
+<!-- constant Visibility: default -->
+<element name="PF_FILE">
+<short>Protocol family: Unix socket (alias)</short>
+</element>
+
+<!-- constant Visibility: default -->
+<element name="AF_LOCAL">
+<short>Address family: Unix socket</short>
+</element>
+
+<!-- constant Visibility: default -->
+<element name="AF_FILE">
+<short>Address family: Unix socket (alias)</short>
+</element>
+
+<!-- constant Visibility: default -->
+<element name="MSG_OOB">
+<short>Receive flags: receive out-of-band data.</short>
+</element>
+
+<!-- constant Visibility: default -->
+<element name="MSG_PEEK">
+<short>Receive flags: peek at data, don't remove from buffer.</short>
+</element>
+
+<!-- constant Visibility: default -->
+<element name="MSG_DONTROUTE">
+<short>Send flags: don't use gateway</short>
+</element>
+
+<!-- constant Visibility: default -->
+<element name="MSG_TRYHARD">
+<short>Receive flags: ?</short>
+</element>
+
+<!-- constant Visibility: default -->
+<element name="MSG_CTRUNC">
+<short>Receive flags: Control Data was discarded (buffer too small)</short>
+</element>
+
+<!-- constant Visibility: default -->
+<element name="MSG_PROXY">
+<short>Receive flags: ?</short>
+</element>
+
+<!-- constant Visibility: default -->
+<element name="MSG_TRUNC">
+<short>Receive flags: packet Data was discarded (buffer too small)</short>
+</element>
+
+<!-- constant Visibility: default -->
+<element name="MSG_DONTWAIT">
+<short>Receive flags: Non-blocking operation request.</short>
+</element>
+
+<!-- constant Visibility: default -->
+<element name="MSG_EOR">
+<short>Receive flags: End of record</short>
+</element>
+
+<!-- constant Visibility: default -->
+<element name="MSG_WAITALL">
+<short>Receive flags: Wait till operation completed.</short>
+</element>
+
+<!-- constant Visibility: default -->
+<element name="MSG_FIN">
+<short>Receive flags: ?</short>
+</element>
+
+<!-- constant Visibility: default -->
+<element name="MSG_SYN">
+<short>Receive flags: ?</short>
+</element>
+
+<!-- constant Visibility: default -->
+<element name="MSG_CONFIRM">
+<short>Send flags: Conform connection</short>
+</element>
+
+<!-- constant Visibility: default -->
+<element name="MSG_RST">
+<short>Receive flags: ?</short>
+</element>
+
+<!-- constant Visibility: default -->
+<element name="MSG_ERRQUERE">
+<short>Receive flags: ?</short>
+</element>
+
+<!-- constant Visibility: default -->
+<element name="MSG_NOSIGNAL">
+<short>Receive flags: Suppress SIG_PIPE signal.</short>
+</element>
+
+<!-- constant Visibility: default -->
+<element name="MSG_MORE">
+<short>Receive flags: ?</short>
+</element>
+
+<!-- constant Visibility: default -->
+<element name="S_IN">
+<short>Input socket in socket pair.</short>
+</element>
+
+<!-- constant Visibility: default -->
+<element name="S_OUT">
+<short>Output socket in socket pair</short>
+</element>
+
+<!-- record type Visibility: default -->
+<element name="in_addr">
+<short>General inet socket address.</short>
+</element>
+
+<!-- variable Visibility: default -->
+<element name="in_addr.s_addr">
+<short>Actual address</short>
+</element>
+
+<!-- variable Visibility: default -->
+<element name="TSockAddr.sa_family">
+<short>General socket address: Address family</short>
+</element>
+
+<!-- variable Visibility: default -->
+<element name="TSockAddr.sa_data">
+<short>General socket address: Address data</short>
+</element>
+
+<!-- pointer type Visibility: default -->
+<element name="pSockAddr">
+<short>Pointer to <link id="TSockAddr"/></short>
+</element>
+
+<!-- pointer type Visibility: default -->
+<element name="pInetSockAddr">
+<short>Pointer to <link id="TInetSockAddr"/></short>
+</element>
+
+<!-- record type Visibility: default -->
+<element name="Tin6_addr">
+<short>Alias for <link id="TInetSockAddr6"/></short>
+</element>
+
+<!-- pointer type Visibility: default -->
+<element name="pIn6_Addr">
+<short>Pointer to <link id="Tin6_addr"/></short>
+</element>
+
+<!-- record type Visibility: default -->
+<element name="TInetSockAddr6">
+<short>Record for IPV6 socket address.</short>
+</element>
+
+<!-- variable Visibility: default -->
+<element name="TInetSockAddr6.sin6_family">
+<short>Address family</short>
+</element>
+
+<!-- variable Visibility: default -->
+<element name="TInetSockAddr6.sin6_port">
+<short>Port</short>
+</element>
+
+<!-- variable Visibility: default -->
+<element name="TInetSockAddr6.sin6_flowinfo">
+<short>Flow information.</short>
+</element>
+
+<!-- variable Visibility: default -->
+<element name="TInetSockAddr6.sin6_addr">
+<short>IPV6 address</short>
+</element>
+
+<!-- variable Visibility: default -->
+<element name="TInetSockAddr6.sin6_scope_id">
+<short></short>
+</element>
+
+<!-- alias type Visibility: default -->
+<element name="sockaddr_in6">
+<short>Alias for <link id="TInetSockAddr6"/></short>
+</element>
+
+<!-- pointer type Visibility: default -->
+<element name="psockaddr_in6">
+<short>Pointer to <link id="sockaddr_in6"/></short>
+</element>
+
+<!-- array type Visibility: default -->
+<element name="TSockPairArray">
+<short>Array of sockets, used in <link id="SocketPair"/> call.</short>
+</element>
+
+<!-- variable Visibility: default -->
+<element name="SocketError">
+<short>Contains the error code for the last socket operation.</short>
+<descr>
+<var>SocketError</var> contains the error code for the last socket
+operation. It can be examined to return the last socket error. 
+</descr>
+</element>
+
+<!-- function Visibility: default -->
+<element name="fpsocket">
+<short>Alias for the <link id="socket"/> call</short>
+</element>
+
+<!-- function Visibility: default -->
+<element name="fprecv">
+<short>Alias for the <link id="recv"/> call</short>
+</element>
+
+<!-- function Visibility: default -->
+<element name="fprecvfrom">
+<short>Alias for the <link id="recvfrom"/> call</short>
+</element>
+
+<!-- function Visibility: default -->
+<element name="fpsend">
+<short>Alias for the <link id="send"/> call</short>
+</element>
+
+<!-- function Visibility: default -->
+<element name="fpsendto">
+<short>Alias for the <link id="send"/> call</short>
+</element>
+
+<!-- function Visibility: default -->
+<element name="fpbind">
+<short>Alias for the <link id="bind"/> call</short>
+</element>
+
+<!-- function Visibility: default -->
+<element name="fplisten">
+<short>Alias for the <link id="listen"/> call</short>
+</element>
+
+<!-- function Visibility: default -->
+<element name="fpaccept">
+<short>Alias for the <link id="accept"/> call</short>
+</element>
+
+<!-- function Visibility: default -->
+<element name="fpconnect">
+<short>Alias for the <link id="connect"/> call</short>
+</element>
+
+<!-- function Visibility: default -->
+<element name="fpshutdown">
+<short>Alias for the <link id="shutdown"/> call</short>
+</element>
+
+<!-- function Visibility: default -->
+<element name="fpgetsockname">
+<short>Alias for the <link id="GetSocketName"/> call</short>
+</element>
+
+<!-- function Visibility: default -->
+<element name="fpgetpeername">
+<short>Alias for the <link id="GetPeerName"/> call</short>
+</element>
+
+<!-- function Visibility: default -->
+<element name="fpgetsockopt">
+<short>Alias for the <link id="GetSocketOptions"/> call</short>
+</element>
+
+<!-- function Visibility: default -->
+<element name="fpsetsockopt">
+<short>Alias for the <link id="SetSocketOptions"/> call</short>
+</element>
+
+<!-- function Visibility: default -->
+<element name="fpsocketpair">
+<short>Alias for the <link id="SocketPair"/> call</short>
+</element>
+
+<!-- function Visibility: default -->
+<element name="CloseSocket">
+<short>Closes a socket handle.</short>
+<descr>
+<var>CloseSocket</var> closes a socket handle. It returns 0 if the socket
+was closed succesfully, -1 if it failed.
+</descr>
+<errors>
+On error, -1 is returned.
+</errors>
+<seealso>
+<link id="Socket"/>
+</seealso>
+</element>
+
+<!-- function Visibility: default -->
+<element name="SendTo">
+<short>Send data through an unconnected socket to an address.</short>
+<descr>
+<var>SendTo</var> sends data from buffer <var>Buf</var> with length
+<var>Buflen</var> through socket <var>Sock</var> with options
+<var>Flags</var>. The data is sent to address <var>Addr</var>, which has
+length <var>AddrLen</var>
+</descr>
+<errors>
+On error, -1 is returned.
+</errors>
+<seealso>
+<link id="Socket"/>
+<link id="Send"/>
+<link id="RecvFrom"/>
+</seealso>
+</element>
+
+<!-- function Visibility: default -->
+<element name="RecvFrom">
+<short>Receive data from an unconnected socket</short>
+<descr>
+<var>RecvFrom</var> receives data in buffer <var>Buf</var> with maximum
+length <var>BufLen</var> from socket <var>Sock</var>. 
+Receipt is controlled by options in <var>Flags</var>. <var>Addr</var> will
+be filled with the address from the sender, and will have length
+The function returns the number of bytes received, or -1 on error.
+<var>AddrLen</var>.
+</descr>
+<errors>
+On error, -1 is returned.
+</errors>
+<seealso>
+<link id="Socket"/>
+<link id="recv"/>
+<link id="RecvFrom"/>
+</seealso>
+</element>
+
+<element name="Accept">
+<short>Accept a connection from a socket.</short>
+<descr>
+<p>
+<var>FPAccept</var> accepts a connection from a socket <var>Sock</var>, which was
+listening for a connection. If a connection is accepted, a file descriptor
+is returned. On error <var>-1</var> is returned. The returned socket may NOT 
+be used to accept more connections.  The original socket remains open.
+</p>
+<p>
+The <var>Accept</var> call fills the address of the connecting entity in 
+<var>Addr</var>, and sets its length in <var>Addrlen</var>. <var>Addr</var> should 
+be pointing to enough space, and <var>Addrlen</var> should be set to the 
+amount of space available, prior to the call.
+</p>
+<p>
+The alternate forms of the <link id="Accept"/> command, with the
+<var>Text</var> or <var>File</var> parameters are equivalent
+to subsequently calling the regular <link id="Accept"/> function and the
+<link id="Sock2Text"/> or <link id="Sock2File"/> functions. 
+These functions return <var>True</var> if successful, <var>False</var> otherwise.
+</p>
+</descr>
+<errors>
+<p>
+On error, <var>-1</var> is returned, and errors are reported in 
+<var>SocketError</var>, and include the following:
+</p>
+<dl>
+<dt>SYS_EBADF</dt><dd>The socket descriptor is invalid.</dd>
+<dt>SYS_ENOTSOCK</dt><dd>The descriptor is not a socket.</dd>
+<dt>SYS_EOPNOTSUPP</dt><dd>The socket type doesn't support the <var>Listen</var> operation.</dd>
+<dt>SYS_EFAULT</dt><dd><var>Addr</var> points outside your address space.</dd>
+<dt>SYS_EWOULDBLOCK</dt><dd>The requested operation would block the process.</dd>
+</dl>
+</errors>
+<seealso>
+<link id="Listen"/>
+<link id="Connect"/>
+<link id="Bind"/>
+</seealso>
+<example file="sockex/socksvr"/>
+</element>
+
+<element name="Bind">
+<short>Bind a socket to an address.</short>
+<descr>
+<p>
+<var>Bind</var> binds the socket <var>Sock</var> to address <var>Addr</var>. <var>Addr</var>
+has length <var>Addrlen</var>.
+The function returns <var>True</var> if the call was succesful, <var>False</var> if
+not.
+</p>
+<p>
+The form of the <var>Bind</var> command with the <link id="TUnixSockAddr"/>
+is equivalent to subsequently calling <link id="Str2UnixSockAddr"/> and the 
+regular <var>Bind</var> function.
+The function returns <var>True</var> if successfull, <var>False</var> otherwise.
+</p>
+</descr>
+<errors>
+<p>
+Errors are returned in <var>SocketError</var> and include the following:
+</p>
+<dl>
+<dt>SYS_EBADF</dt><dd> The socket descriptor is invalid.</dd>
+<dt>SYS_EINVAL</dt><dd> The socket is already bound to an address,</dd>
+<dt>SYS_EACCESS</dt><dd> Address is protected and you don't have permission to open it.</dd>
+</dl>
+<p>
+More arrors can be found in the Unix man pages.
+</p>
+</errors>
+<seealso>
+<link id="Socket"/>
+</seealso>
+</element>
+
+<element name="Connect">
+<short>Open a connection to a server socket.</short>
+<descr>
+<p>
+<var>Connect</var> opens a connection to a peer, whose address is described by
+<var>Addr</var>. <var>AddrLen</var> contains the length of the address.
+The type of <var>Addr</var> depends on the kind of connection you're trying to
+make, but is generally one of <var>TSockAddr</var> or <var>TUnixSockAddr</var>.
+</p>
+<p>
+The forms of the <link id="Connect"/> command with the <var>Text</var> or
+<var>File</var> arguments are equivalent to subsequently calling the regular <var>Connect</var> 
+function and the  <link id="Sock2Text"/> or <link id="Sock2File"/> functions.
+These functions return <var>True</var> if successfull, <var>False</var> otherwise.
+</p>
+<p>
+The <var>Connect</var> function returns a file descriptor if the call
+was successfull, <var>-1</var> in case of error.
+</p>
+</descr>
+<errors>
+On error, <var>-1</var> is returned and errors are reported in 
+<var>SocketError</var>.
+</errors>
+<seealso>
+<link id="Listen"/>
+<link id="Bind"/>
+<link id="Accept"/>
+</seealso>
+<example file="sockex/sockcli"/>
+<example file="sockex/pfinger"/>
+</element>
+
+<element name="GetPeerName">
+<short>Return the name (address) of the connected peer.</short>
+<descr>
+<p>
+<var>GetPeerName</var> returns the name of the entity connected to the 
+specified socket <var>Sock</var>. The Socket must be connected for this call to
+work. 
+</p>
+<p>
+<var>Addr</var> should point to enough space to store the name, the
+amount of space pointed to should be set in <var>Addrlen</var>. 
+When the function returns succesfully, <var>Addr</var> will be filled with the 
+name, and <var>Addrlen</var> will be set to the length of <var>Addr</var>.
+</p>
+</descr>
+<errors>
+<p>
+Errors are reported in <var>SocketError</var>, and include the following:
+</p>
+<dl>
+<dt>SYS_EBADF</dt><dd> The socket descriptor is invalid.</dd>
+<dt>SYS_ENOBUFS</dt><dd> The system doesn't have enough buffers to perform the operation.</dd>
+<dt>SYS_ENOTSOCK</dt><dd> The descriptor is not a socket.</dd>
+<dt>SYS_EFAULT</dt><dd> <var>Addr</var> points outside your address space.</dd>
+<dt>SYS_ENOTCONN</dt><dd> The socket isn't connected.</dd>
+</dl>
+</errors>
+<seealso>
+<link id="Connect"/>
+<link id="Socket"/>
+</seealso>
+</element>
+
+<element name="GetSocketName">
+<short>Return name of socket.</short>
+<descr>
+<var>GetSockName</var> returns the current name of the specified socket
+<var>Sock</var>. <var>Addr</var> should point to enough space to store the name, the
+amount of space pointed to should be set in <var>Addrlen</var>. 
+When the function returns succesfully, <var>Addr</var> will be filled with the 
+name, and <var>Addrlen</var> will be set to the length of <var>Addr</var>.
+</descr>
+<errors>
+<p>
+Errors are reported in <var>SocketError</var>, and include the following:
+</p>
+<dl>
+<dt>SYS_EBADF</dt><dd> The socket descriptor is invalid.</dd>
+<dt>SYS_ENOBUFS</dt><dd> The system doesn't have enough buffers to perform the operation.</dd>
+<dt>SYS_ENOTSOCK</dt><dd> The descriptor is not a socket.</dd>
+<dt>SYS_EFAULT</dt><dd> <var>Addr</var> points outside your address space.</dd>
+</dl>
+</errors>
+<seealso>
+<link id="Bind"/>
+</seealso>
+</element>
+
+<element name="GetSocketOptions">
+<short>Get current socket options</short>
+<descr>
+<p>
+<var>GetSocketOptions</var> gets the connection options for socket <var>Sock</var>.
+The socket may be obtained from different levels, indicated by <var>Level</var>,
+which can be one of the following:
+</p>
+<dl>
+<dt>SOL_SOCKET</dt><dd> From the socket itself. </dd>
+<dt>XXX</dt><dd> set <var>Level</var> to <var>XXX</var>, the protocol number of the protocol
+which should interprete the option. </dd>
+</dl>
+<p>
+For more information on this call, refer to the unix manual page \seem{getsockopt}{2}.
+</p>
+</descr>
+<errors>
+<p>
+Errors are reported in <var>SocketError</var>, and include the following:
+</p>
+<dl>
+<dt>SYS_EBADF</dt><dd> The socket descriptor is invalid.</dd>
+<dt>SYS_ENOTSOCK</dt><dd> The descriptor is not a socket.</dd>
+<dt>SYS_EFAULT</dt><dd> <var>OptVal</var> points outside your address space.</dd>
+</dl>
+</errors>
+<seealso>
+<link id="GetSocketOptions"/>
+</seealso>
+</element>
+
+<element name="Listen">
+<short>Listen for connections on socket.</short>
+<descr>
+<p>
+<var>Listen</var> listens for up to <var>MaxConnect</var> connections from socket
+<var>Sock</var>. The socket <var>Sock</var> must be of type <var>SOCK_STREAM</var> or
+<var>Sock_SEQPACKET</var>.
+</p>
+<p>
+The function returns <var>True</var> if a connection was accepted, <var>False</var> 
+if an error occurred.
+</p>
+</descr>
+<errors>
+<p>
+Errors are reported in <var>SocketError</var>, and include the following:
+</p>
+<dl>
+<dt>SYS_EBADF</dt><dd> The socket descriptor is invalid.</dd>
+<dt>SYS_ENOTSOCK</dt><dd> The descriptor is not a socket.</dd>
+<dt>SYS_EOPNOTSUPP</dt><dd> The socket type doesn't support the <var>Listen</var> operation.</dd>
+</dl>
+</errors>
+<seealso>
+<link id="Socket"/>
+<link id="Bind"/>
+<link id="Connect"/>
+</seealso>
+</element>
+
+<element name="Recv">
+<short>Receive data on socket</short>
+<descr>
+<p>
+<var>Recv</var> reads at most <var>Addrlen</var> bytes from socket <var>Sock</var> into
+address <var>Addr</var>. The socket must be in a connected state.
+<var>Flags</var> can be one of the following:
+</p>
+<dl>
+<dt>1</dt><dd>Process out-of band data.</dd>
+<dt>4</dt><dd>Bypass routing, use a direct interface.</dd>
+<dt>??</dt><dd> Wait for full request or report an error.</dd>
+</dl>
+<p>
+The functions returns the number of bytes actually read from the socket, or
+-1 if a detectable error occurred.
+</p>
+</descr>
+<errors>
+<p>
+Errors are reported in <var>SocketError</var>, and include the following:
+</p>
+<dl>
+<dt>SYS_EBADF</dt><dd> The socket descriptor is invalid.</dd>
+<dt>SYS_ENOTCONN</dt><dd> The socket isn't connected.</dd>
+<dt>SYS_ENOTSOCK</dt><dd> The descriptor is not a socket.</dd>
+<dt>SYS_EFAULT</dt><dd> The address is outside your address space.</dd>
+<dt>SYS_EMSGSIZE</dt><dd> The message cannot be sent atomically.</dd>
+<dt>SYS_EWOULDBLOCK</dt><dd> The requested operation would block the process.</dd>
+<dt>SYS_ENOBUFS</dt><dd> The system doesn't have enough free buffers available.</dd>
+</dl>
+</errors>
+<seealso>
+<link id="Send"/>
+</seealso>
+</element>
+
+<element name="Send">
+<short>Send data through socket</short>
+<descr>
+<p>
+<var>Send</var> sends <var>AddrLen</var> bytes starting from address <var>Addr</var>
+to socket <var>Sock</var>. <var>Sock</var> must be in a connected state.
+The function returns the number of bytes sent, or -1 if a detectable 
+error occurred.
+</p>
+<p>
+<var>Flags</var> can be one of the following:
+</p>
+<dl>
+<dt>1</dt><dd>Process out-of band data.</dd>
+<dt>4</dt><dd>Bypass routing, use a direct interface.</dd>
+</dl>
+</descr>
+<errors>
+<p>
+Errors are reported in <var>SocketError</var>, and include the following:
+</p>
+<dl>
+<dt>SYS_EBADF</dt><dd> The socket descriptor is invalid.</dd>
+<dt>SYS_ENOTSOCK</dt><dd> The descriptor is not a socket.</dd>
+<dt>SYS_EFAULT</dt><dd> The address is outside your address space.</dd>
+<dt>SYS_EMSGSIZE</dt><dd> The message cannot be sent atomically.</dd>
+<dt>SYS_EWOULDBLOCK</dt><dd> The requested operation would block the process.</dd>
+<dt>SYS_ENOBUFS</dt><dd> The system doesn't have enough free buffers available.</dd>
+</dl>
+</errors>
+<seealso>
+<link id="Recv"/>
+</seealso>
+</element>
+
+<element name="SetSocketOptions">
+<short>Set socket options.</short>
+<descr>
+<p>
+<var>SetSocketOptions</var> sets the connection options for socket <var>Sock</var>.
+The socket may be manipulated at different levels, indicated by <var>Level</var>,
+which can be one of the following:
+</p>
+<dl>
+<dt>SOL_SOCKET</dt><dd> To manipulate the socket itself. </dd>
+<dt>XXX</dt><dd> set <var>Level</var> to <var>XXX</var>, the protocol number of the protocol
+which should interprete the option. </dd>
+</dl>
+<p>
+For more information on this call, refer to the unix manual page
+<file>setsockopt</file>
+</p>
+</descr>
+<errors>
+<p>
+Errors are reported in <var>SocketError</var>, and include the following:
+</p>
+<dl>
+<dt>SYS_EBADF</dt><dd> The socket descriptor is invalid.</dd>
+<dt>SYS_ENOTSOCK</dt><dd> The descriptor is not a socket.</dd>
+<dt>SYS_EFAULT</dt><dd> <var>OptVal</var> points outside your address space.</dd>
+</dl>
+</errors>
+<seealso>
+<link id="GetSocketOptions"/>
+</seealso>
+</element>
+
+<element name="Shutdown">
+<short>Close one end of full duplex connection.</short>
+<descr>
+<p>
+<var>ShutDown</var> closes one end of a full duplex socket connection, described
+by <var>Sock</var>. The parameter <var>How</var> determines how the connection 
+will be shut down, and can be one of the following:
+</p>
+<dl>
+<dt>0</dt><dd>Further receives are disallowed.</dd>
+<dt>1</dt><dd>Further sends are disallowed.</dd>
+<dt>2</dt><dd>Sending nor receiving are allowed.</dd>
+</dl>
+<p>
+On succes, the function returns 0, on error -1 is returned.
+</p>
+</descr>
+<errors>
+<p>
+<var>SocketError</var> is used to report errors, and includes the following:
+</p>
+<dl>
+<dt>SYS_EBADF</dt><dd> The socket descriptor is invalid.</dd>
+<dt>SYS_ENOTCONN</dt><dd> The socket isn't connected.</dd>
+<dt>SYS_ENOTSOCK</dt><dd> The descriptor is not a socket.</dd>
+</dl>
+</errors>
+<seealso>
+<link id="Socket"/>
+<link id="Connect"/>
+</seealso>
+</element>
+
+<element name="Sock2File">
+<short>Convert socket to untyped file descriptors</short>
+<descr>
+<var>Sock2File</var> transforms a socket <var>Sock</var> into 2 Pascal file
+descriptors of type <var>File</var>, one for reading from the socket
+(<var>SockIn</var>), one for writing to the socket (<var>SockOut</var>).
+</descr>
+<errors>
+None.
+</errors>
+<seealso>
+<link id="Socket"/>
+<link id="Sock2Text"/>
+</seealso>
+</element>
+
+<element name="Sock2Text">
+<short>Convert socket to text file descriptors</short>
+<descr>
+<var>Sock2Text</var> transforms a socket <var>Sock</var> into 2 Pascal file
+descriptors of type <var>Text</var>, one for reading from the socket
+(<var>SockIn</var>), one for writing to the socket (<var>SockOut</var>).
+</descr>
+<errors>
+None.
+</errors>
+<seealso>
+<link id="Socket"/>
+<link id="Sock2File"/>
+</seealso>
+</element>
+
+<element name="Socket">
+<short>Create new socket</short>
+<descr>
+<p>
+<var>Socket</var> creates a new socket in domain <var>Domain</var>, from type
+<var>SocketType</var> using protocol <var>Protocol</var>.
+The Domain, Socket type and Protocol can be specified using predefined
+constants (see the section on constants for available constants)
+If succesfull, the function returns a socket descriptor, which can be passed
+to a subsequent <link id="Bind"/> call. If unsuccesfull, the function returns -1.
+</p>
+<p>
+for an example, see <link id="Accept"/>.
+</p>
+</descr>
+<errors>
+<p>
+Errors are returned in <var>SocketError</var>, and include the follwing:
+</p>
+<dl>
+<dt>SYS_EPROTONOSUPPORT</dt><dd> The protocol type or the specified protocol is not
+supported within this domain.</dd>
+<dt>SYS_EMFILE</dt><dd>The per-process descriptor table is full.</dd>
+<dt>SYS_ENFILE</dt><dd>The system file table is full.</dd>
+<dt>SYS_EACCESS</dt><dd> Permission to create a socket of the specified type 
+and/or protocol is denied.</dd>
+<dt>SYS_ENOBUFS</dt><dd>Insufficient buffer space is available. The socket
+cannot be created until sufficient resources are freed.</dd>
+</dl>
+</errors>
+<seealso>
+<link id="SocketPair"/>, \seem{socket}{2}
+</seealso>
+</element>
+
+
+<element name="SocketPair">
+<short>Create socket pair</short>
+<descr>
+<var>SocketPair</var> creates 2 sockets in domain <var>Domain</var>, from type
+<var>SocketType</var> and using protocol <var>Protocol</var>.
+The pair is returned in <var>Pair</var>, and they are indistinguishable.
+The function returns -1 upon error and 0 upon success.
+</descr>
+<errors>
+Errors are reported in <var>SocketError</var>, and are the same as in <link id="Socket"/>
+</errors>
+<seealso>
+<link id="Str2UnixSockAddr"/>
+</seealso>
+</element>
+
+<element name="Str2UnixSockAddr">
+<short>Convert path to <link id="TUnixSockAddr"/></short>
+<descr>
+<var>Str2UnixSockAddr</var> transforms a Unix socket address in a string to a
+<var>TUnixSockAddr</var> structure which can be passed to the <link id="Bind"/> call.
+</descr>
+<errors>
+None.
+</errors>
+<seealso>
+<link id="Socket"/>
+<link id="Bind"/>
+</seealso>
+</element>
+
+
+</module>
+</package>
+</fpdoc-descriptions>

+ 1001 - 0
docs/video.xml

@@ -0,0 +1,1001 @@
+<?xml version="1.0" encoding="ISO8859-1"?>
+<fpdoc-descriptions>
+<!--  
+
+   $Id$ 
+   This file is part of the FPC documentation. 
+   Copyright (C) 1997, by Michael Van Canneyt 
+ 
+   The FPC documentation is free text; you can redistribute it and/or 
+   modify it under the terms of the GNU Library General Public License as 
+   published by the Free Software Foundation; either version 2 of the 
+   License, or (at your option) any later version. 
+ 
+   The FPC Documentation 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.  See the GNU 
+   Library General Public License for more details. 
+ 
+   You should have received a copy of the GNU Library General Public 
+   License along with the FPC documentation; see the file COPYING.LIB.  If not, 
+   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 
+   Boston, MA 02111-1307, USA. 
+ -->
+<package name="rtl">
+<module name="video">
+<short>Screen handling unit</short>
+<!-- \FPCexampledir{videoex} -->
+<descr>
+<p>
+The <file>Video</file> unit implements a screen access layer which is system
+independent. It can be used to write on the screen in a system-independent
+way, which should be optimal on all platforms for which the unit is
+implemented.
+</p>
+<p>
+The working of the <file>Video</file> is simple: After calling <link id="InitVideo"/>,
+the array <var>VideoBuf</var> contains a representation of the video screen of
+size <var>ScreenWidth*ScreenHeight</var>, going from left to right and top to
+bottom when walking the array elements: <var>VideoBuf[0]</var> contains the 
+character and color code of the top-left character on the screen.
+<var>VideoBuf[ScreenWidth]</var> contains the data for the character in the
+first column of the second row on the screen, and so on.
+</p>
+<p>
+To write to the 'screen', the text to be written should be written to the
+<var>VideoBuf</var> array. Calling <link id="UpdateScreen"/> will then cp the text to
+the screen in the most optimal way. (an example can be found further on).
+</p>
+<p>
+The color attribute is a combination of the foreground and background color,
+plus the blink bit. The bits describe the various color combinations:
+</p>
+<dl>
+<dt>bits 0-3</dt>
+<dd> The foreground color. Can be set using all color constants. 
+</dd>
+<dt>bits 4-6</dt>
+<dd> The background color. Can be set using a subset of the
+color constants.
+</dd>
+<dt>bit 7</dt>
+<dd> The blinking bit. If this bit is set, the character will appear
+blinking.
+</dd>
+</dl>
+<p>
+Each possible color has a constant associated with it, see the constants
+section for a list of constants.
+</p>
+<p>
+The foreground and background color can be combined to a color attribute
+with the following code:
+</p>
+<code>
+Attr:=ForeGroundColor + (BackGroundColor shl 4);
+</code>
+<p>
+The color attribute can be logically or-ed with the blink attribute to
+produce a blinking character:
+</p>
+<code>
+  Atrr:=Attr or blink;
+</code>
+<p>
+But not all drivers may support this.
+</p>
+<p>
+The contents of the <var>VideoBuf</var> array may be modified: This is 'writing'
+to the screen. As soon as everything that needs to be written in the array
+is in the <var>VideoBuf</var> array, calling <var>UpdateScreen</var> will copy the
+contents of the array screen to the screen, in a manner that is as efficient
+as possible.
+</p>
+<p>
+The updating of the screen can be prohibited to optimize performance; To
+this end, the <link id="LockScreenUpdate"/> function can be used: This will
+increment an internal counter. As long as the counter differs from zero,
+calling <link id="UpdateScreen"/> will not do anything. The counter can be
+lowered with <link id="UnlockScreenUpdate"/>. When it reaches zero, the next call
+to <link id="UpdateScreen"/> will actually update the screen. This is useful when
+having nested procedures that do a lot of screen writing.
+</p>
+<p>
+The video unit also presents an interface for custom screen drivers, thus
+it is possible to override the default screen driver with a custom screen 
+driver, see the <link id="SetVideoDriver"/> call. The current video driver can
+be retrieved using the <link id="GetVideoDriver"/> call.
+</p>
+<remark>
+The video unit should <em> not</em> be used together with the <file>crt</file> unit.
+Doing so will result in very strange behaviour, possibly program crashes.
+</remark>
+</descr>
+
+<element name="Black">
+<short>Black color attribute</short>
+</element>
+
+<element name="Blue">
+<short>Blue color attribute</short>
+</element>
+
+<element name="Green">
+<short>Green color attribute</short>
+</element>
+
+<element name="Cyan">
+<short>Cyan color attribute</short>
+</element>
+
+<element name="Red">
+<short>Red color attribute</short>
+</element>
+
+<element name="Magenta">
+<short>Magenta color attribute</short>
+</element>
+
+<element name="Brown">
+<short>Brown color attribute</short>
+</element>
+
+<element name="LightGray">
+<short>Light gray color attribute</short>
+</element>
+
+<element name="DarkGray">
+<short>Dark gray color attribute</short>
+</element>
+
+<element name="LightBlue">
+<short>Light Blue color attribute</short>
+</element>
+
+<element name="LightGreen">
+<short>Light green color attribute</short>
+</element>
+
+<element name="LightCyan">
+<short>Light cyan color attribute</short>
+</element>
+
+<element name="LightRed">
+<short>Light red color attribute</short>
+</element>
+
+<element name="LightMagenta">
+<short>Light magenta color attribute</short>
+</element>
+
+<element name="Yellow">
+<short>Yellow color attribute</short>
+</element>
+
+<element name="White">
+<short>White color attribute</short>
+</element>
+
+<element name="Blink">
+<short>Blink attribute</short>
+</element>
+
+<element name="cpUnderLine">
+<short>Video driver supports underline attribute</short>
+</element>
+
+<element name="cpBlink">
+<short>Video driver supports blink attribute</short>
+</element>
+
+<element name="cpColor">
+<short>Video driver supports color</short>
+</element>
+
+<element name="cpChangeFont">
+<short>Video driver supports changing screen font.</short>
+</element>
+
+<element name="cpChangeMode">
+<short>Video driver supports changing mode</short>
+</element>
+
+<element name="cpChangeCursor">
+<short>Video driver supports changing cursor shape.</short>
+</element>
+
+<element name="crHidden">
+<short>Hide cursor</short>
+</element>
+
+<element name="crUnderLine">
+<short>Underline cursor</short>
+</element>
+
+<element name="crBlock">
+<short>Block cursor</short>
+</element>
+
+<element name="crHalfBlock">
+<short>Half block cursor</short>
+</element>
+
+<element name="vioOK">
+<short>No errors occurred</short>
+</element>
+
+<element name="errVioBase">
+<short>Base value for video errors</short>
+</element>
+
+<element name="errOK">
+<short>No error</short>
+</element>
+
+<element name="errVioInit">
+<short>Video driver initialization error.</short>
+</element>
+
+<element name="errVioNotSupported">
+<short>Unsupported video function</short>
+</element>
+
+<element name="errVioNoSuchMode">
+<short>Invalid video mode</short>
+</element>
+
+
+<element name="ScreenWidth">
+<short>Current screen Width</short>
+</element>
+
+
+<element name="ScreenHeight">
+<short>Current screen height</short>
+</element>
+
+<element name="LowAscii">
+<short>Only use low ascii characters</short>
+</element>
+
+<element name="NoExtendedFrame">
+<short>Disable transformation of control characters on unix terminals</short>
+</element>
+
+<element name="FVMaxWidth">
+<short>Maximum screen buffer width.</short>
+</element>
+
+<element name="ErrorCode">
+<short>Error code returned by the last operation.</short>
+</element>
+
+<element name="ErrorInfo">
+<short>Pointer to extended error information.</short>
+</element>
+
+<element name="ErrorHandler">
+<short>Error handler routine</short>
+<descr>
+The <var>ErrorHandler</var> variable can be set to a custom-error handling
+function. It is set by default to the <link id="DefaultErrorHandler"/> function.
+</descr>
+</element>
+
+<element name="TVideoMode">
+<descr>
+The <var>TVideoMode</var> record describes a videomode. Its fields are
+self-explaining: <var>Col,Row</var> describe the number of columns and 
+rows on the screen for this mode. <var>Color</var> is <var>True</var> if this mode
+supports colors, or <var>False</var> if not.
+</descr>
+</element>
+
+<element name="PVideoMode">
+<short>Pointer to <link id="TVideoMode"/> record.</short>
+</element>
+
+<element name="TVideoModeSelector">
+<short>Video mode selection callback prototype.</short>
+</element>
+
+<element name="TVideoCell">
+<short>One cell (=screen position) in the video buffer </short>
+<descr>
+<var>TVideoCell</var> describes one character on the screen. One of the bytes 
+contains the color attribute with which the character is drawn on the screen,
+and the other byte contains the ASCII code of the character to be drawn. The
+exact position of the different bytes in the record is operating system specific.
+On most little-endian systems, the high byte represents the color attribute,
+while the low-byte represents the ASCII code of the character to be drawn.
+</descr>
+</element>
+
+<element name="PVideoCell">
+<short>Pointer type to <link id="TVideoCell"/></short>
+</element>
+
+<element name="TVideoBuf">
+<short>Screen array type</short>
+<descr>
+The <var>TVideoBuf</var> type represents the screen.
+</descr>
+</element>
+
+<element name="PVideoBuf">
+<short>Pointer type to <link id="TVideoBuf"/></short>
+</element>
+
+<element name="TErrorHandlerReturnValue">
+<short>Type used to report and respond to error conditions</short>
+</element>
+
+<element name="TErrorHandlerReturnValue.errRetry">
+<short>retry the operation</short>
+</element>
+
+<element name="TErrorHandlerReturnValue.errAbort">
+<short>abort and return error code</short>
+</element>
+
+<element name="TErrorHandlerReturnValue.errContinue">
+<short>abort without returning an errorcode.</short>
+</element>
+
+<element name="TErrorHandler">
+<short>Error handler prototype</short>
+<descr>
+<p>
+The <var>TErrorHandler</var> function is used to register an own error
+handling function. It should be used when installing a custom error
+handling function, and must return one of the above values.
+</p>
+<p>
+<var>Code</var> should contain the error code for the error condition, 
+and the <var>Info</var> parameter may contain any data type specific to 
+the error code passed to the function.
+</p>
+</descr>
+</element>
+
+<element name="TVideoDriver">
+<short>Video driver record</short>
+<descr>
+<p>
+<var>TVideoDriver</var> record can be used to install a custom video
+driver, with the <link id="SetVideoDriver"/> call.
+</p>
+<p>
+An explanation of all fields can be found there.
+</p>
+</descr>
+</element>
+
+<element name="ScreenColor">
+<short>Indicate whether current screen supports colors</short>
+<descr>
+<var>ScreenColor</var> indicates whether the current screen supports colors.
+</descr>
+</element>
+
+<element name="CursorX">
+<short>Current write cursor X position.</short>
+<descr>
+Current horizontal position in the screen where items will be written.
+</descr>
+</element>
+
+<element name="CursorY">
+<short>Current write cursor Y position.</short>
+<descr>
+Current vertical position in the screen where items will be written.
+</descr>
+</element>
+
+<element name="VideoBuf">
+<short>Current screen image.</short>
+<descr>
+<var>VideoBuf</var> forms the heart of the <file>Video</file> unit: This
+variable represents the physical screen. Writing to this
+array and calling <link id="UpdateScreen"/> will write the actual characters
+to the screen. 
+</descr>
+</element>
+
+<element name="OldVideoBuf">
+<short>Last written screen image.</short>
+<descr>
+<p>
+The <var>OldVideoBuf</var> contains the state of the video screen after the last
+screen update. The <link id="UpdateScreen"/> function uses this array to decide
+which characters on screen should be updated, and which not. 
+</p>
+<p>
+Note that the <var>OldVideoBuf</var> array may be ignored by some drivers, so
+it should not be used. The Array is in the interface section of the video
+unit mainly so drivers that need it can make use of it. 
+</p>
+</descr>
+</element>
+
+<element name="VideoBufSize">
+<short>Size of the screen image.</short>
+<descr>Current size of the video buffer pointed to by <link id="VideoBuf"/></descr>
+</element>
+
+<element name="ClearScreen">
+<short>Clear the video screen.</short>
+<descr>
+<var>ClearScreen</var> clears the entire screen, and calls <link id="UpdateScreen"/>
+after that. This is done by writing spaces to all character cells of the
+video buffer in the default color (lightgray on black, color attribute \$07).
+</descr>
+<errors>
+None.
+</errors>
+<seealso>
+<link id="InitVideo"/>
+<link id="UpdateScreen"/>
+</seealso>
+<example file="videoex/ex3"/>
+</element>
+
+
+<element name="DefaultErrorHandler">
+<short>Default error handling routine.</short>
+<descr>
+<var>DefaultErrorHandler</var> is the default error handler used by the video
+driver. It simply sets the error code <var>AErrorCode</var> and <var>AErrorInfo</var> 
+in the global variables <var>ErrorCode</var> and <var>ErrorInfo</var> and returns 
+<var>errContinue</var>.
+</descr>
+<errors>
+None.
+</errors>
+<seealso>
+</seealso>
+</element>
+
+<element name="DoneVideo">
+<short>Disable video driver.</short>
+<descr>
+<p>
+<var>DoneVideo</var> disables the Video driver if the video driver is active. If
+the videodriver was already disabled or not yet initialized, it does
+nothing. Disabling the driver means it will clean up any allocated
+resources, possibly restore the screen in the state it was before
+<var>InitVideo</var> was called. Particularly, the <var>VideoBuf</var> and
+<var>OldVideoBuf</var> arrays are no longer valid after a call to 
+<var>DoneVideo</var>.
+</p>
+<p>
+The <var>DoneVideo</var> should always be called if <var>InitVideo</var> was called.
+Failing to do so may leave the screen in an unusable state after the program
+exits.
+</p>
+<p>
+For an example, see most other functions.
+</p>
+</descr>
+<errors>
+Normally none. If the driver reports an error, this is done through the
+<var>ErrorCode</var> variable.
+</errors>
+<seealso>
+<link id="InitVideo"/>
+</seealso>
+</element>
+
+<element name="GetCapabilities">
+<short>Get current driver capabilities.</short>
+<descr>
+<p>
+<var>GetCapabilities</var> returns the capabilities of the current driver.
+It is an or-ed combination of the following constants:
+</p>
+<dl>
+<dt>cpUnderLine</dt><dd><printshort id="cpUnderLine"/></dd>
+<dt>cpBlink</dt><dd><printshort id="cpBlink"/></dd>
+<dt>cpColor</dt><dd><printshort id="cpColor"/></dd>
+<dt>cpChangeFont</dt><dd><printshort id="cpChangeFont"/></dd>
+<dt>cpChangeMode</dt><dd><printshort id="cpChangeMode"/></dd>
+<dt>cpChangeCursor</dt><dd><printshort id="cpChangeCursor"/></dd>
+</dl>
+<p>
+Note that the video driver should not yet be initialized to use this
+function. It is a property of the driver.
+</p>
+</descr>
+<errors>
+None.
+</errors>
+<seealso>
+<link id="GetCursorType"/>
+<link id="GetVideoDriver"/>
+</seealso>
+<example file="videoex/ex4"/>
+</element>
+
+
+<element name="GetCursorType">
+<short>Get screen cursor type</short>
+<descr>
+<p>
+<var>GetCursorType</var> returns the current cursor type. It is one of the
+following values: 
+</p>
+<dl>
+<dt>crHidden</dt><dd><printshort id="crHidden"/></dd>
+<dt>crUnderLine</dt><dd><printshort id="crUnderLine"/></dd>
+<dt>crBlock</dt><dd><printshort id="crBlock"/></dd>
+<dt>crHalfBlock</dt><dd><printshort id="crHalfBlock"/></dd>
+</dl>
+<p>
+Note that not all drivers support all types of cursors.
+</p>
+</descr>
+<errors>
+None.
+</errors>
+<seealso>
+<link id="SetCursorType"/>
+<link id="GetCapabilities"/>
+</seealso>
+<example file="videoex/ex5"/>
+</element>
+
+
+<element name="GetLockScreenCount">
+<short>Get the screen lock update count.</short>
+<descr>
+<var>GetLockScreenCount</var> returns the current lock level. When the lock
+level is zero, a call to <link id="UpdateScreen"/> will actually update the
+screen.
+</descr>
+<errors>
+None.
+</errors>
+<seealso>
+<link id="LockScreenUpdate"/>
+<link id="UnlockScreenUpdate"/>
+<link id="UpdateScreen"/>
+</seealso>
+<example file="videoex/ex6"/>
+</element>
+
+<element name="GetVideoMode">
+<short>Return current video mode</short>
+<descr>
+</descr>
+<seealso>
+</seealso>
+</element>
+
+<element name="GetVideoDriver">
+<short>Get a copy of the current video driver.</short>
+<descr>
+<var>GetVideoMode</var> returns the settings of the currently active video mode.
+The <var>row,col</var> fields indicate the dimensions of the current video mode,
+and <var>Color</var> is true if the current video supports colors.
+</descr>
+<errors>
+None.
+</errors>
+<seealso>
+<link id="SetVideoMode"/>
+<link id="GetVideoModeData"/>
+</seealso>
+<example file="videoex/ex7"/>
+</element>
+
+
+<element name="GetVideoModeCount">
+<short>Get the number of video modes supported by the driver.</short>
+<descr>
+<p>
+<var>GetVideoModeCount</var> returns the number of video modes that the current
+driver supports. If the driver does not support switching of modes, then 1
+is returned.
+</p>
+<p>
+This function can be used in conjunction with the <link id="GetVideoModeData"/>
+function to retrieve data for the supported video modes.
+</p>
+</descr>
+<errors>
+None.
+</errors>
+<seealso>
+<link id="GetVideoModeData"/>
+<link id="GetVideoMode"/>
+</seealso>
+<example file="videoex/ex8"/>
+</element>
+
+
+<element name="GetVideoModeData">
+<short>Get the specifications for a video mode</short>
+<descr>
+<p>
+<var>GetVideoModeData</var> returns the characteristics of the <var>Index</var>-th
+video mode in <var>Data</var>. <var>Index</var> is zero based, and has a maximum value of
+<var>GetVideoModeCount-1</var>. If the current driver does not support setting of
+modes (<var>GetVideoModeCount=1</var>) and <var>Index</var> is zero, the current mode 
+is returned.
+</p>
+<p>
+The function returns <var>True</var> if the mode data was retrieved succesfully,
+<var>False</var> otherwise.
+</p>
+<p>
+For an example, see <link id="GetVideoModeCount"/>.
+</p>
+</descr>
+<errors>
+In case <var>Index</var> has a wrong value, <var>False</var> is returned.
+</errors>
+<seealso>
+<link id="GetVideoModeCount"/>
+<link id="SetVideoMode"/>
+<link id="GetVideoMode"/>
+</seealso>
+</element>
+
+
+<element name="InitVideo">
+<short>Initialize video driver.</short>
+<descr>
+<p>
+<var>InitVideo</var> Initializes the video subsystem. If the video system was
+already initialized, it does nothing. 
+After the driver has been initialized, the <var>VideoBuf</var> and <var>OldVideoBuf</var> 
+pointers are initialized, based on the <var>ScreenWidth</var> and
+<var>ScreenHeight</var> variables. When this is done, the screen is cleared.
+</p>
+<p>
+For an example, see most other functions.
+</p>
+</descr>
+<errors>
+if the driver fails to initialize, the <var>ErrorCode</var> variable is set.
+</errors>
+<seealso>
+<link id="DoneVideo"/>
+</seealso>
+</element>
+
+
+<element name="LockScreenUpdate">
+<short>Prevent further screen updates.</short>
+<descr>
+<p>
+<var>LockScreenUpdate</var> increments the screen update lock count with one.
+As long as the screen update lock count is not zero, <link id="UpdateScreen"/>
+will not actually update the screen.
+</p>
+<p>
+This function can be used to optimize screen updating: If a lot of writing
+on the screen needs to be done (by possibly unknown functions), calling
+<var>LockScreenUpdate</var> before the drawing, and <link id="UnlockScreenUpdate"/>
+after the drawing, followed by a <link id="UpdateScreen"/> call, all writing will
+be shown on screen at once.
+</p>
+<p>
+For an example, see <link id="GetLockScreenCount"/>.
+</p>
+</descr>
+<errors>
+None.
+</errors>
+<seealso>
+<link id="UpdateScreen"/>
+<link id="UnlockScreenUpdate"/>
+<link id="GetLockScreenCount"/>
+</seealso>
+</element>
+
+
+<element name="SetCursorPos">
+<short>Set write cursor position.</short>
+<descr>
+<p>
+<var>SetCursorPos</var> positions the cursor on the given position: Column 
+<var>NewCursorX</var> and row <var>NewCursorY</var>. The origin of the screen is the
+upper left corner, and has coordinates <var>(0,0)</var>.
+</p>
+<p>
+The current position is stored in the <var>CursorX</var> and <var>CursorY</var>
+variables.
+</p>
+</descr>
+<errors>
+None.
+</errors>
+<seealso>
+<link id="SetCursorType"/>
+</seealso>
+<example file="videoex/ex2"/>
+</element>
+
+<element name="SetCursorType">
+<short>Set cursor type</short>
+<descr>
+<p>
+<var>SetCursorType</var> sets the cursor to the type specified in <var>NewType</var>.
+</p>
+<dl>
+<dt>crHidden</dt><dd><printshort id="crHidden"/></dd>
+<dt>crUnderLine</dt><dd><printshort id="crUnderLine"/></dd>
+<dt>crBlock</dt><dd><printshort id="crBlock"/></dd>
+<dt>crHalfBlock</dt><dd><printshort id="crHalfBlock"/></dd>
+</dl>
+</descr>
+<errors>
+None.
+</errors>
+<seealso>
+<link id="SetCursorPos"/>
+</seealso>
+</element>
+
+<element name="SetVideoDriver">
+<short>Install a new video driver.</short>
+<descr>
+<p>
+<var>SetVideoDriver</var> sets the videodriver to be used to <var>Driver</var>. If
+the current videodriver is initialized (after a call to <var>InitVideo</var>)
+then it does nothing and returns <var>False</var>.
+</p>
+<p>
+A new driver can only be installed if the previous driver was not yet
+activated (i.e. before a call to <link id="InitVideo"/>) or after it was
+deactivated (i.e after a call to <var>DoneVideo</var>).
+</p>
+<p>
+For more information about installing a videodriver, see <link id="viddriver"/>.
+</p>
+<p>
+For an example, see the section on writing a custom video driver.
+</p>
+</descr>
+<errors>
+If the current driver is initialized, then <var>False</var> is returned.
+</errors>
+<seealso>
+<link id="viddriver"/>
+</seealso>
+</element>
+
+<element name="TVideoMode">
+<short>Record type descrbing a video mode.</short>
+</element>
+
+<element name="TVideoMode.Col">
+<short>Number of columns for display</short>
+</element>
+
+<element name="TVideoMode.Row">
+<short>Number of rows for display</short>
+</element>
+
+<element name="TVideoMode.Color">
+<short>Color support</short>
+</element>
+
+<element name="SetVideoMode">
+<short>Set current video mode.</short>
+<descr>
+<p>
+<var>SetVideoMode</var> sets the video mode to the mode specified in <var>Mode</var>:
+</p>
+<p>
+If the call was succesful, then the screen will have <var>Col</var> columns and
+<var>Row</var> rows, and will be displaying in color if <var>Color</var> is
+<var>True</var>. 
+</p>
+<p>
+The function returns <var>True</var> if the mode was set succesfully, <var>False</var>
+otherwise.
+</p>
+<p>
+Note that the video mode may not always be set. E.g. a console on Linux
+or a telnet session cannot always set the mode. It is important to check
+the error value returned by this function if it was not succesful.
+</p>
+<p>
+The mode can be set when the video driver has not yet been initialized
+(i.e. before <link id="InitVideo"/> was called) In that case, the video mode will
+be stored, and after the driver was initialized, an attempt will be made to
+set the requested mode. Changing the video driver before the call to
+<var>InitVideo</var> will clear the stored video mode.
+</p>
+<p>
+To know which modes are valid, use the <link id="GetVideoModeCount"/> and
+<link id="GetVideoModeData"/> functions. To retrieve the current video mode, 
+use the <link id="GetVideoMode"/> procedure.
+</p>
+</descr>
+<errors>
+If the specified mode cannot be set, then <var>errVioNoSuchMode</var> may be set
+in <var>ErrorCode</var>
+</errors>
+<seealso>
+<link id="GetVideoModeCount"/>
+<link id="GetVideoModeData"/>
+<link id="GetVideoMode"/>
+</seealso>
+</element>
+
+<element name="UnlockScreenUpdate">
+<short>Unlock screen update.</short>
+<descr>
+<p>
+<var>UnlockScreenUpdate</var> decrements the screen update lock count with one if
+it is larger than zero. When the lock count reaches zero, the 
+<link id="UpdateScreen"/> will actually update the screen. No screen update will 
+be performed as long as the screen update lock count is nonzero. This 
+mechanism can be used to increase screen performance in case a lot of 
+writing is done. 
+</p>
+<p>
+It is important to make sure that each call to <link id="LockScreenUpdate"/> is
+matched by exactly one call to <var>UnlockScreenUpdate</var>
+</p>
+<p>
+For an example, see <link id="GetLockScreenCount"/>.
+</p>
+</descr>
+<errors>
+None.
+</errors>
+<seealso>
+<link id="LockScreenUpdate"/>
+<link id="GetLockScreenCount"/>
+<link id="UpdateScreen"/>
+</seealso>
+</element>
+
+
+<element name="UpdateScreen">
+<short>Update physical screen with internal screen image.</short>
+<descr>
+<p>
+<var>UpdateScreen</var> synchronizes the actual screen with the contents
+of the <var>VideoBuf</var> internal buffer. The parameter <var>Force</var>
+specifies whether the whole screen has to be redrawn (<var>Force=True</var>)
+or only parts that have changed since the last update of the screen.
+</p>
+<p>
+The <var>Video</var> unit keeps an internal copy of the screen as it last 
+wrote it to the screen (in the <var>OldVideoBuf</var> array). The current 
+contents of <var>VideoBuf</var> are examined to see what locations on the 
+screen need to be updated. On slow terminals (e.g. a linux telnet 
+session) this mechanism can speed up the screen redraw considerably.
+</p>
+<p>
+For an example, see most other functions.
+</p>
+</descr>
+<errors>
+None.
+</errors>
+<seealso>
+<link id="ClearScreen"/>
+</seealso>
+</element>
+
+
+<topic name="viddriver">
+<short>Writing a custom video driver</short>
+<descr>
+<p>
+Writing a custom video driver is not difficult, and generally means
+implementing a couple of functions, which whould be registered with
+the <link id="SetVideoDriver"/> function. The various functions that can be
+implemented are located in the <link id="TVideoDriver"/> record:
+</p>
+<code>
+TVideoDriver = Record
+  InitDriver        : Procedure;
+  DoneDriver        : Procedure;
+  UpdateScreen      : Procedure(Force : Boolean);
+  ClearScreen       : Procedure;
+  SetVideoMode      : Function (Const Mode : TVideoMode) : Boolean;
+  GetVideoModeCount : Function : Word;
+  GetVideoModeData  : Function(Index : Word; Var Data : TVideoMode) : Boolean;
+  SetCursorPos      : procedure (NewCursorX, NewCursorY: Word);
+  GetCursorType     : function : Word;
+  SetCursorType     : procedure (NewType: Word);
+  GetCapabilities   : Function : Word;
+end;
+</code>
+<p>
+Not all of these functions must be implemented. In fact, the only absolutely
+necessary function to write a functioning driver is the <var>UpdateScreen</var> 
+function. The general calls in the <file>Video</file> unit will check which
+functionality is implemented by the driver.
+</p>
+<p>
+The functionality of these calls is the same as the functionality of the
+calls in the video unit, so the expected behaviour can be found in the
+previous section. Some of the calls, however, need some additional remarks.
+</p>
+<dl>
+<dt>InitDriver</dt>
+<dd> Called by <var>InitVideo</var>, this function should initialize 
+any data structures needed for the functionality of the driver, maybe do some 
+screen initializations. The function is guaranteed to be called only once; It 
+can only be called again after a call to <var>DoneVideo</var>. The variables
+<var>ScreenWidth</var> and <var>ScreenHeight</var> should be initialized correctly
+after a call to this function, as the <var>InitVideo</var> call will initialize
+the <var>VideoBuf</var> and <var>OldVideoBuf</var> arrays based on their values.
+</dd>
+<dt>DoneDriver</dt>
+<dd> This should clean up any structures that have been
+initialized in the <var>InitDriver</var> function. It should possibly also
+restore the screen as it was before the driver was initialized. The VideoBuf
+and <var>OldVideoBuf</var> arrays will be disposed of by the general <var>DoneVideo</var>
+call.
+</dd>
+<dt>UpdateScreen</dt>
+<dd> This is the only required function of the driver. It
+should update the screen based on the <var>VideoBuf</var> array's contents. It
+can optimize this process by comparing the values with values in the
+<var>OldVideoBuf</var> array. After updating the screen, the <var>UpdateScreen</var>
+procedure should update the <var>OldVideoBuf</var> by itself. If the <var>Force</var>
+parameter is <var>True</var>, the whole screen should be updated, not just the
+changed values.
+</dd>
+<dt>ClearScreen</dt>
+<dd> If there is a faster way to clear the screen than to
+write spaces in all character cells, then it can be implemented here. If the
+driver does not implement this function, then the general routines will
+write spaces in all video cells, and will call <var>UpdateScreen(True)</var>.
+</dd>
+<dt>SetVideoMode</dt>
+<dd> Should set the desired video mode, if available. It
+should return <var>True</var> if the mode was set, <var>False</var> if not.
+</dd>
+<dt>GetVideoModeCount</dt>
+<dd> Should return the number of supported video modes.
+If no modes are supported, this function should not be implemented; the
+general routines will return 1. (for the current mode)
+</dd>
+<dt>GetVideoModeData</dt>
+<dd> Should return the data for the <var>Index</var>-th mode;
+<var>Index</var> is zero based. The function should return true if the data was
+returned correctly, false if <var>Index</var> contains an invalid index.
+If this is not implemented, then the general routine will return the current 
+video mode when <var>Index</var> equals 0.
+</dd>
+<dt>GetCapabilities</dt>
+<dd> If this function is not implemented, zero (i.e.
+no capabilities) will be returned by the general function.
+</dd>
+</dl>
+<p>
+The following unit shows how to override a video driver, with a driver
+that writes debug information to a file. The unit can be used in any of
+the demonstration programs, by simply including it in the <var>uses</var>
+clause. Setting <var>DetailedVideoLogging</var> to
+<var>True</var> will create a more detailed log (but will also slow down
+functioning)
+</p>
+</descr>
+<example file="videoex/viddbg"/>
+</topic>
+
+<topic name="vidutil">
+<short>Examples utility unit</short>
+<descr>
+The examples in this section make use of the unit <file>vidutil</file>, which 
+contains the <var>TextOut</var> function. This function writes a text to the
+screen at a given location. It looks as follows:
+</descr>
+<example file="videoex/vidutil"/>
+</topic>
+
+
+</module>
+</package>
+</fpdoc-descriptions>