Переглянути джерело

Mass trailing space removal for utils.

Margers 1 тиждень тому
батько
коміт
fb44abdcc1
100 змінених файлів з 1051 додано та 1051 видалено
  1. 1 1
      utils/README.txt
  2. 1 1
      utils/creumap.pp
  3. 3 3
      utils/debugsvr/README.txt
  4. 25 25
      utils/dotutils/README.txt
  5. 1 1
      utils/dotutils/addnamespacetofpmake.pp
  6. 2 2
      utils/dotutils/conditionalprefix.pp
  7. 1 1
      utils/dotutils/dond.pp
  8. 2 2
      utils/dotutils/encloseunit.pp
  9. 3 3
      utils/dotutils/fixuses.pp
  10. 1 1
      utils/dotutils/genunitnames.pp
  11. 1 1
      utils/dotutils/known.txt
  12. 2 2
      utils/dotutils/makedottedfiles.pp
  13. 2 2
      utils/dotutils/prefixunits.pp
  14. 2 2
      utils/dotutils/proxyunit.pp
  15. 1 1
      utils/dotutils/replaceunitnames.pp
  16. 2 2
      utils/dotutils/reworkmakefile.pp
  17. 1 1
      utils/dxegen/fpmake.pp
  18. 1 1
      utils/fpcm/convert_fpmake.txt
  19. 1 1
      utils/fpcm/fpcmmain.pp
  20. 2 2
      utils/fpcm/readme.txt
  21. 2 2
      utils/fpcm/regeninc.pp
  22. 3 3
      utils/fpcmkcfg/fpcmkcfg.pp
  23. 1 1
      utils/fpcmkcfg/fpmake.pp
  24. 2 2
      utils/fpcres/fpcjres.pas
  25. 3 3
      utils/fpcres/fpcres.pas
  26. 1 1
      utils/fpcres/fpmake.pp
  27. 2 2
      utils/fpcres/jarsourcehandler.pas
  28. 1 1
      utils/fpcres/msghandler.pas
  29. 2 2
      utils/fpcres/paramparser.pas
  30. 2 2
      utils/fpcres/sourcehandler.pas
  31. 3 3
      utils/fpcres/target.pas
  32. 1 1
      utils/fpcreslipo/fpcreslipo.pp
  33. 1 1
      utils/fpcreslipo/fpmake.pp
  34. 1 1
      utils/fpcreslipo/msghandler.pp
  35. 4 4
      utils/fpcreslipo/sourcehandler.pp
  36. 2 2
      utils/fpdoc/README.txt
  37. 16 16
      utils/fpdoc/dglobals.pp
  38. 10 10
      utils/fpdoc/dw_chm.pp
  39. 1 1
      utils/fpdoc/dw_dxml.pp
  40. 18 18
      utils/fpdoc/dw_html.pp
  41. 10 10
      utils/fpdoc/dw_latex.pp
  42. 1 1
      utils/fpdoc/dw_linrtf.pp
  43. 12 12
      utils/fpdoc/dw_markdown.pp
  44. 10 10
      utils/fpdoc/dw_newhtml.pp
  45. 7 7
      utils/fpdoc/dwriter.pp
  46. 2 2
      utils/fpdoc/examples/basedir/readme.txt
  47. 1 1
      utils/fpdoc/examples/project/readme.txt
  48. 34 34
      utils/fpdoc/examples/simple/testunit.pp
  49. 12 12
      utils/fpdoc/fpclasschart.pp
  50. 1 1
      utils/fpdoc/fpde/frmabout.pp
  51. 1 1
      utils/fpdoc/fpde/frmlink.pp
  52. 1 1
      utils/fpdoc/fpde/frmnewnode.pp
  53. 1 1
      utils/fpdoc/fpde/frmtable.pp
  54. 5 5
      utils/fpdoc/fpdocstripper.pp
  55. 1 1
      utils/fpdoc/fpmake.pp
  56. 48 48
      utils/fpdoc/makeskel.pp
  57. 4 4
      utils/fpdoc/sh_pas.pp
  58. 1 1
      utils/fpmc/dumpfile.pp
  59. 1 1
      utils/fpmc/fpmake.pp
  60. 2 2
      utils/fppkg/fpmake.pp
  61. 32 32
      utils/fppkg/lnet/fastcgi_base.pp
  62. 10 10
      utils/fppkg/lnet/lcommon.pp
  63. 2 2
      utils/fppkg/lnet/lcontrolstack.pp
  64. 11 11
      utils/fppkg/lnet/levents.pp
  65. 16 16
      utils/fppkg/lnet/lfastcgi.pp
  66. 40 40
      utils/fppkg/lnet/lftp.pp
  67. 53 53
      utils/fppkg/lnet/lhttp.pp
  68. 8 8
      utils/fppkg/lnet/lhttputil.pp
  69. 7 7
      utils/fppkg/lnet/lmimestreams.pp
  70. 2 2
      utils/fppkg/lnet/lmimetypes.pp
  71. 46 46
      utils/fppkg/lnet/lmimewrapper.pp
  72. 70 70
      utils/fppkg/lnet/lnet.pp
  73. 3 3
      utils/fppkg/lnet/lprocess.pp
  74. 37 37
      utils/fppkg/lnet/lsmtp.pp
  75. 2 2
      utils/fppkg/lnet/lstrbuffer.pp
  76. 25 25
      utils/fppkg/lnet/ltelnet.pp
  77. 1 1
      utils/fppkg/lnet/ltimer.pp
  78. 22 22
      utils/fppkg/lnet/lwebserver.pp
  79. 4 4
      utils/fppkg/lnet/sys/lepolleventer.inc
  80. 2 2
      utils/fppkg/lnet/sys/lepolleventerh.inc
  81. 2 2
      utils/fppkg/lnet/sys/lkqueueeventer.inc
  82. 1 1
      utils/fppkg/lnet/sys/lkqueueeventerh.inc
  83. 4 4
      utils/fppkg/lnet/sys/lspawnfcgiunix.inc
  84. 1 1
      utils/fprcp/Readme.txt
  85. 2 2
      utils/fprcp/fpmake.pp
  86. 5 5
      utils/fprcp/fprcp.pp
  87. 2 2
      utils/grab_vcsa.pp
  88. 8 8
      utils/h2pas/README.txt
  89. 5 5
      utils/h2pas/fpmake.pp
  90. 299 299
      utils/h2pas/h2pparse.pp
  91. 9 9
      utils/h2pas/scan.pas
  92. 3 3
      utils/h2pas/scanbase.pp
  93. 1 1
      utils/ihxutil/fpmake.pp
  94. 1 1
      utils/importtl/fpmake.pp
  95. 1 1
      utils/instantfpc/fpmake.pp
  96. 24 24
      utils/instantfpc/instantfpc.pas
  97. 1 1
      utils/instantfpc/instantfptools.pas
  98. 1 1
      utils/json2pas/fpmake.pp
  99. 1 1
      utils/mksymbian/cfgfile.pas
  100. 1 1
      utils/mksymbian/cmdline.pas

+ 1 - 1
utils/README.txt

@@ -7,7 +7,7 @@ ppdep   : Creates a makefile which includes all interdependant units.
 
 
 ptop    : Pascal source beautifier
 ptop    : Pascal source beautifier
 
 
-delp    : Deletes all files generated by Free Pascal, as well 
+delp    : Deletes all files generated by Free Pascal, as well
           temporary files.
           temporary files.
 
 
 h2pas/  : Contains the h2pas program, which converts C header files to pascal
 h2pas/  : Contains the h2pas program, which converts C header files to pascal

+ 1 - 1
utils/creumap.pp

@@ -106,7 +106,7 @@ begin
    Val(paramstr(2),i,e);
    Val(paramstr(2),i,e);
    if e<>0 then
    if e<>0 then
      doerror;
      doerror;
-     
+
    p:=loadunicodemapping(paramstr(1),paramstr(1)+'.txt',i);
    p:=loadunicodemapping(paramstr(1),paramstr(1)+'.txt',i);
    if p=nil then
    if p=nil then
      doerror;
      doerror;

+ 3 - 3
utils/debugsvr/README.txt

@@ -1,12 +1,12 @@
 This is the Free Pascal debug server tool.
 This is the Free Pascal debug server tool.
 
 
 It's design goals and usage principle are the same as the ones for the
 It's design goals and usage principle are the same as the ones for the
-gdebug tools found in the gexperts collection for Delphi. 
+gdebug tools found in the gexperts collection for Delphi.
 (see http://www.gexperts.org/)
 (see http://www.gexperts.org/)
 However, it is a totally new implementation, designed to be cross-platform
 However, it is a totally new implementation, designed to be cross-platform
 and with more options such as a remote debug server.
 and with more options such as a remote debug server.
 
 
-The interface of the dbugintf unit is designed to be more or less compatible 
+The interface of the dbugintf unit is designed to be more or less compatible
 with the dbugintf unit og gexperts.
 with the dbugintf unit og gexperts.
 
 
 To use this:
 To use this:
@@ -16,7 +16,7 @@ To use this:
    is not yet started. The inet socket version will not)
    is not yet started. The inet socket version will not)
 
 
 - Include 'dbugintf' unit in your program/unit's 'uses' clause.
 - Include 'dbugintf' unit in your program/unit's 'uses' clause.
-  
+
 - Include 'SendDebug()' statements wherever needed in possible.
 - Include 'SendDebug()' statements wherever needed in possible.
   (see other possible statements in the dbugintf unit file)
   (see other possible statements in the dbugintf unit file)
 
 

+ 25 - 25
utils/dotutils/README.txt

@@ -18,9 +18,9 @@ The tools expect one or two files:
 A file with rules to apply to units.
 A file with rules to apply to units.
 
 
 Each line is constructed as follows:
 Each line is constructed as follows:
-  
+
 ```
 ```
-FileName=Rule;Compile Options 
+FileName=Rule;Compile Options
 ```
 ```
 
 
 Here
 Here
@@ -50,16 +50,16 @@ the name of the math unit will not be changed.
 ## Known units rules
 ## Known units rules
 
 
 A file with OldName=Rule pairs to apply to unit names in a uses clause. a Rule may never specify a path
 A file with OldName=Rule pairs to apply to unit names in a uses clause. a Rule may never specify a path
-or an extension. The same extension as the original is used. 
+or an extension. The same extension as the original is used.
 
 
 This file is used by the prefixunits tool.
 This file is used by the prefixunits tool.
 
 
 # Conversion Rules
 # Conversion Rules
 
 
 A rule can take the following forms:
 A rule can take the following forms:
-  
+
 "*DottedUnitName" : Use the dotted name as typed.
 "*DottedUnitName" : Use the dotted name as typed.
-   
+
 Example:
 Example:
 
 
 ```
 ```
@@ -77,29 +77,29 @@ sysutils=system
 ```
 ```
 
 
 will result in a file system.sysutils
 will result in a file system.sysutils
- 
+
 "Prefix,*UnitSuffix" : This is equivalent to *Prefix.UnitSuffix
 "Prefix,*UnitSuffix" : This is equivalent to *Prefix.UnitSuffix
 
 
 Example:
 Example:
 
 
 ```
 ```
-sysutils=System,*SysUtils 
+sysutils=System,*SysUtils
 ```
 ```
-  
+
 will result in System.SysUtils
 will result in System.SysUtils
 
 
 
 
-"Prefix,-TextToDelete" strips the indicated part from the start of the original filename and prepends the result with Prefix. 
+"Prefix,-TextToDelete" strips the indicated part from the start of the original filename and prepends the result with Prefix.
 
 
 Example:
 Example:
 
 
 ```
 ```
-fpreportdata=FpReport,-fpreport 
+fpreportdata=FpReport,-fpreport
 ```
 ```
 
 
 Will result in FpReport.Data
 Will result in FpReport.Data
 
 
-"Prefix,TextToDelete-" strips the indicated part from the end of the original filename and prepends the result with Prefix. 
+"Prefix,TextToDelete-" strips the indicated part from the end of the original filename and prepends the result with Prefix.
 
 
 Example:
 Example:
 
 
@@ -109,7 +109,7 @@ elfresource=System.Resources,resource-
 
 
 
 
 Will result in System.Resources.elf
 Will result in System.Resources.elf
-  
+
 
 
 # Available tools
 # Available tools
 
 
@@ -125,14 +125,14 @@ Takes a unit name from standard input, pretty print it (first letter
 uppercased) and add a conditional define for a namespace.
 uppercased) and add a conditional define for a namespace.
 
 
 ```
 ```
-echo "sysutils" | conditionalprefix System will result in 
+echo "sysutils" | conditionalprefix System will result in
 ```
 ```
 
 
 ```
 ```
 {$IFDEF FPC_DOTTEDUNITS}System{$ENDIF}.Sysutils
 {$IFDEF FPC_DOTTEDUNITS}System{$ENDIF}.Sysutils
 ```
 ```
 
 
-To be used in shell scripts or to be invoked from an editor 
+To be used in shell scripts or to be invoked from an editor
 that allows you to filter a selection through a command
 that allows you to filter a selection through a command
 
 
 ## dond.pp
 ## dond.pp
@@ -143,17 +143,17 @@ Tool to lowercase values in a Name=Value list
 
 
 ## fixuses.pp
 ## fixuses.pp
 
 
-Read a complete uses clause from standard input, and replace it with a conditional uses clause that 
+Read a complete uses clause from standard input, and replace it with a conditional uses clause that
 allows dotted and non-dotted units. The command needs a file with unit transform rules to apply
 allows dotted and non-dotted units. The command needs a file with unit transform rules to apply
 to the units in the uses clause.
 to the units in the uses clause.
 
 
-To be used in shell scripts or to be invoked from an editor 
+To be used in shell scripts or to be invoked from an editor
 that allows you to filter a selection through a command.
 that allows you to filter a selection through a command.
 
 
 Example:
 Example:
 
 
 ```
 ```
-echo "uses sysutils, classes" | fixuses known.txt 
+echo "uses sysutils, classes" | fixuses known.txt
 ```
 ```
 
 
 results in
 results in
@@ -186,7 +186,7 @@ sysutils=*System.SysUtils
 classes=*System.Classes
 classes=*System.Classes
 ```
 ```
 
 
-results in 
+results in
 
 
 ```
 ```
 ifdef FPC_DOTTEDUNITS
 ifdef FPC_DOTTEDUNITS
@@ -206,8 +206,8 @@ generate a dotted version of the unit. Optionally adapts an fpmake file.
 This tool accepts a lot of options, run with -h to get an explanation of
 This tool accepts a lot of options, run with -h to get an explanation of
 what it does.
 what it does.
 
 
-It needs 2 files to be specified using the command-line options: 
-a rule file of units to treat and the 'known mappings' rule file.    
+It needs 2 files to be specified using the command-line options:
+a rule file of units to treat and the 'known mappings' rule file.
 
 
 ## prefixunits.pp
 ## prefixunits.pp
 
 
@@ -219,7 +219,7 @@ program or unit so it uses dotted names, based on a list of known aliases.
 
 
 ## proxyunit.pp
 ## proxyunit.pp
 
 
-Generate a skeleton unit with namespaced name which defines FPC_DOTTEDUNITS and 
+Generate a skeleton unit with namespaced name which defines FPC_DOTTEDUNITS and
 includes the original non-dotted unit. The full path to the skeleton unit
 includes the original non-dotted unit. The full path to the skeleton unit
 must be given, the original non-dotted unit must be given only as a name.
 must be given, the original non-dotted unit must be given only as a name.
 The extension is optional, when not specified, .pp is assumed.
 The extension is optional, when not specified, .pp is assumed.
@@ -258,7 +258,7 @@ and the Makefile:
 sysutils($PPUEXT): sysutils.pp
 sysutils($PPUEXT): sysutils.pp
 	$(COMPILER) sysutils.pp
 	$(COMPILER) sysutils.pp
 
 
-classes($PPUEXT): classes.pp sysutils.pp 
+classes($PPUEXT): classes.pp sysutils.pp
 	$(COMPILER) classes.pp
 	$(COMPILER) classes.pp
 ```
 ```
 
 
@@ -266,11 +266,11 @@ is transformed to
 sysutils($PPUEXT): $(SYSUTILSUNIT).pp
 sysutils($PPUEXT): $(SYSUTILSUNIT).pp
         $(COMPILER) $(SYSUTILSUNIT).pp
         $(COMPILER) $(SYSUTILSUNIT).pp
 
 
-classes($PPUEXT): $(CLASSESUNIT).pp $(SYSUTILSUNIT).pp 
+classes($PPUEXT): $(CLASSESUNIT).pp $(SYSUTILSUNIT).pp
         $(COMPILER) $(CLASSESUNIT).pp
         $(COMPILER) $(CLASSESUNIT).pp
-	
 
 
-## reworkmakefile.pp  
+
+## reworkmakefile.pp
 
 
 Duplicate all rules in a Makefile.fpc [Rules] section according to the rules specified
 Duplicate all rules in a Makefile.fpc [Rules] section according to the rules specified
 in the aliases file. Skip rules that are in the skip file. Every rule is
 in the aliases file. Skip rules that are in the skip file. Every rule is

+ 1 - 1
utils/dotutils/addnamespacetofpmake.pp

@@ -3,7 +3,7 @@
     Copyright (c) 2022 by Michael Van Canneyt, [email protected]
     Copyright (c) 2022 by Michael Van Canneyt, [email protected]
 
 
     Utility to add a statement to add a namespace to a fpmake program file for FPC packages.
     Utility to add a statement to add a namespace to a fpmake program file for FPC packages.
-    
+
     See the file COPYING.FPC, included in this distribution,
     See the file COPYING.FPC, included in this distribution,
     for details about the copyright.
     for details about the copyright.
 
 

+ 2 - 2
utils/dotutils/conditionalprefix.pp

@@ -3,9 +3,9 @@
     Copyright (c) 2022 by Michael Van Canneyt, [email protected]
     Copyright (c) 2022 by Michael Van Canneyt, [email protected]
 
 
     Take a unit name and add a conditional define for a namespace.
     Take a unit name and add a conditional define for a namespace.
-    To be used in shell scripts or to be invoked from an editor 
+    To be used in shell scripts or to be invoked from an editor
     that allows you to filter a selection through a command
     that allows you to filter a selection through a command
-    
+
     See the file COPYING.FPC, included in this distribution,
     See the file COPYING.FPC, included in this distribution,
     for details about the copyright.
     for details about the copyright.
 
 

+ 1 - 1
utils/dotutils/dond.pp

@@ -3,7 +3,7 @@
     Copyright (c) 2022 by Michael Van Canneyt, [email protected]
     Copyright (c) 2022 by Michael Van Canneyt, [email protected]
 
 
     Tool to lowercase values in a Name=Value lisst.
     Tool to lowercase values in a Name=Value lisst.
-    
+
     See the file COPYING.FPC, included in this distribution,
     See the file COPYING.FPC, included in this distribution,
     for details about the copyright.
     for details about the copyright.
 
 

+ 2 - 2
utils/dotutils/encloseunit.pp

@@ -4,8 +4,8 @@
 
 
 var
 var
   S : String;
   S : String;
-  
-begin  
+
+begin
   Writeln('{$IFNDEF FPC_DOTTEDUNITS}');
   Writeln('{$IFNDEF FPC_DOTTEDUNITS}');
   While not EOF do
   While not EOF do
     begin
     begin

+ 3 - 3
utils/dotutils/fixuses.pp

@@ -2,11 +2,11 @@
     This file is part of the Free Component Library
     This file is part of the Free Component Library
     Copyright (c) 2022 by Michael Van Canneyt, [email protected]
     Copyright (c) 2022 by Michael Van Canneyt, [email protected]
 
 
-    Take a uses clause from standard input, 
+    Take a uses clause from standard input,
     and replace it with a conditional uses clause that allows dotted and non-dotted units.
     and replace it with a conditional uses clause that allows dotted and non-dotted units.
-    To be used in shell scripts or to be invoked from an editor 
+    To be used in shell scripts or to be invoked from an editor
     that allows you to filter a selection through a command.
     that allows you to filter a selection through a command.
-    
+
     See the file COPYING.FPC, included in this distribution,
     See the file COPYING.FPC, included in this distribution,
     for details about the copyright.
     for details about the copyright.
 
 

+ 1 - 1
utils/dotutils/genunitnames.pp

@@ -5,7 +5,7 @@
     Read a list of unit file transformations and generate a list of unit names for use in a Makefile.
     Read a list of unit file transformations and generate a list of unit names for use in a Makefile.
     The output consists of a XYZUNIT variable for each unit in the file list, twice: once dotted, once not dotted.
     The output consists of a XYZUNIT variable for each unit in the file list, twice: once dotted, once not dotted.
     The variables can be used in target definitions and dependency lists.
     The variables can be used in target definitions and dependency lists.
-        
+
     See the file COPYING.FPC, included in this distribution,
     See the file COPYING.FPC, included in this distribution,
     for details about the copyright.
     for details about the copyright.
 
 

+ 1 - 1
utils/dotutils/known.txt

@@ -2572,7 +2572,7 @@ rp2040=EmbeddedApi
 RtlConsts=System
 RtlConsts=System
 sam3x8e=EmbeddedApi
 sam3x8e=EmbeddedApi
 samd51p19a=EmbeddedApi
 samd51p19a=EmbeddedApi
-sc32442b=EmbeddedApi 
+sc32442b=EmbeddedApi
 sfpu128=*System.SoftFpu128
 sfpu128=*System.SoftFpu128
 sfpux80=*System.SoftFpuX80
 sfpux80=*System.SoftFpuX80
 ShareMem=WinApi
 ShareMem=WinApi

+ 2 - 2
utils/dotutils/makedottedfiles.pp

@@ -2,9 +2,9 @@
     This file is part of the Free Component Library
     This file is part of the Free Component Library
     Copyright (c) 2022 by Michael Van Canneyt, [email protected]
     Copyright (c) 2022 by Michael Van Canneyt, [email protected]
 
 
-    Application to Prefix units in uses clause of a list of programs. 
+    Application to Prefix units in uses clause of a list of programs.
     Optionally adapts an fpmake file.
     Optionally adapts an fpmake file.
-    
+
     See the file COPYING.FPC, included in this distribution,
     See the file COPYING.FPC, included in this distribution,
     for details about the copyright.
     for details about the copyright.
 
 

+ 2 - 2
utils/dotutils/prefixunits.pp

@@ -3,7 +3,7 @@
     Copyright (c) 2022 by Michael Van Canneyt, [email protected]
     Copyright (c) 2022 by Michael Van Canneyt, [email protected]
 
 
     Prefix units in uses clause of a single program or unit.
     Prefix units in uses clause of a single program or unit.
-    
+
     See the file COPYING.FPC, included in this distribution,
     See the file COPYING.FPC, included in this distribution,
     for details about the copyright.
     for details about the copyright.
 
 
@@ -16,7 +16,7 @@ program prefixunits;
 
 
 {$mode objfpc}
 {$mode objfpc}
 {$H+}
 {$H+}
- 
+
 uses cwstring, SysUtils, Classes, custapp, prefixer;
 uses cwstring, SysUtils, Classes, custapp, prefixer;
 
 
 type
 type

+ 2 - 2
utils/dotutils/proxyunit.pp

@@ -2,9 +2,9 @@
     This file is part of the Free Component Library
     This file is part of the Free Component Library
     Copyright (c) 2022 by Michael Van Canneyt, [email protected]
     Copyright (c) 2022 by Michael Van Canneyt, [email protected]
 
 
-    Generate a skeleton unit with namespaced name which defines FPC_DOTTEDUNITS and 
+    Generate a skeleton unit with namespaced name which defines FPC_DOTTEDUNITS and
     includes the original non-dotted unit.
     includes the original non-dotted unit.
-        
+
     See the file COPYING.FPC, included in this distribution,
     See the file COPYING.FPC, included in this distribution,
     for details about the copyright.
     for details about the copyright.
 
 

+ 1 - 1
utils/dotutils/replaceunitnames.pp

@@ -4,7 +4,7 @@
 
 
     Replace hardcoded unit names xyz in a makefile by a variable XYZUNIT.
     Replace hardcoded unit names xyz in a makefile by a variable XYZUNIT.
     (see genunitnames for how to create the variables)
     (see genunitnames for how to create the variables)
-    
+
     See the file COPYING.FPC, included in this distribution,
     See the file COPYING.FPC, included in this distribution,
     for details about the copyright.
     for details about the copyright.
 
 

+ 2 - 2
utils/dotutils/reworkmakefile.pp

@@ -2,10 +2,10 @@
     This file is part of the Free Component Library
     This file is part of the Free Component Library
     Copyright (c) 2022 by Michael Van Canneyt, [email protected]
     Copyright (c) 2022 by Michael Van Canneyt, [email protected]
 
 
-    Rework makefile rules: 
+    Rework makefile rules:
     Replace hardcoded unit names xyz in a rule with variable XYZUNIT.
     Replace hardcoded unit names xyz in a rule with variable XYZUNIT.
     (see genunitnames for how to create the variables)
     (see genunitnames for how to create the variables)
-    
+
     See the file COPYING.FPC, included in this distribution,
     See the file COPYING.FPC, included in this distribution,
     for details about the copyright.
     for details about the copyright.
 
 

+ 1 - 1
utils/dxegen/fpmake.pp

@@ -2,7 +2,7 @@
 {$mode objfpc}{$H+}
 {$mode objfpc}{$H+}
 program fpmake;
 program fpmake;
 
 
-uses 
+uses
   {$ifdef unix}
   {$ifdef unix}
   cthreads,
   cthreads,
   {$endif}
   {$endif}

+ 1 - 1
utils/fpcm/convert_fpmake.txt

@@ -1,7 +1,7 @@
 The convert_all_fpmake.sh script generates the Makefile.fpc's for calling
 The convert_all_fpmake.sh script generates the Makefile.fpc's for calling
 fpmake.
 fpmake.
 It does that for all packages in sub-directories of the current directory. The
 It does that for all packages in sub-directories of the current directory. The
-Makefile.fpc's are based on the Makefile.fpmake.template and the 
+Makefile.fpc's are based on the Makefile.fpmake.template and the
 Makefile.fpmake.bs.template, the latter for packages that are needed to bootstrap the fpmkunit. Note that the fpmkunint-package is skipped by this
 Makefile.fpmake.bs.template, the latter for packages that are needed to bootstrap the fpmkunit. Note that the fpmkunint-package is skipped by this
 script, since it's Makefile.fpc is very different from the others.
 script, since it's Makefile.fpc is very different from the others.
 
 

+ 1 - 1
utils/fpcm/fpcmmain.pp

@@ -157,7 +157,7 @@ interface
       var
       var
         OSCpuPossible : TOsCpuPossible;
         OSCpuPossible : TOsCpuPossible;
 {$else}
 {$else}
-      OSCpuPossible : array[TOS,TCpu] of boolean = 
+      OSCpuPossible : array[TOS,TCpu] of boolean =
       (
       (
         { os          none   i386    m68k  ppc    sparc  x86_64 arm    ppc64  avr    armeb  armel  mips   mipsel mips64 misp64el jvm    i8086  aarch64 wasm32 sparc64 riscv32 riscv64 xtensa z80   loongarch64 }
         { os          none   i386    m68k  ppc    sparc  x86_64 arm    ppc64  avr    armeb  armel  mips   mipsel mips64 misp64el jvm    i8086  aarch64 wasm32 sparc64 riscv32 riscv64 xtensa z80   loongarch64 }
         { none  }   ( false, false, false, false, false, false, false, false, false, false, false, false, false, false, false,   false, false, false,  false, false, false,  false,  false, false, false),
         { none  }   ( false, false, false, false, false, false, false, false, false, false, false, false, false, false, false,   false, false, false,  false, false, false,  false,  false, false, false),

+ 2 - 2
utils/fpcm/readme.txt

@@ -3,8 +3,8 @@ Free Pascal makefiles, depending on the rules
 specified in the Makefile.fpc files.
 specified in the Makefile.fpc files.
 
 
 Some tips:
 Some tips:
-- The rtl and packages contain a script that regenerates the makefiles. 
-  targets, simply do (in a unix-like environment) 
+- The rtl and packages contain a script that regenerates the makefiles.
+  targets, simply do (in a unix-like environment)
   cd rtl
   cd rtl
   ./regenmakefiles.sh
   ./regenmakefiles.sh
   cd ../packages
   cd ../packages

+ 2 - 2
utils/fpcm/regeninc.pp

@@ -7,7 +7,7 @@ const
   ininame = 'fpcmake.ini';
   ininame = 'fpcmake.ini';
   incname = 'fpcmake.inc';
   incname = 'fpcmake.inc';
   constname = 'fpcmakeini';
   constname = 'fpcmakeini';
-  
+
 var
 var
   Data2Inc : string;
   Data2Inc : string;
   res : integer;
   res : integer;
@@ -25,6 +25,6 @@ begin
     Halt(2);
     Halt(2);
     end;
     end;
   Res:=ExecuteProcess(data2inc,['-b','-s',ininame,incname,constname]);
   Res:=ExecuteProcess(data2inc,['-b','-s',ininame,incname,constname]);
-  if Res<>0 then 
+  if Res<>0 then
     Halt(Res);
     Halt(Res);
 end.
 end.

+ 3 - 3
utils/fpcmkcfg/fpcmkcfg.pp

@@ -260,10 +260,10 @@ begin
             (-> only use the 10.14 sdk when targeting x86_64 or unknown architectures )
             (-> only use the 10.14 sdk when targeting x86_64 or unknown architectures )
           3) crt1.o is no longer installed under /usr -> add its directory explicitly via
           3) crt1.o is no longer installed under /usr -> add its directory explicitly via
              -Fl
              -Fl
-            
+
         We can't detect the macOS version inside fpc.cfg, unfortunately, so we can only
         We can't detect the macOS version inside fpc.cfg, unfortunately, so we can only
         insert this while generating the configuration file.
         insert this while generating the configuration file.
-        
+
         This will stop working when macOS 10.15 is released without i386 support, but then
         This will stop working when macOS 10.15 is released without i386 support, but then
         users will be responsible for supplying their own i386 SDK anyway.
         users will be responsible for supplying their own i386 SDK anyway.
        }
        }
@@ -293,7 +293,7 @@ begin
 
 
   { ifdef everything above related to the target OS otherwise host linker/clib paths can leak
   { ifdef everything above related to the target OS otherwise host linker/clib paths can leak
     into the target while cross-ing, and cause nonworking executables (Darwin-x86_64 to ARM-Linux
     into the target while cross-ing, and cause nonworking executables (Darwin-x86_64 to ARM-Linux
-    for example on my setup), and while it's advised to use -n when crosscompiling, it can 
+    for example on my setup), and while it's advised to use -n when crosscompiling, it can
     cause hard to identify issues if -n is forgotten... (KB) }
     cause hard to identify issues if -n is forgotten... (KB) }
   if result <> '' then
   if result <> '' then
     result := '#ifdef ' + BuildOSTarget + LineEnding +
     result := '#ifdef ' + BuildOSTarget + LineEnding +

+ 1 - 1
utils/fpcmkcfg/fpmake.pp

@@ -2,7 +2,7 @@
 {$mode objfpc}{$H+}
 {$mode objfpc}{$H+}
 program fpmake;
 program fpmake;
 
 
-uses 
+uses
   {$ifdef unix}
   {$ifdef unix}
   cthreads,
   cthreads,
   {$endif}
   {$endif}

+ 2 - 2
utils/fpcres/fpcjres.pas

@@ -82,10 +82,10 @@ const
   SNoInputFiles = 'No input files';
   SNoInputFiles = 'No input files';
   SNoOutputFile = 'No output file name specified';
   SNoOutputFile = 'No output file name specified';
   SCannotReadConfFile ='Can''t read config file ''%s''';
   SCannotReadConfFile ='Can''t read config file ''%s''';
-  
+
   SCantOpenFile = 'Can''t open file ''%s''';
   SCantOpenFile = 'Can''t open file ''%s''';
   SUnknownInputFormat = 'No known file format detected for file ''%s''';
   SUnknownInputFormat = 'No known file format detected for file ''%s''';
-  
+
   SCantCreateDirHier = 'Can''t create directory hierarchy ''%s''';
   SCantCreateDirHier = 'Can''t create directory hierarchy ''%s''';
   SCantCreateFile = 'Can''t create file ''%s''';
   SCantCreateFile = 'Can''t create file ''%s''';
 
 

+ 3 - 3
utils/fpcres/fpcres.pas

@@ -29,7 +29,7 @@ uses
   externalwriter,
   externalwriter,
 //misc
 //misc
   elfconsts, cofftypes, machotypes, externaltypes;
   elfconsts, cofftypes, machotypes, externaltypes;
-  
+
 const
 const
   halt_no_err = 0;
   halt_no_err = 0;
   halt_param_err = 1;
   halt_param_err = 1;
@@ -98,10 +98,10 @@ const
   SNoInputFiles = 'No input files';
   SNoInputFiles = 'No input files';
   SNoOutputFile = 'No output file name specified';
   SNoOutputFile = 'No output file name specified';
   SCannotReadConfFile ='Can''t read config file ''%s''';
   SCannotReadConfFile ='Can''t read config file ''%s''';
-  
+
   SCantOpenFile = 'Can''t open file ''%s''';
   SCantOpenFile = 'Can''t open file ''%s''';
   SUnknownInputFormat = 'No known file format detected for file ''%s''';
   SUnknownInputFormat = 'No known file format detected for file ''%s''';
-  
+
   SCantCreateFile = 'Can''t create file ''%s''';
   SCantCreateFile = 'Can''t create file ''%s''';
 
 
 function GetCurrentTimeMsec : longint;
 function GetCurrentTimeMsec : longint;

+ 1 - 1
utils/fpcres/fpmake.pp

@@ -2,7 +2,7 @@
 {$mode objfpc}{$H+}
 {$mode objfpc}{$H+}
 program fpmake;
 program fpmake;
 
 
-uses 
+uses
   {$ifdef unix}
   {$ifdef unix}
   cthreads,
   cthreads,
   {$endif}
   {$endif}

+ 2 - 2
utils/fpcres/jarsourcehandler.pas

@@ -30,7 +30,7 @@ type
   ESourceFilesException = class(Exception);
   ESourceFilesException = class(Exception);
   ECantOpenFileException = class(ESourceFilesException);
   ECantOpenFileException = class(ESourceFilesException);
   EUnknownInputFormatException = class(ESourceFilesException);
   EUnknownInputFormatException = class(ESourceFilesException);
-  
+
 type
 type
 
 
   { TSourceFiles }
   { TSourceFiles }
@@ -41,7 +41,7 @@ type
   public
   public
     procedure Load(aResources : TZipper);reintroduce;
     procedure Load(aResources : TZipper);reintroduce;
   end;
   end;
-  
+
 implementation
 implementation
 
 
 uses msghandler, closablefilestream;
 uses msghandler, closablefilestream;

+ 1 - 1
utils/fpcres/msghandler.pas

@@ -44,7 +44,7 @@ type
     procedure Flush;
     procedure Flush;
     property Verbose : boolean read fVerbose write SetVerbose;
     property Verbose : boolean read fVerbose write SetVerbose;
   end;
   end;
-  
+
 var Messages : TMessages;
 var Messages : TMessages;
 
 
 procedure Halt(errnum:Longint);
 procedure Halt(errnum:Longint);

+ 2 - 2
utils/fpcres/paramparser.pas

@@ -3,7 +3,7 @@
     FPCRes - Free Pascal Resource Converter
     FPCRes - Free Pascal Resource Converter
     Part of the Free Pascal distribution
     Part of the Free Pascal distribution
     Copyright (C) 2008 by Giulio Bernardi
     Copyright (C) 2008 by Giulio Bernardi
-    
+
     Handles the parsing of parameters
     Handles the parsing of parameters
 
 
     See the file COPYING, included in this distribution,
     See the file COPYING, included in this distribution,
@@ -266,7 +266,7 @@ begin
       exit;
       exit;
     end;
     end;
   end;
   end;
-  
+
   raise EUnknownObjFormatException.Create(tmp);
   raise EUnknownObjFormatException.Create(tmp);
 
 
 end;
 end;

+ 2 - 2
utils/fpcres/sourcehandler.pas

@@ -27,7 +27,7 @@ type
   ESourceFilesException = class(Exception);
   ESourceFilesException = class(Exception);
   ECantOpenFileException = class(ESourceFilesException);
   ECantOpenFileException = class(ESourceFilesException);
   EUnknownInputFormatException = class(ESourceFilesException);
   EUnknownInputFormatException = class(ESourceFilesException);
-  
+
 type
 type
 
 
   { TSourceFiles }
   { TSourceFiles }
@@ -49,7 +49,7 @@ type
     property RCDefines: TStringList read fRCDefines;
     property RCDefines: TStringList read fRCDefines;
     property RCMode: Boolean read fRCMode write fRCMode;
     property RCMode: Boolean read fRCMode write fRCMode;
   end;
   end;
-  
+
 implementation
 implementation
 
 
 uses msghandler, closablefilestream, rcreader;
 uses msghandler, closablefilestream, rcreader;

+ 3 - 3
utils/fpcres/target.pas

@@ -43,14 +43,14 @@ type
 
 
   TObjFormat = (ofNone, ofRes, ofElf, ofCoff, ofXCoff, ofMachO, ofWasm, ofExt);
   TObjFormat = (ofNone, ofRes, ofElf, ofCoff, ofXCoff, ofMachO, ofWasm, ofExt);
   TObjFormats = set of TObjFormat;
   TObjFormats = set of TObjFormat;
-  
+
 
 
   TMachineInfo = record
   TMachineInfo = record
     name : string;
     name : string;
     formats : TObjFormats;
     formats : TObjFormats;
     alias : string;
     alias : string;
   end;
   end;
-  
+
   TFormatInfo = record
   TFormatInfo = record
     name : string;
     name : string;
     ext : string;
     ext : string;
@@ -100,7 +100,7 @@ var
     ('all','armv4','armv6','armv5tej','xscale','armv7');
     ('all','armv4','armv6','armv5tej','xscale','armv7');
   SubMachinesGen: array[TSubMachineTypeGeneric] of string[3] =
   SubMachinesGen: array[TSubMachineTypeGeneric] of string[3] =
     ('all');
     ('all');
-  
+
   ObjFormats : array[TObjFormat] of TFormatInfo =
   ObjFormats : array[TObjFormat] of TFormatInfo =
   (
   (
     (name : '';         ext : '';        machines : []),
     (name : '';         ext : '';        machines : []),

+ 1 - 1
utils/fpcreslipo/fpcreslipo.pp

@@ -19,7 +19,7 @@ program fpcreslipo;
 uses
 uses
   SysUtils, Classes, paramparser, msghandler, sourcehandler,
   SysUtils, Classes, paramparser, msghandler, sourcehandler,
   resource, externalreader, externalwriter;
   resource, externalreader, externalwriter;
-  
+
 const
 const
   halt_no_err = 0;
   halt_no_err = 0;
   halt_param_err = 1;
   halt_param_err = 1;

+ 1 - 1
utils/fpcreslipo/fpmake.pp

@@ -2,7 +2,7 @@
 {$mode objfpc}{$H+}
 {$mode objfpc}{$H+}
 program fpmake;
 program fpmake;
 
 
-uses 
+uses
 {$ifdef unix}
 {$ifdef unix}
   cthreads,
   cthreads,
 {$endif}
 {$endif}

+ 1 - 1
utils/fpcreslipo/msghandler.pp

@@ -43,7 +43,7 @@ type
     procedure DoVerbose(const aMsg : string);
     procedure DoVerbose(const aMsg : string);
     property Verbose : boolean read fVerbose write SetVerbose;
     property Verbose : boolean read fVerbose write SetVerbose;
   end;
   end;
-  
+
 var Messages : TMessages;
 var Messages : TMessages;
 
 
 implementation
 implementation

+ 4 - 4
utils/fpcreslipo/sourcehandler.pp

@@ -76,7 +76,7 @@ type
     property Items[index : integer] : TSourceFile read GetItem;
     property Items[index : integer] : TSourceFile read GetItem;
     property Count : integer read GetCount;
     property Count : integer read GetCount;
   end;
   end;
-  
+
 implementation
 implementation
 
 
 uses msghandler;
 uses msghandler;
@@ -149,11 +149,11 @@ begin
       Messages.DoVerbose(Format('No more resources in file %s, deleted',[fFname]));
       Messages.DoVerbose(Format('No more resources in file %s, deleted',[fFname]));
     exit;
     exit;
   end;
   end;
-  
+
   tmp:=ExtractFileDir(fFname);
   tmp:=ExtractFileDir(fFname);
   if tmp='' then tmp:='.';
   if tmp='' then tmp:='.';
   tmp:=GetTempFileName(tmp,'tmp');
   tmp:=GetTempFileName(tmp,'tmp');
-  
+
   Messages.DoVerbose(Format('Updating file %s...',[fFname]));
   Messages.DoVerbose(Format('Updating file %s...',[fFname]));
   try
   try
     aStream:=TFileStream.Create(tmp,fmCreate or fmShareDenyWrite);
     aStream:=TFileStream.Create(tmp,fmCreate or fmShareDenyWrite);
@@ -172,7 +172,7 @@ begin
   finally
   finally
     aStream.Free;
     aStream.Free;
   end;
   end;
-  
+
   if not Delete then exit;
   if not Delete then exit;
   if not RenameFile(tmp,fFname) then
   if not RenameFile(tmp,fFname) then
     Messages.DoError(Format('Can''t rename file %s to %s.',[tmp,fFname]))
     Messages.DoError(Format('Can''t rename file %s to %s.',[tmp,fFname]))

+ 2 - 2
utils/fpdoc/README.txt

@@ -54,11 +54,11 @@ fpdoc.pp
 
 
 fpdocstripper.lpr
 fpdocstripper.lpr
 fpdocstripper.lpi
 fpdocstripper.lpi
-  * Utility program that strips fpdoc xml files of all elements 
+  * Utility program that strips fpdoc xml files of all elements
     that have no documentation in them. Useful before submitting
     that have no documentation in them. Useful before submitting
 	a documentation patch as it keeps file sizes down and makes
 	a documentation patch as it keeps file sizes down and makes
 	it clearer what exactly is documented.
 	it clearer what exactly is documented.
-  
+
 makeskel.pp
 makeskel.pp
   * Skeleton XML description file generator
   * Skeleton XML description file generator
 
 

+ 16 - 16
utils/fpdoc/dglobals.pp

@@ -145,7 +145,7 @@ type
     Property TopicNode : Boolean Read FTopicNode;
     Property TopicNode : Boolean Read FTopicNode;
     Property RefCount : Integer Read FRefCount;
     Property RefCount : Integer Read FRefCount;
   end;
   end;
-  
+
 
 
 
 
   // The main FPDoc engine
   // The main FPDoc engine
@@ -695,15 +695,15 @@ var
       begin
       begin
         ClassEl := TPasElement(clslist[i]);
         ClassEl := TPasElement(clslist[i]);
         if CompareText(ClassEl.Name,s) =0 then
         if CompareText(ClassEl.Name,s) =0 then
-          exit(Classel); 
+          exit(Classel);
       end;
       end;
   end;
   end;
 
 
   function ResolveClassType(AName:String):TPasClassType;
   function ResolveClassType(AName:String):TPasClassType;
-  var 
+  var
      pkg     : TPasPackage;
      pkg     : TPasPackage;
      module  : TPasModule;
      module  : TPasModule;
-     s       : string; 
+     s       : string;
   begin
   begin
     Result:=nil;
     Result:=nil;
     s:=ResolvePackageModule(AName,pkg,module,False);
     s:=ResolvePackageModule(AName,pkg,module,False);
@@ -713,10 +713,10 @@ var
   end;
   end;
 
 
   function ResolveAliasType(AName:String):TPasAliasType;
   function ResolveAliasType(AName:String):TPasAliasType;
-  var 
+  var
      pkg     : TPasPackage;
      pkg     : TPasPackage;
      module  : TPasModule;
      module  : TPasModule;
-     s       : string; 
+     s       : string;
   begin
   begin
     Result:=nil;
     Result:=nil;
     s:=ResolvePackageModule(AName,pkg,module,False);
     s:=ResolvePackageModule(AName,pkg,module,False);
@@ -755,7 +755,7 @@ var
      instr:=trim(instr);
      instr:=trim(instr);
      i:=pos('(',instr);
      i:=pos('(',instr);
      if i>0 then
      if i>0 then
-      begin 
+      begin
         j:=length(instr)-i;
         j:=length(instr)-i;
         if instr[length(instr)]=')' then
         if instr[length(instr)]=')' then
           dec(j);
           dec(j);
@@ -766,7 +766,7 @@ var
 
 
     Function ResolveAndLinkClass(clname:String;IsClass:boolean;cls:TPasClassType):TPasClassType;
     Function ResolveAndLinkClass(clname:String;IsClass:boolean;cls:TPasClassType):TPasClassType;
     begin
     begin
-     result:=TPasClassType(ResolveClassType(clname)); 
+     result:=TPasClassType(ResolveClassType(clname));
      if assigned(result) and not (cls=result) then  // save from tobject=implicit tobject
      if assigned(result) and not (cls=result) then  // save from tobject=implicit tobject
        begin
        begin
          if IsClass then
          if IsClass then
@@ -775,7 +775,7 @@ var
 //             writeln(cls.name, ' has as ancestor ',result.pathname);
 //             writeln(cls.name, ' has as ancestor ',result.pathname);
            end
            end
          else
          else
-           begin    
+           begin
              cls.interfaces.add(result);
              cls.interfaces.add(result);
 //             writeln(cls.name, ' implements ',result.pathname);
 //             writeln(cls.name, ' implements ',result.pathname);
            end;
            end;
@@ -797,7 +797,7 @@ var
         if not assigned(module) then
         if not assigned(module) then
           exit;
           exit;
         cl2:=TPasClassType(ResolveClassType(alname));
         cl2:=TPasClassType(ResolveClassType(alname));
-        if assigned( cl2) and not (parentclass=cl2) then  
+        if assigned( cl2) and not (parentclass=cl2) then
           begin
           begin
             result:=ResolveAliasType(clname);
             result:=ResolveAliasType(clname);
             if assigned(result) then
             if assigned(result) then
@@ -829,7 +829,7 @@ var
        for i:=0 to InhInfo.Count-1 do
        for i:=0 to InhInfo.Count-1 do
          begin
          begin
            cls:=TPasClassType(InhInfo.Objects[i]);
            cls:=TPasClassType(InhInfo.Objects[i]);
-           inhclass.clear; 
+           inhclass.clear;
            inhclass.delimitedtext:=InhInfo[i];
            inhclass.delimitedtext:=InhInfo[i];
 
 
            for j:= 0 to inhclass.count-1 do
            for j:= 0 to inhclass.count-1 do
@@ -842,7 +842,7 @@ var
                    // writeln('Found alias pair ',clname,' = ',alname);
                    // writeln('Found alias pair ',clname,' = ',alname);
                    if (dleXCT in FDocLogLevels) and not assigned(CreateAliasType(alname,clname,cls,cls2)) then
                    if (dleXCT in FDocLogLevels) and not assigned(CreateAliasType(alname,clname,cls,cls2)) then
                       DoLog('Warning: creating alias %s for %s failed!',[alname,clname]);
                       DoLog('Warning: creating alias %s for %s failed!',[alname,clname]);
-                 end 
+                 end
                else
                else
                  cls2:=ResolveAndLinkClass(clname,j=0,cls);
                  cls2:=ResolveAndLinkClass(clname,j=0,cls);
              end;
              end;
@@ -1322,7 +1322,7 @@ begin
       finally
       finally
         Src.Free; // cleanup
         Src.Free; // cleanup
       end;
       end;
-    finally 
+    finally
      Parser.Free;
      Parser.Free;
      end;
      end;
   finally
   finally
@@ -1631,7 +1631,7 @@ function TFPDocEngine.GetExampleFilename(const ExElement: TDOMElement): String;
 var
 var
   i: Integer;
   i: Integer;
   fn : String;
   fn : String;
-  
+
 begin
 begin
   Result:='';
   Result:='';
   Fn:=UTF8Encode(ExElement['file']);
   Fn:=UTF8Encode(ExElement['file']);
@@ -1648,7 +1648,7 @@ begin
         Result := ExtractFilePath(DescrDocNames[i]) + FN;
         Result := ExtractFilePath(DescrDocNames[i]) + FN;
       Inc(I);
       Inc(I);
       end;
       end;
-    end;  
+    end;
   if (ExtractFileExt(Result)='') then
   if (ExtractFileExt(Result)='') then
     Result:=Result+'.pp';
     Result:=Result+'.pp';
 end;
 end;
@@ -1661,7 +1661,7 @@ procedure TranslateDocStrings(const Lang: String);
 Const
 Const
 {$ifdef unix}
 {$ifdef unix}
   DefDir = '/usr/local/share/locale';
   DefDir = '/usr/local/share/locale';
-{$else}  
+{$else}
   DefDir = 'intl';
   DefDir = 'intl';
 {$endif}
 {$endif}
 
 

+ 10 - 10
utils/fpdoc/dw_chm.pp

@@ -153,7 +153,7 @@ end;
 
 
 procedure TFpDocChmWriter.FileAdded ( AStream: TStream;
 procedure TFpDocChmWriter.FileAdded ( AStream: TStream;
   const AEntry: TFileEntryRec ) ;
   const AEntry: TFileEntryRec ) ;
-var FTsave : boolean;  
+var FTsave : boolean;
 begin
 begin
   // Exclude Full text index for files starting from the dot
   // Exclude Full text index for files starting from the dot
   if Pos('.', AEntry.Name) <> 1 then
   if Pos('.', AEntry.Name) <> 1 then
@@ -186,7 +186,7 @@ begin
   begin
   begin
     DoLog('Note: --index-page not assigned. Using default "index.html"');
     DoLog('Note: --index-page not assigned. Using default "index.html"');
   end;
   end;
-  
+
   if CSSFile <> '' then
   if CSSFile <> '' then
   begin
   begin
     if not FileExists(CSSFile) Then
     if not FileExists(CSSFile) Then
@@ -199,7 +199,7 @@ begin
   end;
   end;
 
 
   FChm.DefaultPage := FDefaultPage;
   FChm.DefaultPage := FDefaultPage;
-  
+
   if FOtherFiles <> '' then
   if FOtherFiles <> '' then
   begin
   begin
     FChm.FilesToCompress.LoadFromFile(FOtherFiles);
     FChm.FilesToCompress.LoadFromFile(FOtherFiles);
@@ -218,7 +218,7 @@ begin
   Stream := TMemoryStream.Create;
   Stream := TMemoryStream.Create;
   TMemoryStream(Stream).LoadFromFile(DataName);
   TMemoryStream(Stream).LoadFromFile(DataName);
   FileName := ExtractFileName(DataName);
   FileName := ExtractFileName(DataName);
-  
+
   if ExtractFileDir(DataName) <> '' then
   if ExtractFileDir(DataName) <> '' then
     PathInChm := ExtractRelativepath(GetCurrentDir, ExtractFileDir(DataName))
     PathInChm := ExtractRelativepath(GetCurrentDir, ExtractFileDir(DataName))
   else
   else
@@ -242,7 +242,7 @@ begin
       FChm.AppendTOC(TmpStream);
       FChm.AppendTOC(TmpStream);
       TmpStream.Size := 0;
       TmpStream.Size := 0;
     end;
     end;
-    
+
   if FAutoIndex then
   if FAutoIndex then
     GenerateIndex
     GenerateIndex
   else
   else
@@ -393,13 +393,13 @@ begin
     if RoutinesByUnitItem.Children.Item[i].Children.Count = 0 then
     if RoutinesByUnitItem.Children.Item[i].Children.Count = 0 then
       RoutinesByUnitItem.Children.Delete(i);
       RoutinesByUnitItem.Children.Delete(i);
   end;
   end;
-  
+
   for i := TOC.Items.Count-1 downto 0 do
   for i := TOC.Items.Count-1 downto 0 do
   begin
   begin
     if TOC.Items.Item[i].Children.Count = 0 then
     if TOC.Items.Item[i].Children.Count = 0 then
       TOC.Items.Delete(i);
       TOC.Items.Delete(i);
   end;
   end;
-  
+
   // Sort
   // Sort
   for i := 0 to TOC.Items.Count-1 do
   for i := 0 to TOC.Items.Count-1 do
   begin
   begin
@@ -423,7 +423,7 @@ end;
 type
 type
   TClassMemberType = (cmtProcedure, cmtFunction, cmtConstructor, cmtDestructor,
   TClassMemberType = (cmtProcedure, cmtFunction, cmtConstructor, cmtDestructor,
       cmtInterface, cmtProperty, cmtVariable, cmtOperator, cmtConstant, cmtUnknown);
       cmtInterface, cmtProperty, cmtVariable, cmtOperator, cmtConstant, cmtUnknown);
-  
+
 function ElementType(Element: TPasElement): TClassMemberType;
 function ElementType(Element: TPasElement): TClassMemberType;
 var
 var
   C: TClass;
   C: TClass;
@@ -648,8 +648,8 @@ begin
 
 
   FileName := Engine.Output;
   FileName := Engine.Output;
   if FileName = '' then
   if FileName = '' then
-    Raise Exception.Create('Error: no --output option used.'); 
-  
+    Raise Exception.Create('Error: no --output option used.');
+
   if ExtractFileExt(FileName) <> FileNameExtension then
   if ExtractFileExt(FileName) <> FileNameExtension then
     FileName := ChangeFileExt(FileName, FileNameExtension);
     FileName := ChangeFileExt(FileName, FileNameExtension);
 
 

+ 1 - 1
utils/fpdoc/dw_dxml.pp

@@ -60,7 +60,7 @@ end;
 
 
 { TDocumentation }
 { TDocumentation }
 
 
-procedure TDocumentation.Visit(obj: TPasElement); 
+procedure TDocumentation.Visit(obj: TPasElement);
 
 
 begin
 begin
   If (Obj.ClassType=TPasSection) then
   If (Obj.ClassType=TPasSection) then

+ 18 - 18
utils/fpdoc/dw_html.pp

@@ -169,7 +169,7 @@ begin
   El := Doc.CreateElement('meta');
   El := Doc.CreateElement('meta');
   HeadEl.AppendChild(El);
   HeadEl.AppendChild(El);
   El['http-equiv'] := 'Content-Type';
   El['http-equiv'] := 'Content-Type';
-  
+
   El['content'] := 'text/html; charset=utf-8';
   El['content'] := 'text/html; charset=utf-8';
   FTitleElement := Doc.CreateElement('title');
   FTitleElement := Doc.CreateElement('title');
   HeadEl.AppendChild(TitleElement);
   HeadEl.AppendChild(TitleElement);
@@ -811,7 +811,7 @@ begin
     If (FDateFormat='') then
     If (FDateFormat='') then
       S:=DateToStr(Date)
       S:=DateToStr(Date)
     else
     else
-      S:=FormatDateTime(FDateFormat,Date);  
+      S:=FormatDateTime(FDateFormat,Date);
     AppendText(F,Format(SDocDateGenerated,[S]));
     AppendText(F,Format(SDocDateGenerated,[S]));
     end;
     end;
 end;
 end;
@@ -1009,7 +1009,7 @@ begin
     If (ASubPageIndex=0) then
     If (ASubPageIndex=0) then
       CreatePackagePageBody
       CreatePackagePageBody
     else if ASubPageIndex=IndexSubIndex then
     else if ASubPageIndex=IndexSubIndex then
-      CreatePackageIndex  
+      CreatePackageIndex
     else if ASubPageIndex=ClassHierarchySubIndex then
     else if ASubPageIndex=ClassHierarchySubIndex then
       CreatePackageClassHierarchy
       CreatePackageClassHierarchy
     end
     end
@@ -1065,7 +1065,7 @@ begin
     E:=TPasElement(L.Objects[i]);
     E:=TPasElement(L.Objects[i]);
     If not (E is TPasUnresolvedTypeRef) then
     If not (E is TPasUnresolvedTypeRef) then
       begin
       begin
-      If (S<>'') then 
+      If (S<>'') then
         begin
         begin
         C:=Upcase(S[1]);
         C:=Upcase(S[1]);
         If C='_' then
         If C='_' then
@@ -1076,12 +1076,12 @@ begin
           Lists[C]:=CL;
           Lists[C]:=CL;
           end;
           end;
         end;
         end;
-      if assigned(cl) then  
+      if assigned(cl) then
         CL.AddObject(S,E);
         CL.AddObject(S,E);
-      end;  
-    end;  
-  Try  
-  // Create a quick jump table to all available letters.    
+      end;
+    end;
+  Try
+  // Create a quick jump table to all available letters.
   TableEl := CreateTable(ContentElement);
   TableEl := CreateTable(ContentElement);
   TableEl['border']:='1';
   TableEl['border']:='1';
   TableEl['width']:='50%';
   TableEl['width']:='50%';
@@ -1094,7 +1094,7 @@ begin
       If C<>'Z' then
       If C<>'Z' then
        AppendNBsp(El,1);
        AppendNBsp(El,1);
       end;
       end;
-  // Now emit all identifiers.    
+  // Now emit all identifiers.
   TableEl:=Nil;
   TableEl:=Nil;
   For C:='A' to 'Z' do
   For C:='A' to 'Z' do
     begin
     begin
@@ -1110,11 +1110,11 @@ begin
       Rows:=(CL.Count div IndexColCount);
       Rows:=(CL.Count div IndexColCount);
       If ((CL.Count Mod IndexColCount)<>0) then
       If ((CL.Count Mod IndexColCount)<>0) then
         Inc(Rows);
         Inc(Rows);
-      // Fill rows  
+      // Fill rows
       For I:=0 to Rows-1 do
       For I:=0 to Rows-1 do
         begin
         begin
         TREl := CreateTR(TableEl);
         TREl := CreateTR(TableEl);
-        For J:=0 to IndexColCount-1 do 
+        For J:=0 to IndexColCount-1 do
           begin
           begin
           El:=CreateTD_vtop(TREl);
           El:=CreateTD_vtop(TREl);
           Index:=(J*Rows)+I;
           Index:=(J*Rows)+I;
@@ -1124,14 +1124,14 @@ begin
             E:=TPasElement(CL.Objects[Index]);
             E:=TPasElement(CL.Objects[Index]);
             AppendHyperlink(El,E);
             AppendHyperlink(El,E);
             end;
             end;
-          end;  
-        end;  
+          end;
+        end;
       end; // have List
       end; // have List
     end;  // For C:=
     end;  // For C:=
   Finally
   Finally
     for C:='A' to 'Z' do
     for C:='A' to 'Z' do
       FreeAndNil(Lists[C]);
       FreeAndNil(Lists[C]);
-  end;  
+  end;
 end;
 end;
 
 
 procedure THTMLWriter.CreatePackageIndex;
 procedure THTMLWriter.CreatePackageIndex;
@@ -1141,7 +1141,7 @@ Var
   I : Integer;
   I : Integer;
   M : TPasModule;
   M : TPasModule;
   S : String;
   S : String;
-  
+
 begin
 begin
   L:=TStringList.Create;
   L:=TStringList.Create;
   try
   try
@@ -1251,7 +1251,7 @@ begin
     CreateIndexPage(L);
     CreateIndexPage(L);
   Finally
   Finally
     L.Free;
     L.Free;
-  end;  
+  end;
 end;
 end;
 
 
 procedure THTMLWriter.CreateModuleMainPage(aModule : TPasModule);
 procedure THTMLWriter.CreateModuleMainPage(aModule : TPasModule);
@@ -1385,7 +1385,7 @@ begin
       CreateModuleSimpleSubpage(aModule, ProcsSubindex, UTF8Decode(SDocProceduresAndFunctions), AModule.InterfaceSection.Functions);
       CreateModuleSimpleSubpage(aModule, ProcsSubindex, UTF8Decode(SDocProceduresAndFunctions), AModule.InterfaceSection.Functions);
     VarsSubindex:
     VarsSubindex:
       CreateModuleSimpleSubpage(aModule, VarsSubindex,UTF8Decode(SDocVariables), AModule.InterfaceSection.Variables);
       CreateModuleSimpleSubpage(aModule, VarsSubindex,UTF8Decode(SDocVariables), AModule.InterfaceSection.Variables);
-    IndexSubIndex: 
+    IndexSubIndex:
       CreateModuleIndexPage(AModule);
       CreateModuleIndexPage(AModule);
   end;
   end;
 end;
 end;

+ 10 - 10
utils/fpdoc/dw_latex.pp

@@ -164,12 +164,12 @@ Function TLaTeXWriter.SplitLine (ALine : String): String;
 
 
   Const
   Const
     NonSplit = ['a'..'z','A'..'Z','0'..'9','_'];
     NonSplit = ['a'..'z','A'..'Z','0'..'9','_'];
-   
+
    Var
    Var
      L,I : integer;
      L,I : integer;
      C : PChar;
      C : PChar;
      InString : Boolean;
      InString : Boolean;
-    
+
   begin
   begin
      Result:=0;
      Result:=0;
      L:=Length(S);
      L:=Length(S);
@@ -195,11 +195,11 @@ Function TLaTeXWriter.SplitLine (ALine : String): String;
      If (Result=0) or (Result=1) then
      If (Result=0) or (Result=1) then
        Result:=L+1;
        Result:=L+1;
    end;
    end;
-   
+
 Var
 Var
-  SP : Integer;   
+  SP : Integer;
   L : String;
   L : String;
-   
+
 begin
 begin
   Result:='';
   Result:='';
   While (Aline<>'') do
   While (Aline<>'') do
@@ -224,7 +224,7 @@ begin
     begin
     begin
     if (MaxVerbatimLength=0) or (length(S)<=MaxVerbatimLength) then
     if (MaxVerbatimLength=0) or (length(S)<=MaxVerbatimLength) then
       Result:=S
       Result:=S
-    else 
+    else
       Result:=SplitLine(S);
       Result:=SplitLine(S);
     end
     end
   else
   else
@@ -255,7 +255,7 @@ begin
     If not (S[i] in ['&','{','}','#','_','$','%','''','~','^', '\']) then
     If not (S[i] in ['&','{','}','#','_','$','%','''','~','^', '\']) then
       Result := Result + S[i]
       Result := Result + S[i]
     else
     else
-      Result:=result+'!'  
+      Result:=result+'!'
 end;
 end;
 
 
 
 
@@ -299,13 +299,13 @@ begin
   Write('}');
   Write('}');
 end;
 end;
 
 
-procedure TLaTeXWriter.DescrWriteImageEl(const AFileName, ACaption, ALinkName : DOMString); 
+procedure TLaTeXWriter.DescrWriteImageEl(const AFileName, ACaption, ALinkName : DOMString);
 
 
 Var
 Var
   FN : String;
   FN : String;
   L : Integer;
   L : Integer;
   S : String;
   S : String;
-  
+
 begin
 begin
   Writeln('\begin{figure}[ht]%');
   Writeln('\begin{figure}[ht]%');
   Writeln('\begin{center}');
   Writeln('\begin{center}');
@@ -819,7 +819,7 @@ Resourcestring
   SLatexVerbatimLengthDocs = 'Specify maximum line length for verbatim environments (default 64).';
   SLatexVerbatimLengthDocs = 'Specify maximum line length for verbatim environments (default 64).';
   SLatexImageDirDocs = 'Specify the directory where the images are stored.';
   SLatexImageDirDocs = 'Specify the directory where the images are stored.';
 
 
-class procedure TLaTeXWriter.Usage(List: TStrings); 
+class procedure TLaTeXWriter.Usage(List: TStrings);
 
 
 begin
 begin
   Inherited;
   Inherited;

+ 1 - 1
utils/fpdoc/dw_linrtf.pp

@@ -51,7 +51,7 @@ Type
     property nextitem : integer read fnextitem;
     property nextitem : integer read fnextitem;
     property previous : TEnvironment read fprevious;
     property previous : TEnvironment read fprevious;
   end;
   end;
-  
+
 
 
 type
 type
 
 

+ 12 - 12
utils/fpdoc/dw_markdown.pp

@@ -924,7 +924,7 @@ begin
     If (ASubPageIndex=0) then
     If (ASubPageIndex=0) then
       CreatePackagePageBody
       CreatePackagePageBody
     else if ASubPageIndex=IndexSubIndex then
     else if ASubPageIndex=IndexSubIndex then
-      CreatePackageIndex  
+      CreatePackageIndex
     else if ASubPageIndex=ClassHierarchySubIndex then
     else if ASubPageIndex=ClassHierarchySubIndex then
       CreatePackageClassHierarchy
       CreatePackageClassHierarchy
     end
     end
@@ -980,7 +980,7 @@ begin
     E:=TPasElement(L.Objects[i]);
     E:=TPasElement(L.Objects[i]);
     If not (E is TPasUnresolvedTypeRef) then
     If not (E is TPasUnresolvedTypeRef) then
       begin
       begin
-      If (S<>'') then 
+      If (S<>'') then
         begin
         begin
         C:=Upcase(S[1]);
         C:=Upcase(S[1]);
         If C='_' then
         If C='_' then
@@ -991,12 +991,12 @@ begin
           Lists[C]:=CL;
           Lists[C]:=CL;
           end;
           end;
         end;
         end;
-      if assigned(cl) then  
+      if assigned(cl) then
         CL.AddObject(S,E);
         CL.AddObject(S,E);
-      end;  
-    end;  
-  Try  
-  // Create a quick jump table to all available letters.    
+      end;
+    end;
+  Try
+  // Create a quick jump table to all available letters.
   CCount:=0;
   CCount:=0;
   for C:='A' to 'Z' do
   for C:='A' to 'Z' do
     If (Lists[C]<>Nil) then
     If (Lists[C]<>Nil) then
@@ -1031,7 +1031,7 @@ begin
       Rows:=(CL.Count div IndexColCount);
       Rows:=(CL.Count div IndexColCount);
       If ((CL.Count Mod IndexColCount)<>0) then
       If ((CL.Count Mod IndexColCount)<>0) then
         Inc(Rows);
         Inc(Rows);
-      // Fill rows  
+      // Fill rows
       For I:=0 to Rows-1 do
       For I:=0 to Rows-1 do
         begin
         begin
         DescrBeginTableRow;
         DescrBeginTableRow;
@@ -1053,7 +1053,7 @@ begin
   Finally
   Finally
     for C:='A' to 'Z' do
     for C:='A' to 'Z' do
       FreeAndNil(Lists[C]);
       FreeAndNil(Lists[C]);
-  end;  
+  end;
 end;
 end;
 
 
 
 
@@ -1079,7 +1079,7 @@ Var
   I : Integer;
   I : Integer;
   M : TPasModule;
   M : TPasModule;
   S : String;
   S : String;
-  
+
 begin
 begin
   L:=TStringList.Create;
   L:=TStringList.Create;
   try
   try
@@ -1199,7 +1199,7 @@ begin
     CreateIndexPage(L);
     CreateIndexPage(L);
   Finally
   Finally
     L.Free;
     L.Free;
-  end;  
+  end;
 end;
 end;
 
 
 procedure TMarkdownWriter.CreateModuleMainPageBody(AModule: TPasModule);
 procedure TMarkdownWriter.CreateModuleMainPageBody(AModule: TPasModule);
@@ -1316,7 +1316,7 @@ begin
       CreateSimpleSubpage(aModule,SDocProceduresAndFunctions, SDocProcedureOrFunction, AModule.InterfaceSection.Functions);
       CreateSimpleSubpage(aModule,SDocProceduresAndFunctions, SDocProcedureOrFunction, AModule.InterfaceSection.Functions);
     VarsSubindex:
     VarsSubindex:
       CreateSimpleSubpage(aModule,SDocVariables, SDocVariable, AModule.InterfaceSection.Variables);
       CreateSimpleSubpage(aModule,SDocVariables, SDocVariable, AModule.InterfaceSection.Variables);
-    IndexSubIndex: 
+    IndexSubIndex:
       CreateModuleIndexPage(AModule);
       CreateModuleIndexPage(AModule);
   end;
   end;
 end;
 end;

+ 10 - 10
utils/fpdoc/dw_newhtml.pp

@@ -829,7 +829,7 @@ begin
     If (FDateFormat='') then
     If (FDateFormat='') then
       S:=DateToStr(Date)
       S:=DateToStr(Date)
     else
     else
-      S:=FormatDateTime(FDateFormat,Date);  
+      S:=FormatDateTime(FDateFormat,Date);
     AppendText(lDateEl,Format(SDocDateGenerated,[S]));
     AppendText(lDateEl,Format(SDocDateGenerated,[S]));
     end;
     end;
 end;
 end;
@@ -1226,7 +1226,7 @@ begin
     If (ASubPageIndex=0) then
     If (ASubPageIndex=0) then
       CreatePackagePageBody
       CreatePackagePageBody
     else if ASubPageIndex=IndexSubIndex then
     else if ASubPageIndex=IndexSubIndex then
-      CreatePackageIndex  
+      CreatePackageIndex
     else if ASubPageIndex=ClassHierarchySubIndex then
     else if ASubPageIndex=ClassHierarchySubIndex then
       CreatePackageClassHierarchy
       CreatePackageClassHierarchy
     end
     end
@@ -1277,7 +1277,7 @@ begin
     E:=TPasElement(L.Objects[i]);
     E:=TPasElement(L.Objects[i]);
     If not (E is TPasUnresolvedTypeRef) then
     If not (E is TPasUnresolvedTypeRef) then
       begin
       begin
-      If (S<>'') then 
+      If (S<>'') then
         begin
         begin
         C:=Upcase(S[1]);
         C:=Upcase(S[1]);
         If C='_' then
         If C='_' then
@@ -1288,10 +1288,10 @@ begin
           Lists[C]:=CL;
           Lists[C]:=CL;
           end;
           end;
         end;
         end;
-      if assigned(cl) then  
+      if assigned(cl) then
         CL.AddObject(S,E);
         CL.AddObject(S,E);
-      end;  
-    end;  
+      end;
+    end;
   Try
   Try
   // Create a quick jump table to all available letters.
   // Create a quick jump table to all available letters.
   lColumns := CreateEl(aParent,'div','columns is-multiline');
   lColumns := CreateEl(aParent,'div','columns is-multiline');
@@ -1303,7 +1303,7 @@ begin
       lColumn['class']:='button is-link';
       lColumn['class']:='button is-link';
       AppendText(lColumn,UTF8Decode(C));
       AppendText(lColumn,UTF8Decode(C));
       end;
       end;
-  // Now emit all identifiers.    
+  // Now emit all identifiers.
   For C:='A' to 'Z' do
   For C:='A' to 'Z' do
     begin
     begin
     CL:=Lists[C];
     CL:=Lists[C];
@@ -1326,7 +1326,7 @@ begin
   Finally
   Finally
     for C:='A' to 'Z' do
     for C:='A' to 'Z' do
       FreeAndNil(Lists[C]);
       FreeAndNil(Lists[C]);
-  end;  
+  end;
 end;
 end;
 
 
 procedure TNewHTMLWriter.CreatePackageIndex;
 procedure TNewHTMLWriter.CreatePackageIndex;
@@ -1500,7 +1500,7 @@ begin
     PopContentElement;
     PopContentElement;
   Finally
   Finally
     L.Free;
     L.Free;
-  end;  
+  end;
 end;
 end;
 
 
 procedure TNewHTMLWriter.CreateModuleMainPage(aModule : TPasModule);
 procedure TNewHTMLWriter.CreateModuleMainPage(aModule : TPasModule);
@@ -1634,7 +1634,7 @@ begin
       CreateModuleSimpleSubpage(aModule, ProcsSubindex, UTF8Decode(SDocProceduresAndFunctions), AModule.InterfaceSection.Functions);
       CreateModuleSimpleSubpage(aModule, ProcsSubindex, UTF8Decode(SDocProceduresAndFunctions), AModule.InterfaceSection.Functions);
     VarsSubindex:
     VarsSubindex:
       CreateModuleSimpleSubpage(aModule, VarsSubindex,UTF8Decode(SDocVariables), AModule.InterfaceSection.Variables);
       CreateModuleSimpleSubpage(aModule, VarsSubindex,UTF8Decode(SDocVariables), AModule.InterfaceSection.Variables);
-    IndexSubIndex: 
+    IndexSubIndex:
       CreateModuleIndexPage(AModule);
       CreateModuleIndexPage(AModule);
   end;
   end;
 end;
 end;

+ 7 - 7
utils/fpdoc/dwriter.pp

@@ -74,7 +74,7 @@ type
 
 
   TWriterLogEvent = Procedure(Sender : TObject; Const Msg : String) of object;
   TWriterLogEvent = Procedure(Sender : TObject; Const Msg : String) of object;
   TWriterNoteEvent = Procedure(Sender : TObject; Note : TDomElement; Var EmitNote : Boolean) of object;
   TWriterNoteEvent = Procedure(Sender : TObject; Note : TDomElement; Var EmitNote : Boolean) of object;
-  
+
   { TFPDocWriter }
   { TFPDocWriter }
 
 
   TFPDocWriter = class
   TFPDocWriter = class
@@ -131,7 +131,7 @@ type
     procedure DescrEndUnderline; virtual; abstract;
     procedure DescrEndUnderline; virtual; abstract;
     procedure DescrBeginEmph; virtual; abstract;
     procedure DescrBeginEmph; virtual; abstract;
     procedure DescrEndEmph; virtual; abstract;
     procedure DescrEndEmph; virtual; abstract;
-    procedure DescrWriteImageEl(const AFileName, ACaption,ALinkName : DOMString); virtual; 
+    procedure DescrWriteImageEl(const AFileName, ACaption,ALinkName : DOMString); virtual;
     procedure DescrWriteFileEl(const AText: DOMString); virtual; abstract;
     procedure DescrWriteFileEl(const AText: DOMString); virtual; abstract;
     procedure DescrWriteKeywordEl(const AText: DOMString); virtual; abstract;
     procedure DescrWriteKeywordEl(const AText: DOMString); virtual; abstract;
     procedure DescrWriteVarEl(const AText: DOMString); virtual; abstract;
     procedure DescrWriteVarEl(const AText: DOMString); virtual; abstract;
@@ -809,7 +809,7 @@ begin
     end;
     end;
 end;
 end;
 
 
-  
+
 procedure TMultiFileDocWriter.AllocatePackagePages;
 procedure TMultiFileDocWriter.AllocatePackagePages;
 
 
 Var
 Var
@@ -1060,7 +1060,7 @@ var
   I,L: Integer;
   I,L: Integer;
   S: DOMString;
   S: DOMString;
   P : PWideChar;
   P : PWideChar;
-  
+
 begin
 begin
   S := Node.Data;
   S := Node.Data;
   Result := True;
   Result := True;
@@ -1347,7 +1347,7 @@ end;
 
 
 function IsContentNodeType(Node: TDOMNode): Boolean;
 function IsContentNodeType(Node: TDOMNode): Boolean;
 begin
 begin
-  Result := (Node.NodeType = ELEMENT_NODE) or 
+  Result := (Node.NodeType = ELEMENT_NODE) or
     ((Node.NodeType = TEXT_NODE) and not IsWhitespaceNode(TDOMText(Node))) or
     ((Node.NodeType = TEXT_NODE) and not IsWhitespaceNode(TDOMText(Node))) or
     (Node.NodeType = ENTITY_REFERENCE_NODE);
     (Node.NodeType = ENTITY_REFERENCE_NODE);
 end;
 end;
@@ -1608,7 +1608,7 @@ begin
     begin
     begin
       El := TDOMElement(Node);
       El := TDOMElement(Node);
       hlp:=AContext;
       hlp:=AContext;
-      while assigned(hlp) and not (hlp is TPasModule) do 
+      while assigned(hlp) and not (hlp is TPasModule) do
         hlp:=hlp.parent;
         hlp:=hlp.parent;
       if not (hlp is TPasModule) then
       if not (hlp is TPasModule) then
         hlp:=nil;
         hlp:=nil;
@@ -2128,7 +2128,7 @@ begin
     ConvertImage(Node as TDomElement);
     ConvertImage(Node as TDomElement);
     Result:=True;
     Result:=True;
     end;
     end;
-  end else  
+  end else
     Result := False;
     Result := False;
 end;
 end;
 
 

+ 2 - 2
utils/fpdoc/examples/basedir/readme.txt

@@ -2,10 +2,10 @@ This directory demonstrates the use of a fpdoc project file.
 It uses the files in the examples/simple directory.
 It uses the files in the examples/simple directory.
 
 
 The project file contains the names of the files without paths.
 The project file contains the names of the files without paths.
-That means that fpdoc must be executed from this directory, 
+That means that fpdoc must be executed from this directory,
 supplying the paths to the input and description files
 supplying the paths to the input and description files
 
 
 fpdoc --project=sample-project.xml --base-input-dir=../simple --base-descr-dir=../simple
 fpdoc --project=sample-project.xml --base-input-dir=../simple --base-descr-dir=../simple
 
 
-The docs will be written to a subdirectory doc. 
+The docs will be written to a subdirectory doc.
 This directory can be deleted if it is no longer necessary.
 This directory can be deleted if it is no longer necessary.

+ 1 - 1
utils/fpdoc/examples/project/readme.txt

@@ -6,5 +6,5 @@ That means that fpdoc must be executed from this directory:
 
 
 fpdoc --project=sample-project.xml
 fpdoc --project=sample-project.xml
 
 
-The docs will be written to a subdirectory doc. 
+The docs will be written to a subdirectory doc.
 This directory can be deleted if it is no longer necessary.
 This directory can be deleted if it is no longer necessary.

+ 34 - 34
utils/fpdoc/examples/simple/testunit.pp

@@ -1,6 +1,6 @@
 {$mode objfpc}
 {$mode objfpc}
 {$h+}
 {$h+}
-{$modeswitch advancedrecords} 
+{$modeswitch advancedrecords}
 
 
 unit testunit;
 unit testunit;
 
 
@@ -22,13 +22,13 @@ Const
 resourcestring
 resourcestring
   String1 = 'Resource string 1';
   String1 = 'Resource string 1';
   String2 = 'Resource string 2';
   String2 = 'Resource string 2';
-   
+
 Type
 Type
   TAnEnumType         = (one,two,three);
   TAnEnumType         = (one,two,three);
   TASetType           = Set of TAnEnumType;
   TASetType           = Set of TAnEnumType;
   TAnArrayType        = Array[1..10] of Integer;
   TAnArrayType        = Array[1..10] of Integer;
 //  TASubRangeType      = one..two;
 //  TASubRangeType      = one..two;
-  TABooleanArrayType  = Array[Boolean] of Integer;  
+  TABooleanArrayType  = Array[Boolean] of Integer;
   TARecordType        = Record
   TARecordType        = Record
                          X,Y : Integer;
                          X,Y : Integer;
                          Z : String;
                          Z : String;
@@ -38,25 +38,25 @@ Type
                           Case Integer of
                           Case Integer of
                            1 : (X,Y : Integer);
                            1 : (X,Y : Integer);
                            2 : (phi,Omega : Real);
                            2 : (phi,Omega : Real);
-                        end; 
+                        end;
   TAVariantRecordType2 = Record
   TAVariantRecordType2 = Record
                           A : String;
                           A : String;
                           Case Atype : Integer of
                           Case Atype : Integer of
                             1 : (X,Y : Integer);
                             1 : (X,Y : Integer);
                             2 : (phi,Omega : Real);
                             2 : (phi,Omega : Real);
-                          end; 
-                          
+                          end;
+
   TADeprecatedType = Integer deprecated;
   TADeprecatedType = Integer deprecated;
 
 
   TMethodRecord = Record
   TMethodRecord = Record
-  
+
   Private
   Private
     Const aconst = 123;
     Const aconst = 123;
-  private  
+  private
     X22 : Integer;
     X22 : Integer;
     Procedure SetX(AValue : Integer);
     Procedure SetX(AValue : Integer);
     Function GetX : Integer;
     Function GetX : Integer;
-  Public  
+  Public
     Procedure MyMethod;
     Procedure MyMethod;
     Property MyX : Integer Read GetX Write SetX;
     Property MyX : Integer Read GetX Write SetX;
   Case Integer of
   Case Integer of
@@ -65,12 +65,12 @@ Type
   end;
   end;
   TAExtRecordType        = Record
   TAExtRecordType        = Record
     Const X = 100;
     Const X = 100;
-  public  
+  public
     class operator assign(Y : Integer) : TAExtRecordType;
     class operator assign(Y : Integer) : TAExtRecordType;
   end;
   end;
-                        
+
 Var
 Var
-  ASimpleVar : Integer;  
+  ASimpleVar : Integer;
   ATypedVar  : TMethod;
   ATypedVar  : TMethod;
   ARecordVar : Record
   ARecordVar : Record
                  A,B : integer;
                  A,B : integer;
@@ -78,25 +78,25 @@ Var
   AnArrayVar : Array[1..10] of Integer;
   AnArrayVar : Array[1..10] of Integer;
   ATypedArray : Array[TanEnumType] of Integer;
   ATypedArray : Array[TanEnumType] of Integer;
   AInitVar : Integer = 1;
   AInitVar : Integer = 1;
-  
+
   ADeprecatedVar : Integer deprecated;
   ADeprecatedVar : Integer deprecated;
   ACVarVar : Integer; cvar;
   ACVarVar : Integer; cvar;
   AnExternalVar : Integer; external name 'avar';
   AnExternalVar : Integer; external name 'avar';
   AnExternalLibVar : Integer; external 'library' name 'avar';
   AnExternalLibVar : Integer; external 'library' name 'avar';
-      
+
 Procedure SimpleProc;
 Procedure SimpleProc;
 Procedure OverloadedProc(A : Integer);
 Procedure OverloadedProc(A : Integer);
 Procedure OverloadedProc(B : String);
 Procedure OverloadedProc(B : String);
 Function SimpleFunc : Integer;
 Function SimpleFunc : Integer;
 Function OverloadedFunc(A: Integer) : Integer;
 Function OverloadedFunc(A: Integer) : Integer;
-Function OverloadedFunc(B : String) : Integer;  
+Function OverloadedFunc(B : String) : Integer;
 
 
-Procedure ConstArgProc(Const A : Integer); 
-Procedure VarArgProc(Var A : Integer); 
-Procedure OutArgProc(Out A : Integer); 
-Procedure UntypedVarArgProc(Var A); 
-Procedure UntypedConstArgProc(const A); 
-Procedure UntypedOutArgProc(Out A); 
+Procedure ConstArgProc(Const A : Integer);
+Procedure VarArgProc(Var A : Integer);
+Procedure OutArgProc(Out A : Integer);
+Procedure UntypedVarArgProc(Var A);
+Procedure UntypedConstArgProc(const A);
+Procedure UntypedOutArgProc(Out A);
 
 
 Procedure ArrayArgProc (A : TAnArrayType);
 Procedure ArrayArgProc (A : TAnArrayType);
 Procedure OpenArrayArgProc(A : Array of string);
 Procedure OpenArrayArgProc(A : Array of string);
@@ -106,12 +106,12 @@ Procedure externalproc; external;
 Procedure externalnameProc; external name 'aname';
 Procedure externalnameProc; external name 'aname';
 Procedure externallibnameProc; external 'alibrary' name 'aname';
 Procedure externallibnameProc; external 'alibrary' name 'aname';
 
 
-Type 
+Type
 
 
   { TMyParentClass }
   { TMyParentClass }
 
 
   TMyParentClass = Class(TComponent)
   TMyParentClass = Class(TComponent)
-  Private 
+  Private
     FI : Integer;
     FI : Integer;
     function GetA(AIndex : Integer): String;
     function GetA(AIndex : Integer): String;
     function GetIP(AIndex: integer): String;
     function GetIP(AIndex: integer): String;
@@ -121,7 +121,7 @@ Type
     Function ReadI : Integer;
     Function ReadI : Integer;
   Protected
   Protected
     Procedure AProtectedMethod;
     Procedure AProtectedMethod;
-    Property AProtectedProp : Integer Read FI Write FI;  
+    Property AProtectedProp : Integer Read FI Write FI;
   Public
   Public
     Constructor Create(AOwner : TComponent); override;
     Constructor Create(AOwner : TComponent); override;
     Destructor Destroy; override;
     Destructor Destroy; override;
@@ -131,7 +131,7 @@ Type
     Procedure AStringMessageProc(Var Msg); Message '123';
     Procedure AStringMessageProc(Var Msg); Message '123';
     Procedure ADeprecatedProc; deprecated;
     Procedure ADeprecatedProc; deprecated;
     Procedure APlatformProc; Platform;
     Procedure APlatformProc; Platform;
-    function MyFunc : Integer; 
+    function MyFunc : Integer;
     Property IntProp : Integer Read FI Write Fi;
     Property IntProp : Integer Read FI Write Fi;
     Property IntROProp : Integer Read FI;
     Property IntROProp : Integer Read FI;
     Property GetIntProp : Integer Read ReadI Write WriteI;
     Property GetIntProp : Integer Read ReadI Write WriteI;
@@ -141,7 +141,7 @@ Type
   Published
   Published
     Procedure SomePublishedMethod;
     Procedure SomePublishedMethod;
   end;
   end;
-  
+
   { TMyChildClass }
   { TMyChildClass }
 
 
   TMyChildClass = Class(TMyParentClass)
   TMyChildClass = Class(TMyParentClass)
@@ -154,7 +154,7 @@ Type
 
 
 Operator + (A,B : TAnArrayType) : TAnArrayType;
 Operator + (A,B : TAnArrayType) : TAnArrayType;
 Operator multiply (A,B : TAnArrayType) : TAnArrayType;
 Operator multiply (A,B : TAnArrayType) : TAnArrayType;
-  
+
 Implementation
 Implementation
 
 
 Procedure SimpleProc;
 Procedure SimpleProc;
@@ -177,7 +177,7 @@ Function OverloadedFunc(A: Integer) : Integer;
 begin
 begin
 end;
 end;
 
 
-Function OverloadedFunc(B : String) : Integer;  
+Function OverloadedFunc(B : String) : Integer;
 begin
 begin
 end;
 end;
 
 
@@ -193,27 +193,27 @@ Procedure ConstArrayArgProc(A : Array of const);
 begin
 begin
 end;
 end;
 
 
-Procedure ConstArgProc(Const A : Integer); 
+Procedure ConstArgProc(Const A : Integer);
 begin
 begin
 end;
 end;
 
 
-Procedure VarArgProc(Var A : Integer); 
+Procedure VarArgProc(Var A : Integer);
 begin
 begin
 end;
 end;
 
 
-Procedure OutArgProc(Out A : Integer); 
+Procedure OutArgProc(Out A : Integer);
 begin
 begin
 end;
 end;
 
 
-Procedure UntypedVarArgProc(Var A); 
+Procedure UntypedVarArgProc(Var A);
 begin
 begin
 end;
 end;
 
 
-Procedure UntypedConstArgProc(const A); 
+Procedure UntypedConstArgProc(const A);
 begin
 begin
 end;
 end;
 
 
-Procedure UntypedOutArgProc(Out A); 
+Procedure UntypedOutArgProc(Out A);
 begin
 begin
 end;
 end;
 
 

+ 12 - 12
utils/fpdoc/fpclasschart.pp

@@ -460,7 +460,7 @@ end;
 
 
 
 
 { ---------------------------------------------------------------------
 { ---------------------------------------------------------------------
-  Main program. Document all units.    
+  Main program. Document all units.
   ---------------------------------------------------------------------}
   ---------------------------------------------------------------------}
 
 
 Function MergeNodes(Doc : TXMLDocument;Dest,Source : TDomElement) : Integer;
 Function MergeNodes(Doc : TXMLDocument;Dest,Source : TDomElement) : Integer;
@@ -618,9 +618,9 @@ end;
   ---------------------------------------------------------------------}
   ---------------------------------------------------------------------}
 
 
 
 
-var  
+var
   cmdObjectKind : TPasObjKind;
   cmdObjectKind : TPasObjKind;
-  InputFiles, 
+  InputFiles,
   MergeFiles : TStringList;
   MergeFiles : TStringList;
   DocLang : String;
   DocLang : String;
   OutputName: String;
   OutputName: String;
@@ -639,9 +639,9 @@ begin
 end;
 end;
 
 
 { ---------------------------------------------------------------------
 { ---------------------------------------------------------------------
-  Usage  
+  Usage
   ---------------------------------------------------------------------}
   ---------------------------------------------------------------------}
-  
+
 Procedure Usage;
 Procedure Usage;
 
 
 begin
 begin
@@ -760,11 +760,11 @@ end;
 
 
 
 
 { ---------------------------------------------------------------------
 { ---------------------------------------------------------------------
-  Main Program  
+  Main Program
   ---------------------------------------------------------------------}
   ---------------------------------------------------------------------}
-  
+
 Procedure Run;
 Procedure Run;
-  
+
 var
 var
   E: Integer;
   E: Integer;
 
 
@@ -772,7 +772,7 @@ begin
   WriteLn(STitle);
   WriteLn(STitle);
   WriteLn(Format(SVersion, [FPCVersion, FPCDate]));
   WriteLn(Format(SVersion, [FPCVersion, FPCDate]));
   WriteLn(SCopyright);
   WriteLn(SCopyright);
- 
+
   InitOptions;
   InitOptions;
   Try
   Try
     E:=ParseCommandLine;
     E:=ParseCommandLine;
@@ -781,12 +781,12 @@ begin
     WriteLn;
     WriteLn;
     AnalyseFiles(OutputName,InputFiles,MergeFiles,cmdObjectKind);
     AnalyseFiles(OutputName,InputFiles,MergeFiles,cmdObjectKind);
     WriteLn(StdErr,SDone);
     WriteLn(StdErr,SDone);
-  Finally  
+  Finally
     FreeOptions;
     FreeOptions;
-  end;  
+  end;
 end;
 end;
 
 
 Begin
 Begin
-  Run;  
+  Run;
 end.
 end.
 
 

+ 1 - 1
utils/fpdoc/fpde/frmabout.pp

@@ -57,4 +57,4 @@ end;
 
 
 
 
 
 
-end.  
+end.

+ 1 - 1
utils/fpdoc/fpde/frmlink.pp

@@ -83,4 +83,4 @@ begin
 end;
 end;
 
 
 
 
-end.  
+end.

+ 1 - 1
utils/fpdoc/fpde/frmnewnode.pp

@@ -78,4 +78,4 @@ begin
 end;
 end;
 
 
 
 
-end.  
+end.

+ 1 - 1
utils/fpdoc/fpde/frmtable.pp

@@ -94,4 +94,4 @@ begin
 end;
 end;
 
 
 
 
-end.  
+end.

+ 5 - 5
utils/fpdoc/fpdocstripper.pp

@@ -53,7 +53,7 @@ var
   E : TDomElement;
   E : TDomElement;
   CN : TDomNode;
   CN : TDomNode;
   B : Boolean;
   B : Boolean;
-  
+
 begin
 begin
   // Exit procedure if no more nodes to process
   // Exit procedure if no more nodes to process
   if Node = nil then Exit;
   if Node = nil then Exit;
@@ -74,17 +74,17 @@ begin
       B:=(CN.HasChildNodes=false) and
       B:=(CN.HasChildNodes=false) and
          (CN.HasAttributes=false) and
          (CN.HasAttributes=false) and
          (CN.TextContent='');
          (CN.TextContent='');
-      // Empty elements that do not link to others   
+      // Empty elements that do not link to others
       if not B then
       if not B then
         begin
         begin
         if (CN is TDomElement) then
         if (CN is TDomElement) then
           begin
           begin
           E:=CN as TDomElement;
           E:=CN as TDomElement;
-          B:=(E.NodeName='element') 
+          B:=(E.NodeName='element')
              and (E.HasChildNodes=false)
              and (E.HasChildNodes=false)
              and (E['name']<>'') and (E['link']='');
              and (E['name']<>'') and (E['link']='');
           end;
           end;
-        end;   
+        end;
       end;
       end;
     if B then
     if B then
       Node.RemoveChild(CN);
       Node.RemoveChild(CN);
@@ -125,7 +125,7 @@ begin
   end;
   end;
 
 
   FStripComments:=not HasOption('keepcomments');
   FStripComments:=not HasOption('keepcomments');
-  
+
   if HasOption('output') then begin
   if HasOption('output') then begin
     FOutputFile:=ExpandFileName(GetOptionValue('output'));
     FOutputFile:=ExpandFileName(GetOptionValue('output'));
   end else begin
   end else begin

+ 1 - 1
utils/fpdoc/fpmake.pp

@@ -2,7 +2,7 @@
 {$mode objfpc}{$H+}
 {$mode objfpc}{$H+}
 program fpmake;
 program fpmake;
 
 
-uses 
+uses
 {$ifdef unix}
 {$ifdef unix}
   cthreads,
   cthreads,
 {$endif}
 {$endif}

+ 48 - 48
utils/fpdoc/makeskel.pp

@@ -43,7 +43,7 @@ type
   Private
   Private
     FEl : TPasElement;
     FEl : TPasElement;
     FNode : TDocNode;
     FNode : TDocNode;
-  Public  
+  Public
     Constructor Create(AnElement : TPasElement; ADocNode : TDocNode);
     Constructor Create(AnElement : TPasElement; ADocNode : TDocNode);
     Property Element : TPasElement Read FEl;
     Property Element : TPasElement Read FEl;
     Property DocNode : TDocNode Read FNode;
     Property DocNode : TDocNode Read FNode;
@@ -53,7 +53,7 @@ type
 
 
   TSkelEngine = class(TFPDocEngine)
   TSkelEngine = class(TFPDocEngine)
   Private
   Private
-    FEmittedList, 
+    FEmittedList,
     FNodeList,
     FNodeList,
     FModules : TStringList;
     FModules : TStringList;
     Procedure  DoWriteUnReferencedNodes(N : TDocNode; NodePath : String);
     Procedure  DoWriteUnReferencedNodes(N : TDocNode; NodePath : String);
@@ -92,8 +92,8 @@ var
   DisablePrivate,
   DisablePrivate,
   DisableFunctionResults: Boolean;
   DisableFunctionResults: Boolean;
   EmitClassSeparator: Boolean;
   EmitClassSeparator: Boolean;
-  
-  
+
+
 Constructor TNodePair.Create(AnElement : TPasElement; ADocNode : TDocNode);
 Constructor TNodePair.Create(AnElement : TPasElement; ADocNode : TDocNode);
 
 
 begin
 begin
@@ -101,7 +101,7 @@ begin
   FNode:=ADocNode;
   FNode:=ADocNode;
 end;
 end;
 
 
-function TSkelEngine.FindModule(const AName: String): TPasModule; 
+function TSkelEngine.FindModule(const AName: String): TPasModule;
 
 
 Var
 Var
   I : Integer;
   I : Integer;
@@ -122,21 +122,21 @@ begin
       FModules.AddObject(AName,Result);
       FModules.AddObject(AName,Result);
       end
       end
     else
     else
-      Result:=FModules.Objects[i] as TPasModule;  
-    end;  
+      Result:=FModules.Objects[i] as TPasModule;
+    end;
 end;
 end;
 
 
-Destructor TSkelEngine.Destroy; 
+Destructor TSkelEngine.Destroy;
 
 
 Var
 Var
   I : Integer;
   I : Integer;
 
 
 begin
 begin
-  If Assigned(FModules) then 
+  If Assigned(FModules) then
     begin
     begin
    { For I:=0 to FModules.Count-1 do
    { For I:=0 to FModules.Count-1 do
       FModules.Objects[i].Release;}
       FModules.Objects[i].Release;}
-    FreeAndNil(FModules);    
+    FreeAndNil(FModules);
     end;
     end;
 end;
 end;
 
 
@@ -189,7 +189,7 @@ begin
     Result:=(Not Assigned(FEmittedList) or (FEmittedList.IndexOf(El.FullName)=-1));
     Result:=(Not Assigned(FEmittedList) or (FEmittedList.IndexOf(El.FullName)=-1));
     If DisableOverride and (El is TPasProcedure) then
     If DisableOverride and (El is TPasProcedure) then
       Result:=Not TPasProcedure(El).IsOverride;
       Result:=Not TPasProcedure(El).IsOverride;
-    end;  
+    end;
 end;
 end;
 
 
 
 
@@ -216,12 +216,12 @@ begin
   // Track this element
   // Track this element
   If UpdateMode then
   If UpdateMode then
     begin
     begin
-    DN:=FindDocNode(Result);    
+    DN:=FindDocNode(Result);
     If Assigned(DN) then
     If Assigned(DN) then
       DN.IncRefCount;
       DN.IncRefCount;
     end
     end
   else
   else
-    DN:=Nil;  
+    DN:=Nil;
   // See if we need to write documentation for it
   // See if we need to write documentation for it
   If MustWriteElement(Result,False) then
   If MustWriteElement(Result,False) then
     FNodeList.AddObject(Result.PathName,TNodePair.Create(Result,DN));
     FNodeList.AddObject(Result.PathName,TNodePair.Create(Result,DN));
@@ -247,15 +247,15 @@ Function TSkelEngine.WriteElement(Var F : Text;El : TPasElement; ADocNode : TDoc
               (InheritsFrom(TPasResString)) or
               (InheritsFrom(TPasResString)) or
               (InheritsFrom(TPasVariable));
               (InheritsFrom(TPasVariable));
   end;
   end;
-  
+
   Function NeedDeclaration(El : TPasElement) : boolean;
   Function NeedDeclaration(El : TPasElement) : boolean;
-  
+
   begin
   begin
-    Result:=IsTypeVarConst(El) 
-            or WriteOnlyShort(El) 
-            or EL.InheritsFrom(TPasProcedure) 
+    Result:=IsTypeVarConst(El)
+            or WriteOnlyShort(El)
+            or EL.InheritsFrom(TPasProcedure)
   end;
   end;
-    
+
 begin
 begin
   // Check again, this time with full declaration.
   // Check again, this time with full declaration.
   Result:=MustWriteElement(El,True);
   Result:=MustWriteElement(El,True);
@@ -276,9 +276,9 @@ begin
     WriteLn(f, '-->');
     WriteLn(f, '-->');
     WriteLn(f);
     WriteLn(f);
     end;
     end;
-  If Not (WriteDeclaration and NeedDeclaration(El)) then  
+  If Not (WriteDeclaration and NeedDeclaration(El)) then
     Writeln(F,'<!-- ', El.ElementTypeName,' Visibility: ',VisibilityNames[El.Visibility], ' -->')
     Writeln(F,'<!-- ', El.ElementTypeName,' Visibility: ',VisibilityNames[El.Visibility], ' -->')
-  else  
+  else
     begin
     begin
     Writeln(F,'<!-- ',El.ElementTypeName,' Visibility: ',VisibilityNames[El.Visibility]);
     Writeln(F,'<!-- ',El.ElementTypeName,' Visibility: ',VisibilityNames[El.Visibility]);
     Writeln(F,'     Declaration: ',El.GetDeclaration(True),' -->');
     Writeln(F,'     Declaration: ',El.GetDeclaration(True),' -->');
@@ -331,7 +331,7 @@ Procedure TSkelEngine.WriteNodes(Var F : Text; AModule : TPasModule; List : TStr
 Var
 Var
   P : TNodePair;
   P : TNodePair;
   I : integer;
   I : integer;
-  
+
 begin
 begin
   WriteLn(f);
   WriteLn(f);
   WriteLn(f, '<!--');
   WriteLn(f, '<!--');
@@ -347,18 +347,18 @@ begin
     WriteLn(f, '<descr>');
     WriteLn(f, '<descr>');
     WriteLn(f, '</descr>');
     WriteLn(f, '</descr>');
     end;
     end;
-  Try 
+  Try
     For I:=0 to List.Count-1 do
     For I:=0 to List.Count-1 do
       begin
       begin
       P:=List.Objects[i] as TNodePair;
       P:=List.Objects[i] as TNodePair;
       If (P.Element<>AModule) then
       If (P.Element<>AModule) then
         WriteElement(F,P.Element,P.DocNode);
         WriteElement(F,P.Element,P.DocNode);
-      end;  
+      end;
   Finally
   Finally
     WriteLn(f, '');
     WriteLn(f, '');
     WriteLn(f, '</module> <!-- ', AModule.Name, ' -->');
     WriteLn(f, '</module> <!-- ', AModule.Name, ' -->');
     WriteLn(f, '');
     WriteLn(f, '');
-  end;   
+  end;
 end;
 end;
 
 
 Procedure TSkelEngine.DocumentFile(Var F : Text; Const AFileName,ATarget,ACPU : String);
 Procedure TSkelEngine.DocumentFile(Var F : Text; Const AFileName,ATarget,ACPU : String);
@@ -407,25 +407,25 @@ begin
            N.IncRefCount;
            N.IncRefCount;
         ResolveOperators;
         ResolveOperators;
         end;
         end;
-      If SortNodes then  
-        FNodelist.Sorted:=True;   
-      WriteNodes(F,Module,FNodeList);  
+      If SortNodes then
+        FNodelist.Sorted:=True;
+      WriteNodes(F,Module,FNodeList);
       If UpdateMode then
       If UpdateMode then
         WriteUnReferencedNodes;
         WriteUnReferencedNodes;
     Finally
     Finally
       FEmittedList.Free;
       FEmittedList.Free;
-    end;  
-  Finally  
+    end;
+  Finally
     For I:=0 to FNodeList.Count-1 do
     For I:=0 to FNodeList.Count-1 do
       FNodeList.Objects[i].Free;
       FNodeList.Objects[i].Free;
-    FNodeList.Free;  
-  end;  
+    FNodeList.Free;
+  end;
 end;
 end;
 
 
 { ---------------------------------------------------------------------
 { ---------------------------------------------------------------------
-  Main program. Document all units.    
+  Main program. Document all units.
   ---------------------------------------------------------------------}
   ---------------------------------------------------------------------}
-  
+
 Function DocumentPackage(Const APackageName,AOutputName : String; InputFiles,DescrFiles : TStrings) : String;
 Function DocumentPackage(Const APackageName,AOutputName : String; InputFiles,DescrFiles : TStrings) : String;
 
 
 Var
 Var
@@ -451,7 +451,7 @@ begin
           if UpdateMode then
           if UpdateMode then
             For J:=0 to DescrFiles.Count-1 do
             For J:=0 to DescrFiles.Count-1 do
               Engine.AddDocFile(DescrFiles[J]);
               Engine.AddDocFile(DescrFiles[J]);
-          Try    
+          Try
             Engine.DocumentFile(F,InputFiles[I],OSTarget,CPUTarget);
             Engine.DocumentFile(F,InputFiles[I],OSTarget,CPUTarget);
           except
           except
             on E:Exception do
             on E:Exception do
@@ -477,13 +477,13 @@ end;
 { ---------------------------------------------------------------------
 { ---------------------------------------------------------------------
     Option management
     Option management
   ---------------------------------------------------------------------}
   ---------------------------------------------------------------------}
-  
 
 
-var  
-  InputFiles, 
+
+var
+  InputFiles,
   DescrFiles : TStringList;
   DescrFiles : TStringList;
   DocLang : String;
   DocLang : String;
-  PackageName, 
+  PackageName,
   OutputName: String;
   OutputName: String;
 
 
 procedure InitOptions;
 procedure InitOptions;
@@ -593,7 +593,7 @@ Const
 var
 var
   MOFilename: string;
   MOFilename: string;
   i: Integer;
   i: Integer;
-  
+
 begin
 begin
   Result:=0;
   Result:=0;
   DocLang:='';
   DocLang:='';
@@ -623,9 +623,9 @@ begin
 end;
 end;
 
 
 { ---------------------------------------------------------------------
 { ---------------------------------------------------------------------
-  Usage  
+  Usage
   ---------------------------------------------------------------------}
   ---------------------------------------------------------------------}
-  
+
 Procedure Usage;
 Procedure Usage;
 
 
 begin
 begin
@@ -654,11 +654,11 @@ begin
 end;
 end;
 
 
 { ---------------------------------------------------------------------
 { ---------------------------------------------------------------------
-  Main Program  
+  Main Program
   ---------------------------------------------------------------------}
   ---------------------------------------------------------------------}
-  
+
 Procedure Run;
 Procedure Run;
-  
+
 var
 var
   E: Integer;
   E: Integer;
 
 
@@ -680,12 +680,12 @@ begin
       DocumentPackage(PackageName,OutputName,InputFiles,DescrFiles);
       DocumentPackage(PackageName,OutputName,InputFiles,DescrFiles);
       WriteLn(SDone);
       WriteLn(SDone);
       end;
       end;
-  Finally  
+  Finally
     FreeOptions;
     FreeOptions;
-  end;  
+  end;
 end;
 end;
 
 
 Begin
 Begin
-  Run;  
+  Run;
 end.
 end.
 
 

+ 4 - 4
utils/fpdoc/sh_pas.pp

@@ -111,15 +111,15 @@ var
     dest[dp] := source[0]; Inc(dp); Inc(source);
     dest[dp] := source[0]; Inc(dp); Inc(source);
   end;
   end;
   procedure PutChars(S : String);
   procedure PutChars(S : String);
-  
+
   Var
   Var
     C : char;
     C : char;
-  
+
   begin
   begin
     for C in S do
     for C in S do
       begin
       begin
-      dest[dp] := c; 
-      Inc(dp); 
+      dest[dp] := c;
+      Inc(dp);
       Inc(source);
       Inc(source);
       end;
       end;
   end;
   end;

+ 1 - 1
utils/fpmc/dumpfile.pp

@@ -24,4 +24,4 @@ begin
   If Col<>1 then
   If Col<>1 then
     Writeln;
     Writeln;
 end.
 end.
-    
+

+ 1 - 1
utils/fpmc/fpmake.pp

@@ -2,7 +2,7 @@
 {$mode objfpc}{$H+}
 {$mode objfpc}{$H+}
 program fpmake;
 program fpmake;
 
 
-uses 
+uses
 {$ifdef unix}
 {$ifdef unix}
   cthreads,
   cthreads,
 {$endif}
 {$endif}

+ 2 - 2
utils/fppkg/fpmake.pp

@@ -2,10 +2,10 @@
 {$mode objfpc}{$H+}
 {$mode objfpc}{$H+}
 program fpmake;
 program fpmake;
 
 
-uses 
+uses
 {$ifdef unix}
 {$ifdef unix}
   cthreads,
   cthreads,
-{$endif} 
+{$endif}
   fpmkunit;
   fpmkunit;
 {$endif ALLPACKAGES}
 {$endif ALLPACKAGES}
 
 

+ 32 - 32
utils/fppkg/lnet/fastcgi_base.pp

@@ -18,7 +18,7 @@ interface
 }
 }
 
 
 const
 const
-   FCGI_LISTENSOCK_FILENO = 0;     
+   FCGI_LISTENSOCK_FILENO = 0;
 
 
 type
 type
 
 
@@ -39,33 +39,33 @@ type
 }
 }
 
 
 const
 const
-   FCGI_HEADER_LEN = 8;     
+   FCGI_HEADER_LEN = 8;
 
 
 {
 {
  * Value for version component of FCGI_Header
  * Value for version component of FCGI_Header
 }
 }
-   FCGI_VERSION_1 = 1;     
+   FCGI_VERSION_1 = 1;
 
 
 {
 {
  * Values for type component of FCGI_Header
  * Values for type component of FCGI_Header
 }
 }
-   FCGI_BEGIN_REQUEST = 1;     
-   FCGI_ABORT_REQUEST = 2;     
-   FCGI_END_REQUEST = 3;     
-   FCGI_PARAMS = 4;     
-   FCGI_STDIN = 5;     
-   FCGI_STDOUT = 6;     
-   FCGI_STDERR = 7;     
-   FCGI_DATA = 8;     
-   FCGI_GET_VALUES = 9;     
-   FCGI_GET_VALUES_RESULT = 10;     
-   FCGI_UNKNOWN_TYPE = 11;     
-   FCGI_MAXTYPE = FCGI_UNKNOWN_TYPE;     
-   
+   FCGI_BEGIN_REQUEST = 1;
+   FCGI_ABORT_REQUEST = 2;
+   FCGI_END_REQUEST = 3;
+   FCGI_PARAMS = 4;
+   FCGI_STDIN = 5;
+   FCGI_STDOUT = 6;
+   FCGI_STDERR = 7;
+   FCGI_DATA = 8;
+   FCGI_GET_VALUES = 9;
+   FCGI_GET_VALUES_RESULT = 10;
+   FCGI_UNKNOWN_TYPE = 11;
+   FCGI_MAXTYPE = FCGI_UNKNOWN_TYPE;
+
 {
 {
  * Value for requestId component of FCGI_Header
  * Value for requestId component of FCGI_Header
 }
 }
-   FCGI_NULL_REQUEST_ID = 0;     
+   FCGI_NULL_REQUEST_ID = 0;
 
 
 type
 type
    FCGI_BeginRequestBody = record
    FCGI_BeginRequestBody = record
@@ -79,21 +79,21 @@ type
       header : FCGI_Header;
       header : FCGI_Header;
       body : FCGI_BeginRequestBody;
       body : FCGI_BeginRequestBody;
    end;
    end;
-   
+
 {
 {
  * Mask for flags component of FCGI_BeginRequestBody
  * Mask for flags component of FCGI_BeginRequestBody
 }
 }
 
 
 const
 const
-   FCGI_KEEP_CONN = 1;     
-   
+   FCGI_KEEP_CONN = 1;
+
 {
 {
  * Values for role component of FCGI_BeginRequestBody
  * Values for role component of FCGI_BeginRequestBody
 }
 }
 
 
-   FCGI_RESPONDER = 1;     
-   FCGI_AUTHORIZER = 2;     
-   FCGI_FILTER = 3;     
+   FCGI_RESPONDER = 1;
+   FCGI_AUTHORIZER = 2;
+   FCGI_FILTER = 3;
 
 
 type
 type
 
 
@@ -110,24 +110,24 @@ type
       header : FCGI_Header;
       header : FCGI_Header;
       body : FCGI_EndRequestBody;
       body : FCGI_EndRequestBody;
    end;
    end;
-   
+
 {
 {
  * Values for protocolStatus component of FCGI_EndRequestBody
  * Values for protocolStatus component of FCGI_EndRequestBody
 }
 }
 
 
 const
 const
-   FCGI_REQUEST_COMPLETE = 0;     
-   FCGI_CANT_MPX_CONN = 1;     
-   FCGI_OVERLOADED = 2;     
-   FCGI_UNKNOWN_ROLE = 3;     
-   
+   FCGI_REQUEST_COMPLETE = 0;
+   FCGI_CANT_MPX_CONN = 1;
+   FCGI_OVERLOADED = 2;
+   FCGI_UNKNOWN_ROLE = 3;
+
 {
 {
  * Variable names for FCGI_GET_VALUES / FCGI_GET_VALUES_RESULT records
  * Variable names for FCGI_GET_VALUES / FCGI_GET_VALUES_RESULT records
 }
 }
 
 
-   FCGI_MAX_CONNS = 'FCGI_MAX_CONNS';     
-   FCGI_MAX_REQS = 'FCGI_MAX_REQS';     
-   FCGI_MPXS_CONNS = 'FCGI_MPXS_CONNS';     
+   FCGI_MAX_CONNS = 'FCGI_MAX_CONNS';
+   FCGI_MAX_REQS = 'FCGI_MAX_REQS';
+   FCGI_MPXS_CONNS = 'FCGI_MPXS_CONNS';
 
 
 type
 type
 
 

+ 10 - 10
utils/fppkg/lnet/lcommon.pp

@@ -15,7 +15,7 @@
   You should have received a Copy of the GNU Library General Public License
   You should have received a Copy of the GNU Library General Public License
   along with This library; if not, Write to the Free Software Foundation,
   along with This library; if not, Write to the Free Software Foundation,
   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-  
+
   This license has been modified. See File LICENSE.ADDON for more inFormation.
   This license has been modified. See File LICENSE.ADDON for more inFormation.
   Should you find these sources without a LICENSE File, please contact
   Should you find these sources without a LICENSE File, please contact
   me at [email protected]
   me at [email protected]
@@ -64,7 +64,7 @@ const
         LMSG = 0;
         LMSG = 0;
       {$ENDIF}
       {$ENDIF}
     {$ENDIF}
     {$ENDIF}
-    
+
     {$IFDEF DARWIN}
     {$IFDEF DARWIN}
     SO_NOSIGPIPE = $1022; // for fpc 2.0.4
     SO_NOSIGPIPE = $1022; // for fpc 2.0.4
     {$ENDIF}
     {$ENDIF}
@@ -106,7 +106,7 @@ type
       LAF_INET  : (IPv4: TInetSockAddr);
       LAF_INET  : (IPv4: TInetSockAddr);
       LAF_INET6 : (IPv6: TInetSockAddr6);
       LAF_INET6 : (IPv6: TInetSockAddr6);
   end;
   end;
-  
+
   { Base functions }
   { Base functions }
   {$IFNDEF UNIX}
   {$IFNDEF UNIX}
   function fpSelect(const nfds: Integer; const readfds, writefds, exceptfds: PFDSet;
   function fpSelect(const nfds: Integer; const readfds, writefds, exceptfds: PFDSet;
@@ -123,7 +123,7 @@ type
 
 
   function LStrError(const Ernum: Longint; const UseUTF8: Boolean = False): string;
   function LStrError(const Ernum: Longint; const UseUTF8: Boolean = False): string;
   function LSocketError: Longint;
   function LSocketError: Longint;
-  
+
   function SetBlocking(const aHandle: Integer; const aValue: Boolean): Boolean;
   function SetBlocking(const aHandle: Integer; const aValue: Boolean): Boolean;
 //  function SetNoDelay(const aHandle: Integer; const aValue: Boolean): Boolean;
 //  function SetNoDelay(const aHandle: Integer; const aValue: Boolean): Boolean;
 
 
@@ -137,20 +137,20 @@ type
   function HostAddrToStr(const Entry: Cardinal): string; inline;
   function HostAddrToStr(const Entry: Cardinal): string; inline;
   function StrToNetAddr(const IP: string): Cardinal; inline;
   function StrToNetAddr(const IP: string): Cardinal; inline;
   function NetAddrToStr(const Entry: Cardinal): string; inline;
   function NetAddrToStr(const Entry: Cardinal): string; inline;
-  
+
   procedure FillAddressInfo(var aAddrInfo: TLSocketAddress; const aFamily: sa_family_t;
   procedure FillAddressInfo(var aAddrInfo: TLSocketAddress; const aFamily: sa_family_t;
                             const Address: string; const aPort: Word);
                             const Address: string; const aPort: Word);
-                            
+
 implementation
 implementation
 
 
 uses
 uses
   StrUtils
   StrUtils
-  
+
 {$IFNDEF UNIX}
 {$IFNDEF UNIX}
 
 
 {$IFDEF WINDOWS}
 {$IFDEF WINDOWS}
   , Windows, lws2tcpip;
   , Windows, lws2tcpip;
-  
+
 {$IFDEF WINCE}
 {$IFDEF WINCE}
 
 
 function LStrError(const Ernum: Longint; const UseUTF8: Boolean = False): string;
 function LStrError(const Ernum: Longint; const UseUTF8: Boolean = False): string;
@@ -216,7 +216,7 @@ end;
 
 
 {$ELSE}
 {$ELSE}
   ; // uses
   ; // uses
-  
+
 function LStrError(const Ernum: Longint; const UseUTF8: Boolean = False): string;
 function LStrError(const Ernum: Longint; const UseUTF8: Boolean = False): string;
 begin
 begin
   Result := IntToStr(Ernum); // TODO: fix for non-windows winsock users
   Result := IntToStr(Ernum); // TODO: fix for non-windows winsock users
@@ -431,7 +431,7 @@ begin
   opt := fpfcntl(aHandle, F_GETFL);
   opt := fpfcntl(aHandle, F_GETFL);
   if opt = SOCKET_ERROR then
   if opt = SOCKET_ERROR then
     Exit(False);
     Exit(False);
-    
+
   if aValue then
   if aValue then
     opt := opt and not O_NONBLOCK
     opt := opt and not O_NONBLOCK
   else
   else

+ 2 - 2
utils/fppkg/lnet/lcontrolstack.pp

@@ -32,7 +32,7 @@ const
 
 
 type
 type
   TLOnFull = procedure of object;
   TLOnFull = procedure of object;
-  
+
   TLControlStack = class
   TLControlStack = class
    private
    private
     FItems: array of Char;
     FItems: array of Char;
@@ -62,7 +62,7 @@ uses
 (* The normal situation is that there are up to TL_CSLENGTH items on the stack. *)
 (* The normal situation is that there are up to TL_CSLENGTH items on the stack. *)
 (* However this may be relaxed in cases (assumed to be rare) where subcommand   *)
 (* However this may be relaxed in cases (assumed to be rare) where subcommand   *)
 (* parameters are being accumulated.                                            *)
 (* parameters are being accumulated.                                            *)
-  
+
 constructor TLControlStack.Create;
 constructor TLControlStack.Create;
 begin
 begin
   FOnFull:=nil;
   FOnFull:=nil;

+ 11 - 11
utils/fppkg/lnet/levents.pp

@@ -15,7 +15,7 @@
   You should have received a Copy of the GNU Library General Public License
   You should have received a Copy of the GNU Library General Public License
   along with This library; if not, Write to the Free Software Foundation,
   along with This library; if not, Write to the Free Software Foundation,
   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-  
+
   This license has been modified. See File LICENSE.ADDON for more inFormation.
   This license has been modified. See File LICENSE.ADDON for more inFormation.
   Should you find these sources without a LICENSE File, please contact
   Should you find these sources without a LICENSE File, please contact
   me at [email protected]
   me at [email protected]
@@ -47,7 +47,7 @@ type
   TLHandleEvent = procedure (aHandle: TLHandle) of object;
   TLHandleEvent = procedure (aHandle: TLHandle) of object;
   TLHandleErrorEvent = procedure (aHandle: TLHandle; const msg: string) of object;
   TLHandleErrorEvent = procedure (aHandle: TLHandle; const msg: string) of object;
   TLEventerErrorEvent = procedure (const msg: string; Sender: TLEventer) of object;
   TLEventerErrorEvent = procedure (const msg: string; Sender: TLEventer) of object;
-  
+
   { TLHandle }
   { TLHandle }
 
 
   TLHandle = class(TObject)
   TLHandle = class(TObject)
@@ -66,7 +66,7 @@ type
     FNext: TLHandle;
     FNext: TLHandle;
     FFreeNext: TLHandle;
     FFreeNext: TLHandle;
     FInternalData: Pointer;
     FInternalData: Pointer;
-    
+
     procedure SetIgnoreError(const aValue: Boolean);
     procedure SetIgnoreError(const aValue: Boolean);
     procedure SetIgnoreWrite(const aValue: Boolean);
     procedure SetIgnoreWrite(const aValue: Boolean);
     procedure SetIgnoreRead(const aValue: Boolean);
     procedure SetIgnoreRead(const aValue: Boolean);
@@ -171,7 +171,7 @@ type
     property Count: Integer read GetCount;
     property Count: Integer read GetCount;
   end;
   end;
   TLEventerClass = class of TLEventer;
   TLEventerClass = class of TLEventer;
-  
+
   { TLSelectEventer }
   { TLSelectEventer }
 
 
   TLSelectEventer = class(TLEventer)
   TLSelectEventer = class(TLEventer)
@@ -187,21 +187,21 @@ type
     constructor Create; override;
     constructor Create; override;
     function CallAction: Boolean; override;
     function CallAction: Boolean; override;
   end;
   end;
-  
+
 {$i sys/lkqueueeventerh.inc}
 {$i sys/lkqueueeventerh.inc}
 {$i sys/lepolleventerh.inc}
 {$i sys/lepolleventerh.inc}
 
 
   function BestEventerClass: TLEventerClass;
   function BestEventerClass: TLEventerClass;
-  
+
 implementation
 implementation
 
 
 uses
 uses
   syncobjs,
   syncobjs,
   lCommon;
   lCommon;
-  
+
 var
 var
   CS: TCriticalSection;
   CS: TCriticalSection;
-  
+
 { TLHandle }
 { TLHandle }
 
 
 procedure TLHandle.SetIgnoreError(const aValue: Boolean);
 procedure TLHandle.SetIgnoreError(const aValue: Boolean);
@@ -286,7 +286,7 @@ end;
 
 
 procedure TLTimer.CallAction;
 procedure TLTimer.CallAction;
 begin
 begin
-  if FEnabled and Assigned(FOnTimer) and (Now - FStarted >= FInterval) then 
+  if FEnabled and Assigned(FOnTimer) and (Now - FStarted >= FInterval) then
   begin
   begin
     FOnTimer(Self);
     FOnTimer(Self);
     if not FOneShot then
     if not FOneShot then
@@ -574,11 +574,11 @@ begin
     n := fpSelect(MaxHandle + 1, @FReadFDSet, @FWriteFDSet, @FErrorFDSet, @TempTime)
     n := fpSelect(MaxHandle + 1, @FReadFDSet, @FWriteFDSet, @FErrorFDSet, @TempTime)
   else
   else
     n := fpSelect(MaxHandle + 1, @FReadFDSet, @FWriteFDSet, @FErrorFDSet, nil);
     n := fpSelect(MaxHandle + 1, @FReadFDSet, @FWriteFDSet, @FErrorFDSet, nil);
-  
+
   if n < 0 then
   if n < 0 then
     Bail('Error on select', LSocketError);
     Bail('Error on select', LSocketError);
   Result := n > 0;
   Result := n > 0;
-  
+
   if Result then begin
   if Result then begin
     Temp := FRoot;
     Temp := FRoot;
     while Assigned(Temp) do begin
     while Assigned(Temp) do begin

+ 16 - 16
utils/fppkg/lnet/lfastcgi.pp

@@ -15,7 +15,7 @@
   You should have received a Copy of the GNU Library General Public License
   You should have received a Copy of the GNU Library General Public License
   along with This library; if not, Write to the Free Software Foundation,
   along with This library; if not, Write to the Free Software Foundation,
   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-  
+
   This license has been modified. See file LICENSE.ADDON for more information.
   This license has been modified. See file LICENSE.ADDON for more information.
   Should you find these sources without a LICENSE File, please contact
   Should you find these sources without a LICENSE File, please contact
   me at [email protected]
   me at [email protected]
@@ -74,7 +74,7 @@ type
   public
   public
     constructor Create;
     constructor Create;
     destructor Destroy; override;
     destructor Destroy; override;
-    
+
     procedure AbortRequest;
     procedure AbortRequest;
     function  Get(ABuffer: pchar; ASize: integer): integer;
     function  Get(ABuffer: pchar; ASize: integer): integer;
     procedure ParseClientBuffer;
     procedure ParseClientBuffer;
@@ -96,9 +96,9 @@ type
     property OnStderr: TLFastCGIRequestEvent read FOnStderr write FOnStderr;
     property OnStderr: TLFastCGIRequestEvent read FOnStderr write FOnStderr;
   end;
   end;
 
 
-  TFastCGIClientState = (fsIdle, fsConnecting, fsConnectingAgain, 
+  TFastCGIClientState = (fsIdle, fsConnecting, fsConnectingAgain,
     fsStartingServer, fsHeader, fsData, fsFlush);
     fsStartingServer, fsHeader, fsData, fsFlush);
-  
+
   PLFastCGIClient = ^TLFastCGIClient;
   PLFastCGIClient = ^TLFastCGIClient;
   TLFastCGIClient = class(TLTcp)
   TLFastCGIClient = class(TLTcp)
   protected
   protected
@@ -160,7 +160,7 @@ type
     FHost: string;
     FHost: string;
     FPort: integer;
     FPort: integer;
     FSpawnState: TSpawnState;
     FSpawnState: TSpawnState;
-    
+
     procedure AddToFreeClients(AClient: TLFastCGIClient);
     procedure AddToFreeClients(AClient: TLFastCGIClient);
     function  CreateClient: TLFastCGIClient;
     function  CreateClient: TLFastCGIClient;
     procedure ConnectClients(Sender: TObject);
     procedure ConnectClients(Sender: TObject);
@@ -307,7 +307,7 @@ begin
   end else
   end else
     Result := 1;
     Result := 1;
 end;
 end;
-  
+
 procedure FillFastCGIStringSize(const AStr: string; var AFastCGIStr: TLFastCGIStringSize);
 procedure FillFastCGIStringSize(const AStr: string; var AFastCGIStr: TLFastCGIStringSize);
 var
 var
   lLen: dword;
   lLen: dword;
@@ -348,7 +348,7 @@ begin
   FillFastCGIStringSize(AName, lNameLen);
   FillFastCGIStringSize(AName, lNameLen);
   FillFastCGIStringSize(AValue, lValueLen);
   FillFastCGIStringSize(AValue, lValueLen);
   lTotalLen := lNameLen.Size+lValueLen.Size+Length(AName)+Length(AValue);
   lTotalLen := lNameLen.Size+lValueLen.Size+Length(AName)+Length(AValue);
-  if (FHeader.ReqType = AReqType) and (FBufferSendPos = 0) 
+  if (FHeader.ReqType = AReqType) and (FBufferSendPos = 0)
     and (0 <= FHeaderPos) and (FHeaderPos < FBuffer.Pos - FBuffer.Memory) then
     and (0 <= FHeaderPos) and (FHeaderPos < FBuffer.Pos - FBuffer.Memory) then
   begin
   begin
     { undo padding }
     { undo padding }
@@ -420,7 +420,7 @@ begin
   { already a queue and we are not first in line ? no use in trying to send then }
   { already a queue and we are not first in line ? no use in trying to send then }
   if (FClient.FSendRequest = nil) or (FClient.FSendRequest = Self) then
   if (FClient.FSendRequest = nil) or (FClient.FSendRequest = Self) then
   begin
   begin
-    lWritten := FClient.Send(FBuffer.Memory[FBufferSendPos], 
+    lWritten := FClient.Send(FBuffer.Memory[FBufferSendPos],
       FBuffer.Pos-FBuffer.Memory-FBufferSendPos);
       FBuffer.Pos-FBuffer.Memory-FBufferSendPos);
     Inc(FBufferSendPos, lWritten);
     Inc(FBufferSendPos, lWritten);
     Result := FBufferSendPos = FBuffer.Pos-FBuffer.Memory;
     Result := FBufferSendPos = FBuffer.Pos-FBuffer.Memory;
@@ -438,7 +438,7 @@ var
   lWritten: integer;
   lWritten: integer;
 begin
 begin
   { already a queue and we are not first in line ? no use in trying to send then }
   { already a queue and we are not first in line ? no use in trying to send then }
-  if (FClient.FSendRequest <> nil) and (FClient.FSendRequest <> Self) then 
+  if (FClient.FSendRequest <> nil) and (FClient.FSendRequest <> Self) then
     exit(0);
     exit(0);
 
 
   { header to be sent? }
   { header to be sent? }
@@ -519,7 +519,7 @@ end;
 function TLFastCGIClient.GetBuffer(ABuffer: pchar; ASize: integer): integer;
 function TLFastCGIClient.GetBuffer(ABuffer: pchar; ASize: integer): integer;
 begin
 begin
   Result := FBufferEnd - FBufferPos;
   Result := FBufferEnd - FBufferPos;
-  if Result > FContentLength then 
+  if Result > FContentLength then
     Result := FContentLength;
     Result := FContentLength;
   if Result > ASize then
   if Result > ASize then
     Result := ASize;
     Result := ASize;
@@ -568,13 +568,13 @@ begin
       else
       else
         FRequests[I].EndRequest;
         FRequests[I].EndRequest;
     end;
     end;
-  if needReconnect then 
+  if needReconnect then
     Connect;
     Connect;
 end;
 end;
 
 
 procedure TLFastCGIClient.ErrorEvent(ASocket: TLHandle; const msg: string);
 procedure TLFastCGIClient.ErrorEvent(ASocket: TLHandle; const msg: string);
 begin
 begin
-  if (FState = fsConnectingAgain) 
+  if (FState = fsConnectingAgain)
     or ((FState = fsConnecting) and (FPool.FSpawnState = ssSpawned)) then
     or ((FState = fsConnecting) and (FPool.FSpawnState = ssSpawned)) then
   begin
   begin
     FRequest.DoEndRequest;
     FRequest.DoEndRequest;
@@ -705,10 +705,10 @@ begin
         end else
         end else
           Flush;
           Flush;
       end;
       end;
-      fsData: 
+      fsData:
       begin
       begin
         FRequest.HandleReceive;
         FRequest.HandleReceive;
-        if FContentLength = 0 then 
+        if FContentLength = 0 then
           Flush
           Flush
         else begin
         else begin
           FRequest.FOutputPending := true;
           FRequest.FOutputPending := true;
@@ -805,7 +805,7 @@ begin
   if FPool <> nil then
   if FPool <> nil then
     FPool.EndRequest(Self);
     FPool.EndRequest(Self);
 end;
 end;
-   
+
 { TLFastCGIPool }
 { TLFastCGIPool }
 
 
 constructor TLFastCGIPool.Create;
 constructor TLFastCGIPool.Create;
@@ -876,7 +876,7 @@ end;
 procedure TLFastCGIPool.AddToFreeClients(AClient: TLFastCGIClient);
 procedure TLFastCGIPool.AddToFreeClients(AClient: TLFastCGIClient);
 begin
 begin
   if AClient.FNextFree <> nil then exit;
   if AClient.FNextFree <> nil then exit;
-  
+
   if FFreeClient = nil then
   if FFreeClient = nil then
     FFreeClient := AClient
     FFreeClient := AClient
   else
   else

+ 40 - 40
utils/fppkg/lnet/lftp.pp

@@ -30,7 +30,7 @@ interface
 
 
 uses
 uses
   Classes, lNet, lTelnet;
   Classes, lNet, lTelnet;
-  
+
 const
 const
   DEFAULT_FTP_PORT    = 1025;
   DEFAULT_FTP_PORT    = 1025;
 
 
@@ -41,16 +41,16 @@ type
   TLFTPStatus = (fsNone, fsCon, fsUser, fsPass, fsPasv, fsPort, fsList, fsRetr,
   TLFTPStatus = (fsNone, fsCon, fsUser, fsPass, fsPasv, fsPort, fsList, fsRetr,
                  fsStor, fsType, fsCWD, fsMKD, fsRMD, fsDEL, fsRNFR, fsRNTO,
                  fsStor, fsType, fsCWD, fsMKD, fsRMD, fsDEL, fsRNFR, fsRNTO,
                  fsSYS, fsFeat, fsPWD, fsHelp, fsLast);
                  fsSYS, fsFeat, fsPWD, fsHelp, fsLast);
-                 
+
   TLFTPStatusSet = set of TLFTPStatus;
   TLFTPStatusSet = set of TLFTPStatus;
-                 
+
   TLFTPStatusRec = record
   TLFTPStatusRec = record
     Status: TLFTPStatus;
     Status: TLFTPStatus;
     Args: array[1..2] of string;
     Args: array[1..2] of string;
   end;
   end;
-  
+
   TLFTPTransferMethod = (ftActive, ftPassive);
   TLFTPTransferMethod = (ftActive, ftPassive);
-                 
+
   TLFTPClientStatusEvent = procedure (aSocket: TLSocket;
   TLFTPClientStatusEvent = procedure (aSocket: TLSocket;
                                      const aStatus: TLFTPStatus) of object;
                                      const aStatus: TLFTPStatus) of object;
 
 
@@ -60,7 +60,7 @@ type
   {$DEFINE __front_type__  :=  TLFTPStatusRec}
   {$DEFINE __front_type__  :=  TLFTPStatusRec}
   {$i lcontainersh.inc}
   {$i lcontainersh.inc}
   TLFTPStatusFront = TLFront;
   TLFTPStatusFront = TLFront;
-  
+
   TLFTP = class(TLComponent, ILDirect)
   TLFTP = class(TLComponent, ILDirect)
    protected
    protected
     FControl: TLTelnetClient;
     FControl: TLTelnetClient;
@@ -71,7 +71,7 @@ type
     FFeatureString: string;
     FFeatureString: string;
 
 
     function GetConnected: Boolean; virtual;
     function GetConnected: Boolean; virtual;
-    
+
     function GetTimeout: Integer;
     function GetTimeout: Integer;
     procedure SetTimeout(const Value: Integer);
     procedure SetTimeout(const Value: Integer);
 
 
@@ -84,13 +84,13 @@ type
    public
    public
     constructor Create(aOwner: TComponent); override;
     constructor Create(aOwner: TComponent); override;
     destructor Destroy; override;
     destructor Destroy; override;
-    
+
     function Get(out aData; const aSize: Integer; aSocket: TLSocket = nil): Integer; virtual; abstract;
     function Get(out aData; const aSize: Integer; aSocket: TLSocket = nil): Integer; virtual; abstract;
     function GetMessage(out msg: string; aSocket: TLSocket = nil): Integer; virtual; abstract;
     function GetMessage(out msg: string; aSocket: TLSocket = nil): Integer; virtual; abstract;
-    
+
     function Send(const aData; const aSize: Integer; aSocket: TLSocket = nil): Integer; virtual; abstract;
     function Send(const aData; const aSize: Integer; aSocket: TLSocket = nil): Integer; virtual; abstract;
     function SendMessage(const msg: string; aSocket: TLSocket = nil): Integer; virtual; abstract;
     function SendMessage(const msg: string; aSocket: TLSocket = nil): Integer; virtual; abstract;
-    
+
    public
    public
     property Connected: Boolean read GetConnected;
     property Connected: Boolean read GetConnected;
     property Timeout: Integer read GetTimeout write SetTimeout;
     property Timeout: Integer read GetTimeout write SetTimeout;
@@ -103,7 +103,7 @@ type
   end;
   end;
 
 
   { TLFTPTelnetClient }
   { TLFTPTelnetClient }
-  
+
   TLFTPTelnetClient = class(TLTelnetClient)
   TLFTPTelnetClient = class(TLTelnetClient)
    protected
    protected
     function React(const Operation, Command: Char):boolean; override;
     function React(const Operation, Command: Char):boolean; override;
@@ -144,7 +144,7 @@ type
     procedure OnControlRe(aSocket: TLSocket);
     procedure OnControlRe(aSocket: TLSocket);
     procedure OnControlCo(aSocket: TLSocket);
     procedure OnControlCo(aSocket: TLSocket);
     procedure OnControlDs(aSocket: TLSocket);
     procedure OnControlDs(aSocket: TLSocket);
-    
+
     procedure ClearStatusFlags;
     procedure ClearStatusFlags;
 
 
     function GetCurrentStatus: TLFTPStatus;
     function GetCurrentStatus: TLFTPStatus;
@@ -183,25 +183,25 @@ type
 
 
     function Get(out aData; const aSize: Integer; aSocket: TLSocket = nil): Integer; override;
     function Get(out aData; const aSize: Integer; aSocket: TLSocket = nil): Integer; override;
     function GetMessage(out msg: string; aSocket: TLSocket = nil): Integer; override;
     function GetMessage(out msg: string; aSocket: TLSocket = nil): Integer; override;
-    
+
     function Send(const aData; const aSize: Integer; aSocket: TLSocket = nil): Integer; override;
     function Send(const aData; const aSize: Integer; aSocket: TLSocket = nil): Integer; override;
     function SendMessage(const msg: string; aSocket: TLSocket = nil): Integer; override;
     function SendMessage(const msg: string; aSocket: TLSocket = nil): Integer; override;
-    
+
     function Connect(const aHost: string; const aPort: Word = 21): Boolean; virtual; overload;
     function Connect(const aHost: string; const aPort: Word = 21): Boolean; virtual; overload;
     function Connect: Boolean; virtual; overload;
     function Connect: Boolean; virtual; overload;
-    
+
     function Authenticate(const aUsername, aPassword: string): Boolean;
     function Authenticate(const aUsername, aPassword: string): Boolean;
-    
+
     function GetData(out aData; const aSize: Integer): Integer;
     function GetData(out aData; const aSize: Integer): Integer;
     function GetDataMessage: string;
     function GetDataMessage: string;
-    
+
     function Retrieve(const FileName: string): Boolean;
     function Retrieve(const FileName: string): Boolean;
     function Put(const FileName: string): Boolean; virtual; // because of LCLsocket
     function Put(const FileName: string): Boolean; virtual; // because of LCLsocket
-    
+
     function ChangeDirectory(const DestPath: string): Boolean;
     function ChangeDirectory(const DestPath: string): Boolean;
     function MakeDirectory(const DirName: string): Boolean;
     function MakeDirectory(const DirName: string): Boolean;
     function RemoveDirectory(const DirName: string): Boolean;
     function RemoveDirectory(const DirName: string): Boolean;
-    
+
     function DeleteFile(const FileName: string): Boolean;
     function DeleteFile(const FileName: string): Boolean;
     function Rename(const FromName, ToName: string): Boolean;
     function Rename(const FromName, ToName: string): Boolean;
    public
    public
@@ -211,9 +211,9 @@ type
     procedure ListFeatures;
     procedure ListFeatures;
     procedure PresentWorkingDirectory;
     procedure PresentWorkingDirectory;
     procedure Help(const Arg: string);
     procedure Help(const Arg: string);
-    
+
     procedure Disconnect(const Forced: Boolean = True); override;
     procedure Disconnect(const Forced: Boolean = True); override;
-    
+
     procedure CallAction; override;
     procedure CallAction; override;
    public
    public
     property StatusSet: TLFTPStatusSet read FStatusSet write FStatusSet;
     property StatusSet: TLFTPStatusSet read FStatusSet write FStatusSet;
@@ -234,9 +234,9 @@ type
     property OnSuccess: TLFTPClientStatusEvent read FOnSuccess write FOnSuccess;
     property OnSuccess: TLFTPClientStatusEvent read FOnSuccess write FOnSuccess;
     property OnFailure: TLFTPClientStatusEvent read FOnFailure write FOnFailure;
     property OnFailure: TLFTPClientStatusEvent read FOnFailure write FOnFailure;
   end;
   end;
-  
+
   function FTPStatusToStr(const aStatus: TLFTPStatus): string;
   function FTPStatusToStr(const aStatus: TLFTPStatus): string;
-  
+
 implementation
 implementation
 
 
 uses
 uses
@@ -306,7 +306,7 @@ end;
 procedure TLFTP.SetCreator(AValue: TLComponent);
 procedure TLFTP.SetCreator(AValue: TLComponent);
 begin
 begin
   inherited SetCreator(AValue);
   inherited SetCreator(AValue);
-  
+
   FControl.Creator := AValue;
   FControl.Creator := AValue;
   FData.Creator := AValue;
   FData.Creator := AValue;
 end;
 end;
@@ -403,7 +403,7 @@ begin
 
 
   FStatus := TLFTPStatusFront.Create(EMPTY_REC);
   FStatus := TLFTPStatusFront.Create(EMPTY_REC);
   FCommandFront := TLFTPStatusFront.Create(EMPTY_REC);
   FCommandFront := TLFTPStatusFront.Create(EMPTY_REC);
-  
+
   FStoreFile := nil;
   FStoreFile := nil;
 end;
 end;
 
 
@@ -446,13 +446,13 @@ end;
 procedure TLFTPClient.OnControlEr(const msg: string; aSocket: TLSocket);
 procedure TLFTPClient.OnControlEr(const msg: string; aSocket: TLSocket);
 begin
 begin
   FSending := False;
   FSending := False;
-  
+
   if Assigned(FOnFailure) then begin
   if Assigned(FOnFailure) then begin
     while not FStatus.Empty do
     while not FStatus.Empty do
       FOnFailure(aSocket, FStatus.Remove.Status);
       FOnFailure(aSocket, FStatus.Remove.Status);
   end else
   end else
     FStatus.Clear;
     FStatus.Clear;
-    
+
   ClearStatusFlags;
   ClearStatusFlags;
 
 
   if Assigned(FOnError) then
   if Assigned(FOnError) then
@@ -648,25 +648,25 @@ procedure TLFTPClient.EvaluateAnswer(const Ans: string);
       FStatus.Remove;
       FStatus.Remove;
     end;
     end;
   end;
   end;
-  
+
   procedure SendFile;
   procedure SendFile;
   begin
   begin
     FStoreFile.Position := 0;
     FStoreFile.Position := 0;
     FSending := True;
     FSending := True;
     SendChunk(False);
     SendChunk(False);
   end;
   end;
-  
+
   function ValidResponse(const Answer: string): Boolean; inline;
   function ValidResponse(const Answer: string): Boolean; inline;
   begin
   begin
     Result := (Length(Ans) >= 3) and
     Result := (Length(Ans) >= 3) and
             (Ans[1] in ['1'..'5']) and
             (Ans[1] in ['1'..'5']) and
             (Ans[2] in ['0'..'9']) and
             (Ans[2] in ['0'..'9']) and
             (Ans[3] in ['0'..'9']);
             (Ans[3] in ['0'..'9']);
-            
+
     if Result then
     if Result then
       Result := (Length(Ans) = 3) or ((Length(Ans) > 3) and (Ans[4] = ' '));
       Result := (Length(Ans) = 3) or ((Length(Ans) > 3) and (Ans[4] = ' '));
   end;
   end;
-  
+
   procedure Eventize(const aStatus: TLFTPStatus; const Res: Boolean);
   procedure Eventize(const aStatus: TLFTPStatus; const Res: Boolean);
   begin
   begin
     FStatus.Remove;
     FStatus.Remove;
@@ -678,7 +678,7 @@ procedure TLFTPClient.EvaluateAnswer(const Ans: string);
         FOnFailure(FData.Iterator, aStatus);
         FOnFailure(FData.Iterator, aStatus);
     end;
     end;
   end;
   end;
-  
+
 var
 var
   x: Integer;
   x: Integer;
 begin
 begin
@@ -723,7 +723,7 @@ begin
                        Eventize(FStatus.First.Status, False);
                        Eventize(FStatus.First.Status, False);
                      end;
                      end;
                  end;
                  end;
-                 
+
         fsPass : case x of
         fsPass : case x of
                    230:
                    230:
                      begin
                      begin
@@ -782,7 +782,7 @@ begin
 
 
         fsStor : case x of
         fsStor : case x of
                    125, 150: SendFile;
                    125, 150: SendFile;
-                   
+
                    226:
                    226:
                      begin
                      begin
                        Eventize(FStatus.First.Status, True);
                        Eventize(FStatus.First.Status, True);
@@ -844,7 +844,7 @@ begin
                        Eventize(FStatus.First.Status, False);
                        Eventize(FStatus.First.Status, False);
                      end;
                      end;
                  end;
                  end;
-                 
+
         fsMKD  : case x of
         fsMKD  : case x of
                    250, 257:
                    250, 257:
                      begin
                      begin
@@ -857,7 +857,7 @@ begin
                        Eventize(FStatus.First.Status, False);
                        Eventize(FStatus.First.Status, False);
                      end;
                      end;
                  end;
                  end;
-                 
+
         fsRMD,
         fsRMD,
         fsDEL  : case x of
         fsDEL  : case x of
                    250:
                    250:
@@ -871,7 +871,7 @@ begin
                        Eventize(FStatus.First.Status, False);
                        Eventize(FStatus.First.Status, False);
                      end;
                      end;
                  end;
                  end;
-                 
+
         fsRNFR : case x of
         fsRNFR : case x of
                    350:
                    350:
                      begin
                      begin
@@ -883,7 +883,7 @@ begin
                        Eventize(FStatus.First.Status, False);
                        Eventize(FStatus.First.Status, False);
                      end;
                      end;
                  end;
                  end;
-                 
+
         fsRNTO : case x of
         fsRNTO : case x of
                    250:
                    250:
                      begin
                      begin
@@ -921,13 +921,13 @@ procedure TLFTPClient.PasvPort;
     Result := IntToStr(aPort div 256);
     Result := IntToStr(aPort div 256);
     Result := Result + ',' + IntToStr(aPort mod 256);
     Result := Result + ',' + IntToStr(aPort mod 256);
   end;
   end;
-  
+
   function StringIP: string;
   function StringIP: string;
   begin
   begin
     Result := StringReplace(FControl.Connection.Iterator.LocalAddress, '.', ',',
     Result := StringReplace(FControl.Connection.Iterator.LocalAddress, '.', ',',
                           [rfReplaceAll]) + ',';
                           [rfReplaceAll]) + ',';
   end;
   end;
-  
+
 begin
 begin
   if FTransferMethod = ftActive then begin
   if FTransferMethod = ftActive then begin
     Writedbg(['Sent PORT']);
     Writedbg(['Sent PORT']);

+ 53 - 53
utils/fppkg/lnet/lhttp.pp

@@ -15,7 +15,7 @@
   You should have received a Copy of the GNU Library General Public License
   You should have received a Copy of the GNU Library General Public License
   along with This library; if not, Write to the Free Software Foundation,
   along with This library; if not, Write to the Free Software Foundation,
   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-  
+
   This license has been modified. See file LICENSE.ADDON for more information.
   This license has been modified. See file LICENSE.ADDON for more information.
   Should you find these sources without a LICENSE File, please contact
   Should you find these sources without a LICENSE File, please contact
   me at [email protected]
   me at [email protected]
@@ -38,7 +38,7 @@ type
     hpAccept, hpAcceptCharset, hpAcceptEncoding, hpAcceptLanguage, hpHost,
     hpAccept, hpAcceptCharset, hpAcceptEncoding, hpAcceptLanguage, hpHost,
     hpFrom, hpReferer, hpUserAgent, hpRange, hpTransferEncoding,
     hpFrom, hpReferer, hpUserAgent, hpRange, hpTransferEncoding,
     hpIfModifiedSince, hpIfUnmodifiedSince, hpCookie);
     hpIfModifiedSince, hpIfUnmodifiedSince, hpCookie);
-  TLHTTPStatus = (hsUnknown, hsOK, hsNoContent, hsMovedPermanently, hsFound, hsNotModified, 
+  TLHTTPStatus = (hsUnknown, hsOK, hsNoContent, hsMovedPermanently, hsFound, hsNotModified,
     hsBadRequest, hsForbidden, hsNotFound, hsPreconditionFailed, hsRequestTooLong,
     hsBadRequest, hsForbidden, hsNotFound, hsPreconditionFailed, hsRequestTooLong,
     hsInternalError, hsNotImplemented, hsNotAllowed);
     hsInternalError, hsNotImplemented, hsNotAllowed);
   TLHTTPTransferEncoding = (teIdentity, teChunked);
   TLHTTPTransferEncoding = (teIdentity, teChunked);
@@ -46,19 +46,19 @@ type
     ceUnsupportedEncoding);
     ceUnsupportedEncoding);
 
 
 const
 const
-  HTTPDisconnectStatuses = [hsBadRequest, hsRequestTooLong, hsForbidden, 
+  HTTPDisconnectStatuses = [hsBadRequest, hsRequestTooLong, hsForbidden,
     hsInternalError, hsNotAllowed];
     hsInternalError, hsNotAllowed];
   HTTPMethodStrings: array[TLHTTPMethod] of string =
   HTTPMethodStrings: array[TLHTTPMethod] of string =
     ('HEAD', 'GET', 'POST', '');
     ('HEAD', 'GET', 'POST', '');
   HTTPParameterStrings: array[TLHTTPParameter] of string =
   HTTPParameterStrings: array[TLHTTPParameter] of string =
-    ('CONNECTION', 'CONTENT-LENGTH', 'CONTENT-TYPE', 'ACCEPT', 
+    ('CONNECTION', 'CONTENT-LENGTH', 'CONTENT-TYPE', 'ACCEPT',
      'ACCEPT-CHARSET', 'ACCEPT-ENCODING', 'ACCEPT-LANGUAGE', 'HOST',
      'ACCEPT-CHARSET', 'ACCEPT-ENCODING', 'ACCEPT-LANGUAGE', 'HOST',
      'FROM', 'REFERER', 'USER-AGENT', 'RANGE', 'TRANSFER-ENCODING',
      'FROM', 'REFERER', 'USER-AGENT', 'RANGE', 'TRANSFER-ENCODING',
      'IF-MODIFIED-SINCE', 'IF-UNMODIFIED-SINCE', 'COOKIE');
      'IF-MODIFIED-SINCE', 'IF-UNMODIFIED-SINCE', 'COOKIE');
   HTTPStatusCodes: array[TLHTTPStatus] of dword =
   HTTPStatusCodes: array[TLHTTPStatus] of dword =
     (0, 200, 204, 301, 302, 304, 400, 403, 404, 412, 414, 500, 501, 504);
     (0, 200, 204, 301, 302, 304, 400, 403, 404, 412, 414, 500, 501, 504);
-  HTTPTexts: array[TLHTTPStatus] of string = 
-    ('', 'OK', 'No Content', 'Moved Permanently', 'Found', 'Not Modified', 'Bad Request', 'Forbidden', 
+  HTTPTexts: array[TLHTTPStatus] of string =
+    ('', 'OK', 'No Content', 'Moved Permanently', 'Found', 'Not Modified', 'Bad Request', 'Forbidden',
      'Not Found', 'Precondition Failed', 'Request Too Long', 'Internal Error',
      'Not Found', 'Precondition Failed', 'Request Too Long', 'Internal Error',
      'Method Not Implemented', 'Method Not Allowed');
      'Method Not Implemented', 'Method Not Allowed');
   HTTPDescriptions: array[TLHTTPStatus] of string = (
   HTTPDescriptions: array[TLHTTPStatus] of string = (
@@ -120,7 +120,7 @@ type
   TLHTTPSocket = class;
   TLHTTPSocket = class;
   TLHTTPConnection = class;
   TLHTTPConnection = class;
   TLHTTPClientSocket = class;
   TLHTTPClientSocket = class;
-  
+
   PRequestInfo = ^TRequestInfo;
   PRequestInfo = ^TRequestInfo;
   TRequestInfo = record
   TRequestInfo = record
     RequestType: TLHTTPMethod;
     RequestType: TLHTTPMethod;
@@ -229,7 +229,7 @@ type
   protected
   protected
     FFreeBuffer: boolean;
     FFreeBuffer: boolean;
   public
   public
-    constructor Create(ASocket: TLHTTPSocket; ABuffer: pointer; 
+    constructor Create(ASocket: TLHTTPSocket; ABuffer: pointer;
       ABufferOffset, ABufferSize: integer; AFreeBuffer: boolean);
       ABufferOffset, ABufferSize: integer; AFreeBuffer: boolean);
     destructor Destroy; override;
     destructor Destroy; override;
   end;
   end;
@@ -245,7 +245,7 @@ type
     constructor Create(ASocket: TLHTTPSocket; AStream: TStream; AFreeStream: boolean);
     constructor Create(ASocket: TLHTTPSocket; AStream: TStream; AFreeStream: boolean);
     destructor Destroy; override;
     destructor Destroy; override;
   end;
   end;
-  
+
   TMemoryStreamOutput = class(TOutputItem)
   TMemoryStreamOutput = class(TOutputItem)
   protected
   protected
     FFreeStream: boolean;
     FFreeStream: boolean;
@@ -259,7 +259,7 @@ type
 
 
   TChunkState = (csInitial, csData, csDataEnd, csTrailer, csFinished);
   TChunkState = (csInitial, csData, csDataEnd, csTrailer, csFinished);
   TLHTTPParameterArray = array[TLHTTPParameter] of PAnsiChar;
   TLHTTPParameterArray = array[TLHTTPParameter] of PAnsiChar;
-  
+
   TParseBufferMethod = function: boolean of object;
   TParseBufferMethod = function: boolean of object;
   TLInputEvent = function(ASocket: TLHTTPClientSocket; ABuffer: PAnsiChar; ASize: integer): integer of object;
   TLInputEvent = function(ASocket: TLHTTPClientSocket; ABuffer: PAnsiChar; ASize: integer): integer of object;
   TLCanWriteEvent = procedure(ASocket: TLHTTPClientSocket; var OutputEof: TWriteBlockStatus) of object;
   TLCanWriteEvent = procedure(ASocket: TLHTTPClientSocket; var OutputEof: TWriteBlockStatus) of object;
@@ -328,14 +328,14 @@ type
     procedure HandleReceive;
     procedure HandleReceive;
     function  ParseBuffer: boolean;
     function  ParseBuffer: boolean;
     procedure WriteBlock;
     procedure WriteBlock;
-    
+
     property Parameters: TLHTTPParameterArray read FParameters;
     property Parameters: TLHTTPParameterArray read FParameters;
   end;
   end;
 
 
   { http server }
   { http server }
 
 
   TSetupEncodingState = (seNone, seWaitHeaders, seStartHeaders);
   TSetupEncodingState = (seNone, seWaitHeaders, seStartHeaders);
-  
+
   TLHTTPServerSocket = class(TLHTTPSocket)
   TLHTTPServerSocket = class(TLHTTPSocket)
   protected
   protected
     FLogMessage: TStringBuffer;
     FLogMessage: TStringBuffer;
@@ -367,7 +367,7 @@ type
     procedure StartMemoryResponse(AOutputItem: TMemoryOutput; ACustomErrorMessage: boolean = false);
     procedure StartMemoryResponse(AOutputItem: TMemoryOutput; ACustomErrorMessage: boolean = false);
     procedure StartResponse(AOutputItem: TBufferOutput; ACustomErrorMessage: boolean = false);
     procedure StartResponse(AOutputItem: TBufferOutput; ACustomErrorMessage: boolean = false);
   end;
   end;
-  
+
   TURIHandler = class(TObject)
   TURIHandler = class(TObject)
   private
   private
     FNext: TURIHandler;
     FNext: TURIHandler;
@@ -411,7 +411,7 @@ type
     FResponse: PClientResponse;
     FResponse: PClientResponse;
     FHeaderOut: PHeaderOutInfo;
     FHeaderOut: PHeaderOutInfo;
     FError: TLHTTPClientError;
     FError: TLHTTPClientError;
-    
+
     procedure AddContentLength(ALength: integer); override;
     procedure AddContentLength(ALength: integer); override;
     function  GetResponseReason: string;
     function  GetResponseReason: string;
     function  GetResponseStatus: TLHTTPStatus;
     function  GetResponseStatus: TLHTTPStatus;
@@ -446,7 +446,7 @@ type
     FOnDoneInput: TLHTTPClientEvent;
     FOnDoneInput: TLHTTPClientEvent;
     FOnInput: TLInputEvent;
     FOnInput: TLInputEvent;
     FOnProcessHeaders: TLHTTPClientEvent;
     FOnProcessHeaders: TLHTTPClientEvent;
-    
+
     procedure ConnectEvent(aSocket: TLHandle); override;
     procedure ConnectEvent(aSocket: TLHandle); override;
     procedure DoDoneInput(ASocket: TLHTTPClientSocket);
     procedure DoDoneInput(ASocket: TLHTTPClientSocket);
     function  DoHandleInput(ASocket: TLHTTPClientSocket; ABuffer: PAnsiChar; ASize: integer): integer;
     function  DoHandleInput(ASocket: TLHTTPClientSocket; ABuffer: PAnsiChar; ASize: integer): integer;
@@ -506,9 +506,9 @@ function HTTPVersionCheck(AStr, AStrEnd: PAnsiChar; out AVersion: dword): boolea
 var
 var
   lMajorVersion, lMinorVersion: byte;
   lMajorVersion, lMinorVersion: byte;
 begin
 begin
-  Result := ((AStrEnd-AStr) = 8) 
+  Result := ((AStrEnd-AStr) = 8)
     and CompareMem(AStr, PAnsiChar('HTTP/'), 5)
     and CompareMem(AStr, PAnsiChar('HTTP/'), 5)
-    and TrySingleDigit(AStr[5], lMajorVersion) 
+    and TrySingleDigit(AStr[5], lMajorVersion)
     and (AStr[6] = '.')
     and (AStr[6] = '.')
     and TrySingleDigit(AStr[7], lMinorVersion);
     and TrySingleDigit(AStr[7], lMinorVersion);
   AVersion := lMajorVersion * 10 + lMinorVersion;
   AVersion := lMajorVersion * 10 + lMinorVersion;
@@ -589,7 +589,7 @@ destructor TOutputItem.Destroy;
 begin
 begin
   if FSocket.FCurrentInput = Self then
   if FSocket.FCurrentInput = Self then
     FSocket.FCurrentInput := nil;
     FSocket.FCurrentInput := nil;
-    
+
   if FPrevDelayFree = nil then
   if FPrevDelayFree = nil then
     FSocket.FDelayFreeItems := FNextDelayFree
     FSocket.FDelayFreeItems := FNextDelayFree
   else
   else
@@ -681,7 +681,7 @@ begin
     FSocket.PrependOutput(TStreamOutput.Create(FSocket, AStream, AFree), Self);
     FSocket.PrependOutput(TStreamOutput.Create(FSocket, AStream, AFree), Self);
 end;
 end;
 
 
-procedure TBufferOutput.Add(AStream: TStream; AQueue: boolean = false; 
+procedure TBufferOutput.Add(AStream: TStream; AQueue: boolean = false;
   AFree: boolean = true);
   AFree: boolean = true);
 var
 var
   size, copySize: integer;
   size, copySize: integer;
@@ -778,7 +778,7 @@ begin
       FBuffer[FBufferSize+4] := #10;
       FBuffer[FBufferSize+4] := #10;
       inc(FBufferSize, 5);
       inc(FBufferSize, 5);
     end;
     end;
-  end else   
+  end else
     Result := EofToWriteStatus[FEof];
     Result := EofToWriteStatus[FEof];
   if FOutputPending then
   if FOutputPending then
   begin
   begin
@@ -790,7 +790,7 @@ begin
     end;
     end;
   end;
   end;
 end;
 end;
-  
+
 function TBufferOutput.WriteBuffer: TWriteBlockStatus;
 function TBufferOutput.WriteBuffer: TWriteBlockStatus;
 begin
 begin
   if not FOutputPending then
   if not FOutputPending then
@@ -859,7 +859,7 @@ begin
   FFinishBuffer := @FinishChunk;
   FFinishBuffer := @FinishChunk;
   PrepareChunk;
   PrepareChunk;
 end;
 end;
-  
+
 procedure TBufferOutput.SelectBuffered;
 procedure TBufferOutput.SelectBuffered;
 begin
 begin
   FPrepareBuffer := @PrepareBuffer;
   FPrepareBuffer := @PrepareBuffer;
@@ -867,7 +867,7 @@ begin
   FFinishBuffer := @FinishBuffer;
   FFinishBuffer := @FinishBuffer;
   PrepareBuffer;
   PrepareBuffer;
 end;
 end;
-  
+
 procedure TBufferOutput.SelectPlain;
 procedure TBufferOutput.SelectPlain;
 begin
 begin
   FPrepareBuffer := @PrepareBuffer;
   FPrepareBuffer := @PrepareBuffer;
@@ -878,7 +878,7 @@ end;
 
 
 { TMemoryOutput }
 { TMemoryOutput }
 
 
-constructor TMemoryOutput.Create(ASocket: TLHTTPSocket; ABuffer: pointer; 
+constructor TMemoryOutput.Create(ASocket: TLHTTPSocket; ABuffer: pointer;
   ABufferOffset, ABufferSize: integer; AFreeBuffer: boolean);
   ABufferOffset, ABufferSize: integer; AFreeBuffer: boolean);
 begin
 begin
   inherited Create(ASocket);
   inherited Create(ASocket);
@@ -925,7 +925,7 @@ end;
 
 
 { TMemoryStreamOutput }
 { TMemoryStreamOutput }
 
 
-constructor TMemoryStreamOutput.Create(ASocket: TLHTTPSocket; AStream: TMemoryStream; 
+constructor TMemoryStreamOutput.Create(ASocket: TLHTTPSocket; AStream: TMemoryStream;
   AFreeStream: boolean);
   AFreeStream: boolean);
 begin
 begin
   inherited Create(ASocket);
   inherited Create(ASocket);
@@ -1087,7 +1087,7 @@ procedure TLHTTPSocket.HandleReceive;
 var
 var
   lRead: integer;
   lRead: integer;
 begin
 begin
-  if FRequestInputDone then 
+  if FRequestInputDone then
   begin
   begin
     IgnoreRead := true;
     IgnoreRead := true;
     exit;
     exit;
@@ -1196,19 +1196,19 @@ begin
     if FChunkState = csFinished then
     if FChunkState = csFinished then
       exit(false);
       exit(false);
     if FChunkState = csData then
     if FChunkState = csData then
-      if ParseEntityPlain then 
+      if ParseEntityPlain then
         exit(true)
         exit(true)
       else
       else
         FChunkState := csDataEnd;
         FChunkState := csDataEnd;
-    
+
     lLineEnd := StrScan(FBufferPos, #10);
     lLineEnd := StrScan(FBufferPos, #10);
     if lLineEnd = nil then
     if lLineEnd = nil then
       exit(true);
       exit(true);
-    
+
     lNextLine := lLineEnd+1;
     lNextLine := lLineEnd+1;
     if (lLineEnd > FBufferPos) and ((lLineEnd-1)^ = #13) then
     if (lLineEnd > FBufferPos) and ((lLineEnd-1)^ = #13) then
       dec(lLineEnd);
       dec(lLineEnd);
-    case FChunkState of 
+    case FChunkState of
       csInitial:
       csInitial:
       begin
       begin
         lLineEnd^ := #0;
         lLineEnd^ := #0;
@@ -1257,7 +1257,7 @@ begin
         WriteError(hsRequestTooLong);
         WriteError(hsRequestTooLong);
       exit(true);
       exit(true);
     end;
     end;
-  
+
     pNextLine := pLineEnd+1;
     pNextLine := pLineEnd+1;
     if (pLineEnd > FBufferPos) and ((pLineEnd-1)^ = #13) then
     if (pLineEnd > FBufferPos) and ((pLineEnd-1)^ = #13) then
       dec(pLineEnd);
       dec(pLineEnd);
@@ -1307,7 +1307,7 @@ begin
   end else
   end else
     ParseParameterLine(pLineEnd);
     ParseParameterLine(pLineEnd);
 end;
 end;
-        
+
 function TLHTTPSocket.ParseBuffer: boolean;
 function TLHTTPSocket.ParseBuffer: boolean;
 var
 var
   lParseFunc: TParseBufferMethod;
   lParseFunc: TParseBufferMethod;
@@ -1321,7 +1321,7 @@ begin
       if FCurrentInput <> nil then
       if FCurrentInput <> nil then
         FCurrentInput.DoneInput;
         FCurrentInput.DoneInput;
     end;
     end;
-    { if parse func changed mid-run, then we should continue calling the new 
+    { if parse func changed mid-run, then we should continue calling the new
       one: header + data }
       one: header + data }
   until (lParseFunc = FParseBuffer) or not Result;
   until (lParseFunc = FParseBuffer) or not Result;
 end;
 end;
@@ -1354,7 +1354,7 @@ begin
     exit;
     exit;
   end;
   end;
 
 
-  { only if keep-alive, then user must specify either of above headers to 
+  { only if keep-alive, then user must specify either of above headers to
     indicate next header's start }
     indicate next header's start }
   lParam := FParameters[hpConnection];
   lParam := FParameters[hpConnection];
   FRequestInputDone := (lParam <> nil) and (StrIComp(lParam, 'keep-alive') = 0);
   FRequestInputDone := (lParam <> nil) and (StrIComp(lParam, 'keep-alive') = 0);
@@ -1414,13 +1414,13 @@ begin
       if FBufferPos = FBufferEnd then
       if FBufferPos = FBufferEnd then
         PackRequestBuffer;
         PackRequestBuffer;
 
 
-      if ParseBuffer and IgnoreRead then 
+      if ParseBuffer and IgnoreRead then
       begin
       begin
         { end of input buffer reached, try reading more }
         { end of input buffer reached, try reading more }
         HandleReceive;
         HandleReceive;
       end;
       end;
 
 
-      if FCurrentOutput = nil then 
+      if FCurrentOutput = nil then
         break;
         break;
     end;
     end;
 
 
@@ -1495,7 +1495,7 @@ procedure TLHTTPServerSocket.LogMessage;
 
 
 
 
 begin
 begin
-  { log a message about this request, 
+  { log a message about this request,
     '<StatusCode> <Length> "<Referer>" "<User-Agent>"' }
     '<StatusCode> <Length> "<Referer>" "<User-Agent>"' }
   AppendString(FLogMessage, IntToStr(HTTPStatusCodes[FResponseInfo.Status]));
   AppendString(FLogMessage, IntToStr(HTTPStatusCodes[FResponseInfo.Status]));
   AppendChar(FLogMessage, ' ');
   AppendChar(FLogMessage, ' ');
@@ -1542,7 +1542,7 @@ begin
   end;
   end;
   inherited;
   inherited;
 end;
 end;
-  
+
 procedure TLHTTPServerSocket.RelocateVariables;
 procedure TLHTTPServerSocket.RelocateVariables;
 begin
 begin
   RelocateVariable(FRequestInfo.Method);
   RelocateVariable(FRequestInfo.Method);
@@ -1603,7 +1603,7 @@ begin
   end;
   end;
   FRequestInfo.VersionStr := lPos;
   FRequestInfo.VersionStr := lPos;
   FHeaderOut.Version := FRequestInfo.Version;
   FHeaderOut.Version := FRequestInfo.Version;
-  
+
   { trim spaces at end of URI }
   { trim spaces at end of URI }
   dec(lPos);
   dec(lPos);
   repeat
   repeat
@@ -1641,7 +1641,7 @@ begin
   begin
   begin
     { absolute URI }
     { absolute URI }
     lPos := FRequestInfo.Argument+7;
     lPos := FRequestInfo.Argument+7;
-    while (lPos^ = '/') do 
+    while (lPos^ = '/') do
       Inc(lPos);
       Inc(lPos);
     FParameters[hpHost] := lPos;
     FParameters[hpHost] := lPos;
     lPos := StrScan(lPos, '/');
     lPos := StrScan(lPos, '/');
@@ -1669,7 +1669,7 @@ begin
     WriteError(hsBadRequest);
     WriteError(hsBadRequest);
     exit;
     exit;
   end;
   end;
-      
+
   lPos := StrScan(FRequestInfo.Argument, '?');
   lPos := StrScan(FRequestInfo.Argument, '?');
   if lPos <> nil then
   if lPos <> nil then
   begin
   begin
@@ -1687,7 +1687,7 @@ begin
     if StrIComp(lConnParam, 'close') = 0 then
     if StrIComp(lConnParam, 'close') = 0 then
       FKeepAlive := false;
       FKeepAlive := false;
   end;
   end;
-  
+
   HTTPDecode(FRequestInfo.Argument);
   HTTPDecode(FRequestInfo.Argument);
   if not CheckPermission(FRequestInfo.Argument) then
   if not CheckPermission(FRequestInfo.Argument) then
   begin
   begin
@@ -1698,9 +1698,9 @@ begin
       WriteError(hsNotImplemented);
       WriteError(hsNotImplemented);
       exit;
       exit;
     end;
     end;
-      
+
     FCurrentInput := HandleURI;
     FCurrentInput := HandleURI;
-    { if we have a valid outputitem, wait until it is ready 
+    { if we have a valid outputitem, wait until it is ready
       to produce its response }
       to produce its response }
     if FCurrentInput = nil then
     if FCurrentInput = nil then
     begin
     begin
@@ -1720,7 +1720,7 @@ begin
   { check modification date }
   { check modification date }
   if FResponseInfo.Status < hsBadRequest then
   if FResponseInfo.Status < hsBadRequest then
   begin
   begin
-    if (FParameters[hpIfModifiedSince] <> nil) 
+    if (FParameters[hpIfModifiedSince] <> nil)
       and (FResponseInfo.LastModified <> 0.0) then
       and (FResponseInfo.LastModified <> 0.0) then
     begin
     begin
       if TryHTTPDateStrToDateTime(FParameters[hpIfModifiedSince], lDateTime) then
       if TryHTTPDateStrToDateTime(FParameters[hpIfModifiedSince], lDateTime) then
@@ -1736,7 +1736,7 @@ begin
     begin
     begin
       if TryHTTPDateStrToDateTime(FParameters[hpIfUnmodifiedSince], lDateTime) then
       if TryHTTPDateStrToDateTime(FParameters[hpIfUnmodifiedSince], lDateTime) then
       begin
       begin
-        if (FResponseInfo.LastModified = 0.0) 
+        if (FResponseInfo.LastModified = 0.0)
           or (lDateTime < FResponseInfo.LastModified) then
           or (lDateTime < FResponseInfo.LastModified) then
           FResponseInfo.Status := hsPreconditionFailed;
           FResponseInfo.Status := hsPreconditionFailed;
       end;
       end;
@@ -1749,7 +1749,7 @@ begin
     ACustomErrorMessage := false;
     ACustomErrorMessage := false;
     FHeaderOut.ContentLength := 0;
     FHeaderOut.ContentLength := 0;
   end;
   end;
-  
+
   Result := (FResponseInfo.Status = hsOK) or ACustomErrorMessage;
   Result := (FResponseInfo.Status = hsOK) or ACustomErrorMessage;
   if not Result then
   if not Result then
   begin
   begin
@@ -1822,7 +1822,7 @@ var
   tempStr: string;
   tempStr: string;
 begin
 begin
   lMessage := InitStringBuffer(504);
   lMessage := InitStringBuffer(504);
-  
+
   AppendString(lMessage, 'HTTP/1.1 ');
   AppendString(lMessage, 'HTTP/1.1 ');
   Str(HTTPStatusCodes[FResponseInfo.Status], lTemp);
   Str(HTTPStatusCodes[FResponseInfo.Status], lTemp);
   AppendString(lMessage, lTemp);
   AppendString(lMessage, lTemp);
@@ -1927,7 +1927,7 @@ begin
   else
   else
     TZSign := '-';
     TZSign := '-';
   TZSecsAbs := Abs(TZSeconds);
   TZSecsAbs := Abs(TZSeconds);
-  FLogMessageTZString := Format(' %s%.2d%.2d] "', 
+  FLogMessageTZString := Format(' %s%.2d%.2d] "',
     [TZSign, TZSecsAbs div 3600, (TZSecsAbs div 60) mod 60]);
     [TZSign, TZSecsAbs div 3600, (TZSecsAbs div 60) mod 60]);
 end;
 end;
 
 
@@ -1983,7 +1983,7 @@ type
   TClientOutput = class(TOutputItem)
   TClientOutput = class(TOutputItem)
   protected
   protected
     FPersistent: boolean;
     FPersistent: boolean;
-    
+
     procedure DoneInput; override;
     procedure DoneInput; override;
   public
   public
     constructor Create(ASocket: TLHTTPClientSocket);
     constructor Create(ASocket: TLHTTPClientSocket);
@@ -2002,13 +2002,13 @@ end;
 
 
 destructor TClientOutput.Destroy;
 destructor TClientOutput.Destroy;
 begin
 begin
-  if FPersistent then exit; 
+  if FPersistent then exit;
   inherited;
   inherited;
 end;
 end;
 
 
 procedure TClientOutput.FreeInstance;
 procedure TClientOutput.FreeInstance;
 begin
 begin
-  if FPersistent then exit; 
+  if FPersistent then exit;
   inherited;
   inherited;
 end;
 end;
 
 
@@ -2121,7 +2121,7 @@ begin
   AddToOutput(TMemoryOutput.Create(Self, lMessage.Memory, 0,
   AddToOutput(TMemoryOutput.Create(Self, lMessage.Memory, 0,
     lMessage.Pos-lMessage.Memory, true));
     lMessage.Pos-lMessage.Memory, true));
   AddToOutput(FCurrentInput);
   AddToOutput(FCurrentInput);
-  
+
   WriteBlock;
   WriteBlock;
 end;
 end;
 
 

+ 8 - 8
utils/fppkg/lnet/lhttputil.pp

@@ -15,7 +15,7 @@
   You should have received a Copy of the GNU Library General Public License
   You should have received a Copy of the GNU Library General Public License
   along with This library; if not, Write to the Free Software Foundation,
   along with This library; if not, Write to the Free Software Foundation,
   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-  
+
   This license has been modified. See file LICENSE.ADDON for more information.
   This license has been modified. See file LICENSE.ADDON for more information.
   Should you find these sources without a LICENSE File, please contact
   Should you find these sources without a LICENSE File, please contact
   me at [email protected]
   me at [email protected]
@@ -29,12 +29,12 @@ unit lHTTPUtil;
 interface
 interface
 
 
 uses
 uses
-  sysutils, 
+  sysutils,
   strutils;
   strutils;
 
 
 const
 const
   HTTPDateFormat: string = 'ddd, dd mmm yyyy hh:nn:ss';
   HTTPDateFormat: string = 'ddd, dd mmm yyyy hh:nn:ss';
-  HTTPAllowedChars = ['A'..'Z','a'..'z', '*','@','.','_','-', 
+  HTTPAllowedChars = ['A'..'Z','a'..'z', '*','@','.','_','-',
       '0'..'9', '$','!','''','(',')'];
       '0'..'9', '$','!','''','(',')'];
 
 
 type
 type
@@ -50,7 +50,7 @@ type
   function HTTPDecode(AStr: pansichar): pansichar;
   function HTTPDecode(AStr: pansichar): pansichar;
   function HTTPEncode(const AStr: string): string;
   function HTTPEncode(const AStr: string): string;
   function HexToNum(AChar: char): byte;
   function HexToNum(AChar: char): byte;
-  
+
   function DecomposeURL(const URL: string; out Host, URI: string; out Port: Word): Boolean;
   function DecomposeURL(const URL: string; out Host, URI: string; out Port: Word): Boolean;
   function ComposeURL(Host, URI: string; const Port: Word): string;
   function ComposeURL(Host, URI: string; const Port: Word): string;
 
 
@@ -81,7 +81,7 @@ begin
   { day }
   { day }
   if ADateStr[2] = ' ' then
   if ADateStr[2] = ' ' then
     ADateStr[2] := #0
     ADateStr[2] := #0
-  else 
+  else
     exit(false);
     exit(false);
   Val(ADateStr, lDay, lCode);
   Val(ADateStr, lDay, lCode);
   if lCode <> 0 then exit(false);
   if lCode <> 0 then exit(false);
@@ -114,7 +114,7 @@ begin
   Result := true;
   Result := true;
 end;
 end;
 
 
-function SeparatePath(var InPath: string; out ExtraPath: string; const Mode:Longint; 
+function SeparatePath(var InPath: string; out ExtraPath: string; const Mode:Longint;
   ASearchRec: PSearchRec = nil): boolean;
   ASearchRec: PSearchRec = nil): boolean;
 var
 var
   lFullPath: string;
   lFullPath: string;
@@ -197,9 +197,9 @@ begin
     exit;
     exit;
   dest := pchar(Result);
   dest := pchar(Result);
   src := pchar(AStr);
   src := pchar(AStr);
-  srcend := src + len; 
+  srcend := src + len;
   while src < srcend do
   while src < srcend do
-  begin 
+  begin
     if src^ in HTTPAllowedChars then
     if src^ in HTTPAllowedChars then
       dest^ := src^
       dest^ := src^
     else if src^ = ' ' then
     else if src^ = ' ' then

+ 7 - 7
utils/fppkg/lnet/lmimestreams.pp

@@ -29,7 +29,7 @@ interface
 
 
 uses
 uses
   Classes;
   Classes;
-  
+
 const
 const
   CRLF = #13#10;
   CRLF = #13#10;
 
 
@@ -66,9 +66,9 @@ type
     function Seek(const Offset: Int64; Origin: TSeekOrigin): Int64; overload; override;
     function Seek(const Offset: Int64; Origin: TSeekOrigin): Int64; overload; override;
     procedure Reset;
     procedure Reset;
   end;
   end;
-  
+
   function EncodeMimeHeaderText(const s: string): string;
   function EncodeMimeHeaderText(const s: string): string;
-  
+
 implementation
 implementation
 
 
 uses
 uses
@@ -124,7 +124,7 @@ end;
 constructor TMimeOutputStream.Create(aNotificationEvent: TStreamNotificationEvent);
 constructor TMimeOutputStream.Create(aNotificationEvent: TStreamNotificationEvent);
 begin
 begin
   inherited Create;
   inherited Create;
-  
+
   FNotificationEvent := aNotificationEvent;
   FNotificationEvent := aNotificationEvent;
 end;
 end;
 
 
@@ -134,10 +134,10 @@ begin
     FNotificationEvent(Count);
     FNotificationEvent(Count);
 
 
   Result := Min(Count, Length(FInputData));
   Result := Min(Count, Length(FInputData));
-  
+
   if Result <= 0 then
   if Result <= 0 then
     Exit(0);
     Exit(0);
-  
+
   Move(FInputData[1], Buffer, Result);
   Move(FInputData[1], Buffer, Result);
   Delete(FInputData, 1, Result);
   Delete(FInputData, 1, Result);
 end;
 end;
@@ -178,7 +178,7 @@ end;
 function TBogusStream.Read(var Buffer; Count: Longint): Longint;
 function TBogusStream.Read(var Buffer; Count: Longint): Longint;
 begin
 begin
   Result := Min(Count, Length(FData));
   Result := Min(Count, Length(FData));
-  
+
   Move(FData[1], Buffer, Result);
   Move(FData[1], Buffer, Result);
   Delete(FData, 1, Result);
   Delete(FData, 1, Result);
 end;
 end;

+ 2 - 2
utils/fppkg/lnet/lmimetypes.pp

@@ -15,7 +15,7 @@
   You should have received a Copy of the GNU Library General Public License
   You should have received a Copy of the GNU Library General Public License
   along with This library; if not, Write to the Free Software Foundation,
   along with This library; if not, Write to the Free Software Foundation,
   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-  
+
   This license has been modified. See file LICENSE.ADDON for more information.
   This license has been modified. See file LICENSE.ADDON for more information.
   Should you find these sources without a LICENSE File, please contact
   Should you find these sources without a LICENSE File, please contact
   me at [email protected]
   me at [email protected]
@@ -34,7 +34,7 @@ type
   TStringObject = class(TObject)
   TStringObject = class(TObject)
     Str: string;
     Str: string;
   end;
   end;
-  
+
   procedure InitMimeList(const aFileName: string);
   procedure InitMimeList(const aFileName: string);
 
 
 var
 var

+ 46 - 46
utils/fppkg/lnet/lmimewrapper.pp

@@ -29,7 +29,7 @@ interface
 
 
 uses
 uses
   SysUtils, Classes, Contnrs, lMimeStreams;
   SysUtils, Classes, Contnrs, lMimeStreams;
-  
+
 const
 const
   MIME_VERSION = 'MIME-version: 1.0' + CRLF;
   MIME_VERSION = 'MIME-version: 1.0' + CRLF;
 
 
@@ -72,7 +72,7 @@ type
     property Header: string read GetHeader;
     property Header: string read GetHeader;
     property Size: Integer read GetSize;
     property Size: Integer read GetSize;
   end;
   end;
-  
+
   { TMimeTextSection }
   { TMimeTextSection }
 
 
   TMimeTextSection = class(TMimeSection)
   TMimeTextSection = class(TMimeSection)
@@ -91,7 +91,7 @@ type
     property Charset: string read GetCharset write SetCharset;
     property Charset: string read GetCharset write SetCharset;
     property Text: string read FData write SetData;
     property Text: string read FData write SetData;
   end;
   end;
-  
+
   { TMimeStreamSection }
   { TMimeStreamSection }
 
 
   TMimeStreamSection = class(TMimeSection)
   TMimeStreamSection = class(TMimeSection)
@@ -110,7 +110,7 @@ type
     property Stream: TStream read FStream write SetStream;
     property Stream: TStream read FStream write SetStream;
     property OwnsStreams: Boolean read FOwnsStreams write FOwnsStreams;
     property OwnsStreams: Boolean read FOwnsStreams write FOwnsStreams;
   end;
   end;
-  
+
   { TMimeFileSection }
   { TMimeFileSection }
 
 
   TMimeFileSection = class(TMimeStreamSection)
   TMimeFileSection = class(TMimeStreamSection)
@@ -162,14 +162,14 @@ type
     property Count: Integer read GetCount;
     property Count: Integer read GetCount;
     property Boundary: string read FBoundary;
     property Boundary: string read FBoundary;
   end;
   end;
-  
+
   { EAlreadyActivatedException }
   { EAlreadyActivatedException }
 
 
   EAlreadyActivatedException = class(Exception)
   EAlreadyActivatedException = class(Exception)
    public
    public
     constructor Create;
     constructor Create;
   end;
   end;
-  
+
   { EAlreadyCalledReadException }
   { EAlreadyCalledReadException }
 
 
   EAlreadyCalledReadException = class(Exception)
   EAlreadyCalledReadException = class(Exception)
@@ -183,12 +183,12 @@ type
    public
    public
     constructor Create;
     constructor Create;
   end;
   end;
-  
+
 implementation
 implementation
 
 
 uses
 uses
   Math, Base64;
   Math, Base64;
-  
+
 function EncodingToStr(const Encoding: TMimeEncoding): string;
 function EncodingToStr(const Encoding: TMimeEncoding): string;
 begin
 begin
   Result := '';
   Result := '';
@@ -215,7 +215,7 @@ begin
 
 
   if OriginalSize = 0 then
   if OriginalSize = 0 then
     Exit;
     Exit;
-    
+
   case FEncoding of
   case FEncoding of
     me8bit   : Result := OriginalSize;
     me8bit   : Result := OriginalSize;
     meBase64 : if OriginalSize mod 3 = 0 then
     meBase64 : if OriginalSize mod 3 = 0 then
@@ -243,7 +243,7 @@ begin
     FEncoding := aValue;
     FEncoding := aValue;
     if Assigned(FEncodingStream) then
     if Assigned(FEncodingStream) then
       FEncodingStream.Free;
       FEncodingStream.Free;
-    
+
     CreateEncodingStream;
     CreateEncodingStream;
   end;
   end;
 end;
 end;
@@ -264,7 +264,7 @@ begin
 
 
   if Length(FDescription) > 0 then
   if Length(FDescription) > 0 then
     Result := Result + 'Content-Description: ' + FDescription + CRLF;
     Result := Result + 'Content-Description: ' + FDescription + CRLF;
-    
+
   Result := Result + CRLF;
   Result := Result + CRLF;
 end;
 end;
 
 
@@ -274,7 +274,7 @@ begin
 
 
   if aSize >= Length(FBuffer) then
   if aSize >= Length(FBuffer) then
     FillBuffer(aSize);
     FillBuffer(aSize);
-    
+
   Result := Copy(FBuffer, 1, aSize);
   Result := Copy(FBuffer, 1, aSize);
 end;
 end;
 
 
@@ -289,7 +289,7 @@ destructor TMimeSection.Destroy;
 begin
 begin
   if Assigned(FEncodingStream) then
   if Assigned(FEncodingStream) then
     FEncodingStream.Free;
     FEncodingStream.Free;
-    
+
   FLocalStream.Free;
   FLocalStream.Free;
 
 
   inherited Destroy;
   inherited Destroy;
@@ -308,10 +308,10 @@ begin
     FActivated := True;
     FActivated := True;
     FBuffer := GetHeader;
     FBuffer := GetHeader;
   end;
   end;
-  
+
   if Length(FBuffer) < aSize then
   if Length(FBuffer) < aSize then
     FillBuffer(aSize);
     FillBuffer(aSize);
-    
+
   s := ReadBuffer(aSize);
   s := ReadBuffer(aSize);
   if Length(s) >= aSize then begin
   if Length(s) >= aSize then begin
     Result := FOutputStream.Write(s[1], aSize);
     Result := FOutputStream.Write(s[1], aSize);
@@ -348,10 +348,10 @@ var
   n: Integer;
   n: Integer;
 begin
 begin
   s := Copy(FData, 1, aSize);
   s := Copy(FData, 1, aSize);
-  
+
   if Length(s) = 0 then
   if Length(s) = 0 then
     Exit;
     Exit;
-  
+
   n := aSize;
   n := aSize;
 
 
   if Assigned(FEncodingStream) then begin
   if Assigned(FEncodingStream) then begin
@@ -363,7 +363,7 @@ begin
       CreateEncodingStream;
       CreateEncodingStream;
       FLocalStream.Write(CRLF[1], Length(CRLF));
       FLocalStream.Write(CRLF[1], Length(CRLF));
     end;
     end;
-    
+
     SetLength(s, FLocalStream.Size);
     SetLength(s, FLocalStream.Size);
     SetLength(s, FLocalStream.Read(s[1], Length(s)));
     SetLength(s, FLocalStream.Read(s[1], Length(s)));
   end else begin
   end else begin
@@ -432,7 +432,7 @@ begin
     Result := Length(FBuffer) + RecalculateSize(FStream.Size - FStream.Position)
     Result := Length(FBuffer) + RecalculateSize(FStream.Size - FStream.Position)
   else
   else
     Result := Length(FBuffer) + Length(GetHeader) + RecalculateSize(FStream.Size - FStream.Position);
     Result := Length(FBuffer) + Length(GetHeader) + RecalculateSize(FStream.Size - FStream.Position);
-    
+
   if not FActivated
   if not FActivated
   or (Length(FBuffer) > 0)
   or (Length(FBuffer) > 0)
   or (FStream.Size - FStream.Position > 0) then
   or (FStream.Size - FStream.Position > 0) then
@@ -447,7 +447,7 @@ begin
     FStream.Free;
     FStream.Free;
     FStream := nil;
     FStream := nil;
   end;
   end;
-  
+
   FStream := aValue;
   FStream := aValue;
   FOriginalPosition := FStream.Position;
   FOriginalPosition := FStream.Position;
 end;
 end;
@@ -459,22 +459,22 @@ var
 begin
 begin
   SetLength(s, aSize);
   SetLength(s, aSize);
   SetLength(s, FStream.Read(s[1], aSize));
   SetLength(s, FStream.Read(s[1], aSize));
-  
+
   if Length(s) <= 0 then
   if Length(s) <= 0 then
     Exit;
     Exit;
-  
+
   if Assigned(FEncodingStream) then begin
   if Assigned(FEncodingStream) then begin
     n := FEncodingStream.Write(s[1], Length(s));
     n := FEncodingStream.Write(s[1], Length(s));
-    
+
     if n < Length(s) then
     if n < Length(s) then
       FStream.Position := FStream.Position - (n - Length(s));
       FStream.Position := FStream.Position - (n - Length(s));
-      
+
     if FStream.Size - FStream.Position = 0 then begin
     if FStream.Size - FStream.Position = 0 then begin
       FEncodingStream.Free; // to fill in the last bit
       FEncodingStream.Free; // to fill in the last bit
       CreateEncodingStream;
       CreateEncodingStream;
       FLocalStream.Write(CRLF[1], Length(CRLF));
       FLocalStream.Write(CRLF[1], Length(CRLF));
     end;
     end;
-      
+
     SetLength(s, FLocalStream.Size);
     SetLength(s, FLocalStream.Size);
     SetLength(s, FLocalStream.Read(s[1], FLocalStream.Size));
     SetLength(s, FLocalStream.Read(s[1], FLocalStream.Size));
   end else if FStream.Size - FStream.Position = 0 then
   end else if FStream.Size - FStream.Position = 0 then
@@ -486,7 +486,7 @@ end;
 constructor TMimeStreamSection.Create(aOutputStream: TStream; aStream: TStream);
 constructor TMimeStreamSection.Create(aOutputStream: TStream; aStream: TStream);
 begin
 begin
   inherited Create(aOutputStream);
   inherited Create(aOutputStream);
-  
+
   FDisposition := mdAttachment;
   FDisposition := mdAttachment;
   FStream := aStream;
   FStream := aStream;
   FOriginalPosition := FStream.Position;
   FOriginalPosition := FStream.Position;
@@ -527,14 +527,14 @@ var
   i: Integer;
   i: Integer;
 begin
 begin
   Result := 0;
   Result := 0;
-  
+
   if FActiveSection > -2 then
   if FActiveSection > -2 then
     for i := 0 to Count - 1 do
     for i := 0 to Count - 1 do
       Result := Result + TMimeSection(FSections[i]).Size;
       Result := Result + TMimeSection(FSections[i]).Size;
-      
+
   if FActiveSection = -1 then // not yet active, must add header info
   if FActiveSection = -1 then // not yet active, must add header info
     Result := Result + Length(GetMimeHeader) + GetBoundarySize;
     Result := Result + Length(GetMimeHeader) + GetBoundarySize;
-    
+
   Result := Result + FOutputStream.Size;
   Result := Result + FOutputStream.Size;
 end;
 end;
 
 
@@ -555,7 +555,7 @@ end;
 function TMimeStream.GetSection(i: Integer): TMimeSection;
 function TMimeStream.GetSection(i: Integer): TMimeSection;
 begin
 begin
   Result := nil;
   Result := nil;
-  
+
   if  (i >= 0)
   if  (i >= 0)
   and (i < FSections.Count) then
   and (i < FSections.Count) then
     Result := TMimeSection(FSections[i]);
     Result := TMimeSection(FSections[i]);
@@ -566,7 +566,7 @@ const
   MIME_HEADER = 'Content-type: multipart/mixed; boundary="';
   MIME_HEADER = 'Content-type: multipart/mixed; boundary="';
 begin
 begin
   Result := MIME_VERSION;
   Result := MIME_VERSION;
-  
+
   if FSections.Count > 1 then
   if FSections.Count > 1 then
     Result := Result + MIME_HEADER + FBoundary + '"' + CRLF + CRLF +
     Result := Result + MIME_HEADER + FBoundary + '"' + CRLF + CRLF +
          'This is a multi-part message in MIME format.' + CRLF +
          'This is a multi-part message in MIME format.' + CRLF +
@@ -603,7 +603,7 @@ begin
       s := '--' + FBoundary + '--' + CRLF
       s := '--' + FBoundary + '--' + CRLF
     else
     else
       s := '--' + FBoundary + CRLF;
       s := '--' + FBoundary + CRLF;
-      
+
     FOutputStream.Write(s[1], Length(s));
     FOutputStream.Write(s[1], Length(s));
   end;
   end;
 
 
@@ -614,12 +614,12 @@ end;
 procedure TMimeStream.DoRead(const aSize: Integer);
 procedure TMimeStream.DoRead(const aSize: Integer);
 begin
 begin
   ActivateFirstSection;
   ActivateFirstSection;
-  
+
   if FActiveSection < 0 then
   if FActiveSection < 0 then
     Exit;
     Exit;
-    
+
   TMimeSection(FSections[FActiveSection]).Read(aSize);
   TMimeSection(FSections[FActiveSection]).Read(aSize);
-  
+
   if TMimeSection(FSections[FActiveSection]).Size = 0 then
   if TMimeSection(FSections[FActiveSection]).Size = 0 then
     ActivateNextSection;
     ActivateNextSection;
 end;
 end;
@@ -627,7 +627,7 @@ end;
 constructor TMimeStream.Create;
 constructor TMimeStream.Create;
 begin
 begin
   Randomize;
   Randomize;
-  
+
   FActiveSection := -1;
   FActiveSection := -1;
   FBoundary := GetBoundary;
   FBoundary := GetBoundary;
   FSections := TFPObjectList.Create(True);
   FSections := TFPObjectList.Create(True);
@@ -656,7 +656,7 @@ function TMimeStream.Read(var Buffer; Count: Longint): Longint;
 begin
 begin
   if Count <= 0 then
   if Count <= 0 then
     Exit(0);
     Exit(0);
-    
+
   if FCalledWrite then
   if FCalledWrite then
     raise EAlreadyCalledWriteException.Create;
     raise EAlreadyCalledWriteException.Create;
 
 
@@ -683,9 +683,9 @@ var
 begin
 begin
   if FActiveSection >= 0 then
   if FActiveSection >= 0 then
     raise EAlreadyActivatedException.Create;
     raise EAlreadyActivatedException.Create;
-    
+
   s := TMimeTextSection.Create(FOutputStream, aText);
   s := TMimeTextSection.Create(FOutputStream, aText);
-  
+
   s.Charset := aCharSet;
   s.Charset := aCharSet;
   FSections.Add(s);
   FSections.Add(s);
 end;
 end;
@@ -729,10 +729,10 @@ var
 begin
 begin
   FCalledRead := False;
   FCalledRead := False;
   FCalledWrite := False;
   FCalledWrite := False;
-  
+
   for i := 0 to FSections.Count - 1 do
   for i := 0 to FSections.Count - 1 do
     TMimeSection(FSections[i]).Reset;
     TMimeSection(FSections[i]).Reset;
-    
+
   FOutputStream.Reset;
   FOutputStream.Reset;
   FActiveSection := -1;
   FActiveSection := -1;
 end;
 end;
@@ -769,11 +769,11 @@ begin
   or (s = 'php4')
   or (s = 'php4')
   or (s = 'php5')
   or (s = 'php5')
   or (s = 'c++') then FContentType := 'text/plain';
   or (s = 'c++') then FContentType := 'text/plain';
-  
+
   if (s = 'html')
   if (s = 'html')
   or (s = 'shtml') then FContentType := 'text/html';
   or (s = 'shtml') then FContentType := 'text/html';
   if s = 'css' then FContentType := 'text/css';
   if s = 'css' then FContentType := 'text/css';
-  
+
   if s = 'png' then FContentType := 'image/x-png';
   if s = 'png' then FContentType := 'image/x-png';
   if s = 'xpm' then FContentType := 'image/x-pixmap';
   if s = 'xpm' then FContentType := 'image/x-pixmap';
   if s = 'xbm' then FContentType := 'image/x-bitmap';
   if s = 'xbm' then FContentType := 'image/x-bitmap';
@@ -785,7 +785,7 @@ begin
   if (s = 'jpg')
   if (s = 'jpg')
   or (s = 'jpeg') then FContentType := 'image/jpeg';
   or (s = 'jpeg') then FContentType := 'image/jpeg';
   if s = 'bmp' then FContentType := 'image/x-ms-bmp';
   if s = 'bmp' then FContentType := 'image/x-ms-bmp';
-    
+
   if s = 'wav' then FContentType := 'audio/x-wav';
   if s = 'wav' then FContentType := 'audio/x-wav';
   if s = 'mp3' then FContentType := 'audio/x-mp3';
   if s = 'mp3' then FContentType := 'audio/x-mp3';
   if s = 'ogg' then FContentType := 'audio/x-ogg';
   if s = 'ogg' then FContentType := 'audio/x-ogg';
@@ -794,7 +794,7 @@ begin
   or (s = 'mov') then FContentType := 'video/quicktime';
   or (s = 'mov') then FContentType := 'video/quicktime';
   if (s = 'mpg')
   if (s = 'mpg')
   or (s = 'mpeg') then FContentType := 'video/mpeg';
   or (s = 'mpeg') then FContentType := 'video/mpeg';
-  
+
   if s = 'pdf' then FContentType := 'application/pdf';
   if s = 'pdf' then FContentType := 'application/pdf';
   if s = 'rtf' then FContentType := 'application/rtf';
   if s = 'rtf' then FContentType := 'application/rtf';
   if s = 'tex' then FContentType := 'application/x-tex';
   if s = 'tex' then FContentType := 'application/x-tex';
@@ -817,7 +817,7 @@ begin
 
 
   if Length(FDescription) > 0 then
   if Length(FDescription) > 0 then
     Result := Result + 'Content-Description: ' + FDescription + CRLF;
     Result := Result + 'Content-Description: ' + FDescription + CRLF;
-    
+
   Result := Result + CRLF;
   Result := Result + CRLF;
 end;
 end;
 
 

+ 70 - 70
utils/fppkg/lnet/lnet.pp

@@ -15,7 +15,7 @@
   You should have received a Copy of the GNU Library General Public License
   You should have received a Copy of the GNU Library General Public License
   along with This library; if not, Write to the Free Software Foundation,
   along with This library; if not, Write to the Free Software Foundation,
   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-  
+
   This license has been modified. See File LICENSE.ADDON for more inFormation.
   This license has been modified. See File LICENSE.ADDON for more inFormation.
   Should you find these sources without a LICENSE File, please contact
   Should you find these sources without a LICENSE File, please contact
   me at [email protected]
   me at [email protected]
@@ -98,12 +98,12 @@ type
     function GetIPAddressLength: TSocklen;
     function GetIPAddressLength: TSocklen;
 
 
     function SetupSocket(const APort: Word; const Address: string): Boolean; virtual;
     function SetupSocket(const APort: Word; const Address: string): Boolean; virtual;
-    
+
     function DoSend(const aData; const aSize: Integer): Integer; virtual;
     function DoSend(const aData; const aSize: Integer): Integer; virtual;
     function DoGet(out aData; const aSize: Integer): Integer; virtual;
     function DoGet(out aData; const aSize: Integer): Integer; virtual;
 
 
     function HandleResult(const aResult: Integer; aOp: TLSocketOperation): Integer; virtual;
     function HandleResult(const aResult: Integer; aOp: TLSocketOperation): Integer; virtual;
-    
+
     function GetLocalPort: Word;
     function GetLocalPort: Word;
     function GetPeerPort: Word;
     function GetPeerPort: Word;
     function GetPeerAddress: string;
     function GetPeerAddress: string;
@@ -120,26 +120,26 @@ type
     procedure SoftDisconnect;
     procedure SoftDisconnect;
 
 
     function Bail(const msg: string; const ernum: Integer): Boolean;
     function Bail(const msg: string; const ernum: Integer): Boolean;
-    
+
     function LogError(const msg: string; const ernum: Integer): Boolean; virtual;
     function LogError(const msg: string; const ernum: Integer): Boolean; virtual;
-    
+
     property SocketType: Integer read FSocketType write FSocketType; // inherit and publicize if you need to set this outside
     property SocketType: Integer read FSocketType write FSocketType; // inherit and publicize if you need to set this outside
    public
    public
     constructor Create; override;
     constructor Create; override;
     destructor Destroy; override;
     destructor Destroy; override;
-    
+
     function SetState(const aState: TLSocketState; const TurnOn: Boolean = True): Boolean; virtual;
     function SetState(const aState: TLSocketState; const TurnOn: Boolean = True): Boolean; virtual;
-    
+
     function Listen(const APort: Word; const AIntf: string = LADDR_ANY): Boolean;
     function Listen(const APort: Word; const AIntf: string = LADDR_ANY): Boolean;
     function Accept(const SerSock: TSocket): Boolean;
     function Accept(const SerSock: TSocket): Boolean;
     function Connect(const Address: string; const APort: Word): Boolean;
     function Connect(const Address: string; const APort: Word): Boolean;
-    
+
     function Send(const aData; const aSize: Integer): Integer; virtual;
     function Send(const aData; const aSize: Integer): Integer; virtual;
     function SendMessage(const msg: string): Integer;
     function SendMessage(const msg: string): Integer;
-    
+
     function Get(out aData; const aSize: Integer): Integer; virtual;
     function Get(out aData; const aSize: Integer): Integer; virtual;
     function GetMessage(out msg: string): Integer;
     function GetMessage(out msg: string): Integer;
-    
+
     procedure Disconnect(const Forced: Boolean = True); virtual;
     procedure Disconnect(const Forced: Boolean = True); virtual;
    public
    public
     property Connected: Boolean read GetConnected; deprecated;
     property Connected: Boolean read GetConnected; deprecated;
@@ -160,22 +160,22 @@ type
     Property MsgBufferSize: Integer Read FMsgBufferSize Write FMsgBufferSize;
     Property MsgBufferSize: Integer Read FMsgBufferSize Write FMsgBufferSize;
   end;
   end;
   TLSocketClass = class of TLSocket;
   TLSocketClass = class of TLSocket;
-  
+
   { this is the socket used by TLConnection }
   { this is the socket used by TLConnection }
-  
+
   TLActionEnum = (acConnect, acAccept, acSend, acReceive, acError);
   TLActionEnum = (acConnect, acAccept, acSend, acReceive, acError);
 
 
   { Base interface common to ALL connections }
   { Base interface common to ALL connections }
-  
+
   ILComponent = interface
   ILComponent = interface
     procedure Disconnect(const Forced: Boolean = True);
     procedure Disconnect(const Forced: Boolean = True);
     procedure CallAction;
     procedure CallAction;
-    
+
     property SocketClass: TLSocketClass;
     property SocketClass: TLSocketClass;
     property Host: string;
     property Host: string;
     property Port: Word;
     property Port: Word;
   end;
   end;
-  
+
   { Interface for protools with direct send/get capabilities }
   { Interface for protools with direct send/get capabilities }
 
 
   ILDirect = interface
   ILDirect = interface
@@ -185,20 +185,20 @@ type
     function Send(const aData; const aSize: Integer; aSocket: TLSocket = nil): Integer;
     function Send(const aData; const aSize: Integer; aSocket: TLSocket = nil): Integer;
     function SendMessage(const msg: string; aSocket: TLSocket = nil): Integer;
     function SendMessage(const msg: string; aSocket: TLSocket = nil): Integer;
   end;
   end;
-  
+
   { Interface for all servers }
   { Interface for all servers }
-  
+
   ILServer = interface
   ILServer = interface
     function Listen(const APort: Word; const AIntf: string = LADDR_ANY): Boolean;
     function Listen(const APort: Word; const AIntf: string = LADDR_ANY): Boolean;
   end;
   end;
 
 
   { Interface for all clients }
   { Interface for all clients }
-  
+
   ILClient = interface
   ILClient = interface
     function Connect(const Address: string; const APort: Word): Boolean; overload;
     function Connect(const Address: string; const APort: Word): Boolean; overload;
     function Connect: Boolean; overload;
     function Connect: Boolean; overload;
   end;
   end;
-  
+
   { TLComponent }
   { TLComponent }
 
 
   TLComponent = class(TComponent, ILComponent)
   TLComponent = class(TComponent, ILComponent)
@@ -219,7 +219,7 @@ type
     property Creator: TLComponent read FCreator write SetCreator;
     property Creator: TLComponent read FCreator write SetCreator;
     property Active: Boolean read FActive;
     property Active: Boolean read FActive;
   end;
   end;
-  
+
   { TLConnection
   { TLConnection
     Common ancestor for TLTcp and TLUdp classes. Holds Event properties
     Common ancestor for TLTcp and TLUdp classes. Holds Event properties
     and common variables. }
     and common variables. }
@@ -243,14 +243,14 @@ type
     FSession: TLSession;
     FSession: TLSession;
    protected
    protected
     function InitSocket(aSocket: TLSocket): TLSocket; virtual;
     function InitSocket(aSocket: TLSocket): TLSocket; virtual;
-    
+
     function GetConnected: Boolean; virtual; abstract;
     function GetConnected: Boolean; virtual; abstract;
     function GetCount: Integer; virtual;
     function GetCount: Integer; virtual;
     function GetItem(const i: Integer): TLSocket;
     function GetItem(const i: Integer): TLSocket;
-    
+
     function GetTimeout: Integer;
     function GetTimeout: Integer;
     procedure SetTimeout(const AValue: Integer);
     procedure SetTimeout(const AValue: Integer);
-    
+
     procedure SetEventer(Value: TLEventer);
     procedure SetEventer(Value: TLEventer);
     procedure SetSession(aSession: TLSession);
     procedure SetSession(aSession: TLSession);
     procedure Notification(AComponent: TComponent; Operation: TOperation); override;
     procedure Notification(AComponent: TComponent; Operation: TOperation); override;
@@ -260,7 +260,7 @@ type
     procedure ReceiveAction(aSocket: TLHandle); virtual;
     procedure ReceiveAction(aSocket: TLHandle); virtual;
     procedure SendAction(aSocket: TLHandle); virtual;
     procedure SendAction(aSocket: TLHandle); virtual;
     procedure ErrorAction(aSocket: TLHandle; const msg: string); virtual;
     procedure ErrorAction(aSocket: TLHandle; const msg: string); virtual;
-    
+
     procedure ConnectEvent(aSocket: TLHandle); virtual;
     procedure ConnectEvent(aSocket: TLHandle); virtual;
     procedure DisconnectEvent(aSocket: TLHandle); virtual;
     procedure DisconnectEvent(aSocket: TLHandle); virtual;
     procedure AcceptEvent(aSocket: TLHandle); virtual;
     procedure AcceptEvent(aSocket: TLHandle); virtual;
@@ -268,26 +268,26 @@ type
     procedure CanSendEvent(aSocket: TLHandle); virtual;
     procedure CanSendEvent(aSocket: TLHandle); virtual;
     procedure ErrorEvent(aSocket: TLHandle; const msg: string); virtual;
     procedure ErrorEvent(aSocket: TLHandle; const msg: string); virtual;
     procedure EventerError(const msg: string; Sender: TLEventer);
     procedure EventerError(const msg: string; Sender: TLEventer);
-    
+
     procedure RegisterWithEventer; virtual;
     procedure RegisterWithEventer; virtual;
-    
+
     procedure FreeSocks(const Forced: Boolean); virtual;
     procedure FreeSocks(const Forced: Boolean); virtual;
    public
    public
     constructor Create(aOwner: TComponent); override;
     constructor Create(aOwner: TComponent); override;
     destructor Destroy; override;
     destructor Destroy; override;
-    
+
     function Connect(const Address: string; const APort: Word): Boolean; virtual; overload;
     function Connect(const Address: string; const APort: Word): Boolean; virtual; overload;
     function Connect: Boolean; virtual; overload;
     function Connect: Boolean; virtual; overload;
-    
+
     function Listen(const APort: Word; const AIntf: string = LADDR_ANY): Boolean; virtual; abstract; overload;
     function Listen(const APort: Word; const AIntf: string = LADDR_ANY): Boolean; virtual; abstract; overload;
     function Listen: Boolean; virtual; overload;
     function Listen: Boolean; virtual; overload;
-    
+
     function Get(out aData; const aSize: Integer; aSocket: TLSocket = nil): Integer; virtual; abstract;
     function Get(out aData; const aSize: Integer; aSocket: TLSocket = nil): Integer; virtual; abstract;
     function GetMessage(out msg: string; aSocket: TLSocket = nil): Integer; virtual; abstract;
     function GetMessage(out msg: string; aSocket: TLSocket = nil): Integer; virtual; abstract;
-    
+
     function Send(const aData; const aSize: Integer; aSocket: TLSocket = nil): Integer; virtual; abstract;
     function Send(const aData; const aSize: Integer; aSocket: TLSocket = nil): Integer; virtual; abstract;
     function SendMessage(const msg: string; aSocket: TLSocket = nil): Integer; virtual; abstract;
     function SendMessage(const msg: string; aSocket: TLSocket = nil): Integer; virtual; abstract;
-    
+
     function IterNext: Boolean; virtual; abstract;
     function IterNext: Boolean; virtual; abstract;
     procedure IterReset; virtual; abstract;
     procedure IterReset; virtual; abstract;
    public
    public
@@ -305,36 +305,36 @@ type
     property EventerClass: TLEventerClass read FEventerClass write FEventerClass;
     property EventerClass: TLEventerClass read FEventerClass write FEventerClass;
     property Session: TLSession read FSession write SetSession;
     property Session: TLSession read FSession write SetSession;
   end;
   end;
-  
+
   { TLUdp }
   { TLUdp }
 
 
   TLUdp = class(TLConnection)
   TLUdp = class(TLConnection)
    protected
    protected
     function InitSocket(aSocket: TLSocket): TLSocket; override;
     function InitSocket(aSocket: TLSocket): TLSocket; override;
-    
+
     function GetConnected: Boolean; override;
     function GetConnected: Boolean; override;
-    
+
     procedure ReceiveAction(aSocket: TLHandle); override;
     procedure ReceiveAction(aSocket: TLHandle); override;
     procedure ErrorAction(aSocket: TLHandle; const msg: string); override;
     procedure ErrorAction(aSocket: TLHandle; const msg: string); override;
-    
+
     function Bail(const msg: string): Boolean;
     function Bail(const msg: string): Boolean;
-    
+
     procedure SetAddress(const Address: string);
     procedure SetAddress(const Address: string);
    public
    public
     constructor Create(aOwner: TComponent); override;
     constructor Create(aOwner: TComponent); override;
-    
+
     function Connect(const Address: string; const APort: Word): Boolean; override;
     function Connect(const Address: string; const APort: Word): Boolean; override;
     function Listen(const APort: Word; const AIntf: string = LADDR_ANY): Boolean; override;
     function Listen(const APort: Word; const AIntf: string = LADDR_ANY): Boolean; override;
-    
+
     function Get(out aData; const aSize: Integer; aSocket: TLSocket = nil): Integer; override;
     function Get(out aData; const aSize: Integer; aSocket: TLSocket = nil): Integer; override;
     function GetMessage(out msg: string; aSocket: TLSocket = nil): Integer; override;
     function GetMessage(out msg: string; aSocket: TLSocket = nil): Integer; override;
-    
+
     function SendMessage(const msg: string; aSocket: TLSocket = nil): Integer; override;
     function SendMessage(const msg: string; aSocket: TLSocket = nil): Integer; override;
     function SendMessage(const msg: string; const Address: string): Integer; overload;
     function SendMessage(const msg: string; const Address: string): Integer; overload;
-    
+
     function Send(const aData; const aSize: Integer; aSocket: TLSocket = nil): Integer; override;
     function Send(const aData; const aSize: Integer; aSocket: TLSocket = nil): Integer; override;
     function Send(const aData; const aSize: Integer; const Address: string): Integer; overload;
     function Send(const aData; const aSize: Integer; const Address: string): Integer; overload;
-    
+
     function IterNext: Boolean; override;
     function IterNext: Boolean; override;
     procedure IterReset; override;
     procedure IterReset; override;
 
 
@@ -342,7 +342,7 @@ type
 
 
     procedure CallAction; override;
     procedure CallAction; override;
   end;
   end;
-  
+
   { TLTcp }
   { TLTcp }
 
 
   TLTcp = class(TLConnection)
   TLTcp = class(TLConnection)
@@ -461,7 +461,7 @@ begin
                             FSocketState := FSocketState + [aState]
                             FSocketState := FSocketState + [aState]
                           else
                           else
                             raise Exception.Create('Can not turn off server socket feature');
                             raise Exception.Create('Can not turn off server socket feature');
-                            
+
     ssBlocking          : SetBlocking(TurnOn);
     ssBlocking          : SetBlocking(TurnOn);
     ssReuseAddress      : SetReuseAddress(TurnOn);
     ssReuseAddress      : SetReuseAddress(TurnOn);
 
 
@@ -470,11 +470,11 @@ begin
                             FSocketState := FSocketState + [aState]
                             FSocketState := FSocketState + [aState]
                           else
                           else
                             FSocketState := FSocketState - [aState];
                             FSocketState := FSocketState - [aState];
-    
+
     ssSSLActive         : raise Exception.Create('Can not turn SSL/TLS on in TLSocket instance');
     ssSSLActive         : raise Exception.Create('Can not turn SSL/TLS on in TLSocket instance');
 {    ssNoDelay           : SetNoDelay(TurnOn);}
 {    ssNoDelay           : SetNoDelay(TurnOn);}
   end;
   end;
-  
+
   Result := True;
   Result := True;
 end;
 end;
 
 
@@ -642,7 +642,7 @@ end;
 function TLSocket.Get(out aData; const aSize: Integer): Integer;
 function TLSocket.Get(out aData; const aSize: Integer): Integer;
 begin
 begin
   Result := 0;
   Result := 0;
-  
+
   if aSize = 0 then
   if aSize = 0 then
     raise Exception.Create('Invalid buffer size 0 in Get');
     raise Exception.Create('Invalid buffer size 0 in Get');
 
 
@@ -725,13 +725,13 @@ begin
       if fpsetsockopt(FHandle, SOL_SOCKET, Opt, @Arg, Sizeof(Arg)) = SOCKET_ERROR then
       if fpsetsockopt(FHandle, SOL_SOCKET, Opt, @Arg, Sizeof(Arg)) = SOCKET_ERROR then
         Exit(Bail('SetSockOpt error setting reuseaddr', LSocketError));
         Exit(Bail('SetSockOpt error setting reuseaddr', LSocketError));
     end;
     end;
-    
+
     {$ifdef darwin}
     {$ifdef darwin}
     Arg := 1;
     Arg := 1;
     if fpsetsockopt(FHandle, SOL_SOCKET, SO_NOSIGPIPE, @Arg, Sizeof(Arg)) = SOCKET_ERROR then
     if fpsetsockopt(FHandle, SOL_SOCKET, SO_NOSIGPIPE, @Arg, Sizeof(Arg)) = SOCKET_ERROR then
       Exit(Bail('SetSockOpt error setting nosigpipe', LSocketError));
       Exit(Bail('SetSockOpt error setting nosigpipe', LSocketError));
     {$endif}
     {$endif}
-    
+
     FillAddressInfo(FAddress, FSocketNet, Address, aPort);
     FillAddressInfo(FAddress, FSocketNet, Address, aPort);
     FillAddressInfo(FPeerAddress, FSocketNet, LADDR_BR, aPort);
     FillAddressInfo(FPeerAddress, FSocketNet, LADDR_BR, aPort);
     if FMSGBufferSize>0 then
     if FMSGBufferSize>0 then
@@ -750,11 +750,11 @@ end;
 function TLSocket.DoSend(const aData; const aSize: Integer): Integer;
 function TLSocket.DoSend(const aData; const aSize: Integer): Integer;
 var
 var
   AddressLength: Longint = SizeOf(FPeerAddress.IPv4);
   AddressLength: Longint = SizeOf(FPeerAddress.IPv4);
-  
+
 begin
 begin
   if FSocketType = SOCK_STREAM then
   if FSocketType = SOCK_STREAM then
     Result := Sockets.fpSend(FHandle, @aData, aSize, LMSG)
     Result := Sockets.fpSend(FHandle, @aData, aSize, LMSG)
-  else 
+  else
     Result := sockets.fpsendto(FHandle, @aData, aSize, LMSG, @FPeerAddress, AddressLength);
     Result := sockets.fpsendto(FHandle, @aData, aSize, LMSG, @FPeerAddress, AddressLength);
 end;
 end;
 
 
@@ -795,7 +795,7 @@ begin
       HardDisconnect(True); {$warning check if we need aOp = soSend in the IF, perhaps bad recv is possible?}
       HardDisconnect(True); {$warning check if we need aOp = soSend in the IF, perhaps bad recv is possible?}
     end else
     end else
       Bail(GSStr[aOp] + ' error', LastError);
       Bail(GSStr[aOp] + ' error', LastError);
-      
+
     Result := 0;
     Result := 0;
   end;
   end;
 end;
 end;
@@ -854,7 +854,7 @@ end;
 function TLSocket.Connect(const Address: string; const aPort: Word): Boolean;
 function TLSocket.Connect(const Address: string; const aPort: Word): Boolean;
 begin
 begin
   Result := False;
   Result := False;
-  
+
   if FConnectionStatus <> scNone then
   if FConnectionStatus <> scNone then
     Disconnect(True);
     Disconnect(True);
 
 
@@ -873,7 +873,7 @@ end;
 function TLSocket.Send(const aData; const aSize: Integer): Integer;
 function TLSocket.Send(const aData; const aSize: Integer): Integer;
 begin
 begin
   Result := 0;
   Result := 0;
-  
+
   if aSize = 0 then
   if aSize = 0 then
     raise Exception.Create('Invalid buffersize 0 in Send');
     raise Exception.Create('Invalid buffersize 0 in Send');
 
 
@@ -968,7 +968,7 @@ procedure TLConnection.Notification(AComponent: TComponent;
   Operation: TOperation);
   Operation: TOperation);
 begin
 begin
   inherited Notification(AComponent, Operation);
   inherited Notification(AComponent, Operation);
-  
+
   if (Operation = opRemove) and (AComponent = FSession) then
   if (Operation = opRemove) and (AComponent = FSession) then
     FSession := nil;
     FSession := nil;
 end;
 end;
@@ -1160,7 +1160,7 @@ begin
   FIterator := FRootSock;
   FIterator := FRootSock;
 
 
   Result := FRootSock.SetupSocket(APort, LADDR_ANY);
   Result := FRootSock.SetupSocket(APort, LADDR_ANY);
-  
+
   if Result then begin
   if Result then begin
     FillAddressInfo(FRootSock.FPeerAddress, FRootSock.FSocketNet, Address, aPort);
     FillAddressInfo(FRootSock.FPeerAddress, FRootSock.FSocketNet, Address, aPort);
     FRootSock.FConnectionStatus := scConnected;
     FRootSock.FConnectionStatus := scConnected;
@@ -1177,10 +1177,10 @@ begin
 
 
   FRootSock := InitSocket(SocketClass.Create);
   FRootSock := InitSocket(SocketClass.Create);
   FIterator := FRootSock;
   FIterator := FRootSock;
-  
+
   if FRootSock.Listen(APort, AIntf) then begin
   if FRootSock.Listen(APort, AIntf) then begin
     FillAddressInfo(FRootSock.FPeerAddress, FRootSock.FSocketNet, LADDR_BR, aPort);
     FillAddressInfo(FRootSock.FPeerAddress, FRootSock.FSocketNet, LADDR_BR, aPort);
-  
+
     FRootSock.FConnectionStatus := scConnected;
     FRootSock.FConnectionStatus := scConnected;
     RegisterWithEventer;
     RegisterWithEventer;
     Result := True;
     Result := True;
@@ -1328,13 +1328,13 @@ end;
 function TLTcp.Connect(const Address: string; const APort: Word): Boolean;
 function TLTcp.Connect(const Address: string; const APort: Word): Boolean;
 begin
 begin
   Result := inherited Connect(Address, aPort);
   Result := inherited Connect(Address, aPort);
-  
+
   if Assigned(FRootSock) then
   if Assigned(FRootSock) then
     Disconnect(True);
     Disconnect(True);
-    
+
   FRootSock := InitSocket(SocketClass.Create);
   FRootSock := InitSocket(SocketClass.Create);
   Result := FRootSock.Connect(Address, aPort);
   Result := FRootSock.Connect(Address, aPort);
-  
+
   if Result then begin
   if Result then begin
     Inc(FCount);
     Inc(FCount);
     FIterator := FRootSock;
     FIterator := FRootSock;
@@ -1348,10 +1348,10 @@ end;
 function TLTcp.Listen(const APort: Word; const AIntf: string = LADDR_ANY): Boolean;
 function TLTcp.Listen(const APort: Word; const AIntf: string = LADDR_ANY): Boolean;
 begin
 begin
   Result := false;
   Result := false;
-  
+
   if Assigned(FRootSock) then
   if Assigned(FRootSock) then
     Disconnect(True);
     Disconnect(True);
-  
+
   FRootSock := InitSocket(SocketClass.Create);
   FRootSock := InitSocket(SocketClass.Create);
   FRootSock.SetReuseAddress(FReuseAddress);
   FRootSock.SetReuseAddress(FReuseAddress);
   FRootSock.MsgBufferSize:= MsgBufferSize;
   FRootSock.MsgBufferSize:= MsgBufferSize;
@@ -1398,7 +1398,7 @@ begin
     aSocket.PrevSock.NextSock := aSocket.NextSock;
     aSocket.PrevSock.NextSock := aSocket.NextSock;
   if Assigned(aSocket.NextSock) then
   if Assigned(aSocket.NextSock) then
     aSocket.NextSock.PrevSock := aSocket.PrevSock;
     aSocket.NextSock.PrevSock := aSocket.PrevSock;
-    
+
   Dec(FCount);
   Dec(FCount);
 end;
 end;
 
 
@@ -1467,23 +1467,23 @@ var
   Tmp: TLSocket;
   Tmp: TLSocket;
 begin
 begin
   Tmp := InitSocket(SocketClass.Create);
   Tmp := InitSocket(SocketClass.Create);
-  
+
   if Tmp.Accept(FRootSock.FHandle) then begin
   if Tmp.Accept(FRootSock.FHandle) then begin
     if Assigned(FRootSock.FNextSock) then begin
     if Assigned(FRootSock.FNextSock) then begin
       Tmp.FNextSock := FRootSock.FNextSock;
       Tmp.FNextSock := FRootSock.FNextSock;
       FRootSock.FNextSock.FPrevSock := Tmp;
       FRootSock.FNextSock.FPrevSock := Tmp;
     end;
     end;
-    
+
     FRootSock.FNextSock := Tmp;
     FRootSock.FNextSock := Tmp;
     Tmp.FPrevSock := FRootSock;
     Tmp.FPrevSock := FRootSock;
-    
+
     if not Assigned(FIterator)      // if we don't have (bug?) an iterator yet
     if not Assigned(FIterator)      // if we don't have (bug?) an iterator yet
     or (ssServerSocket in FIterator.SocketState) then // or if it's the first socket accepted
     or (ssServerSocket in FIterator.SocketState) then // or if it's the first socket accepted
       FIterator := Tmp;  // assign it as iterator (don't assign later acceptees)
       FIterator := Tmp;  // assign it as iterator (don't assign later acceptees)
-      
+
     Inc(FCount);
     Inc(FCount);
     FEventer.AddHandle(Tmp);
     FEventer.AddHandle(Tmp);
-    
+
     Tmp.FConnectionStatus := scConnected;
     Tmp.FConnectionStatus := scConnected;
     Tmp.IgnoreWrite := True;
     Tmp.IgnoreWrite := True;
 
 
@@ -1531,7 +1531,7 @@ begin
     Self.Bail('Error on connect: connection refused', TLSocket(aSocket));
     Self.Bail('Error on connect: connection refused', TLSocket(aSocket));
     Exit;
     Exit;
   end;
   end;
-  
+
   if Assigned(FSession) then
   if Assigned(FSession) then
     FSession.ErrorEvent(aSocket, msg)
     FSession.ErrorEvent(aSocket, msg)
   else
   else
@@ -1567,7 +1567,7 @@ end;
 function TLTcp.GetValidSocket: TLSocket;
 function TLTcp.GetValidSocket: TLSocket;
 begin
 begin
   Result := nil;
   Result := nil;
-  
+
   if Assigned(FIterator) and not (ssServerSocket in FIterator.SocketState) then
   if Assigned(FIterator) and not (ssServerSocket in FIterator.SocketState) then
     Result := FIterator
     Result := FIterator
   else if Assigned(FRootSock) and Assigned(FRootSock.FNextSock) then
   else if Assigned(FRootSock) and Assigned(FRootSock.FNextSock) then

+ 3 - 3
utils/fppkg/lnet/lprocess.pp

@@ -15,7 +15,7 @@
   You should have received a Copy of the GNU Library General Public License
   You should have received a Copy of the GNU Library General Public License
   along with This library; if not, Write to the Free Software Foundation,
   along with This library; if not, Write to the Free Software Foundation,
   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-  
+
   This license has been modified. See file LICENSE.ADDON for more information.
   This license has been modified. See file LICENSE.ADDON for more information.
   Should you find these sources without a LICENSE File, please contact
   Should you find these sources without a LICENSE File, please contact
   me at [email protected]
   me at [email protected]
@@ -42,7 +42,7 @@ type
   protected
   protected
     FEvent: TLHandle;
     FEvent: TLHandle;
   public
   public
-    function Write(const Buffer; Count: longint): longint; override;          
+    function Write(const Buffer; Count: longint): longint; override;
   end;
   end;
 
 
   TLProcess = class(TProcess)
   TLProcess = class(TProcess)
@@ -61,7 +61,7 @@ type
   public
   public
     constructor Create(AOwner: TComponent); override;
     constructor Create(AOwner: TComponent); override;
     destructor Destroy; override;
     destructor Destroy; override;
-    
+
     procedure CloseInput; override;
     procedure CloseInput; override;
     procedure CloseOutput; override;
     procedure CloseOutput; override;
     procedure CloseStderr; override;
     procedure CloseStderr; override;

+ 37 - 37
utils/fppkg/lnet/lsmtp.pp

@@ -15,7 +15,7 @@
   You should have received a Copy of the GNU Library General Public License
   You should have received a Copy of the GNU Library General Public License
   along with This library; if not, Write to the Free Software Foundation,
   along with This library; if not, Write to the Free Software Foundation,
   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-  
+
   This license has been modified. See File LICENSE.ADDON for more inFormation.
   This license has been modified. See File LICENSE.ADDON for more inFormation.
   Should you find these sources without a LICENSE File, please contact
   Should you find these sources without a LICENSE File, please contact
   me at [email protected]
   me at [email protected]
@@ -31,11 +31,11 @@ interface
 uses
 uses
   Classes, SysUtils, Contnrs, Base64,
   Classes, SysUtils, Contnrs, Base64,
   lNet, lEvents, lCommon, lMimeWrapper, lMimeStreams;
   lNet, lEvents, lCommon, lMimeWrapper, lMimeStreams;
-  
+
 type
 type
   TLSMTP = class;
   TLSMTP = class;
   TLSMTPClient = class;
   TLSMTPClient = class;
-  
+
   TLSMTPStatus = (ssNone, ssCon, ssHelo, ssEhlo, ssAuthLogin, ssAuthPlain,
   TLSMTPStatus = (ssNone, ssCon, ssHelo, ssEhlo, ssAuthLogin, ssAuthPlain,
                   ssStartTLS, ssMail, ssRcpt, ssData, ssRset, ssQuit, ssLast);
                   ssStartTLS, ssMail, ssRcpt, ssData, ssRset, ssQuit, ssLast);
 
 
@@ -45,7 +45,7 @@ type
     Status: TLSMTPStatus;
     Status: TLSMTPStatus;
     Args: array[1..2] of string;
     Args: array[1..2] of string;
   end;
   end;
-  
+
   { TLSMTPStatusFront }
   { TLSMTPStatusFront }
   {$DEFINE __front_type__  :=  TLSMTPStatusRec}
   {$DEFINE __front_type__  :=  TLSMTPStatusRec}
   {$i lcontainersh.inc}
   {$i lcontainersh.inc}
@@ -53,7 +53,7 @@ type
 
 
   TLSMTPClientStatusEvent = procedure (aSocket: TLSocket;
   TLSMTPClientStatusEvent = procedure (aSocket: TLSocket;
                                        const aStatus: TLSMTPStatus) of object;
                                        const aStatus: TLSMTPStatus) of object;
-                                       
+
   { TMail }
   { TMail }
 
 
   TMail = class
   TMail = class
@@ -91,7 +91,7 @@ type
    protected
    protected
     function GetTimeout: Integer;
     function GetTimeout: Integer;
     procedure SetTimeout(const AValue: Integer);
     procedure SetTimeout(const AValue: Integer);
-    
+
     function GetSession: TLSession;
     function GetSession: TLSession;
     procedure SetSession(const AValue: TLSession);
     procedure SetSession(const AValue: TLSession);
     procedure SetCreator(AValue: TLComponent); override;
     procedure SetCreator(AValue: TLComponent); override;
@@ -100,13 +100,13 @@ type
 
 
     function GetSocketClass: TLSocketClass;
     function GetSocketClass: TLSocketClass;
     procedure SetSocketClass(const AValue: TLSocketClass);
     procedure SetSocketClass(const AValue: TLSocketClass);
-    
+
     function GetEventer: TLEventer;
     function GetEventer: TLEventer;
     procedure SetEventer(Value: TLEventer);
     procedure SetEventer(Value: TLEventer);
    public
    public
     constructor Create(aOwner: TComponent); override;
     constructor Create(aOwner: TComponent); override;
     destructor Destroy; override;
     destructor Destroy; override;
-    
+
     function HasFeature(aFeature: string): Boolean;
     function HasFeature(aFeature: string): Boolean;
    public
    public
     property Connected: Boolean read GetConnected;
     property Connected: Boolean read GetConnected;
@@ -151,31 +151,31 @@ type
     procedure OnCs(aSocket: TLSocket);
     procedure OnCs(aSocket: TLSocket);
    protected
    protected
     function CanContinue(const aStatus: TLSMTPStatus; const Arg1, Arg2: string): Boolean;
     function CanContinue(const aStatus: TLSMTPStatus; const Arg1, Arg2: string): Boolean;
-    
+
     function CleanInput(var s: string): Integer;
     function CleanInput(var s: string): Integer;
-    
+
     procedure EvaluateServer;
     procedure EvaluateServer;
     procedure EvaluateFeatures;
     procedure EvaluateFeatures;
     procedure EvaluateAnswer(const Ans: string);
     procedure EvaluateAnswer(const Ans: string);
     procedure ExecuteFrontCommand;
     procedure ExecuteFrontCommand;
-    
+
     procedure AddToBuffer(s: string);
     procedure AddToBuffer(s: string);
     procedure SendData(const FromStream: Boolean = False);
     procedure SendData(const FromStream: Boolean = False);
     function EncodeBase64(const s: string): string;
     function EncodeBase64(const s: string): string;
    public
    public
     constructor Create(aOwner: TComponent); override;
     constructor Create(aOwner: TComponent); override;
     destructor Destroy; override;
     destructor Destroy; override;
-    
+
     function Connect(const aHost: string; const aPort: Word = 25): Boolean; virtual; overload;
     function Connect(const aHost: string; const aPort: Word = 25): Boolean; virtual; overload;
     function Connect: Boolean; virtual; overload;
     function Connect: Boolean; virtual; overload;
-    
+
     function Get(var aData; const aSize: Integer; aSocket: TLSocket = nil): Integer; virtual;
     function Get(var aData; const aSize: Integer; aSocket: TLSocket = nil): Integer; virtual;
     function GetMessage(out msg: string; aSocket: TLSocket = nil): Integer; virtual;
     function GetMessage(out msg: string; aSocket: TLSocket = nil): Integer; virtual;
 
 
     procedure SendMail(From, Recipients, Subject, Msg: string);
     procedure SendMail(From, Recipients, Subject, Msg: string);
     procedure SendMail(From, Recipients, Subject: string; aStream: TStream);
     procedure SendMail(From, Recipients, Subject: string; aStream: TStream);
     procedure SendMail(aMail: TMail);
     procedure SendMail(aMail: TMail);
-    
+
     procedure Helo(aHost: string = '');
     procedure Helo(aHost: string = '');
     procedure Ehlo(aHost: string = '');
     procedure Ehlo(aHost: string = '');
     procedure StartTLS;
     procedure StartTLS;
@@ -186,9 +186,9 @@ type
     procedure Data(const Msg: string);
     procedure Data(const Msg: string);
     procedure Rset;
     procedure Rset;
     procedure Quit;
     procedure Quit;
-    
+
     procedure Disconnect(const Forced: Boolean = True); override;
     procedure Disconnect(const Forced: Boolean = True); override;
-    
+
     procedure CallAction; override;
     procedure CallAction; override;
    public
    public
     property PipeLine: Boolean read FPipeLine write FPipeLine;
     property PipeLine: Boolean read FPipeLine write FPipeLine;
@@ -240,7 +240,7 @@ end;
 procedure TLSMTP.SetCreator(AValue: TLComponent);
 procedure TLSMTP.SetCreator(AValue: TLComponent);
 begin
 begin
   inherited SetCreator(AValue);
   inherited SetCreator(AValue);
-  
+
   FConnection.Creator := AValue;
   FConnection.Creator := AValue;
 end;
 end;
 
 
@@ -282,7 +282,7 @@ end;
 constructor TLSMTP.Create(aOwner: TComponent);
 constructor TLSMTP.Create(aOwner: TComponent);
 begin
 begin
   inherited Create(aOwner);
   inherited Create(aOwner);
-  
+
   FFeatureList := TStringList.Create;
   FFeatureList := TStringList.Create;
   FConnection := TLTcp.Create(nil);
   FConnection := TLTcp.Create(nil);
   FConnection.Creator := Self;
   FConnection.Creator := Self;
@@ -342,7 +342,7 @@ begin
   FSL := TStringList.Create;
   FSL := TStringList.Create;
 //  {$warning TODO: fix pipelining support when server does it}
 //  {$warning TODO: fix pipelining support when server does it}
   FPipeLine := False;
   FPipeLine := False;
-  
+
   FConnection.OnError := @OnEr;
   FConnection.OnError := @OnEr;
   FConnection.OnCanSend := @OnCs;
   FConnection.OnCanSend := @OnCs;
   FConnection.OnReceive := @OnRe;
   FConnection.OnReceive := @OnRe;
@@ -472,7 +472,7 @@ procedure TLSMTPClient.EvaluateAnswer(const Ans: string);
       Result := -1;
       Result := -1;
     end;
     end;
   end;
   end;
-  
+
   function ValidResponse(const Answer: string): Boolean; inline;
   function ValidResponse(const Answer: string): Boolean; inline;
   begin
   begin
     Result := (Length(Ans) >= 3) and
     Result := (Length(Ans) >= 3) and
@@ -483,7 +483,7 @@ procedure TLSMTPClient.EvaluateAnswer(const Ans: string);
     if Result then
     if Result then
       Result := (Length(Ans) = 3) or ((Length(Ans) > 3) and (Ans[4] = ' '));
       Result := (Length(Ans) = 3) or ((Length(Ans) > 3) and (Ans[4] = ' '));
   end;
   end;
-  
+
   procedure Eventize(const aStatus: TLSMTPStatus; const Res: Boolean);
   procedure Eventize(const aStatus: TLSMTPStatus; const Res: Boolean);
   begin
   begin
     FStatus.Remove;
     FStatus.Remove;
@@ -495,7 +495,7 @@ procedure TLSMTPClient.EvaluateAnswer(const Ans: string);
         FOnFailure(FConnection.Iterator, aStatus);
         FOnFailure(FConnection.Iterator, aStatus);
     end;
     end;
   end;
   end;
-  
+
 var
 var
   x: Integer;
   x: Integer;
 begin
 begin
@@ -520,7 +520,7 @@ begin
                             FTempBuffer := '';
                             FTempBuffer := '';
                           end;
                           end;
               end;
               end;
-              
+
       ssStartTLS:
       ssStartTLS:
               case x of
               case x of
                 200..299: begin
                 200..299: begin
@@ -531,7 +531,7 @@ begin
                             Eventize(FStatus.First.Status, False);
                             Eventize(FStatus.First.Status, False);
                           end;
                           end;
               end;
               end;
-              
+
       ssAuthLogin:
       ssAuthLogin:
               case x of
               case x of
                 200..299: begin
                 200..299: begin
@@ -552,7 +552,7 @@ begin
                             Eventize(FStatus.First.Status, False);
                             Eventize(FStatus.First.Status, False);
                           end;
                           end;
               end;
               end;
-              
+
       ssAuthPlain:
       ssAuthPlain:
               case x of
               case x of
                 200..299: begin
                 200..299: begin
@@ -586,11 +586,11 @@ begin
                             Eventize(FStatus.First.Status, False);
                             Eventize(FStatus.First.Status, False);
                           end;
                           end;
               end;
               end;
-              
+
       ssRset: begin
       ssRset: begin
                 Eventize(FStatus.First.Status, (x >= 200) and (x < 299));
                 Eventize(FStatus.First.Status, (x >= 200) and (x < 299));
               end;
               end;
-              
+
       ssQuit: begin
       ssQuit: begin
                 Eventize(FStatus.First.Status, (x >= 200) and (x < 299));
                 Eventize(FStatus.First.Status, (x >= 200) and (x < 299));
 {                if Assigned(FOnDisconnect) then
 {                if Assigned(FOnDisconnect) then
@@ -598,7 +598,7 @@ begin
                 Disconnect(False);
                 Disconnect(False);
               end;
               end;
     end;
     end;
-    
+
   if FStatus.Empty and not FCommandFront.Empty then
   if FStatus.Empty and not FCommandFront.Empty then
     ExecuteFrontCommand;
     ExecuteFrontCommand;
 end;
 end;
@@ -652,23 +652,23 @@ begin
     end else
     end else
       Inc(FCharCount);
       Inc(FCharCount);
   end;
   end;
-  
+
   FBuffer := FBuffer + s;
   FBuffer := FBuffer + s;
 end;
 end;
 
 
 procedure TLSMTPClient.SendData(const FromStream: Boolean = False);
 procedure TLSMTPClient.SendData(const FromStream: Boolean = False);
 const
 const
   SBUF_SIZE = 65535;
   SBUF_SIZE = 65535;
-  
+
   procedure FillBuffer;
   procedure FillBuffer;
   var
   var
     s: string;
     s: string;
   begin
   begin
     SetLength(s, SBUF_SIZE - Length(FBuffer));
     SetLength(s, SBUF_SIZE - Length(FBuffer));
     SetLength(s, FStream.Read(s[1], Length(s)));
     SetLength(s, FStream.Read(s[1], Length(s)));
-    
+
     AddToBuffer(s);
     AddToBuffer(s);
-    
+
     if FStream.Position = FStream.Size then begin // we finished the stream
     if FStream.Position = FStream.Size then begin // we finished the stream
       AddToBuffer(CRLF + '.' + CRLF);
       AddToBuffer(CRLF + '.' + CRLF);
       FStream := nil;
       FStream := nil;
@@ -693,7 +693,7 @@ begin
     if FromStream and Assigned(FStream) and (Length(FBuffer) < SBUF_SIZE) then
     if FromStream and Assigned(FStream) and (Length(FBuffer) < SBUF_SIZE) then
       FillBuffer;
       FillBuffer;
   end;
   end;
-  
+
   if Assigned(FOnSent) and (FStatus.First.Status = ssData) then
   if Assigned(FOnSent) and (FStatus.First.Status = ssData) then
     FOnSent(FConnection.Iterator, Sent);
     FOnSent(FConnection.Iterator, Sent);
 end;
 end;
@@ -706,7 +706,7 @@ begin
   Result := '';
   Result := '';
   if Length(s) = 0 then
   if Length(s) = 0 then
     Exit;
     Exit;
-  
+
   Dummy := TBogusStream.Create;
   Dummy := TBogusStream.Create;
   Enc := TBase64EncodingStream.Create(Dummy);
   Enc := TBase64EncodingStream.Create(Dummy);
 
 
@@ -763,7 +763,7 @@ begin
   From := EncodeMimeHeaderText(From);
   From := EncodeMimeHeaderText(From);
   Recipients := EncodeMimeHeaderText(Recipients);
   Recipients := EncodeMimeHeaderText(Recipients);
   Subject := EncodeMimeHeaderText(Subject);
   Subject := EncodeMimeHeaderText(Subject);
-  
+
   if (Length(Recipients) > 0) and (Length(From) > 0) then begin
   if (Length(Recipients) > 0) and (Length(From) > 0) then begin
     Mail(From);
     Mail(From);
     FSL.CommaText := StringReplace(Recipients, ' ', ',', [rfReplaceAll]);
     FSL.CommaText := StringReplace(Recipients, ' ', ',', [rfReplaceAll]);
@@ -780,7 +780,7 @@ begin
   From := EncodeMimeHeaderText(From);
   From := EncodeMimeHeaderText(From);
   Recipients := EncodeMimeHeaderText(Recipients);
   Recipients := EncodeMimeHeaderText(Recipients);
   Subject := EncodeMimeHeaderText(Subject);
   Subject := EncodeMimeHeaderText(Subject);
-  
+
   FStream := aStream;
   FStream := aStream;
 
 
   if (Length(Recipients) > 0) and (Length(From) > 0) then begin
   if (Length(Recipients) > 0) and (Length(From) > 0) then begin
@@ -838,7 +838,7 @@ begin
   aName := EncodeBase64(aName);
   aName := EncodeBase64(aName);
   aPass := EncodeBase64(aPass);
   aPass := EncodeBase64(aPass);
   FAuthStep := 0; // first, send username
   FAuthStep := 0; // first, send username
-  
+
   if CanContinue(ssAuthLogin, aName, aPass) then begin
   if CanContinue(ssAuthLogin, aName, aPass) then begin
     AddToBuffer('AUTH LOGIN' + CRLF);
     AddToBuffer('AUTH LOGIN' + CRLF);
     FStatus.Insert(MakeStatusRec(ssAuthLogin, aName, aPass));
     FStatus.Insert(MakeStatusRec(ssAuthLogin, aName, aPass));

+ 2 - 2
utils/fppkg/lnet/lstrbuffer.pp

@@ -15,7 +15,7 @@
   You should have received a Copy of the GNU Library General Public License
   You should have received a Copy of the GNU Library General Public License
   along with This library; if not, Write to the Free Software Foundation,
   along with This library; if not, Write to the Free Software Foundation,
   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-  
+
   This license has been modified. See file LICENSE.ADDON for more information.
   This license has been modified. See file LICENSE.ADDON for more information.
   Should you find these sources without a LICENSE File, please contact
   Should you find these sources without a LICENSE File, please contact
   me at [email protected]
   me at [email protected]
@@ -71,7 +71,7 @@ end;
 procedure AppendString(var ABuffer: TStringBuffer; ASource: pansichar);
 procedure AppendString(var ABuffer: TStringBuffer; ASource: pansichar);
 begin
 begin
   if ASource = nil then exit;
   if ASource = nil then exit;
-  AppendString(ABuffer, ASource, StrLen(ASource)); 
+  AppendString(ABuffer, ASource, StrLen(ASource));
 end;
 end;
 
 
 procedure AppendString(var ABuffer: TStringBuffer; const ASource: shortstring);
 procedure AppendString(var ABuffer: TStringBuffer; const ASource: shortstring);

+ 25 - 25
utils/fppkg/lnet/ltelnet.pp

@@ -28,7 +28,7 @@ interface
 
 
 uses
 uses
   Classes, SysUtils, lNet, lControlStack;
   Classes, SysUtils, lNet, lControlStack;
-  
+
 const
 const
   // Telnet printer signals
   // Telnet printer signals
   TS_NUL         = #0;
   TS_NUL         = #0;
@@ -61,7 +61,7 @@ const
   TS_DONT        = #254;
   TS_DONT        = #254;
   // Mother of all power
   // Mother of all power
   TS_IAC         = #255;
   TS_IAC         = #255;
-  
+
 type
 type
   TLTelnetClient = class;
   TLTelnetClient = class;
 
 
@@ -101,11 +101,11 @@ type
     FSubcommandCallbacks: TLSubcommandArray;
     FSubcommandCallbacks: TLSubcommandArray;
     procedure InflateBuffer;
     procedure InflateBuffer;
     function AddToBuffer(const aStr: string): Boolean; inline;
     function AddToBuffer(const aStr: string): Boolean; inline;
-    
+
     function Question(const Command: Char; const Value: Boolean): Char;
     function Question(const Command: Char; const Value: Boolean): Char;
-    
+
     function GetConnected: Boolean;
     function GetConnected: Boolean;
-    
+
     function GetTimeout: Integer;
     function GetTimeout: Integer;
     procedure SetTimeout(const Value: Integer);
     procedure SetTimeout(const Value: Integer);
 
 
@@ -126,13 +126,13 @@ type
    public
    public
     constructor Create(aOwner: TComponent); override;
     constructor Create(aOwner: TComponent); override;
     destructor Destroy; override;
     destructor Destroy; override;
-    
+
     function Get(out aData; const aSize: Integer; aSocket: TLSocket = nil): Integer; virtual; abstract;
     function Get(out aData; const aSize: Integer; aSocket: TLSocket = nil): Integer; virtual; abstract;
     function GetMessage(out msg: string; aSocket: TLSocket = nil): Integer; virtual; abstract;
     function GetMessage(out msg: string; aSocket: TLSocket = nil): Integer; virtual; abstract;
-    
+
     function Send(const aData; const aSize: Integer; aSocket: TLSocket = nil): Integer; virtual; abstract;
     function Send(const aData; const aSize: Integer; aSocket: TLSocket = nil): Integer; virtual; abstract;
     function SendMessage(const msg: string; aSocket: TLSocket = nil): Integer; virtual; abstract;
     function SendMessage(const msg: string; aSocket: TLSocket = nil): Integer; virtual; abstract;
-    
+
     function OptionIsSet(const Option: Char): Boolean;
     function OptionIsSet(const Option: Char): Boolean;
     function RegisterOption(const aOption: Char; const aCommand: Boolean): Boolean;
     function RegisterOption(const aOption: Char; const aCommand: Boolean): Boolean;
     procedure SetOption(const Option: Char);
     procedure SetOption(const Option: Char);
@@ -142,7 +142,7 @@ type
                 const defaultResponse: string= ''; requiredParams: integer= 0): boolean;
                 const defaultResponse: string= ''; requiredParams: integer= 0): boolean;
 
 
     procedure Disconnect(const Forced: Boolean = True); override;
     procedure Disconnect(const Forced: Boolean = True); override;
-    
+
     procedure SendCommand(const aCommand: Char; const How: TLHowEnum); virtual;
     procedure SendCommand(const aCommand: Char; const How: TLHowEnum); virtual;
    public
    public
     property Output: TMemoryStream read FOutput;
     property Output: TMemoryStream read FOutput;
@@ -168,20 +168,20 @@ type
     procedure OnCo(aSocket: TLSocket);
     procedure OnCo(aSocket: TLSocket);
 
 
     function React(const Operation, Command: Char): boolean; override;
     function React(const Operation, Command: Char): boolean; override;
-    
+
     procedure SendCommand(const Command: Char; const Value: Boolean); override;
     procedure SendCommand(const Command: Char; const Value: Boolean); override;
    public
    public
     constructor Create(aOwner: TComponent); override;
     constructor Create(aOwner: TComponent); override;
-    
+
     function Connect(const anAddress: string; const aPort: Word): Boolean;
     function Connect(const anAddress: string; const aPort: Word): Boolean;
     function Connect: Boolean;
     function Connect: Boolean;
-    
+
     function Get(out aData; const aSize: Integer; aSocket: TLSocket = nil): Integer; override;
     function Get(out aData; const aSize: Integer; aSocket: TLSocket = nil): Integer; override;
     function GetMessage(out msg: string; aSocket: TLSocket = nil): Integer; override;
     function GetMessage(out msg: string; aSocket: TLSocket = nil): Integer; override;
-    
+
     function Send(const aData; const aSize: Integer; aSocket: TLSocket = nil): Integer; override;
     function Send(const aData; const aSize: Integer; aSocket: TLSocket = nil): Integer; override;
     function SendMessage(const msg: string; aSocket: TLSocket = nil): Integer; override;
     function SendMessage(const msg: string; aSocket: TLSocket = nil): Integer; override;
-    
+
     procedure CallAction; override;
     procedure CallAction; override;
    public
    public
     property LocalEcho: Boolean read FLocalEcho write FLocalEcho;
     property LocalEcho: Boolean read FLocalEcho write FLocalEcho;
@@ -206,11 +206,11 @@ var
 constructor TLTelnet.Create(aOwner: TComponent);
 constructor TLTelnet.Create(aOwner: TComponent);
 begin
 begin
   inherited Create(aOwner);
   inherited Create(aOwner);
-  
+
   FConnection := TLTCP.Create(nil);
   FConnection := TLTCP.Create(nil);
   FConnection.Creator := Self;
   FConnection.Creator := Self;
   FConnection.OnCanSend := @OnCs;
   FConnection.OnCanSend := @OnCs;
-  
+
   FOutput := TMemoryStream.Create;
   FOutput := TMemoryStream.Create;
   FCommandCharIndex := 0;
   FCommandCharIndex := 0;
   FStack := TLControlStack.Create;
   FStack := TLControlStack.Create;
@@ -258,10 +258,10 @@ end;
 function TLTelnet.AddToBuffer(const aStr: string): Boolean; inline;
 function TLTelnet.AddToBuffer(const aStr: string): Boolean; inline;
 begin
 begin
   Result := False;
   Result := False;
-  
+
   while Length(aStr) + FBufferEnd > Length(FBuffer) do
   while Length(aStr) + FBufferEnd > Length(FBuffer) do
     InflateBuffer;
     InflateBuffer;
-    
+
   Move(aStr[1], FBuffer[FBufferEnd], Length(aStr));
   Move(aStr[1], FBuffer[FBufferEnd], Length(aStr));
   Inc(FBufferEnd, Length(aStr));
   Inc(FBufferEnd, Length(aStr));
 end;
 end;
@@ -361,7 +361,7 @@ begin
     if n > 0 then
     if n > 0 then
       Inc(FBufferIndex, n);
       Inc(FBufferIndex, n);
   end;
   end;
-  
+
   if FBufferEnd - FBufferIndex < FBufferIndex then begin // if we can move the "right" side of the buffer back to the left
   if FBufferEnd - FBufferIndex < FBufferIndex then begin // if we can move the "right" side of the buffer back to the left
     Move(FBuffer[FBufferIndex], FBuffer[0], FBufferEnd - FBufferIndex);
     Move(FBuffer[FBufferIndex], FBuffer[0], FBufferEnd - FBufferIndex);
     FBufferEnd := FBufferEnd - FBufferIndex;
     FBufferEnd := FBufferEnd - FBufferIndex;
@@ -489,7 +489,7 @@ function TLTelnetClient.React(const Operation, Command: Char): boolean;
     AddToBuffer(TS_IAC + Operation + Command);
     AddToBuffer(TS_IAC + Operation + Command);
     OnCs(nil);
     OnCs(nil);
   end;
   end;
-  
+
   procedure Refuse(const Operation, Command: Char);
   procedure Refuse(const Operation, Command: Char);
   begin
   begin
     FActiveOpts := FActiveOpts - [Command];
     FActiveOpts := FActiveOpts - [Command];
@@ -558,12 +558,12 @@ begin
   case Operation of
   case Operation of
     TS_DO   : if Command in FPossible then Accept(TS_WILL, Command)
     TS_DO   : if Command in FPossible then Accept(TS_WILL, Command)
               else Refuse(TS_WONT, Command);
               else Refuse(TS_WONT, Command);
-              
+
     TS_DONT : if Command in FPossible then Refuse(TS_WONT, Command);
     TS_DONT : if Command in FPossible then Refuse(TS_WONT, Command);
-    
+
     TS_WILL : if Command in FPossible then FActiveOpts := FActiveOpts + [Command]
     TS_WILL : if Command in FPossible then FActiveOpts := FActiveOpts + [Command]
               else Refuse(TS_DONT, Command);
               else Refuse(TS_DONT, Command);
-                 
+
     TS_WONT : if Command in FPossible then FActiveOpts := FActiveOpts - [Command];
     TS_WONT : if Command in FPossible then FActiveOpts := FActiveOpts - [Command];
     TS_SB   : if not Assigned(FSubcommandCallbacks[command].callback) then
     TS_SB   : if not Assigned(FSubcommandCallbacks[command].callback) then
                 refuse(TS_WONT, command)
                 refuse(TS_WONT, command)
@@ -635,10 +635,10 @@ begin
     DoubleIAC(Tmp);
     DoubleIAC(Tmp);
     if LocalEcho and (not OptionIsSet(TS_ECHO)) and (not OptionIsSet(TS_HYI)) then
     if LocalEcho and (not OptionIsSet(TS_ECHO)) and (not OptionIsSet(TS_HYI)) then
       FOutput.Write(PChar(Tmp)^, Length(Tmp));
       FOutput.Write(PChar(Tmp)^, Length(Tmp));
-      
+
     AddToBuffer(Tmp);
     AddToBuffer(Tmp);
     OnCs(nil);
     OnCs(nil);
-    
+
     Result := aSize;
     Result := aSize;
   end;
   end;
   {$ifdef debug}
   {$ifdef debug}

+ 1 - 1
utils/fppkg/lnet/ltimer.pp

@@ -70,7 +70,7 @@ end;
 
 
 procedure TLTimer.CallAction;
 procedure TLTimer.CallAction;
 begin
 begin
-  if FEnabled and Assigned(FOnTimer) and (Now - FStarted >= FInterval) then 
+  if FEnabled and Assigned(FOnTimer) and (Now - FStarted >= FInterval) then
   begin
   begin
     FOnTimer(Self);
     FOnTimer(Self);
     if not FOneShot then
     if not FOneShot then

+ 22 - 22
utils/fppkg/lnet/lwebserver.pp

@@ -15,7 +15,7 @@
   You should have received a Copy of the GNU Library General Public License
   You should have received a Copy of the GNU Library General Public License
   along with This library; if not, Write to the Free Software Foundation,
   along with This library; if not, Write to the Free Software Foundation,
   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-  
+
   This license has been modified. See file LICENSE.ADDON for more information.
   This license has been modified. See file LICENSE.ADDON for more information.
   Should you find these sources without a LICENSE File, please contact
   Should you find these sources without a LICENSE File, please contact
   me at [email protected]
   me at [email protected]
@@ -70,7 +70,7 @@ type
     FParsePos: pchar;
     FParsePos: pchar;
     FReadPos: integer;
     FReadPos: integer;
     FParsingHeaders: boolean;
     FParsingHeaders: boolean;
-   
+
     procedure AddEnvironment(const AName, AValue: string); virtual; abstract;
     procedure AddEnvironment(const AName, AValue: string); virtual; abstract;
     procedure AddHTTPParam(const AName: string; AParam: TLHTTPParameter);
     procedure AddHTTPParam(const AName: string; AParam: TLHTTPParameter);
     function  ParseHeaders: boolean;
     function  ParseHeaders: boolean;
@@ -184,7 +184,7 @@ type
 
 
     constructor Create;
     constructor Create;
     destructor Destroy; override;
     destructor Destroy; override;
-    
+
     procedure RegisterHandler(AHandler: TDocumentHandler);
     procedure RegisterHandler(AHandler: TDocumentHandler);
 
 
     property DirIndexList: TStrings read FDirIndexList;
     property DirIndexList: TStrings read FDirIndexList;
@@ -260,9 +260,9 @@ type
     destructor Destroy; override;
     destructor Destroy; override;
 
 
     function AddVariables(Variables: pchar; ASize: integer; SepChar: char): integer;
     function AddVariables(Variables: pchar; ASize: integer; SepChar: char): integer;
-    procedure DeleteCookie(const AName: string; const APath: string = '/'; 
+    procedure DeleteCookie(const AName: string; const APath: string = '/';
         const ADomain: string = '');
         const ADomain: string = '');
-    procedure SetCookie(const AName, AValue: string; const AExpires: TDateTime; 
+    procedure SetCookie(const AName, AValue: string; const AExpires: TDateTime;
         const APath: string = '/'; const ADomain: string = '');
         const APath: string = '/'; const ADomain: string = '');
 
 
     property OnExtraHeaders: TNotifyEvent read FOnExtraHeaders write FOnExtraHeaders;
     property OnExtraHeaders: TNotifyEvent read FOnExtraHeaders write FOnExtraHeaders;
@@ -294,7 +294,7 @@ uses
 const
 const
   InputBufferEmptyToWriteStatus: array[boolean] of TWriteBlockStatus =
   InputBufferEmptyToWriteStatus: array[boolean] of TWriteBlockStatus =
     (wsPendingData, wsWaitingData);
     (wsPendingData, wsWaitingData);
-  
+
 procedure InternalWrite(const s: string);
 procedure InternalWrite(const s: string);
 begin
 begin
   if EnableWriteln then
   if EnableWriteln then
@@ -324,7 +324,7 @@ begin
     begin
     begin
       lOutput.Process.CommandLine := lExecPath;
       lOutput.Process.CommandLine := lExecPath;
       lOutput.FScriptFileName := lExecPath;
       lOutput.FScriptFileName := lExecPath;
-      lOutput.FScriptName := Copy(lExecPath, Length(FCGIRoot), 
+      lOutput.FScriptName := Copy(lExecPath, Length(FCGIRoot),
         Length(lExecPath)-Length(FCGIRoot)+1);
         Length(lExecPath)-Length(FCGIRoot)+1);
       lOutput.StartRequest;
       lOutput.StartRequest;
     end else
     end else
@@ -416,7 +416,7 @@ begin
   DoDirSeparators(LDocRequest.Document);
   DoDirSeparators(LDocRequest.Document);
   lDocRequest.Document := IncludeTrailingPathDelimiter(DocumentRoot)
   lDocRequest.Document := IncludeTrailingPathDelimiter(DocumentRoot)
     + lDocRequest.Document;
     + lDocRequest.Document;
-  lDocRequest.InfoValid := SeparatePath(lDocRequest.Document,lDocRequest.ExtraPath, 
+  lDocRequest.InfoValid := SeparatePath(lDocRequest.Document,lDocRequest.ExtraPath,
     faAnyFile, @lDocRequest.Info);
     faAnyFile, @lDocRequest.Info);
   if not lDocRequest.InfoValid then
   if not lDocRequest.InfoValid then
     exit;
     exit;
@@ -431,7 +431,7 @@ begin
       for I := 0 to FDirIndexList.Count - 1 do
       for I := 0 to FDirIndexList.Count - 1 do
       begin
       begin
         lTempDoc := lDocRequest.Document + FDirIndexList.Strings[I];
         lTempDoc := lDocRequest.Document + FDirIndexList.Strings[I];
-        lDocRequest.InfoValid := FindFirst(lTempDoc, 
+        lDocRequest.InfoValid := FindFirst(lTempDoc,
           faAnyFile and not faDirectory, lDocRequest.Info) = 0;
           faAnyFile and not faDirectory, lDocRequest.Info) = 0;
         FindClose(lDocRequest.Info);
         FindClose(lDocRequest.Info);
         if lDocRequest.InfoValid and ((lDocRequest.Info.Attr and faDirectory) = 0) then
         if lDocRequest.InfoValid and ((lDocRequest.Info.Attr and faDirectory) = 0) then
@@ -583,7 +583,7 @@ end;
 destructor TFileOutput.Destroy;
 destructor TFileOutput.Destroy;
 begin
 begin
   inherited;
   inherited;
-  
+
   if not FEof then
   if not FEof then
     Close(FFile);
     Close(FFile);
 end;
 end;
@@ -608,7 +608,7 @@ function TFileOutput.FillBuffer: TWriteBlockStatus;
 var
 var
   lRead: integer;
   lRead: integer;
 begin
 begin
-  if FEof then 
+  if FEof then
     exit(wsDone);
     exit(wsDone);
   BlockRead(FFile, FBuffer[FBufferPos], FBufferSize-FBufferPos, lRead);
   BlockRead(FFile, FBuffer[FBufferPos], FBufferSize-FBufferPos, lRead);
   Inc(FBufferPos, lRead);
   Inc(FBufferPos, lRead);
@@ -657,7 +657,7 @@ begin
   if Length(tempStr) > 0 then
   if Length(tempStr) > 0 then
     AddEnvironment('SERVER_SOFTWARE', tempStr);
     AddEnvironment('SERVER_SOFTWARE', tempStr);
 
 
-  AddEnvironment('GATEWAY_INTERFACE', 'CGI/1.1'); 
+  AddEnvironment('GATEWAY_INTERFACE', 'CGI/1.1');
   AddEnvironment('SERVER_PROTOCOL', lServerSocket.FRequestInfo.VersionStr);
   AddEnvironment('SERVER_PROTOCOL', lServerSocket.FRequestInfo.VersionStr);
   AddEnvironment('REQUEST_METHOD', lServerSocket.FRequestInfo.Method);
   AddEnvironment('REQUEST_METHOD', lServerSocket.FRequestInfo.Method);
   AddEnvironment('REQUEST_URI', '/'+lServerSocket.FRequestInfo.Argument);
   AddEnvironment('REQUEST_URI', '/'+lServerSocket.FRequestInfo.Argument);
@@ -671,7 +671,7 @@ begin
 
 
   AddEnvironment('SCRIPT_NAME', FScriptName);
   AddEnvironment('SCRIPT_NAME', FScriptName);
   AddEnvironment('SCRIPT_FILENAME', FScriptFileName);
   AddEnvironment('SCRIPT_FILENAME', FScriptFileName);
-  
+
   AddEnvironment('QUERY_STRING', lServerSocket.FRequestInfo.QueryParams);
   AddEnvironment('QUERY_STRING', lServerSocket.FRequestInfo.QueryParams);
   AddHTTPParam('CONTENT_TYPE', hpContentType);
   AddHTTPParam('CONTENT_TYPE', hpContentType);
   AddHTTPParam('CONTENT_LENGTH', hpContentLength);
   AddHTTPParam('CONTENT_LENGTH', hpContentLength);
@@ -682,7 +682,7 @@ begin
   { used when user has authenticated in some way to server }
   { used when user has authenticated in some way to server }
 //  AddEnvironment('AUTH_TYPE='+...);
 //  AddEnvironment('AUTH_TYPE='+...);
 //  AddEnvironment('REMOTE_USER='+...);
 //  AddEnvironment('REMOTE_USER='+...);
-  
+
   AddEnvironment('DOCUMENT_ROOT', FDocumentRoot);
   AddEnvironment('DOCUMENT_ROOT', FDocumentRoot);
   AddEnvironment('REDIRECT_STATUS', '200');
   AddEnvironment('REDIRECT_STATUS', '200');
   AddHTTPParam('HTTP_HOST', hpHost);
   AddHTTPParam('HTTP_HOST', hpHost);
@@ -708,7 +708,7 @@ var
 
 
   procedure AddExtraHeader;
   procedure AddExtraHeader;
   begin
   begin
-    AppendString(lServerSocket.FHeaderOut.ExtraHeaders, 
+    AppendString(lServerSocket.FHeaderOut.ExtraHeaders,
       FParsePos + ': ' + pValue + #13#10);
       FParsePos + ': ' + pValue + #13#10);
   end;
   end;
 
 
@@ -740,7 +740,7 @@ begin
     if StrIComp(FParsePos, 'Content-type') = 0 then
     if StrIComp(FParsePos, 'Content-type') = 0 then
     begin
     begin
       lServerSocket.FResponseInfo.ContentType := pValue;
       lServerSocket.FResponseInfo.ContentType := pValue;
-    end else 
+    end else
     if StrIComp(FParsePos, 'Location') = 0 then
     if StrIComp(FParsePos, 'Location') = 0 then
     begin
     begin
       if StrLIComp(pValue, 'http://', 7) = 0 then
       if StrLIComp(pValue, 'http://', 7) = 0 then
@@ -750,7 +750,7 @@ begin
         AddExtraHeader;
         AddExtraHeader;
       end else
       end else
         InternalWrite('WARNING: unimplemented ''Location'' response received from CGI script');
         InternalWrite('WARNING: unimplemented ''Location'' response received from CGI script');
-    end else 
+    end else
     if StrIComp(FParsePos, 'Status') = 0 then
     if StrIComp(FParsePos, 'Status') = 0 then
     begin
     begin
       { sometimes we get '<status code> space <reason>' }
       { sometimes we get '<status code> space <reason>' }
@@ -773,7 +773,7 @@ begin
     end else
     end else
     if StrIComp(FParsePos, 'Last-Modified') = 0 then
     if StrIComp(FParsePos, 'Last-Modified') = 0 then
     begin
     begin
-      if not TryHTTPDateStrToDateTime(pValue, 
+      if not TryHTTPDateStrToDateTime(pValue,
           lServerSocket.FResponseInfo.LastModified) then
           lServerSocket.FResponseInfo.LastModified) then
         InternalWrite('WARNING: unable to parse last-modified string from CGI script: ' + pValue);
         InternalWrite('WARNING: unable to parse last-modified string from CGI script: ' + pValue);
     end else
     end else
@@ -870,7 +870,7 @@ end;
 procedure TSimpleCGIOutput.StartRequest;
 procedure TSimpleCGIOutput.StartRequest;
 begin
 begin
   inherited;
   inherited;
-  
+
   FProcess.Eventer := FSocket.Eventer;
   FProcess.Eventer := FSocket.Eventer;
   FProcess.Execute;
   FProcess.Execute;
 end;
 end;
@@ -1009,7 +1009,7 @@ begin
   FRequest.DoneParams;
   FRequest.DoneParams;
 end;
 end;
 
 
-{ TFormOutput } 
+{ TFormOutput }
 
 
 constructor TFormOutput.Create(ASocket: TLHTTPSocket);
 constructor TFormOutput.Create(ASocket: TLHTTPSocket);
 begin
 begin
@@ -1065,7 +1065,7 @@ begin
       i := FRequestVars.Add(strName);
       i := FRequestVars.Add(strName);
       tmpObj := nil;
       tmpObj := nil;
       string(tmpObj) := strValue;
       string(tmpObj) := strValue;
-      FRequestVars.Objects[i] := tmpObj; 
+      FRequestVars.Objects[i] := tmpObj;
     end;
     end;
     varname := next+1;
     varname := next+1;
   until false;
   until false;
@@ -1184,7 +1184,7 @@ begin
     FOnFillBuffer(Self, Result);
     FOnFillBuffer(Self, Result);
 end;
 end;
 
 
-procedure TFormOutput.DeleteCookie(const AName: string; const APath: string = '/'; 
+procedure TFormOutput.DeleteCookie(const AName: string; const APath: string = '/';
   const ADomain: string = '');
   const ADomain: string = '');
 begin
 begin
   { cookies expire when expires is in the past, duh }
   { cookies expire when expires is in the past, duh }

+ 4 - 4
utils/fppkg/lnet/sys/lepolleventer.inc

@@ -10,7 +10,7 @@ const
   EPOLL_CTL_ADD = 1;
   EPOLL_CTL_ADD = 1;
   EPOLL_CTL_DEL = 2;
   EPOLL_CTL_DEL = 2;
   EPOLL_CTL_MOD = 3;
   EPOLL_CTL_MOD = 3;
-  
+
   EPOLLIN  = $01; { The associated file is available for read(2) operations. }
   EPOLLIN  = $01; { The associated file is available for read(2) operations. }
   EPOLLPRI = $02; { There is urgent data available for read(2) operations. }
   EPOLLPRI = $02; { There is urgent data available for read(2) operations. }
   EPOLLOUT = $04; { The associated file is available for write(2) operations. }
   EPOLLOUT = $04; { The associated file is available for write(2) operations. }
@@ -128,7 +128,7 @@ begin
   Result := False;
   Result := False;
   if FInLoop then
   if FInLoop then
     Exit;
     Exit;
-    
+
   Changes := 0;
   Changes := 0;
   ReadChanges := 0;
   ReadChanges := 0;
 
 
@@ -144,7 +144,7 @@ begin
       Bail('Error on epoll', LSocketError)
       Bail('Error on epoll', LSocketError)
     else
     else
       Result := Changes + ReadChanges > 0;
       Result := Changes + ReadChanges > 0;
-      
+
     if Result then begin
     if Result then begin
       FInLoop := True;
       FInLoop := True;
       for i := 0 to Max(Changes, ReadChanges) - 1 do begin
       for i := 0 to Max(Changes, ReadChanges) - 1 do begin
@@ -174,7 +174,7 @@ begin
           if TempRead.FDispose then
           if TempRead.FDispose then
             AddForFree(TempRead);
             AddForFree(TempRead);
         end; // reads
         end; // reads
-        
+
         if i < Changes then begin
         if i < Changes then begin
           if not Assigned(Temp) then
           if not Assigned(Temp) then
             Temp := TLHandle(FEvents[i].data.ptr);
             Temp := TLHandle(FEvents[i].data.ptr);

+ 2 - 2
utils/fppkg/lnet/sys/lepolleventerh.inc

@@ -6,9 +6,9 @@
   TEpollEvent = epoll_event;
   TEpollEvent = epoll_event;
   PEpollData = ^epoll_data;
   PEpollData = ^epoll_data;
   TEpollData = epoll_data;
   TEpollData = epoll_data;
-  
+
   { TLEpollEventer }
   { TLEpollEventer }
-  
+
   TLEpollEventer = class(TLEventer)
   TLEpollEventer = class(TLEventer)
    protected
    protected
     FTimeout: cInt;
     FTimeout: cInt;

+ 2 - 2
utils/fppkg/lnet/sys/lkqueueeventer.inc

@@ -109,7 +109,7 @@ begin
     FInLoop := True;
     FInLoop := True;
     for i := 0 to n-1 do begin
     for i := 0 to n-1 do begin
       Temp := TLHandle(FEvents[i].uData);
       Temp := TLHandle(FEvents[i].uData);
-      
+
       if  (not Temp.FDispose)
       if  (not Temp.FDispose)
       and (FEvents[i].Filter = EVFILT_WRITE) then
       and (FEvents[i].Filter = EVFILT_WRITE) then
         if Assigned(Temp.FOnWrite) and not Temp.IgnoreWrite then
         if Assigned(Temp.FOnWrite) and not Temp.IgnoreWrite then
@@ -119,7 +119,7 @@ begin
       and (FEvents[i].Filter = EVFILT_READ) then
       and (FEvents[i].Filter = EVFILT_READ) then
         if Assigned(Temp.FOnRead) and not Temp.IgnoreRead then
         if Assigned(Temp.FOnRead) and not Temp.IgnoreRead then
           Temp.FOnRead(Temp);
           Temp.FOnRead(Temp);
-      
+
       if  (not Temp.FDispose)
       if  (not Temp.FDispose)
       and ((FEvents[i].Flags and EV_ERROR) > 0) then
       and ((FEvents[i].Flags and EV_ERROR) > 0) then
         if Assigned(Temp.FOnError) and not Temp.IgnoreError then
         if Assigned(Temp.FOnError) and not Temp.IgnoreError then

+ 1 - 1
utils/fppkg/lnet/sys/lkqueueeventerh.inc

@@ -21,5 +21,5 @@
     function AddHandle(aHandle: TLHandle): Boolean; override;
     function AddHandle(aHandle: TLHandle): Boolean; override;
     function CallAction: Boolean; override;
     function CallAction: Boolean; override;
   end;
   end;
-  
+
 {$endif} // bsd
 {$endif} // bsd

+ 4 - 4
utils/fppkg/lnet/sys/lspawnfcgiunix.inc

@@ -12,9 +12,9 @@ var
   ppEnv, ppArgs: ppAnsiChar;
   ppEnv, ppArgs: ppAnsiChar;
   Env : Array of AnsiString;
   Env : Array of AnsiString;
   Len : Integer;
   Len : Integer;
-  
+
 begin
 begin
-  {$IF SIZEOF(CHAR)=2}   
+  {$IF SIZEOF(CHAR)=2}
   Apps:=UTF8Encode(App);
   Apps:=UTF8Encode(App);
   Enviros:=UTF8Encode(EnviroS);
   Enviros:=UTF8Encode(EnviroS);
   {$ENDIF}
   {$ENDIF}
@@ -57,13 +57,13 @@ begin
         Env[i]:=SL[i];
         Env[i]:=SL[i];
         {$ENDIF}
         {$ENDIF}
         end;
         end;
-        
+
       GetMem(ppEnv, SizeOf(pChar) * (Len+1));
       GetMem(ppEnv, SizeOf(pChar) * (Len+1));
       for i:=0 to Len-1 do
       for i:=0 to Len-1 do
         ppEnv[i]:=pAnsiChar(Env[i]);
         ppEnv[i]:=pAnsiChar(Env[i]);
       ppEnv[Len]:=nil;
       ppEnv[Len]:=nil;
     end;
     end;
-    
+
     FpExecve(pAnsiChar(App), ppArgs, ppEnv);
     FpExecve(pAnsiChar(App), ppArgs, ppEnv);
   end else if Result > 0 then
   end else if Result > 0 then
     Result:=0; // it went ok
     Result:=0; // it went ok

+ 1 - 1
utils/fprcp/Readme.txt

@@ -8,7 +8,7 @@ to stdout.
 
 
 fprcp.exe can be used as preprocessor by windres GNU-win32 utility.
 fprcp.exe can be used as preprocessor by windres GNU-win32 utility.
 It was tested with windres 2.9.4 successfully.
 It was tested with windres 2.9.4 successfully.
-syntax: 
+syntax:
 windres --preprocessor fprcp.exe [another switches].
 windres --preprocessor fprcp.exe [another switches].
 
 
 Notes:
 Notes:

+ 2 - 2
utils/fprcp/fpmake.pp

@@ -2,7 +2,7 @@
 {$mode objfpc}{$H+}
 {$mode objfpc}{$H+}
 program fpmake;
 program fpmake;
 
 
-uses 
+uses
 {$ifdef unix}
 {$ifdef unix}
   cthreads,
   cthreads,
 {$endif}
 {$endif}
@@ -20,7 +20,7 @@ begin
     begin
     begin
     P:=AddPackage('utils-fprcp');
     P:=AddPackage('utils-fprcp');
     P.ShortName:='fprc';
     P.ShortName:='fprc';
-    { java and jvm-android do not support 
+    { java and jvm-android do not support
       getmem/freemem and new/dispose used in
       getmem/freemem and new/dispose used in
       these sources }
       these sources }
     if Defaults.CPU=jvm then
     if Defaults.CPU=jvm then

+ 5 - 5
utils/fprcp/fprcp.pp

@@ -62,7 +62,7 @@ var
  buf:pchars;
  buf:pchars;
  i:longint;
  i:longint;
  AConstList: TStringList;
  AConstList: TStringList;
- 
+
 function Entry(buf:pchars;Size,fromPos:longint;const sample:str255;casesent:longbool):longbool;
 function Entry(buf:pchars;Size,fromPos:longint;const sample:str255;casesent:longbool):longbool;
  var
  var
   i:longint;
   i:longint;
@@ -438,7 +438,7 @@ begin
      if entry(buf,size,i,'#include',true)then
      if entry(buf,size,i,'#include',true)then
       do_include(GetWord(buf,size,i+length('#include'),nextpos));
       do_include(GetWord(buf,size,i+length('#include'),nextpos));
     end;
     end;
-   //finally 
+   //finally
    AConstList.EndUpdate; //end;
    AConstList.EndUpdate; //end;
 
 
    //replace const-value if needed and evaluate
    //replace const-value if needed and evaluate
@@ -453,7 +453,7 @@ begin
     if Length(sValue2)>0
     if Length(sValue2)>0
     then AConstList.ValueFromIndex[i]:=Evaluate(sValue1);
     then AConstList.ValueFromIndex[i]:=Evaluate(sValue1);
    end;
    end;
- 
+
    if isSwitch('C')or isSwitch('-Cheader')then begin
    if isSwitch('C')or isSwitch('-Cheader')then begin
     for i:=0 to AConstList.Count-1
     for i:=0 to AConstList.Count-1
     do writeln('#define ',AConstList.Names[i],' ',AConstList.ValueFromIndex[i]);
     do writeln('#define ',AConstList.Names[i],' ',AConstList.ValueFromIndex[i]);
@@ -497,7 +497,7 @@ begin
     end;
     end;
    freemem(buf,size);
    freemem(buf,size);
 
 
- //finally 
+ //finally
  AConstList.Free; //end;
  AConstList.Free; //end;
- 
+
 end.
 end.

+ 2 - 2
utils/grab_vcsa.pp

@@ -35,7 +35,7 @@ uses baseunix,termio;
 
 
  - It has been checked if the user can provide any input to the program.
  - It has been checked if the user can provide any input to the program.
    The only input in the program is stdinputhandle, which cannot be
    The only input in the program is stdinputhandle, which cannot be
-   controlled by the user. The user has therefore no control in any way 
+   controlled by the user. The user has therefore no control in any way
    about the code flow in the program; the code that is going to be
    about the code flow in the program; the code that is going to be
    executed is fixed no matter what a user does.
    executed is fixed no matter what a user does.
 
 
@@ -114,7 +114,7 @@ begin
             halt(result_not_owner_error);
             halt(result_not_owner_error);
           vcs:='/dev/vcs'+s;
           vcs:='/dev/vcs'+s;
           vcsa:='/dev/vcsa'+s;
           vcsa:='/dev/vcsa'+s;
-          
+
           {Change owner and group to that of /dev/tty??.}
           {Change owner and group to that of /dev/tty??.}
           if fpchown(vcs,ttystat.st_uid,ttystat.st_gid)<>0 then
           if fpchown(vcs,ttystat.st_uid,ttystat.st_gid)<>0 then
             halt(result_chown_error);
             halt(result_chown_error);

+ 8 - 8
utils/h2pas/README.txt

@@ -4,10 +4,10 @@ units. It is part of the Free Pascal distribution.
 COMPILING
 COMPILING
 
 
 To compile the program, a simple
 To compile the program, a simple
- 'make' 
+ 'make'
 should be sufficient; you need GNU make for this. When using TP, a simple
 should be sufficient; you need GNU make for this. When using TP, a simple
   tpc h2pas.pas
   tpc h2pas.pas
-should also be possible. 
+should also be possible.
 
 
 USAGE
 USAGE
 
 
@@ -18,12 +18,12 @@ h2pas [-p] [-t] [-o outputfilename] [-l libname] [-u unitname] filename
      same name.
      same name.
 
 
 -p : Use 'P' instead of ^ as a pointer symbol;
 -p : Use 'P' instead of ^ as a pointer symbol;
-     This will convert 
+     This will convert
         ^char to pchar
         ^char to pchar
-        ^longint to plongint 
-     etc. It will also define a PSOMETYPE pointer for each SOMETYPE struct type 
+        ^longint to plongint
+     etc. It will also define a PSOMETYPE pointer for each SOMETYPE struct type
      definition in the header file.
      definition in the header file.
-     Thus 
+     Thus
      typedef struct somestruct {
      typedef struct somestruct {
        ...
        ...
      }
      }
@@ -36,8 +36,8 @@ h2pas [-p] [-t] [-o outputfilename] [-l libname] [-u unitname] filename
 
 
 -l : In the implementation part, the external functions will be
 -l : In the implementation part, the external functions will be
      written with 'external libname;' behind it.
      written with 'external libname;' behind it.
-     If you omit this option, all functions will be declared as 
-     cdecl; external; 
+     If you omit this option, all functions will be declared as
+     cdecl; external;
 
 
 -o : specify the outputname. By default, the inputname is used, with
 -o : specify the outputname. By default, the inputname is used, with
      extension '.pp'.
      extension '.pp'.

+ 5 - 5
utils/h2pas/fpmake.pp

@@ -2,7 +2,7 @@
 {$mode objfpc}{$H+}
 {$mode objfpc}{$H+}
 program fpmake;
 program fpmake;
 
 
-uses 
+uses
 {$ifdef unix}
 {$ifdef unix}
   cthreads,
   cthreads,
 {$endif}
 {$endif}
@@ -20,7 +20,7 @@ begin
     begin
     begin
     P:=AddPackage('utils-h2pas');
     P:=AddPackage('utils-h2pas');
     P.ShortName:='h2pa';
     P.ShortName:='h2pa';
-    { java and jvm-android do not support 
+    { java and jvm-android do not support
       fpc_get_output used in these sources }
       fpc_get_output used in these sources }
     if Defaults.CPU=jvm then
     if Defaults.CPU=jvm then
       P.OSes := P.OSes - [java,android];
       P.OSes := P.OSes - [java,android];
@@ -57,7 +57,7 @@ begin
     T.Dependencies.AddUnit('scan');
     T.Dependencies.AddUnit('scan');
     T.Dependencies.AddUnit('h2pyacclib');
     T.Dependencies.AddUnit('h2pyacclib');
     T.Dependencies.AddUnit('h2pparse');
     T.Dependencies.AddUnit('h2pparse');
-    
+
     T:=P.Targets.AddUnit('scan.pas');
     T:=P.Targets.AddUnit('scan.pas');
     T.Install:=false;
     T.Install:=false;
     T.Dependencies.AddUnit('h2pbase');
     T.Dependencies.AddUnit('h2pbase');
@@ -74,8 +74,8 @@ begin
     T.Dependencies.AddUnit('h2ptypes');
     T.Dependencies.AddUnit('h2ptypes');
     T.Dependencies.AddUnit('h2plexlib');
     T.Dependencies.AddUnit('h2plexlib');
     T.Dependencies.AddUnit('h2pyacclib');
     T.Dependencies.AddUnit('h2pyacclib');
-    
-    
+
+
     T:=P.Targets.AddUnit('scanbase.pp');
     T:=P.Targets.AddUnit('scanbase.pp');
     T.install:=false;
     T.install:=false;
     T.Dependencies.AddUnit('h2pconst');
     T.Dependencies.AddUnit('h2pconst');

+ 299 - 299
utils/h2pas/h2pparse.pp

@@ -119,664 +119,664 @@ begin
          yyval := yyv[yysp-0];
          yyval := yyv[yysp-0];
        end;
        end;
    2 : begin
    2 : begin
-         
+
          (* SPACE_DEFINE *)
          (* SPACE_DEFINE *)
          yyval:=nil;
          yyval:=nil;
-         
+
        end;
        end;
    3 : begin
    3 : begin
-         
+
          (* empty space  *)
          (* empty space  *)
          yyval:=nil;
          yyval:=nil;
-         
+
        end;
        end;
    4 : begin
    4 : begin
-         
+
          (* error_info *)
          (* error_info *)
          EmitErrorStart(yyline);
          EmitErrorStart(yyline);
-         
+
        end;
        end;
    5 : begin
    5 : begin
-         
+
          (* declaration_list  declaration *)
          (* declaration_list  declaration *)
          EmitAndOutput('declaration reduced at line ',line_no);
          EmitAndOutput('declaration reduced at line ',line_no);
-         
+
        end;
        end;
    6 : begin
    6 : begin
-         
+
          (* declaration_list define_dec *)
          (* declaration_list define_dec *)
          EmitAndOutput('define declaration reduced at line ',line_no);
          EmitAndOutput('define declaration reduced at line ',line_no);
-         
+
        end;
        end;
    7 : begin
    7 : begin
-         
+
          (* declaration *)
          (* declaration *)
          EmitAndOutput('define declaration reduced at line ',line_no);
          EmitAndOutput('define declaration reduced at line ',line_no);
-         
+
        end;
        end;
    8 : begin
    8 : begin
-         
+
          (* define_dec *)
          (* define_dec *)
          EmitAndOutput('define declaration reduced at line ',line_no);
          EmitAndOutput('define declaration reduced at line ',line_no);
-         
+
        end;
        end;
    9 : begin
    9 : begin
          (* EXTERN *)
          (* EXTERN *)
          yyval:=NewID('extern');
          yyval:=NewID('extern');
-         
+
        end;
        end;
   10 : begin
   10 : begin
          (* not extern  *)
          (* not extern  *)
          yyval:=NewID('intern');
          yyval:=NewID('intern');
-         
+
        end;
        end;
   11 : begin
   11 : begin
-         
+
          (* STDCALL *)
          (* STDCALL *)
          yyval:=NewID('no_pop');
          yyval:=NewID('no_pop');
-         
+
        end;
        end;
   12 : begin
   12 : begin
-         
+
          (* CDECL *)
          (* CDECL *)
          yyval:=NewID('cdecl');
          yyval:=NewID('cdecl');
-         
+
        end;
        end;
   13 : begin
   13 : begin
-         
+
          (* CALLBACK *)
          (* CALLBACK *)
          yyval:=NewID('no_pop');
          yyval:=NewID('no_pop');
-         
+
        end;
        end;
   14 : begin
   14 : begin
-         
+
          (* PASCAL *)
          (* PASCAL *)
          yyval:=NewID('no_pop');
          yyval:=NewID('no_pop');
-         
+
        end;
        end;
   15 : begin
   15 : begin
-         
+
          (* WINAPI *)
          (* WINAPI *)
          yyval:=NewID('no_pop');
          yyval:=NewID('no_pop');
-         
+
        end;
        end;
   16 : begin
   16 : begin
-         
+
          (* APIENTRY  *)
          (* APIENTRY  *)
          yyval:=NewID('no_pop');
          yyval:=NewID('no_pop');
-         
+
        end;
        end;
   17 : begin
   17 : begin
-         
+
          (* WINGDIAPI  *)
          (* WINGDIAPI  *)
          yyval:=NewID('no_pop');
          yyval:=NewID('no_pop');
-         
+
        end;
        end;
   18 : begin
   18 : begin
-         
+
          (* No modifier *)
          (* No modifier *)
          yyval:=nil
          yyval:=nil
-         
+
        end;
        end;
   19 : begin
   19 : begin
-         
+
          (* SYS_TRAP LKLAMMER dname RKLAMMER *)
          (* SYS_TRAP LKLAMMER dname RKLAMMER *)
          yyval:=yyv[yysp-1];
          yyval:=yyv[yysp-1];
-         
+
        end;
        end;
   20 : begin
   20 : begin
-         
+
          (* Empty systrap *)
          (* Empty systrap *)
          yyval:=nil;
          yyval:=nil;
-         
+
        end;
        end;
   21 : begin
   21 : begin
-         
+
          (* expr SEMICOLON *)
          (* expr SEMICOLON *)
          yyval:=yyv[yysp-1];
          yyval:=yyv[yysp-1];
-         
+
        end;
        end;
   22 : begin
   22 : begin
-         
+
          (* _WHILE LKLAMMER expr RKLAMMER statement_list  *)
          (* _WHILE LKLAMMER expr RKLAMMER statement_list  *)
          yyval:=NewType2(t_whilenode,yyv[yysp-2],yyv[yysp-0]);
          yyval:=NewType2(t_whilenode,yyv[yysp-2],yyv[yysp-0]);
-         
+
        end;
        end;
   23 : begin
   23 : begin
-         
+
          (* statement statement_list *)
          (* statement statement_list *)
          yyval:=NewType1(t_statement_list,yyv[yysp-1]);
          yyval:=NewType1(t_statement_list,yyv[yysp-1]);
          yyval^.next:=yyv[yysp-0];
          yyval^.next:=yyv[yysp-0];
-         
+
        end;
        end;
   24 : begin
   24 : begin
-         
+
          (* statement  *)
          (* statement  *)
          yyval:=NewType1(t_statement_list,yyv[yysp-0]);
          yyval:=NewType1(t_statement_list,yyv[yysp-0]);
-         
+
        end;
        end;
   25 : begin
   25 : begin
-         
+
          (* SEMICOLON  *)
          (* SEMICOLON  *)
          yyval:=NewType1(t_statement_list,nil);
          yyval:=NewType1(t_statement_list,nil);
-         
+
        end;
        end;
   26 : begin
   26 : begin
-         
+
          (* empty statement  *)
          (* empty statement  *)
          yyval:=NewType1(t_statement_list,nil);
          yyval:=NewType1(t_statement_list,nil);
-         
+
        end;
        end;
   27 : begin
   27 : begin
-         
+
          (* LGKLAMMER statement_list RGKLAMMER  *)
          (* LGKLAMMER statement_list RGKLAMMER  *)
          yyval:=yyv[yysp-1];
          yyval:=yyv[yysp-1];
-         
+
        end;
        end;
   28 : begin
   28 : begin
-         
+
          (* dec_specifier type_specifier dec_modifier declarator_list statement_block *)
          (* dec_specifier type_specifier dec_modifier declarator_list statement_block *)
          HandleDeclarationStatement(yyv[yysp-4],yyv[yysp-3],yyv[yysp-2],yyv[yysp-1],yyv[yysp-0]);
          HandleDeclarationStatement(yyv[yysp-4],yyv[yysp-3],yyv[yysp-2],yyv[yysp-1],yyv[yysp-0]);
-         
+
        end;
        end;
   29 : begin
   29 : begin
-         
+
          (* dec_specifier type_specifier dec_modifier declarator_list systrap_specifier SEMICOLON *)
          (* dec_specifier type_specifier dec_modifier declarator_list systrap_specifier SEMICOLON *)
          HandleDeclarationSysTrap(yyv[yysp-5],yyv[yysp-4],yyv[yysp-3],yyv[yysp-2],yyv[yysp-1]);
          HandleDeclarationSysTrap(yyv[yysp-5],yyv[yysp-4],yyv[yysp-3],yyv[yysp-2],yyv[yysp-1]);
-         
+
        end;
        end;
   30 : begin
   30 : begin
-         
+
          (* special_type_specifier SEMICOLON *)
          (* special_type_specifier SEMICOLON *)
          HandleSpecialType(yyv[yysp-1]);
          HandleSpecialType(yyv[yysp-1]);
-         
+
        end;
        end;
   31 : begin
   31 : begin
-         
+
          (* TYPEDEF STRUCT dname dname SEMICOLON *)
          (* TYPEDEF STRUCT dname dname SEMICOLON *)
          HandleStructDef(yyv[yysp-2],yyv[yysp-1]);
          HandleStructDef(yyv[yysp-2],yyv[yysp-1]);
-         
+
        end;
        end;
   32 : begin
   32 : begin
-         
+
          (* TYPEDEF type_specifier LKLAMMER dec_modifier declarator RKLAMMER maybe_space LKLAMMER argument_declaration_list RKLAMMER SEMICOLON *)
          (* TYPEDEF type_specifier LKLAMMER dec_modifier declarator RKLAMMER maybe_space LKLAMMER argument_declaration_list RKLAMMER SEMICOLON *)
          HandleTypeDef(yyv[yysp-9],yyv[yysp-7],yyv[yysp-6],yyv[yysp-2]);
          HandleTypeDef(yyv[yysp-9],yyv[yysp-7],yyv[yysp-6],yyv[yysp-2]);
-         
+
        end;
        end;
   33 : begin
   33 : begin
-         
+
          (* TYPEDEF type_specifier dec_modifier declarator_list SEMICOLON *)
          (* TYPEDEF type_specifier dec_modifier declarator_list SEMICOLON *)
          HandleTypeDefList(yyv[yysp-3],yyv[yysp-2],yyv[yysp-1]);
          HandleTypeDefList(yyv[yysp-3],yyv[yysp-2],yyv[yysp-1]);
-         
+
        end;
        end;
   34 : begin
   34 : begin
-         
+
          (* TYPEDEF dname SEMICOLON *)
          (* TYPEDEF dname SEMICOLON *)
          HandleSimpleTypeDef(yyv[yysp-1]);
          HandleSimpleTypeDef(yyv[yysp-1]);
-         
+
        end;
        end;
   35 : begin
   35 : begin
-         
+
          (* error  error_info SEMICOLON *)
          (* error  error_info SEMICOLON *)
          HandleErrorDecl(yyv[yysp-2],yyv[yysp-1]);
          HandleErrorDecl(yyv[yysp-2],yyv[yysp-1]);
-         
+
        end;
        end;
   36 : begin
   36 : begin
-         
+
          (* DEFINE dname LKLAMMER enum_list RKLAMMER para_def_expr NEW_LINE *)
          (* DEFINE dname LKLAMMER enum_list RKLAMMER para_def_expr NEW_LINE *)
          HandleDefineMacro(yyv[yysp-5],yyv[yysp-3],yyv[yysp-1]);
          HandleDefineMacro(yyv[yysp-5],yyv[yysp-3],yyv[yysp-1]);
-         
+
        end;
        end;
   37 : begin
   37 : begin
-         
+
          (* DEFINE dname SPACE_DEFINE NEW_LINE *)
          (* DEFINE dname SPACE_DEFINE NEW_LINE *)
          HandleDefine(yyv[yysp-2]);
          HandleDefine(yyv[yysp-2]);
-         
+
        end;
        end;
   38 : begin
   38 : begin
-         
+
          (* DEFINE dname NEW_LINE *)
          (* DEFINE dname NEW_LINE *)
          HandleDefine(yyv[yysp-1]);
          HandleDefine(yyv[yysp-1]);
-         
+
        end;
        end;
   39 : begin
   39 : begin
-         
+
          (* DEFINE dname SPACE_DEFINE def_expr NEW_LINE *)
          (* DEFINE dname SPACE_DEFINE def_expr NEW_LINE *)
          HandleDefineConst(yyv[yysp-3],yyv[yysp-1]);
          HandleDefineConst(yyv[yysp-3],yyv[yysp-1]);
-         
+
        end;
        end;
   40 : begin
   40 : begin
-         
+
          (* error error_info NEW_LINE *)
          (* error error_info NEW_LINE *)
          HandleErrorDecl(yyv[yysp-2],yyv[yysp-1]);
          HandleErrorDecl(yyv[yysp-2],yyv[yysp-1]);
-         
+
        end;
        end;
   41 : begin
   41 : begin
-         
+
          (* LGKLAMMER member_list RGKLAMMER *)
          (* LGKLAMMER member_list RGKLAMMER *)
          yyval:=yyv[yysp-1];
          yyval:=yyv[yysp-1];
-         
+
        end;
        end;
   42 : begin
   42 : begin
-         
+
          (* error  error_info RGKLAMMER *)
          (* error  error_info RGKLAMMER *)
          emitwriteln(' in member_list *)');
          emitwriteln(' in member_list *)');
          yyerrok;
          yyerrok;
          yyval:=nil;
          yyval:=nil;
-         
+
        end;
        end;
   43 : begin
   43 : begin
-         
+
          (* LGKLAMMER enum_list RGKLAMMER *)
          (* LGKLAMMER enum_list RGKLAMMER *)
          yyval:=yyv[yysp-1];
          yyval:=yyv[yysp-1];
-         
+
        end;
        end;
   44 : begin
   44 : begin
-         
+
          (* error  error_info RGKLAMMER *)
          (* error  error_info RGKLAMMER *)
          emitwriteln(' in enum_list *)');
          emitwriteln(' in enum_list *)');
          yyerrok;
          yyerrok;
          yyval:=nil;
          yyval:=nil;
-         
+
        end;
        end;
   45 : begin
   45 : begin
-         
+
          (* STRUCT dname closed_list _PACKED *)
          (* STRUCT dname closed_list _PACKED *)
          emitpacked(1);
          emitpacked(1);
          yyval:=NewType2(t_structdef,yyv[yysp-1],yyv[yysp-2]);
          yyval:=NewType2(t_structdef,yyv[yysp-1],yyv[yysp-2]);
-         
+
        end;
        end;
   46 : begin
   46 : begin
-         
+
          (* STRUCT dname closed_list *)
          (* STRUCT dname closed_list *)
          emitpacked(4);
          emitpacked(4);
          yyval:=NewType2(t_structdef,yyv[yysp-0],yyv[yysp-1]);
          yyval:=NewType2(t_structdef,yyv[yysp-0],yyv[yysp-1]);
-         
+
        end;
        end;
   47 : begin
   47 : begin
-         
+
          (* UNION dname closed_list _PACKED *)
          (* UNION dname closed_list _PACKED *)
          emitpacked(1);
          emitpacked(1);
          yyval:=NewType2(t_uniondef,yyv[yysp-1],yyv[yysp-2]);
          yyval:=NewType2(t_uniondef,yyv[yysp-1],yyv[yysp-2]);
-         
+
        end;
        end;
   48 : begin
   48 : begin
-         
+
          (* UNION dname closed_list *)
          (* UNION dname closed_list *)
          yyval:=NewType2(t_uniondef,yyv[yysp-0],yyv[yysp-1]);
          yyval:=NewType2(t_uniondef,yyv[yysp-0],yyv[yysp-1]);
-         
+
        end;
        end;
   49 : begin
   49 : begin
-         
+
          (* UNION dname  *)
          (* UNION dname  *)
          yyval:=yyv[yysp-0];
          yyval:=yyv[yysp-0];
-         
+
        end;
        end;
   50 : begin
   50 : begin
-         
+
          (* STRUCT dname *)
          (* STRUCT dname *)
          yyval:=yyv[yysp-0];
          yyval:=yyv[yysp-0];
-         
+
        end;
        end;
   51 : begin
   51 : begin
-         
+
          (* ENUM dname closed_enum_list *)
          (* ENUM dname closed_enum_list *)
          yyval:=NewType2(t_enumdef,yyv[yysp-0],yyv[yysp-1]);
          yyval:=NewType2(t_enumdef,yyv[yysp-0],yyv[yysp-1]);
-         
+
        end;
        end;
   52 : begin
   52 : begin
-         
+
          (* ENUM dname *)
          (* ENUM dname *)
          yyval:=yyv[yysp-0];
          yyval:=yyv[yysp-0];
-         
+
        end;
        end;
   53 : begin
   53 : begin
-         
+
          (* _CONST type_specifier *)
          (* _CONST type_specifier *)
          EmitIgnoreConst;
          EmitIgnoreConst;
          yyval:=yyv[yysp-0];
          yyval:=yyv[yysp-0];
-         
+
        end;
        end;
   54 : begin
   54 : begin
-         
+
          (* UNION closed_list  _PACKED *)
          (* UNION closed_list  _PACKED *)
          EmitPacked(1);
          EmitPacked(1);
          yyval:=NewType1(t_uniondef,yyv[yysp-1]);
          yyval:=NewType1(t_uniondef,yyv[yysp-1]);
-         
+
        end;
        end;
   55 : begin
   55 : begin
-         
+
          (* UNION closed_list *)
          (* UNION closed_list *)
          yyval:=NewType1(t_uniondef,yyv[yysp-0]);
          yyval:=NewType1(t_uniondef,yyv[yysp-0]);
-         
+
        end;
        end;
   56 : begin
   56 : begin
-         
+
          (* STRUCT closed_list _PACKED *)
          (* STRUCT closed_list _PACKED *)
          emitpacked(1);
          emitpacked(1);
          yyval:=NewType1(t_structdef,yyv[yysp-1]);
          yyval:=NewType1(t_structdef,yyv[yysp-1]);
-         
+
        end;
        end;
   57 : begin
   57 : begin
-         
+
          (* STRUCT closed_list  *)
          (* STRUCT closed_list  *)
          emitpacked(4);
          emitpacked(4);
          yyval:=NewType1(t_structdef,yyv[yysp-0]);
          yyval:=NewType1(t_structdef,yyv[yysp-0]);
-         
+
        end;
        end;
   58 : begin
   58 : begin
-         
+
          (* ENUM closed_enum_list*)
          (* ENUM closed_enum_list*)
          yyval:=NewType1(t_enumdef,yyv[yysp-0]);
          yyval:=NewType1(t_enumdef,yyv[yysp-0]);
-         
+
        end;
        end;
   59 : begin
   59 : begin
-         
+
          (* special_type_specifier *)
          (* special_type_specifier *)
          yyval:=yyv[yysp-0];
          yyval:=yyv[yysp-0];
-         
+
        end;
        end;
   60 : begin
   60 : begin
-         yyval:=yyv[yysp-0]; 
+         yyval:=yyv[yysp-0];
        end;
        end;
   61 : begin
   61 : begin
-         
+
          (*  member_declaration member_list *)
          (*  member_declaration member_list *)
          yyval:=NewType1(t_memberdeclist,yyv[yysp-1]);
          yyval:=NewType1(t_memberdeclist,yyv[yysp-1]);
          yyval^.next:=yyv[yysp-0];
          yyval^.next:=yyv[yysp-0];
-         
+
        end;
        end;
   62 : begin
   62 : begin
-         
+
          (* member_declaration *)
          (* member_declaration *)
          yyval:=NewType1(t_memberdeclist,yyv[yysp-0]);
          yyval:=NewType1(t_memberdeclist,yyv[yysp-0]);
-         
+
        end;
        end;
   63 : begin
   63 : begin
-         
+
          (* type_specifier declarator_list SEMICOLON *)
          (* type_specifier declarator_list SEMICOLON *)
          yyval:=NewType2(t_memberdec,yyv[yysp-2],yyv[yysp-1]);
          yyval:=NewType2(t_memberdec,yyv[yysp-2],yyv[yysp-1]);
-         
+
        end;
        end;
   64 : begin
   64 : begin
-         
+
          (* dname *)
          (* dname *)
          yyval:=NewID(act_token);
          yyval:=NewID(act_token);
-         
+
        end;
        end;
   65 : begin
   65 : begin
-         
+
          (* SIGNED special_type_name *)
          (* SIGNED special_type_name *)
          yyval:=HandleSpecialSignedType(yyv[yysp-0]);
          yyval:=HandleSpecialSignedType(yyv[yysp-0]);
-         
+
        end;
        end;
   66 : begin
   66 : begin
-         
+
          (* UNSIGNED special_type_name *)
          (* UNSIGNED special_type_name *)
          yyval:=HandleSpecialUnsignedType(yyv[yysp-0]);
          yyval:=HandleSpecialUnsignedType(yyv[yysp-0]);
-         
+
        end;
        end;
   67 : begin
   67 : begin
-         
+
          (* INT *)
          (* INT *)
          yyval:=NewCType(cint_STR,INT_STR);
          yyval:=NewCType(cint_STR,INT_STR);
-         
+
        end;
        end;
   68 : begin
   68 : begin
-         
+
          (* LONG *)
          (* LONG *)
          yyval:=NewCType(clong_STR,INT_STR);
          yyval:=NewCType(clong_STR,INT_STR);
-         
+
        end;
        end;
   69 : begin
   69 : begin
-         
+
          (* LONG INT *)
          (* LONG INT *)
          yyval:=NewCType(clong_STR,INT_STR);
          yyval:=NewCType(clong_STR,INT_STR);
-         
+
        end;
        end;
   70 : begin
   70 : begin
-         
+
          (* LONG LONG *)
          (* LONG LONG *)
          yyval:=NewCType(clonglong_STR,INT64_STR);
          yyval:=NewCType(clonglong_STR,INT64_STR);
-         
+
        end;
        end;
   71 : begin
   71 : begin
-         
+
          (* LONG LONG INT *)
          (* LONG LONG INT *)
          yyval:=NewCType(clonglong_STR,INT64_STR);
          yyval:=NewCType(clonglong_STR,INT64_STR);
-         
+
        end;
        end;
   72 : begin
   72 : begin
-         
+
          (* SHORT  *)
          (* SHORT  *)
          yyval:=NewCType(cshort_STR,SMALL_STR);
          yyval:=NewCType(cshort_STR,SMALL_STR);
-         
+
        end;
        end;
   73 : begin
   73 : begin
-         
+
          (* SHORT INT *)
          (* SHORT INT *)
          yyval:=NewCType(cshort_STR,SMALL_STR);
          yyval:=NewCType(cshort_STR,SMALL_STR);
-         
+
        end;
        end;
   74 : begin
   74 : begin
-         
+
          (* INT8 *)
          (* INT8 *)
          yyval:=NewCType(cint8_STR,SHORT_STR);
          yyval:=NewCType(cint8_STR,SHORT_STR);
-         
+
        end;
        end;
   75 : begin
   75 : begin
-         
+
          (* INT8 *)
          (* INT8 *)
          yyval:=NewCType(cint16_STR,SMALL_STR);
          yyval:=NewCType(cint16_STR,SMALL_STR);
-         
+
        end;
        end;
   76 : begin
   76 : begin
-         
+
          (* INT32 *)
          (* INT32 *)
          yyval:=NewCType(cint32_STR,INT_STR);
          yyval:=NewCType(cint32_STR,INT_STR);
-         
+
        end;
        end;
   77 : begin
   77 : begin
-         
+
          (* INT64 *)
          (* INT64 *)
-         
+
          yyval:=NewCType(cint64_STR,INT64_STR);
          yyval:=NewCType(cint64_STR,INT64_STR);
-         
+
        end;
        end;
   78 : begin
   78 : begin
-         
+
          (* FLOAT *)
          (* FLOAT *)
          yyval:=NewCType(cfloat_STR,FLOAT_STR);
          yyval:=NewCType(cfloat_STR,FLOAT_STR);
-         
+
        end;
        end;
   79 : begin
   79 : begin
-         
+
          (* VOID *)
          (* VOID *)
          yyval:=NewVoid;
          yyval:=NewVoid;
-         
+
        end;
        end;
   80 : begin
   80 : begin
-         
+
          (* CHAR *)
          (* CHAR *)
          yyval:=NewCType(cchar_STR,char_STR);
          yyval:=NewCType(cchar_STR,char_STR);
-         
+
        end;
        end;
   81 : begin
   81 : begin
-         
+
          (* UNSIGNED *)
          (* UNSIGNED *)
          yyval:=NewCType(cunsigned_STR,UINT_STR);
          yyval:=NewCType(cunsigned_STR,UINT_STR);
-         
+
        end;
        end;
   82 : begin
   82 : begin
-         
+
          (* special_type_name *)
          (* special_type_name *)
          yyval:=yyv[yysp-0];
          yyval:=yyv[yysp-0];
-         
+
        end;
        end;
   83 : begin
   83 : begin
-         
+
          (* dname *)
          (* dname *)
          yyval:=CheckUnderscore(yyv[yysp-0]);
          yyval:=CheckUnderscore(yyv[yysp-0]);
-         
+
        end;
        end;
   84 : begin
   84 : begin
-         
+
          (* declarator_list COMMA declarator *)
          (* declarator_list COMMA declarator *)
          yyval:=HandleDeclarationList(yyv[yysp-2],yyv[yysp-0]);
          yyval:=HandleDeclarationList(yyv[yysp-2],yyv[yysp-0]);
-         
+
        end;
        end;
   85 : begin
   85 : begin
-         
+
          (* error error_info COMMA declarator_list *)
          (* error error_info COMMA declarator_list *)
          EmitWriteln(' in declarator_list *)');
          EmitWriteln(' in declarator_list *)');
          yyval:=yyv[yysp-0];
          yyval:=yyv[yysp-0];
          yyerrok;
          yyerrok;
-         
+
        end;
        end;
   86 : begin
   86 : begin
-         
+
          (* error error_info *)
          (* error error_info *)
          EmitWriteln(' in declarator_list *)');
          EmitWriteln(' in declarator_list *)');
          yyerrok;
          yyerrok;
-         
+
        end;
        end;
   87 : begin
   87 : begin
-         
+
          (* declarator *)
          (* declarator *)
          yyval:=NewType1(t_declist,yyv[yysp-0]);
          yyval:=NewType1(t_declist,yyv[yysp-0]);
-         
+
        end;
        end;
   88 : begin
   88 : begin
-         
+
          (* type_specifier declarator *)
          (* type_specifier declarator *)
          yyval:=NewType2(t_arg,yyv[yysp-1],yyv[yysp-0]);
          yyval:=NewType2(t_arg,yyv[yysp-1],yyv[yysp-0]);
-         
+
        end;
        end;
   89 : begin
   89 : begin
-         
+
          (* type_specifier STAR declarator *)
          (* type_specifier STAR declarator *)
          yyval:=HandlePointerArgDeclarator(yyv[yysp-2],yyv[yysp-0]);
          yyval:=HandlePointerArgDeclarator(yyv[yysp-2],yyv[yysp-0]);
-         
+
        end;
        end;
   90 : begin
   90 : begin
-         
+
          (* type_specifier abstract_declarator *)
          (* type_specifier abstract_declarator *)
          yyval:=NewType2(t_arg,yyv[yysp-1],yyv[yysp-0]);
          yyval:=NewType2(t_arg,yyv[yysp-1],yyv[yysp-0]);
-         
+
        end;
        end;
   91 : begin
   91 : begin
-         
+
          (* argument_declaration *)
          (* argument_declaration *)
          yyval:=NewType2(t_arglist,yyv[yysp-0],nil);
          yyval:=NewType2(t_arglist,yyv[yysp-0],nil);
-         
+
        end;
        end;
   92 : begin
   92 : begin
-         
+
          (* argument_declaration COMMA argument_declaration_list *)
          (* argument_declaration COMMA argument_declaration_list *)
          yyval:=HandleArgList(yyv[yysp-2],yyv[yysp-0])
          yyval:=HandleArgList(yyv[yysp-2],yyv[yysp-0])
-         
+
        end;
        end;
   93 : begin
   93 : begin
-         
+
          (* ELLIPISIS *)
          (* ELLIPISIS *)
          yyval:=NewType2(t_arglist,ellipsisarg,nil);
          yyval:=NewType2(t_arglist,ellipsisarg,nil);
-         
+
        end;
        end;
   94 : begin
   94 : begin
-         
+
          (* empty *)
          (* empty *)
          yyval:=nil;
          yyval:=nil;
-         
+
        end;
        end;
   95 : begin
   95 : begin
-         
+
          (* FAR *)
          (* FAR *)
          yyval:=NewID('far');
          yyval:=NewID('far');
-         
+
        end;
        end;
   96 : begin
   96 : begin
-         
+
          (* NEAR*)
          (* NEAR*)
          yyval:=NewID('near');
          yyval:=NewID('near');
-         
+
        end;
        end;
   97 : begin
   97 : begin
-         
+
          (* HUGE *)
          (* HUGE *)
          yyval:=NewID('huge');
          yyval:=NewID('huge');
        end;
        end;
   98 : begin
   98 : begin
-         
+
          (* _CONST declarator *)
          (* _CONST declarator *)
          EmitIgnoreConst;
          EmitIgnoreConst;
          yyval:=yyv[yysp-0];
          yyval:=yyv[yysp-0];
-         
+
        end;
        end;
   99 : begin
   99 : begin
-         
+
          (* size_overrider STAR declarator *)
          (* size_overrider STAR declarator *)
          yyval:=HandleSizeOverrideDeclarator(yyv[yysp-2],yyv[yysp-0]);
          yyval:=HandleSizeOverrideDeclarator(yyv[yysp-2],yyv[yysp-0]);
-         
+
        end;
        end;
  100 : begin
  100 : begin
-         
+
          (* %prec PSTAR this was wrong!! *)
          (* %prec PSTAR this was wrong!! *)
          yyval:=HandleDeclarator(t_pointerdef,yyv[yysp-0]);
          yyval:=HandleDeclarator(t_pointerdef,yyv[yysp-0]);
-         
+
        end;
        end;
  101 : begin
  101 : begin
-         
+
          (* _AND declarator %prec P_AND *)
          (* _AND declarator %prec P_AND *)
          yyval:=HandleDeclarator(t_addrdef,yyv[yysp-0]);
          yyval:=HandleDeclarator(t_addrdef,yyv[yysp-0]);
-         
+
        end;
        end;
  102 : begin
  102 : begin
-         
+
          (* dname COLON expr *)
          (* dname COLON expr *)
          yyval:=HandleSizedDeclarator(yyv[yysp-2],yyv[yysp-0]);
          yyval:=HandleSizedDeclarator(yyv[yysp-2],yyv[yysp-0]);
-         
+
        end;
        end;
  103 : begin
  103 : begin
-         
+
          (*     dname ASSIGN expr *)
          (*     dname ASSIGN expr *)
          yyval:=HandleDefaultDeclarator(yyv[yysp-2],yyv[yysp-0]);
          yyval:=HandleDefaultDeclarator(yyv[yysp-2],yyv[yysp-0]);
-         
+
        end;
        end;
  104 : begin
  104 : begin
-         
+
          (* dname *)
          (* dname *)
          yyval:=NewType2(t_dec,nil,yyv[yysp-0]);
          yyval:=NewType2(t_dec,nil,yyv[yysp-0]);
-         
+
        end;
        end;
  105 : begin
  105 : begin
-         
+
          (* declarator LKLAMMER argument_declaration_list RKLAMMER *)
          (* declarator LKLAMMER argument_declaration_list RKLAMMER *)
          yyval:=HandleDeclarator2(t_procdef,yyv[yysp-3],yyv[yysp-1]);
          yyval:=HandleDeclarator2(t_procdef,yyv[yysp-3],yyv[yysp-1]);
-         
+
        end;
        end;
  106 : begin
  106 : begin
-         
+
          (*   declarator no_arg *)
          (*   declarator no_arg *)
          yyval:=HandleDeclarator2(t_procdef,yyv[yysp-1],Nil);
          yyval:=HandleDeclarator2(t_procdef,yyv[yysp-1],Nil);
-         
+
        end;
        end;
  107 : begin
  107 : begin
-         
+
          (* declarator LECKKLAMMER expr RECKKLAMMER *)
          (* declarator LECKKLAMMER expr RECKKLAMMER *)
          yyval:=HandleDeclarator2(t_arraydef,yyv[yysp-3],yyv[yysp-1]);
          yyval:=HandleDeclarator2(t_arraydef,yyv[yysp-3],yyv[yysp-1]);
-         
+
        end;
        end;
  108 : begin
  108 : begin
-         
+
          (* declarator LECKKLAMMER RECKKLAMMER *)
          (* declarator LECKKLAMMER RECKKLAMMER *)
          yyval:=HandleDeclarator(t_pointerdef,yyv[yysp-2]);
          yyval:=HandleDeclarator(t_pointerdef,yyv[yysp-2]);
-         
+
        end;
        end;
  109 : begin
  109 : begin
-         
+
          (* LKLAMMER declarator RKLAMMER *)
          (* LKLAMMER declarator RKLAMMER *)
          yyval:=yyv[yysp-1];
          yyval:=yyv[yysp-1];
-         
+
        end;
        end;
  110 : begin
  110 : begin
          yyval := yyv[yysp-1];
          yyval := yyv[yysp-1];
@@ -785,67 +785,67 @@ begin
          yyval := yyv[yysp-2];
          yyval := yyv[yysp-2];
        end;
        end;
  112 : begin
  112 : begin
-         
+
          (* _CONST abstract_declarator *)
          (* _CONST abstract_declarator *)
          EmitAbstractIgnored;
          EmitAbstractIgnored;
          yyval:=yyv[yysp-0];
          yyval:=yyv[yysp-0];
-         
+
        end;
        end;
  113 : begin
  113 : begin
-         
+
          (* size_overrider STAR abstract_declarator *)
          (* size_overrider STAR abstract_declarator *)
          yyval:=HandleSizedPointerDeclarator(yyv[yysp-0],yyv[yysp-2]);
          yyval:=HandleSizedPointerDeclarator(yyv[yysp-0],yyv[yysp-2]);
-         
+
        end;
        end;
  114 : begin
  114 : begin
-         
+
          (* STAR abstract_declarator %prec PSTAR *)
          (* STAR abstract_declarator %prec PSTAR *)
          yyval:=HandlePointerAbstractDeclarator(yyv[yysp-0]);
          yyval:=HandlePointerAbstractDeclarator(yyv[yysp-0]);
-         
+
        end;
        end;
  115 : begin
  115 : begin
-         
+
          (* abstract_declarator LKLAMMER argument_declaration_list RKLAMMER *)
          (* abstract_declarator LKLAMMER argument_declaration_list RKLAMMER *)
          yyval:=HandlePointerAbstractListDeclarator(yyv[yysp-3],yyv[yysp-1]);
          yyval:=HandlePointerAbstractListDeclarator(yyv[yysp-3],yyv[yysp-1]);
-         
+
        end;
        end;
  116 : begin
  116 : begin
-         
+
          (* abstract_declarator no_arg *)
          (* abstract_declarator no_arg *)
          yyval:=HandleFuncNoArg(yyv[yysp-1]);
          yyval:=HandleFuncNoArg(yyv[yysp-1]);
-         
+
        end;
        end;
  117 : begin
  117 : begin
-         
+
          (* abstract_declarator LECKKLAMMER expr RECKKLAMMER *)
          (* abstract_declarator LECKKLAMMER expr RECKKLAMMER *)
          yyval:=HandleSizedArrayDecl(yyv[yysp-3],yyv[yysp-1]);
          yyval:=HandleSizedArrayDecl(yyv[yysp-3],yyv[yysp-1]);
-         
+
        end;
        end;
  118 : begin
  118 : begin
-         
+
          (* declarator LECKKLAMMER RECKKLAMMER *)
          (* declarator LECKKLAMMER RECKKLAMMER *)
          yyval:=HandleArrayDecl(yyv[yysp-2]);
          yyval:=HandleArrayDecl(yyv[yysp-2]);
-         
+
        end;
        end;
  119 : begin
  119 : begin
-         
+
          (* LKLAMMER abstract_declarator RKLAMMER *)
          (* LKLAMMER abstract_declarator RKLAMMER *)
          yyval:=yyv[yysp-1];
          yyval:=yyv[yysp-1];
-         
+
        end;
        end;
  120 : begin
  120 : begin
-         
+
          yyval:=NewType2(t_dec,nil,nil);
          yyval:=NewType2(t_dec,nil,nil);
-         
+
        end;
        end;
  121 : begin
  121 : begin
-         
+
          (* shift_expr *)
          (* shift_expr *)
          yyval:=yyv[yysp-0];
          yyval:=yyv[yysp-0];
-         
+
        end;
        end;
  122 : begin
  122 : begin
-         yyval:=NewBinaryOp(':=',yyv[yysp-2],yyv[yysp-0]); 
+         yyval:=NewBinaryOp(':=',yyv[yysp-2],yyv[yysp-0]);
        end;
        end;
  123 : begin
  123 : begin
          yyval:=NewBinaryOp('=',yyv[yysp-2],yyv[yysp-0]);
          yyval:=NewBinaryOp('=',yyv[yysp-2],yyv[yysp-0]);
@@ -893,192 +893,192 @@ begin
          yyval:=NewBinaryOp(' shr ',yyv[yysp-2],yyv[yysp-0]);
          yyval:=NewBinaryOp(' shr ',yyv[yysp-2],yyv[yysp-0]);
        end;
        end;
  138 : begin
  138 : begin
-         
+
          HandleTernary(yyv[yysp-2],yyv[yysp-0]);
          HandleTernary(yyv[yysp-2],yyv[yysp-0]);
-         
+
        end;
        end;
  139 : begin
  139 : begin
          yyval:=yyv[yysp-0];
          yyval:=yyv[yysp-0];
        end;
        end;
  140 : begin
  140 : begin
-         
+
          (* if A then B else C *)
          (* if A then B else C *)
          yyval:=NewType3(t_ifexpr,nil,yyv[yysp-2],yyv[yysp-0]);
          yyval:=NewType3(t_ifexpr,nil,yyv[yysp-2],yyv[yysp-0]);
-         
+
        end;
        end;
  141 : begin
  141 : begin
-         yyval:=yyv[yysp-0]; 
+         yyval:=yyv[yysp-0];
        end;
        end;
  142 : begin
  142 : begin
          yyval:=nil;
          yyval:=nil;
        end;
        end;
  143 : begin
  143 : begin
-         
+
          yyval:=yyv[yysp-0];
          yyval:=yyv[yysp-0];
-         
+
        end;
        end;
  144 : begin
  144 : begin
-         
+
          yyval:=yyv[yysp-0];
          yyval:=yyv[yysp-0];
-         
+
        end;
        end;
  145 : begin
  145 : begin
-         
+
          (* remove L prefix for widestrings *)
          (* remove L prefix for widestrings *)
          yyval:=CheckWideString(act_token);
          yyval:=CheckWideString(act_token);
-         
+
        end;
        end;
  146 : begin
  146 : begin
-         
+
          yyval:=NewID(act_token);
          yyval:=NewID(act_token);
-         
+
        end;
        end;
  147 : begin
  147 : begin
-         
+
          yyval:=NewBinaryOp('.',yyv[yysp-2],yyv[yysp-0]);
          yyval:=NewBinaryOp('.',yyv[yysp-2],yyv[yysp-0]);
-         
+
        end;
        end;
  148 : begin
  148 : begin
-         
+
          yyval:=NewBinaryOp('^.',yyv[yysp-2],yyv[yysp-0]);
          yyval:=NewBinaryOp('^.',yyv[yysp-2],yyv[yysp-0]);
-         
+
        end;
        end;
  149 : begin
  149 : begin
-         
+
          yyval:=NewUnaryOp('-',yyv[yysp-0]);
          yyval:=NewUnaryOp('-',yyv[yysp-0]);
-         
+
        end;
        end;
  150 : begin
  150 : begin
-         
+
          yyval:=NewUnaryOp('+',yyv[yysp-0]);
          yyval:=NewUnaryOp('+',yyv[yysp-0]);
-         
+
        end;
        end;
  151 : begin
  151 : begin
-         
+
          yyval:=NewUnaryOp('@',yyv[yysp-0]);
          yyval:=NewUnaryOp('@',yyv[yysp-0]);
-         
+
        end;
        end;
  152 : begin
  152 : begin
-         
+
          yyval:=NewUnaryOp(' not ',yyv[yysp-0]);
          yyval:=NewUnaryOp(' not ',yyv[yysp-0]);
-         
+
        end;
        end;
  153 : begin
  153 : begin
-         
+
          if assigned(yyv[yysp-0]) then
          if assigned(yyv[yysp-0]) then
          yyval:=NewType2(t_typespec,yyv[yysp-2],yyv[yysp-0])
          yyval:=NewType2(t_typespec,yyv[yysp-2],yyv[yysp-0])
          else
          else
          yyval:=yyv[yysp-2];
          yyval:=yyv[yysp-2];
-         
+
        end;
        end;
  154 : begin
  154 : begin
-         
+
          yyval:=NewType2(t_typespec,yyv[yysp-2],yyv[yysp-0]);
          yyval:=NewType2(t_typespec,yyv[yysp-2],yyv[yysp-0]);
-         
+
        end;
        end;
  155 : begin
  155 : begin
-         
+
          yyval:=HandlePointerType(yyv[yysp-3],yyv[yysp-0],Nil);
          yyval:=HandlePointerType(yyv[yysp-3],yyv[yysp-0],Nil);
-         
+
        end;
        end;
  156 : begin
  156 : begin
-         
+
          yyval:=HandlePointerType(yyv[yysp-4],yyv[yysp-0],yyv[yysp-3]);
          yyval:=HandlePointerType(yyv[yysp-4],yyv[yysp-0],yyv[yysp-3]);
-         
+
        end;
        end;
  157 : begin
  157 : begin
-         
+
          yyval:=HandleFuncExpr(yyv[yysp-3],yyv[yysp-1]);
          yyval:=HandleFuncExpr(yyv[yysp-3],yyv[yysp-1]);
-         
+
        end;
        end;
  158 : begin
  158 : begin
-         
+
          yyval:=yyv[yysp-1];
          yyval:=yyv[yysp-1];
-         
+
        end;
        end;
  159 : begin
  159 : begin
-         
+
          yyval:=NewType2(t_callop,yyv[yysp-5],yyv[yysp-1]);
          yyval:=NewType2(t_callop,yyv[yysp-5],yyv[yysp-1]);
-         
+
        end;
        end;
  160 : begin
  160 : begin
-         
+
          yyval:=NewType2(t_arrayop,yyv[yysp-3],yyv[yysp-1]);
          yyval:=NewType2(t_arrayop,yyv[yysp-3],yyv[yysp-1]);
-         
+
        end;
        end;
  161 : begin
  161 : begin
-         
+
          (*enum_element COMMA enum_list *)
          (*enum_element COMMA enum_list *)
          yyval:=yyv[yysp-2];
          yyval:=yyv[yysp-2];
          yyval^.next:=yyv[yysp-0];
          yyval^.next:=yyv[yysp-0];
-         
+
        end;
        end;
  162 : begin
  162 : begin
-         
+
          (* enum element *)
          (* enum element *)
          yyval:=yyv[yysp-0];
          yyval:=yyv[yysp-0];
-         
+
        end;
        end;
  163 : begin
  163 : begin
-         
+
          (* empty enum list *)
          (* empty enum list *)
          yyval:=nil;
          yyval:=nil;
-         
+
        end;
        end;
  164 : begin
  164 : begin
-         
+
          (* enum_element: dname _ASSIGN expr *)
          (* enum_element: dname _ASSIGN expr *)
          yyval:=NewType2(t_enumlist,yyv[yysp-2],yyv[yysp-0]);
          yyval:=NewType2(t_enumlist,yyv[yysp-2],yyv[yysp-0]);
-         
+
        end;
        end;
  165 : begin
  165 : begin
-         
+
          (* enum_element: dname *)
          (* enum_element: dname *)
          yyval:=NewType2(t_enumlist,yyv[yysp-0],nil);
          yyval:=NewType2(t_enumlist,yyv[yysp-0],nil);
-         
+
        end;
        end;
  166 : begin
  166 : begin
-         
+
          (* unary_expr *)
          (* unary_expr *)
          yyval:=HandleUnaryDefExpr(yyv[yysp-0]);
          yyval:=HandleUnaryDefExpr(yyv[yysp-0]);
-         
+
        end;
        end;
  167 : begin
  167 : begin
-         
+
          (* SPACE_DEFINE def_expr *)
          (* SPACE_DEFINE def_expr *)
          yyval:=yyv[yysp-0];
          yyval:=yyv[yysp-0];
-         
+
        end;
        end;
  168 : begin
  168 : begin
-         
+
          (* maybe_space LKLAMMER def_expr RKLAMMER *)
          (* maybe_space LKLAMMER def_expr RKLAMMER *)
          yyval:=yyv[yysp-1]
          yyval:=yyv[yysp-1]
-         
+
        end;
        end;
  169 : begin
  169 : begin
-         
+
          (*exprlist COMMA expr*)
          (*exprlist COMMA expr*)
          yyval:=yyv[yysp-2];
          yyval:=yyv[yysp-2];
          yyv[yysp-2]^.next:=yyv[yysp-0];
          yyv[yysp-2]^.next:=yyv[yysp-0];
-         
+
        end;
        end;
  170 : begin
  170 : begin
-         
+
          (* exprelem *)
          (* exprelem *)
          yyval:=yyv[yysp-0];
          yyval:=yyv[yysp-0];
-         
+
        end;
        end;
  171 : begin
  171 : begin
-         
+
          (* empty expression list *)
          (* empty expression list *)
          yyval:=nil;
          yyval:=nil;
-         
+
        end;
        end;
  172 : begin
  172 : begin
-         
+
          (*expr *)
          (*expr *)
          yyval:=NewType1(t_exprlist,yyv[yysp-0]);
          yyval:=NewType1(t_exprlist,yyv[yysp-0]);
-         
+
        end;
        end;
   end;
   end;
 end(*yyaction*);
 end(*yyaction*);

+ 9 - 9
utils/h2pas/scan.pas

@@ -644,7 +644,7 @@ begin
                         end
                         end
                          else skip_until_eol;
                          else skip_until_eol;
   8:
   8:
-                               
+
                         if NotInCPlusBlock then
                         if NotInCPlusBlock then
                         begin
                         begin
                            (* handle pre- and postfixes *)
                            (* handle pre- and postfixes *)
@@ -660,7 +660,7 @@ begin
                         else
                         else
                          skip_until_eol;
                          skip_until_eol;
   9:
   9:
-                             
+
                         if NotInCPlusBlock then
                         if NotInCPlusBlock then
                         begin
                         begin
                           return(NUMBER);
                           return(NUMBER);
@@ -862,41 +862,41 @@ begin
   49:
   49:
                         if NotInCPlusBlock then return(VOID) else skip_until_eol;
                         if NotInCPlusBlock then return(VOID) else skip_until_eol;
   50:
   50:
-                                                             
+
                         begin
                         begin
                           if not stripinfo then
                           if not stripinfo then
                             writeln(outfile,'{ C++ extern C conditionnal removed }');
                             writeln(outfile,'{ C++ extern C conditionnal removed }');
                         end;
                         end;
   51:
   51:
-                                                           
+
                         begin
                         begin
                           if not stripinfo then
                           if not stripinfo then
                             writeln(outfile,'{ C++ extern C conditionnal removed }');
                             writeln(outfile,'{ C++ extern C conditionnal removed }');
                         end;
                         end;
   52:
   52:
-                                                
+
                         begin
                         begin
                           if not stripinfo then
                           if not stripinfo then
                             writeln(outfile,'{ C++ end of extern C conditionnal removed }');
                             writeln(outfile,'{ C++ end of extern C conditionnal removed }');
                         end;
                         end;
   53:
   53:
-                                              
+
                         begin
                         begin
                           if not stripinfo then
                           if not stripinfo then
                             writeln(outfile,'{ C++ end of extern C conditionnal removed }');
                             writeln(outfile,'{ C++ end of extern C conditionnal removed }');
                         end;
                         end;
   54:
   54:
-                               
+
                         begin
                         begin
                           Inc(cplusblocklevel);
                           Inc(cplusblocklevel);
                         end;
                         end;
   55:
   55:
-                                 
+
                         begin
                         begin
                           Inc(cplusblocklevel);
                           Inc(cplusblocklevel);
                         end;
                         end;
   56:
   56:
-             
+
                         begin
                         begin
                            if cplusblocklevel > 0 then
                            if cplusblocklevel > 0 then
                              Inc(cplusblocklevel)
                              Inc(cplusblocklevel)

+ 3 - 3
utils/h2pas/scanbase.pp

@@ -212,7 +212,7 @@ begin
     begin
     begin
     Skip_until_eol;
     Skip_until_eol;
     exit;
     exit;
-    end;  
+    end;
   if not stripcomment then
   if not stripcomment then
     write(outfile,aktspace,'{');
     write(outfile,aktspace,'{');
   repeat
   repeat
@@ -324,7 +324,7 @@ begin
   until false;
   until false;
   flush(outfile);
   flush(outfile);
 end;
 end;
-  
+
 Procedure CheckLongString;
 Procedure CheckLongString;
 
 
 begin
 begin
@@ -398,7 +398,7 @@ begin
   else
   else
     skip_until_eol;
     skip_until_eol;
 end;
 end;
- 
+
 Procedure HandlePreProcIfDef;
 Procedure HandlePreProcIfDef;
 
 
 begin
 begin

+ 1 - 1
utils/ihxutil/fpmake.pp

@@ -2,7 +2,7 @@
 {$mode objfpc}{$H+}
 {$mode objfpc}{$H+}
 program fpmake;
 program fpmake;
 
 
-uses 
+uses
 {$ifdef unix}
 {$ifdef unix}
   cthreads,
   cthreads,
 {$endif}
 {$endif}

+ 1 - 1
utils/importtl/fpmake.pp

@@ -2,7 +2,7 @@
 {$mode objfpc}{$H+}
 {$mode objfpc}{$H+}
 program fpmake;
 program fpmake;
 
 
-uses 
+uses
 {$ifdef unix}
 {$ifdef unix}
   cthreads,
   cthreads,
 {$endif}
 {$endif}

+ 1 - 1
utils/instantfpc/fpmake.pp

@@ -2,7 +2,7 @@
 {$mode objfpc}{$H+}
 {$mode objfpc}{$H+}
 program fpmake;
 program fpmake;
 
 
-uses 
+uses
   {$ifdef unix}
   {$ifdef unix}
   cthreads,
   cthreads,
   {$endif}
   {$endif}

+ 24 - 24
utils/instantfpc/instantfpc.pas

@@ -100,32 +100,32 @@ var
   S,E : String;
   S,E : String;
   DeleteCache : Boolean = False;
   DeleteCache : Boolean = False;
   RunIt: boolean = true;
   RunIt: boolean = true;
-  
+
 // Return true if filename found.
 // Return true if filename found.
-  
+
 Function InterpretParam(p : String) : boolean;
 Function InterpretParam(p : String) : boolean;
 begin
 begin
   Result:=False;
   Result:=False;
   if (P='') then exit;
   if (P='') then exit;
-  if p='-v' then 
+  if p='-v' then
     begin
     begin
     writeln('instantfpc '+Version);
     writeln('instantfpc '+Version);
     Halt(1);
     Halt(1);
     end
     end
-  else if p='-h' then 
+  else if p='-h' then
     usage('')
     usage('')
-  else if p='--get-cache' then 
+  else if p='--get-cache' then
     DisplayCache
     DisplayCache
-  else if copy(p,1,11)='--compiler=' then 
+  else if copy(p,1,11)='--compiler=' then
     begin
     begin
     delete(P,1,11);
     delete(P,1,11);
     SetCompiler(p);
     SetCompiler(p);
-    end 
-  else if copy(p,1,12)='--set-cache=' then 
+    end
+  else if copy(p,1,12)='--set-cache=' then
     begin
     begin
     delete(P,1,12);
     delete(P,1,12);
     SetCacheDir(p);
     SetCacheDir(p);
-    end 
+    end
   else if p='--skip-run' then
   else if p='--skip-run' then
     begin
     begin
     RunIt:=false;
     RunIt:=false;
@@ -141,58 +141,58 @@ begin
     Result:=True;
     Result:=True;
     end;
     end;
 end;
 end;
-  
+
 begin
 begin
   Filename:='';
   Filename:='';
   { For example:
   { For example:
       /usr/bin/instantfpc -MObjFpc -Sh ./envvars.pas param1
       /usr/bin/instantfpc -MObjFpc -Sh ./envvars.pas param1
   }
   }
-  for i:=1 to Paramcount do 
+  for i:=1 to Paramcount do
     begin
     begin
     p:=ParamStr(i);
     p:=ParamStr(i);
     if p='' then
     if p='' then
       continue
       continue
-    else 
+    else
       begin
       begin
       if (I<>1) then
       if (I<>1) then
         begin
         begin
         if InterpretParam(p) then
         if InterpretParam(p) then
           Break;
           Break;
-        end  
+        end
       else
       else
-        begin  
-        // The linux kernel passes the whole shebang line as 1 argument. 
+        begin
+        // The linux kernel passes the whole shebang line as 1 argument.
         // We must parse and split it ourselves.
         // We must parse and split it ourselves.
         Repeat
         Repeat
           J:=Pos(' ',P);
           J:=Pos(' ',P);
           if (J=0) then
           if (J=0) then
             J:=Length(P)+1;
             J:=Length(P)+1;
-          if InterpretParam(Copy(P,1,J-1)) then 
+          if InterpretParam(Copy(P,1,J-1)) then
             Break;
             Break;
           Delete(P,1,J);
           Delete(P,1,J);
         Until (P='');
         Until (P='');
-        if (FileName<>'') then 
+        if (FileName<>'') then
           Break;
           Break;
         end;
         end;
-      end;  
+      end;
   end;
   end;
-  if (Filename='') then 
+  if (Filename='') then
     Usage('Missing source file');
     Usage('Missing source file');
   CheckSourceName(Filename);
   CheckSourceName(Filename);
   Src:=TStringList.Create;
   Src:=TStringList.Create;
   try
   try
     if FileName<>'--' then
     if FileName<>'--' then
       Src.LoadFromFile(Filename)
       Src.LoadFromFile(Filename)
-    else  
+    else
       begin
       begin
-      While not EOF do 
+      While not EOF do
         begin
         begin
         Readln(S);
         Readln(S);
         Src.Add(S);
         Src.Add(S);
         end;
         end;
-      FileName:=ChangeFileExt(GetTempFileName,'.pp');  
+      FileName:=ChangeFileExt(GetTempFileName,'.pp');
       DeleteCache:=true;
       DeleteCache:=true;
-      end;  
+      end;
     CommentShebang(Src);
     CommentShebang(Src);
     CacheDir:=GetCacheDir;
     CacheDir:=GetCacheDir;
 
 
@@ -213,7 +213,7 @@ begin
     if RunIt then
     if RunIt then
       Run(OutputFilename);
       Run(OutputFilename);
     if DeleteCache then
     if DeleteCache then
-      DeleteFile(OutputFileName);  
+      DeleteFile(OutputFileName);
   finally
   finally
     // memory is freed by OS, but for debugging puposes you can do it manually
     // memory is freed by OS, but for debugging puposes you can do it manually
     {$IFDEF IFFreeMem}
     {$IFDEF IFFreeMem}

+ 1 - 1
utils/instantfpc/instantfptools.pas

@@ -423,7 +423,7 @@ begin
     if paramcount>1 then
     if paramcount>1 then
       begin
       begin
         setlength(args,paramcount-1);
         setlength(args,paramcount-1);
-        for i:=2 to paramcount do 
+        for i:=2 to paramcount do
           args[i-2]:=paramstr(i);
           args[i-2]:=paramstr(i);
       end;
       end;
     Halt(ExecuteProcess(FN,args));
     Halt(ExecuteProcess(FN,args));

+ 1 - 1
utils/json2pas/fpmake.pp

@@ -2,7 +2,7 @@
 {$mode objfpc}{$H+}
 {$mode objfpc}{$H+}
 program fpmake;
 program fpmake;
 
 
-uses 
+uses
   {$ifdef unix}
   {$ifdef unix}
   cthreads,
   cthreads,
   {$endif}
   {$endif}

+ 1 - 1
utils/mksymbian/cfgfile.pas

@@ -29,7 +29,7 @@ unit cfgfile;
 interface
 interface
 
 
 uses
 uses
-  Classes, SysUtils; 
+  Classes, SysUtils;
 
 
 implementation
 implementation
 
 

+ 1 - 1
utils/mksymbian/cmdline.pas

@@ -42,7 +42,7 @@ type
     procedure ShowPath;
     procedure ShowPath;
     procedure ParseCmdLineOptions(var opts: TMkSymbianOptions);
     procedure ParseCmdLineOptions(var opts: TMkSymbianOptions);
   end;
   end;
-  
+
 var
 var
   vCmdLine: TCmdLine;
   vCmdLine: TCmdLine;
 
 

Деякі файли не було показано, через те що забагато файлів було змінено