浏览代码

Added error messages and used listings package for program examples

michael 27 年之前
父节点
当前提交
b45a63565b
共有 14 个文件被更改,包括 439 次插入818 次删除
  1. 15 5
      docs/Makefile
  2. 32 16
      docs/crt.tex
  3. 28 14
      docs/dos.tex
  4. 2 1
      docs/getopts.tex
  5. 24 12
      docs/go32.tex
  6. 106 53
      docs/linux.tex
  7. 20 10
      docs/mouse.tex
  8. 2 2
      docs/onechap.tex
  9. 2 1
      docs/printer.tex
  10. 160 79
      docs/ref.tex
  11. 6 3
      docs/sockets.tex
  12. 34 17
      docs/strings.tex
  13. 2 0
      docs/units.tex
  14. 6 605
      docs/user.tex

+ 15 - 5
docs/Makefile

@@ -272,13 +272,13 @@ www-install: psdist htmldist htm
 
 psdist: $(PS)
 	tar -cvzf fpcdocps.tar.gz $(PS)
-	zip fpcdocps $(PS)
+	zip docs-ps $(PS)
 
 pdfdist: pdf
-	zip fpcdocpdf $(PDF)
+	zip docs-pdf $(PDF)
 
 dvidist: dvi
-	zip fpcdocdvi $(DVI)
+	zip docs-dvi $(DVI)
 
 htmldist: html
 	find . -name '*.html' >htmllist
@@ -286,8 +286,15 @@ htmldist: html
 	tar -czf fpcdoc.tar.gz --files-from=htmllist
 	rm -f htmllist
 
+htm: html
+	makehtm `find . -name '*.html'`
+	zip -q doc-htm `find . -name '*.htm'` `find . -name '*.gif'`
+	rm `find -name '*.htm'`
+	
+htmdist: htm
+
 txtdist: txt
-	zip fpcdoctxt $(TXT)
+	zip docs-txt $(TXT)
 
 alldist: dvidist psdist txtdist pdfdist htmldist htmdist
 
@@ -317,7 +324,10 @@ linuxexamples: examples
 
 #
 # $Log$
-# Revision 1.11  1998-09-11 12:08:07  michael
+# Revision 1.12  1998-09-13 12:42:05  michael
+# Added error messages and used listings package for program examples
+#
+# Revision 1.11  1998/09/11 12:08:07  michael
 # Additional cleans
 #
 # Revision 1.10  1998/09/11 11:01:10  peter

+ 32 - 16
docs/crt.tex

@@ -116,7 +116,8 @@ to the window instead.
 }
 {None.}{\seep{Window}}
 
-\input{crtex/ex1.tex}
+\latex{\inputlisting{crtex/ex1.pp}}
+ \html{\input{crtex/ex1.tex}}
 
 \Procedure{BigCursor}{Makes the cursor a big rectangle. 
 
@@ -128,7 +129,8 @@ Not implemented on \linux.}
 end of the window. The cursor doesn't move}
 {None.}{\seep{DelLine}, \seep{InsLine}, \seep{ClrScr}}
 
-\input{crtex/ex9.tex}
+\latex{\inputlisting{crtex/ex9.pp}}
+ \html{\input{crtex/ex9.tex}}
 
 \procedure {ClrScr}{}
 { ClrScr clears the current window (using the current colors), 
@@ -136,7 +138,8 @@ and sets the cursor in the top left
 corner of the current window.}
 {None.}{ \seep{Window} }
 
-\input{crtex/ex8.tex}
+\latex{\inputlisting{crtex/ex8.pp}}
+ \html{\input{crtex/ex8.tex}}
 
 \Procedure{CursorOff}{Switches the cursor off (i.e. the cursor is no
 longer visible). 
@@ -154,7 +157,8 @@ Not implemented on \linux.}
 seconds is an approximation, and may be off a lot, if system load is high.}
 {None}{\seep{Sound}, \seep{NoSound}}
 
-\input{crtex/ex15.tex}
+\latex{\inputlisting{crtex/ex15.pp}}
+ \html{\input{crtex/ex15.tex}}
 
 \Procedure {DelLine}
 { DelLine removes the current line. Lines following the current line are 
@@ -162,7 +166,8 @@ scrolled 1 line up, and an empty line is inserted at the bottom of the
 current window. The cursor doesn't move.}
 {None.}{\seep{ClrEol}, \seep{InsLine}, \seep{ClrScr}}
 
-\input{crtex/ex11.tex}
+\latex{\inputlisting{crtex/ex11.pp}}
+ \html{\input{crtex/ex11.tex}}
 
 \procedure {GotoXY}{(X: Byte; Y: Byte)}
 { Positions the cursor at \var{(X,Y)}, \var{X} in horizontal, \var{Y} in
@@ -171,7 +176,8 @@ is located at \var{(1,1)}, the upper-left corner of the window.
 }
 {None.}{ \seef{WhereX}, \seef{WhereY}, \seep{Window} }
 
-\input{crtex/ex6.tex}
+\latex{\inputlisting{crtex/ex6.pp}}
+ \html{\input{crtex/ex6.tex}}
 
 \procedure {HighVideo}{}
 { HighVideo switches the output to highlighted text. (It sets the high
@@ -180,7 +186,8 @@ intensity bit of the video attribute)
 {None.}{ \seep{TextColor}, \seep{TextBackground}, \seep{LowVideo},
 \seep{NormVideo}}
 
-\input{crtex/ex14.tex}
+\latex{\inputlisting{crtex/ex14.pp}}
+ \html{\input{crtex/ex14.tex}}
 
 \procedure {InsLine}{}
 { InsLine inserts an empty line at the current cursor position. 
@@ -189,7 +196,8 @@ causing the last line to disappear from the window.
 The cursor doesn't move.}
 {None.}{\seep{ClrEol}, \seep{DelLine}, \seep{ClrScr}}
 
-\input{crtex/ex10.tex}
+\latex{\inputlisting{crtex/ex10.pp}}
+ \html{\input{crtex/ex10.tex}}
 
 \Function {KeyPressed}{Boolean}
 { The Keypressed function scans the keyboard buffer and sees if a key has
@@ -200,7 +208,8 @@ the KeyPressed function has been called.
 }
 {None.}{\seef{ReadKey}}
 
-\input{crtex/ex2.tex}
+\latex{\inputlisting{crtex/ex2.pp}}
+ \html{\input{crtex/ex2.tex}}
 
 \Procedure {LowVideo}
 { LowVideo switches the output to non-highlighted text. (It clears the high
@@ -225,7 +234,8 @@ Stops the speaker sound.
 
 This is not supported in \linux}{None.}{\seep{Sound}}
 
-\input{crtex/ex16.tex}
+\latex{\inputlisting{crtex/ex16.pp}}
+ \html{\input{crtex/ex16.tex}}
 
 \Function  {ReadKey}{Char}
 {
@@ -239,7 +249,8 @@ reported by ReadKey, so caution is needed when using ReadKey.
 }
 {None.}{\seef{KeyPressed}}
 
-\input{crtex/ex3.tex}
+\latex{\inputlisting{crtex/ex3.pp}}
+ \html{\input{crtex/ex3.tex}}
 
 
 \procedure{Sound}{(hz : word)}
@@ -255,7 +266,8 @@ predefined color constants.
 {None.}{ \seep{TextColor}, \seep{HighVideo}, \seep{LowVideo},
 \seep{NormVideo}}
 
-\input{crtex/ex13.tex}
+\latex{\inputlisting{crtex/ex13.pp}}
+ \html{\input{crtex/ex13.tex}}
 
 \procedure {TextColor}{(CL: Byte)}
 {
@@ -265,7 +277,8 @@ predefined color constants.
 {None.}{ \seep{TextBackground}, \seep{HighVideo}, \seep{LowVideo},
 \seep{NormVideo}}
 
-\input{crtex/ex12.tex}
+\latex{\inputlisting{crtex/ex12.pp}}
+ \html{\input{crtex/ex12.tex}}
 
 \Function  {WhereX}{Byte}
 {
@@ -276,7 +289,8 @@ window.
 {None.}{ \seep{GotoXY}, \seef{WhereY}, \seep{Window} }
 
 
-\input{crtex/ex7.tex}
+\latex{\inputlisting{crtex/ex7.pp}}
+ \html{\input{crtex/ex7.tex}}
 
 \Function  {WhereY}{Byte}
 {
@@ -286,7 +300,8 @@ window.
 }
 {None.}{ \seep{GotoXY}, \seef{WhereX}, \seep{Window} }
 
-\input{crtex/ex7.tex}
+\latex{\inputlisting{crtex/ex7.pp}}
+ \html{\input{crtex/ex7.tex}}
 
 \procedure {Window}{(X1, Y1, X2, Y2: Byte)}
 { Window creates a window on the screen, to which output will be sent.
@@ -300,7 +315,8 @@ are relative to the window's top left corner.
 }
 {None.}{\seep{GotoXY}, \seef{WhereX}, \seef{WhereY}, \seep{ClrScr}}
 
-\input{crtex/ex5.tex}
+\latex{\inputlisting{crtex/ex5.pp}}
+\html{\input{crtex/ex5.tex}}
 
 
 %\procedure {ScrollWindow}{(X1,Y1,X2,Y2 : Byte; Count : Longint)}

+ 28 - 14
docs/dos.tex

@@ -240,7 +240,8 @@ These settings can be coded in \var{dos.pp}, in the initialization part.
 }{-1 when a failure occurs, or an invalid \var{drivenr} is given.}  
 {\seef{DiskSize}, \seep{AddDisk}}
 
-\input{dosex/ex6.tex}
+\latex{\inputlisting{dosex/ex6.pp}}
+\html{\input{dosex/ex6.tex}}
 
 \function{DiskSize}{(Drive: byte)}{longint}{
 \var{DiskSize} returns the total size (in bytes) of a disk. The parameter
@@ -272,14 +273,16 @@ For an example, see \seef{DiskFree}.
 \var{DosExitCode} contains (in the low byte) the exit-code of a program 
 executed with the \var{Exec} call.}{None.}{\seep{Exec}}
 
-\input{dosex/ex5.tex}
+\latex{\inputlisting{dosex/ex5.pp}}
+\html{\input{dosex/ex5.tex}}
 
 \Function{DosVersion}{Word}
 {\var{DosVersion} returns the \dos version number. On \linux systems, it
 returns the Linux version (The first 2 numbers, e.g Linux version 2.1.76 will
 give you DosVersion 2.1)}{None.}{}
 
-\input{dosex/ex1.tex}
+\latex{\inputlisting{dosex/ex1.pp}}
+\html{\input{dosex/ex1.tex}}
 
 \Function{EnvCount}{longint}{
 \var{EnvCount} returns the number of environment variables.}
@@ -292,7 +295,8 @@ The index of the first pair is zero.}
 {The length is limited to 255 characters. This may cause problems under
 \linux. The \linux unit solves this problem.}{\seef{EnvCount}, \seef{GetEnv}}
 
-\input{dosex/ex13.tex}
+\latex{\inputlisting{dosex/ex13.pp}}
+\html{\input{dosex/ex13.tex}}
 
 \procedure{Exec}{(const Path: pathstr; const ComLine: comstr)}{
 \var{Exec} executes the program in \var{Path}, with the options given by
@@ -312,7 +316,8 @@ The resulting name is converted to uppercase on \dos systems. Under \linux,
 the name is left as it is. (filenames are case sensitive under Unix)
 }{\seep{FSplit}}
 
-\input{dosex/ex5.tex}
+\latex{\inputlisting{dosex/ex5.pp}}
+\html{\input{dosex/ex5.tex}}
 
 \procedure{FindClose}{(Var F: SearchRec)}{
 \textbf{\linux only}
@@ -349,7 +354,8 @@ If \var{DosError} is different from zero, no file(s) matching the criteria
 was(were) found.}{Errors are reported in DosError.}{\seep{FindNext},
 \seep{FindClose}}
 
-\input{dosex/ex7.tex}
+\latex{\inputlisting{dosex/ex7.pp}}
+\html{\input{dosex/ex7.tex}}
 
 \procedure{FindNext}{(var f: searchRec)}{
 \var{FindNext} takes as an argument a \var{SearchRec} from a previous
@@ -372,7 +378,8 @@ colons under \linux).
 When no file is found, an empty string is returned.
 }{None.}{\seefl{FExpand}{Dos:FExpand}}
 
-\input{dosex/ex10.tex}
+\latex{\inputlisting{dosex/ex10.pp}}
+\html{\input{dosex/ex10.tex}}
 
 
  
@@ -385,7 +392,8 @@ Under \linux, the extension is taken to be all letters after the last dot
 (.).
 }{None.}{\seefl{FSearch}{Dos:FSearch}}
 
-\input{dosex/ex12.tex}
+\latex{\inputlisting{dosex/ex12.pp}}
+\html{\input{dosex/ex12.tex}}
 
 \procedure{GetCBreak}{(var breakvalue: boolean)}{
 \var{GetCBreak} gets the status of CTRL-Break checking under \dos.
@@ -400,7 +408,8 @@ not implemented, i.e. the call does nothing.}{\seep{SetCBreak}}
 \var{wday} is the day of the week, starting with Sunday as day 0.}
 {None.}{\seepl{GetTime}{Dos:GetTime},\seep{SetDate}}
 
-\input{dosex/ex2.tex}
+\latex{\inputlisting{dosex/ex2.pp}}
+\html{\input{dosex/ex2.tex}}
 
 \functionl{GetEnv}{Dos:GetEnv}{(EnvVar: String)}{String}{
 \var{Getenv} returns the value of the environment variable \var{EnvVar}.
@@ -409,7 +418,8 @@ Under \linux, case is important when looking for \var{EnvVar}.
 When there is no environment variable \var{EnvVar} defined, an empty
 string is returned.}{None.}{\seef{EnvCount}, \seef{EnvStr}}
 
-\input{dosex/ex14.tex}
+\latex{\inputlisting{dosex/ex14.pp}}
+\html{\input{dosex/ex14.tex}}
 
 \procedure{GetFAttr}{(var F; var Attr: word)}{
 \var{GetFAttr} returns the file attributes of the file-variable \var{f}.
@@ -433,7 +443,8 @@ Under \linux, supported attributes are:
 \end{itemize}
 }{Errors are reported in \var{DosError}}{\seep{SetFAttr}}
 
-\input{dosex/ex8.tex}
+\latex{\inputlisting{dosex/ex8.pp}}
+\html{\input{dosex/ex8.tex}}
 
 \procedure{GetFTime}{(var F; var Time: longint)}{
 \var{GetFTime} returns the modification time of a file.
@@ -442,7 +453,8 @@ This time is encoded and must be decoded with \var{UnPackTime}.
 opened.}{Errors are reported in \var{DosError}}
 {\seep{SetFTime}, \seep{PackTime},\seep{UnPackTime}}
 
-\input{dosex/ex9.tex}
+\latex{\inputlisting{dosex/ex9.pp}}
+\html{\input{dosex/ex9.tex}}
 
 \procedure{GetIntVec}{(IntNo: byte; var Vector: pointer)}{
 \var{GetIntVec} returns the address of interrupt vector
@@ -455,7 +467,8 @@ scale. \var{sec100} is in hundredth of a
 second.}{None.}{\seepl{GetDate}{Dos:GetDate},
 \seep{SetTime}}
 
-\input{dosex/ex3.tex}
+\latex{\inputlisting{dosex/ex3.pp}}
+\html{\input{dosex/ex3.tex}}
 
 \procedure{GetVerify}{(var verify: boolean)}{
 \var{GetVerify} returns the status of the verify flag under \dos. When
@@ -489,7 +502,8 @@ to a packed-time format which can be fed to \var{SetFTime}.}
 {None.}
 {\seep{SetFTime}, \seep{FindFirst}, \seep{FindNext}, \seep{UnPackTime}}
 
-\input{dosex/ex4.tex}
+\latex{\inputlisting{dosex/ex4.pp}}
+\html{\input{dosex/ex4.tex}}
 
 \procedure{SetCBreak}{(breakvalue: boolean)}{
 \var{SetCBreak} sets the status of CTRL-Break checking under \dos.

+ 2 - 1
docs/getopts.tex

@@ -133,5 +133,6 @@ then gives the character which caused the error. If \var{OptErr} is
 }
 {\seef{GetLongOpts}, \seem{getopt}{3}}
 
-\input{optex/optex.tex}
+\latex{\inputlisting{optex/optex.pp}}
+\html{\input{optex/optex.tex}}
 

+ 24 - 12
docs/go32.tex

@@ -207,7 +207,8 @@ second controller).
 
 The following example shows how to redirect the keyboard interrupt.
 
-\input{go32ex/keyclick.tex}
+\latex{\inputlisting{go32ex/keyclick.pp}}
+\html{\input{go32ex/keyclick.tex}}
 
 \subsection{Software interrupts}
 
@@ -228,9 +229,11 @@ See also \seefl{set\_rm\_interrupt}{setrminterrupt},
 
 The following examples illustrate the use of software interrupts.
 
-\input{go32ex/softint.tex}
+\latex{\inputlisting{go32ex/softint.pp}}
+\html{\input{go32ex/softint.tex}}
 
-\input{go32ex/rmpm_int.tex}
+\latex{\inputlisting{go32ex/rmpm_int.pp}}
+\html{\input{go32ex/rmpm_int.tex}}
 
 \subsection{Real mode callbacks}
 
@@ -454,7 +457,8 @@ Check int31error variable
 \seefl{set\_segment\_base\_address}{setsegmentbaseaddress} 
 }
 
-\input{go32ex/sel_des.tex}
+\latex{\inputlisting{go32ex/sel_des.pp}}
+\html{\input{go32ex/sel_des.tex}}
 
 \functionl{free\_ldt\_descriptor}{freeldtdescriptor}{(des : Word)}{boolean}
 {
@@ -713,7 +717,8 @@ obtained with the \seefl{get\_page\_size}{getpagesize}  function.
 {Check the int31error variable}
 {\seefl{get\_page\_size}{getpagesize} }
 
-\input{go32ex/meminfo.tex}
+\latex{\inputlisting{go32ex/meminfo.pp}}
+\html{\input{go32ex/meminfo.tex}}
 
 \functionl{allocate\_memory\_block}{allocatememoryblock}
 {(size:Longint)}{Longint}{
@@ -820,7 +825,8 @@ should only be freed by a \seefl{global\_dos\_free}{globaldosfree}  call.
 }{ Check int31error variable}
 { \seefl{global\_dos\_free}{globaldosfree} }
 
-\input{go32ex/buffer.tex}
+\latex{\inputlisting{go32ex/buffer.pp}}
+\html{\input{go32ex/buffer.tex}}
 
 \functionl{global\_dos\_free}{globaldosfree}{(selector :
 Word)}{boolean}{
@@ -950,7 +956,8 @@ Notes: No range check is performed.
 \seepl{seg\_fillchar}{segfillchar},
 \seepl{seg\_fillword}{segfillword} }
 
-\input{go32ex/textmess.tex}
+\latex{\inputlisting{go32ex/textmess.pp}}
+\html{\input{go32ex/textmess.tex}}
 
 \procedure{dosmemfillword}{(seg,ofs : Word; count : Longint; w : Word)}
 {
@@ -1066,7 +1073,8 @@ address.
 \seefl{set\_rm\_interrupt}{setrminterrupt},
 \seefl{get\_rm\_interrupt}{getrminterrupt} }
 
-\input{go32ex/int_pm.tex}
+\latex{\inputlisting{go32ex/int_pm.pp}}
+\html{\input{go32ex/int_pm.tex}}
 
 \Procedure{disable}{
 
@@ -1111,7 +1119,8 @@ executing an IRET.
 }{}
 
 %For an example, see \seefl{global\_dos\_alloc}{globaldosalloc}.
-\input{go32ex/flags.tex}
+\latex{\inputlisting{go32ex/flags.pp}}
+\html{\input{go32ex/flags.tex}}
 
 \functionl{get\_rm\_callback}{getrmcallback}
 {(pm\_func : pointer; const reg : trealregs; var rmcb: tseginfo)}{boolean}
@@ -1138,7 +1147,8 @@ but only at the time of the actual callback.
 }{Check int31error variable}
 {\seefl{free\_rm\_callback}{freermcallback} }
 
-\input{go32ex/callback.tex}
+\latex{\inputlisting{go32ex/callback.pp}}
+\html{\input{go32ex/callback.tex}}
 
 \functionl{free\_rm\_callback}{freermcallback}{(var intaddr : tseginfo)}{boolean}
 {
@@ -1361,7 +1371,8 @@ Notes: No range check is done in any way.
 \seepl{dosmemput}{dosmemput},
 \seepl{dosmemmove}{dosmemmove} }
 
-\input{go32ex/vgasel.tex}
+\latex{\inputlisting{go32ex/vgasel.pp}}
+\html{\input{go32ex/vgasel.tex}}
 
 \procedurel{seg\_fillword}{segfillword}
 {(seg : Word; ofs : Longint; count : Longint; w :Word)}
@@ -1522,4 +1533,5 @@ Return values: One of the constants used by this function
 {none }
 { constants returned by \seefl{get\_run\_mode}{getrunmode}  }
 
-\input{go32ex/getrunmd.tex}
+\latex{\inputlisting{go32ex/getrunmd.pp}}
+\html{\input{go32ex/getrunmd.tex}}

+ 106 - 53
docs/linux.tex

@@ -427,7 +427,8 @@ dangling symbolic link.
 }
 {\seef{Chown}, \seef{Chmod}, \seem{Access}{2} }
 
-\input{linuxex/ex26.tex}
+\latex{\inputlisting{linuxex/ex26.pp}}
+\html{\input{linuxex/ex26.tex}}
 
 \procedure{AssignPipe}{(Pipe\_in, Pipe\_out : Text)}
 {\var{AssignePipe} creates a pipe, i.e. two file objects, one for input, one for output.
@@ -443,7 +444,8 @@ Reading and writing happens through the usual \var{Readln(Pipe\_in,...)} and
 }
 {\seep{POpen}, \seef{MkFifo}, \seem{pipe}{2}}
 
-\input{linuxex/ex36.tex}
+\latex{\inputlisting{linuxex/ex36.pp}}
+\html{\input{linuxex/ex36.tex}}
 
 \procedure{AssignStream}{(StreamIn,StreamOut : Text; Const prog : String)}
 {\var{AssignStream} creates a 2 pipes, i.e. two file objects, one for input, one for
@@ -465,7 +467,8 @@ Other errors include the ones by the fork and exec programs
 }
 {\seep{AssignPipe}, \seep{POpen},\seem{pipe}{2}}
 
-\input{linuxex/ex38.tex}
+\latex{\inputlisting{linuxex/ex38.pp}}
+\html{\input{linuxex/ex38.tex}}
 
 \function{BaseName}{(Const Path;Suf : Pathstr)}{Pathstr}
 {Returns the filename part of \var{Path}, stripping off \var{Suf} if it
@@ -480,7 +483,8 @@ root directory.
 {None.}
 {\seef{DirName}, \seef{FExpand}, \seem{Basename}{1}}
 
-\input{linuxex/ex48.tex}
+\latex{\inputlisting{linuxex/ex48.pp}}
+\html{\input{linuxex/ex48.tex}}
 
 \procedure{CFMakeRaw}{(var Tios:TermIOS)}
 { \var{CFMakeRaw}
@@ -534,7 +538,8 @@ symbolic link, i.e. a symbolic link, whose expansion points to itself.
 }
 {\seef{Chmod}, \seef{Access}, \seem{Chown}(2)}
 
-\input{linuxex/ex24.tex}
+\latex{\inputlisting{linuxex/ex24.pp}}
+\html{\input{linuxex/ex24.tex}}
 
 \function{Chmod}{(Path : Pathstr;NewMode : Longint)}{Boolean}
 { \var{Chmod}
@@ -577,7 +582,8 @@ symbolic link, i.e. a symbolic link, whose expansion points to itself.
 }
 {\seef{Chown}, \seef{Access}, \seem{Chmod}(2)}
 
-\input{linuxex/ex23.tex}
+\latex{\inputlisting{linuxex/ex23.pp}}
+\html{\input{linuxex/ex23.tex}}
 
 \function{CloseDir}{(p:pdir)}{integer}
 { \var{CloseDir} closes the directory pointed to by \var{p}.
@@ -600,7 +606,8 @@ root directory.
 {None.}
 {\seef{BaseName}, \seef{FExpand}, \seem{Dirname}{1}}
 
-\input{linuxex/ex47.tex}
+\latex{\inputlisting{linuxex/ex47.pp}}
+\html{\input{linuxex/ex47.tex}}
 
 \procedure{Dup}{(Var OldFile, NewFile : Text)}
 {
@@ -620,7 +627,8 @@ fileposition in both files.
 }
 {\seep{Dup2}, \seem{Dup}{2} }
 
-\input{linuxex/ex31.tex}
+\latex{\inputlisting{linuxex/ex31.pp}}
+\html{\input{linuxex/ex31.tex}}
 
 \procedure{Dup2}{(Var OldFile, NewFile : Text)}
 {
@@ -642,7 +650,8 @@ fileposition in both files.
 }
 { \seep{Dup}, \seem{Dup2}{2} }
 
-\input{linuxex/ex32.tex}
+\latex{\inputlisting{linuxex/ex32.pp}}
+\html{\input{linuxex/ex32.tex}}
 
 \procedure{EpochToLocal}
 {(Epoch : Longint; var Year,Month,Day,Hour,Minute,Second : Word)}
@@ -653,7 +662,8 @@ Converts the epoch time (=Number of seconds since 00:00:00 , January 1,
 {None}
 {\seef{GetEpochTime}, \seef{LocalToEpoch}, \seep{GetTime},\seep{GetDate} }
 
-\input{linuxex/ex3.tex}
+\latex{\inputlisting{linuxex/ex3.pp}}
+\html{\input{linuxex/ex3.tex}}
 
 \procedure{Execl}
 {(Path : pathstr)}
@@ -680,7 +690,8 @@ A compononent of the path has no search permission.
 {\seep{Execve}, \seep{Execv}, \seep{Execvp}, \seep{Execle},
  \seep{Execlp}, \seef {Fork}, \seem{execvp}{3} }
 
-\input{linuxex/ex10.tex}
+\latex{\inputlisting{linuxex/ex10.pp}}
+\html{\input{linuxex/ex10.tex}}
 
 \procedure{Execle}
 {(Path : pathstr, Ep : ppchar)}
@@ -708,7 +719,8 @@ A compononent of the path has no search permission.
 {\seep{Execve}, \seep{Execv}, \seep{Execvp},
 \seep{Execl}, \seep{Execlp}, \seef {Fork}, \seem{execvp}{3} }
 
-\input{linuxex/ex11.tex}
+\latex{\inputlisting{linuxex/ex11.pp}}
+\html{\input{linuxex/ex11.tex}}
 
 \procedure{Execlp}
 {(Path : pathstr)}
@@ -736,7 +748,8 @@ A compononent of the path has no search permission.
 {\seep{Execve}, \seep{Execv}, \seep{Execvp}, \seep{Execle},
 \seep{Execl}, \seef {Fork}, \seem{execvp}{3} }
 
-\input{linuxex/ex12.tex}
+\latex{\inputlisting{linuxex/ex12.pp}}
+\html{\input{linuxex/ex12.tex}}
 
 \procedure{Execv}
 {(Path : pathstr; args : ppchar)}
@@ -765,7 +778,8 @@ A compononent of the path has no search permission.
 {\seep{Execve}, \seep{Execvp}, \seep{Execle},
 \seep{Execl}, \seep{Execlp}, \seef {Fork}, \seem{execv}{3} }
 
-\input{linuxex/ex8.tex}
+\latex{\inputlisting{linuxex/ex8.pp}}
+\html{\input{linuxex/ex8.tex}}
 
 \procedure{Execve}
 {(Path : pathstr; args,ep : ppchar)}
@@ -793,7 +807,8 @@ A compononent of the path has no search permission.
 {\seep{Execve}, \seep{Execv}, \seep{Execvp} \seep{Execle},
 \seep{Execl}, \seep{Execlp}, \seef {Fork}, \seem{execve}{2} }
 
-\input{linuxex/ex7.tex}
+\latex{\inputlisting{linuxex/ex7.pp}}
+\html{\input{linuxex/ex7.tex}}
 
 \procedure{Execvp}
 {(Path : pathstr; args : ppchar)}
@@ -822,7 +837,8 @@ A compononent of the path has no search permission.
 {\seep{Execve}, \seep{Execv}, \seep{Execle},
 \seep{Execl}, \seep{Execlp}, \seef {Fork}, \seem{execvp}{3} }
 
-\input{linuxex/ex9.tex}
+\latex{\inputlisting{linuxex/ex9.pp}}
+\html{\input{linuxex/ex9.tex}}
 
 
 \procedurel{FD\_Clear}{FDClear}{(var fds:fdSet)}
@@ -914,7 +930,8 @@ For an example, see \seef{fdRead}.
 {\seef{fdClose}, \seef{fdRead}, \seef{fdWrite},\seef{fdTruncate},
 \seef{fdFlush}, \seef{fdSeek}}
 
-\input{linuxex/ex19.tex}
+\latex{\inputlisting{linuxex/ex19.pp}}
+\html{\input{linuxex/ex19.tex}}
 
 \function{fdRead}{(fd:longint;var buf;size:longint}{longint}
 { \var{fdRead} reads at most \var{size} bytes from the file descriptor
@@ -929,7 +946,8 @@ No checking on the length of \var{buf} is done.
 {\seef{fdOpen}, \seef{fdClose}, \seef{fdWrite},\seef{fdTruncate},
 \seef{fdFlush}, \seef{fdSeek}}
 
-\input{linuxex/ex20.tex}
+\latex{\inputlisting{linuxex/ex20.pp}}
+\html{\input{linuxex/ex20.tex}}
 
 \function{fdSeek}{(fd,Pos,SeekType:longint}{longint}  
 {\var{fdSeek} sets the current fileposition of file \var{fd} to
@@ -978,7 +996,8 @@ eliminating directory references such as . and .. from the result.
 {None}
 {\seef{BaseName},\seef{DirName} }
 
-\input{linuxex/ex45.tex}
+\latex{\inputlisting{linuxex/ex45.pp}}
+\html{\input{linuxex/ex45.tex}}
 
 \procedure{FLock}{(Var F; Mode : longint)}
 {\var{FLock} implements file locking. it sets or removes a lock on the file
@@ -1017,7 +1036,8 @@ failed.
 }
 {\seef{FStat}, \seef{LStat}, \seem{statfs}{2}}
 
-\input{linuxex/ex30.tex}
+\latex{\inputlisting{linuxex/ex30.pp}}
+\html{\input{linuxex/ex30.tex}}
 
 \function{FSearch}{(Path : pathstr;DirList : string)}{Pathstr}
 { Searches in \var{DirList}, a colon separated list of directories,
@@ -1025,7 +1045,8 @@ for a file named \var{Path}. It then returns a path to the found file.}
 {An empty string if no such file was found.}
 {\seef{BaseName}, \seef{DirName}, \seef{FExpand} }
 
-\input{linuxex/ex46.tex}
+\latex{\inputlisting{linuxex/ex46.pp}}
+\html{\input{linuxex/ex46.tex}}
 
 \function{FStat}{(Path : Pathstr; Var Info : stat)}{Boolean}
 {
@@ -1042,7 +1063,8 @@ failed.
 }
 {\seef{FSStat}, \seef{LStat}, \seem{stat}{2}}
 
-\input{linuxex/ex28.tex}
+\latex{\inputlisting{linuxex/ex28.pp}}
+\html{\input{linuxex/ex28.tex}}
 
 \function{Fcntl}{(Fd :  text, Cmd : Integer)}{Integer}
 {
@@ -1105,7 +1127,8 @@ process. (you can get the parent's PID with \seef{GetPPid}).
 }
 {\seep{Execve}, \seem{fork}{2}}
 
-\input{linuxex/ex14.tex}
+\latex{\inputlisting{linuxex/ex14.pp}}
+\html{\input{linuxex/ex14.tex}}
 
 \procedure{GetDate}
 { (Var Year, Month, Day : Word) }
@@ -1115,7 +1138,8 @@ Returns the current day.
 {None}
 {\seef{GetEpochTime}, \seep{GetTime}, \seep{EpochToLocal} }
 
-\input{linuxex/ex6.tex}
+\latex{\inputlisting{linuxex/ex6.pp}}
+\html{\input{linuxex/ex6.tex}}
 
 \function{GetDomainName}{}{String}
 {
@@ -1125,21 +1149,24 @@ An empty string is returned if the domain is not set.
 {None.}
 { \seef{GetHostName},seem{Getdomainname}{2} }
 
-\input{linuxex/ex39.tex}
+\latex{\inputlisting{linuxex/ex39.pp}}
+\html{\input{linuxex/ex39.tex}}
 
 \function{GetEGid}{}{Longint}
 { Get the effective group ID of the currently running process.}
 {None.}
 {\seef{GetGid}, \seem{getegid}{2} }
 
-\input{linuxex/ex18.tex}
+\latex{\inputlisting{linuxex/ex18.pp}}
+\html{\input{linuxex/ex18.tex}}
 
 \function{GetEUid}{}{Longint}
 { Get the effective user ID of the currently running process.}
 {None.}
 {\seef{GetEUid}, \seem{geteuid}{2} }
 
-\input{linuxex/ex17.tex}
+\latex{\inputlisting{linuxex/ex17.pp}}
+\html{\input{linuxex/ex17.tex}}
 
 \function{GetEnv}{(P : String)}{PChar}
 {Returns the value of the environment variable in \var{P}. If the variable is
@@ -1152,7 +1179,8 @@ A PChar is returned to accomodate for strings longer than 255 bytes,
 {None.}
 {\seem{sh}{1}, \seem{csh}{1} }
 
-\input{linuxex/ex41.tex}
+\latex{\inputlisting{linuxex/ex41.pp}}
+\html{\input{linuxex/ex41.tex}}
 
 \function{GetEpochTime}{}{longint}
 {
@@ -1162,7 +1190,8 @@ it is adjusted to the local time zone, but not to DST.
 {no errors}
 {\seep{EpochToLocal}, \seep{GetTime}, \seem{time}{2}}
 
-\input{linuxex/ex1.tex}
+\latex{\inputlisting{linuxex/ex1.pp}}
+\html{\input{linuxex/ex1.tex}}
 \function{GetFS}{(Var F : Any File Type)}{Longint}
 {\var{GetFS} returns the file selector that the kernel provided for your
 file. In principle you don' need this file selector. Only for some calls
@@ -1170,14 +1199,16 @@ it is needed, such as the \seef{Select} call or so.}
 {In case the file was not opened, then -1 is returned.}
 {\seef{Select}}
 
-\input{linuxex/ex34.tex}
+\latex{\inputlisting{linuxex/ex34.pp}}
+\html{\input{linuxex/ex34.tex}}
 
 \function{GetGid}{}{Longint}
 { Get the real group ID of the currently running process.}
 {None.}
 {\seef{GetEGid}, \seem{getgid}{2} }
 
-\input{linuxex/ex18.tex}
+\latex{\inputlisting{linuxex/ex18.pp}}
+\html{\input{linuxex/ex18.tex}}
 \function{GetHostName}{}{String}
 {
 Get the hostname of the machine on which the process is running.
@@ -1186,14 +1217,16 @@ An empty string is returned if hostname is not set.
 {None.}
 { \seef{GetDomainName},seem{Gethostname}{2} }
 
-\input{linuxex/ex40.tex}
+\latex{\inputlisting{linuxex/ex40.pp}}
+\html{\input{linuxex/ex40.tex}}
 
 \function{GetPid}{}{Longint}
 { Get the Process ID of the currently running process.}
 {None.}
 {\seef{GetPPid}, \seem{getpid}{2}}
 
-\input{linuxex/ex16.tex}
+\latex{\inputlisting{linuxex/ex16.pp}}
+\html{\input{linuxex/ex16.tex}}
 
 
 \function{GetPPid}{}{Longint}
@@ -1201,7 +1234,8 @@ An empty string is returned if hostname is not set.
 {None.}
 {\seef{GetPid}, \seem{getppid}{2}}
 
-\input{linuxex/ex16.tex}
+\latex{\inputlisting{linuxex/ex16.pp}}
+\html{\input{linuxex/ex16.tex}}
 
 \function{GetPriority}{(Which,Who : Integer)}{Integer}
 {
@@ -1231,14 +1265,16 @@ Returns the current time of the day.
 {None}
 {\seef{GetEpochTime}, \seep{GetDate}, \seep{EpochToLocal} }
 
-\input{linuxex/ex5.tex}
+\latex{\inputlisting{linuxex/ex5.pp}}
+\html{\input{linuxex/ex5.tex}}
 
 \function{GetUid}{}{Longint}
 { Get the real user ID of the currently running process.}
 {None.}
 {\seef{GetEUid}, \seem{getuid}{2} }
 
-\input{linuxex/ex17.tex}
+\latex{\inputlisting{linuxex/ex17.pp}}
+\html{\input{linuxex/ex17.tex}}
 
 \function{Glob}{(Const Path : Pathstr)}{PGlob}
 {
@@ -1256,7 +1292,8 @@ usual meaning.
 }
 {\seep{GlobFree}, \seem{Glob}{3} }
 
-\input{linuxex/ex49.tex}
+\latex{\inputlisting{linuxex/ex49.pp}}
+\html{\input{linuxex/ex49.tex}}
 
  \procedure{GlobFree}{(Var P : Pglob)}
  {Releases the memory, occupied by a pglob structure. \var{P} is set to nil.}{None}
@@ -1281,7 +1318,8 @@ function, that's why we don't list them here
 }
 {\seem{ioctl}{2}}
 
-\input{linuxex/ex54.tex}
+\latex{\inputlisting{linuxex/ex54.pp}}
+\html{\input{linuxex/ex54.tex}}
 
 \function{IOperm}{(From,Num : Cadinal; Value : Longint)}{boolean}
 {\var{IOperm}
@@ -1387,7 +1425,8 @@ symbolic link. If so it returns \var{True}
  \seefl{S\_ISSOCK}{ISSOCK}
 }
 
-\input{linuxex/ex53.tex}
+\latex{\inputlisting{linuxex/ex53.pp}}
+\html{\input{linuxex/ex53.tex}}
 
 
 \functionl{S\_ISREG}{ISREG}{(m:integer)}{boolean}
@@ -1457,7 +1496,8 @@ failed.
 }
 {\seef{FStat}, \seef{FSStat}, \seem{stat}{2}}
 
-\input{linuxex/ex29.tex}
+\latex{\inputlisting{linuxex/ex29.pp}}
+\html{\input{linuxex/ex29.tex}}
 
 \function{Link}{(OldPath,NewPath : pathstr)}{Boolean}
 {\var{Link} makes \var{NewPath} point to the same file als \var{OldPath}. The two files
@@ -1492,7 +1532,8 @@ entry.
 }
 {\seef{SymLink}, \seef{UnLink}, \seem{Link}{2} }
 
-\input{linuxex/ex21.tex}
+\latex{\inputlisting{linuxex/ex21.pp}}
+\html{\input{linuxex/ex21.tex}}
 
 
 
@@ -1504,7 +1545,8 @@ Converts the Local time to epoch time (=Number of seconds since 00:00:00 , Janua
 {None}
 {\seef{GetEpochTime}, \seep{EpochToLocal}, \seep{GetTime},\seep{GetDate} }
 
-\input{linuxex/ex4.tex}
+\latex{\inputlisting{linuxex/ex4.pp}}
+\html{\input{linuxex/ex4.tex}}
 
 \function{MkFifo}{(PathName: String; Mode : Longint)}{Boolean}
 {\var{MkFifo} creates named a named pipe in the filesystem, with name
@@ -1532,7 +1574,8 @@ do a priority increase.
 \end{description}
 }{\seef{GetPriority}, \seef{SetPriority}, \seem{Nice}{2}}
 
-\input{linuxex/ex15.tex}
+\latex{\inputlisting{linuxex/ex15.pp}}
+\html{\input{linuxex/ex15.tex}}
 
 \function{OpenDir}{(f:pchar)}{pdir}
 { \var{OpenDir} opens the directory  \var{f}, and returns a \var{pdir}
@@ -1542,7 +1585,8 @@ structure. If the directory cannot be opened, \var{nil} is returned.}
 {\seef{CloseDir}, \seef{ReadDir}, \seep{SeekDir}, \seef{TellDir},
 \seem{opendir}{3}}
 
-\input{linuxex/ex35.tex}
+\latex{\inputlisting{linuxex/ex35.pp}}
+\html{\input{linuxex/ex35.tex}}
 
 \function{PClose}{(Var F : FileType)}{longint}
 { \var{PClose} closes a file opened with \var{POpen}. It waits for the
@@ -1573,7 +1617,8 @@ Execve, Dup and AssignPipe commands.
 }
 {\seep{AssignPipe}, \seem{popen}{3}, \seef{PClose}}
 
-\input{linuxex/ex37.tex}
+\latex{\inputlisting{linuxex/ex37.pp}}
+\html{\input{linuxex/ex37.tex}}
 
 \function{ReadDir}{(p:pdir)}{pdirent}
 {\var{ReadDir} reads the next entry in the directory pointed to by \var{p}.
@@ -1648,7 +1693,8 @@ On error, -1 is returned.}
 \seepl{FD\_Set}{FDSet}, 
 \seefl{FD\_IsSet}{FDIsSet}}
 
-\input{linuxex/ex33.tex}
+\latex{\inputlisting{linuxex/ex33.pp}}
+\html{\input{linuxex/ex33.tex}}
 
 \function{SelectText}{( var T : Text; TimeOut :PTime)}{Longint}
 {\var{SelectText} executes the \seef{Select} call on a file of type
@@ -1697,7 +1743,8 @@ or \seep{Execve} calls.
 {Errors are reported in LinuxError.}
 {\seep{POpen}, \seef{Fork}, \seep{Execve}, \seem{system}{3}}
 
-\input{linuxex/ex56.tex}
+\latex{\inputlisting{linuxex/ex56.pp}}
+\html{\input{linuxex/ex56.tex}}
 
 \procedure{SigAction}{(Signum : Integer; Var Act,OldAct : PSigActionRec)}
 { Changes the action to take upon receipt of a signal. \var{Act} and
@@ -1740,7 +1787,8 @@ from within its own signal handler.
 \seem{Sigaction}{2}
 }
 
-\input{linuxex/ex57.tex}
+\latex{\inputlisting{linuxex/ex57.pp}}
+\html{\input{linuxex/ex57.tex}}
 
 \function{SigPending}{}{SigSet}
 {
@@ -1796,7 +1844,8 @@ The return value for Signal is the old signal handler, or nil on error.
 }
 {\seep{SigAction},\seef{Kill}, \seem{Signal}{2} }
 
-\input{linuxex/ex58.tex}
+\latex{\inputlisting{linuxex/ex58.pp}}
+\html{\input{linuxex/ex58.tex}}
 
 \function{SymLink}{(OldPath,NewPath : pathstr)}{Boolean}
 {\var{SymLink} makes \var{Newpath} point to the file in \var{OldPath}, which doesn't
@@ -1831,7 +1880,8 @@ entry.
 }
 {\seef{Link}, \seef{UnLink}, \seem{Symlink}{2} }
 
-\input{linuxex/ex22.tex}
+\latex{\inputlisting{linuxex/ex22.pp}}
+\html{\input{linuxex/ex22.tex}}
 
 \function{TCDrain}{(Fd:longint)}{Boolean}
 { \var{TCDrain}
@@ -1890,7 +1940,8 @@ otherwise.
 {Errors are reported in LinuxError}
 {\seef{TCSetAttr}, \seem{termios}{2} }
 
-\input{linuxex/ex55.tex}
+\latex{\inputlisting{linuxex/ex55.pp}}
+\html{\input{linuxex/ex55.tex}}
 
 \function{TCGetPGrp}{(Fd:longint;var Id:longint)}{boolean}
 { \var{TCGetPGrp}
@@ -1975,7 +2026,8 @@ current mask is returned.
 {None}
 {\seef{Chmod}, \seem{Umask}{2}}
 
-\input{linuxex/ex27.tex}
+\latex{\inputlisting{linuxex/ex27.pp}}
+\html{\input{linuxex/ex27.tex}}
 
 \procedure{Uname}{(var unamerec:utsname)}
 {\var{Uname} gets the name and configuration of the current \linux kernel,
@@ -2034,7 +2086,8 @@ Other errors may occur, but aren't documented.
 }
 {\seef{GetEpochTime}, \seef{Chown}, \seef{Access}, \seem{utime}(2)}
 
-\input{linuxex/ex25.tex}
+\latex{\inputlisting{linuxex/ex25.pp}}
+\html{\input{linuxex/ex25.tex}}
 
 \function{WaitPid}{(Pid : longint; Status : pointer; Options : Integer)}{Longint}
 { \var{WaitPid} waits for a child process with process ID \var{Pid} to exit. The

+ 20 - 10
docs/mouse.tex

@@ -65,7 +65,8 @@ For two-button mice, checking the status of the middle button seems to give
 and clear the stats of the right button.
 }{None.}{\seef{GetLastButtonRelease}}
 
-\input {mouseex/mouse5.tex}
+\latex{\inputlisting{mouseex/mouse5.pp}}
+\html{\input{mouseex/mouse5.tex}}
 
 \function{GetLastButtonRelease}{(Button: Longint; Var x,y:Longint)}{Longint}{
 \var{GetLastButtonRelease}
@@ -94,7 +95,8 @@ necessary information from it.
 \seep{SetMousePos}}
 
 
-\input {mouseex/mouse3.tex}
+\latex{\inputlisting{mouseex/mouse3.pp}}
+\html{\input{mouseex/mouse3.tex}}
 
 \Procedure{HideMouse}{
 \var{HideMouse} makes the mouse cursor invisible.
@@ -115,7 +117,8 @@ You should never have to call it, unless you want to reset everything to
 its default values.
 }{None.}{\var{MouseFound} variable.}
 
-\input {mouseex/mouse1.tex}
+\latex{\inputlisting{mouseex/mouse1.pp}}
+\html{\input{mouseex/mouse1.tex}}
 
 \Function{LPressed}{Boolean}{
 
@@ -153,7 +156,8 @@ and background colors stay the same and that the Ascii code you enter is the
 character that you will get on screen; there's no XOR'ing.
 }{None}{\seep{SetMouseShape}}
 
-\input {mouseex/mouse8.tex}
+\latex{\inputlisting{mouseex/mouse8.pp}}
+\html{\input{mouseex/mouse8.tex}}
 
 
 
@@ -173,7 +177,8 @@ only the lower 16 bits are used.
 }{None.}{\seep{ShowMouse}, \seep{HideMouse}}
 
 
-\input{mouseex/mouse1.tex}
+\latex{nputlisting{mouseex/mouse1.pp}}
+\html{\input{mouseex/mouse1.tex}}
 
 \procedure{SetMousePos}{(x,y:Longint)}{
 \var{SetMosusePos} sets the position of the mouse cursor on the screen.
@@ -184,7 +189,8 @@ While \var{x} and \var{y} are longints, only the lower 16 bits are used.
 }{None.}{\seep{GetMouseState}}
 
 
-\input {mouseex/mouse4.tex}
+\latex{\inputlisting{mouseex/mouse4.pp}}
+\html{\input{mouseex/mouse4.tex}}
 
 \procedure{SetMouseShape}{(ForeColor,BackColor,Ascii: Byte)}{
 \var{SetMouseShape}
@@ -196,7 +202,8 @@ screen are XOR'ed with resp. \var{ForeColor}, \var{BackColor} and
 }{None.}{\seep{SetMouseAscii}}
 
 
-\input {mouseex/mouse7.tex}
+\latex{\inputlisting{mouseex/mouse7.pp}}
+\html{\input{mouseex/mouse7.tex}}
 
 \procedure{SetMouseSpeed}{(Horizontal, Vertical: Longint)}{
 \var{SetMouseSpeed} sets the mouse speed in mickeys per 8 pixels.
@@ -210,7 +217,8 @@ While this procedure accepts longint parameters, only the low 16 bits are
 actually used.
 }{None.}{}
 
-\input {mouseex/mouse10.tex}
+\latex{\inputlisting{mouseex/mouse10.pp}}
+\html{\input{mouseex/mouse10.tex}}
 
 \procedure{SetMouseWindow}{(xmin,ymin,xmax,ymax: Longint)}{
 
@@ -237,7 +245,8 @@ While \var{Min} and \var{Max} are Longint parameters, only the lower 16 bits
 are used.
 }{None.}{\seep{SetMouseYRange}, \seep{SetMouseWindow}}
 
-\input {mouseex/mouse6.tex}
+\latex{\inputlisting{mouseex/mouse6.pp}}
+\html{\input{mouseex/mouse6.tex}}
 
 \procedure{SetMouseYRange}{(Min, Max: Longint)}{
 \var{SetMouseYRange}
@@ -256,5 +265,6 @@ For an example, see \seep{SetMouseXRange}.
 At the start of your progam, the mouse is invisible.
 }{None.}{\seep{HideMouse},\seep{SetMouseHideWindow}}
 
-\input{mouseex/mouse2.tex}
+\latex{\inputlisting{mouseex/mouse2.pp}}
+\html{\input{mouseex/mouse2.tex}}
 

+ 2 - 2
docs/onechap.tex

@@ -28,9 +28,9 @@
 %\input{crt.tex}
 %\input{dos.tex}
 %\input{getopts.tex}
-%\input{go32.tex}
+\input{go32.tex}
 %\input{graph.tex}
-\input{linux.tex}
+%\input{linux.tex}
 %\input{mmx.tex}
 %\input{mouse.tex}
 %\input{printer.tex}

+ 2 - 1
docs/printer.tex

@@ -59,4 +59,5 @@ You can change this behaviour at compile time, setting the DefFile constant.
 { Errors are reported in Linuxerror.}
 {\seem{lpr}{1}}
 
-\input{printex/printex.tex}
+\latex{\inputlisting{printex/printex.pp}}
+\html{\input{printex/printex.tex}}

+ 160 - 79
docs/ref.tex

@@ -26,6 +26,8 @@
 \usepackage{makeidx}
 \usepackage{html}
 \latex{\usepackage{fpc}}
+\latex{\usepackage{listings}\blankstringtrue%
+\selectlisting{tp}\stringstyle{\ttfamily}}
 \html{\input{fpc-html.tex}}
 \usepackage{fancyheadings}
 \pagestyle{fancy}
@@ -1878,7 +1880,8 @@ type.}
 {None.}
 {\seef{Round}}
 
-\input{refex/ex1.tex}
+\latex{\inputlisting{refex/ex1.pp}}
+\html{\input{refex/ex1.tex}}
 
 \function{Addr}{(X : Any type)}{Pointer}
 {\var{Addr} returns a pointer to its argument, which can be any type, or a
@@ -1888,7 +1891,8 @@ typed pointer (\progref). }
 {None}
 {\seef{SizeOf}}
 
-\input{refex/ex2.tex}
+\latex{\inputlisting{refex/ex2.pp}}
+\html{\input{refex/ex2.tex}}
 
 \procedure{Append}{(Var F : Text)}
 {\var{Append} opens an existing file in append mode. Any data written to
@@ -1902,13 +1906,15 @@ Only text files can be opened in append mode.
 {If the file can't be created, a run-time error will be generated.}
 {\seep{Rewrite},\seep{Append}, \seep{Reset}}
 
-\input{refex/ex3.tex}
+\latex{\inputlisting{refex/ex3.pp}}
+\html{\input{refex/ex3.tex}}
 
 \function{Arctan}{(X : Real)}{Real}
 {\var{Arctan} returns the Arctangent of \var{X}, which can be any real type.
 The resulting angle is in radial units.}{None}{\seef{Sin}, \seef{Cos}}
 
-\input{refex/ex4.tex}
+\latex{\inputlisting{refex/ex4.pp}}
+\html{\input{refex/ex4.tex}}
 
 \procedure{Assign}{(Var F; Name : String)}
 {\var{Assign} assigns a name to \var{F}, which can be any file type.
@@ -1917,7 +1923,8 @@ and marks the file as closed.}
 {None.}
 {\seep{Reset}, \seep{Rewrite}, \seep{Append}}
 
-\input{refex/ex5.tex}
+\latex{\inputlisting{refex/ex5.pp}}
+\html{\input{refex/ex5.tex}}
 
 \procedure{Blockread}{(Var F : File; Var Buffer; Var Count : Longint [; var
 Result : Longint])}
@@ -1933,7 +1940,8 @@ read, a run-time error is generated. This behavior can be controlled by the
 than \var{count} records were read.}
 {\seep{Blockwrite},\seep{Reset}, \seep{Assign}}
 
-\input{refex/ex6.tex}
+\latex{\inputlisting{refex/ex6.pp}}
+\html{\input{refex/ex6.tex}}
 
 \procedure{Blockwrite}{(Var F : File; Var Buffer; Var Count : Longint)}
 {\var{Blockread} writes \var{count} records from \var{buffer} to the file
@@ -1952,14 +1960,16 @@ For the example, see \seep{Blockread}.
 {If the directory \var{S} doesn't exist, a run-time error is generated.}
 {\seep{Mkdir}, \seep{Rmdir}}
 
-\input{refex/ex7.tex}
+\latex{\inputlisting{refex/ex7.pp}}
+\html{\input{refex/ex7.tex}}
 
 \function{Chr}{(X : byte)}{Char}
 {\var{Chr} returns the character which has ASCII value \var{X}.}
 {None.}
 {\seef{Ord},\seep{Str}}
 
-\input{refex/ex8.tex}
+\latex{\inputlisting{refex/ex8.pp}}
+\html{\input{refex/ex8.tex}}
 
 \procedure{Close}{(Var F : Anyfiletype)}
 {\var{Close} flushes the buffer of the file \var{F} and closes \var{F}.
@@ -1970,7 +1980,8 @@ To reopen a file closed with \var{Close}, it isn't necessary to assign the
 file again. A call to \seep{Reset} or \seep{Rewrite} is sufficient.}
 {None.}{\seep{Assign}, \seep{Reset}, \seep{Rewrite}}
 
-\input{refex/ex9.tex}
+\latex{\inputlisting{refex/ex9.pp}}
+\html{\input{refex/ex9.tex}}
 
 \function{Concat}{(S1,S2 [,S3, ... ,Sn])}{String}
 {\var{Concat} concatenates the strings \var{S1},\var{S2} etc. to one long
@@ -1980,7 +1991,8 @@ The same operation can be performed with the \var{+} operation.}
 {None.}
 {\seef{Copy}, \seep{Delete}, \seep{Insert}, \seef{Pos}, \seef{Length}}
 
-\input{refex/ex10.tex}
+\latex{\inputlisting{refex/ex10.pp}}
+\html{\input{refex/ex10.tex}}
 
 \function{Copy}{(Const S : String;Index : Integer;Count : Byte)}{String}
 {\var{Copy} returns a string which is a copy if the \var{Count} characters
@@ -1992,14 +2004,16 @@ empty string is returned.}
 {None.}
 {\seep{Delete}, \seep{Insert}, \seef{Pos}}
 
-\input{refex/ex11.tex}
+\latex{\inputlisting{refex/ex11.pp}}
+\html{\input{refex/ex11.tex}}
 
 \function{Cos}{(X : real)}{Real}
 {\var{Cos} returns the cosine of \var{X}, where X is an angle, in radians.}
 {None.}
 {\seef{Arctan}, \seef{Sin}}
 
-\input{refex/ex12.tex}
+\latex{\inputlisting{refex/ex12.pp}}
+\html{\input{refex/ex12.tex}}
 
 \Function{CSeg}{Word}
 {\var{CSeg} returns the Code segment register. In \fpc, it returns always a
@@ -2007,7 +2021,8 @@ zero, since \fpc is a 32 bit compiler.}
 {None.}
 {\seef{DSeg}, \seef{Seg}, \seef{Ofs}, \seef{Ptr}}
 
-\input{refex/ex13.tex}
+\latex{\inputlisting{refex/ex13.pp}}
+\html{\input{refex/ex13.tex}}
 
 \procedure{Dec}{(Var X : Any ordinal type[; Decrement : Longint])}
 {\var{Dec} decreases the value of \var{X} with \var{Decrement}.
@@ -2016,7 +2031,8 @@ If \var{Decrement} isn't specified, then 1 is taken as a default.}
 below its minimum value.}
 {\seep{Inc}}
 
-\input{refex/ex14.tex}
+\latex{\inputlisting{refex/ex14.pp}}
+\html{\input{refex/ex14.tex}}
 
 \procedure{Delete}{(var S : string;Index : Integer;Count : Integer)}
 {\var{Delete} removes \var{Count} characters from string \var{S}, starting
@@ -2026,7 +2042,8 @@ positions to the left, and the length of the string is adjusted.
 {None.}
 {\seef{Copy},\seef{Pos},\seep{Insert}}
 
-\input{refex/ex15.tex}
+\latex{\inputlisting{refex/ex15.pp}}
+\html{\input{refex/ex15.tex}}
 
 \procedure{Dispose}{(P : pointer)}
 {\var{Dispose} releases the memory allocated with a call to \seep{New}.
@@ -2036,7 +2053,8 @@ heap.}
 heap.}
 {\seep{New}, \seep{Getmem}, \seep{Freemem}}
 
-\input{refex/ex16.tex}
+\latex{\inputlisting{refex/ex16.pp}}
+\html{\input{refex/ex16.tex}}
 
 \Function{DSeg}{Word}
 {\var{DSeg} returns the data segment register. In \fpc, it returns always a
@@ -2044,7 +2062,8 @@ zero, since \fpc is a 32 bit compiler.}
 {None.}
 {\seef{CSeg}, \seef{Seg}, \seef{Ofs}, \seef{Ptr}}
 
-\input{refex/ex17.tex}
+\latex{\inputlisting{refex/ex17.pp}}
+\html{\input{refex/ex17.tex}}
 
 \function{Eof}{[(F : Any file type)]}{Boolean}
 {\var{Eof} returns \var{True} if the file-pointer has reached the end of the
@@ -2055,7 +2074,8 @@ If no file \var{F} is specified, standard input is assumed.}
 {None.}
 {\seef{Eoln}, \seep{Assign}, \seep{Reset}, \seep{Rewrite}}
 
-\input{refex/ex18.tex}
+\latex{\inputlisting{refex/ex18.pp}}
+\html{\input{refex/ex18.tex}}
 
 \function{Eoln}{[(F : Text)]}{Boolean}
 {\var{Eof} returns \var{True} if the file pointer has reached the end of a
@@ -2068,7 +2088,8 @@ It can only be used on files of type \var{Text}.}
 {None.}
 {\seef{Eof}, \seep{Assign}, \seep{Reset}, \seep{Rewrite}}
 
-\input{refex/ex19.tex}
+\latex{\inputlisting{refex/ex19.pp}}
+\html{\input{refex/ex19.tex}}
 
 \procedure{Erase}{(Var F : Any file type)}
 {\var{Erase} removes an unopened file from disk. The file should be
@@ -2076,7 +2097,8 @@ assigned with \var{Assign}, but not opened with \var{Reset} or \var{Rewrite}}
 {A run-time error will be generated if the specified file doesn't exist.}
 {\seep{Assign}}
 
-\input{refex/ex20.tex}
+\latex{\inputlisting{refex/ex20.pp}}
+\html{\input{refex/ex20.tex}}
 
 \procedure{Exit}{([Var X : return type )]}
 {\var{Exit} exits the current subroutine, and returns control to the calling
@@ -2088,14 +2110,16 @@ equal to \var{X}.}
 {None.}
 {\seep{Halt}}
 
-\input{refex/ex21.tex}
+\latex{\inputlisting{refex/ex21.pp}}
+\html{\input{refex/ex21.tex}}
 
 \function{Exp}{(Var X : real)}{Real}
 {\var{Exp} returns the exponent of \var{X}, i.e. the number \var{e} to the
 power \var{X}.}
 {None.}{\seef{Ln}, \seef{Power}}
 
-\input{refex/ex22.tex}
+\latex{\inputlisting{refex/ex22.pp}}
+\html{\input{refex/ex22.tex}}
 
 \function{Filepos}{(Var F : Any file type)}{Longint}
 {\var{Filepos} returns the current record position of the file-pointer in file
@@ -2103,7 +2127,8 @@ power \var{X}.}
 {None.}
 {\seef{Filesize}}
 
-\input{refex/ex23.tex}
+\latex{\inputlisting{refex/ex23.pp}}
+\html{\input{refex/ex23.tex}}
 
 \function{Filesize}{(Var F : Any file type)}{Longint}
 {\var{Filepos} returns the total number of records in file \var{F}. 
@@ -2115,7 +2140,8 @@ If \var{F} is empty, 0 is returned.
 {None.}
 {\seef{Filepos}}
 
-\input{refex/ex24.tex}
+\latex{\inputlisting{refex/ex24.pp}}
+\html{\input{refex/ex24.tex}}
 
 \procedure{Fillchar}{(Var X;Count : Longint;Value : char or byte);}
 {\var{Fillchar} fills the memory starting at \var{X} with \var{Count} bytes
@@ -2124,7 +2150,8 @@ or characters with value equal to \var{Value}.
 {No checking on the size of \var{X} is done.}
 {\seep{Fillword}, \seep{Move}}
 
-\input{refex/ex25.tex}
+\latex{\inputlisting{refex/ex25.pp}}
+\html{\input{refex/ex25.tex}}
 
 \procedure{Fillword}{(Var X;Count : Longint;Value : Word);}
 {\var{Fillword} fills the memory starting at \var{X} with \var{Count} words
@@ -2133,7 +2160,8 @@ with value equal to \var{Value}.
 {No checking on the size of \var{X} is done.}
 {\seep{Fillword}, \seep{Move}}
 
-\input{refex/ex76.tex}
+\latex{\inputlisting{refex/ex76.pp}}
+\html{\input{refex/ex76.tex}}
 
 \procedure{Flush}{(Var F : Text)}
 {\var{Flush} empties the internal buffer of file \var{F} and writes the
@@ -2141,14 +2169,16 @@ contents to disk. The file is \textit{not} closed as a result of this call.}
 {If the disk is full, a run-time error will be generated.}
 {\seep{Close}}
 
-\input{refex/ex26.tex}
+\latex{\inputlisting{refex/ex26.pp}}
+\html{\input{refex/ex26.tex}}
 
 \function{Frac}{(X : real)}{Real}
 {\var{Frac} returns the non-integer part of \var{X}.}
 {None.}
 {\seef{Round}, \seef{Int}}
 
-\input{refex/ex27.tex}
+\latex{\inputlisting{refex/ex27.pp}}
+\html{\input{refex/ex27.tex}}
 
 \procedure{Freemem}{(Var P : pointer; Count : longint)}
 {\var{Freemem} releases the memory occupied by the pointer \var{P}, of size
@@ -2157,7 +2187,8 @@ allocated to a dynamical variable.}
 {An error will occur when \var{P} doesn't point to the heap.}
 {\seep{Getmem}, \seep{New}, \seep{Dispose}}
 
-\input{refex/ex28.tex}
+\latex{\inputlisting{refex/ex28.pp}}
+\html{\input{refex/ex28.tex}}
 
 \procedure{Getdir}{(drivenr : byte;var dir : string)}
 {\var{Getdir} returns in \var{dir} the current directory on the drive
@@ -2168,7 +2199,8 @@ On \linux, \var{drivenr} is ignored, as there is only one directory tree.}
 {An error is returned under \dos, if the drive requested isn't ready.}
 {\seep{Chdir}}
 
-\input{refex/ex29.tex}
+\latex{\inputlisting{refex/ex29.pp}}
+\html{\input{refex/ex29.tex}}
 
 \procedure{Getmem}{(var p : pointer;size : longint)}
 {\var{Getmem} reserves \var{Size} bytes memory on the heap, and returns a
@@ -2186,7 +2218,8 @@ omitted, zero is returned.}
 {None.}
 {\seep{Exit}}
 
-\input{refex/ex30.tex}
+\latex{\inputlisting{refex/ex30.pp}}
+\html{\input{refex/ex30.tex}}
 
 \function{Hi}{(X : Ordinal type)}{Word or byte}
 {\var{Hi} returns the high byte or word from \var{X}, depending on the size
@@ -2196,7 +2229,8 @@ of X. If the size of X is 4, then the high word is returned. If the size is
 {None}
 {\seef{Lo}}
 
-\input{refex/ex31.tex}
+\latex{\inputlisting{refex/ex31.pp}}
+\html{\input{refex/ex31.tex}}
 
 \procedure{Inc}{(Var X : Any ordinal type[; Increment : Longint])}
 {\var{Inc} increases the value of \var{X} with \var{Increment}.
@@ -2205,7 +2239,8 @@ If \var{Increment} isn't specified, then 1 is taken as a default.}
 over its maximum value.}
 {\seep{Dec}}
 
-\input{refex/ex32.tex}
+\latex{\inputlisting{refex/ex32.pp}}
+\html{\input{refex/ex32.tex}}
 
 \procedure{Insert}{(Var Source : String;var S : String;Index : integer)}
 {\var{Insert} inserts string \var{S} in string \var{Source}, at position
@@ -2214,14 +2249,16 @@ resulting string is truncated at 255 characters, if needed.}
 {None.}
 {\seep{Delete}, \seef{Copy}, \seef{Pos}}
 
-\input{refex/ex33.tex}
+\latex{\inputlisting{refex/ex33.pp}}
+\html{\input{refex/ex33.tex}}
 
 \function{Int}{(X : real)}{Real}
 {\var{Int} returns the integer part of any real \var{X}, as a real.}
 {None.}
 {\seef{Frac}, \seef{Round}}
 
-\input{refex/ex34.tex}
+\latex{\inputlisting{refex/ex34.pp}}
+\html{\input{refex/ex34.tex}}
 
 \Function{IOresult}{Word}
 {IOresult contains the result of any input/output call, when the
@@ -2278,7 +2315,8 @@ Fatal errors :
 {None.}
 {All I/O functions.}
 
-\input{refex/ex35.tex}
+\latex{\inputlisting{refex/ex35.pp}}
+\html{\input{refex/ex35.tex}}
 
 \function{Length}{(S : String)}{Byte}
 {\var{Length} returns the length of the string \var{S},
@@ -2289,7 +2327,8 @@ which is limited to 255. If the strings \var{S} is empty, 0 is returned.
 {None.}
 {\seef{Pos}}
 
-\input{refex/ex36.tex}
+\latex{\inputlisting{refex/ex36.pp}}
+\html{\input{refex/ex36.tex}}
 
 \function{Ln}{(X : real)}{Real}
 {
@@ -2299,7 +2338,8 @@ which is limited to 255. If the strings \var{S} is empty, 0 is returned.
 {An run-time error will occur when \var{X} is negative.}
 {\seef{Exp}, \seef{Power}}
 
-\input{refex/ex37.tex}
+\latex{\inputlisting{refex/ex37.pp}}
+\html{\input{refex/ex37.tex}}
 
 \function{Lo}{(O : Word or Longint)}{Byte or Word}
 {\var{Lo} returns the low byte of its argument if this is of type
@@ -2309,7 +2349,8 @@ which is limited to 255. If the strings \var{S} is empty, 0 is returned.
 {None.}
 {\seef{Ord}, \seef{Chr}}
 
-\input{refex/ex38.tex}
+\latex{\inputlisting{refex/ex38.pp}}
+\html{\input{refex/ex38.tex}}
 
 \procedure{LongJmp}{(Var env : Jmp\_Buf; Value : longint)}
 {
@@ -2335,14 +2376,16 @@ argument.}
 {None.}
 {\seef{Upcase}}
 
-\input{refex/ex73.tex}
+\latex{\inputlisting{refex/ex73.pp}}
+\html{\input{refex/ex73.tex}}
 
 \procedure{Mark}{(Var P : Pointer)}
 {\var{Mark} copies the current heap-pointer to \var{P}.}
 {None.}
 {\seep{Getmem}, \seep{Freemem}, \seep{New}, \seep{Dispose}, \seef{Maxavail}}
 
-\input{refex/ex39.tex}
+\latex{\inputlisting{refex/ex39.pp}}
+\html{\input{refex/ex39.tex}}
 
 \Function{Maxavail}{Longint}
 {\var{Maxavail} returns the size, in bytes, of the biggest free memory block in
@@ -2353,7 +2396,8 @@ available.}
 {None.}
 {\seep{Release}, \seef{Memavail},\seep{Freemem}, \seep{Getmem}}
 
-\input{refex/ex40.tex}
+\latex{\inputlisting{refex/ex40.pp}}
+\html{\input{refex/ex40.tex}}
 
 \Function{Memavail}{Longint}
 {\var{Memavail} returns the size, in bytes, of the free heap memory.
@@ -2363,7 +2407,8 @@ available.}
 {None.}
 {\seef{Maxavail},\seep{Freemem}, \seep{Getmem}}
 
-\input{refex/ex41.tex}
+\latex{\inputlisting{refex/ex41.pp}}
+\html{\input{refex/ex41.tex}}
 
 \procedure{Mkdir}{(const S : string)}
 {\var{Chdir} creates a new  directory \var{S}.}
@@ -2379,7 +2424,8 @@ the process, then a run-time error will be generated. With older versions of
 the compiler, a segmentation-fault will occur. }
 {\seep{Fillword}, \seep{Fillchar}}
 
-\input{refex/ex42.tex}
+\latex{\inputlisting{refex/ex42.pp}}
+\html{\input{refex/ex42.tex}}
 
 
 \procedure{New}{(Var P : Pointer[, Constructor])}
@@ -2400,7 +2446,8 @@ For an example, see \seep{Dispose}.
 {\seef{Abs}, \seef{Ord}}
 
 
-\input{refex/ex43.tex}
+\latex{\inputlisting{refex/ex43.pp}}
+\html{\input{refex/ex43.tex}}
 
 \function{Ofs}{Var X}{Longint}
 {\var{Ofs} returns the offset of the address of a variable. 
@@ -2413,7 +2460,8 @@ compiler.
 {\seef{DSeg}, \seef{CSeg}, \seef{Seg}, \seef{Ptr}}
 
 
-\input{refex/ex44.tex}
+\latex{\inputlisting{refex/ex44.pp}}
+\html{\input{refex/ex44.tex}}
 
 
 \function{Ord}{(X : Ordinal type)}{Byte}
@@ -2422,7 +2470,8 @@ compiler.
 {\seef{Chr}}
 
 
-\input{refex/ex45.tex}
+\latex{\inputlisting{refex/ex45.pp}}
+\html{\input{refex/ex45.tex}}
 
 \Function{Paramcount}{Longint}
 {\var{Paramcount} returns the number of command-line arguments. If no
@@ -2432,7 +2481,8 @@ arguments were given to the running program, \var{0} is returned.
 {\seef{Paramstr}}
 
 
-\input{refex/ex46.tex}
+\latex{\inputlisting{refex/ex46.pp}}
+\html{\input{refex/ex46.tex}}
 
 \function{Paramstr}{(L : Longint)}{String}
 {\var{Paramstr} returns the \var{L}-th command-line argument. \var{L} must
@@ -2453,7 +2503,8 @@ For an example, see \seef{Paramcount}.
 {\seef{Cos}, \seef{Sin}}
 
 
-\input{refex/ex47.tex}
+\latex{\inputlisting{refex/ex47.pp}}
+\html{\input{refex/ex47.tex}}
 
 \function{Pos}{(Const Substr : String;Const S : String)}{Byte}
 {\var{Pos} returns the index of \var{Substr} in \var{S}, if \var{S} contains
@@ -2465,7 +2516,8 @@ The search is case-sensitive.
 {\seef{Length}, \seef{Copy}, \seep{Delete}, \seep{Insert}}
 
 
-\input{refex/ex48.tex}
+\latex{\inputlisting{refex/ex48.pp}}
+\html{\input{refex/ex48.tex}}
 
 \function{Power}{(base,expon : Real)}{Real}
 {
@@ -2476,7 +2528,8 @@ result will also be a longint.
 The function actually returns \var{Exp(expon*Ln(base))}
 }{None.}{\seef{Exp}, \seef{Ln}}
 
-\input{refex/ex78.tex}
+\latex{\inputlisting{refex/ex78.pp}}
+\html{\input{refex/ex78.tex}}
 
 \function{Ptr}{(Sel,Off : Longint)}{Pointer}
 {
@@ -2494,7 +2547,8 @@ following : \var{ptr:=pointer(\$e0000000+sel shl 4+off)} under \dos, or
 {None.}
 {\seef{Addr}}
 
-\input{refex/ex59.tex}
+\latex{\inputlisting{refex/ex59.pp}}
+\html{\input{refex/ex59.tex}}
 
 \function{Random}{[(L : longint)]}{Longint or Real}
 {\var{Random} returns a random number larger or equal to \var{0} and
@@ -2506,7 +2560,8 @@ If the argument \var{L} is omitted, a real number between 0 and 1 is returned.
 {\seep{Randomize}}
 
 
-\input{refex/ex49.tex}
+\latex{\inputlisting{refex/ex49.pp}}
+\html{\input{refex/ex49.tex}}
 
 \Procedure{Randomize}
 {\var{Randomize} initializes the random number generator of \fpc, by giving
@@ -2533,7 +2588,8 @@ be controlled with the \var{\{\$i\}} compiler switch.}
 {\seep{Readln}, \seep{Blockread}, \seep{Write}, \seep{Blockwrite}}
 
 
-\input{refex/ex50.tex}
+\latex{\inputlisting{refex/ex50.pp}}
+\html{\input{refex/ex50.tex}}
 
 \procedure{Readln}{[Var F : Text], V1 [, V2, ... , Vn])}
 {\var{Read} reads one or more values from a file \var{F}, and stores the
@@ -2568,7 +2624,8 @@ must be assigned, but not opened.}
 or doesn't exist.}
 {\seep{Erase}}
 
-\input{refex/ex77.tex}
+\latex{\inputlisting{refex/ex77.pp}}
+\html{\input{refex/ex77.tex}}
 
 \procedure{Reset}{(Var F : Any File Type[; L : longint])}
 {\var{Reset} opens a file \var{F} for reading. \var{F} can be any file type.
@@ -2580,7 +2637,8 @@ generated. This behavior can be changed by the \var{\{\$i\} } compiler switch.}
 {\seep{Rewrite}, \seep{Assign}, \seep{Close}}
 
 
-\input{refex/ex51.tex}
+\latex{\inputlisting{refex/ex51.pp}}
+\html{\input{refex/ex51.tex}}
 
 \procedure{Rewrite}{(Var F : Any File Type[; L : longint])}
 {\var{Rewrite} opens a file \var{F} for writing. \var{F} can be any file type.
@@ -2597,7 +2655,8 @@ generated. This behavior can be changed by the \var{\{\$i\} } compiler switch.}
 {\seep{Reset}, \seep{Assign}, \seep{Close}}
 
 
-\input{refex/ex52.tex}
+\latex{\inputlisting{refex/ex52.pp}}
+\html{\input{refex/ex52.tex}}
 
 \procedure{Rmdir}{(const S : string)}
 {\var{Rmdir} removes the  directory \var{S}.}
@@ -2605,7 +2664,8 @@ generated. This behavior can be changed by the \var{\{\$i\} } compiler switch.}
 }
 {\seep{Chdir}, \seep{Rmdir}}
 
-\input{refex/ex53.tex}
+\latex{\inputlisting{refex/ex53.pp}}
+\html{\input{refex/ex53.tex}}
 
 \function{Round}{(X : real)}{Longint}
 {\var{Round} rounds \var{X} to the closest integer, which may be bigger or
@@ -2613,7 +2673,8 @@ smaller than \var{X}.}
 {None.}
 {\seef{Frac}, \seef{Int}, \seef{Trunc}}
 
-\input{refex/ex54.tex}
+\latex{\inputlisting{refex/ex54.pp}}
+\html{\input{refex/ex54.tex}}
 
 \procedure{Runerror}{(ErrorCode : Word)}
 {\var{Runerror} stops the execution of the program, and generates a
@@ -2621,7 +2682,8 @@ run-time error \var{ErrorCode}.}
 {None.}
 {\seep{Exit}, \seep{Halt}}
 
-\input{refex/ex55.tex}
+\latex{\inputlisting{refex/ex55.pp}}
+\html{\input{refex/ex55.tex}}
 
 \procedure{Seek}{(Var F; Count : Longint)}
 {\var{Seek} sets the file-pointer for file \var{F} to record Nr. \var{Count}.
@@ -2632,7 +2694,8 @@ is assumed.}
 the file, or the file isn't opened.}
 {\seef{Eof}, \seef{SeekEof}, \seef{SeekEoln}}
 
-\input{refex/ex56.tex}
+\latex{\inputlisting{refex/ex56.pp}}
+\html{\input{refex/ex56.tex}}
 
 \function{SeekEof}{[(Var F : text)]}{Boolean}
 {\var{SeekEof} returns \var{True} is the file-pointer is at the end of the
@@ -2649,7 +2712,8 @@ If the parameter \var{F} is omitted, standard \var{Input} is assumed.
 {A run-time error is generated if the file \var{F} isn't opened.}
 {\seef{Eof}, \seef{SeekEoln}, \seep{Seek}}
 
-\input{refex/ex57.tex}
+\latex{\inputlisting{refex/ex57.pp}}
+\html{\input{refex/ex57.tex}}
 
 \function{SeekEoln}{[(Var F : text)]}{Boolean}
 {\var{SeekEoln} returns \var{True} is the file-pointer is at the end of the
@@ -2667,7 +2731,8 @@ If the parameter \var{F} is omitted, standard \var{Input} is assumed.}
 {A run-time error is generated if the file \var{F} isn't opened.}
 {\seef{Eof}, \seef{SeekEof}, \seep{Seek}}
 
-\input{refex/ex58.tex}
+\latex{\inputlisting{refex/ex58.pp}}
+\html{\input{refex/ex58.tex}}
 
 \function{Seg}{Var X}{Longint}
 {\var{Seg} returns the segment of the address of a variable. 
@@ -2678,7 +2743,8 @@ returns always 0, since \fpc is a 32 bit compiler, segments have no meaning.
 {None.}
 {\seef{DSeg}, \seef{CSeg}, \seef{Ofs}, \seef{Ptr}}
 
-\input{refex/ex60.tex}
+\latex{\inputlisting{refex/ex60.pp}}
+\html{\input{refex/ex60.tex}}
 
 \function{SetJmp}{(Var Env : Jmp\_Buf)}{longint}
 {
@@ -2689,7 +2755,8 @@ If the function returns nonzero, then it means that a call to \seep{LongJmp}
 with \var{env} as an argument was made somewhere in the program.
 }{None.}{\seep{LongJmp}}
 
-\input{refex/ex79.tex}
+\latex{\inputlisting{refex/ex79.pp}}
+\html{\input{refex/ex79.tex}}
 
 
 \procedure{SetTextBuf}{(Var f : Text; Var Buf[; Size : Word])}
@@ -2719,7 +2786,8 @@ occur.
 {No checking on \var{Size} is done.}
 {\seep{Assign}, \seep{Reset}, \seep{Rewrite}, \seep{Append}}
 
-\input{refex/ex61.tex}
+\latex{\inputlisting{refex/ex61.pp}}
+\html{\input{refex/ex61.tex}}
 
 \function{Sin}{(X : real)}{Real}
 {\var{Sin} returns the sine of its argument \var{X}, where \var{X} is an
@@ -2727,7 +2795,8 @@ angle in radians.}
 {None.}
 {\seef{Cos}, \seef{Pi}, \seef{Exp}}
 
-\input{refex/ex62.tex}
+\latex{\inputlisting{refex/ex62.pp}}
+\html{\input{refex/ex62.tex}}
 
 \function{SizeOf}{(X : Any Type)}{Longint}
 {\var{SizeOf} Returns the size, in bytes, of any variable or type-identifier.
@@ -2737,20 +2806,23 @@ compile-time, and hard-coded in your executable.}
 {None.}
 {\seef{Addr}}
 
-\input{refex/ex63.tex}
+\latex{\inputlisting{refex/ex63.pp}}
+\html{\input{refex/ex63.tex}}
 
 \Function{Sptr}{Pointer}
 {\var{Sptr} returns the current stack pointer.
 }{None.}{}
 
-\input{refex/ex64.tex}
+\latex{\inputlisting{refex/ex64.pp}}
+\html{\input{refex/ex64.tex}}
 
 \function{Sqr}{(X : Real)}{Real}
 {\var{Sqr} returns the square of its argument \var{X}.}
 {None.}
 {\seef{Sqrt}, \seef{Ln}, \seef{Exp}}
 
-\input{refex/ex65.tex}
+\latex{\inputlisting{refex/ex65.pp}}
+\html{\input{refex/ex65.tex}}
 
 \function{Sqrt}{(X : Real)}{Real}
 {\var{Sqrt} returns the square root of its argument \var{X}, which must be
@@ -2758,7 +2830,8 @@ positive.}
 {If \var{X} is negative, then a run-time error is generated.}
 {\seef{Sqr}, \seef{Ln}, \seef{Exp}}
 
-\input{refex/ex66.tex}
+\latex{\inputlisting{refex/ex66.pp}}
+\html{\input{refex/ex66.tex}}
 
 \Function{SSeg}{Longint}
 { \var{SSeg} returns the Stack Segment. This function is only 
@@ -2766,7 +2839,8 @@ positive.}
 correct contents of the stackpointer.}
 {None.}{\seef{Sptr}}
 
-\input{refex/ex67.tex}
+\latex{\inputlisting{refex/ex67.pp}}
+\html{\input{refex/ex67.tex}}
 
 
 \procedure{Str}{(Var X[:NumPlaces[:Decimals]]; Var S : String)}
@@ -2778,7 +2852,8 @@ formatting of the string.}
 {None.}
 {\seep{Val}}
 
-\input{refex/ex68.tex}
+\latex{\inputlisting{refex/ex68.pp}}
+\html{\input{refex/ex68.tex}}
 
 \function{Swap}{(X)}{Type of X}
 {\var{Swap} swaps the high and low order bytes of \var{X} if \var{X} is of
@@ -2788,7 +2863,8 @@ type \var{Word} or \var{Integer}, or swaps the high and low order words of
 The return type is the type of \var{X}}
 {None.}{\seef{Lo}, \seef{Hi}}
 
-\input{refex/ex69.tex}
+\latex{\inputlisting{refex/ex69.pp}}
+\html{\input{refex/ex69.tex}}
 
 \function{Trunc}{(X : real)}{Longint}
 {\var{Trunc} returns the integer part of \var{X}, 
@@ -2796,7 +2872,8 @@ which is always smaller than (or equal to)  \var{X}.}
 {None.}
 {\seef{Frac}, \seef{Int}, \seef{Trunc}}
 
-\input{refex/ex70.tex}
+\latex{\inputlisting{refex/ex70.pp}}
+\html{\input{refex/ex70.tex}}
 
 \procedure{Truncate}{(Var F : file)}
 {\var{Truncate} truncates the (opened) file \var{F} at the current file
@@ -2804,7 +2881,8 @@ position.
 }{Errors are reported by IOresult.}{\seep{Append}, \seef{Filepos},
 \seep{Seek}}
 
-\input{refex/ex71.tex}
+\latex{\inputlisting{refex/ex71.pp}}
+\html{\input{refex/ex71.tex}}
 
 \function{Upcase}{(C : Char or string)}{Char or String}
 {\var{Upcase} returns the uppercase version of its argument \var{C}.
@@ -2814,7 +2892,8 @@ argument.}
 {None.}
 {\seef{Lowercase}}
 
-\input{refex/ex72.tex}
+\latex{\inputlisting{refex/ex72.pp}}
+\html{\input{refex/ex72.tex}}
 
 \procedure{Val}{(const S : string;var V;var Code : word)}
 {\var{Val} converts the value represented in the string \var{S} to a numerical
@@ -2829,7 +2908,8 @@ The string \var{S} isn't allow to contain spaces.}
 position where the conversion went wrong.}
 {\seep{Str}}
 
-\input{refex/ex74.tex}
+\latex{\inputlisting{refex/ex74.pp}}
+\html{\input{refex/ex74.tex}}
 
 \procedure{Write}{([Var F : Any filetype;] V1 [; V2; ... , Vn)]}
 {\var{Write} writes the contents of the variables \var{V1}, \var{V2} etc. to
@@ -2884,7 +2964,8 @@ customary in Unix environments.
 controlled with the \var{\{\$i\}} switch. }
 {\seep{Write}, \seep{Read}, \seep{Readln}, \seep{Blockwrite}}
 
-\input{refex/ex75.tex}
+\latex{\inputlisting{refex/ex75.pp}}
+\html{\input{refex/ex75.tex}}
 
 %
 % The index.

+ 6 - 3
docs/sockets.tex

@@ -121,7 +121,8 @@ operation.
 }
 {\seef{Listen}, \seef{Connect}}
 
-\input{sockex/sock_svr.tex}
+\latex{\inputlisting{sockex/sock_svr.pp}}
+\html{\input{sockex/sock_svr.tex}}
 
 \functionl{Accept}{AltAAccept}{(Sock:longint;var addr:string;var SockIn,SockOut:text)}{Boolean}
 { This is an alternate form of the \seef{Accept} command. It is equivalent
@@ -197,7 +198,8 @@ make, but is generally one of \var{TSockAddr} or \var{TUnixSockAddr}.
 {Errors are reported in \var{SocketError}.}
 {\seef{Listen}, \seef{Bind},\seef{Accept}}
 
-\input{sockex/sock_cli.tex}
+\latex{\inputlisting{sockex/sock_cli.pp}}
+\html{\input{sockex/sock_cli.tex}}
 
 \functionl{Connect}{AltAConnect}{(Sock:longint;const addr:string;var SockIn,SockOut:text)}{Boolean}
 { This is an alternate form of the \seef{Connect} command. 
@@ -231,7 +233,8 @@ The function returns \var{True} if successfull, \var{False} otherwise.
 }{The errors are those of \seef{Connect}.}
 {\seef{Connect}}
 
-\input{sockex/pfinger.tex}
+\latex{\inputlisting{sockex/pfinger.pp}}
+\html{\input{sockex/pfinger.tex}}
 
 \function{GetPeerName}{(Sock:Longint;Var Addr;Var Addrlen:Longint)}{Longint}
 {\var{GetPeerName} returns the name of the entity connected to the 

+ 34 - 17
docs/strings.tex

@@ -43,7 +43,8 @@ Attaches \var{Source} to \var{Dest} and returns \var{Dest}.
 {No length checking is performed.}
 {\seem{Concat}{}}
 
-\input{stringex/ex11.tex}
+\latex{\inputlisting{stringex/ex11.pp}}
+\html{\input{stringex/ex11.tex}}
 
 \function{StrComp}{(S1,S2 : PChar)}{Longint}
 {
@@ -68,7 +69,8 @@ returns a pointer to \var{Dest}. \var{Dest} needs enough room to contain
 }
 {No length checking is performed.}{ \seef{StrPCopy}, \seef{StrLCopy}, \seef{StrECopy}}
 
-\input{stringex/ex4.tex}
+\latex{\inputlisting{stringex/ex4.pp}}
+\html{\input{stringex/ex4.tex}}
 
 \procedure{StrDispose}{(P : PChar)}
 {
@@ -76,7 +78,8 @@ Removes the string in \var{P} from the heap and releases the memory.
 }
 {None.}{\seem{Dispose}{}, \seef{StrNew}}
 
-\input{stringex/ex17.tex}
+\latex{\inputlisting{stringex/ex17.pp}}
+\html{\input{stringex/ex17.tex}}
 
 \function{StrECopy}{(Dest,Source : PChar)}{PChar}
 {
@@ -87,7 +90,8 @@ copied string.
 {No length checking is performed.}
 {\seef{StrLCopy}, \seef{StrCopy}}
 
-\input{stringex/ex6.tex}
+\latex{\inputlisting{stringex/ex6.pp}}
+\html{\input{stringex/ex6.tex}}
 
 \function{StrEnd}{(P : PChar)}{PChar}
 {
@@ -96,7 +100,8 @@ null-character.
 }
 {None.}{\seef{StrLen}}
 
-\input{stringex/ex7.tex}
+\latex{\inputlisting{stringex/ex7.pp}}
+\html{\input{stringex/ex7.tex}}
 
 \function{StrIComp}{(S1,S2 : PChar)}{Longint}
 {
@@ -111,7 +116,8 @@ The result is
 }
 {None.}{\seef{StrLComp}, \seef{StrComp}, \seef{StrLIComp}}
 
-\input{stringex/ex8.tex}
+\latex{\inputlisting{stringex/ex8.pp}}
+\html{\input{stringex/ex8.tex}}
 
 \function{StrLCat}{(Dest,Source : PChar; MaxLen : Longint)}{PChar}
 {
@@ -120,7 +126,8 @@ terminating null-character. Returns \var{Dest}.
 }
 {None.}{\seef{StrCat}}
 
-\input{stringex/ex12.tex}
+\latex{\inputlisting{stringex/ex12.pp}}
+\html{\input{stringex/ex12.tex}}
 
 \function{StrLComp}{(S1,S2 : PChar; L : Longint)}{Longint}
 {
@@ -136,7 +143,8 @@ The result is
 }
 {None.}{\seef{StrComp}, \seef{StrIComp}, \seef{StrLIComp}}
 
-\input{stringex/ex8.tex}
+\latex{\inputlisting{stringex/ex8.pp}}
+\html{\input{stringex/ex8.tex}}
 
 \function{StrLCopy}{(Dest,Source : PChar; MaxLen : Longint)}{PChar}
 {
@@ -146,7 +154,8 @@ Copies \var{MaxLen} characters from \var{Source} to \var{Dest}, and makes
 {No length checking is performed.}
 {\seef{StrCopy}, \seef{StrECopy}}
  
-\input{stringex/ex5.tex}
+\latex{\inputlisting{stringex/ex5.pp}}
+\html{\input{stringex/ex5.tex}}
 
 \function{StrLen}{(p : PChar)}{Longint}
 {
@@ -154,7 +163,8 @@ Returns the length of the null-terminated string \var{P}.
 }
 {None.}{\seem{Length}{}}
 
-\input{stringex/ex1.tex}
+\latex{\inputlisting{stringex/ex1.pp}}
+\html{\input{stringex/ex1.tex}}
 
 \function{StrLIComp}{(S1,S2 : PChar; L : Longint)}{Longint}
 {
@@ -178,7 +188,8 @@ Converts \var{P} to an all-lowercase string. Returns \var{P}.
 }
 {None.}{\seem{Upcase}{}, \seef{StrUpper}}
 
-\input{stringex/ex14.tex}
+\latex{\inputlisting{stringex/ex14.pp}}
+\html{\input{stringex/ex14.tex}}
 
 \function{StrMove}{(Dest,Source : PChar; MaxLen : Longint)}{PChar}
 {
@@ -188,7 +199,8 @@ Returns \var {Dest}.
 }
 {None.}{\seef{StrLCopy}, \seef{StrCopy}}
 
-\input{stringex/ex10.tex}
+\latex{\inputlisting{stringex/ex10.pp}}
+\html{\input{stringex/ex10.tex}}
 
 \function{StrNew}{(P : PChar)}{PChar}
 {
@@ -197,7 +209,8 @@ Copies \var{P} to the Heap, and returns a pointer to the copy.
 {Returns \var{Nil} if no memory was available for the copy.}
 {\seem{New}{}, \seef{StrCopy}, \seep{StrDispose}}
 
-\input{stringex/ex16.tex}
+\latex{\inputlisting{stringex/ex16.pp}}
+\html{\input{stringex/ex16.tex}}
 
 \function {StrPas}{(P : PChar)}{String}
 {
@@ -206,7 +219,8 @@ this string. The string is truncated at 255 characters.
 }
 {None.}{ \seef{StrPCopy}}
 
-\input{stringex/ex3.tex}
+\latex{\inputlisting{stringex/ex3.pp}}
+\html{\input{stringex/ex3.tex}}
 
 \function{StrPCopy}{(Dest : PChar; Const Source : String)}{PChar}
 {
@@ -216,7 +230,8 @@ the string \var{Source}, i.e. \var{Length(Source)+1} bytes.
 }
 {No length checking is performed.}{ \seef{StrPas}}
 
-\input{stringex/ex2.tex}
+\latex{\inputlisting{stringex/ex2.pp}}
+\html{\input{stringex/ex2.tex}}
 
 \function{StrPos}{(S1,S2 : PChar)}{PChar}
 {
@@ -225,7 +240,8 @@ If \var{S2} does not occur in \var{S1}, returns \var{Nil}.
 }
 {None.}{\seem{Pos}{}, \seef{StrScan}, \seef{StrRScan}}
 
-\input{stringex/ex15.tex}
+\latex{\inputlisting{stringex/ex15.pp}}
+\html{\input{stringex/ex15.tex}}
 
 \function{StrRScan}{(P : PChar; C : Char)}{PChar}
 {
@@ -245,7 +261,8 @@ null-terminated string \var{P}. If \var{C} does not occur, returns
 }
 {None.}{\seem{Pos}{}, \seef{StrRScan}, \seef{StrPos}}
 
-\input{stringex/ex13.tex}
+\latex{\inputlisting{stringex/ex13.pp}}
+\html{\input{stringex/ex13.tex}}
 
 \function{StrUpper}{(P : PChar)}{PChar}
 {

+ 2 - 0
docs/units.tex

@@ -28,6 +28,8 @@
 \usepackage{makeidx}
 \usepackage{html}
 \latex{\usepackage{fpc}}
+\latex{\usepackage{listings}\blankstringtrue%
+\selectlisting{tp}\stringstyle{\ttfamily}}
 \html{\input{fpc-html.tex}}
 \usepackage{fancyheadings}
 \pagestyle{fancy}

+ 6 - 605
docs/user.tex

@@ -2411,613 +2411,14 @@ xor
 % APPENDIX C.
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
-\chapter{Compiler error messages}
+\chapter{Compiler messages}
 \label{ch:ErrorMessages}
-This appendix is meant to list all the compiler errors. the list of compiler
-errors is fairly complete, the assembler errors are less complete.
+This appendix is meant to list all the compiler messages. The list of 
+messages is generated from he compiler source itself, and should be faitly
+complete. At this point, only assembler errors are not in the list.
 
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-% Compiler errors.
-\section{Compiler errors}
-The following is a list of general compiler errors. 
-\begin{description}
-\item [unexpected end of file]
-this typically happens in on of the following cases :
-\begin{itemize}
-\item The source file ends befor then final \var{end.} statement. This
-happens mostly when the \var{begin} and \var{end} statements aren't
-balanced;
-\item An include file ends in the middle of a statement.
-\item A comment wasn't closed.
-\end{itemize}
-\item [duplicate identifier:]
-The identifier was already declared in the current scope.
-\item [syntax error:]
-An error against the Turbo Pascal language was encountered. This happens
-typically when an illegal character is found in the sources file.
-\item [Parser - syntax error] 
-An error against the Turbo Pascal language was encountered. This happens
-typically when an illegal character is found in the sources file.
-\item [out of memory]
-The compiler doesn't have enough memory to compile your program. There are
-several remedies for this:
-\begin{itemize}
-\item If you're using the build option of the compiler, try compiling the
-different units manually.
-\item If you're compiling a huge program, split it up in units, and compile
-these separately.
-\item If the previous two don't work, recompile the compiler with a bigger
-heap (you can use the \var{-Ch} option for this, \seeo{Ch})
-\end{itemize} 
-\item [unknown identifier]
-The identifier encountered hasn't been declared, or is used outside the
-scope where it's defined.
-\item [illegal character]
-An illegal character was encountered in the input file. 
-\item [source too long]
-The compiler cannot cope with source files longer than (???)
-\item [procedure type INLINE not supported]
-You tried to compile a program with C++ style inlining, and forgot to
-specify the \var{-Si} option (\seeo{Si}). The compiler doesn't support C++
-styled inlining by default. 
-\item [procedure type NEAR ignored]
-This is a warning. \var{NEAR} is a construct for 8 or 16 bit programs. Since
-the compile generates 32 bit programs, it ignores this directive.
-\item [procedure type FAR ignored]
-This is a warning. \var{FAR} is a construct for 8 or 16 bit programs. Since
-the compile generates 32 bit programs, it ignores this directive.
-\item [INTERRUPT ignored]
-Interrupt procedures aren't possible on operating systems, other than DOS, 
-it isn't allowed to take over an interrupt at the user level. (versions
-older than 0.9.2 didn't have \var{INTERRUPT} support.
-\item [private methods shouldn't be VIRTUAL]
-You declared a method in the private part of a object (class) as
-\var{virtual}. This is not allowed. Private methods cannot be overridden
-anyway.
-\item [constructor can't be private or protected]
-Constructors must be in the 'public' part of an object (class) declaration. 
-\item [destructor can't be private or protected]
-Destructors must be in the 'public' part of an object (class) declaration. 
-\item [identifier not found]
-\item [local class definitions are not allowed]
-Classes must be defined globally.
-\item [anonym class definitions are not allowed]
-\item [type identifier expected]
-The identifier is not a type, or you forgot to supply a type identifier.
-\item [identifier already as type identifier declared]
-You are trying to redefine a type.
-\item [type identifier not defined]
-The compiler encountered an unknown type.
-\item [type mismatch]
-This can happen in many cases:
-\begin{itemize}
-\item The variable you're assigning to is of a different type than the
-expression in the assignment.
-\item You are calling a function or procedure with parameters that are 
-incompatible with the parameters in the function or procedure definition.
-\end{itemize}
-\item [statement expected]
-
-\item [illegal integer constant]
-You made an exression which isn't an integer, and the compiler expects the
-result to be an integer.
-\item [illegal expression]
-\item [expression too complicated - FPU stack overflow]
-Your expression is too long for the compiler. You should try dividing the
-construct over multiple assignments.
-\item [CONTINUE not allowed]
-You're trying to use \var{continue} outside a loop construction.
-\item [BREAK not allowed]
-You're trying to use \var{break} outside a loop construction.
-\item [illegal qualifier]
-One of the following is appending :
-\begin{itemize}
-\item You're trying to access a field of a variable that is not a record.
-\item You're indexing a variable that is not an array.
-\item You're dereferencing a variable that is not a pointer. 
-\end{itemize}
-\item [illegal counter variable]
-The type of a \var{for} loop must be ordinal.
-\item [ordinal value expected]
-The expression must be of ordinal type (i.e. maximum a Longint)
-\item [high range limit < low range limit]
-You are declaring a subrange, and the lower limit is higher than the high
-limit of the range.
-\item [illegal unit name]
-The name of the unit doesn't match the file name.
-\item [unknown format of unit file]
-The unit the compiler is trying to read is corrupted, or generated with a
-newer version of the compiler.
-\item [Reading PPU-File]
-The unit the compiler is trying to read is corrupted, or generated with a
-newer version of the compiler.
-\item [Invalid PPU-File entry]
-The unit the compiler is trying to read is corrupted, or generated with a
-newer version of the compiler.
-\item [circular unit use]
-Two units are using each other in the interface part. This is only allowed
-in the implementation part.
-\item [too many units]
-\fpc has a limit of 1024 units in a program. You can change this behavior
-by changing the \var{maxunits} constant in the \file{files.pas} file of the
-compiler, and recompiling the compiler. 
-\item [illegal char constant]
-The compiler expects a character constant, but finds something else.
-\item [overloaded identifier isn't a function identifier]
-The compiler encountered a symbol with the same name a s an overloaded
-function, but it isn't a function it can overload.
-\item [overloaded functions have the same parameter list]
-You're declaring overloaded functions, but with the same parameter list.
-Overloaded function must have at least 1 different parameter in their
-declaration.
-\item [illegal parameter list]
-You are calling a function with parameters that are of a different type than
-the declared parameters of the function.
-\item [can't determine which overloaded function to call]
-You're calling overloaded functions with a parameter that doesn't correspond
-to any of the declared function parameter lists. e.g. when you have declared
-a function with parameters \var{word} and \var{longint}, and then you call
-it with a parameter which is of type \var{integer}.
-\item [forward declaration not solved:]
-This can happen in two cases:
-\begin{itemize}
-\item This happens when you declare a function (in the \var{interface} part, or
-with a \var{forward} directive, but do not implement it.
-\item You reference a type which isn't declared in the current \var{type}
-block.
-\end{itemize}
-\item [input file not found]
-\fpc cannot find the program or unit source file, or the included file isn't
-found.
-\item [function header doesn't match the forward declaration]
-You declared the function in the \var{interface} part, or with the
-\var{forward} directive, but define it with a different parameter list. 
-\item [unknown field identifier]
-The field doesn't exist in the record definition.
-\item [parameter list size exceeds 65535 bytes]
-The I386 processor limits the parameter list to 65535 bytes (the \var{RET}
-instruction causes this)
-\item [function nesting > 31]
-You can nest function definitions only 31 times. 
-\item [illegal compiler switch]
-You included a compiler switch (i.e. \var{\{\$... \}}) which the compiler
-doesn't know.
-\item [can't open include file]
-You want to include (i.e \var{\{\$i file\}}) which the compiler doesn't
-find. Check if the filename is correct.
-\item [record or class type expected]
-The variable or expression isn't of the type \var{record} or \var{class}.
-\item [only values can be jumped over in enumeration types]
-\fpc allows enumeration constructions as in C. Given the following
-declaration two declarations:
-\begin{verbatim}
-type a = (A_A,A_B,A_E=:6,A_UAS:=200);
-type a = (A_A,A_B,A_E=:6,A_UAS:=4);
-\end{verbatim}
-The second declaration would produce an error. \var{A\_UAS} needs to have a
-value higher than \var{A\_E}, i.e. at least 7.
-\item [pointer type expected]
-The variable or expression isn't of the type \var{pointer}.
-\item [unit is compiled for another operating system]
-The unit was compiled with a different target than the target for which
-you're compiling now. (see the option \var{-T} \seeo{T}).
-\item [typed constants of classes are not allowed]
-You cannot declare a constant of type class or object.
-\item [duplicate case label]
-You are specifying the same label 2 times in a \var{case} statement.
-\item [range check error while evaluating constants]
-The constants are out of their allowed range.
-\item [illegal type conversion]
-When doing a type-cast, you must take care that the sizes of the variable and
-the destination type are the same. 
-\item [class type expected]
-The variable of expression isn't of the type \var{class}.
-\item [functions variables of overloaded functions are not allowed]
-You are trying to assign an overloaded function to a procedural variable.
-This isn't allowed.
-\item [can't create assembler file]
-The assembler output file cannot be opened. This can have many causes, but
-'disk full' is a reasonable guess.
-\item [string length must be a value from 1 to 255]
-The length of a string in Pascal is limited to 255 characters. You are
-trying to declare a string with length greater than 255.
-\item [class identifier expected]
-The variable isn't of type \var{class}.
-\item [method identifier expected]
-This identifier is not a method.
-\item [function header doesn't match any method of this class]
-You are defining a function as a class method, but no such function was
-declared in the class.
-\item [use extended syntax of DISPOSE and NEW to generate instances of classes]
-If you have a pointer \var{a} to a class type, then the statement
-\var{new(a)} will not initialize the class (i.e. the constructor isn't
-called), although space will be allocated. you should issue the
-\var{new(a,init)} statement. This will allocate space, and call the
-constructor of the class.
-\item [file types must be var parameters]
-You cannot specify files as value parameters, i.e. they must always be
-declared \var{var} parameters.
-\item [string exceeds line]
-You forgot probably to include the closing ' in a string, so it occupies
-multiple lines. 
-\item [illegal version of the unit:]
-This unit was compiled with an earlier version of \fpc.
-\item [illegal floating point constant]
-\item [destructors can't have parameters]
-You are declaring a destructor with a parameter list. Destructor methods
-cannot have parameters.
-\item [FAIL can be used in constructors only]
-You are using the \var{FAIl} instruction outside a constructor method.
-\item [records fields can be aligned to 1,2 or 4 bytes only]
-You are specifying the \var{\{\$PACKRECORDS n\} } with an illegal value for
-\var{n}. Only 1,2 or 4 are valid in this case.
-\item [too many \$ENDIFs or \$ELSEs]
-Your \var{\{\$IFDEF ..\}} and {\{\$ENDIF\}} statements aren't balanced.
-\item [\$ENDIF expected]
-Your \var{\{\$IFDEF ..\}} and {\{\$ENDIF\}} statements aren't balanced.
-\item [illegal call by reference parameters]
-\item [can't generate DEF file]
-\ostwo only. The DEF file cannot be generated.
-\item [all overloaded methods must be virtual if one is virtual:]
-If you declare overloaded methods in a class, then they should either all be
-virtual, or none. You cannot mix them.
-\item [overloaded methods which are virtual must have the same return type:]
-If you declare virtual overloaded methods in a class definition, they must
-have the same return type.
-\item [all overloaded virtual methods must support exceptions if one support exceptions:]
-If you declare overloaded virtual methods in a class, then they should either 
-all support exceptions, or none. You cannot mix them.
-\item [EXPORT declared functions can't be called]
-You are trying to call a procedure you declared as \var{export}. Due to the
-different calling scheme of \fpc and C, you cannot call such a function from
-within your Pascal program. 
-\item [EXPORT declared functions can't be nested]
-You cannot declare a function or procedure within a function or procedure
-that was declared as an export procedure.
-\item [methods can't be EXPORTed]
-You cannot declare a procedure that is a method for an object as
-\var{export}ed. That is, you methods cannot be called from a C program.
-\item [SELF is only allowed in methods]
-You are trying to use the \var{self} parameter outside an object's method.
-Only methods get passed the \var{self} parameters.
-\item [call by var parameters have to match exactly]
-When calling a function declared with \var{var} parameters, the variables in
-the function call must be of exactly the same type. There is no automatic
-type conversion. 
-\item [class identifier expected]
-The variable isn't of type \var{class}.
-\item [class isn't a super class of the current class]
-When calling inherited methods, you are trying to call a method of a strange
-class. You can only call an inherited method of a parent class.
-\item [methods can be only in other methods called direct with type identifier of the class]
-A construction like \var{sometype.somemethod} is only allowed in a method.
-\item [illegal type: pointer to class expected]
-You specified an illegal type.
-\item [possible illegal call of constructor or destructor (doesn't match to this context)]
-\item [class should have one destructor only]
-You can declare only one destructor for a class.
-\item [expression must be constructor call]
-When using the extended syntax of \var{new}, you must specify the constructor
-method of the class you are trying to create. The procedure you specified
-is not a constructor.
-\item [identifier idents no member]
-When using the extended syntax of \var{new}, you must specify the constructor
-method of the class you are trying to create. The procedure you specified
-does not exist.
-\item [expression must be destructor call]
-When using the extended syntax of \var{dispose}, you must specify the
-destructor method of the class you are trying to dispose of. 
-The procedure you specified is not a destructor.
-\item [type conflict between set elements]
-There is at least one set element which is of the wrong type, i.e. not of
-the set type.
-\item [illegal expression in set constructor]
-\item [type conflict between set elements]
-You are specifying elements of a different type for a set.
-\item [illegal use of ':']
-\item [expression type must be class or record type]
-The expression isn't of type class or record.
-\item [the operator / isn't defined for integer, the result will be real, use DIV instead]
-When using the '/' operator in \fpc the result will be of type real, when
-used with integers.
-\item [can't write PPU file]
-There is a problem when writing to the unit file.
-\item [illegal order of record elements]
-When declaring a constant record, you specified the fields in the wrong
-order.
-\item [the name of constructors must be INIT]
-You are declaring a constructor with a name which isn't \var{init}, and the
-\var{-Ss} switch is in effect. See the \var{-Ss} switch (\seeo{Ss}). 
-\item [the name of constructors must be DONE]
-You are declaring a constructor with a name which isn't \var{done}, and the
-\var{-Ss} switch is in effect. See the \var{-Ss} switch (\seeo{Ss}). 
-\item [set element type mismatch]
-The type of the element doesn't equal the set type.
-\item [illegal label declaration]
-\item [label not found]
-A \var{goto label} was encountered, but the label isn't declared. 
-\item [GOTO and LABEL are not supported (use command line switch -Sg)]
-You must compile a program which has \var{label}s and \var{goto} statements 
-with the  \var{-Sg} switch. By default, \var{label} and \var{goto} aren't
-supported.
-\item [set expected]
-The variable or expression isn't of type \var{set}.
-\item [identifier isn't a label]
-The identifier specified after the \var{goto} isn't of type label.
-\item [label already defined]
-You're attempting to define a label two times. (i.e. you put the same label
-on two different places.)
-\item [label isn't defined:]
-A label was declared, but not defined.
-\item [constructors and destructors must be methods]
-You're declaring a procedure as destructor or constructor, when the
-procedure isn't a class method.
-\item [error when assembling]
-An error occurred when assembling. This can have many causes.
-\item [identifier not used:]
-This is a warning. The identifier was declared (locally or globally) but
-wasn't used (locally or globally).
-\item [functions with void return value can't return any value]
-In \fpc, you can specify a return value for a function when using 
-the \var{exit} statement. This error occurs when you try to do this with a
-procedure. Procedures  cannot return a value.
-\item [Hmmm..., this code can't be much efficient]
-You construction seems dubious to the compiler.
-\item [unreachable code]
-You specified a loop which will never be executed. Example:
-\begin{verbatim}
-while false do
-  begin
-  {.. code ...}
-  end;
-\end{verbatim}
-\item [This overloaded function can't be local (must be exported)]
-You are defining a overloaded function in the implementation part of a unit,
-but there is no corresponding declaration in the interface part of the unit.
-\item [It's not possible to overload this operator]
-You are trying to overload an operator which cannot be overloaded.
-\item [Abstract methods can't be called direct]
-\fpc understands the \var{abstract} keyword.
-\item [the mix of CLASSES and OBJECTS are not allowed]
-You cannot use \var{object} and \var{class} intertwined.
-\item [macro buffer overflow while reading or expanding a macro]
-Your macro or it's result  was too long for the compiler.
-\item [keyword redefined as macro has no effect]
-You cannot redefine keywords with macros.
-\item [extension of macros exceeds a deep of 16,\\ perhaps there is a recursive macro definition (crashes the compiler)]
-When expanding a macro macros have been nested to a level of 16.
-\item [ENDIF without IF(N)DEF]
-Your code contains more \var{\{\$ENDIF\}} than \var{\{\$IF(N)DEF\}}
-statements.
-\item [user defined:]
-A user defined warning occurred. see also the \progref
-\item [linker: Duplicate symbol:]
-Two global symbols in the code have the same name.
-\item [linker: Error while reading object file]
-The linker couldn't read the object file (the assembled file).
-\item [linker: object file not found]
-The linker didn't find the object file (the assembled file).
-\item [linker: illegal magic number in file:]
-The linker cannot determine the type of a file it wants to link in. The type
-of a link file is specified using a magic number, which is some pre-defined
-constant, unique for each system.
-\item [The extended syntax of new or dispose isn't allowed for a class]
-You cannot generate an instance of a class with the extended syntax of 
-\var{new}. The constructor must be used for that. For the same reason, you
-cannot call \var{Dispose} to de-allocate an instance of a class, the
-destructor must be used for that.
-\item [To generate an instance of a class or an object with an abstract method isn't allowed]
-You are trying to generate an instance of a class which has an abstract
-method that wasn't overridden.
-\item [Only virtual methods can be abstract]
-You are declaring a method as abstract, when it isn't declared to be
-virtual.
-\item [Abstract methods shouldn't have any definition (with function body)]
-Abstract methods can only be declared, you cannot implement them. They
-should be overridden by a descendant class.
-\item [can't call the assembler]
-An error occurred when calling the assembler.
-\item [can't call o2obj]
-An error occurred when calling the \var{o} to \var{obj} conversion program.
-\item [asm syntax error]
-There is an error in the assembly language.
-\item [register name expected]
-There is an error in the assembly language. The assembler expected a
-register and got something else.
-\item [asm size mismatch]
-There is an error in the assembly language. The sizes of operands and
-registers don't match.
-\item [no instr match,]
-There is an error in the assembly language. An unknown instruction was
-encountered.
-\item [can't compile unit:]
-When trying to do a build, the compiler cannot compile one of the units.
-\item [Re-raise isn't possible there]
-You are trying to raise an exception where it isn't allowed. You can only
-raise exceptions in an \var{except} block.
-
-\item [ Syntax error while parsing a conditional compiling expression ]
-\item [ Evaluating a conditional compiling expression ]
-There is an error in the expression following the \var{\{\$if \}} compiler
-directive.
-\item [ Keyword redefined as macro has no effect ]
-You cannot redefine Pascal keywords with macros. If you, for instance would
-want to redefine the exit command you'd get this error. 
-\item [ compiler switches aren't allowed in (* ... *) styled comments ]
-Compiler switches should always be between \var{\{ \}} comment delimiters. 
-\item [ No DLL File specified ]
-
-\item [ Illegal open parameter ]
-You are trying to use the wrong type for an open parameter.
-\item [ Illegal floating point constant ]
-The compiler expects a floating point expression, and gets something else.
-\item [ string types doesn't match, because of \$V+ mode ]
-When compiling in \var{\{\$V+ \}} mode, the string you pass as a parameter
-should be of the exact same type as the declared parameter of the procedure.
-\item [ Only class methods can be referred with class references ]
-This error occurs in a situation like the following:
-\begin{verbatim}
-Type :
-   Tclass = Class of Tobject;
-
-Var C : TClass;
-
-begin
-...
-C.free
-\end{verbatim}
-\var{Free} is not a class method and hence cannot be called with a class
-reference.
-\item [ Only class methods can be accessed in class methods ]
-This is related to the previous error. You cannot call a method of an object
-from a inside a class method. The following code would produce this error:
-\begin{verbatim}
-class procedure tobject.x;
-
-begin
-  free
-\end{verbatim}
-Because free is a normal method of a class it cannot be called from a class
-method.
-\item [ Constant and CASE types do not match ]
-One of the labels is not of the same type as the case variable.
-\item [ The symbol can't be exported from a library ]
-You can only export procedures and functions when you write a library. You
-cannot export variables or constants.
-\item [ A virtual method must be overridden using the OVERRIDE directive: ]
-A method that is declared \var{virtual} in a parent class, should be
-overridden in the descendent class with the \var{override} directive. If you
-don't specify the \var{override} directive, you will hide the parent method;
-you will not override it.
-\item [ There is no method in an ancestor class to be overridden: ]
-You try to \var{override} a virtual method of a parent class that doesn't
-exist.
-\item [ No member is provided to access property ]
-You specified no \var{read} directive for a property. 
-\item [ Illegal symbol for property access ]
-There is an error in the \var{read} or \var{write} directives for an array 
-property. When you declare an array property, you can only access it with 
-procedures and functions. The following code woud cause such an error.
-\begin{verbatim}
-tmyobject = class
-  i : integer;
-  property x [i : integer]: integer read I write i;
-\end{verbatim}
- 
-\item [ Cannot write a protected field of an object ]
-Fields that are declared in a \var{protected} section of an object or class
-declaration cannot be accessed outside that objects methods.
-\item [ range check error in set constructor or duplicate set element ]
-The declaration of a set contains an error. Either one of the elements is
-outside the range of the set type, either two of the elements are in fact
-the same.
-\item [ Pointer to class expected ]
-The compiler expects a reference to a class.
-\item [ Operator is not overloaded ]
-You're trying to use an overloaded operator when it isn't overloaded for
-this type.
-\item [ Variable or type indentifier expected ]
-
-\item [ Assembler incompatible with function return value ]
-You're trying to implement a \var{assembler} function, but the return type
-of the function doesn't allow that.
-\item [ Procedure overloading is switched off ]
-You're trying to compile overloaded procedures with the \var{-So} (Turbo Pascal
-compatibility) switch. Remove the switch. 
-\item [ Comparative operator must return a boolean value ]
-When overloading the \var{=} operator, the function must return a boolean
-value.
-\item [ Use of unsupported feature! ]
-You're trying to force the compiler into doing something it cannot do yet.
-\item [ absolute can only be associated to ONE variable ]
-You cannot specify more than one variable before the \var{absolute} directive.
-Thus, the following construct will provide this error:
-\begin{verbatim}
-Var Z : Longint;
-    X,Y : Longint absolute Z;
-\end{verbatim}
-\item [ absolute can only be associated a var or const ]
-The address of a \var{absolute} directive can only point to a variable or
-constant. Therefore, the following code will produce this error:
-\begin{verbatim}
-  Procedure X;
-
- var p : longint absolute x;
-\end{verbatim}
-
-\item [ succ or pred on enums with assignments not possible ]
-When you declared an enumeration type which has assignments in it, as in C,
-like in the following:
-\begin{verbatim}
-  Tenum = (a,b,e:=5);
-\end{verbatim}
-you cannot use the \var{Succ} or \var{Pred} functions on them. 
-\item [ Array properties aren't allowed at this point ]
-Indexed properties are not yet implemented.
-\item [ No property found to override ]
-You want to overrride a property of a parent class, when there is, in fact,
-no such property in the parent class.
-\item [ Only one default property is allowed, found inherited default property in class ]
-You specified a property as \var{Default}, but a parent class already has a
-default property, and a class can have only one default property.
-\item [ The default property must be an array property ]
-Only array properties of classes can be made \var{default} properties. 
-\item [ Internal Error in SymTableStack() ]
-An internal error occurred in the compiler; If you encounter such an error,
-please contact the developers and try to provide  an exact description of
-the circumstances in which the error occurs.
-\item [ Error in type definition ]
-There is an error in your definition of a new type.
-\item [ Only static variables can be used in static methods or outside methods ]
-A static method of an object can only access static variables.
-\item [ Invalid call to tvarsym.mangledname() ]
-An internal error occurred in the compiler; If you encounter such an error,
-please contact the developers and try to provide  an exact description of
-the circumstances in which the error occurs.
-\item [ illegal type declaration of set elements ]
-The declaration of a set contains an invalid type definition.
-\item [ Forward class definition not resolved  ]
-You declared a class, but you didn't implement it.
-\item [ identifier idents no member ]
-You specify a field of a record or object, and the record or object doesn't
-contains such a field.
-\item [ The use of a far pointer isn't allowed there ]
-Free Pascal doesn't support far pointers, so you cannot take the address of
-an expression which has a far reference as a result. The \var{mem} construct
-has a far reference as a result, so the following code will produce this
-error:
-\begin{verbatim}
-var p : pointer;
-...
-p:=@mem[a000:000];
-\end{verbatim}
-\item [ procedure call with stackframe ESP/SP ]
-A procedure doesn't need a complete stack-frame, so it is omitted.
-\item [ Abstract methods can't be called directly ]
-You cannot call an abstract method directy, instead you must call a
-overriding child method, because an abstract method isn't implemented. 
-\item [ Internal Error in getfloatreg(), allocation failure ]
-An internal error occurred in the compiler; If you encounter such an error,
-please contact the developers and try to provide  an exact description of
-the circumstances in which the error occurs.
-\item [ Unknown float type ]
-The compiler cannot determine the kind of float in an expression.
-\item [ SecondVecn() base defined twice ]
-An internal error occurred in the compiler; If you encounter such an error,
-please contact the developers and try to provide  an exact description of
-the circumstances in which the error occurs.
-\item [ Extended cg68k not supported ]
-\item [ 32-bit unsigned not supported in MC68000 mode ]
-The cardinal type isn't supported on the  MC68000 processor.
-\item [ Internal Error in secondinline() ]
-An internal error occurred in the compiler; If you encounter such an error,
-please contact the developers and try to provide  an exact description of
-the circumstances in which the error occurs.
-\item [ Stack limit excedeed in local routine ]
-Your code requires a too big stack. Some operating systems pose limits 
-on the stack size. You should use less variables or try ro put large
-variables on the heap. 
-\end{description}
+% Message file is generated with msg2inc.
+\input {messages.tex}
 
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 % Assembler reader errors