فهرست منبع

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
 
-delp    : Deletes all files generated by Free Pascal, as well 
+delp    : Deletes all files generated by Free Pascal, as well
           temporary files.
 
 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);
    if e<>0 then
      doerror;
-     
+
    p:=loadunicodemapping(paramstr(1),paramstr(1)+'.txt',i);
    if p=nil then
      doerror;

+ 3 - 3
utils/debugsvr/README.txt

@@ -1,12 +1,12 @@
 This is the Free Pascal debug server tool.
 
 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/)
 However, it is a totally new implementation, designed to be cross-platform
 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.
 
 To use this:
@@ -16,7 +16,7 @@ To use this:
    is not yet started. The inet socket version will not)
 
 - Include 'dbugintf' unit in your program/unit's 'uses' clause.
-  
+
 - Include 'SendDebug()' statements wherever needed in possible.
   (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.
 
 Each line is constructed as follows:
-  
+
 ```
-FileName=Rule;Compile Options 
+FileName=Rule;Compile Options
 ```
 
 Here
@@ -50,16 +50,16 @@ the name of the math unit will not be changed.
 ## 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
-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.
 
 # Conversion Rules
 
 A rule can take the following forms:
-  
+
 "*DottedUnitName" : Use the dotted name as typed.
-   
+
 Example:
 
 ```
@@ -77,29 +77,29 @@ sysutils=system
 ```
 
 will result in a file system.sysutils
- 
+
 "Prefix,*UnitSuffix" : This is equivalent to *Prefix.UnitSuffix
 
 Example:
 
 ```
-sysutils=System,*SysUtils 
+sysutils=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:
 
 ```
-fpreportdata=FpReport,-fpreport 
+fpreportdata=FpReport,-fpreport
 ```
 
 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:
 
@@ -109,7 +109,7 @@ elfresource=System.Resources,resource-
 
 
 Will result in System.Resources.elf
-  
+
 
 # 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.
 
 ```
-echo "sysutils" | conditionalprefix System will result in 
+echo "sysutils" | conditionalprefix System will result in
 ```
 
 ```
 {$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
 
 ## dond.pp
@@ -143,17 +143,17 @@ Tool to lowercase values in a Name=Value list
 
 ## 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
 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.
 
 Example:
 
 ```
-echo "uses sysutils, classes" | fixuses known.txt 
+echo "uses sysutils, classes" | fixuses known.txt
 ```
 
 results in
@@ -186,7 +186,7 @@ sysutils=*System.SysUtils
 classes=*System.Classes
 ```
 
-results in 
+results in
 
 ```
 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
 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
 
@@ -219,7 +219,7 @@ program or unit so it uses dotted names, based on a list of known aliases.
 
 ## 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
 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.
@@ -258,7 +258,7 @@ and the Makefile:
 sysutils($PPUEXT): sysutils.pp
 	$(COMPILER) sysutils.pp
 
-classes($PPUEXT): classes.pp sysutils.pp 
+classes($PPUEXT): classes.pp sysutils.pp
 	$(COMPILER) classes.pp
 ```
 
@@ -266,11 +266,11 @@ is transformed to
 sysutils($PPUEXT): $(SYSUTILSUNIT).pp
         $(COMPILER) $(SYSUTILSUNIT).pp
 
-classes($PPUEXT): $(CLASSESUNIT).pp $(SYSUTILSUNIT).pp 
+classes($PPUEXT): $(CLASSESUNIT).pp $(SYSUTILSUNIT).pp
         $(COMPILER) $(CLASSESUNIT).pp
-	
 
-## reworkmakefile.pp  
+
+## reworkmakefile.pp
 
 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

+ 1 - 1
utils/dotutils/addnamespacetofpmake.pp

@@ -3,7 +3,7 @@
     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.
-    
+
     See the file COPYING.FPC, included in this distribution,
     for details about the copyright.
 

+ 2 - 2
utils/dotutils/conditionalprefix.pp

@@ -3,9 +3,9 @@
     Copyright (c) 2022 by Michael Van Canneyt, [email protected]
 
     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
-    
+
     See the file COPYING.FPC, included in this distribution,
     for details about the copyright.
 

+ 1 - 1
utils/dotutils/dond.pp

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

+ 2 - 2
utils/dotutils/encloseunit.pp

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

+ 3 - 3
utils/dotutils/fixuses.pp

@@ -2,11 +2,11 @@
     This file is part of the Free Component Library
     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.
-    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.
-    
+
     See the file COPYING.FPC, included in this distribution,
     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.
     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.
-        
+
     See the file COPYING.FPC, included in this distribution,
     for details about the copyright.
 

+ 1 - 1
utils/dotutils/known.txt

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

+ 2 - 2
utils/dotutils/makedottedfiles.pp

@@ -2,9 +2,9 @@
     This file is part of the Free Component Library
     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.
-    
+
     See the file COPYING.FPC, included in this distribution,
     for details about the copyright.
 

+ 2 - 2
utils/dotutils/prefixunits.pp

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

+ 2 - 2
utils/dotutils/proxyunit.pp

@@ -2,9 +2,9 @@
     This file is part of the Free Component Library
     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.
-        
+
     See the file COPYING.FPC, included in this distribution,
     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.
     (see genunitnames for how to create the variables)
-    
+
     See the file COPYING.FPC, included in this distribution,
     for details about the copyright.
 

+ 2 - 2
utils/dotutils/reworkmakefile.pp

@@ -2,10 +2,10 @@
     This file is part of the Free Component Library
     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.
     (see genunitnames for how to create the variables)
-    
+
     See the file COPYING.FPC, included in this distribution,
     for details about the copyright.
 

+ 1 - 1
utils/dxegen/fpmake.pp

@@ -2,7 +2,7 @@
 {$mode objfpc}{$H+}
 program fpmake;
 
-uses 
+uses
   {$ifdef unix}
   cthreads,
   {$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
 fpmake.
 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
 script, since it's Makefile.fpc is very different from the others.
 

+ 1 - 1
utils/fpcm/fpcmmain.pp

@@ -157,7 +157,7 @@ interface
       var
         OSCpuPossible : TOsCpuPossible;
 {$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 }
         { 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.
 
 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
   ./regenmakefiles.sh
   cd ../packages

+ 2 - 2
utils/fpcm/regeninc.pp

@@ -7,7 +7,7 @@ const
   ininame = 'fpcmake.ini';
   incname = 'fpcmake.inc';
   constname = 'fpcmakeini';
-  
+
 var
   Data2Inc : string;
   res : integer;
@@ -25,6 +25,6 @@ begin
     Halt(2);
     end;
   Res:=ExecuteProcess(data2inc,['-b','-s',ininame,incname,constname]);
-  if Res<>0 then 
+  if Res<>0 then
     Halt(Res);
 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 )
           3) crt1.o is no longer installed under /usr -> add its directory explicitly via
              -Fl
-            
+
         We can't detect the macOS version inside fpc.cfg, unfortunately, so we can only
         insert this while generating the configuration file.
-        
+
         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.
        }
@@ -293,7 +293,7 @@ begin
 
   { 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
-    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) }
   if result <> '' then
     result := '#ifdef ' + BuildOSTarget + LineEnding +

+ 1 - 1
utils/fpcmkcfg/fpmake.pp

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

+ 2 - 2
utils/fpcres/fpcjres.pas

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

+ 3 - 3
utils/fpcres/fpcres.pas

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

+ 1 - 1
utils/fpcres/fpmake.pp

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

+ 2 - 2
utils/fpcres/jarsourcehandler.pas

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

+ 1 - 1
utils/fpcres/msghandler.pas

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

+ 2 - 2
utils/fpcres/paramparser.pas

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

+ 2 - 2
utils/fpcres/sourcehandler.pas

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

+ 3 - 3
utils/fpcres/target.pas

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

+ 1 - 1
utils/fpcreslipo/fpcreslipo.pp

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

+ 1 - 1
utils/fpcreslipo/fpmake.pp

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

+ 1 - 1
utils/fpcreslipo/msghandler.pp

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

+ 4 - 4
utils/fpcreslipo/sourcehandler.pp

@@ -76,7 +76,7 @@ type
     property Items[index : integer] : TSourceFile read GetItem;
     property Count : integer read GetCount;
   end;
-  
+
 implementation
 
 uses msghandler;
@@ -149,11 +149,11 @@ begin
       Messages.DoVerbose(Format('No more resources in file %s, deleted',[fFname]));
     exit;
   end;
-  
+
   tmp:=ExtractFileDir(fFname);
   if tmp='' then tmp:='.';
   tmp:=GetTempFileName(tmp,'tmp');
-  
+
   Messages.DoVerbose(Format('Updating file %s...',[fFname]));
   try
     aStream:=TFileStream.Create(tmp,fmCreate or fmShareDenyWrite);
@@ -172,7 +172,7 @@ begin
   finally
     aStream.Free;
   end;
-  
+
   if not Delete then exit;
   if not RenameFile(tmp,fFname) then
     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.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
 	a documentation patch as it keeps file sizes down and makes
 	it clearer what exactly is documented.
-  
+
 makeskel.pp
   * Skeleton XML description file generator
 

+ 16 - 16
utils/fpdoc/dglobals.pp

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

+ 10 - 10
utils/fpdoc/dw_chm.pp

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

+ 1 - 1
utils/fpdoc/dw_dxml.pp

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

+ 18 - 18
utils/fpdoc/dw_html.pp

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

+ 10 - 10
utils/fpdoc/dw_latex.pp

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

+ 1 - 1
utils/fpdoc/dw_linrtf.pp

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

+ 12 - 12
utils/fpdoc/dw_markdown.pp

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

+ 10 - 10
utils/fpdoc/dw_newhtml.pp

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

+ 7 - 7
utils/fpdoc/dwriter.pp

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

+ 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
 
-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.

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

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

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

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

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

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

+ 5 - 5
utils/fpdoc/fpdocstripper.pp

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

+ 1 - 1
utils/fpdoc/fpmake.pp

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

+ 48 - 48
utils/fpdoc/makeskel.pp

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

+ 4 - 4
utils/fpdoc/sh_pas.pp

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

+ 1 - 1
utils/fpmc/dumpfile.pp

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

+ 1 - 1
utils/fpmc/fpmake.pp

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

+ 2 - 2
utils/fppkg/fpmake.pp

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

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

@@ -18,7 +18,7 @@ interface
 }
 
 const
-   FCGI_LISTENSOCK_FILENO = 0;     
+   FCGI_LISTENSOCK_FILENO = 0;
 
 type
 
@@ -39,33 +39,33 @@ type
 }
 
 const
-   FCGI_HEADER_LEN = 8;     
+   FCGI_HEADER_LEN = 8;
 
 {
  * Value for version component of FCGI_Header
 }
-   FCGI_VERSION_1 = 1;     
+   FCGI_VERSION_1 = 1;
 
 {
  * 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
 }
-   FCGI_NULL_REQUEST_ID = 0;     
+   FCGI_NULL_REQUEST_ID = 0;
 
 type
    FCGI_BeginRequestBody = record
@@ -79,21 +79,21 @@ type
       header : FCGI_Header;
       body : FCGI_BeginRequestBody;
    end;
-   
+
 {
  * Mask for flags component of FCGI_BeginRequestBody
 }
 
 const
-   FCGI_KEEP_CONN = 1;     
-   
+   FCGI_KEEP_CONN = 1;
+
 {
  * 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
 
@@ -110,24 +110,24 @@ type
       header : FCGI_Header;
       body : FCGI_EndRequestBody;
    end;
-   
+
 {
  * Values for protocolStatus component of FCGI_EndRequestBody
 }
 
 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
 }
 
-   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
 

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

@@ -15,7 +15,7 @@
   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,
   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-  
+
   This license has been modified. See File LICENSE.ADDON for more inFormation.
   Should you find these sources without a LICENSE File, please contact
   me at [email protected]
@@ -64,7 +64,7 @@ const
         LMSG = 0;
       {$ENDIF}
     {$ENDIF}
-    
+
     {$IFDEF DARWIN}
     SO_NOSIGPIPE = $1022; // for fpc 2.0.4
     {$ENDIF}
@@ -106,7 +106,7 @@ type
       LAF_INET  : (IPv4: TInetSockAddr);
       LAF_INET6 : (IPv6: TInetSockAddr6);
   end;
-  
+
   { Base functions }
   {$IFNDEF UNIX}
   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 LSocketError: Longint;
-  
+
   function SetBlocking(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 StrToNetAddr(const IP: string): Cardinal; inline;
   function NetAddrToStr(const Entry: Cardinal): string; inline;
-  
+
   procedure FillAddressInfo(var aAddrInfo: TLSocketAddress; const aFamily: sa_family_t;
                             const Address: string; const aPort: Word);
-                            
+
 implementation
 
 uses
   StrUtils
-  
+
 {$IFNDEF UNIX}
 
 {$IFDEF WINDOWS}
   , Windows, lws2tcpip;
-  
+
 {$IFDEF WINCE}
 
 function LStrError(const Ernum: Longint; const UseUTF8: Boolean = False): string;
@@ -216,7 +216,7 @@ end;
 
 {$ELSE}
   ; // uses
-  
+
 function LStrError(const Ernum: Longint; const UseUTF8: Boolean = False): string;
 begin
   Result := IntToStr(Ernum); // TODO: fix for non-windows winsock users
@@ -431,7 +431,7 @@ begin
   opt := fpfcntl(aHandle, F_GETFL);
   if opt = SOCKET_ERROR then
     Exit(False);
-    
+
   if aValue then
     opt := opt and not O_NONBLOCK
   else

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

@@ -32,7 +32,7 @@ const
 
 type
   TLOnFull = procedure of object;
-  
+
   TLControlStack = class
    private
     FItems: array of Char;
@@ -62,7 +62,7 @@ uses
 (* 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   *)
 (* parameters are being accumulated.                                            *)
-  
+
 constructor TLControlStack.Create;
 begin
   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
   along with This library; if not, Write to the Free Software Foundation,
   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-  
+
   This license has been modified. See File LICENSE.ADDON for more inFormation.
   Should you find these sources without a LICENSE File, please contact
   me at [email protected]
@@ -47,7 +47,7 @@ type
   TLHandleEvent = procedure (aHandle: TLHandle) of object;
   TLHandleErrorEvent = procedure (aHandle: TLHandle; const msg: string) of object;
   TLEventerErrorEvent = procedure (const msg: string; Sender: TLEventer) of object;
-  
+
   { TLHandle }
 
   TLHandle = class(TObject)
@@ -66,7 +66,7 @@ type
     FNext: TLHandle;
     FFreeNext: TLHandle;
     FInternalData: Pointer;
-    
+
     procedure SetIgnoreError(const aValue: Boolean);
     procedure SetIgnoreWrite(const aValue: Boolean);
     procedure SetIgnoreRead(const aValue: Boolean);
@@ -171,7 +171,7 @@ type
     property Count: Integer read GetCount;
   end;
   TLEventerClass = class of TLEventer;
-  
+
   { TLSelectEventer }
 
   TLSelectEventer = class(TLEventer)
@@ -187,21 +187,21 @@ type
     constructor Create; override;
     function CallAction: Boolean; override;
   end;
-  
+
 {$i sys/lkqueueeventerh.inc}
 {$i sys/lepolleventerh.inc}
 
   function BestEventerClass: TLEventerClass;
-  
+
 implementation
 
 uses
   syncobjs,
   lCommon;
-  
+
 var
   CS: TCriticalSection;
-  
+
 { TLHandle }
 
 procedure TLHandle.SetIgnoreError(const aValue: Boolean);
@@ -286,7 +286,7 @@ end;
 
 procedure TLTimer.CallAction;
 begin
-  if FEnabled and Assigned(FOnTimer) and (Now - FStarted >= FInterval) then 
+  if FEnabled and Assigned(FOnTimer) and (Now - FStarted >= FInterval) then
   begin
     FOnTimer(Self);
     if not FOneShot then
@@ -574,11 +574,11 @@ begin
     n := fpSelect(MaxHandle + 1, @FReadFDSet, @FWriteFDSet, @FErrorFDSet, @TempTime)
   else
     n := fpSelect(MaxHandle + 1, @FReadFDSet, @FWriteFDSet, @FErrorFDSet, nil);
-  
+
   if n < 0 then
     Bail('Error on select', LSocketError);
   Result := n > 0;
-  
+
   if Result then begin
     Temp := FRoot;
     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
   along with This library; if not, Write to the Free Software Foundation,
   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-  
+
   This license has been modified. See file LICENSE.ADDON for more information.
   Should you find these sources without a LICENSE File, please contact
   me at [email protected]
@@ -74,7 +74,7 @@ type
   public
     constructor Create;
     destructor Destroy; override;
-    
+
     procedure AbortRequest;
     function  Get(ABuffer: pchar; ASize: integer): integer;
     procedure ParseClientBuffer;
@@ -96,9 +96,9 @@ type
     property OnStderr: TLFastCGIRequestEvent read FOnStderr write FOnStderr;
   end;
 
-  TFastCGIClientState = (fsIdle, fsConnecting, fsConnectingAgain, 
+  TFastCGIClientState = (fsIdle, fsConnecting, fsConnectingAgain,
     fsStartingServer, fsHeader, fsData, fsFlush);
-  
+
   PLFastCGIClient = ^TLFastCGIClient;
   TLFastCGIClient = class(TLTcp)
   protected
@@ -160,7 +160,7 @@ type
     FHost: string;
     FPort: integer;
     FSpawnState: TSpawnState;
-    
+
     procedure AddToFreeClients(AClient: TLFastCGIClient);
     function  CreateClient: TLFastCGIClient;
     procedure ConnectClients(Sender: TObject);
@@ -307,7 +307,7 @@ begin
   end else
     Result := 1;
 end;
-  
+
 procedure FillFastCGIStringSize(const AStr: string; var AFastCGIStr: TLFastCGIStringSize);
 var
   lLen: dword;
@@ -348,7 +348,7 @@ begin
   FillFastCGIStringSize(AName, lNameLen);
   FillFastCGIStringSize(AValue, lValueLen);
   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
   begin
     { undo padding }
@@ -420,7 +420,7 @@ begin
   { 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
   begin
-    lWritten := FClient.Send(FBuffer.Memory[FBufferSendPos], 
+    lWritten := FClient.Send(FBuffer.Memory[FBufferSendPos],
       FBuffer.Pos-FBuffer.Memory-FBufferSendPos);
     Inc(FBufferSendPos, lWritten);
     Result := FBufferSendPos = FBuffer.Pos-FBuffer.Memory;
@@ -438,7 +438,7 @@ var
   lWritten: integer;
 begin
   { 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);
 
   { header to be sent? }
@@ -519,7 +519,7 @@ end;
 function TLFastCGIClient.GetBuffer(ABuffer: pchar; ASize: integer): integer;
 begin
   Result := FBufferEnd - FBufferPos;
-  if Result > FContentLength then 
+  if Result > FContentLength then
     Result := FContentLength;
   if Result > ASize then
     Result := ASize;
@@ -568,13 +568,13 @@ begin
       else
         FRequests[I].EndRequest;
     end;
-  if needReconnect then 
+  if needReconnect then
     Connect;
 end;
 
 procedure TLFastCGIClient.ErrorEvent(ASocket: TLHandle; const msg: string);
 begin
-  if (FState = fsConnectingAgain) 
+  if (FState = fsConnectingAgain)
     or ((FState = fsConnecting) and (FPool.FSpawnState = ssSpawned)) then
   begin
     FRequest.DoEndRequest;
@@ -705,10 +705,10 @@ begin
         end else
           Flush;
       end;
-      fsData: 
+      fsData:
       begin
         FRequest.HandleReceive;
-        if FContentLength = 0 then 
+        if FContentLength = 0 then
           Flush
         else begin
           FRequest.FOutputPending := true;
@@ -805,7 +805,7 @@ begin
   if FPool <> nil then
     FPool.EndRequest(Self);
 end;
-   
+
 { TLFastCGIPool }
 
 constructor TLFastCGIPool.Create;
@@ -876,7 +876,7 @@ end;
 procedure TLFastCGIPool.AddToFreeClients(AClient: TLFastCGIClient);
 begin
   if AClient.FNextFree <> nil then exit;
-  
+
   if FFreeClient = nil then
     FFreeClient := AClient
   else

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

@@ -30,7 +30,7 @@ interface
 
 uses
   Classes, lNet, lTelnet;
-  
+
 const
   DEFAULT_FTP_PORT    = 1025;
 
@@ -41,16 +41,16 @@ type
   TLFTPStatus = (fsNone, fsCon, fsUser, fsPass, fsPasv, fsPort, fsList, fsRetr,
                  fsStor, fsType, fsCWD, fsMKD, fsRMD, fsDEL, fsRNFR, fsRNTO,
                  fsSYS, fsFeat, fsPWD, fsHelp, fsLast);
-                 
+
   TLFTPStatusSet = set of TLFTPStatus;
-                 
+
   TLFTPStatusRec = record
     Status: TLFTPStatus;
     Args: array[1..2] of string;
   end;
-  
+
   TLFTPTransferMethod = (ftActive, ftPassive);
-                 
+
   TLFTPClientStatusEvent = procedure (aSocket: TLSocket;
                                      const aStatus: TLFTPStatus) of object;
 
@@ -60,7 +60,7 @@ type
   {$DEFINE __front_type__  :=  TLFTPStatusRec}
   {$i lcontainersh.inc}
   TLFTPStatusFront = TLFront;
-  
+
   TLFTP = class(TLComponent, ILDirect)
    protected
     FControl: TLTelnetClient;
@@ -71,7 +71,7 @@ type
     FFeatureString: string;
 
     function GetConnected: Boolean; virtual;
-    
+
     function GetTimeout: Integer;
     procedure SetTimeout(const Value: Integer);
 
@@ -84,13 +84,13 @@ type
    public
     constructor Create(aOwner: TComponent); override;
     destructor Destroy; override;
-    
+
     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 Send(const aData; const aSize: Integer; aSocket: TLSocket = nil): Integer; virtual; abstract;
     function SendMessage(const msg: string; aSocket: TLSocket = nil): Integer; virtual; abstract;
-    
+
    public
     property Connected: Boolean read GetConnected;
     property Timeout: Integer read GetTimeout write SetTimeout;
@@ -103,7 +103,7 @@ type
   end;
 
   { TLFTPTelnetClient }
-  
+
   TLFTPTelnetClient = class(TLTelnetClient)
    protected
     function React(const Operation, Command: Char):boolean; override;
@@ -144,7 +144,7 @@ type
     procedure OnControlRe(aSocket: TLSocket);
     procedure OnControlCo(aSocket: TLSocket);
     procedure OnControlDs(aSocket: TLSocket);
-    
+
     procedure ClearStatusFlags;
 
     function GetCurrentStatus: TLFTPStatus;
@@ -183,25 +183,25 @@ type
 
     function Get(out aData; const aSize: Integer; 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 SendMessage(const msg: string; aSocket: TLSocket = nil): Integer; override;
-    
+
     function Connect(const aHost: string; const aPort: Word = 21): Boolean; virtual; overload;
     function Connect: Boolean; virtual; overload;
-    
+
     function Authenticate(const aUsername, aPassword: string): Boolean;
-    
+
     function GetData(out aData; const aSize: Integer): Integer;
     function GetDataMessage: string;
-    
+
     function Retrieve(const FileName: string): Boolean;
     function Put(const FileName: string): Boolean; virtual; // because of LCLsocket
-    
+
     function ChangeDirectory(const DestPath: string): Boolean;
     function MakeDirectory(const DirName: string): Boolean;
     function RemoveDirectory(const DirName: string): Boolean;
-    
+
     function DeleteFile(const FileName: string): Boolean;
     function Rename(const FromName, ToName: string): Boolean;
    public
@@ -211,9 +211,9 @@ type
     procedure ListFeatures;
     procedure PresentWorkingDirectory;
     procedure Help(const Arg: string);
-    
+
     procedure Disconnect(const Forced: Boolean = True); override;
-    
+
     procedure CallAction; override;
    public
     property StatusSet: TLFTPStatusSet read FStatusSet write FStatusSet;
@@ -234,9 +234,9 @@ type
     property OnSuccess: TLFTPClientStatusEvent read FOnSuccess write FOnSuccess;
     property OnFailure: TLFTPClientStatusEvent read FOnFailure write FOnFailure;
   end;
-  
+
   function FTPStatusToStr(const aStatus: TLFTPStatus): string;
-  
+
 implementation
 
 uses
@@ -306,7 +306,7 @@ end;
 procedure TLFTP.SetCreator(AValue: TLComponent);
 begin
   inherited SetCreator(AValue);
-  
+
   FControl.Creator := AValue;
   FData.Creator := AValue;
 end;
@@ -403,7 +403,7 @@ begin
 
   FStatus := TLFTPStatusFront.Create(EMPTY_REC);
   FCommandFront := TLFTPStatusFront.Create(EMPTY_REC);
-  
+
   FStoreFile := nil;
 end;
 
@@ -446,13 +446,13 @@ end;
 procedure TLFTPClient.OnControlEr(const msg: string; aSocket: TLSocket);
 begin
   FSending := False;
-  
+
   if Assigned(FOnFailure) then begin
     while not FStatus.Empty do
       FOnFailure(aSocket, FStatus.Remove.Status);
   end else
     FStatus.Clear;
-    
+
   ClearStatusFlags;
 
   if Assigned(FOnError) then
@@ -648,25 +648,25 @@ procedure TLFTPClient.EvaluateAnswer(const Ans: string);
       FStatus.Remove;
     end;
   end;
-  
+
   procedure SendFile;
   begin
     FStoreFile.Position := 0;
     FSending := True;
     SendChunk(False);
   end;
-  
+
   function ValidResponse(const Answer: string): Boolean; inline;
   begin
     Result := (Length(Ans) >= 3) and
             (Ans[1] in ['1'..'5']) and
             (Ans[2] in ['0'..'9']) and
             (Ans[3] in ['0'..'9']);
-            
+
     if Result then
       Result := (Length(Ans) = 3) or ((Length(Ans) > 3) and (Ans[4] = ' '));
   end;
-  
+
   procedure Eventize(const aStatus: TLFTPStatus; const Res: Boolean);
   begin
     FStatus.Remove;
@@ -678,7 +678,7 @@ procedure TLFTPClient.EvaluateAnswer(const Ans: string);
         FOnFailure(FData.Iterator, aStatus);
     end;
   end;
-  
+
 var
   x: Integer;
 begin
@@ -723,7 +723,7 @@ begin
                        Eventize(FStatus.First.Status, False);
                      end;
                  end;
-                 
+
         fsPass : case x of
                    230:
                      begin
@@ -782,7 +782,7 @@ begin
 
         fsStor : case x of
                    125, 150: SendFile;
-                   
+
                    226:
                      begin
                        Eventize(FStatus.First.Status, True);
@@ -844,7 +844,7 @@ begin
                        Eventize(FStatus.First.Status, False);
                      end;
                  end;
-                 
+
         fsMKD  : case x of
                    250, 257:
                      begin
@@ -857,7 +857,7 @@ begin
                        Eventize(FStatus.First.Status, False);
                      end;
                  end;
-                 
+
         fsRMD,
         fsDEL  : case x of
                    250:
@@ -871,7 +871,7 @@ begin
                        Eventize(FStatus.First.Status, False);
                      end;
                  end;
-                 
+
         fsRNFR : case x of
                    350:
                      begin
@@ -883,7 +883,7 @@ begin
                        Eventize(FStatus.First.Status, False);
                      end;
                  end;
-                 
+
         fsRNTO : case x of
                    250:
                      begin
@@ -921,13 +921,13 @@ procedure TLFTPClient.PasvPort;
     Result := IntToStr(aPort div 256);
     Result := Result + ',' + IntToStr(aPort mod 256);
   end;
-  
+
   function StringIP: string;
   begin
     Result := StringReplace(FControl.Connection.Iterator.LocalAddress, '.', ',',
                           [rfReplaceAll]) + ',';
   end;
-  
+
 begin
   if FTransferMethod = ftActive then begin
     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
   along with This library; if not, Write to the Free Software Foundation,
   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-  
+
   This license has been modified. See file LICENSE.ADDON for more information.
   Should you find these sources without a LICENSE File, please contact
   me at [email protected]
@@ -38,7 +38,7 @@ type
     hpAccept, hpAcceptCharset, hpAcceptEncoding, hpAcceptLanguage, hpHost,
     hpFrom, hpReferer, hpUserAgent, hpRange, hpTransferEncoding,
     hpIfModifiedSince, hpIfUnmodifiedSince, hpCookie);
-  TLHTTPStatus = (hsUnknown, hsOK, hsNoContent, hsMovedPermanently, hsFound, hsNotModified, 
+  TLHTTPStatus = (hsUnknown, hsOK, hsNoContent, hsMovedPermanently, hsFound, hsNotModified,
     hsBadRequest, hsForbidden, hsNotFound, hsPreconditionFailed, hsRequestTooLong,
     hsInternalError, hsNotImplemented, hsNotAllowed);
   TLHTTPTransferEncoding = (teIdentity, teChunked);
@@ -46,19 +46,19 @@ type
     ceUnsupportedEncoding);
 
 const
-  HTTPDisconnectStatuses = [hsBadRequest, hsRequestTooLong, hsForbidden, 
+  HTTPDisconnectStatuses = [hsBadRequest, hsRequestTooLong, hsForbidden,
     hsInternalError, hsNotAllowed];
   HTTPMethodStrings: array[TLHTTPMethod] of string =
     ('HEAD', 'GET', 'POST', '');
   HTTPParameterStrings: array[TLHTTPParameter] of string =
-    ('CONNECTION', 'CONTENT-LENGTH', 'CONTENT-TYPE', 'ACCEPT', 
+    ('CONNECTION', 'CONTENT-LENGTH', 'CONTENT-TYPE', 'ACCEPT',
      'ACCEPT-CHARSET', 'ACCEPT-ENCODING', 'ACCEPT-LANGUAGE', 'HOST',
      'FROM', 'REFERER', 'USER-AGENT', 'RANGE', 'TRANSFER-ENCODING',
      'IF-MODIFIED-SINCE', 'IF-UNMODIFIED-SINCE', 'COOKIE');
   HTTPStatusCodes: array[TLHTTPStatus] of dword =
     (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',
      'Method Not Implemented', 'Method Not Allowed');
   HTTPDescriptions: array[TLHTTPStatus] of string = (
@@ -120,7 +120,7 @@ type
   TLHTTPSocket = class;
   TLHTTPConnection = class;
   TLHTTPClientSocket = class;
-  
+
   PRequestInfo = ^TRequestInfo;
   TRequestInfo = record
     RequestType: TLHTTPMethod;
@@ -229,7 +229,7 @@ type
   protected
     FFreeBuffer: boolean;
   public
-    constructor Create(ASocket: TLHTTPSocket; ABuffer: pointer; 
+    constructor Create(ASocket: TLHTTPSocket; ABuffer: pointer;
       ABufferOffset, ABufferSize: integer; AFreeBuffer: boolean);
     destructor Destroy; override;
   end;
@@ -245,7 +245,7 @@ type
     constructor Create(ASocket: TLHTTPSocket; AStream: TStream; AFreeStream: boolean);
     destructor Destroy; override;
   end;
-  
+
   TMemoryStreamOutput = class(TOutputItem)
   protected
     FFreeStream: boolean;
@@ -259,7 +259,7 @@ type
 
   TChunkState = (csInitial, csData, csDataEnd, csTrailer, csFinished);
   TLHTTPParameterArray = array[TLHTTPParameter] of PAnsiChar;
-  
+
   TParseBufferMethod = function: boolean of object;
   TLInputEvent = function(ASocket: TLHTTPClientSocket; ABuffer: PAnsiChar; ASize: integer): integer of object;
   TLCanWriteEvent = procedure(ASocket: TLHTTPClientSocket; var OutputEof: TWriteBlockStatus) of object;
@@ -328,14 +328,14 @@ type
     procedure HandleReceive;
     function  ParseBuffer: boolean;
     procedure WriteBlock;
-    
+
     property Parameters: TLHTTPParameterArray read FParameters;
   end;
 
   { http server }
 
   TSetupEncodingState = (seNone, seWaitHeaders, seStartHeaders);
-  
+
   TLHTTPServerSocket = class(TLHTTPSocket)
   protected
     FLogMessage: TStringBuffer;
@@ -367,7 +367,7 @@ type
     procedure StartMemoryResponse(AOutputItem: TMemoryOutput; ACustomErrorMessage: boolean = false);
     procedure StartResponse(AOutputItem: TBufferOutput; ACustomErrorMessage: boolean = false);
   end;
-  
+
   TURIHandler = class(TObject)
   private
     FNext: TURIHandler;
@@ -411,7 +411,7 @@ type
     FResponse: PClientResponse;
     FHeaderOut: PHeaderOutInfo;
     FError: TLHTTPClientError;
-    
+
     procedure AddContentLength(ALength: integer); override;
     function  GetResponseReason: string;
     function  GetResponseStatus: TLHTTPStatus;
@@ -446,7 +446,7 @@ type
     FOnDoneInput: TLHTTPClientEvent;
     FOnInput: TLInputEvent;
     FOnProcessHeaders: TLHTTPClientEvent;
-    
+
     procedure ConnectEvent(aSocket: TLHandle); override;
     procedure DoDoneInput(ASocket: TLHTTPClientSocket);
     function  DoHandleInput(ASocket: TLHTTPClientSocket; ABuffer: PAnsiChar; ASize: integer): integer;
@@ -506,9 +506,9 @@ function HTTPVersionCheck(AStr, AStrEnd: PAnsiChar; out AVersion: dword): boolea
 var
   lMajorVersion, lMinorVersion: byte;
 begin
-  Result := ((AStrEnd-AStr) = 8) 
+  Result := ((AStrEnd-AStr) = 8)
     and CompareMem(AStr, PAnsiChar('HTTP/'), 5)
-    and TrySingleDigit(AStr[5], lMajorVersion) 
+    and TrySingleDigit(AStr[5], lMajorVersion)
     and (AStr[6] = '.')
     and TrySingleDigit(AStr[7], lMinorVersion);
   AVersion := lMajorVersion * 10 + lMinorVersion;
@@ -589,7 +589,7 @@ destructor TOutputItem.Destroy;
 begin
   if FSocket.FCurrentInput = Self then
     FSocket.FCurrentInput := nil;
-    
+
   if FPrevDelayFree = nil then
     FSocket.FDelayFreeItems := FNextDelayFree
   else
@@ -681,7 +681,7 @@ begin
     FSocket.PrependOutput(TStreamOutput.Create(FSocket, AStream, AFree), Self);
 end;
 
-procedure TBufferOutput.Add(AStream: TStream; AQueue: boolean = false; 
+procedure TBufferOutput.Add(AStream: TStream; AQueue: boolean = false;
   AFree: boolean = true);
 var
   size, copySize: integer;
@@ -778,7 +778,7 @@ begin
       FBuffer[FBufferSize+4] := #10;
       inc(FBufferSize, 5);
     end;
-  end else   
+  end else
     Result := EofToWriteStatus[FEof];
   if FOutputPending then
   begin
@@ -790,7 +790,7 @@ begin
     end;
   end;
 end;
-  
+
 function TBufferOutput.WriteBuffer: TWriteBlockStatus;
 begin
   if not FOutputPending then
@@ -859,7 +859,7 @@ begin
   FFinishBuffer := @FinishChunk;
   PrepareChunk;
 end;
-  
+
 procedure TBufferOutput.SelectBuffered;
 begin
   FPrepareBuffer := @PrepareBuffer;
@@ -867,7 +867,7 @@ begin
   FFinishBuffer := @FinishBuffer;
   PrepareBuffer;
 end;
-  
+
 procedure TBufferOutput.SelectPlain;
 begin
   FPrepareBuffer := @PrepareBuffer;
@@ -878,7 +878,7 @@ end;
 
 { TMemoryOutput }
 
-constructor TMemoryOutput.Create(ASocket: TLHTTPSocket; ABuffer: pointer; 
+constructor TMemoryOutput.Create(ASocket: TLHTTPSocket; ABuffer: pointer;
   ABufferOffset, ABufferSize: integer; AFreeBuffer: boolean);
 begin
   inherited Create(ASocket);
@@ -925,7 +925,7 @@ end;
 
 { TMemoryStreamOutput }
 
-constructor TMemoryStreamOutput.Create(ASocket: TLHTTPSocket; AStream: TMemoryStream; 
+constructor TMemoryStreamOutput.Create(ASocket: TLHTTPSocket; AStream: TMemoryStream;
   AFreeStream: boolean);
 begin
   inherited Create(ASocket);
@@ -1087,7 +1087,7 @@ procedure TLHTTPSocket.HandleReceive;
 var
   lRead: integer;
 begin
-  if FRequestInputDone then 
+  if FRequestInputDone then
   begin
     IgnoreRead := true;
     exit;
@@ -1196,19 +1196,19 @@ begin
     if FChunkState = csFinished then
       exit(false);
     if FChunkState = csData then
-      if ParseEntityPlain then 
+      if ParseEntityPlain then
         exit(true)
       else
         FChunkState := csDataEnd;
-    
+
     lLineEnd := StrScan(FBufferPos, #10);
     if lLineEnd = nil then
       exit(true);
-    
+
     lNextLine := lLineEnd+1;
     if (lLineEnd > FBufferPos) and ((lLineEnd-1)^ = #13) then
       dec(lLineEnd);
-    case FChunkState of 
+    case FChunkState of
       csInitial:
       begin
         lLineEnd^ := #0;
@@ -1257,7 +1257,7 @@ begin
         WriteError(hsRequestTooLong);
       exit(true);
     end;
-  
+
     pNextLine := pLineEnd+1;
     if (pLineEnd > FBufferPos) and ((pLineEnd-1)^ = #13) then
       dec(pLineEnd);
@@ -1307,7 +1307,7 @@ begin
   end else
     ParseParameterLine(pLineEnd);
 end;
-        
+
 function TLHTTPSocket.ParseBuffer: boolean;
 var
   lParseFunc: TParseBufferMethod;
@@ -1321,7 +1321,7 @@ begin
       if FCurrentInput <> nil then
         FCurrentInput.DoneInput;
     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 }
   until (lParseFunc = FParseBuffer) or not Result;
 end;
@@ -1354,7 +1354,7 @@ begin
     exit;
   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 }
   lParam := FParameters[hpConnection];
   FRequestInputDone := (lParam <> nil) and (StrIComp(lParam, 'keep-alive') = 0);
@@ -1414,13 +1414,13 @@ begin
       if FBufferPos = FBufferEnd then
         PackRequestBuffer;
 
-      if ParseBuffer and IgnoreRead then 
+      if ParseBuffer and IgnoreRead then
       begin
         { end of input buffer reached, try reading more }
         HandleReceive;
       end;
 
-      if FCurrentOutput = nil then 
+      if FCurrentOutput = nil then
         break;
     end;
 
@@ -1495,7 +1495,7 @@ procedure TLHTTPServerSocket.LogMessage;
 
 
 begin
-  { log a message about this request, 
+  { log a message about this request,
     '<StatusCode> <Length> "<Referer>" "<User-Agent>"' }
   AppendString(FLogMessage, IntToStr(HTTPStatusCodes[FResponseInfo.Status]));
   AppendChar(FLogMessage, ' ');
@@ -1542,7 +1542,7 @@ begin
   end;
   inherited;
 end;
-  
+
 procedure TLHTTPServerSocket.RelocateVariables;
 begin
   RelocateVariable(FRequestInfo.Method);
@@ -1603,7 +1603,7 @@ begin
   end;
   FRequestInfo.VersionStr := lPos;
   FHeaderOut.Version := FRequestInfo.Version;
-  
+
   { trim spaces at end of URI }
   dec(lPos);
   repeat
@@ -1641,7 +1641,7 @@ begin
   begin
     { absolute URI }
     lPos := FRequestInfo.Argument+7;
-    while (lPos^ = '/') do 
+    while (lPos^ = '/') do
       Inc(lPos);
     FParameters[hpHost] := lPos;
     lPos := StrScan(lPos, '/');
@@ -1669,7 +1669,7 @@ begin
     WriteError(hsBadRequest);
     exit;
   end;
-      
+
   lPos := StrScan(FRequestInfo.Argument, '?');
   if lPos <> nil then
   begin
@@ -1687,7 +1687,7 @@ begin
     if StrIComp(lConnParam, 'close') = 0 then
       FKeepAlive := false;
   end;
-  
+
   HTTPDecode(FRequestInfo.Argument);
   if not CheckPermission(FRequestInfo.Argument) then
   begin
@@ -1698,9 +1698,9 @@ begin
       WriteError(hsNotImplemented);
       exit;
     end;
-      
+
     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 }
     if FCurrentInput = nil then
     begin
@@ -1720,7 +1720,7 @@ begin
   { check modification date }
   if FResponseInfo.Status < hsBadRequest then
   begin
-    if (FParameters[hpIfModifiedSince] <> nil) 
+    if (FParameters[hpIfModifiedSince] <> nil)
       and (FResponseInfo.LastModified <> 0.0) then
     begin
       if TryHTTPDateStrToDateTime(FParameters[hpIfModifiedSince], lDateTime) then
@@ -1736,7 +1736,7 @@ begin
     begin
       if TryHTTPDateStrToDateTime(FParameters[hpIfUnmodifiedSince], lDateTime) then
       begin
-        if (FResponseInfo.LastModified = 0.0) 
+        if (FResponseInfo.LastModified = 0.0)
           or (lDateTime < FResponseInfo.LastModified) then
           FResponseInfo.Status := hsPreconditionFailed;
       end;
@@ -1749,7 +1749,7 @@ begin
     ACustomErrorMessage := false;
     FHeaderOut.ContentLength := 0;
   end;
-  
+
   Result := (FResponseInfo.Status = hsOK) or ACustomErrorMessage;
   if not Result then
   begin
@@ -1822,7 +1822,7 @@ var
   tempStr: string;
 begin
   lMessage := InitStringBuffer(504);
-  
+
   AppendString(lMessage, 'HTTP/1.1 ');
   Str(HTTPStatusCodes[FResponseInfo.Status], lTemp);
   AppendString(lMessage, lTemp);
@@ -1927,7 +1927,7 @@ begin
   else
     TZSign := '-';
   TZSecsAbs := Abs(TZSeconds);
-  FLogMessageTZString := Format(' %s%.2d%.2d] "', 
+  FLogMessageTZString := Format(' %s%.2d%.2d] "',
     [TZSign, TZSecsAbs div 3600, (TZSecsAbs div 60) mod 60]);
 end;
 
@@ -1983,7 +1983,7 @@ type
   TClientOutput = class(TOutputItem)
   protected
     FPersistent: boolean;
-    
+
     procedure DoneInput; override;
   public
     constructor Create(ASocket: TLHTTPClientSocket);
@@ -2002,13 +2002,13 @@ end;
 
 destructor TClientOutput.Destroy;
 begin
-  if FPersistent then exit; 
+  if FPersistent then exit;
   inherited;
 end;
 
 procedure TClientOutput.FreeInstance;
 begin
-  if FPersistent then exit; 
+  if FPersistent then exit;
   inherited;
 end;
 
@@ -2121,7 +2121,7 @@ begin
   AddToOutput(TMemoryOutput.Create(Self, lMessage.Memory, 0,
     lMessage.Pos-lMessage.Memory, true));
   AddToOutput(FCurrentInput);
-  
+
   WriteBlock;
 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
   along with This library; if not, Write to the Free Software Foundation,
   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-  
+
   This license has been modified. See file LICENSE.ADDON for more information.
   Should you find these sources without a LICENSE File, please contact
   me at [email protected]
@@ -29,12 +29,12 @@ unit lHTTPUtil;
 interface
 
 uses
-  sysutils, 
+  sysutils,
   strutils;
 
 const
   HTTPDateFormat: string = 'ddd, dd mmm yyyy hh:nn:ss';
-  HTTPAllowedChars = ['A'..'Z','a'..'z', '*','@','.','_','-', 
+  HTTPAllowedChars = ['A'..'Z','a'..'z', '*','@','.','_','-',
       '0'..'9', '$','!','''','(',')'];
 
 type
@@ -50,7 +50,7 @@ type
   function HTTPDecode(AStr: pansichar): pansichar;
   function HTTPEncode(const AStr: string): string;
   function HexToNum(AChar: char): byte;
-  
+
   function DecomposeURL(const URL: string; out Host, URI: string; out Port: Word): Boolean;
   function ComposeURL(Host, URI: string; const Port: Word): string;
 
@@ -81,7 +81,7 @@ begin
   { day }
   if ADateStr[2] = ' ' then
     ADateStr[2] := #0
-  else 
+  else
     exit(false);
   Val(ADateStr, lDay, lCode);
   if lCode <> 0 then exit(false);
@@ -114,7 +114,7 @@ begin
   Result := true;
 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;
 var
   lFullPath: string;
@@ -197,9 +197,9 @@ begin
     exit;
   dest := pchar(Result);
   src := pchar(AStr);
-  srcend := src + len; 
+  srcend := src + len;
   while src < srcend do
-  begin 
+  begin
     if src^ in HTTPAllowedChars then
       dest^ := src^
     else if src^ = ' ' then

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

@@ -29,7 +29,7 @@ interface
 
 uses
   Classes;
-  
+
 const
   CRLF = #13#10;
 
@@ -66,9 +66,9 @@ type
     function Seek(const Offset: Int64; Origin: TSeekOrigin): Int64; overload; override;
     procedure Reset;
   end;
-  
+
   function EncodeMimeHeaderText(const s: string): string;
-  
+
 implementation
 
 uses
@@ -124,7 +124,7 @@ end;
 constructor TMimeOutputStream.Create(aNotificationEvent: TStreamNotificationEvent);
 begin
   inherited Create;
-  
+
   FNotificationEvent := aNotificationEvent;
 end;
 
@@ -134,10 +134,10 @@ begin
     FNotificationEvent(Count);
 
   Result := Min(Count, Length(FInputData));
-  
+
   if Result <= 0 then
     Exit(0);
-  
+
   Move(FInputData[1], Buffer, Result);
   Delete(FInputData, 1, Result);
 end;
@@ -178,7 +178,7 @@ end;
 function TBogusStream.Read(var Buffer; Count: Longint): Longint;
 begin
   Result := Min(Count, Length(FData));
-  
+
   Move(FData[1], Buffer, Result);
   Delete(FData, 1, Result);
 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
   along with This library; if not, Write to the Free Software Foundation,
   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-  
+
   This license has been modified. See file LICENSE.ADDON for more information.
   Should you find these sources without a LICENSE File, please contact
   me at [email protected]
@@ -34,7 +34,7 @@ type
   TStringObject = class(TObject)
     Str: string;
   end;
-  
+
   procedure InitMimeList(const aFileName: string);
 
 var

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

@@ -29,7 +29,7 @@ interface
 
 uses
   SysUtils, Classes, Contnrs, lMimeStreams;
-  
+
 const
   MIME_VERSION = 'MIME-version: 1.0' + CRLF;
 
@@ -72,7 +72,7 @@ type
     property Header: string read GetHeader;
     property Size: Integer read GetSize;
   end;
-  
+
   { TMimeTextSection }
 
   TMimeTextSection = class(TMimeSection)
@@ -91,7 +91,7 @@ type
     property Charset: string read GetCharset write SetCharset;
     property Text: string read FData write SetData;
   end;
-  
+
   { TMimeStreamSection }
 
   TMimeStreamSection = class(TMimeSection)
@@ -110,7 +110,7 @@ type
     property Stream: TStream read FStream write SetStream;
     property OwnsStreams: Boolean read FOwnsStreams write FOwnsStreams;
   end;
-  
+
   { TMimeFileSection }
 
   TMimeFileSection = class(TMimeStreamSection)
@@ -162,14 +162,14 @@ type
     property Count: Integer read GetCount;
     property Boundary: string read FBoundary;
   end;
-  
+
   { EAlreadyActivatedException }
 
   EAlreadyActivatedException = class(Exception)
    public
     constructor Create;
   end;
-  
+
   { EAlreadyCalledReadException }
 
   EAlreadyCalledReadException = class(Exception)
@@ -183,12 +183,12 @@ type
    public
     constructor Create;
   end;
-  
+
 implementation
 
 uses
   Math, Base64;
-  
+
 function EncodingToStr(const Encoding: TMimeEncoding): string;
 begin
   Result := '';
@@ -215,7 +215,7 @@ begin
 
   if OriginalSize = 0 then
     Exit;
-    
+
   case FEncoding of
     me8bit   : Result := OriginalSize;
     meBase64 : if OriginalSize mod 3 = 0 then
@@ -243,7 +243,7 @@ begin
     FEncoding := aValue;
     if Assigned(FEncodingStream) then
       FEncodingStream.Free;
-    
+
     CreateEncodingStream;
   end;
 end;
@@ -264,7 +264,7 @@ begin
 
   if Length(FDescription) > 0 then
     Result := Result + 'Content-Description: ' + FDescription + CRLF;
-    
+
   Result := Result + CRLF;
 end;
 
@@ -274,7 +274,7 @@ begin
 
   if aSize >= Length(FBuffer) then
     FillBuffer(aSize);
-    
+
   Result := Copy(FBuffer, 1, aSize);
 end;
 
@@ -289,7 +289,7 @@ destructor TMimeSection.Destroy;
 begin
   if Assigned(FEncodingStream) then
     FEncodingStream.Free;
-    
+
   FLocalStream.Free;
 
   inherited Destroy;
@@ -308,10 +308,10 @@ begin
     FActivated := True;
     FBuffer := GetHeader;
   end;
-  
+
   if Length(FBuffer) < aSize then
     FillBuffer(aSize);
-    
+
   s := ReadBuffer(aSize);
   if Length(s) >= aSize then begin
     Result := FOutputStream.Write(s[1], aSize);
@@ -348,10 +348,10 @@ var
   n: Integer;
 begin
   s := Copy(FData, 1, aSize);
-  
+
   if Length(s) = 0 then
     Exit;
-  
+
   n := aSize;
 
   if Assigned(FEncodingStream) then begin
@@ -363,7 +363,7 @@ begin
       CreateEncodingStream;
       FLocalStream.Write(CRLF[1], Length(CRLF));
     end;
-    
+
     SetLength(s, FLocalStream.Size);
     SetLength(s, FLocalStream.Read(s[1], Length(s)));
   end else begin
@@ -432,7 +432,7 @@ begin
     Result := Length(FBuffer) + RecalculateSize(FStream.Size - FStream.Position)
   else
     Result := Length(FBuffer) + Length(GetHeader) + RecalculateSize(FStream.Size - FStream.Position);
-    
+
   if not FActivated
   or (Length(FBuffer) > 0)
   or (FStream.Size - FStream.Position > 0) then
@@ -447,7 +447,7 @@ begin
     FStream.Free;
     FStream := nil;
   end;
-  
+
   FStream := aValue;
   FOriginalPosition := FStream.Position;
 end;
@@ -459,22 +459,22 @@ var
 begin
   SetLength(s, aSize);
   SetLength(s, FStream.Read(s[1], aSize));
-  
+
   if Length(s) <= 0 then
     Exit;
-  
+
   if Assigned(FEncodingStream) then begin
     n := FEncodingStream.Write(s[1], Length(s));
-    
+
     if n < Length(s) then
       FStream.Position := FStream.Position - (n - Length(s));
-      
+
     if FStream.Size - FStream.Position = 0 then begin
       FEncodingStream.Free; // to fill in the last bit
       CreateEncodingStream;
       FLocalStream.Write(CRLF[1], Length(CRLF));
     end;
-      
+
     SetLength(s, FLocalStream.Size);
     SetLength(s, FLocalStream.Read(s[1], FLocalStream.Size));
   end else if FStream.Size - FStream.Position = 0 then
@@ -486,7 +486,7 @@ end;
 constructor TMimeStreamSection.Create(aOutputStream: TStream; aStream: TStream);
 begin
   inherited Create(aOutputStream);
-  
+
   FDisposition := mdAttachment;
   FStream := aStream;
   FOriginalPosition := FStream.Position;
@@ -527,14 +527,14 @@ var
   i: Integer;
 begin
   Result := 0;
-  
+
   if FActiveSection > -2 then
     for i := 0 to Count - 1 do
       Result := Result + TMimeSection(FSections[i]).Size;
-      
+
   if FActiveSection = -1 then // not yet active, must add header info
     Result := Result + Length(GetMimeHeader) + GetBoundarySize;
-    
+
   Result := Result + FOutputStream.Size;
 end;
 
@@ -555,7 +555,7 @@ end;
 function TMimeStream.GetSection(i: Integer): TMimeSection;
 begin
   Result := nil;
-  
+
   if  (i >= 0)
   and (i < FSections.Count) then
     Result := TMimeSection(FSections[i]);
@@ -566,7 +566,7 @@ const
   MIME_HEADER = 'Content-type: multipart/mixed; boundary="';
 begin
   Result := MIME_VERSION;
-  
+
   if FSections.Count > 1 then
     Result := Result + MIME_HEADER + FBoundary + '"' + CRLF + CRLF +
          'This is a multi-part message in MIME format.' + CRLF +
@@ -603,7 +603,7 @@ begin
       s := '--' + FBoundary + '--' + CRLF
     else
       s := '--' + FBoundary + CRLF;
-      
+
     FOutputStream.Write(s[1], Length(s));
   end;
 
@@ -614,12 +614,12 @@ end;
 procedure TMimeStream.DoRead(const aSize: Integer);
 begin
   ActivateFirstSection;
-  
+
   if FActiveSection < 0 then
     Exit;
-    
+
   TMimeSection(FSections[FActiveSection]).Read(aSize);
-  
+
   if TMimeSection(FSections[FActiveSection]).Size = 0 then
     ActivateNextSection;
 end;
@@ -627,7 +627,7 @@ end;
 constructor TMimeStream.Create;
 begin
   Randomize;
-  
+
   FActiveSection := -1;
   FBoundary := GetBoundary;
   FSections := TFPObjectList.Create(True);
@@ -656,7 +656,7 @@ function TMimeStream.Read(var Buffer; Count: Longint): Longint;
 begin
   if Count <= 0 then
     Exit(0);
-    
+
   if FCalledWrite then
     raise EAlreadyCalledWriteException.Create;
 
@@ -683,9 +683,9 @@ var
 begin
   if FActiveSection >= 0 then
     raise EAlreadyActivatedException.Create;
-    
+
   s := TMimeTextSection.Create(FOutputStream, aText);
-  
+
   s.Charset := aCharSet;
   FSections.Add(s);
 end;
@@ -729,10 +729,10 @@ var
 begin
   FCalledRead := False;
   FCalledWrite := False;
-  
+
   for i := 0 to FSections.Count - 1 do
     TMimeSection(FSections[i]).Reset;
-    
+
   FOutputStream.Reset;
   FActiveSection := -1;
 end;
@@ -769,11 +769,11 @@ begin
   or (s = 'php4')
   or (s = 'php5')
   or (s = 'c++') then FContentType := 'text/plain';
-  
+
   if (s = 'html')
   or (s = 'shtml') then FContentType := 'text/html';
   if s = 'css' then FContentType := 'text/css';
-  
+
   if s = 'png' then FContentType := 'image/x-png';
   if s = 'xpm' then FContentType := 'image/x-pixmap';
   if s = 'xbm' then FContentType := 'image/x-bitmap';
@@ -785,7 +785,7 @@ begin
   if (s = 'jpg')
   or (s = 'jpeg') then FContentType := 'image/jpeg';
   if s = 'bmp' then FContentType := 'image/x-ms-bmp';
-    
+
   if s = 'wav' then FContentType := 'audio/x-wav';
   if s = 'mp3' then FContentType := 'audio/x-mp3';
   if s = 'ogg' then FContentType := 'audio/x-ogg';
@@ -794,7 +794,7 @@ begin
   or (s = 'mov') then FContentType := 'video/quicktime';
   if (s = 'mpg')
   or (s = 'mpeg') then FContentType := 'video/mpeg';
-  
+
   if s = 'pdf' then FContentType := 'application/pdf';
   if s = 'rtf' then FContentType := 'application/rtf';
   if s = 'tex' then FContentType := 'application/x-tex';
@@ -817,7 +817,7 @@ begin
 
   if Length(FDescription) > 0 then
     Result := Result + 'Content-Description: ' + FDescription + CRLF;
-    
+
   Result := Result + CRLF;
 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
   along with This library; if not, Write to the Free Software Foundation,
   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-  
+
   This license has been modified. See File LICENSE.ADDON for more inFormation.
   Should you find these sources without a LICENSE File, please contact
   me at [email protected]
@@ -98,12 +98,12 @@ type
     function GetIPAddressLength: TSocklen;
 
     function SetupSocket(const APort: Word; const Address: string): Boolean; virtual;
-    
+
     function DoSend(const 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 GetLocalPort: Word;
     function GetPeerPort: Word;
     function GetPeerAddress: string;
@@ -120,26 +120,26 @@ type
     procedure SoftDisconnect;
 
     function Bail(const msg: string; const ernum: Integer): Boolean;
-    
+
     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
    public
     constructor Create; override;
     destructor Destroy; override;
-    
+
     function SetState(const aState: TLSocketState; const TurnOn: Boolean = True): Boolean; virtual;
-    
+
     function Listen(const APort: Word; const AIntf: string = LADDR_ANY): Boolean;
     function Accept(const SerSock: TSocket): Boolean;
     function Connect(const Address: string; const APort: Word): Boolean;
-    
+
     function Send(const aData; const aSize: Integer): Integer; virtual;
     function SendMessage(const msg: string): Integer;
-    
+
     function Get(out aData; const aSize: Integer): Integer; virtual;
     function GetMessage(out msg: string): Integer;
-    
+
     procedure Disconnect(const Forced: Boolean = True); virtual;
    public
     property Connected: Boolean read GetConnected; deprecated;
@@ -160,22 +160,22 @@ type
     Property MsgBufferSize: Integer Read FMsgBufferSize Write FMsgBufferSize;
   end;
   TLSocketClass = class of TLSocket;
-  
+
   { this is the socket used by TLConnection }
-  
+
   TLActionEnum = (acConnect, acAccept, acSend, acReceive, acError);
 
   { Base interface common to ALL connections }
-  
+
   ILComponent = interface
     procedure Disconnect(const Forced: Boolean = True);
     procedure CallAction;
-    
+
     property SocketClass: TLSocketClass;
     property Host: string;
     property Port: Word;
   end;
-  
+
   { Interface for protools with direct send/get capabilities }
 
   ILDirect = interface
@@ -185,20 +185,20 @@ type
     function Send(const aData; const aSize: Integer; aSocket: TLSocket = nil): Integer;
     function SendMessage(const msg: string; aSocket: TLSocket = nil): Integer;
   end;
-  
+
   { Interface for all servers }
-  
+
   ILServer = interface
     function Listen(const APort: Word; const AIntf: string = LADDR_ANY): Boolean;
   end;
 
   { Interface for all clients }
-  
+
   ILClient = interface
     function Connect(const Address: string; const APort: Word): Boolean; overload;
     function Connect: Boolean; overload;
   end;
-  
+
   { TLComponent }
 
   TLComponent = class(TComponent, ILComponent)
@@ -219,7 +219,7 @@ type
     property Creator: TLComponent read FCreator write SetCreator;
     property Active: Boolean read FActive;
   end;
-  
+
   { TLConnection
     Common ancestor for TLTcp and TLUdp classes. Holds Event properties
     and common variables. }
@@ -243,14 +243,14 @@ type
     FSession: TLSession;
    protected
     function InitSocket(aSocket: TLSocket): TLSocket; virtual;
-    
+
     function GetConnected: Boolean; virtual; abstract;
     function GetCount: Integer; virtual;
     function GetItem(const i: Integer): TLSocket;
-    
+
     function GetTimeout: Integer;
     procedure SetTimeout(const AValue: Integer);
-    
+
     procedure SetEventer(Value: TLEventer);
     procedure SetSession(aSession: TLSession);
     procedure Notification(AComponent: TComponent; Operation: TOperation); override;
@@ -260,7 +260,7 @@ type
     procedure ReceiveAction(aSocket: TLHandle); virtual;
     procedure SendAction(aSocket: TLHandle); virtual;
     procedure ErrorAction(aSocket: TLHandle; const msg: string); virtual;
-    
+
     procedure ConnectEvent(aSocket: TLHandle); virtual;
     procedure DisconnectEvent(aSocket: TLHandle); virtual;
     procedure AcceptEvent(aSocket: TLHandle); virtual;
@@ -268,26 +268,26 @@ type
     procedure CanSendEvent(aSocket: TLHandle); virtual;
     procedure ErrorEvent(aSocket: TLHandle; const msg: string); virtual;
     procedure EventerError(const msg: string; Sender: TLEventer);
-    
+
     procedure RegisterWithEventer; virtual;
-    
+
     procedure FreeSocks(const Forced: Boolean); virtual;
    public
     constructor Create(aOwner: TComponent); override;
     destructor Destroy; override;
-    
+
     function Connect(const Address: string; const APort: Word): Boolean; virtual; overload;
     function Connect: Boolean; virtual; overload;
-    
+
     function Listen(const APort: Word; const AIntf: string = LADDR_ANY): Boolean; virtual; abstract; overload;
     function Listen: Boolean; virtual; overload;
-    
+
     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 Send(const aData; const aSize: Integer; aSocket: TLSocket = nil): Integer; virtual; abstract;
     function SendMessage(const msg: string; aSocket: TLSocket = nil): Integer; virtual; abstract;
-    
+
     function IterNext: Boolean; virtual; abstract;
     procedure IterReset; virtual; abstract;
    public
@@ -305,36 +305,36 @@ type
     property EventerClass: TLEventerClass read FEventerClass write FEventerClass;
     property Session: TLSession read FSession write SetSession;
   end;
-  
+
   { TLUdp }
 
   TLUdp = class(TLConnection)
    protected
     function InitSocket(aSocket: TLSocket): TLSocket; override;
-    
+
     function GetConnected: Boolean; override;
-    
+
     procedure ReceiveAction(aSocket: TLHandle); override;
     procedure ErrorAction(aSocket: TLHandle; const msg: string); override;
-    
+
     function Bail(const msg: string): Boolean;
-    
+
     procedure SetAddress(const Address: string);
    public
     constructor Create(aOwner: TComponent); override;
-    
+
     function Connect(const Address: string; const APort: Word): 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 GetMessage(out 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 Send(const aData; const aSize: Integer; aSocket: TLSocket = nil): Integer; override;
     function Send(const aData; const aSize: Integer; const Address: string): Integer; overload;
-    
+
     function IterNext: Boolean; override;
     procedure IterReset; override;
 
@@ -342,7 +342,7 @@ type
 
     procedure CallAction; override;
   end;
-  
+
   { TLTcp }
 
   TLTcp = class(TLConnection)
@@ -461,7 +461,7 @@ begin
                             FSocketState := FSocketState + [aState]
                           else
                             raise Exception.Create('Can not turn off server socket feature');
-                            
+
     ssBlocking          : SetBlocking(TurnOn);
     ssReuseAddress      : SetReuseAddress(TurnOn);
 
@@ -470,11 +470,11 @@ begin
                             FSocketState := FSocketState + [aState]
                           else
                             FSocketState := FSocketState - [aState];
-    
+
     ssSSLActive         : raise Exception.Create('Can not turn SSL/TLS on in TLSocket instance');
 {    ssNoDelay           : SetNoDelay(TurnOn);}
   end;
-  
+
   Result := True;
 end;
 
@@ -642,7 +642,7 @@ end;
 function TLSocket.Get(out aData; const aSize: Integer): Integer;
 begin
   Result := 0;
-  
+
   if aSize = 0 then
     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
         Exit(Bail('SetSockOpt error setting reuseaddr', LSocketError));
     end;
-    
+
     {$ifdef darwin}
     Arg := 1;
     if fpsetsockopt(FHandle, SOL_SOCKET, SO_NOSIGPIPE, @Arg, Sizeof(Arg)) = SOCKET_ERROR then
       Exit(Bail('SetSockOpt error setting nosigpipe', LSocketError));
     {$endif}
-    
+
     FillAddressInfo(FAddress, FSocketNet, Address, aPort);
     FillAddressInfo(FPeerAddress, FSocketNet, LADDR_BR, aPort);
     if FMSGBufferSize>0 then
@@ -750,11 +750,11 @@ end;
 function TLSocket.DoSend(const aData; const aSize: Integer): Integer;
 var
   AddressLength: Longint = SizeOf(FPeerAddress.IPv4);
-  
+
 begin
   if FSocketType = SOCK_STREAM then
     Result := Sockets.fpSend(FHandle, @aData, aSize, LMSG)
-  else 
+  else
     Result := sockets.fpsendto(FHandle, @aData, aSize, LMSG, @FPeerAddress, AddressLength);
 end;
 
@@ -795,7 +795,7 @@ begin
       HardDisconnect(True); {$warning check if we need aOp = soSend in the IF, perhaps bad recv is possible?}
     end else
       Bail(GSStr[aOp] + ' error', LastError);
-      
+
     Result := 0;
   end;
 end;
@@ -854,7 +854,7 @@ end;
 function TLSocket.Connect(const Address: string; const aPort: Word): Boolean;
 begin
   Result := False;
-  
+
   if FConnectionStatus <> scNone then
     Disconnect(True);
 
@@ -873,7 +873,7 @@ end;
 function TLSocket.Send(const aData; const aSize: Integer): Integer;
 begin
   Result := 0;
-  
+
   if aSize = 0 then
     raise Exception.Create('Invalid buffersize 0 in Send');
 
@@ -968,7 +968,7 @@ procedure TLConnection.Notification(AComponent: TComponent;
   Operation: TOperation);
 begin
   inherited Notification(AComponent, Operation);
-  
+
   if (Operation = opRemove) and (AComponent = FSession) then
     FSession := nil;
 end;
@@ -1160,7 +1160,7 @@ begin
   FIterator := FRootSock;
 
   Result := FRootSock.SetupSocket(APort, LADDR_ANY);
-  
+
   if Result then begin
     FillAddressInfo(FRootSock.FPeerAddress, FRootSock.FSocketNet, Address, aPort);
     FRootSock.FConnectionStatus := scConnected;
@@ -1177,10 +1177,10 @@ begin
 
   FRootSock := InitSocket(SocketClass.Create);
   FIterator := FRootSock;
-  
+
   if FRootSock.Listen(APort, AIntf) then begin
     FillAddressInfo(FRootSock.FPeerAddress, FRootSock.FSocketNet, LADDR_BR, aPort);
-  
+
     FRootSock.FConnectionStatus := scConnected;
     RegisterWithEventer;
     Result := True;
@@ -1328,13 +1328,13 @@ end;
 function TLTcp.Connect(const Address: string; const APort: Word): Boolean;
 begin
   Result := inherited Connect(Address, aPort);
-  
+
   if Assigned(FRootSock) then
     Disconnect(True);
-    
+
   FRootSock := InitSocket(SocketClass.Create);
   Result := FRootSock.Connect(Address, aPort);
-  
+
   if Result then begin
     Inc(FCount);
     FIterator := FRootSock;
@@ -1348,10 +1348,10 @@ end;
 function TLTcp.Listen(const APort: Word; const AIntf: string = LADDR_ANY): Boolean;
 begin
   Result := false;
-  
+
   if Assigned(FRootSock) then
     Disconnect(True);
-  
+
   FRootSock := InitSocket(SocketClass.Create);
   FRootSock.SetReuseAddress(FReuseAddress);
   FRootSock.MsgBufferSize:= MsgBufferSize;
@@ -1398,7 +1398,7 @@ begin
     aSocket.PrevSock.NextSock := aSocket.NextSock;
   if Assigned(aSocket.NextSock) then
     aSocket.NextSock.PrevSock := aSocket.PrevSock;
-    
+
   Dec(FCount);
 end;
 
@@ -1467,23 +1467,23 @@ var
   Tmp: TLSocket;
 begin
   Tmp := InitSocket(SocketClass.Create);
-  
+
   if Tmp.Accept(FRootSock.FHandle) then begin
     if Assigned(FRootSock.FNextSock) then begin
       Tmp.FNextSock := FRootSock.FNextSock;
       FRootSock.FNextSock.FPrevSock := Tmp;
     end;
-    
+
     FRootSock.FNextSock := Tmp;
     Tmp.FPrevSock := FRootSock;
-    
+
     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
       FIterator := Tmp;  // assign it as iterator (don't assign later acceptees)
-      
+
     Inc(FCount);
     FEventer.AddHandle(Tmp);
-    
+
     Tmp.FConnectionStatus := scConnected;
     Tmp.IgnoreWrite := True;
 
@@ -1531,7 +1531,7 @@ begin
     Self.Bail('Error on connect: connection refused', TLSocket(aSocket));
     Exit;
   end;
-  
+
   if Assigned(FSession) then
     FSession.ErrorEvent(aSocket, msg)
   else
@@ -1567,7 +1567,7 @@ end;
 function TLTcp.GetValidSocket: TLSocket;
 begin
   Result := nil;
-  
+
   if Assigned(FIterator) and not (ssServerSocket in FIterator.SocketState) then
     Result := FIterator
   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
   along with This library; if not, Write to the Free Software Foundation,
   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-  
+
   This license has been modified. See file LICENSE.ADDON for more information.
   Should you find these sources without a LICENSE File, please contact
   me at [email protected]
@@ -42,7 +42,7 @@ type
   protected
     FEvent: TLHandle;
   public
-    function Write(const Buffer; Count: longint): longint; override;          
+    function Write(const Buffer; Count: longint): longint; override;
   end;
 
   TLProcess = class(TProcess)
@@ -61,7 +61,7 @@ type
   public
     constructor Create(AOwner: TComponent); override;
     destructor Destroy; override;
-    
+
     procedure CloseInput; override;
     procedure CloseOutput; 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
   along with This library; if not, Write to the Free Software Foundation,
   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-  
+
   This license has been modified. See File LICENSE.ADDON for more inFormation.
   Should you find these sources without a LICENSE File, please contact
   me at [email protected]
@@ -31,11 +31,11 @@ interface
 uses
   Classes, SysUtils, Contnrs, Base64,
   lNet, lEvents, lCommon, lMimeWrapper, lMimeStreams;
-  
+
 type
   TLSMTP = class;
   TLSMTPClient = class;
-  
+
   TLSMTPStatus = (ssNone, ssCon, ssHelo, ssEhlo, ssAuthLogin, ssAuthPlain,
                   ssStartTLS, ssMail, ssRcpt, ssData, ssRset, ssQuit, ssLast);
 
@@ -45,7 +45,7 @@ type
     Status: TLSMTPStatus;
     Args: array[1..2] of string;
   end;
-  
+
   { TLSMTPStatusFront }
   {$DEFINE __front_type__  :=  TLSMTPStatusRec}
   {$i lcontainersh.inc}
@@ -53,7 +53,7 @@ type
 
   TLSMTPClientStatusEvent = procedure (aSocket: TLSocket;
                                        const aStatus: TLSMTPStatus) of object;
-                                       
+
   { TMail }
 
   TMail = class
@@ -91,7 +91,7 @@ type
    protected
     function GetTimeout: Integer;
     procedure SetTimeout(const AValue: Integer);
-    
+
     function GetSession: TLSession;
     procedure SetSession(const AValue: TLSession);
     procedure SetCreator(AValue: TLComponent); override;
@@ -100,13 +100,13 @@ type
 
     function GetSocketClass: TLSocketClass;
     procedure SetSocketClass(const AValue: TLSocketClass);
-    
+
     function GetEventer: TLEventer;
     procedure SetEventer(Value: TLEventer);
    public
     constructor Create(aOwner: TComponent); override;
     destructor Destroy; override;
-    
+
     function HasFeature(aFeature: string): Boolean;
    public
     property Connected: Boolean read GetConnected;
@@ -151,31 +151,31 @@ type
     procedure OnCs(aSocket: TLSocket);
    protected
     function CanContinue(const aStatus: TLSMTPStatus; const Arg1, Arg2: string): Boolean;
-    
+
     function CleanInput(var s: string): Integer;
-    
+
     procedure EvaluateServer;
     procedure EvaluateFeatures;
     procedure EvaluateAnswer(const Ans: string);
     procedure ExecuteFrontCommand;
-    
+
     procedure AddToBuffer(s: string);
     procedure SendData(const FromStream: Boolean = False);
     function EncodeBase64(const s: string): string;
    public
     constructor Create(aOwner: TComponent); override;
     destructor Destroy; override;
-    
+
     function Connect(const aHost: string; const aPort: Word = 25): Boolean; virtual; overload;
     function Connect: Boolean; virtual; overload;
-    
+
     function Get(var aData; const aSize: Integer; 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: string; aStream: TStream);
     procedure SendMail(aMail: TMail);
-    
+
     procedure Helo(aHost: string = '');
     procedure Ehlo(aHost: string = '');
     procedure StartTLS;
@@ -186,9 +186,9 @@ type
     procedure Data(const Msg: string);
     procedure Rset;
     procedure Quit;
-    
+
     procedure Disconnect(const Forced: Boolean = True); override;
-    
+
     procedure CallAction; override;
    public
     property PipeLine: Boolean read FPipeLine write FPipeLine;
@@ -240,7 +240,7 @@ end;
 procedure TLSMTP.SetCreator(AValue: TLComponent);
 begin
   inherited SetCreator(AValue);
-  
+
   FConnection.Creator := AValue;
 end;
 
@@ -282,7 +282,7 @@ end;
 constructor TLSMTP.Create(aOwner: TComponent);
 begin
   inherited Create(aOwner);
-  
+
   FFeatureList := TStringList.Create;
   FConnection := TLTcp.Create(nil);
   FConnection.Creator := Self;
@@ -342,7 +342,7 @@ begin
   FSL := TStringList.Create;
 //  {$warning TODO: fix pipelining support when server does it}
   FPipeLine := False;
-  
+
   FConnection.OnError := @OnEr;
   FConnection.OnCanSend := @OnCs;
   FConnection.OnReceive := @OnRe;
@@ -472,7 +472,7 @@ procedure TLSMTPClient.EvaluateAnswer(const Ans: string);
       Result := -1;
     end;
   end;
-  
+
   function ValidResponse(const Answer: string): Boolean; inline;
   begin
     Result := (Length(Ans) >= 3) and
@@ -483,7 +483,7 @@ procedure TLSMTPClient.EvaluateAnswer(const Ans: string);
     if Result then
       Result := (Length(Ans) = 3) or ((Length(Ans) > 3) and (Ans[4] = ' '));
   end;
-  
+
   procedure Eventize(const aStatus: TLSMTPStatus; const Res: Boolean);
   begin
     FStatus.Remove;
@@ -495,7 +495,7 @@ procedure TLSMTPClient.EvaluateAnswer(const Ans: string);
         FOnFailure(FConnection.Iterator, aStatus);
     end;
   end;
-  
+
 var
   x: Integer;
 begin
@@ -520,7 +520,7 @@ begin
                             FTempBuffer := '';
                           end;
               end;
-              
+
       ssStartTLS:
               case x of
                 200..299: begin
@@ -531,7 +531,7 @@ begin
                             Eventize(FStatus.First.Status, False);
                           end;
               end;
-              
+
       ssAuthLogin:
               case x of
                 200..299: begin
@@ -552,7 +552,7 @@ begin
                             Eventize(FStatus.First.Status, False);
                           end;
               end;
-              
+
       ssAuthPlain:
               case x of
                 200..299: begin
@@ -586,11 +586,11 @@ begin
                             Eventize(FStatus.First.Status, False);
                           end;
               end;
-              
+
       ssRset: begin
                 Eventize(FStatus.First.Status, (x >= 200) and (x < 299));
               end;
-              
+
       ssQuit: begin
                 Eventize(FStatus.First.Status, (x >= 200) and (x < 299));
 {                if Assigned(FOnDisconnect) then
@@ -598,7 +598,7 @@ begin
                 Disconnect(False);
               end;
     end;
-    
+
   if FStatus.Empty and not FCommandFront.Empty then
     ExecuteFrontCommand;
 end;
@@ -652,23 +652,23 @@ begin
     end else
       Inc(FCharCount);
   end;
-  
+
   FBuffer := FBuffer + s;
 end;
 
 procedure TLSMTPClient.SendData(const FromStream: Boolean = False);
 const
   SBUF_SIZE = 65535;
-  
+
   procedure FillBuffer;
   var
     s: string;
   begin
     SetLength(s, SBUF_SIZE - Length(FBuffer));
     SetLength(s, FStream.Read(s[1], Length(s)));
-    
+
     AddToBuffer(s);
-    
+
     if FStream.Position = FStream.Size then begin // we finished the stream
       AddToBuffer(CRLF + '.' + CRLF);
       FStream := nil;
@@ -693,7 +693,7 @@ begin
     if FromStream and Assigned(FStream) and (Length(FBuffer) < SBUF_SIZE) then
       FillBuffer;
   end;
-  
+
   if Assigned(FOnSent) and (FStatus.First.Status = ssData) then
     FOnSent(FConnection.Iterator, Sent);
 end;
@@ -706,7 +706,7 @@ begin
   Result := '';
   if Length(s) = 0 then
     Exit;
-  
+
   Dummy := TBogusStream.Create;
   Enc := TBase64EncodingStream.Create(Dummy);
 
@@ -763,7 +763,7 @@ begin
   From := EncodeMimeHeaderText(From);
   Recipients := EncodeMimeHeaderText(Recipients);
   Subject := EncodeMimeHeaderText(Subject);
-  
+
   if (Length(Recipients) > 0) and (Length(From) > 0) then begin
     Mail(From);
     FSL.CommaText := StringReplace(Recipients, ' ', ',', [rfReplaceAll]);
@@ -780,7 +780,7 @@ begin
   From := EncodeMimeHeaderText(From);
   Recipients := EncodeMimeHeaderText(Recipients);
   Subject := EncodeMimeHeaderText(Subject);
-  
+
   FStream := aStream;
 
   if (Length(Recipients) > 0) and (Length(From) > 0) then begin
@@ -838,7 +838,7 @@ begin
   aName := EncodeBase64(aName);
   aPass := EncodeBase64(aPass);
   FAuthStep := 0; // first, send username
-  
+
   if CanContinue(ssAuthLogin, aName, aPass) then begin
     AddToBuffer('AUTH LOGIN' + CRLF);
     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
   along with This library; if not, Write to the Free Software Foundation,
   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-  
+
   This license has been modified. See file LICENSE.ADDON for more information.
   Should you find these sources without a LICENSE File, please contact
   me at [email protected]
@@ -71,7 +71,7 @@ end;
 procedure AppendString(var ABuffer: TStringBuffer; ASource: pansichar);
 begin
   if ASource = nil then exit;
-  AppendString(ABuffer, ASource, StrLen(ASource)); 
+  AppendString(ABuffer, ASource, StrLen(ASource));
 end;
 
 procedure AppendString(var ABuffer: TStringBuffer; const ASource: shortstring);

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

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

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

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

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

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

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

@@ -109,7 +109,7 @@ begin
     FInLoop := True;
     for i := 0 to n-1 do begin
       Temp := TLHandle(FEvents[i].uData);
-      
+
       if  (not Temp.FDispose)
       and (FEvents[i].Filter = EVFILT_WRITE) then
         if Assigned(Temp.FOnWrite) and not Temp.IgnoreWrite then
@@ -119,7 +119,7 @@ begin
       and (FEvents[i].Filter = EVFILT_READ) then
         if Assigned(Temp.FOnRead) and not Temp.IgnoreRead then
           Temp.FOnRead(Temp);
-      
+
       if  (not Temp.FDispose)
       and ((FEvents[i].Flags and EV_ERROR) > 0) 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 CallAction: Boolean; override;
   end;
-  
+
 {$endif} // bsd

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

@@ -12,9 +12,9 @@ var
   ppEnv, ppArgs: ppAnsiChar;
   Env : Array of AnsiString;
   Len : Integer;
-  
+
 begin
-  {$IF SIZEOF(CHAR)=2}   
+  {$IF SIZEOF(CHAR)=2}
   Apps:=UTF8Encode(App);
   Enviros:=UTF8Encode(EnviroS);
   {$ENDIF}
@@ -57,13 +57,13 @@ begin
         Env[i]:=SL[i];
         {$ENDIF}
         end;
-        
+
       GetMem(ppEnv, SizeOf(pChar) * (Len+1));
       for i:=0 to Len-1 do
         ppEnv[i]:=pAnsiChar(Env[i]);
       ppEnv[Len]:=nil;
     end;
-    
+
     FpExecve(pAnsiChar(App), ppArgs, ppEnv);
   end else if Result > 0 then
     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.
 It was tested with windres 2.9.4 successfully.
-syntax: 
+syntax:
 windres --preprocessor fprcp.exe [another switches].
 
 Notes:

+ 2 - 2
utils/fprcp/fpmake.pp

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

+ 5 - 5
utils/fprcp/fprcp.pp

@@ -62,7 +62,7 @@ var
  buf:pchars;
  i:longint;
  AConstList: TStringList;
- 
+
 function Entry(buf:pchars;Size,fromPos:longint;const sample:str255;casesent:longbool):longbool;
  var
   i:longint;
@@ -438,7 +438,7 @@ begin
      if entry(buf,size,i,'#include',true)then
       do_include(GetWord(buf,size,i+length('#include'),nextpos));
     end;
-   //finally 
+   //finally
    AConstList.EndUpdate; //end;
 
    //replace const-value if needed and evaluate
@@ -453,7 +453,7 @@ begin
     if Length(sValue2)>0
     then AConstList.ValueFromIndex[i]:=Evaluate(sValue1);
    end;
- 
+
    if isSwitch('C')or isSwitch('-Cheader')then begin
     for i:=0 to AConstList.Count-1
     do writeln('#define ',AConstList.Names[i],' ',AConstList.ValueFromIndex[i]);
@@ -497,7 +497,7 @@ begin
     end;
    freemem(buf,size);
 
- //finally 
+ //finally
  AConstList.Free; //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.
    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
    executed is fixed no matter what a user does.
 
@@ -114,7 +114,7 @@ begin
             halt(result_not_owner_error);
           vcs:='/dev/vcs'+s;
           vcsa:='/dev/vcsa'+s;
-          
+
           {Change owner and group to that of /dev/tty??.}
           if fpchown(vcs,ttystat.st_uid,ttystat.st_gid)<>0 then
             halt(result_chown_error);

+ 8 - 8
utils/h2pas/README.txt

@@ -4,10 +4,10 @@ units. It is part of the Free Pascal distribution.
 COMPILING
 
 To compile the program, a simple
- 'make' 
+ 'make'
 should be sufficient; you need GNU make for this. When using TP, a simple
   tpc h2pas.pas
-should also be possible. 
+should also be possible.
 
 USAGE
 
@@ -18,12 +18,12 @@ h2pas [-p] [-t] [-o outputfilename] [-l libname] [-u unitname] filename
      same name.
 
 -p : Use 'P' instead of ^ as a pointer symbol;
-     This will convert 
+     This will convert
         ^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.
-     Thus 
+     Thus
      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
      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
      extension '.pp'.

+ 5 - 5
utils/h2pas/fpmake.pp

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

+ 299 - 299
utils/h2pas/h2pparse.pp

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

+ 9 - 9
utils/h2pas/scan.pas

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

+ 3 - 3
utils/h2pas/scanbase.pp

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

+ 1 - 1
utils/ihxutil/fpmake.pp

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

+ 1 - 1
utils/importtl/fpmake.pp

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

+ 1 - 1
utils/instantfpc/fpmake.pp

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

+ 24 - 24
utils/instantfpc/instantfpc.pas

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

+ 1 - 1
utils/instantfpc/instantfptools.pas

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

+ 1 - 1
utils/json2pas/fpmake.pp

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

+ 1 - 1
utils/mksymbian/cfgfile.pas

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

+ 1 - 1
utils/mksymbian/cmdline.pas

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

برخی فایل ها در این مقایسه diff نمایش داده نمی شوند زیرا تعداد فایل ها بسیار زیاد است