Browse Source

Merge branch 'master' into hotfix

Source commit: 98d97d0af0c62fb9222b98b9587cb658e8ef9c48
Martin Prikryl 4 years ago
parent
commit
0821bf0717
100 changed files with 5698 additions and 2647 deletions
  1. 1 1
      deployment/WinSCPnet.nuspec
  2. 1 1
      deployment/winscp.isl
  3. 78 29
      deployment/winscpsetup.iss
  4. 85 4
      dotnet/ComparisonDifference.cs
  5. 154 161
      dotnet/GlobalSuppressions.cs
  6. 13 0
      dotnet/RemotePath.cs
  7. 257 53
      dotnet/Session.cs
  8. 45 6
      dotnet/SessionOptions.cs
  9. 7 2
      dotnet/internal/Callstack.cs
  10. 10 2
      dotnet/internal/CallstackAndLock.cs
  11. 26 3
      dotnet/internal/ConsoleCommStruct.cs
  12. 1 1
      dotnet/internal/ElementLogReader.cs
  13. 203 18
      dotnet/internal/ExeSessionProcess.cs
  14. 0 1
      dotnet/internal/ISessionProcess.cs
  15. 25 0
      dotnet/internal/ImplicitEnumerable.cs
  16. 1 1
      dotnet/internal/Job.cs
  17. 17 6
      dotnet/internal/Logger.cs
  18. 1 1
      dotnet/internal/PatientFileStream.cs
  19. 375 0
      dotnet/internal/PipeStream.cs
  20. 1 1
      dotnet/internal/ProgressHandler.cs
  21. 13 0
      dotnet/internal/StdOutException.cs
  22. 2 2
      dotnet/properties/AssemblyInfo.cs
  23. 6 6
      libs/expat/CMake.README
  24. 247 51
      libs/expat/CMakeLists.txt
  25. 1 1
      libs/expat/COPYING
  26. 204 3
      libs/expat/Changes
  27. 17 3
      libs/expat/Makefile.am
  28. 121 25
      libs/expat/Makefile.in
  29. 89 8
      libs/expat/README.md
  30. 27 30
      libs/expat/aclocal.m4
  31. 2 2
      libs/expat/bcb5/expat_static.mak
  32. 67 0
      libs/expat/cmake/autotools/expat-config-version.cmake.in
  33. 19 0
      libs/expat/cmake/autotools/expat-noconfig.cmake.in
  34. 19 0
      libs/expat/cmake/autotools/expat-noconfig__linux.cmake.in
  35. 19 0
      libs/expat/cmake/autotools/expat-noconfig__macos.cmake.in
  36. 19 0
      libs/expat/cmake/autotools/expat-noconfig__windows.cmake.in
  37. 25 0
      libs/expat/cmake/autotools/expat-package-init.cmake
  38. 94 0
      libs/expat/cmake/autotools/expat.cmake
  39. 350 230
      libs/expat/configure
  40. 140 28
      libs/expat/configure.ac
  41. 10 9
      libs/expat/conftools/ar-lib
  42. 8 5
      libs/expat/conftools/ax-check-compile-flag.m4
  43. 6 6
      libs/expat/conftools/compile
  44. 326 257
      libs/expat/conftools/config.guess
  45. 993 1072
      libs/expat/conftools/config.sub
  46. 4 4
      libs/expat/conftools/depcomp
  47. 28 2
      libs/expat/conftools/get-version.sh
  48. 92 69
      libs/expat/conftools/install-sh
  49. 1 1
      libs/expat/conftools/missing
  50. 9 7
      libs/expat/conftools/test-driver
  51. 4 2
      libs/expat/doc/Makefile.am
  52. 24 4
      libs/expat/doc/Makefile.in
  53. BIN
      libs/expat/doc/expat.png
  54. 1 0
      libs/expat/doc/ok.min.css
  55. 292 94
      libs/expat/doc/reference.html
  56. 40 94
      libs/expat/doc/style.css
  57. BIN
      libs/expat/doc/valid-xhtml10.png
  58. 101 33
      libs/expat/doc/xmlwf.1
  59. 148 62
      libs/expat/doc/xmlwf.xml
  60. 3 2
      libs/expat/examples/Makefile.am
  61. 22 4
      libs/expat/examples/Makefile.in
  62. 6 1
      libs/expat/examples/elements.c
  63. 6 2
      libs/expat/examples/outline.c
  64. 2 2
      libs/expat/expat.pc.in
  65. 5 5
      libs/expat/expat_config.h
  66. 1 1
      libs/expat/fix-xmltest-log.sh
  67. 13 2
      libs/expat/lib/Makefile.am
  68. 66 20
      libs/expat/lib/Makefile.in
  69. 5 2
      libs/expat/lib/ascii.h
  70. 3 1
      libs/expat/lib/asciitab.h
  71. 35 9
      libs/expat/lib/expat.h
  72. 8 1
      libs/expat/lib/expat_external.h
  73. 3 1
      libs/expat/lib/iasciitab.h
  74. 49 9
      libs/expat/lib/internal.h
  75. 3 1
      libs/expat/lib/latin1tab.h
  76. 4 2
      libs/expat/lib/libexpat.def
  77. 4 2
      libs/expat/lib/libexpatw.def
  78. 2 2
      libs/expat/lib/nametab.h
  79. 4 9
      libs/expat/lib/siphash.h
  80. 3 1
      libs/expat/lib/utf8tab.h
  81. 6 15
      libs/expat/lib/winconfig.h
  82. 397 82
      libs/expat/lib/xmlparse.c
  83. 13 6
      libs/expat/lib/xmlrole.c
  84. 4 1
      libs/expat/lib/xmlrole.h
  85. 27 19
      libs/expat/lib/xmltok.c
  86. 5 1
      libs/expat/lib/xmltok.h
  87. 15 6
      libs/expat/lib/xmltok_impl.c
  88. 2 1
      libs/expat/lib/xmltok_impl.h
  89. 5 1
      libs/expat/lib/xmltok_ns.c
  90. 28 2
      libs/expat/run.sh.in
  91. 2 1
      libs/expat/test-driver-wrapper.sh
  92. 6 4
      libs/expat/tests/Makefile.am
  93. 29 9
      libs/expat/tests/Makefile.in
  94. 3 2
      libs/expat/tests/benchmark/Makefile.am
  95. 22 4
      libs/expat/tests/benchmark/Makefile.in
  96. 4 2
      libs/expat/tests/benchmark/benchmark.c
  97. 7 5
      libs/expat/tests/chardata.c
  98. 3 2
      libs/expat/tests/chardata.h
  99. 2 2
      libs/expat/tests/memcheck.c
  100. 2 2
      libs/expat/tests/memcheck.h

+ 1 - 1
deployment/WinSCPnet.nuspec

@@ -18,7 +18,7 @@ The library is primarily intended for advanced automation tasks that require con
 For documentation and examples of use, see project website.
 For documentation and examples of use, see project website.
 
 
 The NuGet package includes the assembly itself and a required WinSCP executable. When installed, it adds the assembly as reference to your project and sets up WinSCP executable to be copied to project output directory, so that it can be found on run-time.</description>
 The NuGet package includes the assembly itself and a required WinSCP executable. When installed, it adds the assembly as reference to your project and sets up WinSCP executable to be copied to project output directory, so that it can be found on run-time.</description>
-    <copyright>Copyright © 2012-2021 Martin Prikryl</copyright>
+    <copyright>Copyright © 20122021 Martin Prikryl</copyright>
     <tags>winscp sftp ftp ftps webdav s3 scp transfer</tags>
     <tags>winscp sftp ftp ftps webdav s3 scp transfer</tags>
     <dependencies>
     <dependencies>
       <group targetFramework=".NETStandard2.0"/>
       <group targetFramework=".NETStandard2.0"/>

+ 1 - 1
deployment/winscp.isl

@@ -58,7 +58,7 @@ AboutDonations=About donations
 Donate=Donate %s
 Donate=Donate %s
 Currency=USD
 Currency=USD
 ImportSites=Looking for sites to import...
 ImportSites=Looking for sites to import...
-AcceptButton=&Accept >
+AcceptButton=&Accept
 IncompleteTranslation=You are about to use an incomplete translation. It is completed by %1%% only.%n%nUntranslated parts of the user interface will be shown in their original English version.%n%nVisit WinSCP website at winscp.net to check, if newer version of the translation is available.
 IncompleteTranslation=You are about to use an incomplete translation. It is completed by %1%% only.%n%nUntranslated parts of the user interface will be shown in their original English version.%n%nVisit WinSCP website at winscp.net to check, if newer version of the translation is available.
 
 
 [CustomOptions]
 [CustomOptions]

+ 78 - 29
deployment/winscpsetup.iss

@@ -73,7 +73,7 @@
 #define Minor
 #define Minor
 #define Rev
 #define Rev
 #define Build
 #define Build
-#expr ParseVersion(MainFileSource, Major, Minor, Rev, Build)
+#expr GetVersionComponents(MainFileSource, Major, Minor, Rev, Build)
 #define VersionOnly Str(Major)+"."+Str(Minor)+(Rev > 0 ? "."+Str(Rev) : "")
 #define VersionOnly Str(Major)+"."+Str(Minor)+(Rev > 0 ? "."+Str(Rev) : "")
 #define Version VersionOnly+(Status != "" ? " "+Status : "")
 #define Version VersionOnly+(Status != "" ? " "+Status : "")
 
 
@@ -123,7 +123,6 @@ PrivilegesRequiredOverridesAllowed=commandline dialog
 ShowLanguageDialog=auto
 ShowLanguageDialog=auto
 UsePreviousLanguage=yes
 UsePreviousLanguage=yes
 DisableProgramGroupPage=yes
 DisableProgramGroupPage=yes
-MinVersion=6.0
 SetupIconFile=winscpsetup.ico
 SetupIconFile=winscpsetup.ico
 DisableDirPage=no
 DisableDirPage=no
 WizardStyle=modern
 WizardStyle=modern
@@ -194,8 +193,10 @@ Name: custom; Description: "custom"; Flags: iscustom
 [Components]
 [Components]
 Name: main; Description: {cm:ApplicationComponent}; \
 Name: main; Description: {cm:ApplicationComponent}; \
   Types: full custom compact; Flags: fixed
   Types: full custom compact; Flags: fixed
+; Because the files for the component have Check parameters, they are ignored for the size calculation
 Name: shellext; Description: {cm:ShellExtComponent}; \
 Name: shellext; Description: {cm:ShellExtComponent}; \
-  Types: full compact
+  ExtraDiskSpaceRequired: {#Max(FileSize(ShellExtFileSource), FileSize(ShellExt64FileSource))}; \
+  Types: full compact; 
 Name: pageant; Description: {cm:PageantComponent}; \
 Name: pageant; Description: {cm:PageantComponent}; \
   Types: full
   Types: full
 Name: puttygen; Description: {cm:PuTTYgenComponent}; \
 Name: puttygen; Description: {cm:PuTTYgenComponent}; \
@@ -268,14 +269,15 @@ Source: "{#AssemblyFileSource}"; DestDir: "{app}"; \
   Components: main; Flags: ignoreversion
   Components: main; Flags: ignoreversion
 Source: "license.txt"; DestDir: "{app}"; \
 Source: "license.txt"; DestDir: "{app}"; \
   Components: main; Flags: ignoreversion
   Components: main; Flags: ignoreversion
+; If the Check is ever removed, remove the ExtraDiskSpaceRequired parameter of the component too
 Source: "{#ShellExtFileSource}"; DestDir: "{app}"; \
 Source: "{#ShellExtFileSource}"; DestDir: "{app}"; \
   Components: shellext; \
   Components: shellext; \
   Flags: regserver restartreplace uninsrestartdelete ignoreversion; \
   Flags: regserver restartreplace uninsrestartdelete ignoreversion; \
-  Check: not IsWin64 and ShouldInstallShellExt(ExpandConstant('{app}\{#ShellExtFileName}'), '{#GetFileVersion(ShellExtFileSource)}')
+  Check: not IsWin64 and ShouldInstallShellExt(ExpandConstant('{app}\{#ShellExtFileName}'), '{#GetVersionNumbersString(ShellExtFileSource)}')
 Source: "{#ShellExt64FileSource}"; DestDir: "{app}"; \
 Source: "{#ShellExt64FileSource}"; DestDir: "{app}"; \
   Components: shellext; \
   Components: shellext; \
   Flags: regserver restartreplace uninsrestartdelete ignoreversion; \
   Flags: regserver restartreplace uninsrestartdelete ignoreversion; \
-  Check: IsWin64 and ShouldInstallShellExt(ExpandConstant('{app}\{#ShellExt64FileName}'), '{#GetFileVersion(ShellExt64FileSource)}')
+  Check: IsWin64 and ShouldInstallShellExt(ExpandConstant('{app}\{#ShellExt64FileName}'), '{#GetVersionNumbersString(ShellExt64FileSource)}')
 Source: "{#PuttySourceDir}\LICENCE"; DestDir: "{app}\PuTTY"; \
 Source: "{#PuttySourceDir}\LICENCE"; DestDir: "{app}\PuTTY"; \
   Components: pageant puttygen; Flags: ignoreversion
   Components: pageant puttygen; Flags: ignoreversion
 Source: "{#PuttySourceDir}\putty.chm"; DestDir: "{app}\PuTTY"; \
 Source: "{#PuttySourceDir}\putty.chm"; DestDir: "{app}\PuTTY"; \
@@ -1419,7 +1421,7 @@ begin
       // old style counter
       // old style counter
       UsageData := UsageData + Format('TypicalInstallation:%d,', [Integer(IsTypicalInstallation)]);
       UsageData := UsageData + Format('TypicalInstallation:%d,', [Integer(IsTypicalInstallation)]);
 
 
-      UsageData := UsageData + 'InstallationsUser+,';
+      UsageData := UsageData + 'InstallationsUser+,InstallationParentProcess@,';
 
 
       Installations := 0; // default, if the counter does not exist
       Installations := 0; // default, if the counter does not exist
       RegQueryDWordValue(HKEY_LOCAL_MACHINE, '{#RegistryKey}', 'Installations', Installations);
       RegQueryDWordValue(HKEY_LOCAL_MACHINE, '{#RegistryKey}', 'Installations', Installations);
@@ -1531,6 +1533,8 @@ const
 
 
 var
 var
   ShowSponsor: Integer;
   ShowSponsor: Integer;
+  SponsoringLinkLabel, SponsorLinkLabel: TLabel;
+  SponsorImage: TBitmapImage;
 
 
 procedure SponsorImageClick(Sender: TObject);
 procedure SponsorImageClick(Sender: TObject);
 begin
 begin
@@ -1538,6 +1542,41 @@ begin
   OpenBrowser('{#WebReport}?mode=sponsor' + Format('&sponsor=%s&', [Sponsor]) + ExpandConstant('{#WebArguments}'));
   OpenBrowser('{#WebReport}?mode=sponsor' + Format('&sponsor=%s&', [Sponsor]) + ExpandConstant('{#WebArguments}'));
 end;
 end;
 
 
+function GetSponsorAreaHeight: Integer;
+begin
+  Result := SponsorPage.SurfaceHeight - SponsorLinkLabel.Height - ScaleY(12);
+end;
+
+procedure CenterSponsorImage;
+begin
+  if (Extended(SponsorImage.Bitmap.Width) / SponsorPage.SurfaceWidth) <
+       (Extended(SponsorImage.Bitmap.Height) / GetSponsorAreaHeight())  then
+  begin
+    SponsorImage.Top := 0;
+    SponsorImage.Height := GetSponsorAreaHeight();
+    SponsorImage.Width :=
+      Trunc((Extended(SponsorImage.Bitmap.Width) / SponsorImage.Bitmap.Height) * SponsorImage.Height);
+    SponsorImage.Left := (SponsorPage.SurfaceWidth - SponsorImage.Width) div 2;
+  end
+    else
+  begin
+    SponsorImage.Left := 0;
+    SponsorImage.Width := SponsorPage.SurfaceWidth;
+    SponsorImage.Height :=
+      Trunc((Extended(SponsorImage.Bitmap.Height) / SponsorImage.Bitmap.Width) * SponsorImage.Width);
+    SponsorImage.Top := (GetSponsorAreaHeight() - SponsorImage.Height) div 2;
+  end;
+  SponsorLinkLabel.Left := SponsorImage.Left;
+  SponsorLinkLabel.Top := GetBottom(SponsorImage) + ScaleX(6);
+  SponsoringLinkLabel.Left := GetRight(SponsorImage) - SponsoringLinkLabel.Width;
+  SponsoringLinkLabel.Top := SponsorLinkLabel.Top;
+end;
+
+procedure WizardFormResize(Sender: TObject);
+begin
+  CenterSponsorImage;
+end;
+
 function CheckSponsorReq: Boolean;
 function CheckSponsorReq: Boolean;
 var
 var
   R, Succeeded: Integer;
   R, Succeeded: Integer;
@@ -1549,9 +1588,8 @@ var
   Size: LongWord;
   Size: LongWord;
   ZipPath, TargetPath, ImagePath: string;
   ZipPath, TargetPath, ImagePath: string;
   Shell, ZipFile, TargetFolder: Variant;
   Shell, ZipFile, TargetFolder: Variant;
-  SponsorLinkLabel, SponsoringLinkLabel: TLabel;
-  SponsorImage: TBitmapImage;
-  ImageSize, GrayHeight: Integer;
+  SponsorArea: TBitmapImage;
+  ImageSize: Integer;
 begin
 begin
   if ShowSponsor = 0 then
   if ShowSponsor = 0 then
   begin
   begin
@@ -1579,17 +1617,28 @@ begin
       begin
       begin
         Log('Sponsor request succeeded');
         Log('Sponsor request succeeded');
 
 
+        if CmdLineParamExists('/SponsorArea') then
+        begin
+          SponsorArea := TBitmapImage.Create(SponsorPage);
+          SponsorArea.Parent := SponsorPage.Surface;
+          SponsorArea.Visible := CmdLineParamExists('/SponsorArea');
+          SponsorArea.BackColor := clTeal;
+          SponsorArea.Anchors := [akLeft, akTop, akRight, akBottom];
+        end
+          else
+        begin
+          SponsorArea := nil;
+        end;
+
         SponsorLinkLabel := TLabel.Create(SponsorPage);
         SponsorLinkLabel := TLabel.Create(SponsorPage);
         SponsorLinkLabel.Parent := SponsorPage.Surface;
         SponsorLinkLabel.Parent := SponsorPage.Surface;
         SponsorLinkLabel.Caption := 'Visit release sponsor';
         SponsorLinkLabel.Caption := 'Visit release sponsor';
-        SponsorLinkLabel.Top := SponsorPage.Surface.Height - SponsorLinkLabel.Height - ScaleY(2);
         SponsorLinkLabel.OnClick := @SponsorImageClick;
         SponsorLinkLabel.OnClick := @SponsorImageClick;
         LinkLabel(SponsorLinkLabel);
         LinkLabel(SponsorLinkLabel);
 
 
         SponsoringLinkLabel := TLabel.Create(SponsorPage);
         SponsoringLinkLabel := TLabel.Create(SponsorPage);
         SponsoringLinkLabel.Parent := SponsorPage.Surface;
         SponsoringLinkLabel.Parent := SponsorPage.Surface;
         SponsoringLinkLabel.Caption := 'Become next release sponsor';
         SponsoringLinkLabel.Caption := 'Become next release sponsor';
-        SponsoringLinkLabel.Top := SponsorLinkLabel.Top;
         SponsoringLinkLabel.OnClick := @SponsoringLinkLabelClick;
         SponsoringLinkLabel.OnClick := @SponsoringLinkLabelClick;
         LinkLabel(SponsoringLinkLabel);
         LinkLabel(SponsoringLinkLabel);
 
 
@@ -1684,9 +1733,9 @@ begin
 
 
                 SponsorImage := TBitmapImage.Create(SponsorPage);
                 SponsorImage := TBitmapImage.Create(SponsorPage);
                 SponsorImage.Parent := SponsorPage.Surface;
                 SponsorImage.Parent := SponsorPage.Surface;
-                SponsorImage.AutoSize := True;
                 SponsorImage.Hint := SponsorLinkLabel.Caption;
                 SponsorImage.Hint := SponsorLinkLabel.Caption;
                 SponsorImage.ShowHint := True;
                 SponsorImage.ShowHint := True;
+                SponsorImage.Stretch := True;
                 try
                 try
                   LoadBitmap(SponsorImage, ImagePath, SponsorPage.Surface.Color);
                   LoadBitmap(SponsorImage, ImagePath, SponsorPage.Surface.Color);
                 except
                 except
@@ -1697,26 +1746,26 @@ begin
 
 
                 if ShowSponsor = 0 then
                 if ShowSponsor = 0 then
                 begin
                 begin
-                  GrayHeight :=
-                    // Overal height of area between header and footer (InnerNotebook is smaller and not vertically centered)
-                    (WizardForm.Bevel.Top - (WizardForm.OuterNotebook.Top + GetBottom(WizardForm.Bevel1)))
-                    // Bottom padding of InnerNotebook
-                    - (WizardForm.Bevel.Top - GetBottom(WizardForm.InnerNotebook))
-                    // height occupied by link label on the bottom of InnerNotebook
-                    - SponsorLinkLabel.Height;
-
-                  SponsorImage.Top := ((GrayHeight - SponsorImage.Height) div 2) - (WizardForm.InnerNotebook.Top - GetBottom(WizardForm.Bevel1));
-                  if SponsorImage.Top < 0 then SponsorImage.Top := 0;
-                  SponsorImage.Left := (SponsorPage.Surface.Width - SponsorImage.Width) div 2;
-                  SponsorLinkLabel.Left := SponsorImage.Left;
-                  if SponsorLinkLabel.Left < 0 then SponsorLinkLabel.Left := 0;
-                  SponsoringLinkLabel.Left := GetRight(SponsorImage) - SponsoringLinkLabel.Width;
-                  if GetRight(SponsoringLinkLabel) > SponsorPage.Surface.Width then
-                    SponsoringLinkLabel.Left := SponsorPage.Surface.Width - SponsoringLinkLabel.Width;
+                  if Assigned(SponsorArea) then
+                  begin
+                    SponsorArea.Left := 0;
+                    SponsorArea.Top := 0;
+                    SponsorArea.Width := SponsorPage.Surface.Width;
+                    SponsorArea.Height := GetSponsorAreaHeight();
+                    Log(Format('Sponsor area is %dx%d', [SponsorArea.Width, SponsorArea.Height]));
+                  end;
+
+                  CenterSponsorImage;
+
                   SponsorImage.Cursor := crHand;
                   SponsorImage.Cursor := crHand;
                   SponsorImage.OnClick := @SponsorImageClick;
                   SponsorImage.OnClick := @SponsorImageClick;
+
+                  WizardForm.OnResize := @WizardFormResize;
+
                   FileSize(ImagePath, ImageSize);
                   FileSize(ImagePath, ImageSize);
-                  Log(Format('Sponsor image loaded (%d bytes, %dx%d)', [Integer(ImageSize), SponsorPage.Surface.Width, SponsorImage.Height]));
+                  Log(Format('Sponsor image loaded (%d bytes, %dx%d) and displayed (%dx%d)', [
+                    Integer(ImageSize), SponsorImage.Bitmap.Width, SponsorImage.Bitmap.Height,
+                    SponsorImage.Width, SponsorImage.Height]));
                 end;
                 end;
               end
               end
                 else
                 else

+ 85 - 4
dotnet/ComparisonDifference.cs

@@ -51,6 +51,56 @@ namespace WinSCP
             _remotePath = remotePath;
             _remotePath = remotePath;
         }
         }
 
 
+        public override string ToString()
+        {
+            string buf;
+            switch (Action)
+            {
+                case SynchronizationAction.UploadNew:
+                    buf = RemotePath.Combine(TranslateLocalPathToRemote(), "*");
+                    return $"{GetLocalPathString()} ==> {buf}";
+
+                case SynchronizationAction.DownloadNew:
+                    buf = Path.Combine(TranslateRemotePathToLocal(), "*");
+                    return $"{buf} <== {GetRemotePathString()}";
+
+                case SynchronizationAction.UploadUpdate:
+                    return $"{GetLocalPathString()} ==> {GetRemotePathString()}";
+
+                case SynchronizationAction.DownloadUpdate:
+                    return $"{GetLocalPathString()} <== {GetRemotePathString()}";
+
+                case SynchronizationAction.DeleteRemote:
+                    return $"× {GetRemotePathString()}";
+
+                case SynchronizationAction.DeleteLocal:
+                    return $"× {GetLocalPathString()}";
+
+                default:
+                    throw new InvalidOperationException();
+            }
+        }
+
+        private string TranslateRemotePathToLocal()
+        {
+            return RemotePath.TranslateRemotePathToLocal(RemotePath.GetDirectoryName(Remote.FileName), _remotePath, _localPath);
+        }
+
+        private string TranslateLocalPathToRemote()
+        {
+            return RemotePath.TranslateLocalPathToRemote(Path.GetDirectoryName(Local.FileName), _localPath, _remotePath);
+        }
+
+        private string GetRemotePathString()
+        {
+            return Remote.FileName + (IsDirectory ? "/" : string.Empty);
+        }
+
+        private string GetLocalPathString()
+        {
+            return Local.FileName + (IsDirectory ? "\\" : string.Empty);
+        }
+
         public FileOperationEventArgs Resolve(Session session, TransferOptions options = null)
         public FileOperationEventArgs Resolve(Session session, TransferOptions options = null)
         {
         {
             if (session == null)
             if (session == null)
@@ -63,8 +113,7 @@ namespace WinSCP
                 case SynchronizationAction.UploadNew:
                 case SynchronizationAction.UploadNew:
                 case SynchronizationAction.UploadUpdate:
                 case SynchronizationAction.UploadUpdate:
                     {
                     {
-                        string remoteDirectory =
-                            RemotePath.TranslateLocalPathToRemote(Path.GetDirectoryName(Local.FileName), _localPath, _remotePath);
+                        string remoteDirectory = TranslateLocalPathToRemote();
                         if (!IsDirectory)
                         if (!IsDirectory)
                         {
                         {
                             return session.PutFileToDirectory(Local.FileName, remoteDirectory, options: options);
                             return session.PutFileToDirectory(Local.FileName, remoteDirectory, options: options);
@@ -79,8 +128,7 @@ namespace WinSCP
                 case SynchronizationAction.DownloadNew:
                 case SynchronizationAction.DownloadNew:
                 case SynchronizationAction.DownloadUpdate:
                 case SynchronizationAction.DownloadUpdate:
                     {
                     {
-                        string localDirectory =
-                            RemotePath.TranslateRemotePathToLocal(RemotePath.GetDirectoryName(Remote.FileName), _remotePath, _localPath);
+                        string localDirectory = TranslateRemotePathToLocal();
                         if (!IsDirectory)
                         if (!IsDirectory)
                         {
                         {
                             return session.GetFileToDirectory(Remote.FileName, localDirectory, options: options);
                             return session.GetFileToDirectory(Remote.FileName, localDirectory, options: options);
@@ -119,6 +167,39 @@ namespace WinSCP
             }
             }
         }
         }
 
 
+        public void Reverse()
+        {
+            switch (Action)
+            {
+                case SynchronizationAction.UploadNew:
+                    Action = SynchronizationAction.DeleteLocal;
+                    break;
+
+                case SynchronizationAction.DownloadNew:
+                    Action = SynchronizationAction.DeleteRemote;
+                    break;
+
+                case SynchronizationAction.UploadUpdate:
+                    Action = SynchronizationAction.DownloadUpdate;
+                    break;
+
+                case SynchronizationAction.DownloadUpdate:
+                    Action = SynchronizationAction.UploadUpdate;
+                    break;
+
+                case SynchronizationAction.DeleteRemote:
+                    Action = SynchronizationAction.DownloadNew;
+                    break;
+
+                case SynchronizationAction.DeleteLocal:
+                    Action = SynchronizationAction.UploadNew;
+                    break;
+
+                default:
+                    throw new InvalidOperationException();
+            }
+        }
+
         private readonly string _localPath;
         private readonly string _localPath;
         private readonly string _remotePath;
         private readonly string _remotePath;
     }
     }

+ 154 - 161
dotnet/GlobalSuppressions.cs

@@ -10,166 +10,159 @@
 
 
 using System.Diagnostics.CodeAnalysis;
 using System.Diagnostics.CodeAnalysis;
 
 
-[assembly: SuppressMessage("Microsoft.Design", "CA1032:ImplementStandardExceptionConstructors", Scope = "type", Target = "WinSCP.SessionException")]
-[assembly: SuppressMessage("Microsoft.Design", "CA1032:ImplementStandardExceptionConstructors", Scope = "type", Target = "WinSCP.SessionLocalException")]
-[assembly: SuppressMessage("Microsoft.Design", "CA1032:ImplementStandardExceptionConstructors", Scope = "type", Target = "WinSCP.SessionRemoteException")]
-[assembly: SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Scope = "member", Target = "WinSCP.ElementLogReader.#Dispose()")]
-[assembly: SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Scope = "member", Target = "WinSCP.Session.#Cleanup()")]
-[assembly: SuppressMessage("Microsoft.Naming", "CA1714:FlagsEnumsShouldHavePluralNames", Scope = "type", Target = "WinSCP.SynchronizationCriteria")]
-[assembly: SuppressMessage("Microsoft.Security", "CA2122:DoNotIndirectlyExposeMethodsWithLinkDemands", Scope = "member", Target = "WinSCP.Session.#Cleanup()")]
-[assembly: SuppressMessage("Microsoft.Security", "CA2122:DoNotIndirectlyExposeMethodsWithLinkDemands", Scope = "member", Target = "WinSCP.Session.#Open(WinSCP.SessionOptions)")]
-[assembly: SuppressMessage("Microsoft.Security", "CA2122:DoNotIndirectlyExposeMethodsWithLinkDemands", Scope = "member", Target = "WinSCP.Session.#WriteCommand(System.String)")]
+[assembly: SuppressMessage("Microsoft.Design", "CA1032:ImplementStandardExceptionConstructors", Scope = "type", Target = "~T:WinSCP.SessionException")]
+[assembly: SuppressMessage("Microsoft.Design", "CA1032:ImplementStandardExceptionConstructors", Scope = "type", Target = "~T:WinSCP.SessionLocalException")]
+[assembly: SuppressMessage("Microsoft.Design", "CA1032:ImplementStandardExceptionConstructors", Scope = "type", Target = "~T:WinSCP.SessionRemoteException")]
+[assembly: SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Scope = "member", Target = "~M:WinSCP.ElementLogReader.Dispose")]
+[assembly: SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Scope = "member", Target = "~M:WinSCP.Session.Cleanup")]
+[assembly: SuppressMessage("Microsoft.Naming", "CA1714:FlagsEnumsShouldHavePluralNames", Scope = "type", Target = "~T:WinSCP.SynchronizationCriteria")]
+[assembly: SuppressMessage("Microsoft.Security", "CA2122:DoNotIndirectlyExposeMethodsWithLinkDemands", Scope = "member", Target = "~M:WinSCP.Session.Cleanup")]
+[assembly: SuppressMessage("Microsoft.Security", "CA2122:DoNotIndirectlyExposeMethodsWithLinkDemands", Scope = "member", Target = "~M:WinSCP.Session.Open(WinSCP.SessionOptions)")]
+[assembly: SuppressMessage("Microsoft.Security", "CA2122:DoNotIndirectlyExposeMethodsWithLinkDemands", Scope = "member", Target = "~M:WinSCP.Session.WriteCommand(System.String)")]
 [assembly: SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "SCP")]
 [assembly: SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "SCP")]
-[assembly: SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "SCP", Scope = "namespace", Target = "WinSCP")]
-[assembly: SuppressMessage("Microsoft.Reliability", "CA2000:Dispose objects before losing scope", Scope = "member", Target = "WinSCP.Session.#Open(WinSCP.SessionOptions)")]
-[assembly: SuppressMessage("Microsoft.Usage", "CA2237:MarkISerializableTypesWithSerializable", Scope = "type", Target = "WinSCP.SessionLocalException")]
-[assembly: SuppressMessage("Microsoft.Usage", "CA2237:MarkISerializableTypesWithSerializable", Scope = "type", Target = "WinSCP.SessionRemoteException")]
-[assembly: SuppressMessage("Microsoft.Usage", "CA2237:MarkISerializableTypesWithSerializable", Scope = "type", Target = "WinSCP.SessionException")]
+[assembly: SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "SCP", Scope = "namespace", Target = "~N:WinSCP")]
+[assembly: SuppressMessage("Microsoft.Reliability", "CA2000:Dispose objects before losing scope", Scope = "member", Target = "~M:WinSCP.Session.Open(WinSCP.SessionOptions)")]
+[assembly: SuppressMessage("Microsoft.Usage", "CA2237:MarkISerializableTypesWithSerializable", Scope = "type", Target = "~T:WinSCP.SessionLocalException")]
+[assembly: SuppressMessage("Microsoft.Usage", "CA2237:MarkISerializableTypesWithSerializable", Scope = "type", Target = "~T:WinSCP.SessionRemoteException")]
+[assembly: SuppressMessage("Microsoft.Usage", "CA2237:MarkISerializableTypesWithSerializable", Scope = "type", Target = "~T:WinSCP.SessionException")]
 [assembly: SuppressMessage("Microsoft.Design", "CA2210:AssembliesShouldHaveValidStrongNames")]
 [assembly: SuppressMessage("Microsoft.Design", "CA2210:AssembliesShouldHaveValidStrongNames")]
-[assembly: SuppressMessage("Microsoft.Interoperability", "CA1408:DoNotUseAutoDualClassInterfaceType", Scope = "type", Target = "WinSCP.ChmodEventArgs")]
-[assembly: SuppressMessage("Microsoft.Interoperability", "CA1408:DoNotUseAutoDualClassInterfaceType", Scope = "type", Target = "WinSCP.CommandExecutionResult")]
-[assembly: SuppressMessage("Microsoft.Interoperability", "CA1408:DoNotUseAutoDualClassInterfaceType", Scope = "type", Target = "WinSCP.FailedEventArgs")]
-[assembly: SuppressMessage("Microsoft.Interoperability", "CA1408:DoNotUseAutoDualClassInterfaceType", Scope = "type", Target = "WinSCP.FileOperationEventArgs")]
-[assembly: SuppressMessage("Microsoft.Interoperability", "CA1408:DoNotUseAutoDualClassInterfaceType", Scope = "type", Target = "WinSCP.FilePermissions")]
-[assembly: SuppressMessage("Microsoft.Interoperability", "CA1408:DoNotUseAutoDualClassInterfaceType", Scope = "type", Target = "WinSCP.OperationEventArgs")]
-[assembly: SuppressMessage("Microsoft.Interoperability", "CA1408:DoNotUseAutoDualClassInterfaceType", Scope = "type", Target = "WinSCP.OperationResultBase")]
-[assembly: SuppressMessage("Microsoft.Interoperability", "CA1408:DoNotUseAutoDualClassInterfaceType", Scope = "type", Target = "WinSCP.RemoteFileInfo")]
-[assembly: SuppressMessage("Microsoft.Interoperability", "CA1408:DoNotUseAutoDualClassInterfaceType", Scope = "type", Target = "WinSCP.RemovalEventArgs")]
-[assembly: SuppressMessage("Microsoft.Interoperability", "CA1408:DoNotUseAutoDualClassInterfaceType", Scope = "type", Target = "WinSCP.RemovalOperationResult")]
-[assembly: SuppressMessage("Microsoft.Interoperability", "CA1408:DoNotUseAutoDualClassInterfaceType", Scope = "type", Target = "WinSCP.Session")]
-[assembly: SuppressMessage("Microsoft.Interoperability", "CA1408:DoNotUseAutoDualClassInterfaceType", Scope = "type", Target = "WinSCP.SessionException")]
-[assembly: SuppressMessage("Microsoft.Interoperability", "CA1408:DoNotUseAutoDualClassInterfaceType", Scope = "type", Target = "WinSCP.SessionLocalException")]
-[assembly: SuppressMessage("Microsoft.Interoperability", "CA1408:DoNotUseAutoDualClassInterfaceType", Scope = "type", Target = "WinSCP.SessionOptions")]
-[assembly: SuppressMessage("Microsoft.Interoperability", "CA1408:DoNotUseAutoDualClassInterfaceType", Scope = "type", Target = "WinSCP.SessionRemoteException")]
-[assembly: SuppressMessage("Microsoft.Interoperability", "CA1408:DoNotUseAutoDualClassInterfaceType", Scope = "type", Target = "WinSCP.SynchronizationResult")]
-[assembly: SuppressMessage("Microsoft.Interoperability", "CA1408:DoNotUseAutoDualClassInterfaceType", Scope = "type", Target = "WinSCP.TouchEventArgs")]
-[assembly: SuppressMessage("Microsoft.Interoperability", "CA1408:DoNotUseAutoDualClassInterfaceType", Scope = "type", Target = "WinSCP.TransferEventArgs")]
-[assembly: SuppressMessage("Microsoft.Interoperability", "CA1408:DoNotUseAutoDualClassInterfaceType", Scope = "type", Target = "WinSCP.TransferOperationResult")]
-[assembly: SuppressMessage("Microsoft.Interoperability", "CA1408:DoNotUseAutoDualClassInterfaceType", Scope = "type", Target = "WinSCP.TransferOptions")]
-[assembly: SuppressMessage("Microsoft.Interoperability", "CA1409:ComVisibleTypesShouldBeCreatable", Scope = "type", Target = "WinSCP.ChmodEventArgs")]
-[assembly: SuppressMessage("Microsoft.Interoperability", "CA1409:ComVisibleTypesShouldBeCreatable", Scope = "type", Target = "WinSCP.CommandExecutionResult")]
-[assembly: SuppressMessage("Microsoft.Interoperability", "CA1409:ComVisibleTypesShouldBeCreatable", Scope = "type", Target = "WinSCP.FailedEventArgs")]
-[assembly: SuppressMessage("Microsoft.Interoperability", "CA1409:ComVisibleTypesShouldBeCreatable", Scope = "type", Target = "WinSCP.FileOperationEventArgs")]
-[assembly: SuppressMessage("Microsoft.Interoperability", "CA1409:ComVisibleTypesShouldBeCreatable", Scope = "type", Target = "WinSCP.OperationEventArgs")]
-[assembly: SuppressMessage("Microsoft.Interoperability", "CA1409:ComVisibleTypesShouldBeCreatable", Scope = "type", Target = "WinSCP.OperationResultBase")]
-[assembly: SuppressMessage("Microsoft.Interoperability", "CA1409:ComVisibleTypesShouldBeCreatable", Scope = "type", Target = "WinSCP.RemoteFileInfo")]
-[assembly: SuppressMessage("Microsoft.Interoperability", "CA1409:ComVisibleTypesShouldBeCreatable", Scope = "type", Target = "WinSCP.RemovalEventArgs")]
-[assembly: SuppressMessage("Microsoft.Interoperability", "CA1409:ComVisibleTypesShouldBeCreatable", Scope = "type", Target = "WinSCP.RemovalOperationResult")]
-[assembly: SuppressMessage("Microsoft.Interoperability", "CA1409:ComVisibleTypesShouldBeCreatable", Scope = "type", Target = "WinSCP.SessionException")]
-[assembly: SuppressMessage("Microsoft.Interoperability", "CA1409:ComVisibleTypesShouldBeCreatable", Scope = "type", Target = "WinSCP.SessionLocalException")]
-[assembly: SuppressMessage("Microsoft.Interoperability", "CA1409:ComVisibleTypesShouldBeCreatable", Scope = "type", Target = "WinSCP.SessionRemoteException")]
-[assembly: SuppressMessage("Microsoft.Interoperability", "CA1409:ComVisibleTypesShouldBeCreatable", Scope = "type", Target = "WinSCP.SynchronizationResult")]
-[assembly: SuppressMessage("Microsoft.Interoperability", "CA1409:ComVisibleTypesShouldBeCreatable", Scope = "type", Target = "WinSCP.TouchEventArgs")]
-[assembly: SuppressMessage("Microsoft.Interoperability", "CA1409:ComVisibleTypesShouldBeCreatable", Scope = "type", Target = "WinSCP.TransferEventArgs")]
-[assembly: SuppressMessage("Microsoft.Interoperability", "CA1409:ComVisibleTypesShouldBeCreatable", Scope = "type", Target = "WinSCP.TransferOperationResult")]
-[assembly: SuppressMessage("Microsoft.Design", "CA1003:UseGenericEventHandlerInstances", Scope = "type", Target = "WinSCP.FailedEventHandler")]
-[assembly: SuppressMessage("Microsoft.Design", "CA1003:UseGenericEventHandlerInstances", Scope = "type", Target = "WinSCP.FileTransferredEventHandler")]
-[assembly: SuppressMessage("Microsoft.Interoperability", "CA1409:ComVisibleTypesShouldBeCreatable", Scope = "type", Target = "WinSCP.RemoteDirectoryInfo")]
-[assembly: SuppressMessage("Microsoft.Interoperability", "CA1408:DoNotUseAutoDualClassInterfaceType", Scope = "type", Target = "WinSCP.RemoteDirectoryInfo")]
-[assembly: SuppressMessage("Microsoft.Interoperability", "CA1408:DoNotUseAutoDualClassInterfaceType", Scope = "type", Target = "WinSCP.RemoteFileInfoCollection")]
-[assembly: SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId = "index", Scope = "member", Target = "WinSCP.ReadOnlyInteropCollectionHelper`1.#Item[System.Int32]")]
-[assembly: SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId = "value", Scope = "member", Target = "WinSCP.ReadOnlyInteropCollectionHelper`1.#Item[System.Int32]")]
-[assembly: SuppressMessage("Microsoft.Interoperability", "CA1408:DoNotUseAutoDualClassInterfaceType", Scope = "type", Target = "WinSCP.RemovalEventArgsCollection")]
-[assembly: SuppressMessage("Microsoft.Interoperability", "CA1408:DoNotUseAutoDualClassInterfaceType", Scope = "type", Target = "WinSCP.SessionRemoteExceptionCollection")]
-[assembly: SuppressMessage("Microsoft.Interoperability", "CA1408:DoNotUseAutoDualClassInterfaceType", Scope = "type", Target = "WinSCP.StringCollection")]
-[assembly: SuppressMessage("Microsoft.Interoperability", "CA1408:DoNotUseAutoDualClassInterfaceType", Scope = "type", Target = "WinSCP.TransferEventArgsCollection")]
-[assembly: SuppressMessage("Microsoft.Security", "CA2122:DoNotIndirectlyExposeMethodsWithLinkDemands", Scope = "member", Target = "WinSCP.Session.#CheckVersion(System.String,System.Diagnostics.FileVersionInfo,System.String)")]
-[assembly: SuppressMessage("Microsoft.Security", "CA2122:DoNotIndirectlyExposeMethodsWithLinkDemands", Scope = "member", Target = "WinSCP.Session.#CheckVersions(System.String)")]
-[assembly: SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Scope = "member", Target = "WinSCP.Logger.#WriteLine(System.String)")]
-[assembly: SuppressMessage("Microsoft.Security", "CA2122:DoNotIndirectlyExposeMethodsWithLinkDemands", Scope = "member", Target = "WinSCP.Logger.#WriteEnvironmentInfo()")]
-[assembly: SuppressMessage("Microsoft.Design", "CA1003:UseGenericEventHandlerInstances", Scope = "type", Target = "WinSCP.OutputDataReceivedEventHandler")]
-[assembly: SuppressMessage("Microsoft.Security", "CA2122:DoNotIndirectlyExposeMethodsWithLinkDemands", Scope = "member", Target = "WinSCP.ExeSessionProcess.#.ctor(WinSCP.Session,System.Boolean,System.String)")]
-[assembly: SuppressMessage("Microsoft.Reliability", "CA2000:Dispose objects before losing scope", Scope = "member", Target = "WinSCP.ExeSessionProcess.#CreateEvent(System.String)")]
-[assembly: SuppressMessage("Microsoft.Reliability", "CA2006:UseSafeHandleToEncapsulateNativeResources", Scope = "member", Target = "WinSCP.ConsoleCommStruct.#_ptr")]
-[assembly: SuppressMessage("Microsoft.Reliability", "CA2000:Dispose objects before losing scope", Scope = "member", Target = "WinSCP.ExeSessionProcess.#InitializeConsole()")]
-[assembly: SuppressMessage("Microsoft.Security", "CA2122:DoNotIndirectlyExposeMethodsWithLinkDemands", Scope = "member", Target = "WinSCP.ExeSessionProcess.#InitializeChild()")]
-[assembly: SuppressMessage("Microsoft.Security", "CA2122:DoNotIndirectlyExposeMethodsWithLinkDemands", Scope = "member", Target = "WinSCP.ExeSessionProcess.#InitializeConsole()")]
-[assembly: SuppressMessage("Microsoft.Security", "CA2122:DoNotIndirectlyExposeMethodsWithLinkDemands", Scope = "member", Target = "WinSCP.ExeSessionProcess.#HasExited")]
-[assembly: SuppressMessage("Microsoft.Security", "CA2122:DoNotIndirectlyExposeMethodsWithLinkDemands", Scope = "member", Target = "WinSCP.ExeSessionProcess.#ExitCode")]
-[assembly: SuppressMessage("Microsoft.Security", "CA2122:DoNotIndirectlyExposeMethodsWithLinkDemands", Scope = "member", Target = "WinSCP.ExeSessionProcess.#Dispose()")]
-[assembly: SuppressMessage("Microsoft.Security", "CA2122:DoNotIndirectlyExposeMethodsWithLinkDemands", Scope = "member", Target = "WinSCP.ExeSessionProcess.#Close()")]
-[assembly: SuppressMessage("Microsoft.Security", "CA2122:DoNotIndirectlyExposeMethodsWithLinkDemands", Scope = "member", Target = "WinSCP.ConsoleCommStruct.#Size")]
-[assembly: SuppressMessage("Microsoft.Security", "CA2122:DoNotIndirectlyExposeMethodsWithLinkDemands", Scope = "member", Target = "WinSCP.ConsoleCommStruct.#.ctor(WinSCP.Session,Microsoft.Win32.SafeHandles.SafeFileHandle)")]
-[assembly: SuppressMessage("Microsoft.Security", "CA2122:DoNotIndirectlyExposeMethodsWithLinkDemands", Scope = "member", Target = "WinSCP.Session.#CheckVersion(System.String,System.Diagnostics.FileVersionInfo)")]
-[assembly: SuppressMessage("Microsoft.Security", "CA2111:PointersShouldNotBeVisible", Scope = "member", Target = "WinSCP.SECURITY_ATTRIBUTES.#lpSecurityDescriptor")]
-[assembly: SuppressMessage("Microsoft.Reliability", "CA2006:UseSafeHandleToEncapsulateNativeResources", Scope = "member", Target = "WinSCP.Job.#_handle")]
-[assembly: SuppressMessage("Microsoft.Usage", "CA1806:DoNotIgnoreMethodResults", MessageId = "WinSCP.UnsafeNativeMethods.CloseHandle(System.IntPtr)", Scope = "member", Target = "WinSCP.Job.#Close()")]
-[assembly: SuppressMessage("Microsoft.Security", "CA2122:DoNotIndirectlyExposeMethodsWithLinkDemands", Scope = "member", Target = "WinSCP.Job.#.ctor()")]
-[assembly: SuppressMessage("Microsoft.Interoperability", "CA1409:ComVisibleTypesShouldBeCreatable", Scope = "type", Target = "WinSCP.OutputDataReceivedEventArgs")]
-[assembly: SuppressMessage("Microsoft.Interoperability", "CA1408:DoNotUseAutoDualClassInterfaceType", Scope = "type", Target = "WinSCP.OutputDataReceivedEventArgs")]
-[assembly: SuppressMessage("Microsoft.Security", "CA2122:DoNotIndirectlyExposeMethodsWithLinkDemands", Scope = "member", Target = "WinSCP.ExeSessionProcess.#CheckVersion(System.String,System.Diagnostics.FileVersionInfo)")]
-[assembly: SuppressMessage("Microsoft.Security", "CA2122:DoNotIndirectlyExposeMethodsWithLinkDemands", Scope = "member", Target = "WinSCP.ExeSessionProcess.#.ctor(WinSCP.Session)")]
-[assembly: SuppressMessage("Microsoft.Maintainability", "CA1506:AvoidExcessiveClassCoupling", Scope = "type", Target = "WinSCP.Session")]
-[assembly: SuppressMessage("Microsoft.Globalization", "CA1303:Do not pass literals as localized parameters", MessageId = "WinSCP.Logger.WriteLine(System.String)", Scope = "member", Target = "WinSCP.Session.#System.Reflection.IReflect.InvokeMember(System.String,System.Reflection.BindingFlags,System.Reflection.Binder,System.Object,System.Object[],System.Reflection.ParameterModifier[],System.Globalization.CultureInfo,System.String[])")]
-[assembly: SuppressMessage("Microsoft.Globalization", "CA1303:Do not pass literals as localized parameters", MessageId = "WinSCP.Logger.WriteLine(System.String)", Scope = "member", Target = "WinSCP.ExeSessionProcess.#CheckVersion(System.String,System.Diagnostics.FileVersionInfo)")]
-[assembly: SuppressMessage("Microsoft.Globalization", "CA1303:Do not pass literals as localized parameters", MessageId = "WinSCP.Logger.WriteLine(System.String)", Scope = "member", Target = "WinSCP.Session.#Cleanup()")]
-[assembly: SuppressMessage("Microsoft.Globalization", "CA1303:Do not pass literals as localized parameters", MessageId = "WinSCP.Logger.WriteLine(System.String)", Scope = "member", Target = "WinSCP.Logger.#Dispose()")]
-[assembly: SuppressMessage("Microsoft.Globalization", "CA1303:Do not pass literals as localized parameters", MessageId = "WinSCP.Logger.WriteLine(System.String)", Scope = "member", Target = "WinSCP.SessionLogReader.#OpenLog()")]
-[assembly: SuppressMessage("Microsoft.Globalization", "CA1303:Do not pass literals as localized parameters", MessageId = "WinSCP.Logger.WriteLine(System.String)", Scope = "member", Target = "WinSCP.ExeSessionProcess.#Close()")]
-[assembly: SuppressMessage("Microsoft.Globalization", "CA1303:Do not pass literals as localized parameters", MessageId = "WinSCP.Logger.WriteLine(System.String)", Scope = "member", Target = "WinSCP.SessionLogReader.#LogContents()")]
-[assembly: SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Scope = "member", Target = "WinSCP.SessionLogReader.#LogContents()")]
-[assembly: SuppressMessage("Microsoft.Globalization", "CA1303:Do not pass literals as localized parameters", MessageId = "WinSCP.Logger.WriteLine(System.String)", Scope = "member", Target = "WinSCP.ElementLogReader.#Dispose()")]
-[assembly: SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Scope = "member", Target = "WinSCP.Logger.#.ctor()")]
-[assembly: SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Scope = "member", Target = "WinSCP.Logger.#Dispose()")]
-[assembly: SuppressMessage("Microsoft.Security", "CA2122:DoNotIndirectlyExposeMethodsWithLinkDemands", Scope = "member", Target = "WinSCP.ExeSessionProcess.#Abort()")]
-[assembly: SuppressMessage("Microsoft.Usage", "CA2201:DoNotRaiseReservedExceptionTypes", Scope = "member", Target = "WinSCP.Logger.#GetAssemblyFilePath()")]
-[assembly: SuppressMessage("Microsoft.Globalization", "CA1303:Do not pass literals as localized parameters", MessageId = "WinSCP.Logger.WriteLine(System.String)", Scope = "member", Target = "WinSCP.ExeSessionProcess.#AbortedOrExited()")]
-[assembly: SuppressMessage("Microsoft.Globalization", "CA1303:Do not pass literals as localized parameters", MessageId = "WinSCP.Logger.WriteLine(System.String)", Scope = "member", Target = "WinSCP.SessionLogReader.#DoRead()")]
-[assembly: SuppressMessage("Microsoft.Globalization", "CA1303:Do not pass literals as localized parameters", MessageId = "WinSCP.Logger.WriteLine(System.String)", Scope = "member", Target = "WinSCP.SessionLogReader.#Cleanup()")]
-[assembly: SuppressMessage("Microsoft.Security", "CA2122:DoNotIndirectlyExposeMethodsWithLinkDemands", Scope = "member", Target = "WinSCP.Session.#GetTempPath()")]
-[assembly: SuppressMessage("Microsoft.Security", "CA2122:DoNotIndirectlyExposeMethodsWithLinkDemands", Scope = "member", Target = "WinSCP.Session.#SetupTempPath()")]
-[assembly: SuppressMessage("Microsoft.Globalization", "CA1303:Do not pass literals as localized parameters", MessageId = "WinSCP.Logger.WriteLine(System.String)", Scope = "member", Target = "WinSCP.Logger.#GetAssemblyFilePath()")]
-[assembly: SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "CPS", Scope = "member", Target = "WinSCP.FileTransferProgressEventArgs.#CPS")]
-[assembly: SuppressMessage("Microsoft.Interoperability", "CA1409:ComVisibleTypesShouldBeCreatable", Scope = "type", Target = "WinSCP.FileTransferProgressEventArgs")]
-[assembly: SuppressMessage("Microsoft.Design", "CA1003:UseGenericEventHandlerInstances", Scope = "type", Target = "WinSCP.FileTransferProgressEventHandler")]
-[assembly: SuppressMessage("Microsoft.Security", "CA5122:PInvokesShouldNotBeSafeCriticalFxCopRule", Scope = "member", Target = "WinSCP.UnsafeNativeMethods.#CreateFileMapping(Microsoft.Win32.SafeHandles.SafeFileHandle,System.IntPtr,System.Int32,System.Int32,System.Int32,System.String)", Justification = "Warning is bogus.")]
-[assembly: SuppressMessage("Microsoft.Security", "CA5122:PInvokesShouldNotBeSafeCriticalFxCopRule", Scope = "member", Target = "WinSCP.UnsafeNativeMethods.#MapViewOfFile(Microsoft.Win32.SafeHandles.SafeFileHandle,System.Int32,System.UInt32,System.UInt32,System.UIntPtr)", Justification = "Warning is bogus.")]
-[assembly: SuppressMessage("Microsoft.Security", "CA5122:PInvokesShouldNotBeSafeCriticalFxCopRule", Scope = "member", Target = "WinSCP.UnsafeNativeMethods.#UnmapViewOfFile(System.IntPtr)", Justification = "Warning is bogus.")]
-[assembly: SuppressMessage("Microsoft.Security", "CA5122:PInvokesShouldNotBeSafeCriticalFxCopRule", Scope = "member", Target = "WinSCP.UnsafeNativeMethods.#CloseHandle(System.IntPtr)", Justification = "Warning is bogus.")]
-[assembly: SuppressMessage("Microsoft.Security", "CA5122:PInvokesShouldNotBeSafeCriticalFxCopRule", Scope = "member", Target = "WinSCP.UnsafeNativeMethods.#CreateJobObject(System.IntPtr,System.String)", Justification = "Warning is bogus.")]
-[assembly: SuppressMessage("Microsoft.Security", "CA5122:PInvokesShouldNotBeSafeCriticalFxCopRule", Scope = "member", Target = "WinSCP.UnsafeNativeMethods.#SetInformationJobObject(System.IntPtr,WinSCP.JobObjectInfoType,System.IntPtr,System.UInt32)", Justification = "Warning is bogus.")]
-[assembly: SuppressMessage("Microsoft.Interoperability", "CA1409:ComVisibleTypesShouldBeCreatable", Scope = "type", Target = "WinSCP.TransferResumeSupport")]
-[assembly: SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Scope = "member", Target = "WinSCP.Logger.#CreateCounters()")]
-[assembly: SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Scope = "member", Target = "WinSCP.Logger.#WriteCounters()")]
-[assembly: SuppressMessage("Microsoft.Security", "CA2122:DoNotIndirectlyExposeMethodsWithLinkDemands", Scope = "member", Target = "WinSCP.Logger.#WriteProcesses()")]
-[assembly: SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Scope = "member", Target = "WinSCP.Logger.#WriteProcesses()")]
-[assembly: SuppressMessage("Microsoft.Security", "CA2122:DoNotIndirectlyExposeMethodsWithLinkDemands", Scope = "member", Target = "WinSCP.Logger.#GetProcessStartTime(System.Diagnostics.Process)")]
-[assembly: SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Scope = "member", Target = "WinSCP.Logger.#GetProcessStartTime(System.Diagnostics.Process)")]
-[assembly: SuppressMessage("Microsoft.Security", "CA2122:DoNotIndirectlyExposeMethodsWithLinkDemands", Scope = "member", Target = "WinSCP.Logger.#GetTotalProcessorTime(System.Diagnostics.Process)")]
-[assembly: SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Scope = "member", Target = "WinSCP.Logger.#GetTotalProcessorTime(System.Diagnostics.Process)")]
-[assembly: SuppressMessage("Microsoft.Usage", "CA2217:DoNotMarkEnumsWithFlags", Scope = "type", Target = "WinSCP.FileMapAccess")]
-[assembly: SuppressMessage("Microsoft.Security", "CA5122:PInvokesShouldNotBeSafeCriticalFxCopRule", Scope = "member", Target = "WinSCP.UnsafeNativeMethods.#CreateFileMapping(Microsoft.Win32.SafeHandles.SafeFileHandle,System.IntPtr,WinSCP.FileMapProtection,System.Int32,System.Int32,System.String)")]
-[assembly: SuppressMessage("Microsoft.Security", "CA5122:PInvokesShouldNotBeSafeCriticalFxCopRule", Scope = "member", Target = "WinSCP.UnsafeNativeMethods.#MapViewOfFile(Microsoft.Win32.SafeHandles.SafeFileHandle,WinSCP.FileMapAccess,System.UInt32,System.UInt32,System.UIntPtr)")]
-[assembly: SuppressMessage("Microsoft.Interoperability", "CA1404:CallGetLastErrorImmediatelyAfterPInvoke", Scope = "member", Target = "WinSCP.ExeSessionProcess.#InitializeConsole()")]
-[assembly: SuppressMessage("Microsoft.Interoperability", "CA1404:CallGetLastErrorImmediatelyAfterPInvoke", Scope = "member", Target = "WinSCP.ExeSessionProcess.#Dispose()")]
-[assembly: SuppressMessage("Microsoft.Security", "CA2122:DoNotIndirectlyExposeMethodsWithLinkDemands", Scope = "member", Target = "WinSCP.Job.#.ctor(WinSCP.Logger,System.String)")]
-[assembly: SuppressMessage("Microsoft.Security", "CA2122:DoNotIndirectlyExposeMethodsWithLinkDemands", Scope = "member", Target = "WinSCP.Logger.#LastWin32ErrorMessage()")]
-[assembly: SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Scope = "member", Target = "WinSCP.Session.#GuardProcessWithJobInternal")]
-[assembly: SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Scope = "member", Target = "WinSCP.Session.#TestHandlesClosedInternal")]
-[assembly: SuppressMessage("Microsoft.Security", "CA2122:DoNotIndirectlyExposeMethodsWithLinkDemands", Scope = "member", Target = "WinSCP.ExeSessionProcess.#TryCreateEvent(System.String,System.Threading.EventWaitHandle&)")]
-[assembly: SuppressMessage("Microsoft.Reliability", "CA2001:AvoidCallingProblematicMethods", MessageId = "System.Runtime.InteropServices.SafeHandle.DangerousGetHandle", Scope = "member", Target = "WinSCP.ExeSessionProcess.#TryCreateEvent(System.String,System.Threading.EventWaitHandle&)")]
-[assembly: SuppressMessage("Microsoft.Security", "CA2122:DoNotIndirectlyExposeMethodsWithLinkDemands", Scope = "member", Target = "WinSCP.SessionOptions.#GetPassword(System.Security.SecureString)")]
-[assembly: SuppressMessage("Microsoft.Design", "CA1054:UriParametersShouldNotBeStrings", MessageId = "0#", Scope = "member", Target = "WinSCP.SessionOptions.#ParseUrl(System.String)")]
-[assembly: SuppressMessage("Microsoft.Security", "CA2122:DoNotIndirectlyExposeMethodsWithLinkDemands", Scope = "member", Target = "WinSCP.ExeSessionProcess+NoopSafeHandle.#.ctor(System.IntPtr)")]
-[assembly: SuppressMessage("Microsoft.Security", "CA2122:DoNotIndirectlyExposeMethodsWithLinkDemands", Scope = "member", Target = "WinSCP.ExeSessionProcess.#CreateFileMapping(System.String)")]
-[assembly: SuppressMessage("Microsoft.Security", "CA5122:PInvokesShouldNotBeSafeCriticalFxCopRule", Scope = "member", Target = "WinSCP.UnsafeNativeMethods.#GetProcessWindowStation()")]
-[assembly: SuppressMessage("Microsoft.Security", "CA5122:PInvokesShouldNotBeSafeCriticalFxCopRule", Scope = "member", Target = "WinSCP.UnsafeNativeMethods.#GetThreadDesktop(System.Int32)")]
-[assembly: SuppressMessage("Microsoft.Security", "CA5122:PInvokesShouldNotBeSafeCriticalFxCopRule", Scope = "member", Target = "WinSCP.UnsafeNativeMethods.#GetCurrentThreadId()")]
-[assembly: SuppressMessage("Microsoft.Reliability", "CA2000:Dispose objects before losing scope", Scope = "member", Target = "WinSCP.ExeSessionProcess.#CreateFileMapping(System.String)")]
-[assembly: SuppressMessage("Microsoft.Reliability", "CA2000:Dispose objects before losing scope", Scope = "member", Target = "WinSCP.Logger.#CreateCounters()")]
-[assembly: SuppressMessage("Microsoft.Reliability", "CA2000:Dispose objects before losing scope", Scope = "member", Target = "WinSCP.SessionLogReader.#LogContents()")]
-[assembly: SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "member", Target = "WinSCP.Session.#SessionOptionsToSwitches(WinSCP.SessionOptions,System.Boolean,System.String&,System.String&)")]
-[assembly: SuppressMessage("Microsoft.Security", "CA5122:PInvokesShouldNotBeSafeCriticalFxCopRule", Scope = "member", Target = "WinSCP.UnsafeNativeMethods.#RegGetValue(System.UIntPtr,System.String,System.String,WinSCP.RegistryFlags,WinSCP.RegistryType&,System.IntPtr,System.UInt32&)")]
-[assembly: SuppressMessage("Microsoft.Security", "CA2122:DoNotIndirectlyExposeMethodsWithLinkDemands", Scope = "member", Target = "WinSCP.ExeSessionProcess.#GetInstallationPath(Microsoft.Win32.RegistryHive,Microsoft.Win32.RegistryKey)")]
-[assembly: SuppressMessage("Microsoft.Globalization", "CA1303:Do not pass literals as localized parameters", MessageId = "WinSCP.Logger.DoWriteLine(System.String)", Scope = "member", Target = "WinSCP.Logger.#WriteException(System.Exception)")]
-[assembly: SuppressMessage("Microsoft.Interoperability", "CA1407:AvoidStaticMembersInComVisibleTypes", Scope = "member", Target = "WinSCP.RemotePath.#CombinePaths(System.String,System.String)")]
-[assembly: SuppressMessage("Microsoft.Interoperability", "CA1407:AvoidStaticMembersInComVisibleTypes", Scope = "member", Target = "WinSCP.RemotePath.#EscapeFileMask(System.String)")]
-[assembly: SuppressMessage("Microsoft.Interoperability", "CA1407:AvoidStaticMembersInComVisibleTypes", Scope = "member", Target = "WinSCP.RemotePath.#TranslateRemotePathToLocal(System.String,System.String,System.String)")]
-[assembly: SuppressMessage("Microsoft.Interoperability", "CA1407:AvoidStaticMembersInComVisibleTypes", Scope = "member", Target = "WinSCP.RemotePath.#TranslateLocalPathToRemote(System.String,System.String,System.String)")]
-[assembly: SuppressMessage("Microsoft.Interoperability", "CA1407:AvoidStaticMembersInComVisibleTypes", Scope = "member", Target = "WinSCP.RemotePath.#GetDirectoryName(System.String)")]
-[assembly: SuppressMessage("Microsoft.Interoperability", "CA1407:AvoidStaticMembersInComVisibleTypes", Scope = "member", Target = "WinSCP.RemotePath.#AddDirectorySeparator(System.String)")]
-[assembly: SuppressMessage("Microsoft.Interoperability", "CA1407:AvoidStaticMembersInComVisibleTypes", Scope = "member", Target = "WinSCP.RemotePath.#GetFileName(System.String)")]
-[assembly: SuppressMessage("Microsoft.Interoperability", "CA1409:ComVisibleTypesShouldBeCreatable", Scope = "type", Target = "WinSCP.QueryReceivedEventArgs")]
-[assembly: SuppressMessage("Microsoft.Design", "CA1003:UseGenericEventHandlerInstances", Scope = "type", Target = "WinSCP.QueryReceivedEventHandler")]
-[assembly: SuppressMessage("Microsoft.Security", "CA2122:DoNotIndirectlyExposeMethodsWithLinkDemands", Scope = "member", Target = "WinSCP.ExeSessionProcess.#RequestCallstack()")]
-[assembly: SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Scope = "member", Target = "WinSCP.ExeSessionProcess.#RequestCallstack()")]
+[assembly: SuppressMessage("Microsoft.Interoperability", "CA1408:DoNotUseAutoDualClassInterfaceType", Scope = "type", Target = "~T:WinSCP.ChmodEventArgs")]
+[assembly: SuppressMessage("Microsoft.Interoperability", "CA1408:DoNotUseAutoDualClassInterfaceType", Scope = "type", Target = "~T:WinSCP.CommandExecutionResult")]
+[assembly: SuppressMessage("Microsoft.Interoperability", "CA1408:DoNotUseAutoDualClassInterfaceType", Scope = "type", Target = "~T:WinSCP.FailedEventArgs")]
+[assembly: SuppressMessage("Microsoft.Interoperability", "CA1408:DoNotUseAutoDualClassInterfaceType", Scope = "type", Target = "~T:WinSCP.FileOperationEventArgs")]
+[assembly: SuppressMessage("Microsoft.Interoperability", "CA1408:DoNotUseAutoDualClassInterfaceType", Scope = "type", Target = "~T:WinSCP.FilePermissions")]
+[assembly: SuppressMessage("Microsoft.Interoperability", "CA1408:DoNotUseAutoDualClassInterfaceType", Scope = "type", Target = "~T:WinSCP.OperationEventArgs")]
+[assembly: SuppressMessage("Microsoft.Interoperability", "CA1408:DoNotUseAutoDualClassInterfaceType", Scope = "type", Target = "~T:WinSCP.OperationResultBase")]
+[assembly: SuppressMessage("Microsoft.Interoperability", "CA1408:DoNotUseAutoDualClassInterfaceType", Scope = "type", Target = "~T:WinSCP.RemoteFileInfo")]
+[assembly: SuppressMessage("Microsoft.Interoperability", "CA1408:DoNotUseAutoDualClassInterfaceType", Scope = "type", Target = "~T:WinSCP.RemovalEventArgs")]
+[assembly: SuppressMessage("Microsoft.Interoperability", "CA1408:DoNotUseAutoDualClassInterfaceType", Scope = "type", Target = "~T:WinSCP.RemovalOperationResult")]
+[assembly: SuppressMessage("Microsoft.Interoperability", "CA1408:DoNotUseAutoDualClassInterfaceType", Scope = "type", Target = "~T:WinSCP.Session")]
+[assembly: SuppressMessage("Microsoft.Interoperability", "CA1408:DoNotUseAutoDualClassInterfaceType", Scope = "type", Target = "~T:WinSCP.SessionException")]
+[assembly: SuppressMessage("Microsoft.Interoperability", "CA1408:DoNotUseAutoDualClassInterfaceType", Scope = "type", Target = "~T:WinSCP.SessionLocalException")]
+[assembly: SuppressMessage("Microsoft.Interoperability", "CA1408:DoNotUseAutoDualClassInterfaceType", Scope = "type", Target = "~T:WinSCP.SessionOptions")]
+[assembly: SuppressMessage("Microsoft.Interoperability", "CA1408:DoNotUseAutoDualClassInterfaceType", Scope = "type", Target = "~T:WinSCP.SessionRemoteException")]
+[assembly: SuppressMessage("Microsoft.Interoperability", "CA1408:DoNotUseAutoDualClassInterfaceType", Scope = "type", Target = "~T:WinSCP.SynchronizationResult")]
+[assembly: SuppressMessage("Microsoft.Interoperability", "CA1408:DoNotUseAutoDualClassInterfaceType", Scope = "type", Target = "~T:WinSCP.TouchEventArgs")]
+[assembly: SuppressMessage("Microsoft.Interoperability", "CA1408:DoNotUseAutoDualClassInterfaceType", Scope = "type", Target = "~T:WinSCP.TransferEventArgs")]
+[assembly: SuppressMessage("Microsoft.Interoperability", "CA1408:DoNotUseAutoDualClassInterfaceType", Scope = "type", Target = "~T:WinSCP.TransferOperationResult")]
+[assembly: SuppressMessage("Microsoft.Interoperability", "CA1408:DoNotUseAutoDualClassInterfaceType", Scope = "type", Target = "~T:WinSCP.TransferOptions")]
+[assembly: SuppressMessage("Microsoft.Interoperability", "CA1409:ComVisibleTypesShouldBeCreatable", Scope = "type", Target = "~T:WinSCP.ChmodEventArgs")]
+[assembly: SuppressMessage("Microsoft.Interoperability", "CA1409:ComVisibleTypesShouldBeCreatable", Scope = "type", Target = "~T:WinSCP.CommandExecutionResult")]
+[assembly: SuppressMessage("Microsoft.Interoperability", "CA1409:ComVisibleTypesShouldBeCreatable", Scope = "type", Target = "~T:WinSCP.FailedEventArgs")]
+[assembly: SuppressMessage("Microsoft.Interoperability", "CA1409:ComVisibleTypesShouldBeCreatable", Scope = "type", Target = "~T:WinSCP.FileOperationEventArgs")]
+[assembly: SuppressMessage("Microsoft.Interoperability", "CA1409:ComVisibleTypesShouldBeCreatable", Scope = "type", Target = "~T:WinSCP.OperationEventArgs")]
+[assembly: SuppressMessage("Microsoft.Interoperability", "CA1409:ComVisibleTypesShouldBeCreatable", Scope = "type", Target = "~T:WinSCP.OperationResultBase")]
+[assembly: SuppressMessage("Microsoft.Interoperability", "CA1409:ComVisibleTypesShouldBeCreatable", Scope = "type", Target = "~T:WinSCP.RemoteFileInfo")]
+[assembly: SuppressMessage("Microsoft.Interoperability", "CA1409:ComVisibleTypesShouldBeCreatable", Scope = "type", Target = "~T:WinSCP.RemovalEventArgs")]
+[assembly: SuppressMessage("Microsoft.Interoperability", "CA1409:ComVisibleTypesShouldBeCreatable", Scope = "type", Target = "~T:WinSCP.RemovalOperationResult")]
+[assembly: SuppressMessage("Microsoft.Interoperability", "CA1409:ComVisibleTypesShouldBeCreatable", Scope = "type", Target = "~T:WinSCP.SessionException")]
+[assembly: SuppressMessage("Microsoft.Interoperability", "CA1409:ComVisibleTypesShouldBeCreatable", Scope = "type", Target = "~T:WinSCP.SessionLocalException")]
+[assembly: SuppressMessage("Microsoft.Interoperability", "CA1409:ComVisibleTypesShouldBeCreatable", Scope = "type", Target = "~T:WinSCP.SessionRemoteException")]
+[assembly: SuppressMessage("Microsoft.Interoperability", "CA1409:ComVisibleTypesShouldBeCreatable", Scope = "type", Target = "~T:WinSCP.SynchronizationResult")]
+[assembly: SuppressMessage("Microsoft.Interoperability", "CA1409:ComVisibleTypesShouldBeCreatable", Scope = "type", Target = "~T:WinSCP.TouchEventArgs")]
+[assembly: SuppressMessage("Microsoft.Interoperability", "CA1409:ComVisibleTypesShouldBeCreatable", Scope = "type", Target = "~T:WinSCP.TransferEventArgs")]
+[assembly: SuppressMessage("Microsoft.Interoperability", "CA1409:ComVisibleTypesShouldBeCreatable", Scope = "type", Target = "~T:WinSCP.TransferOperationResult")]
+[assembly: SuppressMessage("Microsoft.Design", "CA1003:UseGenericEventHandlerInstances", Scope = "type", Target = "~T:WinSCP.FailedEventHandler")]
+[assembly: SuppressMessage("Microsoft.Design", "CA1003:UseGenericEventHandlerInstances", Scope = "type", Target = "~T:WinSCP.FileTransferredEventHandler")]
+[assembly: SuppressMessage("Microsoft.Interoperability", "CA1409:ComVisibleTypesShouldBeCreatable", Scope = "type", Target = "~T:WinSCP.RemoteDirectoryInfo")]
+[assembly: SuppressMessage("Microsoft.Interoperability", "CA1408:DoNotUseAutoDualClassInterfaceType", Scope = "type", Target = "~T:WinSCP.RemoteDirectoryInfo")]
+[assembly: SuppressMessage("Microsoft.Interoperability", "CA1408:DoNotUseAutoDualClassInterfaceType", Scope = "type", Target = "~T:WinSCP.RemoteFileInfoCollection")]
+[assembly: SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId = "index", Scope = "member", Target = "~P:WinSCP.ReadOnlyInteropCollectionHelper`1.Item(System.Int32)")]
+[assembly: SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId = "value", Scope = "member", Target = "~P:WinSCP.ReadOnlyInteropCollectionHelper`1.Item(System.Int32)")]
+[assembly: SuppressMessage("Microsoft.Interoperability", "CA1408:DoNotUseAutoDualClassInterfaceType", Scope = "type", Target = "~T:WinSCP.RemovalEventArgsCollection")]
+[assembly: SuppressMessage("Microsoft.Interoperability", "CA1408:DoNotUseAutoDualClassInterfaceType", Scope = "type", Target = "~T:WinSCP.SessionRemoteExceptionCollection")]
+[assembly: SuppressMessage("Microsoft.Interoperability", "CA1408:DoNotUseAutoDualClassInterfaceType", Scope = "type", Target = "~T:WinSCP.StringCollection")]
+[assembly: SuppressMessage("Microsoft.Interoperability", "CA1408:DoNotUseAutoDualClassInterfaceType", Scope = "type", Target = "~T:WinSCP.TransferEventArgsCollection")]
+[assembly: SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Scope = "member", Target = "~M:WinSCP.Logger.WriteLine(System.String)")]
+[assembly: SuppressMessage("Microsoft.Security", "CA2122:DoNotIndirectlyExposeMethodsWithLinkDemands", Scope = "member", Target = "~M:WinSCP.Logger.WriteEnvironmentInfo")]
+[assembly: SuppressMessage("Microsoft.Design", "CA1003:UseGenericEventHandlerInstances", Scope = "type", Target = "~T:WinSCP.OutputDataReceivedEventHandler")]
+[assembly: SuppressMessage("Microsoft.Security", "CA2122:DoNotIndirectlyExposeMethodsWithLinkDemands", Scope = "member", Target = "~M:WinSCP.ExeSessionProcess.#ctor(WinSCP.Session,System.Boolean,System.String)")]
+[assembly: SuppressMessage("Microsoft.Reliability", "CA2000:Dispose objects before losing scope", Scope = "member", Target = "~M:WinSCP.ExeSessionProcess.CreateEvent(System.String)~System.Threading.EventWaitHandle")]
+[assembly: SuppressMessage("Microsoft.Reliability", "CA2006:UseSafeHandleToEncapsulateNativeResources", Scope = "member", Target = "~F:WinSCP.ConsoleCommStruct._ptr")]
+[assembly: SuppressMessage("Microsoft.Reliability", "CA2000:Dispose objects before losing scope", Scope = "member", Target = "~M:WinSCP.ExeSessionProcess.InitializeConsole")]
+[assembly: SuppressMessage("Microsoft.Security", "CA2122:DoNotIndirectlyExposeMethodsWithLinkDemands", Scope = "member", Target = "~M:WinSCP.ExeSessionProcess.InitializeChild")]
+[assembly: SuppressMessage("Microsoft.Security", "CA2122:DoNotIndirectlyExposeMethodsWithLinkDemands", Scope = "member", Target = "~M:WinSCP.ExeSessionProcess.InitializeConsole")]
+[assembly: SuppressMessage("Microsoft.Security", "CA2122:DoNotIndirectlyExposeMethodsWithLinkDemands", Scope = "member", Target = "~P:WinSCP.ExeSessionProcess.HasExited")]
+[assembly: SuppressMessage("Microsoft.Security", "CA2122:DoNotIndirectlyExposeMethodsWithLinkDemands", Scope = "member", Target = "~P:WinSCP.ExeSessionProcess.ExitCode")]
+[assembly: SuppressMessage("Microsoft.Security", "CA2122:DoNotIndirectlyExposeMethodsWithLinkDemands", Scope = "member", Target = "~M:WinSCP.ExeSessionProcess.Dispose")]
+[assembly: SuppressMessage("Microsoft.Security", "CA2122:DoNotIndirectlyExposeMethodsWithLinkDemands", Scope = "member", Target = "~M:WinSCP.ExeSessionProcess.Close")]
+[assembly: SuppressMessage("Microsoft.Security", "CA2122:DoNotIndirectlyExposeMethodsWithLinkDemands", Scope = "member", Target = "~P:WinSCP.ConsoleCommStruct.Size")]
+[assembly: SuppressMessage("Microsoft.Security", "CA2122:DoNotIndirectlyExposeMethodsWithLinkDemands", Scope = "member", Target = "~M:WinSCP.ConsoleCommStruct.#ctor(WinSCP.Session,Microsoft.Win32.SafeHandles.SafeFileHandle)")]
+[assembly: SuppressMessage("Microsoft.Reliability", "CA2006:UseSafeHandleToEncapsulateNativeResources", Scope = "member", Target = "~F:WinSCP.Job._handle")]
+[assembly: SuppressMessage("Microsoft.Usage", "CA1806:DoNotIgnoreMethodResults", MessageId = "WinSCP.UnsafeNativeMethods.CloseHandle(System.IntPtr)", Scope = "member", Target = "~M:WinSCP.Job.Close")]
+[assembly: SuppressMessage("Microsoft.Interoperability", "CA1409:ComVisibleTypesShouldBeCreatable", Scope = "type", Target = "~T:WinSCP.OutputDataReceivedEventArgs")]
+[assembly: SuppressMessage("Microsoft.Interoperability", "CA1408:DoNotUseAutoDualClassInterfaceType", Scope = "type", Target = "~T:WinSCP.OutputDataReceivedEventArgs")]
+[assembly: SuppressMessage("Microsoft.Security", "CA2122:DoNotIndirectlyExposeMethodsWithLinkDemands", Scope = "member", Target = "~M:WinSCP.ExeSessionProcess.CheckVersion(System.String,System.Diagnostics.FileVersionInfo)")]
+[assembly: SuppressMessage("Microsoft.Maintainability", "CA1506:AvoidExcessiveClassCoupling", Scope = "type", Target = "~T:WinSCP.Session")]
+[assembly: SuppressMessage("Microsoft.Globalization", "CA1303:Do not pass literals as localized parameters", MessageId = "WinSCP.Logger.WriteLine(System.String)", Scope = "member", Target = "~M:WinSCP.ExeSessionProcess.CheckVersion(System.String,System.Diagnostics.FileVersionInfo)")]
+[assembly: SuppressMessage("Microsoft.Globalization", "CA1303:Do not pass literals as localized parameters", MessageId = "WinSCP.Logger.WriteLine(System.String)", Scope = "member", Target = "~M:WinSCP.Session.Cleanup")]
+[assembly: SuppressMessage("Microsoft.Globalization", "CA1303:Do not pass literals as localized parameters", MessageId = "WinSCP.Logger.WriteLine(System.String)", Scope = "member", Target = "~M:WinSCP.Logger.Dispose")]
+[assembly: SuppressMessage("Microsoft.Globalization", "CA1303:Do not pass literals as localized parameters", MessageId = "WinSCP.Logger.WriteLine(System.String)", Scope = "member", Target = "~M:WinSCP.SessionLogReader.OpenLog")]
+[assembly: SuppressMessage("Microsoft.Globalization", "CA1303:Do not pass literals as localized parameters", MessageId = "WinSCP.Logger.WriteLine(System.String)", Scope = "member", Target = "~M:WinSCP.ExeSessionProcess.Close")]
+[assembly: SuppressMessage("Microsoft.Globalization", "CA1303:Do not pass literals as localized parameters", MessageId = "WinSCP.Logger.WriteLine(System.String)", Scope = "member", Target = "~M:WinSCP.SessionLogReader.LogContents")]
+[assembly: SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Scope = "member", Target = "~M:WinSCP.SessionLogReader.LogContents")]
+[assembly: SuppressMessage("Microsoft.Globalization", "CA1303:Do not pass literals as localized parameters", MessageId = "WinSCP.Logger.WriteLine(System.String)", Scope = "member", Target = "~M:WinSCP.ElementLogReader.Dispose")]
+[assembly: SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Scope = "member", Target = "~M:WinSCP.Logger.#ctor")]
+[assembly: SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Scope = "member", Target = "~M:WinSCP.Logger.Dispose")]
+[assembly: SuppressMessage("Microsoft.Security", "CA2122:DoNotIndirectlyExposeMethodsWithLinkDemands", Scope = "member", Target = "~M:WinSCP.ExeSessionProcess.Abort")]
+[assembly: SuppressMessage("Microsoft.Usage", "CA2201:DoNotRaiseReservedExceptionTypes", Scope = "member", Target = "~M:WinSCP.Logger.GetAssemblyFilePath~System.String")]
+[assembly: SuppressMessage("Microsoft.Globalization", "CA1303:Do not pass literals as localized parameters", MessageId = "WinSCP.Logger.WriteLine(System.String)", Scope = "member", Target = "~M:WinSCP.ExeSessionProcess.AbortedOrExited~System.Boolean")]
+[assembly: SuppressMessage("Microsoft.Globalization", "CA1303:Do not pass literals as localized parameters", MessageId = "WinSCP.Logger.WriteLine(System.String)", Scope = "member", Target = "~M:WinSCP.SessionLogReader.DoRead~System.Boolean")]
+[assembly: SuppressMessage("Microsoft.Globalization", "CA1303:Do not pass literals as localized parameters", MessageId = "WinSCP.Logger.WriteLine(System.String)", Scope = "member", Target = "~M:WinSCP.SessionLogReader.Cleanup")]
+[assembly: SuppressMessage("Microsoft.Security", "CA2122:DoNotIndirectlyExposeMethodsWithLinkDemands", Scope = "member", Target = "~M:WinSCP.Session.SetupTempPath")]
+[assembly: SuppressMessage("Microsoft.Globalization", "CA1303:Do not pass literals as localized parameters", MessageId = "WinSCP.Logger.WriteLine(System.String)", Scope = "member", Target = "~M:WinSCP.Logger.GetAssemblyFilePath~System.String")]
+[assembly: SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "CPS", Scope = "member", Target = "~P:WinSCP.FileTransferProgressEventArgs.CPS")]
+[assembly: SuppressMessage("Microsoft.Interoperability", "CA1409:ComVisibleTypesShouldBeCreatable", Scope = "type", Target = "~T:WinSCP.FileTransferProgressEventArgs")]
+[assembly: SuppressMessage("Microsoft.Design", "CA1003:UseGenericEventHandlerInstances", Scope = "type", Target = "~T:WinSCP.FileTransferProgressEventHandler")]
+[assembly: SuppressMessage("Microsoft.Security", "CA5122:PInvokesShouldNotBeSafeCriticalFxCopRule", Scope = "member", Target = "~M:WinSCP.UnsafeNativeMethods.UnmapViewOfFile(System.IntPtr)~System.Boolean", Justification = "Warning is bogus.")]
+[assembly: SuppressMessage("Microsoft.Security", "CA5122:PInvokesShouldNotBeSafeCriticalFxCopRule", Scope = "member", Target = "~M:WinSCP.UnsafeNativeMethods.CloseHandle(System.IntPtr)~System.Int32", Justification = "Warning is bogus.")]
+[assembly: SuppressMessage("Microsoft.Security", "CA5122:PInvokesShouldNotBeSafeCriticalFxCopRule", Scope = "member", Target = "~M:WinSCP.UnsafeNativeMethods.CreateJobObject(System.IntPtr,System.String)~System.IntPtr", Justification = "Warning is bogus.")]
+[assembly: SuppressMessage("Microsoft.Security", "CA5122:PInvokesShouldNotBeSafeCriticalFxCopRule", Scope = "member", Target = "~M:WinSCP.UnsafeNativeMethods.SetInformationJobObject(System.IntPtr,WinSCP.JobObjectInfoType,System.IntPtr,System.UInt32)~System.Boolean", Justification = "Warning is bogus.")]
+[assembly: SuppressMessage("Microsoft.Interoperability", "CA1409:ComVisibleTypesShouldBeCreatable", Scope = "type", Target = "~T:WinSCP.TransferResumeSupport")]
+#if !NETSTANDARD
+[assembly: SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Scope = "member", Target = "~M:WinSCP.Logger.CreateCounters")]
+[assembly: SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Scope = "member", Target = "~M:WinSCP.Logger.WriteCounters")]
+#endif
+[assembly: SuppressMessage("Microsoft.Security", "CA2122:DoNotIndirectlyExposeMethodsWithLinkDemands", Scope = "member", Target = "~M:WinSCP.Logger.WriteProcesses")]
+[assembly: SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Scope = "member", Target = "~M:WinSCP.Logger.WriteProcesses")]
+[assembly: SuppressMessage("Microsoft.Security", "CA2122:DoNotIndirectlyExposeMethodsWithLinkDemands", Scope = "member", Target = "~M:WinSCP.Logger.GetProcessStartTime(System.Diagnostics.Process)~System.Object")]
+[assembly: SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Scope = "member", Target = "~M:WinSCP.Logger.GetProcessStartTime(System.Diagnostics.Process)~System.Object")]
+[assembly: SuppressMessage("Microsoft.Security", "CA2122:DoNotIndirectlyExposeMethodsWithLinkDemands", Scope = "member", Target = "~M:WinSCP.Logger.GetTotalProcessorTime(System.Diagnostics.Process)~System.Object")]
+[assembly: SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Scope = "member", Target = "~M:WinSCP.Logger.GetTotalProcessorTime(System.Diagnostics.Process)~System.Object")]
+[assembly: SuppressMessage("Microsoft.Usage", "CA2217:DoNotMarkEnumsWithFlags", Scope = "type", Target = "~T:WinSCP.FileMapAccess")]
+[assembly: SuppressMessage("Microsoft.Security", "CA5122:PInvokesShouldNotBeSafeCriticalFxCopRule", Scope = "member", Target = "~M:WinSCP.UnsafeNativeMethods.CreateFileMapping(Microsoft.Win32.SafeHandles.SafeFileHandle,System.IntPtr,WinSCP.FileMapProtection,System.Int32,System.Int32,System.String)~Microsoft.Win32.SafeHandles.SafeFileHandle")]
+[assembly: SuppressMessage("Microsoft.Security", "CA5122:PInvokesShouldNotBeSafeCriticalFxCopRule", Scope = "member", Target = "~M:WinSCP.UnsafeNativeMethods.MapViewOfFile(Microsoft.Win32.SafeHandles.SafeFileHandle,WinSCP.FileMapAccess,System.UInt32,System.UInt32,System.UIntPtr)~System.IntPtr")]
+[assembly: SuppressMessage("Microsoft.Interoperability", "CA1404:CallGetLastErrorImmediatelyAfterPInvoke", Scope = "member", Target = "~M:WinSCP.ExeSessionProcess.InitializeConsole")]
+[assembly: SuppressMessage("Microsoft.Interoperability", "CA1404:CallGetLastErrorImmediatelyAfterPInvoke", Scope = "member", Target = "~M:WinSCP.ExeSessionProcess.Dispose")]
+[assembly: SuppressMessage("Microsoft.Security", "CA2122:DoNotIndirectlyExposeMethodsWithLinkDemands", Scope = "member", Target = "~M:WinSCP.Job.#ctor(WinSCP.Logger,System.String)")]
+[assembly: SuppressMessage("Microsoft.Security", "CA2122:DoNotIndirectlyExposeMethodsWithLinkDemands", Scope = "member", Target = "~M:WinSCP.Logger.LastWin32ErrorMessage~System.String")]
+[assembly: SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Scope = "member", Target = "~P:WinSCP.Session.GuardProcessWithJobInternal")]
+[assembly: SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Scope = "member", Target = "~P:WinSCP.Session.TestHandlesClosedInternal")]
+[assembly: SuppressMessage("Microsoft.Security", "CA2122:DoNotIndirectlyExposeMethodsWithLinkDemands", Scope = "member", Target = "~M:WinSCP.ExeSessionProcess.TryCreateEvent(System.String,System.Threading.EventWaitHandle@)~System.Boolean")]
+[assembly: SuppressMessage("Microsoft.Reliability", "CA2001:AvoidCallingProblematicMethods", MessageId = "System.Runtime.InteropServices.SafeHandle.DangerousGetHandle", Scope = "member", Target = "~M:WinSCP.ExeSessionProcess.TryCreateEvent(System.String,System.Threading.EventWaitHandle@)~System.Boolean")]
+[assembly: SuppressMessage("Microsoft.Security", "CA2122:DoNotIndirectlyExposeMethodsWithLinkDemands", Scope = "member", Target = "~M:WinSCP.SessionOptions.GetPassword(System.Security.SecureString)~System.String")]
+[assembly: SuppressMessage("Microsoft.Design", "CA1054:UriParametersShouldNotBeStrings", MessageId = "0#", Scope = "member", Target = "~M:WinSCP.SessionOptions.ParseUrl(System.String)")]
+[assembly: SuppressMessage("Microsoft.Security", "CA2122:DoNotIndirectlyExposeMethodsWithLinkDemands", Scope = "member", Target = "~M:WinSCP.ExeSessionProcess.NoopSafeHandle.#ctor(System.IntPtr)")]
+[assembly: SuppressMessage("Microsoft.Security", "CA2122:DoNotIndirectlyExposeMethodsWithLinkDemands", Scope = "member", Target = "~M:WinSCP.ExeSessionProcess.CreateFileMapping(System.String)~Microsoft.Win32.SafeHandles.SafeFileHandle")]
+[assembly: SuppressMessage("Microsoft.Security", "CA5122:PInvokesShouldNotBeSafeCriticalFxCopRule", Scope = "member", Target = "~M:WinSCP.UnsafeNativeMethods.GetProcessWindowStation~System.IntPtr")]
+[assembly: SuppressMessage("Microsoft.Security", "CA5122:PInvokesShouldNotBeSafeCriticalFxCopRule", Scope = "member", Target = "~M:WinSCP.UnsafeNativeMethods.GetThreadDesktop(System.Int32)~System.IntPtr")]
+[assembly: SuppressMessage("Microsoft.Security", "CA5122:PInvokesShouldNotBeSafeCriticalFxCopRule", Scope = "member", Target = "~M:WinSCP.UnsafeNativeMethods.GetCurrentThreadId~System.Int32")]
+[assembly: SuppressMessage("Microsoft.Reliability", "CA2000:Dispose objects before losing scope", Scope = "member", Target = "~M:WinSCP.ExeSessionProcess.CreateFileMapping(System.String)~Microsoft.Win32.SafeHandles.SafeFileHandle")]
+#if !NETSTANDARD
+[assembly: SuppressMessage("Microsoft.Reliability", "CA2000:Dispose objects before losing scope", Scope = "member", Target = "~M:WinSCP.Logger.CreateCounters")]
+#endif
+[assembly: SuppressMessage("Microsoft.Reliability", "CA2000:Dispose objects before losing scope", Scope = "member", Target = "~M:WinSCP.SessionLogReader.LogContents")]
+[assembly: SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "member", Target = "~M:WinSCP.Session.SessionOptionsToSwitches(WinSCP.SessionOptions,System.Boolean,System.String@,System.String@)")]
+[assembly: SuppressMessage("Microsoft.Security", "CA5122:PInvokesShouldNotBeSafeCriticalFxCopRule", Scope = "member", Target = "~M:WinSCP.UnsafeNativeMethods.RegGetValue(System.UIntPtr,System.String,System.String,WinSCP.RegistryFlags,WinSCP.RegistryType@,System.IntPtr,System.UInt32@)~System.Int32")]
+[assembly: SuppressMessage("Microsoft.Globalization", "CA1303:Do not pass literals as localized parameters", MessageId = "WinSCP.Logger.DoWriteLine(System.String)", Scope = "member", Target = "~M:WinSCP.Logger.WriteException(System.Exception)~System.Exception")]
+[assembly: SuppressMessage("Microsoft.Interoperability", "CA1407:AvoidStaticMembersInComVisibleTypes", Scope = "member", Target = "~M:WinSCP.RemotePath.CombinePaths(System.String,System.String)~System.String")]
+[assembly: SuppressMessage("Microsoft.Interoperability", "CA1407:AvoidStaticMembersInComVisibleTypes", Scope = "member", Target = "~M:WinSCP.RemotePath.EscapeFileMask(System.String)~System.String")]
+[assembly: SuppressMessage("Microsoft.Interoperability", "CA1407:AvoidStaticMembersInComVisibleTypes", Scope = "member", Target = "~M:WinSCP.RemotePath.TranslateRemotePathToLocal(System.String,System.String,System.String)~System.String")]
+[assembly: SuppressMessage("Microsoft.Interoperability", "CA1407:AvoidStaticMembersInComVisibleTypes", Scope = "member", Target = "~M:WinSCP.RemotePath.TranslateLocalPathToRemote(System.String,System.String,System.String)~System.String")]
+[assembly: SuppressMessage("Microsoft.Interoperability", "CA1407:AvoidStaticMembersInComVisibleTypes", Scope = "member", Target = "~M:WinSCP.RemotePath.GetDirectoryName(System.String)~System.String")]
+[assembly: SuppressMessage("Microsoft.Interoperability", "CA1407:AvoidStaticMembersInComVisibleTypes", Scope = "member", Target = "~M:WinSCP.RemotePath.AddDirectorySeparator(System.String)~System.String")]
+[assembly: SuppressMessage("Microsoft.Interoperability", "CA1407:AvoidStaticMembersInComVisibleTypes", Scope = "member", Target = "~M:WinSCP.RemotePath.GetFileName(System.String)~System.String")]
+[assembly: SuppressMessage("Microsoft.Interoperability", "CA1409:ComVisibleTypesShouldBeCreatable", Scope = "type", Target = "~T:WinSCP.QueryReceivedEventArgs")]
+[assembly: SuppressMessage("Microsoft.Design", "CA1003:UseGenericEventHandlerInstances", Scope = "type", Target = "~T:WinSCP.QueryReceivedEventHandler")]
+[assembly: SuppressMessage("Microsoft.Security", "CA2122:DoNotIndirectlyExposeMethodsWithLinkDemands", Scope = "member", Target = "~M:WinSCP.ExeSessionProcess.RequestCallstack")]
+[assembly: SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Scope = "member", Target = "~M:WinSCP.ExeSessionProcess.RequestCallstack")]

+ 13 - 0
dotnet/RemotePath.cs

@@ -24,6 +24,19 @@ namespace WinSCP
             return path + mask;
             return path + mask;
         }
         }
 
 
+        public static string EscapeOperationMask(string operationMask)
+        {
+            if (operationMask == null)
+            {
+                throw new ArgumentNullException(nameof(operationMask));
+            }
+            int lastSlash = operationMask.LastIndexOf('/');
+            string path = lastSlash > 0 ? operationMask.Substring(0, lastSlash + 1) : string.Empty;
+            string mask = lastSlash > 0 ? operationMask.Substring(lastSlash + 1) : operationMask;
+            mask = mask.Replace("\\", "\\\\").Replace("*", "\\*").Replace("?", "\\?");
+            return path + mask;
+        }
+
         [Obsolete("Use RemotePath.Combine method")]
         [Obsolete("Use RemotePath.Combine method")]
         public static string CombinePaths(string path1, string path2)
         public static string CombinePaths(string path1, string path2)
         {
         {

+ 257 - 53
dotnet/Session.cs

@@ -6,9 +6,13 @@ using System.Globalization;
 using System.Runtime.InteropServices;
 using System.Runtime.InteropServices;
 using System.Threading;
 using System.Threading;
 using System.Xml;
 using System.Xml;
+#if !NETSTANDARD
 using Microsoft.Win32;
 using Microsoft.Win32;
+#endif
 using System.Diagnostics;
 using System.Diagnostics;
+#if !NETSTANDARD
 using System.Security;
 using System.Security;
+#endif
 using System.Text.RegularExpressions;
 using System.Text.RegularExpressions;
 using System.Linq;
 using System.Linq;
 
 
@@ -102,7 +106,7 @@ namespace WinSCP
         {
         {
             add
             add
             {
             {
-                using (Logger.CreateCallstackAndLock())
+                using (CreateCallstackAndLock())
                 {
                 {
                     CheckNotOpened();
                     CheckNotOpened();
                     _fileTransferProgress += value;
                     _fileTransferProgress += value;
@@ -111,7 +115,7 @@ namespace WinSCP
 
 
             remove
             remove
             {
             {
-                using (Logger.CreateCallstackAndLock())
+                using (CreateCallstackAndLock())
                 {
                 {
                     CheckNotOpened();
                     CheckNotOpened();
                     _fileTransferProgress -= value;
                     _fileTransferProgress -= value;
@@ -119,11 +123,22 @@ namespace WinSCP
             }
             }
         }
         }
 
 
+        private IDisposable CreateCallstackAndLock()
+        {
+            var result = Logger.CreateCallstackAndLock();
+            if ((_process != null) && (_process.StdOut != null))
+            {
+                result.Dispose();
+                throw Logger.WriteException(new InvalidOperationException("Finish reading the stream from Session.GetFile first."));
+            }
+            return result;
+        }
+
         public event QueryReceivedEventHandler QueryReceived { add { AddQueryReceived(value); } remove { RemoveQueryReceived(value); } }
         public event QueryReceivedEventHandler QueryReceived { add { AddQueryReceived(value); } remove { RemoveQueryReceived(value); } }
 
 
         private void AddQueryReceived(QueryReceivedEventHandler value)
         private void AddQueryReceived(QueryReceivedEventHandler value)
         {
         {
-            using (Logger.CreateCallstackAndLock())
+            using (CreateCallstackAndLock())
             {
             {
                 bool send = (_queryReceived == null);
                 bool send = (_queryReceived == null);
                 _queryReceived += value;
                 _queryReceived += value;
@@ -137,7 +152,7 @@ namespace WinSCP
 
 
         private void RemoveQueryReceived(QueryReceivedEventHandler value)
         private void RemoveQueryReceived(QueryReceivedEventHandler value)
         {
         {
-            using (Logger.CreateCallstackAndLock())
+            using (CreateCallstackAndLock())
             {
             {
                 if (_queryReceived != null)
                 if (_queryReceived != null)
                 {
                 {
@@ -155,7 +170,7 @@ namespace WinSCP
         {
         {
             Logger = new Logger();
             Logger = new Logger();
 
 
-            using (Logger.CreateCallstackAndLock())
+            using (CreateCallstackAndLock())
             {
             {
                 Timeout = new TimeSpan(0, 1, 0);
                 Timeout = new TimeSpan(0, 1, 0);
                 _reconnectTime = new TimeSpan(0, 2, 0); // keep in sync with TScript::OptionImpl
                 _reconnectTime = new TimeSpan(0, 2, 0); // keep in sync with TScript::OptionImpl
@@ -180,7 +195,7 @@ namespace WinSCP
 
 
         public void Dispose()
         public void Dispose()
         {
         {
-            using (Logger.CreateCallstackAndLock())
+            using (CreateCallstackAndLock())
             {
             {
                 _disposed = true;
                 _disposed = true;
 
 
@@ -221,7 +236,7 @@ namespace WinSCP
 
 
         public void Open(SessionOptions sessionOptions)
         public void Open(SessionOptions sessionOptions)
         {
         {
-            using (Logger.CreateCallstackAndLock())
+            using (CreateCallstackAndLock())
             {
             {
                 CheckNotDisposed();
                 CheckNotDisposed();
 
 
@@ -398,7 +413,7 @@ namespace WinSCP
 
 
         public string ScanFingerprint(SessionOptions sessionOptions, string algorithm)
         public string ScanFingerprint(SessionOptions sessionOptions, string algorithm)
         {
         {
-            using (Logger.CreateCallstackAndLock())
+            using (CreateCallstackAndLock())
             {
             {
                 string normalizeAlgorithm = NormalizeIdent(algorithm);
                 string normalizeAlgorithm = NormalizeIdent(algorithm);
                 if (string.IsNullOrEmpty(normalizeAlgorithm))
                 if (string.IsNullOrEmpty(normalizeAlgorithm))
@@ -487,7 +502,7 @@ namespace WinSCP
 
 
         public void Close()
         public void Close()
         {
         {
-            using (Logger.CreateCallstackAndLock())
+            using (CreateCallstackAndLock())
             {
             {
                 CheckOpened();
                 CheckOpened();
 
 
@@ -497,7 +512,7 @@ namespace WinSCP
 
 
         public RemoteDirectoryInfo ListDirectory(string path)
         public RemoteDirectoryInfo ListDirectory(string path)
         {
         {
-            using (Logger.CreateCallstackAndLock())
+            using (CreateCallstackAndLock())
             {
             {
                 CheckOpened();
                 CheckOpened();
 
 
@@ -655,13 +670,13 @@ namespace WinSCP
             // so the Session object is not guarded during the whole enumeration.
             // so the Session object is not guarded during the whole enumeration.
             // Though it should not matter as it uses only guarded methods (ListDirectory)
             // Though it should not matter as it uses only guarded methods (ListDirectory)
             // for the actual work on the session
             // for the actual work on the session
-            using (Logger.CreateCallstackAndLock())
+            using (CreateCallstackAndLock())
             {
             {
                 CheckOpened();
                 CheckOpened();
 
 
                 Regex regex = MaskToRegex(mask);
                 Regex regex = MaskToRegex(mask);
 
 
-                return DoEnumerateRemoteFiles(path, regex, options, true);
+                return new ImplicitEnumerable<RemoteFileInfo>(DoEnumerateRemoteFiles(path, regex, options, true));
             }
             }
         }
         }
 
 
@@ -687,7 +702,15 @@ namespace WinSCP
 
 
         public TransferOperationResult PutFiles(string localPath, string remotePath, bool remove = false, TransferOptions options = null)
         public TransferOperationResult PutFiles(string localPath, string remotePath, bool remove = false, TransferOptions options = null)
         {
         {
-            using (Logger.CreateCallstackAndLock())
+            using (CreateCallstackAndLock())
+            {
+                return DoPutFiles(localPath, remotePath, remove, options);
+            }
+        }
+
+        public TransferOperationResult DoPutFiles(string localPath, string remotePath, bool remove, TransferOptions options)
+        {
+            using (Logger.CreateCallstack())
             {
             {
                 if (options == null)
                 if (options == null)
                 {
                 {
@@ -800,6 +823,34 @@ namespace WinSCP
             }
             }
         }
         }
 
 
+        public void PutFile(Stream stream, string remoteFilePath, TransferOptions options = null)
+        {
+            using (CreateCallstackAndLock())
+            {
+                if (remoteFilePath == null)
+                {
+                    throw Logger.WriteException(new ArgumentNullException(nameof(remoteFilePath)));
+                }
+                if (_process.StdIn != null)
+                {
+                    throw Logger.WriteException(new InvalidOperationException("Already uploading from a stream"));
+                }
+                _process.StdIn = stream ?? throw Logger.WriteException(new ArgumentNullException(nameof(stream)));
+                try
+                {
+                    remoteFilePath = RemotePath.EscapeOperationMask(remoteFilePath);
+                    TransferOperationResult operationResult = DoPutFiles("-", remoteFilePath, false, options);
+                    operationResult.Check();
+                    // Assert that any transfer took place at all
+                    GetOnlyFileOperation(operationResult.Transfers);
+                }
+                finally
+                {
+                    _process.StdIn = null;
+                }
+            }
+        }
+
         internal TransferOperationResult PutEntryToDirectory(string localFilePath, string remoteDirectory, bool remove = false, TransferOptions options = null)
         internal TransferOperationResult PutEntryToDirectory(string localFilePath, string remoteDirectory, bool remove = false, TransferOptions options = null)
         {
         {
             using (Logger.CreateCallstack())
             using (Logger.CreateCallstack())
@@ -810,7 +861,7 @@ namespace WinSCP
                 }
                 }
 
 
                 string localDirectory = Path.GetDirectoryName(localFilePath);
                 string localDirectory = Path.GetDirectoryName(localFilePath);
-                string filemask = RemotePath.EscapeFileMask(Path.GetFileName(localFilePath));
+                string filemask = Path.GetFileName(localFilePath);
 
 
                 TransferOperationResult operationResult = PutFilesToDirectory(localDirectory, remoteDirectory, filemask, remove, options);
                 TransferOperationResult operationResult = PutFilesToDirectory(localDirectory, remoteDirectory, filemask, remove, options);
                 operationResult.Check();
                 operationResult.Check();
@@ -829,7 +880,7 @@ namespace WinSCP
 
 
         public TransferOperationResult GetFiles(string remotePath, string localPath, bool remove = false, TransferOptions options = null)
         public TransferOperationResult GetFiles(string remotePath, string localPath, bool remove = false, TransferOptions options = null)
         {
         {
-            using (Logger.CreateCallstackAndLock())
+            using (CreateCallstackAndLock())
             {
             {
                 return DoGetFiles(remotePath, localPath, remove, options, string.Empty);
                 return DoGetFiles(remotePath, localPath, remove, options, string.Empty);
             }
             }
@@ -840,17 +891,7 @@ namespace WinSCP
         {
         {
             using (Logger.CreateCallstack())
             using (Logger.CreateCallstack())
             {
             {
-                if (options == null)
-                {
-                    options = new TransferOptions();
-                }
-
-                CheckOpened();
-
-                WriteCommand(
-                    string.Format(CultureInfo.InvariantCulture, "get {0} {1} {2} -- \"{3}\" \"{4}\"",
-                        BooleanSwitch(remove, "delete"), options.ToSwitches(), additionalParams,
-                        Tools.ArgumentEscape(remotePath), Tools.ArgumentEscape(localPath)));
+                StartGetCommand(remotePath, localPath, remove, options, additionalParams);
 
 
                 TransferOperationResult result = new TransferOperationResult();
                 TransferOperationResult result = new TransferOperationResult();
 
 
@@ -887,10 +928,25 @@ namespace WinSCP
             }
             }
         }
         }
 
 
+        private void StartGetCommand(string remotePath, string localPath, bool remove, TransferOptions options, string additionalParams)
+        {
+            if (options == null)
+            {
+                options = new TransferOptions();
+            }
+
+            CheckOpened();
+
+            WriteCommand(
+                string.Format(CultureInfo.InvariantCulture, "get {0} {1} {2} -- \"{3}\" \"{4}\"",
+                    BooleanSwitch(remove, "delete"), options.ToSwitches(), additionalParams,
+                    Tools.ArgumentEscape(remotePath), Tools.ArgumentEscape(localPath)));
+        }
+
         public TransferOperationResult GetFilesToDirectory(
         public TransferOperationResult GetFilesToDirectory(
             string remoteDirectory, string localDirectory, string filemask = null, bool remove = false, TransferOptions options = null)
             string remoteDirectory, string localDirectory, string filemask = null, bool remove = false, TransferOptions options = null)
         {
         {
-            using (Logger.CreateCallstackAndLock())
+            using (CreateCallstackAndLock())
             {
             {
                 return DoGetFilesToDirectory(remoteDirectory, localDirectory, filemask, remove, options, null);
                 return DoGetFilesToDirectory(remoteDirectory, localDirectory, filemask, remove, options, null);
             }
             }
@@ -928,7 +984,7 @@ namespace WinSCP
 
 
         public TransferEventArgs GetFileToDirectory(string remoteFilePath, string localDirectory, bool remove = false, TransferOptions options = null)
         public TransferEventArgs GetFileToDirectory(string remoteFilePath, string localDirectory, bool remove = false, TransferOptions options = null)
         {
         {
-            using (Logger.CreateCallstackAndLock())
+            using (CreateCallstackAndLock())
             {
             {
                 const string additionalParams = "-onlyfile";
                 const string additionalParams = "-onlyfile";
                 TransferOperationResult operationResult = GetEntryToDirectory(remoteFilePath, localDirectory, remove, options, additionalParams);
                 TransferOperationResult operationResult = GetEntryToDirectory(remoteFilePath, localDirectory, remove, options, additionalParams);
@@ -941,13 +997,7 @@ namespace WinSCP
         {
         {
             using (Logger.CreateCallstack())
             using (Logger.CreateCallstack())
             {
             {
-                if (string.IsNullOrEmpty(remoteFilePath))
-                {
-                    throw Logger.WriteException(new ArgumentException("File to path cannot be empty", nameof(remoteFilePath)));
-                }
-
-                string remoteDirectory = RemotePath.GetDirectoryName(remoteFilePath);
-                string filemask = RemotePath.EscapeFileMask(RemotePath.GetFileName(remoteFilePath));
+                ParseRemotePath(remoteFilePath, out string remoteDirectory, out string filemask);
 
 
                 TransferOperationResult operationResult =
                 TransferOperationResult operationResult =
                     DoGetFilesToDirectory(remoteDirectory, localDirectory, filemask, remove, options, additionalParams ?? string.Empty);
                     DoGetFilesToDirectory(remoteDirectory, localDirectory, filemask, remove, options, additionalParams ?? string.Empty);
@@ -956,6 +1006,17 @@ namespace WinSCP
             }
             }
         }
         }
 
 
+        private void ParseRemotePath(string remoteFilePath, out string remoteDirectory, out string filemask)
+        {
+            if (string.IsNullOrEmpty(remoteFilePath))
+            {
+                throw Logger.WriteException(new ArgumentException("File to path cannot be empty", nameof(remoteFilePath)));
+            }
+
+            remoteDirectory = RemotePath.GetDirectoryName(remoteFilePath);
+            filemask = RemotePath.EscapeFileMask(RemotePath.GetFileName(remoteFilePath));
+        }
+
         private T GetOnlyFileOperation<T>(ICollection<T> operations)
         private T GetOnlyFileOperation<T>(ICollection<T> operations)
         {
         {
             // For "get", this should happen only when the filename is mask-like, otherwise "get" throws straight away.
             // For "get", this should happen only when the filename is mask-like, otherwise "get" throws straight away.
@@ -971,9 +1032,128 @@ namespace WinSCP
             return operations.First();
             return operations.First();
         }
         }
 
 
+        public Stream GetFile(string remoteFilePath, TransferOptions options = null)
+        {
+            using (CreateCallstackAndLock())
+            {
+                const string additionalParams = "-onlyfile";
+                ParseRemotePath(remoteFilePath, out string remoteDirectory, out string filemask);
+                string remotePath = RemotePath.Combine(remoteDirectory, filemask);
+
+                // only to collect failures
+                TransferOperationResult result = new TransferOperationResult();
+
+                ElementLogReader groupReader = null;
+                IDisposable operationResultGuard = null;
+                IDisposable progressHandler = null;
+
+                // should never happen
+                if (_process.StdOut != null)
+                {
+                    throw Logger.WriteException(new InvalidOperationException("Data stream already exist"));
+                }
+
+                PipeStream stream = new PipeStream();
+                _process.StdOut = stream;
+
+                void onGetEnd()
+                {
+                    using (Logger.CreateCallstack())
+                    {
+                        try
+                        {
+                            // This can throw
+                            progressHandler?.Dispose();
+                        }
+                        finally
+                        {
+                            try
+                            {
+                                groupReader?.Dispose();
+                            }
+                            finally
+                            {
+                                _process.StdOut = null;
+                                // Only after disposing the group reader, so when called from onGetEndWithExit, the Check() has all failures.
+                                operationResultGuard?.Dispose();
+                            }
+                        }
+                    }
+                }
+
+                void onGetEndWithExit()
+                {
+                    // Explicitly not Session.CreateCallstackAndLock
+                    using (Logger.CreateCallstackAndLock())
+                    {
+                        Logger.WriteLine("Closing download stream");
+                        try
+                        {
+                            onGetEnd();
+                        }
+                        finally
+                        {
+                            Logger.WriteLine("Closed download stream");
+                            result.Check();
+                        }
+                    }
+                }
+
+                try
+                {
+                    StartGetCommand(remotePath, "-", false, options, additionalParams);
+
+                    groupReader = _reader.WaitForGroupAndCreateLogReader();
+                    operationResultGuard = RegisterOperationResult(result);
+                    progressHandler = CreateProgressHandler();
+
+                    if (_throwStdOut)
+                    {
+                        throw Logger.WriteException(new InvalidOperationException());
+                    }
+                    _throwStdOut = true;
+                    bool downloadFound;
+                    try
+                    {
+                        // Not using WaitForNonEmptyElement only to allow throwing better exception message below.
+                        // Not using ThrowFailures as we need to return the stream, if there's <download>,
+                        // even if there's a <failure> as well.
+                        downloadFound = groupReader.TryWaitForNonEmptyElement(TransferEventArgs.DownloadTag, 0);
+                    }
+                    catch (StdOutException)
+                    {
+                        downloadFound = true;
+                    }
+                    finally
+                    {
+                        _throwStdOut = false;
+                    }
+                    if (downloadFound)
+                    {
+                        Logger.WriteLine("Download stream started");
+                        stream.OnDispose = onGetEndWithExit;
+                        return stream;
+                    }
+                    else
+                    {
+                        // First throw any specific error from <failure>
+                        result.Check();
+                        // And only then fallback to the generic one.
+                        // See also the comment in GetOnlyFileOperation.
+                        throw Logger.WriteException(new FileNotFoundException("File not found"));
+                    }
+                }
+                catch
+                {
+                    onGetEnd();
+                    throw;
+                }
+            }
+        }
+
         public RemovalOperationResult RemoveFiles(string path)
         public RemovalOperationResult RemoveFiles(string path)
         {
         {
-            using (Logger.CreateCallstackAndLock())
+            using (CreateCallstackAndLock())
             {
             {
                 return DoRemoveFiles(path, string.Empty);
                 return DoRemoveFiles(path, string.Empty);
             }
             }
@@ -1007,7 +1187,7 @@ namespace WinSCP
 
 
         public RemovalEventArgs RemoveFile(string path)
         public RemovalEventArgs RemoveFile(string path)
         {
         {
-            using (Logger.CreateCallstackAndLock())
+            using (CreateCallstackAndLock())
             {
             {
                 RemovalOperationResult operationResult = RemoveEntry(path, "-onlyfile");
                 RemovalOperationResult operationResult = RemoveEntry(path, "-onlyfile");
                 return GetOnlyFileOperation(operationResult.Removals);
                 return GetOnlyFileOperation(operationResult.Removals);
@@ -1042,7 +1222,7 @@ namespace WinSCP
             bool removeFiles, bool mirror = false, SynchronizationCriteria criteria = SynchronizationCriteria.Time,
             bool removeFiles, bool mirror = false, SynchronizationCriteria criteria = SynchronizationCriteria.Time,
             TransferOptions options = null)
             TransferOptions options = null)
         {
         {
-            using (Logger.CreateCallstackAndLock())
+            using (CreateCallstackAndLock())
             {
             {
                 DoSynchronizeDirectories(mode, localPath, remotePath, removeFiles, mirror, criteria, options, string.Empty);
                 DoSynchronizeDirectories(mode, localPath, remotePath, removeFiles, mirror, criteria, options, string.Empty);
 
 
@@ -1201,7 +1381,7 @@ namespace WinSCP
             bool removeFiles, bool mirror = false, SynchronizationCriteria criteria = SynchronizationCriteria.Time,
             bool removeFiles, bool mirror = false, SynchronizationCriteria criteria = SynchronizationCriteria.Time,
             TransferOptions options = null)
             TransferOptions options = null)
         {
         {
-            using (Logger.CreateCallstackAndLock())
+            using (CreateCallstackAndLock())
             {
             {
                 DoSynchronizeDirectories(mode, localPath, remotePath, removeFiles, mirror, criteria, options, "-preview");
                 DoSynchronizeDirectories(mode, localPath, remotePath, removeFiles, mirror, criteria, options, "-preview");
 
 
@@ -1307,7 +1487,7 @@ namespace WinSCP
                                 }
                                 }
                             }
                             }
 
 
-                            if (difference.Action == default(SynchronizationAction))
+                            if (difference.Action == default)
                             {
                             {
                                 throw Logger.WriteException(new InvalidOperationException("No action tag found"));
                                 throw Logger.WriteException(new InvalidOperationException("No action tag found"));
                             }
                             }
@@ -1328,7 +1508,7 @@ namespace WinSCP
 
 
         public CommandExecutionResult ExecuteCommand(string command)
         public CommandExecutionResult ExecuteCommand(string command)
         {
         {
-            using (Logger.CreateCallstackAndLock())
+            using (CreateCallstackAndLock())
             {
             {
                 CheckOpened();
                 CheckOpened();
 
 
@@ -1365,7 +1545,7 @@ namespace WinSCP
 
 
         public RemoteFileInfo GetFileInfo(string path)
         public RemoteFileInfo GetFileInfo(string path)
         {
         {
-            using (Logger.CreateCallstackAndLock())
+            using (CreateCallstackAndLock())
             {
             {
                 CheckOpened();
                 CheckOpened();
 
 
@@ -1375,7 +1555,7 @@ namespace WinSCP
 
 
         public bool FileExists(string path)
         public bool FileExists(string path)
         {
         {
-            using (Logger.CreateCallstackAndLock())
+            using (CreateCallstackAndLock())
             {
             {
                 CheckOpened();
                 CheckOpened();
 
 
@@ -1401,7 +1581,7 @@ namespace WinSCP
 
 
         public byte[] CalculateFileChecksum(string algorithm, string path)
         public byte[] CalculateFileChecksum(string algorithm, string path)
         {
         {
-            using (Logger.CreateCallstackAndLock())
+            using (CreateCallstackAndLock())
             {
             {
                 WriteCommand(string.Format(CultureInfo.InvariantCulture, "checksum -- \"{0}\" \"{1}\"", Tools.ArgumentEscape(algorithm), Tools.ArgumentEscape(path)));
                 WriteCommand(string.Format(CultureInfo.InvariantCulture, "checksum -- \"{0}\" \"{1}\"", Tools.ArgumentEscape(algorithm), Tools.ArgumentEscape(path)));
 
 
@@ -1441,7 +1621,7 @@ namespace WinSCP
 
 
         public void CreateDirectory(string path)
         public void CreateDirectory(string path)
         {
         {
-            using (Logger.CreateCallstackAndLock())
+            using (CreateCallstackAndLock())
             {
             {
                 CheckOpened();
                 CheckOpened();
 
 
@@ -1458,7 +1638,7 @@ namespace WinSCP
 
 
         public void MoveFile(string sourcePath, string targetPath)
         public void MoveFile(string sourcePath, string targetPath)
         {
         {
-            using (Logger.CreateCallstackAndLock())
+            using (CreateCallstackAndLock())
             {
             {
                 CheckOpened();
                 CheckOpened();
 
 
@@ -1484,7 +1664,7 @@ namespace WinSCP
 
 
         public void DuplicateFile(string sourcePath, string targetPath)
         public void DuplicateFile(string sourcePath, string targetPath)
         {
         {
-            using (Logger.CreateCallstackAndLock())
+            using (CreateCallstackAndLock())
             {
             {
                 CheckOpened();
                 CheckOpened();
 
 
@@ -1847,17 +2027,29 @@ namespace WinSCP
                 List<string> switches = new List<string>();
                 List<string> switches = new List<string>();
 
 
                 if (!string.IsNullOrEmpty(sessionOptions.SshHostKeyFingerprint) ||
                 if (!string.IsNullOrEmpty(sessionOptions.SshHostKeyFingerprint) ||
-                    (sessionOptions.GiveUpSecurityAndAcceptAnySshHostKey && !scanFingerprint))
+                    ((sessionOptions.SshHostKeyPolicy != SshHostKeyPolicy.Check) && !scanFingerprint))
                 {
                 {
                     if (!sessionOptions.IsSsh)
                     if (!sessionOptions.IsSsh)
                     {
                     {
-                        throw Logger.WriteException(new ArgumentException("SessionOptions.SshHostKeyFingerprint or SessionOptions.GiveUpSecurityAndAcceptAnySshHostKey is set, but SessionOptions.Protocol is neither Protocol.Sftp nor Protocol.Scp."));
+                        throw Logger.WriteException(new ArgumentException("SessionOptions.SshHostKeyFingerprint is set or sessionOptions.SshHostKeyPolicy has not the default value Check, but SessionOptions.Protocol is neither Protocol.Sftp nor Protocol.Scp."));
                     }
                     }
                     string sshHostKeyFingerprint = sessionOptions.SshHostKeyFingerprint;
                     string sshHostKeyFingerprint = sessionOptions.SshHostKeyFingerprint;
-                    if (sessionOptions.GiveUpSecurityAndAcceptAnySshHostKey)
+                    switch (sessionOptions.SshHostKeyPolicy)
                     {
                     {
-                        Logger.WriteLine("WARNING! Giving up security and accepting any key as configured");
-                        sshHostKeyFingerprint = AddStarToList(sshHostKeyFingerprint);
+                        case SshHostKeyPolicy.Check:
+                            // noop
+                            break;
+                        case SshHostKeyPolicy.GiveUpSecurityAndAcceptAny:
+                            sshHostKeyFingerprint = AddStarToList(sshHostKeyFingerprint);
+                            Logger.WriteLine("WARNING! Giving up security and accepting any key as configured");
+                            break;
+                        case SshHostKeyPolicy.AcceptNew:
+                            if (!string.IsNullOrEmpty(sshHostKeyFingerprint))
+                            {
+                                throw Logger.WriteException(new ArgumentException("SessionOptions.SshHostKeyFingerprint is set and SshHostKeyPolicy is not Check"));
+                            }
+                            sshHostKeyFingerprint = "acceptnew";
+                            break;
                     }
                     }
                     switches.Add(FormatSwitch("hostkey", sshHostKeyFingerprint));
                     switches.Add(FormatSwitch("hostkey", sshHostKeyFingerprint));
                 }
                 }
@@ -2102,6 +2294,7 @@ namespace WinSCP
                 {
                 {
                     _logReader.SetTimeouted();
                     _logReader.SetTimeouted();
                 }
                 }
+                Cleanup();
                 throw Logger.WriteException(new TimeoutException(message));
                 throw Logger.WriteException(new TimeoutException(message));
             }
             }
 
 
@@ -2109,6 +2302,14 @@ namespace WinSCP
             {
             {
                 throw Logger.WriteException(new SessionLocalException(this, "Aborted."));
                 throw Logger.WriteException(new SessionLocalException(this, "Aborted."));
             }
             }
+
+            if (_throwStdOut && (_process.StdOut != null) && _process.StdOut.ReadAvailable(1))
+            {
+                // This is here to return from GetFile asap (?)
+                // Not logging the exception, as it's not really an exception.
+                Logger.WriteLine("Got data");
+                throw new StdOutException();
+            }
         }
         }
 
 
         private void RaiseFileTransferredEvent(TransferEventArgs args)
         private void RaiseFileTransferredEvent(TransferEventArgs args)
@@ -2200,6 +2401,7 @@ namespace WinSCP
 
 
         internal void UnregisterOperationResult(OperationResultBase operationResult)
         internal void UnregisterOperationResult(OperationResultBase operationResult)
         {
         {
+            // GetFile relies on this not to throw
             _operationResults.Remove(operationResult);
             _operationResults.Remove(operationResult);
         }
         }
 
 
@@ -2306,10 +2508,12 @@ namespace WinSCP
             }
             }
         }
         }
 
 
+#if !NETSTANDARD
         private static string GetTypeLibKey(Type t)
         private static string GetTypeLibKey(Type t)
         {
         {
             return "CLSID\\{" + t.GUID.ToString().ToUpperInvariant() + "}\\TypeLib";
             return "CLSID\\{" + t.GUID.ToString().ToUpperInvariant() + "}\\TypeLib";
         }
         }
+#endif
 
 
         FieldInfo IReflect.GetField(string name, BindingFlags bindingAttr)
         FieldInfo IReflect.GetField(string name, BindingFlags bindingAttr)
         {
         {
@@ -2588,7 +2792,6 @@ namespace WinSCP
         private ElementLogReader _reader;
         private ElementLogReader _reader;
         private SessionLogReader _logReader;
         private SessionLogReader _logReader;
         private readonly IList<OperationResultBase> _operationResults;
         private readonly IList<OperationResultBase> _operationResults;
-        private delegate void Action();
         private readonly IList<Action> _events;
         private readonly IList<Action> _events;
         private AutoResetEvent _eventsEvent;
         private AutoResetEvent _eventsEvent;
         private ManualResetEvent _choiceEvent;
         private ManualResetEvent _choiceEvent;
@@ -2615,5 +2818,6 @@ namespace WinSCP
         private bool _ignoreFailed;
         private bool _ignoreFailed;
         private TimeSpan _sessionTimeout;
         private TimeSpan _sessionTimeout;
         private QueryReceivedEventHandler _queryReceived;
         private QueryReceivedEventHandler _queryReceived;
+        private bool _throwStdOut;
     }
     }
 }
 }

+ 45 - 6
dotnet/SessionOptions.cs

@@ -35,6 +35,15 @@ namespace WinSCP
         Explicit = 3,
         Explicit = 3,
     }
     }
 
 
+    [Guid("8A98AB8F-30E8-4539-A3DE-A33DDC43B33C")]
+    [ComVisible(true)]
+    public enum SshHostKeyPolicy
+    {
+        Check = 0,
+        GiveUpSecurityAndAcceptAny = 1,
+        AcceptNew = 2,
+    }
+
     [Guid("2D4EF368-EE80-4C15-AE77-D12AEAF4B00A")]
     [Guid("2D4EF368-EE80-4C15-AE77-D12AEAF4B00A")]
     [ClassInterface(Constants.ClassInterface)]
     [ClassInterface(Constants.ClassInterface)]
     [ComVisible(true)]
     [ComVisible(true)]
@@ -63,7 +72,9 @@ namespace WinSCP
 
 
         // SSH
         // SSH
         public string SshHostKeyFingerprint { get { return _sshHostKeyFingerprint; } set { SetSshHostKeyFingerprint(value); } }
         public string SshHostKeyFingerprint { get { return _sshHostKeyFingerprint; } set { SetSshHostKeyFingerprint(value); } }
-        public bool GiveUpSecurityAndAcceptAnySshHostKey { get; set; }
+        public SshHostKeyPolicy SshHostKeyPolicy { get; set; }
+        [Obsolete("Use SshHostKeyPolicy")]
+        public bool GiveUpSecurityAndAcceptAnySshHostKey { get { return GetGiveUpSecurityAndAcceptAnySshHostKey(); } set { SetGiveUpSecurityAndAcceptAnySshHostKey(value); } }
         public string SshPrivateKeyPath { get; set; }
         public string SshPrivateKeyPath { get; set; }
         [Obsolete("Use PrivateKeyPassphrase")]
         [Obsolete("Use PrivateKeyPassphrase")]
         public string SshPrivateKeyPassphrase { get { return PrivateKeyPassphrase; } set { PrivateKeyPassphrase = value; } }
         public string SshPrivateKeyPassphrase { get { return PrivateKeyPassphrase; } set { PrivateKeyPassphrase = value; } }
@@ -171,6 +182,9 @@ namespace WinSCP
                 portNumber = hostInfo;
                 portNumber = hostInfo;
             }
             }
 
 
+            // Contrary to TSessionData::ParseUrl, not converting Webdav to S3 on S3 hostname.
+            // Not sure if it is desirable and WinSCP will do the conversion for us later anyway.
+
             if (string.IsNullOrEmpty(HostName))
             if (string.IsNullOrEmpty(HostName))
             {
             {
                 throw new ArgumentException("No host name", nameof(url));
                 throw new ArgumentException("No host name", nameof(url));
@@ -196,7 +210,7 @@ namespace WinSCP
             UserName = null;
             UserName = null;
             Password = null;
             Password = null;
             SshHostKeyFingerprint = null;
             SshHostKeyFingerprint = null;
-            GiveUpSecurityAndAcceptAnySshHostKey = false;
+            SshHostKeyPolicy = SshHostKeyPolicy.Check;
             TlsHostCertificateFingerprint = null;
             TlsHostCertificateFingerprint = null;
             GiveUpSecurityAndAcceptAnyTlsHostCertificate = false;
             GiveUpSecurityAndAcceptAnyTlsHostCertificate = false;
             if (!string.IsNullOrEmpty(userInfo))
             if (!string.IsNullOrEmpty(userInfo))
@@ -216,7 +230,22 @@ namespace WinSCP
                     const string RawSettingsPrefix = "x-";
                     const string RawSettingsPrefix = "x-";
                     if (parameterName.Equals("fingerprint", StringComparison.OrdinalIgnoreCase))
                     if (parameterName.Equals("fingerprint", StringComparison.OrdinalIgnoreCase))
                     {
                     {
-                        SshHostKeyFingerprint = parameter;
+                        switch (Protocol)
+                        {
+                            case Protocol.Sftp:
+                            case Protocol.Scp:
+                                SshHostKeyFingerprint = parameter;
+                                break;
+
+                            case Protocol.Ftp:
+                            case Protocol.Webdav:
+                            case Protocol.S3:
+                                TlsHostCertificateFingerprint = parameter;
+                                break;
+
+                            default:
+                                throw new ArgumentException();
+                        }
                     }
                     }
                     else if (parameterName.StartsWith(RawSettingsPrefix, StringComparison.OrdinalIgnoreCase))
                     else if (parameterName.StartsWith(RawSettingsPrefix, StringComparison.OrdinalIgnoreCase))
                     {
                     {
@@ -375,9 +404,9 @@ namespace WinSCP
 
 
         private void SetPortNumber(int value)
         private void SetPortNumber(int value)
         {
         {
-            if (value < 0)
+            if ((value < 0) || (value > 65535))
             {
             {
-                throw new ArgumentException("Port number cannot be negative");
+                throw new ArgumentOutOfRangeException("Port number has to be in range from 0 to 65535");
             }
             }
 
 
             _portNumber = value;
             _portNumber = value;
@@ -468,6 +497,16 @@ namespace WinSCP
             return Name;
             return Name;
         }
         }
 
 
+        private void SetGiveUpSecurityAndAcceptAnySshHostKey(bool value)
+        {
+            SshHostKeyPolicy = value ? SshHostKeyPolicy.GiveUpSecurityAndAcceptAny : SshHostKeyPolicy.Check;
+        }
+
+        private bool GetGiveUpSecurityAndAcceptAnySshHostKey()
+        {
+            return (SshHostKeyPolicy == SshHostKeyPolicy.GiveUpSecurityAndAcceptAny);
+        }
+
         private SecureString _securePassword;
         private SecureString _securePassword;
         private SecureString _secureNewPassword;
         private SecureString _secureNewPassword;
         private SecureString _securePrivateKeyPassphrase;
         private SecureString _securePrivateKeyPassphrase;
@@ -483,7 +522,7 @@ namespace WinSCP
         private const string _sshHostKeyPattern = @"((ssh-rsa|ssh-dss|ssh-ed25519|ecdsa-sha2-nistp(256|384|521))( |-))?(\d+ )?(([0-9a-fA-F]{2}(:|-)){15}[0-9a-fA-F]{2}|[0-9a-zA-Z+/\-_]{43}=?)";
         private const string _sshHostKeyPattern = @"((ssh-rsa|ssh-dss|ssh-ed25519|ecdsa-sha2-nistp(256|384|521))( |-))?(\d+ )?(([0-9a-fA-F]{2}(:|-)){15}[0-9a-fA-F]{2}|[0-9a-zA-Z+/\-_]{43}=?)";
         private static readonly Regex _sshHostKeyRegex =
         private static readonly Regex _sshHostKeyRegex =
             new Regex(string.Format(CultureInfo.InvariantCulture, _listPattern, _sshHostKeyPattern));
             new Regex(string.Format(CultureInfo.InvariantCulture, _listPattern, _sshHostKeyPattern));
-        private const string _tlsCertificatePattern = @"([0-9a-fA-F]{2}[:\-]){19}[0-9a-fA-F]{2}";
+        private const string _tlsCertificatePattern = @"((([0-9a-fA-F]{2}[:\-]){31})|(([0-9a-fA-F]{2}[:\-]){19}))[0-9a-fA-F]{2}";
         private static readonly Regex _tlsCertificateRegex =
         private static readonly Regex _tlsCertificateRegex =
             new Regex(string.Format(CultureInfo.InvariantCulture, _listPattern, _tlsCertificatePattern));
             new Regex(string.Format(CultureInfo.InvariantCulture, _listPattern, _tlsCertificatePattern));
     }
     }

+ 7 - 2
dotnet/internal/Callstack.cs

@@ -21,8 +21,8 @@ namespace WinSCP
                 {
                 {
                     StackFrame frame = stackTrace.GetFrame(i);
                     StackFrame frame = stackTrace.GetFrame(i);
                     method = frame.GetMethod();
                     method = frame.GetMethod();
-                    if ((method.IsConstructor && ((method.DeclaringType == type) || method.DeclaringType.IsSubclassOf(type))) ||
-                        ((method.MemberType == MemberTypes.Method) && ((MethodInfo)method).ReturnType == type))
+                    if ((method.IsConstructor && IsTypeOrSubType(method.DeclaringType, type)) ||
+                        ((method.MemberType == MemberTypes.Method) && IsTypeOrSubType(((MethodInfo)method).ReturnType, type)))
                     {
                     {
                         method = null;
                         method = null;
                     }
                     }
@@ -47,6 +47,11 @@ namespace WinSCP
             }
             }
         }
         }
 
 
+        private static bool IsTypeOrSubType(Type tested, Type type)
+        {
+            return (tested == type) || tested.IsSubclassOf(type);
+        }
+
         public virtual void Dispose()
         public virtual void Dispose()
         {
         {
             if (_name != null)
             if (_name != null)

+ 10 - 2
dotnet/internal/CallstackAndLock.cs

@@ -11,10 +11,18 @@
 
 
         public override void Dispose()
         public override void Dispose()
         {
         {
-            _lock.Exit();
+            if (_lock != null)
+            {
+                _lock.Exit();
+            }
             base.Dispose();
             base.Dispose();
         }
         }
 
 
-        private readonly Lock _lock;
+        public void DisarmLock()
+        {
+            _lock = null;
+        }
+
+        private Lock _lock;
     }
     }
 }
 }

+ 26 - 3
dotnet/internal/ConsoleCommStruct.cs

@@ -4,14 +4,20 @@ using Microsoft.Win32.SafeHandles;
 
 
 namespace WinSCP
 namespace WinSCP
 {
 {
-    public enum ConsoleEvent { None, Print, Input, Choice, Title, Init, Progress }
+    public enum ConsoleEvent { None, Print, Input, Choice, Title, Init, Progress, TransferOut, TransferIn }
 
 
     [StructLayout(LayoutKind.Sequential)]
     [StructLayout(LayoutKind.Sequential)]
     internal class ConsoleInitEventStruct
     internal class ConsoleInitEventStruct
     {
     {
         public uint InputType;
         public uint InputType;
         public uint OutputType;
         public uint OutputType;
+        [MarshalAs(UnmanagedType.I1)]
         public bool WantsProgress; // since version 6
         public bool WantsProgress; // since version 6
+        [MarshalAs(UnmanagedType.I1)]
+        public bool UseStdErr; // since version 10
+        public enum StdInOut { Off, Binary, Chunked }
+        public StdInOut BinaryOutput; // since version 10
+        public StdInOut BinaryInput; // since version 10
     }
     }
 
 
     [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
     [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
@@ -80,9 +86,21 @@ namespace WinSCP
         public uint OverallProgress;
         public uint OverallProgress;
         public uint FileProgress;
         public uint FileProgress;
         public uint CPS;
         public uint CPS;
+        [MarshalAs(UnmanagedType.I1)]
         public bool Cancel; // since version 8
         public bool Cancel; // since version 8
     }
     }
 
 
+    // Since version 10
+    [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
+    internal class ConsoleTransferEventStruct
+    {
+        [MarshalAs(UnmanagedType.ByValArray, SizeConst = 20480)]
+        public byte[] Data;
+        public UIntPtr Len;
+        [MarshalAs(UnmanagedType.I1)]
+        public bool Error; // TransferIn only
+    }
+
     [StructLayout(LayoutKind.Sequential)]
     [StructLayout(LayoutKind.Sequential)]
     internal class ConsoleCommHeader
     internal class ConsoleCommHeader
     {
     {
@@ -95,7 +113,7 @@ namespace WinSCP
 
 
     internal class ConsoleCommStruct : IDisposable
     internal class ConsoleCommStruct : IDisposable
     {
     {
-        public const int CurrentVersion = 0x0009;
+        public const int CurrentVersion = 0x000A;
 
 
         public ConsoleCommStruct(Session session, SafeFileHandle fileMapping)
         public ConsoleCommStruct(Session session, SafeFileHandle fileMapping)
         {
         {
@@ -162,6 +180,10 @@ namespace WinSCP
 
 
         public ConsoleProgressEventStruct ProgressEvent { get { return UnmarshalPayload<ConsoleProgressEventStruct>(ConsoleEvent.Progress); } }
         public ConsoleProgressEventStruct ProgressEvent { get { return UnmarshalPayload<ConsoleProgressEventStruct>(ConsoleEvent.Progress); } }
 
 
+        public ConsoleTransferEventStruct TransferOutEvent { get { return UnmarshalPayload<ConsoleTransferEventStruct>(ConsoleEvent.TransferOut); } }
+
+        public ConsoleTransferEventStruct TransferInEvent { get { return UnmarshalPayload<ConsoleTransferEventStruct>(ConsoleEvent.TransferIn); } }
+
         private T UnmarshalPayload<T>(ConsoleEvent e)
         private T UnmarshalPayload<T>(ConsoleEvent e)
         {
         {
             CheckNotDisposed();
             CheckNotDisposed();
@@ -194,7 +216,8 @@ namespace WinSCP
                 Type[] types =
                 Type[] types =
                     new[] {
                     new[] {
                         typeof(ConsolePrintEventStruct), typeof(ConsoleInitEventStruct), typeof(ConsoleInputEventStruct),
                         typeof(ConsolePrintEventStruct), typeof(ConsoleInitEventStruct), typeof(ConsoleInputEventStruct),
-                        typeof(ConsoleChoiceEventStruct), typeof(ConsoleTitleEventStruct), typeof(ConsoleProgressEventStruct) };
+                        typeof(ConsoleChoiceEventStruct), typeof(ConsoleTitleEventStruct), typeof(ConsoleProgressEventStruct),
+                        typeof(ConsoleTransferEventStruct) };
 
 
                 int maxSize = 0;
                 int maxSize = 0;
                 foreach (Type type in types)
                 foreach (Type type in types)

+ 1 - 1
dotnet/internal/ElementLogReader.cs

@@ -86,6 +86,6 @@ namespace WinSCP
         private readonly string _localName;
         private readonly string _localName;
         private readonly int _depth;
         private readonly int _depth;
         protected bool _read;
         protected bool _read;
-        private string _token;
+        private readonly string _token;
     }
     }
 }
 }

+ 203 - 18
dotnet/internal/ExeSessionProcess.cs

@@ -4,12 +4,18 @@ using System.Diagnostics;
 using System.Globalization;
 using System.Globalization;
 using System.IO;
 using System.IO;
 using System.Threading;
 using System.Threading;
+#if !NETSTANDARD
 using Microsoft.Win32;
 using Microsoft.Win32;
+#endif
 using Microsoft.Win32.SafeHandles;
 using Microsoft.Win32.SafeHandles;
 using System.Runtime.InteropServices;
 using System.Runtime.InteropServices;
 using System.Reflection;
 using System.Reflection;
+#if !NETSTANDARD
 using System.Security.Principal;
 using System.Security.Principal;
 using System.Security.AccessControl;
 using System.Security.AccessControl;
+#endif
+using System.ComponentModel;
+using System.Security.Cryptography;
 
 
 namespace WinSCP
 namespace WinSCP
 {
 {
@@ -19,6 +25,8 @@ namespace WinSCP
 
 
         public bool HasExited { get { return _process.HasExited; } }
         public bool HasExited { get { return _process.HasExited; } }
         public int ExitCode { get { return _process.ExitCode; } }
         public int ExitCode { get { return _process.ExitCode; } }
+        public PipeStream StdOut { get; set; }
+        public Stream StdIn { get; set; }
 
 
         public static ExeSessionProcess CreateForSession(Session session)
         public static ExeSessionProcess CreateForSession(Session session)
         {
         {
@@ -85,7 +93,7 @@ namespace WinSCP
                 }
                 }
 
 
                 string logLevelSwitch = null;
                 string logLevelSwitch = null;
-                if (_session.DebugLogLevel > 0)
+                if (_session.DebugLogLevel != 0)
                 {
                 {
                     logLevelSwitch = string.Format(CultureInfo.InvariantCulture, "/loglevel={0} ", _session.DebugLogLevel);
                     logLevelSwitch = string.Format(CultureInfo.InvariantCulture, "/loglevel={0} ", _session.DebugLogLevel);
                 }
                 }
@@ -98,7 +106,7 @@ namespace WinSCP
                     string.Format(CultureInfo.InvariantCulture, "/dotnet={0} ", assemblyVersionStr);
                     string.Format(CultureInfo.InvariantCulture, "/dotnet={0} ", assemblyVersionStr);
 
 
                 string arguments =
                 string arguments =
-                    xmlLogSwitch + "/nointeractiveinput " + assemblyVersionSwitch +
+                    xmlLogSwitch + "/nointeractiveinput /stdout /stdin " + assemblyVersionSwitch +
                     configSwitch + logSwitch + logLevelSwitch + _session.AdditionalExecutableArguments;
                     configSwitch + logSwitch + logLevelSwitch + _session.AdditionalExecutableArguments;
 
 
                 Tools.AddRawParameters(ref arguments, _session.RawConfiguration, "/rawconfig", false);
                 Tools.AddRawParameters(ref arguments, _session.RawConfiguration, "/rawconfig", false);
@@ -270,22 +278,31 @@ namespace WinSCP
         {
         {
             using (_logger.CreateCallstack())
             using (_logger.CreateCallstack())
             {
             {
-                while (!AbortedOrExited())
+                try
                 {
                 {
-                    _logger.WriteLineLevel(1, "Waiting for request event");
-                    // Keep in sync with a delay in SessionLogReader.DoRead
-                    if (_requestEvent.WaitOne(100, false))
+                    while (!AbortedOrExited())
                     {
                     {
-                        _logger.WriteLineLevel(1, "Got request event");
-                        ProcessEvent();
-                    }
+                        _logger.WriteLineLevel(1, "Waiting for request event");
+                        // Keep in sync with a delay in SessionLogReader.DoRead
+                        if (_requestEvent.WaitOne(100, false))
+                        {
+                            _logger.WriteLineLevel(1, "Got request event");
+                            ProcessEvent();
+                        }
 
 
-                    if (_logger.LogLevel >= 1)
-                    {
-                        _logger.WriteLine(string.Format(CultureInfo.InvariantCulture, "2nd generation collection count: {0}", GC.CollectionCount(2)));
-                        _logger.WriteLine(string.Format(CultureInfo.InvariantCulture, "Total memory allocated: {0}", GC.GetTotalMemory(false)));
+                        if (_logger.LogLevel >= 1)
+                        {
+                            _logger.WriteLine(string.Format(CultureInfo.InvariantCulture, "2nd generation collection count: {0}", GC.CollectionCount(2)));
+                            _logger.WriteLine(string.Format(CultureInfo.InvariantCulture, "Total memory allocated: {0}", GC.GetTotalMemory(false)));
+                        }
                     }
                     }
                 }
                 }
+                catch (Exception e)
+                {
+                    _logger.WriteLine("Error while processing events");
+                    _logger.WriteException(e);
+                    throw;
+                }
             }
             }
         }
         }
 
 
@@ -321,12 +338,21 @@ namespace WinSCP
                             ProcessProgressEvent(commStruct.ProgressEvent);
                             ProcessProgressEvent(commStruct.ProgressEvent);
                             break;
                             break;
 
 
+                        case ConsoleEvent.TransferOut:
+                            ProcessTransferOutEvent(commStruct.TransferOutEvent);
+                            break;
+
+                        case ConsoleEvent.TransferIn:
+                            ProcessTransferInEvent(commStruct.TransferInEvent);
+                            break;
+
                         default:
                         default:
                             throw _logger.WriteException(new NotImplementedException());
                             throw _logger.WriteException(new NotImplementedException());
                     }
                     }
                 }
                 }
 
 
                 _responseEvent.Set();
                 _responseEvent.Set();
+                _logger.WriteLineLevel(1, "Response event set");
             }
             }
         }
         }
 
 
@@ -462,6 +488,13 @@ namespace WinSCP
         {
         {
             using (_logger.CreateCallstack())
             using (_logger.CreateCallstack())
             {
             {
+                if (!e.UseStdErr ||
+                    (e.BinaryOutput != ConsoleInitEventStruct.StdInOut.Binary) ||
+                    (e.BinaryInput != ConsoleInitEventStruct.StdInOut.Binary))
+                {
+                    throw _logger.WriteException(new InvalidOperationException("Unexpected console interface options"));
+                }
+
                 e.InputType = 3; // pipe
                 e.InputType = 3; // pipe
                 e.OutputType = 3; // pipe
                 e.OutputType = 3; // pipe
                 e.WantsProgress = _session.WantsProgress;
                 e.WantsProgress = _session.WantsProgress;
@@ -520,6 +553,56 @@ namespace WinSCP
             }
             }
         }
         }
 
 
+        private void ProcessTransferOutEvent(ConsoleTransferEventStruct e)
+        {
+            using (_logger.CreateCallstack())
+            {
+                _logger.WriteLine("Len [{0}]", e.Len);
+
+                if (StdOut == null)
+                {
+                    throw _logger.WriteException(new InvalidOperationException("Unexpected data"));
+                }
+                int len = (int)e.Len;
+                if (len > 0)
+                {
+                    StdOut.WriteInternal(e.Data, 0, len);
+                    _logger.WriteLine("Data written to the buffer");
+                }
+                else
+                {
+                    StdOut.CloseWrite();
+                    _logger.WriteLine("Data buffer closed");
+                }
+            }
+        }
+
+        private void ProcessTransferInEvent(ConsoleTransferEventStruct e)
+        {
+            using (_logger.CreateCallstack())
+            {
+                _logger.WriteLine("Len [{0}]", e.Len);
+
+                if (StdIn == null)
+                {
+                    throw _logger.WriteException(new InvalidOperationException("Unexpected data request"));
+                }
+                try
+                {
+                    int len = (int)e.Len;
+                    len = StdIn.Read(e.Data, 0, len);
+                    _logger.WriteLine("{0} bytes read", len);
+                    e.Len = (UIntPtr)len;
+                }
+                catch (Exception ex)
+                {
+                    _logger.WriteLine("Error reading data stream");
+                    _logger.WriteException(ex);
+                    e.Error = true;
+                }
+            }
+        }
+
         private void InitializeConsole()
         private void InitializeConsole()
         {
         {
             using (_logger.CreateCallstack())
             using (_logger.CreateCallstack())
@@ -934,6 +1017,22 @@ namespace WinSCP
             return path;
             return path;
         }
         }
 
 
+        [DllImport("version.dll", CharSet = CharSet.Auto, SetLastError = true, BestFitMapping = false)]
+        public static extern int GetFileVersionInfoSize(string lptstrFilename, out int handle);
+
+        [DllImport("kernel32.dll", SetLastError = true)]
+        static extern IntPtr LoadLibraryEx(string lpFileName, IntPtr hReservedNull, uint dwFlags);
+
+        [DllImport("kernel32.dll", SetLastError = true)]
+        [return: MarshalAs(UnmanagedType.Bool)]
+        static extern bool FreeLibrary(IntPtr hModule);
+
+        [DllImport("kernel32.dll", SetLastError = true)]
+        static extern IntPtr FindResource(IntPtr hModule, string lpName, string lpType);
+
+        [DllImport("kernel32.dll", SetLastError = true)]
+        static extern uint SizeofResource(IntPtr hModule, IntPtr hResInfo);
+
         private void CheckVersion(string exePath, FileVersionInfo assemblyVersion)
         private void CheckVersion(string exePath, FileVersionInfo assemblyVersion)
         {
         {
             using (_logger.CreateCallstack())
             using (_logger.CreateCallstack())
@@ -952,17 +1051,103 @@ namespace WinSCP
 
 
                     _logger.WriteLine("Version of {0} is {1}, product {2} version is {3}", exePath, version.FileVersion, version.ProductName, version.ProductVersion);
                     _logger.WriteLine("Version of {0} is {1}, product {2} version is {3}", exePath, version.FileVersion, version.ProductName, version.ProductVersion);
 
 
+                    Exception accessException = null;
+                    try
+                    {
+                        using (File.OpenRead(exePath))
+                        {
+                        }
+                        long size = new FileInfo(exePath).Length;
+                        _logger.WriteLine($"Size of the executable file is {size}");
+
+                        int verInfoSize = GetFileVersionInfoSize(exePath, out int handle);
+                        if (verInfoSize == 0)
+                        {
+                            throw new Exception($"Cannot retrieve {exePath} version info", new Win32Exception());
+                        }
+                        else
+                        {
+                            _logger.WriteLine($"Size of the executable file version info is {verInfoSize}");
+                        }
+                    }
+                    catch (Exception e)
+                    {
+                        _logger.WriteLine("Accessing executable file failed");
+                        _logger.WriteException(e);
+                        accessException = e;
+                    }
+
                     if (_session.DisableVersionCheck)
                     if (_session.DisableVersionCheck)
                     {
                     {
                         _logger.WriteLine("Version check disabled (not recommended)");
                         _logger.WriteLine("Version check disabled (not recommended)");
                     }
                     }
                     else if (assemblyVersion.ProductVersion != version.ProductVersion)
                     else if (assemblyVersion.ProductVersion != version.ProductVersion)
                     {
                     {
-                        throw _logger.WriteException(
-                            new SessionLocalException(
-                                _session, string.Format(CultureInfo.CurrentCulture,
-                                    "The version of {0} ({1}) does not match version of this assembly {2} ({3}).",
-                                    exePath, version.ProductVersion, _logger.GetAssemblyFilePath(), assemblyVersion.ProductVersion)));
+                        try
+                        {
+                            using (SHA256 SHA256 = SHA256.Create())
+                            using (FileStream stream = File.OpenRead(exePath))
+                            {
+                                string sha256 = string.Concat(Array.ConvertAll(SHA256.ComputeHash(stream), b => b.ToString("x2")));
+                                _logger.WriteLine($"SHA-256 of the executable file is {sha256}");
+                            }
+                        }
+                        catch (Exception e)
+                        {
+                            _logger.WriteLine("Calculating SHA-256 of the executable file failed");
+                            _logger.WriteException(e);
+                        }
+
+                        try
+                        {
+                            IntPtr library = LoadLibraryEx(exePath, IntPtr.Zero, 0x00000002); // LOAD_LIBRARY_AS_DATAFILE
+                            if (library == IntPtr.Zero)
+                            {
+                                _logger.WriteLine("Cannot load");
+                                _logger.WriteException(new Win32Exception());
+                            }
+                            else
+                            {
+                                IntPtr resource = FindResource(library, "#1", "#16");
+                                if (resource == IntPtr.Zero)
+                                {
+                                    _logger.WriteLine("Cannot find version resource");
+                                    _logger.WriteException(new Win32Exception());
+                                }
+                                else
+                                {
+                                    uint resourceSize = SizeofResource(library, resource);
+                                    if (resourceSize == 0)
+                                    {
+                                        _logger.WriteLine("Cannot find size of version resource");
+                                        _logger.WriteException(new Win32Exception());
+                                    }
+                                    else
+                                    {
+                                        _logger.WriteLine($"Version resource size is {resourceSize}");
+                                    }
+                                }
+                                FreeLibrary(library);
+                            }
+                        }
+                        catch (Exception e)
+                        {
+                            _logger.WriteLine("Querying version resource failed");
+                            _logger.WriteException(e);
+                        }
+
+                        string message;
+                        if (string.IsNullOrEmpty(version.ProductVersion) && (accessException != null))
+                        {
+                            message = $"Cannot use {exePath}";
+                        }
+                        else
+                        {
+                            message =
+                                $"The version of {exePath} ({version.ProductVersion}) does not match " +
+                                $"version of this assembly {_logger.GetAssemblyFilePath()} ({assemblyVersion.ProductVersion}).";
+                        }
+                        throw _logger.WriteException(new SessionLocalException(_session, message, accessException));
                     }
                     }
                 }
                 }
             }
             }

+ 0 - 1
dotnet/internal/ISessionProcess.cs

@@ -1,5 +1,4 @@
 using System;
 using System;
-using System.Diagnostics;
 
 
 namespace WinSCP
 namespace WinSCP
 {
 {

+ 25 - 0
dotnet/internal/ImplicitEnumerable.cs

@@ -0,0 +1,25 @@
+using System.Collections;
+using System.Collections.Generic;
+
+namespace WinSCP
+{
+    internal class ImplicitEnumerable<T> : IEnumerable<T>
+    {
+        private readonly IEnumerable<T> _enumerable;
+
+        public ImplicitEnumerable(IEnumerable<T> enumerable)
+        {
+            _enumerable = enumerable;
+        }
+
+        public IEnumerator<T> GetEnumerator()
+        {
+            return _enumerable.GetEnumerator();
+        }
+
+        IEnumerator IEnumerable.GetEnumerator()
+        {
+            return GetEnumerator();
+        }
+    }
+}

+ 1 - 1
dotnet/internal/Job.cs

@@ -67,6 +67,6 @@ namespace WinSCP
         }
         }
 
 
         private IntPtr _handle;
         private IntPtr _handle;
-        private Logger _logger;
+        private readonly Logger _logger;
     }
     }
 }
 }

+ 17 - 6
dotnet/internal/Logger.cs

@@ -15,6 +15,7 @@ namespace WinSCP
         public string LogPath { get { return _logPath; } set { SetLogPath(value); } }
         public string LogPath { get { return _logPath; } set { SetLogPath(value); } }
         public int LogLevel { get { return _logLevel; } set { SetLogLevel(value); } }
         public int LogLevel { get { return _logLevel; } set { SetLogLevel(value); } }
         public bool Logging { get { return (_writter != null) && _writter.BaseStream.CanWrite; } }
         public bool Logging { get { return (_writter != null) && _writter.BaseStream.CanWrite; } }
+        public Lock Lock { get; } = new Lock();
 
 
         public string GetAssemblyFilePath()
         public string GetAssemblyFilePath()
         {
         {
@@ -41,7 +42,18 @@ namespace WinSCP
 
 
             // It's also good to know that the CodeBase is not guaranteed to be set for assemblies in the GAC.
             // It's also good to know that the CodeBase is not guaranteed to be set for assemblies in the GAC.
             // Location will always be set for assemblies loaded from disk, however.
             // Location will always be set for assemblies loaded from disk, however.
-            string codeBase = assembly.CodeBase;
+            string codeBase;
+            try
+            {
+                codeBase = assembly.CodeBase;
+            }
+            catch (NotSupportedException e)
+            {
+                // CodeBase is not supported on assemblies loaded from a single-file bundle
+                WriteLine($"CodeBase not supported: {e.Message}");
+                codeBase = string.Empty;
+            }
+
             string location = assembly.Location;
             string location = assembly.Location;
 
 
             // cannot use Uri.UnescapeDataString, because it treats some characters valid in
             // cannot use Uri.UnescapeDataString, because it treats some characters valid in
@@ -282,9 +294,9 @@ namespace WinSCP
             return new Callstack(this, token);
             return new Callstack(this, token);
         }
         }
 
 
-        public Callstack CreateCallstackAndLock()
+        public CallstackAndLock CreateCallstackAndLock()
         {
         {
-            return new CallstackAndLock(this, _lock);
+            return new CallstackAndLock(this, Lock);
         }
         }
 
 
         public Exception WriteException(Exception e)
         public Exception WriteException(Exception e)
@@ -395,7 +407,7 @@ namespace WinSCP
         {
         {
             if ((value < -1) || (value > 2))
             if ((value < -1) || (value > 2))
             {
             {
-                throw WriteException(new ArgumentOutOfRangeException(string.Format(CultureInfo.CurrentCulture, "Logging level has to be in range 0-2")));
+                throw WriteException(new ArgumentOutOfRangeException(string.Format(CultureInfo.CurrentCulture, "Logging level has to be in range -1 to 2")));
             }
             }
             _logLevel = value;
             _logLevel = value;
         }
         }
@@ -404,9 +416,8 @@ namespace WinSCP
         private string _logPath;
         private string _logPath;
         private readonly Dictionary<int, int> _indents = new Dictionary<int, int>();
         private readonly Dictionary<int, int> _indents = new Dictionary<int, int>();
         private readonly object _logLock = new object();
         private readonly object _logLock = new object();
-        private readonly Lock _lock = new Lock();
 #if !NETSTANDARD
 #if !NETSTANDARD
-        private List<PerformanceCounter> _performanceCounters = new List<PerformanceCounter>();
+        private readonly List<PerformanceCounter> _performanceCounters = new List<PerformanceCounter>();
 #endif
 #endif
         private int _logLevel;
         private int _logLevel;
     }
     }

+ 1 - 1
dotnet/internal/PatientFileStream.cs

@@ -148,6 +148,6 @@ namespace WinSCP
         }
         }
 
 
         private FileStream _stream;
         private FileStream _stream;
-        private Session _session;
+        private readonly Session _session;
     }
     }
 }
 }

+ 375 - 0
dotnet/internal/PipeStream.cs

@@ -0,0 +1,375 @@
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Threading;
+
+namespace WinSCP
+{
+    /// <summary>
+    /// PipeStream is a thread-safe read/write data stream for use between two threads in a
+    /// single-producer/single-consumer type problem.
+    /// </summary>
+    /// <version>2006/10/13 1.0</version>
+    /// <remarks>Update on 2008/10/9 1.1 - uses Monitor instead of Manual Reset events for more elegant synchronicity.</remarks>
+    /// <license>
+    ///  Copyright (c) 2006 James Kolpack (james dot kolpack at google mail)
+    ///
+    ///  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
+    ///  associated documentation files (the "Software"), to deal in the Software without restriction,
+    ///  including without limitation the rights to use, copy, modify, merge, publish, distribute,
+    ///  sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
+    ///  furnished to do so, subject to the following conditions:
+    ///
+    ///  The above copyright notice and this permission notice shall be included in all copies or
+    ///  substantial portions of the Software.
+    ///
+    ///  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+    ///  INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+    ///  PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+    ///  LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT
+    ///  OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+    ///  OTHER DEALINGS IN THE SOFTWARE.
+    /// </license>
+    internal class PipeStream : Stream
+    {
+        #region Private members
+
+        /// <summary>
+        /// Queue of bytes provides the datastructure for transmitting from an
+        /// input stream to an output stream.
+        /// </summary>
+        /// <remarks>Possible more effecient ways to accomplish this.</remarks>
+        private readonly Queue<byte> _buffer = new Queue<byte>();
+
+        /// <summary>
+        /// Indicates that the input stream has been flushed and that
+        /// all remaining data should be written to the output stream.
+        /// </summary>
+        private bool _isFlushed;
+
+        /// <summary>
+        /// Indicates whether the current <see cref="PipeStream"/> is disposed.
+        /// </summary>
+        private bool _isDisposed;
+
+        private bool _closedWrite;
+
+        private long _position;
+
+        #endregion
+
+        #region Public properties
+
+        /// <summary>
+        /// Gets or sets the maximum number of bytes to store in the buffer.
+        /// </summary>
+        /// <value>The length of the max buffer.</value>
+        public long MaxBufferLength { get; set; } = 200 * 1024 * 1024;
+
+        public Action OnDispose { get; set; }
+
+        #endregion
+
+        #region Stream overide methods
+
+        /// <summary>
+        /// When overridden in a derived class, clears all buffers for this stream and causes any buffered data to be written to the underlying device.
+        /// </summary>
+        /// <exception cref="IOException">An I/O error occurs.</exception>
+        /// <exception cref="ObjectDisposedException">Methods were called after the stream was closed.</exception>
+        /// <remarks>
+        /// Once flushed, any subsequent read operations no longer block until requested bytes are available. Any write operation reactivates blocking
+        /// reads.
+        /// </remarks>
+        public override void Flush()
+        {
+            CheckDisposed();
+
+            _isFlushed = true;
+            lock (_buffer)
+            {
+                // unblock read hereby allowing buffer to be partially filled
+                Monitor.Pulse(_buffer);
+            }
+        }
+
+        /// <summary>
+        /// When overridden in a derived class, sets the position within the current stream.
+        /// </summary>
+        /// <returns>
+        /// The new position within the current stream.
+        /// </returns>
+        /// <param name="offset">A byte offset relative to the origin parameter.</param>
+        /// <param name="origin">A value of type <see cref="SeekOrigin"/> indicating the reference point used to obtain the new position.</param>
+        /// <exception cref="NotSupportedException">The stream does not support seeking, such as if the stream is constructed from a pipe or console output.</exception>
+        public override long Seek(long offset, SeekOrigin origin)
+        {
+            throw new NotSupportedException();
+        }
+
+        /// <summary>
+        /// When overridden in a derived class, sets the length of the current stream.
+        /// </summary>
+        /// <param name="value">The desired length of the current stream in bytes.</param>
+        /// <exception cref="NotSupportedException">The stream does not support both writing and seeking, such as if the stream is constructed from a pipe or console output.</exception>
+        public override void SetLength(long value)
+        {
+            throw new NotSupportedException();
+        }
+
+        ///<summary>
+        ///When overridden in a derived class, reads a sequence of bytes from the current stream and advances the position within the stream by the number of bytes read.
+        ///</summary>
+        ///<returns>
+        ///The total number of bytes read into the buffer. This can be less than the number of bytes requested if that many bytes are not currently available, or zero if the stream is closed or end of the stream has been reached.
+        ///</returns>
+        ///<param name="offset">The zero-based byte offset in buffer at which to begin storing the data read from the current stream.</param>
+        ///<param name="count">The maximum number of bytes to be read from the current stream.</param>
+        ///<param name="buffer">An array of bytes. When this method returns, the buffer contains the specified byte array with the values between offset and (offset + count - 1) replaced by the bytes read from the current source.</param>
+        ///<exception cref="ArgumentException">The sum of offset and count is larger than the buffer length.</exception>
+        ///<exception cref="ObjectDisposedException">Methods were called after the stream was closed.</exception>
+        ///<exception cref="NotSupportedException">The stream does not support reading.</exception>
+        ///<exception cref="ArgumentNullException"><paramref name="buffer"/> is <c>null</c>.</exception>
+        ///<exception cref="IOException">An I/O error occurs.</exception>
+        ///<exception cref="ArgumentOutOfRangeException">offset or count is negative.</exception>
+        public override int Read(byte[] buffer, int offset, int count)
+        {
+            if (offset != 0)
+                throw new NotSupportedException("Offsets with value of non-zero are not supported");
+            if (buffer == null)
+                throw new ArgumentNullException("buffer");
+            if (offset + count > buffer.Length)
+                throw new ArgumentException("The sum of offset and count is greater than the buffer length.");
+            if (offset < 0 || count < 0)
+                throw new ArgumentOutOfRangeException("offset", "offset or count is negative.");
+            CheckDisposed();
+            if (count == 0)
+                return 0;
+
+            var readLength = 0;
+
+            lock (_buffer)
+            {
+                while (!_isDisposed && !_closedWrite && !ReadAvailable(1))
+                {
+                    Monitor.Wait(_buffer);
+                }
+
+                // return zero when the read is interrupted by a close/dispose of the stream
+                if (_isDisposed)
+                {
+                    return 0;
+                }
+
+                // fill the read buffer
+                for (; readLength < count && _buffer.Count > 0; readLength++)
+                {
+                    buffer[readLength] = _buffer.Dequeue();
+                }
+
+                if (_closedWrite)
+                {
+                    // Throw any pending exception asap, not only once the stream is closed.
+                    // Also releases the lock.
+                    Closed();
+                }
+
+                Monitor.Pulse(_buffer);
+
+                _position += readLength;
+            }
+
+            return readLength;
+        }
+
+        /// <summary>
+        /// Returns true if there are
+        /// </summary>
+        /// <param name="count">The count.</param>
+        /// <returns><c>True</c> if data available; otherwise<c>false</c>.</returns>
+        public bool ReadAvailable(int count)
+        {
+            CheckDisposed();
+            var length = _buffer.Count;
+            return (_isFlushed || length >= count);
+        }
+
+        ///<summary>
+        ///When overridden in a derived class, writes a sequence of bytes to the current stream and advances the current position within this stream by the number of bytes written.
+        ///</summary>
+        ///<param name="offset">The zero-based byte offset in buffer at which to begin copying bytes to the current stream.</param>
+        ///<param name="count">The number of bytes to be written to the current stream.</param>
+        ///<param name="buffer">An array of bytes. This method copies count bytes from buffer to the current stream.</param>
+        ///<exception cref="IOException">An I/O error occurs.</exception>
+        ///<exception cref="NotSupportedException">The stream does not support writing.</exception>
+        ///<exception cref="ObjectDisposedException">Methods were called after the stream was closed.</exception>
+        ///<exception cref="ArgumentNullException"><paramref name="buffer"/> is <c>null</c>.</exception>
+        ///<exception cref="ArgumentException">The sum of offset and count is greater than the buffer length.</exception>
+        ///<exception cref="ArgumentOutOfRangeException">offset or count is negative.</exception>
+        public override void Write(byte[] buffer, int offset, int count)
+        {
+            throw new NotSupportedException();
+        }
+
+        public void WriteInternal(byte[] buffer, int offset, int count)
+        {
+            if (buffer == null)
+                throw new ArgumentNullException("buffer");
+            if (offset + count > buffer.Length)
+                throw new ArgumentException("The sum of offset and count is greater than the buffer length.");
+            if (offset < 0 || count < 0)
+                throw new ArgumentOutOfRangeException("offset", "offset or count is negative.");
+            if (count == 0)
+                return;
+            if (_closedWrite)
+                throw new InvalidOperationException("Stream closed for writes");
+
+            lock (_buffer)
+            {
+                // wait until the buffer isn't full
+                while (_buffer.Count >= MaxBufferLength)
+                    Monitor.Wait(_buffer);
+
+                if (!_isDisposed)
+                {
+                    _isFlushed = false; // if it were flushed before, it soon will not be.
+
+                    // queue up the buffer data
+                    for (var i = offset; i < offset + count; i++)
+                    {
+                        _buffer.Enqueue(buffer[i]);
+                    }
+
+                    Monitor.Pulse(_buffer); // signal that write has occurred
+                }
+            }
+        }
+
+        /// <summary>
+        /// Releases the unmanaged resources used by the Stream and optionally releases the managed resources.
+        /// </summary>
+        /// <param name="disposing"><c>true</c> to release both managed and unmanaged resources; <c>false</c> to release only unmanaged resources.</param>
+        /// <remarks>
+        /// Disposing a <see cref="PipeStream"/> will interrupt blocking read and write operations.
+        /// </remarks>
+        protected override void Dispose(bool disposing)
+        {
+            base.Dispose(disposing);
+
+            if (!_isDisposed)
+            {
+                lock (_buffer)
+                {
+                    _isDisposed = true;
+                    _buffer.Clear();
+                    Monitor.Pulse(_buffer);
+                }
+
+                Closed();
+            }
+        }
+
+        ///<summary>
+        ///When overridden in a derived class, gets a value indicating whether the current stream supports reading.
+        ///</summary>
+        ///<returns>
+        ///true if the stream supports reading; otherwise, false.
+        ///</returns>
+        public override bool CanRead
+        {
+            get { return !_isDisposed; }
+        }
+
+        /// <summary>
+        /// When overridden in a derived class, gets a value indicating whether the current stream supports seeking.
+        /// </summary>
+        /// <returns>
+        /// <c>true</c> if the stream supports seeking; otherwise, <c>false</c>.
+        ///</returns>
+        public override bool CanSeek
+        {
+            get { return false; }
+        }
+
+        /// <summary>
+        /// When overridden in a derived class, gets a value indicating whether the current stream supports writing.
+        /// </summary>
+        /// <returns>
+        /// <c>true</c> if the stream supports writing; otherwise, <c>false</c>.
+        /// </returns>
+        public override bool CanWrite
+        {
+            get { return false; }
+        }
+
+        /// <summary>
+        /// When overridden in a derived class, gets the length in bytes of the stream.
+        /// </summary>
+        /// <returns>
+        /// A long value representing the length of the stream in bytes.
+        /// </returns>
+        /// <exception cref="NotSupportedException">A class derived from Stream does not support seeking.</exception>
+        /// <exception cref="ObjectDisposedException">Methods were called after the stream was closed.</exception>
+        public override long Length
+        {
+            get
+            {
+                throw new NotSupportedException();
+            }
+        }
+
+        /// <summary>
+        /// When overridden in a derived class, gets or sets the position within the current stream.
+        /// </summary>
+        /// <returns>
+        /// The current position within the stream.
+        /// </returns>
+        /// <exception cref="NotSupportedException">The stream does not support seeking.</exception>
+        public override long Position
+        {
+            get
+            {
+                lock (_buffer)
+                {
+                    return _position;
+                }
+            }
+
+            set
+            {
+                throw new NotSupportedException();
+            }
+        }
+
+        #endregion
+
+        public void CloseWrite()
+        {
+            lock (_buffer)
+            {
+                // This can be called while the stream is disposed, when the download has finishes
+                // (TransferOut with Len=0 is processed) only after Close/Dispose is called
+                if (!_closedWrite && !_isDisposed)
+                {
+                    _closedWrite = true;
+                    Monitor.Pulse(_buffer);
+                }
+            }
+        }
+
+        private void CheckDisposed()
+        {
+            if (_isDisposed)
+            {
+                throw new ObjectDisposedException(GetType().FullName);
+            }
+        }
+
+        private void Closed()
+        {
+            Action onDispose = OnDispose;
+            OnDispose = null;
+            onDispose?.Invoke();
+        }
+    }
+}

+ 1 - 1
dotnet/internal/ProgressHandler.cs

@@ -17,6 +17,6 @@ namespace WinSCP
             }
             }
         }
         }
 
 
-        private Session _session;
+        private readonly Session _session;
     }
     }
 }
 }

+ 13 - 0
dotnet/internal/StdOutException.cs

@@ -0,0 +1,13 @@
+using System;
+
+namespace WinSCP
+{
+    internal class StdOutException : Exception
+    {
+        public StdOutException() :
+            // when the data are expected, the exception does not leave the API
+            base("Unexpected data")
+        {
+        }
+    }
+}

+ 2 - 2
dotnet/properties/AssemblyInfo.cs

@@ -35,7 +35,7 @@ namespace WinSCP
     {
     {
         public const string UndefinedProductVersion = "9.9.9.9";
         public const string UndefinedProductVersion = "9.9.9.9";
 
 
-        public const string Version = "1.7.2.0";
-        public const string ProductVersion = "5.17.11.0";
+        public const string Version = "1.8.3.0";
+        public const string ProductVersion = "5.19.5.0";
     }
     }
 }
 }

+ 6 - 6
libs/expat/CMake.README

@@ -3,25 +3,25 @@
 The cmake based buildsystem for expat works on Windows (cygwin, mingw, Visual
 The cmake based buildsystem for expat works on Windows (cygwin, mingw, Visual
 Studio) and should work on all other platform cmake supports.
 Studio) and should work on all other platform cmake supports.
 
 
-Assuming ~/expat-2.2.9 is the source directory of expat, add a subdirectory
+Assuming ~/expat-2.4.1 is the source directory of expat, add a subdirectory
 build and change into that directory:
 build and change into that directory:
-~/expat-2.2.9$ mkdir build && cd build
-~/expat-2.2.9/build$
+~/expat-2.4.1$ mkdir build && cd build
+~/expat-2.4.1/build$
 
 
 From that directory, call cmake first, then call make, make test and
 From that directory, call cmake first, then call make, make test and
 make install in the usual way:
 make install in the usual way:
-~/expat-2.2.9/build$ cmake ..
+~/expat-2.4.1/build$ cmake ..
 -- The C compiler identification is GNU
 -- The C compiler identification is GNU
 -- The CXX compiler identification is GNU
 -- The CXX compiler identification is GNU
 ....
 ....
 -- Configuring done
 -- Configuring done
 -- Generating done
 -- Generating done
--- Build files have been written to: /home/patrick/expat-2.2.9/build
+-- Build files have been written to: /home/patrick/expat-2.4.1/build
 
 
 If you want to specify the install location for your files, append
 If you want to specify the install location for your files, append
 -DCMAKE_INSTALL_PREFIX=/your/install/path to the cmake call.
 -DCMAKE_INSTALL_PREFIX=/your/install/path to the cmake call.
 
 
-~/expat-2.2.9/build$ make && make test && make install
+~/expat-2.4.1/build$ make && make test && make install
 Scanning dependencies of target expat
 Scanning dependencies of target expat
 [  5%] Building C object CMakeFiles/expat.dir/lib/xmlparse.c.o
 [  5%] Building C object CMakeFiles/expat.dir/lib/xmlparse.c.o
 [ 11%] Building C object CMakeFiles/expat.dir/lib/xmlrole.c.o
 [ 11%] Building C object CMakeFiles/expat.dir/lib/xmlrole.c.o

+ 247 - 51
libs/expat/CMakeLists.txt

@@ -1,11 +1,70 @@
-# This file is copyrighted under the BSD-license for buildsystem files of KDE
-# copyright 2010, Patrick Spendrin <[email protected]>
+#                          __  __            _
+#                       ___\ \/ /_ __   __ _| |_
+#                      / _ \\  /| '_ \ / _` | __|
+#                     |  __//  \| |_) | (_| | |_
+#                      \___/_/\_\ .__/ \__,_|\__|
+#                               |_| XML parser
+#
+# Copyright (c) 2010      Patrick Spendrin <[email protected]>
+# Copyright (c) 2012      Karl Waclawek <[email protected]>
+# Copyright (c) 2016-2021 Sebastian Pipping <[email protected]>
+# Copyright (c) 2016      Sergei Nikulov <[email protected]>
+# Copyright (c) 2016      Björn Lindahl <[email protected]>
+# Copyright (c) 2016      Tobias Taschner <[email protected]>
+# Copyright (c) 2016      Ben Boeckel <[email protected]>
+# Copyright (c) 2017      Rhodri James <[email protected]>
+# Copyright (c) 2017      Rolf Eike Beer <[email protected]>
+# Copyright (c) 2017      Stephen Groat <[email protected]>
+# Copyright (c) 2017      Franek Korta <[email protected]>
+# Copyright (c) 2018      pedro-vicente <[email protected]>
+# Copyright (c) 2018      Frank Rast <[email protected]>
+# Copyright (c) 2018      userwithuid <[email protected]>
+# Copyright (c) 2018      Yury Gribov <[email protected]>
+# Copyright (c) 2019      Kishore Kunche <[email protected]>
+# Copyright (c) 2019      xantares <[email protected]>
+# Copyright (c) 2019      Mohammed Khajapasha <[email protected]>
+# Copyright (c) 2019      David Loffredo <[email protected]>
+# Copyright (c) 2019      Bhargava Shastry <[email protected]>
+# Copyright (c) 2020      Maciej Sroczyński <[email protected]>
+# Copyright (c) 2020      Gulliver <[email protected]>
+# Copyright (c) 2020      Thomas Beutlich <[email protected]>
+# Copyright (c) 2021      Alex Richardson <[email protected]>
+# Unlike most of Expat,
+# this file is copyrighted under the BSD-license for buildsystem files of KDE.
 
 
 cmake_minimum_required(VERSION 3.1.3)
 cmake_minimum_required(VERSION 3.1.3)
 
 
+# This allows controlling documented build time switches
+# when Expat is pulled in using the add_subdirectory function, e.g.
+#
+#   set(EXPAT_BUILD_DOCS OFF)
+#   set(EXPAT_BUILD_TOOLS OFF)
+#   add_subdirectory(${expat_SOURCE_DIR}/expat ${expat_BINARY_DIR})
+#
+# would disable compilation of the xmlwf CLI and its man page.
+# Without activating behaviour NEW for policy CMP0077 here,
+# a user with -Wdev enabled would see warning
+#
+#   Policy CMP0077 is not set: option() honors normal variables.  Run "cmake
+#   --help-policy CMP0077" for policy details.  Use the cmake_policy command to
+#   set the policy and suppress this warning.
+#
+#   For compatibility with older versions of CMake, option is clearing the
+#   normal variable 'EXPAT_BUILD_DOCS'.
+#
+# and effectively not be able to adjust option EXPAT_BUILD_DOCS.
+#
+# For more details please see:
+# - https://cmake.org/cmake/help/latest/policy/CMP0077.html
+# - https://github.com/libexpat/libexpat/pull/419
+#
+if(POLICY CMP0077)
+    cmake_policy(SET CMP0077 NEW)
+endif()
+
 project(expat
 project(expat
     VERSION
     VERSION
-        2.2.9
+        2.4.1
     LANGUAGES
     LANGUAGES
         C
         C
 )
 )
@@ -37,6 +96,16 @@ else()
         set(_EXPAT_BUILD_DOCS_DEFAULT OFF)
         set(_EXPAT_BUILD_DOCS_DEFAULT OFF)
     endif()
     endif()
 endif()
 endif()
+if(MSVC)
+    set(_EXPAT_BUILD_PKGCONFIG_DEFAULT OFF)
+else()
+    set(_EXPAT_BUILD_PKGCONFIG_DEFAULT ON)
+endif()
+if(DEFINED BUILD_SHARED_LIBS)
+    set(_EXPAT_SHARED_LIBS_DEFAULT ${BUILD_SHARED_LIBS})
+else()
+    set(_EXPAT_SHARED_LIBS_DEFAULT ON)
+endif()
 
 
 #
 #
 # Configuration
 # Configuration
@@ -44,10 +113,14 @@ endif()
 option(EXPAT_BUILD_TOOLS "build the xmlwf tool for expat library" ${_EXPAT_BUILD_TOOLS_DEFAULT})
 option(EXPAT_BUILD_TOOLS "build the xmlwf tool for expat library" ${_EXPAT_BUILD_TOOLS_DEFAULT})
 option(EXPAT_BUILD_EXAMPLES "build the examples for expat library" ON)
 option(EXPAT_BUILD_EXAMPLES "build the examples for expat library" ON)
 option(EXPAT_BUILD_TESTS "build the tests for expat library" ON)
 option(EXPAT_BUILD_TESTS "build the tests for expat library" ON)
-option(EXPAT_SHARED_LIBS "build a shared expat library" ON)
+option(EXPAT_SHARED_LIBS "build a shared expat library" ${_EXPAT_SHARED_LIBS_DEFAULT})
 option(EXPAT_BUILD_DOCS "build man page for xmlwf" ${_EXPAT_BUILD_DOCS_DEFAULT})
 option(EXPAT_BUILD_DOCS "build man page for xmlwf" ${_EXPAT_BUILD_DOCS_DEFAULT})
 option(EXPAT_BUILD_FUZZERS "build fuzzers for the expat library" OFF)
 option(EXPAT_BUILD_FUZZERS "build fuzzers for the expat library" OFF)
-option(EXPAT_WITH_LIBBSD "utilize libbsd (for arc4random_buf)" OFF)
+option(EXPAT_BUILD_PKGCONFIG "build pkg-config file" ${_EXPAT_BUILD_PKGCONFIG_DEFAULT})
+option(EXPAT_OSSFUZZ_BUILD "build fuzzers via ossfuzz for the expat library" OFF)
+if(UNIX OR _EXPAT_HELP)
+    option(EXPAT_WITH_LIBBSD "utilize libbsd (for arc4random_buf)" OFF)
+endif()
 option(EXPAT_ENABLE_INSTALL "install expat files in cmake install target" ON)
 option(EXPAT_ENABLE_INSTALL "install expat files in cmake install target" ON)
 set(EXPAT_CONTEXT_BYTES 1024 CACHE STRING "Define to specify how much context to retain around the current parse point")
 set(EXPAT_CONTEXT_BYTES 1024 CACHE STRING "Define to specify how much context to retain around the current parse point")
 mark_as_advanced(EXPAT_CONTEXT_BYTES)
 mark_as_advanced(EXPAT_CONTEXT_BYTES)
@@ -56,7 +129,7 @@ mark_as_advanced(EXPAT_DTD)
 option(EXPAT_NS "Define to make XML Namespaces functionality available" ON)
 option(EXPAT_NS "Define to make XML Namespaces functionality available" ON)
 mark_as_advanced(EXPAT_NS)
 mark_as_advanced(EXPAT_NS)
 option(EXPAT_WARNINGS_AS_ERRORS "Treat all compiler warnings as errors" OFF)
 option(EXPAT_WARNINGS_AS_ERRORS "Treat all compiler warnings as errors" OFF)
-if(NOT WIN32 OR _EXPAT_HELP)
+if(UNIX OR _EXPAT_HELP)
     option(EXPAT_DEV_URANDOM "Define to include code reading entropy from `/dev/urandom'." ON)
     option(EXPAT_DEV_URANDOM "Define to include code reading entropy from `/dev/urandom'." ON)
     set(EXPAT_WITH_GETRANDOM "AUTO" CACHE STRING
     set(EXPAT_WITH_GETRANDOM "AUTO" CACHE STRING
             "Make use of getrandom function (ON|OFF|AUTO) [default=AUTO]")
             "Make use of getrandom function (ON|OFF|AUTO) [default=AUTO]")
@@ -75,6 +148,11 @@ if(MSVC OR _EXPAT_HELP)
     set(EXPAT_MSVC_STATIC_CRT OFF CACHE BOOL "Use /MT flag (static CRT) when compiling in MSVC")
     set(EXPAT_MSVC_STATIC_CRT OFF CACHE BOOL "Use /MT flag (static CRT) when compiling in MSVC")
 endif()
 endif()
 
 
+if(EXPAT_BUILD_TESTS)
+    # We have to call enable_language() before modifying any CMAKE_CXX_* variables
+    enable_language(CXX)
+endif()
+
 #
 #
 # Environment checks
 # Environment checks
 #
 #
@@ -87,6 +165,26 @@ if(EXPAT_WITH_LIBBSD)
     endif()
     endif()
 endif()
 endif()
 
 
+if(MSVC)
+    # For the three types of MSVC version values, please see:
+    # - https://cmake.org/cmake/help/latest/variable/MSVC_VERSION.html
+    # - https://sourceforge.net/p/predef/wiki/Compilers/
+    # - https://en.wikipedia.org/wiki/Microsoft_Visual_Studio#History
+    set(_EXPAT_MSVC_REQUIRED_INT 1800)  # i.e. 12.0/2013/1800; see PR #426
+    set(_EXPAT_MSVC_SUPPORTED_INT 1910)
+    set(_EXPAT_MSVC_SUPPORTED_DISPLAY "Visual Studio 15.0/2017/${_EXPAT_MSVC_SUPPORTED_INT}")
+
+    if(MSVC_VERSION VERSION_LESS ${_EXPAT_MSVC_SUPPORTED_INT})
+        if(MSVC_VERSION VERSION_LESS ${_EXPAT_MSVC_REQUIRED_INT})
+            message(SEND_ERROR "MSVC_VERSION ${MSVC_VERSION} is TOO OLD to compile Expat without errors.")
+            message(SEND_ERROR "Please use officially supported ${_EXPAT_MSVC_SUPPORTED_DISPLAY} or later.  Thank you!")
+        else()
+            message(WARNING "MSVC_VERSION ${MSVC_VERSION} is NOT OFFICIALLY SUPPORTED by Expat.")
+            message(WARNING "Please use ${_EXPAT_MSVC_SUPPORTED_DISPLAY} or later.  Thank you!")
+        endif()
+    endif()
+endif()
+
 macro(_expat_copy_bool_int source_ref dest_ref)
 macro(_expat_copy_bool_int source_ref dest_ref)
     if(${source_ref})
     if(${source_ref})
         set(${dest_ref} 1)
         set(${dest_ref} 1)
@@ -109,12 +207,27 @@ if(EXPAT_CHAR_TYPE STREQUAL "char")
 elseif(EXPAT_CHAR_TYPE STREQUAL "ushort")
 elseif(EXPAT_CHAR_TYPE STREQUAL "ushort")
     set(_EXPAT_UNICODE ON)
     set(_EXPAT_UNICODE ON)
     set(_EXPAT_UNICODE_WCHAR_T OFF)
     set(_EXPAT_UNICODE_WCHAR_T OFF)
+    if(EXPAT_BUILD_EXAMPLES)
+        message(SEND_ERROR "Examples can not be built with option -DEXPAT_CHAR_TYPE=ushort. Please pass -DEXPAT_CHAR_TYPE=(char|wchar_t) or -DEXPAT_BUILD_EXAMPLES=OFF.")
+    endif()
+    if(EXPAT_BUILD_TESTS)
+        message(SEND_ERROR "The testsuite can not be built with option -DEXPAT_CHAR_TYPE=ushort. Please pass -DEXPAT_CHAR_TYPE=(char|wchar_t) or -DEXPAT_BUILD_TESTS=OFF.")
+    endif()
     if(EXPAT_BUILD_TOOLS)
     if(EXPAT_BUILD_TOOLS)
         message(SEND_ERROR "The xmlwf tool can not be built with option -DEXPAT_CHAR_TYPE=ushort. Please pass -DEXPAT_CHAR_TYPE=(char|wchar_t) or -DEXPAT_BUILD_TOOLS=OFF.")
         message(SEND_ERROR "The xmlwf tool can not be built with option -DEXPAT_CHAR_TYPE=ushort. Please pass -DEXPAT_CHAR_TYPE=(char|wchar_t) or -DEXPAT_BUILD_TOOLS=OFF.")
     endif()
     endif()
 elseif(EXPAT_CHAR_TYPE STREQUAL "wchar_t")
 elseif(EXPAT_CHAR_TYPE STREQUAL "wchar_t")
     set(_EXPAT_UNICODE ON)
     set(_EXPAT_UNICODE ON)
     set(_EXPAT_UNICODE_WCHAR_T ON)
     set(_EXPAT_UNICODE_WCHAR_T ON)
+    if(NOT WIN32)
+        string(FIND "${CMAKE_C_FLAGS}" "-fshort-wchar" _expat_short_wchar_found)
+        if(${_expat_short_wchar_found} EQUAL "-1")
+            message(SEND_ERROR "Configuration -DEXPAT_CHAR_TYPE=wchar_t requires -DCMAKE_{C,CXX}_FLAGS=-fshort-wchar (which was not found) and libc compiled with -fshort-wchar, too.")
+        endif()
+        if (EXPAT_BUILD_TOOLS)
+            message(SEND_ERROR "The xmlwf tool can not be built with option -DEXPAT_CHAR_TYPE=wchar_t outside of Windows. Please pass -DEXPAT_CHAR_TYPE=char or -DEXPAT_BUILD_TOOLS=OFF.")
+        endif()
+    endif()
 else()
 else()
     message(SEND_ERROR "Option -DEXPAT_CHAR_TYPE=(char|ushort|wchar_t) cannot be \"${EXPAT_CHAR_TYPE}\".")
     message(SEND_ERROR "Option -DEXPAT_CHAR_TYPE=(char|ushort|wchar_t) cannot be \"${EXPAT_CHAR_TYPE}\".")
 endif()
 endif()
@@ -160,7 +273,6 @@ macro(expat_install)
 endmacro()
 endmacro()
 
 
 configure_file(expat_config.h.cmake "${CMAKE_CURRENT_BINARY_DIR}/expat_config.h")
 configure_file(expat_config.h.cmake "${CMAKE_CURRENT_BINARY_DIR}/expat_config.h")
-add_definitions(-DHAVE_EXPAT_CONFIG_H)
 expat_install(FILES "${CMAKE_CURRENT_BINARY_DIR}/expat_config.h" DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
 expat_install(FILES "${CMAKE_CURRENT_BINARY_DIR}/expat_config.h" DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
 
 
 
 
@@ -171,14 +283,18 @@ endif()
 if(FLAG_VISIBILITY)
 if(FLAG_VISIBILITY)
   add_definitions(-DXML_ENABLE_VISIBILITY=1)
   add_definitions(-DXML_ENABLE_VISIBILITY=1)
   set(EXTRA_COMPILE_FLAGS "${EXTRA_COMPILE_FLAGS} -fvisibility=hidden")
   set(EXTRA_COMPILE_FLAGS "${EXTRA_COMPILE_FLAGS} -fvisibility=hidden")
-endif(FLAG_VISIBILITY)
+endif()
+if(MINGW)
+    # Without __USE_MINGW_ANSI_STDIO the compiler produces a false positive
+    set(EXTRA_COMPILE_FLAGS "${EXTRA_COMPILE_FLAGS} -Wno-pedantic-ms-format")
+endif()
 if (EXPAT_WARNINGS_AS_ERRORS)
 if (EXPAT_WARNINGS_AS_ERRORS)
     if(MSVC)
     if(MSVC)
         add_definitions(/WX)
         add_definitions(/WX)
-    else(MSVC)
+    else()
         set(EXTRA_COMPILE_FLAGS "${EXTRA_COMPILE_FLAGS} -Werror")
         set(EXTRA_COMPILE_FLAGS "${EXTRA_COMPILE_FLAGS} -Werror")
-    endif(MSVC)
-endif(EXPAT_WARNINGS_AS_ERRORS)
+    endif()
+endif()
 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_COMPILE_FLAGS}")
 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_COMPILE_FLAGS}")
 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${EXTRA_COMPILE_FLAGS}")
 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${EXTRA_COMPILE_FLAGS}")
 
 
@@ -203,7 +319,7 @@ endif()
 include_directories(${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/lib)
 include_directories(${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/lib)
 if(MSVC)
 if(MSVC)
     add_definitions(-D_CRT_SECURE_NO_WARNINGS -wd4996)
     add_definitions(-D_CRT_SECURE_NO_WARNINGS -wd4996)
-endif(MSVC)
+endif()
 if(WIN32)
 if(WIN32)
     if(_EXPAT_UNICODE_WCHAR_T)
     if(_EXPAT_UNICODE_WCHAR_T)
         set(_POSTFIX_WIDE "w")
         set(_POSTFIX_WIDE "w")
@@ -231,7 +347,7 @@ if(WIN32)
 
 
         set(${postfix_var} "${_POSTFIX_WIDE}${_POSTFIX_DEBUG}${_POSTFIX_CRT}" CACHE STRING "Windows binary postfix, e.g. libexpat<postfix=[w][d][MD|MT]>.lib")
         set(${postfix_var} "${_POSTFIX_WIDE}${_POSTFIX_DEBUG}${_POSTFIX_CRT}" CACHE STRING "Windows binary postfix, e.g. libexpat<postfix=[w][d][MD|MT]>.lib")
     endforeach()
     endforeach()
-endif(WIN32)
+endif()
 
 
 #
 #
 # C library
 # C library
@@ -249,38 +365,51 @@ if(EXPAT_SHARED_LIBS)
     set(_SHARED SHARED)
     set(_SHARED SHARED)
     if(MSVC)
     if(MSVC)
         set(expat_SRCS ${expat_SRCS} lib/libexpat.def)
         set(expat_SRCS ${expat_SRCS} lib/libexpat.def)
-    endif(MSVC)
-else(EXPAT_SHARED_LIBS)
+    endif()
+else()
     set(_SHARED STATIC)
     set(_SHARED STATIC)
-    if(WIN32)
-        add_definitions(-DXML_STATIC)
-    endif(WIN32)
-endif(EXPAT_SHARED_LIBS)
+endif()
 
 
 # Avoid colliding with Expat.dll of Perl's XML::Parser::Expat
 # Avoid colliding with Expat.dll of Perl's XML::Parser::Expat
 if(WIN32 AND NOT MINGW)
 if(WIN32 AND NOT MINGW)
-    set(_EXPAT_TARGET libexpat)
+    set(_EXPAT_OUTPUT_NAME libexpat)  # CMAKE_*_POSTFIX applies, see above
 else()
 else()
-    set(_EXPAT_TARGET expat)
+    if(_EXPAT_UNICODE)
+        set(_EXPAT_OUTPUT_NAME expatw)
+    else()
+        set(_EXPAT_OUTPUT_NAME expat)
+    endif()
 endif()
 endif()
 
 
-add_library(${_EXPAT_TARGET} ${_SHARED} ${expat_SRCS})
+add_library(expat ${_SHARED} ${expat_SRCS})
 if(EXPAT_WITH_LIBBSD)
 if(EXPAT_WITH_LIBBSD)
-    target_link_libraries(${_EXPAT_TARGET} ${LIB_BSD})
+    target_link_libraries(expat ${LIB_BSD})
 endif()
 endif()
 
 
-set(LIBCURRENT 7)    # sync
-set(LIBREVISION 11)  # with
-set(LIBAGE 6)        # configure.ac!
+set(LIBCURRENT 9)   # sync
+set(LIBREVISION 1)  # with
+set(LIBAGE 8)       # configure.ac!
 math(EXPR LIBCURRENT_MINUS_AGE "${LIBCURRENT} - ${LIBAGE}")
 math(EXPR LIBCURRENT_MINUS_AGE "${LIBCURRENT} - ${LIBAGE}")
 
 
+set_property(TARGET expat PROPERTY OUTPUT_NAME "${_EXPAT_OUTPUT_NAME}")
 if(NOT WIN32)
 if(NOT WIN32)
-    set_property(TARGET ${_EXPAT_TARGET} PROPERTY VERSION ${LIBCURRENT_MINUS_AGE}.${LIBAGE}.${LIBREVISION})
-    set_property(TARGET ${_EXPAT_TARGET} PROPERTY SOVERSION ${LIBCURRENT_MINUS_AGE})
-    set_property(TARGET ${_EXPAT_TARGET} PROPERTY NO_SONAME ${NO_SONAME})
-endif(NOT WIN32)
+    set_property(TARGET expat PROPERTY VERSION ${LIBCURRENT_MINUS_AGE}.${LIBAGE}.${LIBREVISION})
+    set_property(TARGET expat PROPERTY SOVERSION ${LIBCURRENT_MINUS_AGE})
+    set_property(TARGET expat PROPERTY NO_SONAME ${NO_SONAME})
+endif()
+
+target_include_directories(expat
+    INTERFACE
+        $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/lib>
+        $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>
+        $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
+)
+
+if(NOT EXPAT_SHARED_LIBS AND WIN32)
+    target_compile_definitions(expat PUBLIC -DXML_STATIC)
+endif()
 
 
-expat_install(TARGETS ${_EXPAT_TARGET} EXPORT expat
+expat_install(TARGETS expat EXPORT expat
                       RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
                       RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
                       LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
                       LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
                       ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
                       ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
@@ -290,11 +419,22 @@ expat_install(FILES lib/expat.h lib/expat_external.h DESTINATION ${CMAKE_INSTALL
 #
 #
 # pkg-config file
 # pkg-config file
 #
 #
-if(NOT MSVC)
+if(EXPAT_BUILD_PKGCONFIG)
     set(prefix ${CMAKE_INSTALL_PREFIX})
     set(prefix ${CMAKE_INSTALL_PREFIX})
     set(exec_prefix "\${prefix}")
     set(exec_prefix "\${prefix}")
-    set(libdir "\${exec_prefix}/${CMAKE_INSTALL_LIBDIR}")
-    set(includedir "\${prefix}/${CMAKE_INSTALL_INCLUDEDIR}")
+
+    if(CMAKE_INSTALL_LIBDIR MATCHES "^/")
+        set(libdir "${CMAKE_INSTALL_LIBDIR}")
+    else()
+        set(libdir "\${exec_prefix}/${CMAKE_INSTALL_LIBDIR}")
+    endif()
+
+    if(CMAKE_INSTALL_INCLUDEDIR MATCHES "^/")
+        set(includedir "${CMAKE_INSTALL_INCLUDEDIR}")
+    else()
+        set(includedir "\${prefix}/${CMAKE_INSTALL_INCLUDEDIR}")
+    endif()
+
     configure_file(expat.pc.in ${CMAKE_CURRENT_BINARY_DIR}/expat.pc @ONLY)
     configure_file(expat.pc.in ${CMAKE_CURRENT_BINARY_DIR}/expat.pc @ONLY)
     expat_install(FILES ${CMAKE_CURRENT_BINARY_DIR}/expat.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
     expat_install(FILES ${CMAKE_CURRENT_BINARY_DIR}/expat.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
 endif()
 endif()
@@ -312,7 +452,7 @@ if(EXPAT_BUILD_TOOLS)
 
 
     add_executable(xmlwf ${xmlwf_SRCS})
     add_executable(xmlwf ${xmlwf_SRCS})
     set_property(TARGET xmlwf PROPERTY RUNTIME_OUTPUT_DIRECTORY xmlwf)
     set_property(TARGET xmlwf PROPERTY RUNTIME_OUTPUT_DIRECTORY xmlwf)
-    target_link_libraries(xmlwf ${_EXPAT_TARGET})
+    target_link_libraries(xmlwf expat)
     expat_install(TARGETS xmlwf DESTINATION ${CMAKE_INSTALL_BINDIR})
     expat_install(TARGETS xmlwf DESTINATION ${CMAKE_INSTALL_BINDIR})
 
 
     if(MINGW AND _EXPAT_UNICODE_WCHAR_T)
     if(MINGW AND _EXPAT_UNICODE_WCHAR_T)
@@ -322,8 +462,16 @@ if(EXPAT_BUILD_TOOLS)
 
 
     if(EXPAT_BUILD_DOCS)
     if(EXPAT_BUILD_DOCS)
         file(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/doc)
         file(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/doc)
-        add_custom_command(TARGET ${_EXPAT_TARGET} PRE_BUILD COMMAND "${DOCBOOK_TO_MAN}" "${PROJECT_SOURCE_DIR}/doc/xmlwf.xml" && mv "XMLWF.1" "${PROJECT_BINARY_DIR}/doc/xmlwf.1")
+        add_custom_target(
+            xmlwf-manpage
+            COMMAND
+                "${DOCBOOK_TO_MAN}" "${PROJECT_SOURCE_DIR}/doc/xmlwf.xml" && mv "XMLWF.1" "${PROJECT_BINARY_DIR}/doc/xmlwf.1"
+            BYPRODUCTS
+                doc/xmlwf.1)
+        add_dependencies(expat xmlwf-manpage)
         expat_install(FILES "${PROJECT_BINARY_DIR}/doc/xmlwf.1" DESTINATION ${CMAKE_INSTALL_MANDIR}/man1)
         expat_install(FILES "${PROJECT_BINARY_DIR}/doc/xmlwf.1" DESTINATION ${CMAKE_INSTALL_MANDIR}/man1)
+    elseif(EXISTS ${PROJECT_SOURCE_DIR}/doc/xmlwf.1)
+        expat_install(FILES "${PROJECT_SOURCE_DIR}/doc/xmlwf.1" DESTINATION ${CMAKE_INSTALL_MANDIR}/man1)
     endif()
     endif()
 endif()
 endif()
 
 
@@ -333,19 +481,18 @@ endif()
 if(EXPAT_BUILD_EXAMPLES)
 if(EXPAT_BUILD_EXAMPLES)
     add_executable(elements examples/elements.c)
     add_executable(elements examples/elements.c)
     set_property(TARGET elements PROPERTY RUNTIME_OUTPUT_DIRECTORY examples)
     set_property(TARGET elements PROPERTY RUNTIME_OUTPUT_DIRECTORY examples)
-    target_link_libraries(elements ${_EXPAT_TARGET})
+    target_link_libraries(elements expat)
 
 
     add_executable(outline examples/outline.c)
     add_executable(outline examples/outline.c)
     set_property(TARGET outline PROPERTY RUNTIME_OUTPUT_DIRECTORY examples)
     set_property(TARGET outline PROPERTY RUNTIME_OUTPUT_DIRECTORY examples)
-    target_link_libraries(outline ${_EXPAT_TARGET})
-endif(EXPAT_BUILD_EXAMPLES)
+    target_link_libraries(outline expat)
+endif()
 
 
 #
 #
 # C/C++ test runners
 # C/C++ test runners
 #
 #
 if(EXPAT_BUILD_TESTS)
 if(EXPAT_BUILD_TESTS)
     ## these are unittests that can be run on any platform
     ## these are unittests that can be run on any platform
-    enable_language(CXX)
     enable_testing()
     enable_testing()
 
 
     set(test_SRCS
     set(test_SRCS
@@ -353,6 +500,7 @@ if(EXPAT_BUILD_TESTS)
         tests/memcheck.c
         tests/memcheck.c
         tests/minicheck.c
         tests/minicheck.c
         tests/structdata.c
         tests/structdata.c
+        ${expat_SRCS}
     )
     )
 
 
     if(NOT MSVC)
     if(NOT MSVC)
@@ -372,14 +520,17 @@ if(EXPAT_BUILD_TESTS)
 
 
     add_executable(runtests tests/runtests.c ${test_SRCS})
     add_executable(runtests tests/runtests.c ${test_SRCS})
     set_property(TARGET runtests PROPERTY RUNTIME_OUTPUT_DIRECTORY tests)
     set_property(TARGET runtests PROPERTY RUNTIME_OUTPUT_DIRECTORY tests)
-    target_link_libraries(runtests ${_EXPAT_TARGET})
     expat_add_test(runtests $<TARGET_FILE:runtests>)
     expat_add_test(runtests $<TARGET_FILE:runtests>)
 
 
     add_executable(runtestspp tests/runtestspp.cpp ${test_SRCS})
     add_executable(runtestspp tests/runtestspp.cpp ${test_SRCS})
     set_property(TARGET runtestspp PROPERTY RUNTIME_OUTPUT_DIRECTORY tests)
     set_property(TARGET runtestspp PROPERTY RUNTIME_OUTPUT_DIRECTORY tests)
-    target_link_libraries(runtestspp ${_EXPAT_TARGET})
     expat_add_test(runtestspp $<TARGET_FILE:runtestspp>)
     expat_add_test(runtestspp $<TARGET_FILE:runtestspp>)
-endif(EXPAT_BUILD_TESTS)
+
+    if(EXPAT_WITH_LIBBSD)
+        target_link_libraries(runtests ${LIB_BSD})
+        target_link_libraries(runtestspp ${LIB_BSD})
+    endif()
+endif()
 
 
 if(EXPAT_BUILD_FUZZERS)
 if(EXPAT_BUILD_FUZZERS)
     if(NOT "${CMAKE_C_COMPILER_ID}" STREQUAL "Clang")
     if(NOT "${CMAKE_C_COMPILER_ID}" STREQUAL "Clang")
@@ -389,23 +540,34 @@ if(EXPAT_BUILD_FUZZERS)
             "-DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++.")
             "-DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++.")
     endif()
     endif()
 
 
-    string(FIND "${CMAKE_EXE_LINKER_FLAGS}" "-fsanitize" sanitizer_present)
+    string(FIND "${CMAKE_C_FLAGS}" "-fsanitize" sanitizer_present)
     if(${sanitizer_present} EQUAL "-1")
     if(${sanitizer_present} EQUAL "-1")
         message(WARNING
         message(WARNING
             "There was no sanitizer present when building the fuzz targets. "
             "There was no sanitizer present when building the fuzz targets. "
             "This is likely in error - consider adding "
             "This is likely in error - consider adding "
             "-DCMAKE_C_FLAGS='-fsanitize=<sanitizer>' and "
             "-DCMAKE_C_FLAGS='-fsanitize=<sanitizer>' and "
             "-DCMAKE_CXX_FLAGS='-fsanitize=<sanitizer>' and "
             "-DCMAKE_CXX_FLAGS='-fsanitize=<sanitizer>' and "
-            "-DCMAKE_STATIC_LINKER_FLAGS='-fsanitize=<sanitizer>' and "
-            "-DCMAKE_EXE_LINKER_FLAGS='-fsanitize=<sanitizer>' to your cmake "
+            "-DCMAKE_EXE_LINKER_FLAGS='-fsanitize=<sanitizer>' and "
+            "-DCMAKE_MODULE_LINKER_FLAGS='-fsanitize=<sanitizer>' and "
+            "-DCMAKE_SHARED_LINKER_FLAGS='-fsanitize=<sanitizer>' to your cmake "
             "execution.")
             "execution.")
     endif()
     endif()
 
 
+    if(EXPAT_OSSFUZZ_BUILD AND NOT DEFINED ENV{LIB_FUZZING_ENGINE})
+        message(SEND_ERROR
+            "OSS-Fuzz builds require the environment variable "
+            "LIB_FUZZING_ENGINE to be set. If you are seeing this "
+            "warning, it points to a deeper problem in the ossfuzz "
+            "build setup.")
+    endif()
+
     set(encoding_types UTF-16 UTF-8 ISO-8859-1 US-ASCII UTF-16BE UTF-16LE)
     set(encoding_types UTF-16 UTF-8 ISO-8859-1 US-ASCII UTF-16BE UTF-16LE)
     set(fuzz_targets xml_parse_fuzzer xml_parsebuffer_fuzzer)
     set(fuzz_targets xml_parse_fuzzer xml_parsebuffer_fuzzer)
 
 
     add_library(fuzzpat STATIC ${expat_SRCS})
     add_library(fuzzpat STATIC ${expat_SRCS})
-    target_compile_options(fuzzpat PRIVATE -fsanitize=fuzzer-no-link)
+    if(NOT EXPAT_OSSFUZZ_BUILD)
+        target_compile_options(fuzzpat PRIVATE -fsanitize=fuzzer-no-link)
+    endif()
 
 
     foreach(fuzz_target ${fuzz_targets})
     foreach(fuzz_target ${fuzz_targets})
         foreach(encoding_type ${encoding_types})
         foreach(encoding_type ${encoding_types})
@@ -414,14 +576,28 @@ if(EXPAT_BUILD_FUZZERS)
             target_link_libraries(${target_name} fuzzpat)
             target_link_libraries(${target_name} fuzzpat)
             target_compile_definitions(${target_name}
             target_compile_definitions(${target_name}
                 PRIVATE ENCODING_FOR_FUZZING=${encoding_type})
                 PRIVATE ENCODING_FOR_FUZZING=${encoding_type})
-            target_compile_options(${target_name} PRIVATE -fsanitize=fuzzer-no-link)
+            if(NOT EXPAT_OSSFUZZ_BUILD)
+                target_compile_options(${target_name} PRIVATE -fsanitize=fuzzer-no-link)
+            endif()
             # NOTE: Avoiding target_link_options here only because it needs CMake >=3.13
             # NOTE: Avoiding target_link_options here only because it needs CMake >=3.13
-            set_target_properties(${target_name} PROPERTIES LINK_FLAGS -fsanitize=fuzzer)
+            if(EXPAT_OSSFUZZ_BUILD)
+                set_target_properties(${target_name} PROPERTIES LINK_FLAGS $ENV{LIB_FUZZING_ENGINE})
+                set_target_properties(${target_name} PROPERTIES LINKER_LANGUAGE "CXX")
+            else()
+                set_target_properties(${target_name} PROPERTIES LINK_FLAGS -fsanitize=fuzzer)
+            endif()
             set_property(
             set_property(
                 TARGET ${target_name} PROPERTY RUNTIME_OUTPUT_DIRECTORY fuzz)
                 TARGET ${target_name} PROPERTY RUNTIME_OUTPUT_DIRECTORY fuzz)
         endforeach()
         endforeach()
     endforeach()
     endforeach()
-endif(EXPAT_BUILD_FUZZERS)
+else()
+    if(EXPAT_OSSFUZZ_BUILD)
+        message(SEND_ERROR
+                "Attempting to perform an ossfuzz build without turning on the fuzzer build. "
+                "This is likely in error - consider adding "
+                "-DEXPAT_BUILD_FUZZERS=ON to your cmake execution.")
+    endif()
+endif()
 
 
 #
 #
 # Custom target "run-xmltest"
 # Custom target "run-xmltest"
@@ -498,7 +674,7 @@ write_basic_package_version_file(
 )
 )
 export(
 export(
     TARGETS
     TARGETS
-        ${_EXPAT_TARGET}
+        expat
     FILE
     FILE
         cmake/expat-targets.cmake  # not going to be installed
         cmake/expat-targets.cmake  # not going to be installed
 )
 )
@@ -518,6 +694,25 @@ expat_install(
         expat::
         expat::
 )
 )
 
 
+#
+# CPack
+#
+
+# This effectively disables target "package_source".
+# That is done due to CPack's unfortunate choice of an exclusion list
+# rather than inclusion list.  An exclusion list does not protect against
+# unwanted files ending up in the resulting archive in a way that's
+# safe to run from an Expat developer's machine.
+set(CPACK_SOURCE_GENERATOR '')
+
+if(WIN32)
+    set(CPACK_GENERATOR ZIP)
+else()
+    set(CPACK_GENERATOR TGZ)
+endif()
+
+include(CPack)
+
 #
 #
 # Summary
 # Summary
 #
 #
@@ -555,6 +750,7 @@ message(STATUS "  Build examples ............. ${EXPAT_BUILD_EXAMPLES}")
 message(STATUS "  Build fuzzers .............. ${EXPAT_BUILD_FUZZERS}")
 message(STATUS "  Build fuzzers .............. ${EXPAT_BUILD_FUZZERS}")
 message(STATUS "  Build tests ................ ${EXPAT_BUILD_TESTS}")
 message(STATUS "  Build tests ................ ${EXPAT_BUILD_TESTS}")
 message(STATUS "  Build tools (xmlwf) ........ ${EXPAT_BUILD_TOOLS}")
 message(STATUS "  Build tools (xmlwf) ........ ${EXPAT_BUILD_TOOLS}")
+message(STATUS "  Build pkg-config file ...... ${EXPAT_BUILD_PKGCONFIG}")
 message(STATUS "  Install files .............. ${EXPAT_ENABLE_INSTALL}")
 message(STATUS "  Install files .............. ${EXPAT_ENABLE_INSTALL}")
 message(STATUS "")
 message(STATUS "")
 message(STATUS "  Features")
 message(STATUS "  Features")

+ 1 - 1
libs/expat/COPYING

@@ -1,5 +1,5 @@
 Copyright (c) 1998-2000 Thai Open Source Software Center Ltd and Clark Cooper
 Copyright (c) 1998-2000 Thai Open Source Software Center Ltd and Clark Cooper
-Copyright (c) 2001-2017 Expat maintainers
+Copyright (c) 2001-2019 Expat maintainers
 
 
 Permission is hereby granted, free of charge, to any person obtaining
 Permission is hereby granted, free of charge, to any person obtaining
 a copy of this software and associated documentation files (the
 a copy of this software and associated documentation files (the

+ 204 - 3
libs/expat/Changes

@@ -2,7 +2,208 @@ NOTE: We are looking for help with a few things:
       https://github.com/libexpat/libexpat/labels/help%20wanted
       https://github.com/libexpat/libexpat/labels/help%20wanted
       If you can help, please get in touch.  Thanks!
       If you can help, please get in touch.  Thanks!
 
 
-Release 2.2.9 Wed Septemper 25 2019
+Release 2.4.1 Sun May 23 2021
+        Bug fixes:
+       #488 #490  Autotools: Fix installed header expat_config.h for multilib
+                    systems; regression introduced in 2.4.0 by pull request #486
+
+        Other changes:
+       #491 #492  Version info bumped from 9:0:8 to 9:1:8;
+                    see https://verbump.de/ for what these numbers do
+
+        Special thanks to:
+            Gentoo's QA check "multilib_check_headers"
+
+Release 2.4.0 Sun May 23 2021
+        Security fixes:
+   #34 #466 #484  CVE-2013-0340/CWE-776 -- Protect against billion laughs attacks
+                    (denial-of-service; flavors targeting CPU time or RAM or both,
+                    leveraging general entities or parameter entities or both)
+                    by tracking and limiting the input amplification factor
+                    (<amplification> := (<direct> + <indirect>) / <direct>).
+                    By conservative default, amplification up to a factor of 100.0
+                    is tolerated and rejection only starts after 8 MiB of output bytes
+                    (=<direct> + <indirect>) have been processed.
+                    The fix adds the following to the API:
+                    - A new error code XML_ERROR_AMPLIFICATION_LIMIT_BREACH to
+                      signals this specific condition.
+                    - Two new API functions ..
+                      - XML_SetBillionLaughsAttackProtectionMaximumAmplification and
+                      - XML_SetBillionLaughsAttackProtectionActivationThreshold
+                      .. to further tighten billion laughs protection parameters
+                      when desired.  Please see file "doc/reference.html" for details.
+                      If you ever need to increase the defaults for non-attack XML
+                      payload, please file a bug report with libexpat.
+                    - Two new XML_FEATURE_* constants ..
+                      - that can be queried using the XML_GetFeatureList function, and
+                      - that are shown in "xmlwf -v" output.
+                    - Two new environment variable switches ..
+                      - EXPAT_ACCOUNTING_DEBUG=(0|1|2|3) and
+                      - EXPAT_ENTITY_DEBUG=(0|1)
+                      .. for runtime debugging of accounting and entity processing.
+                      Specific behavior of these values may change in the future.
+                    - Two new command line arguments "-a FACTOR" and "-b BYTES"
+                      for xmlwf to further tighten billion laughs protection
+                      parameters when desired.
+                      If you ever need to increase the defaults for non-attack XML
+                      payload, please file a bug report with libexpat.
+
+        Bug fixes:
+       #332 #470  For (non-default) compilation with -DEXPAT_MIN_SIZE=ON (CMake)
+                    or CPPFLAGS=-DXML_MIN_SIZE (GNU Autotools): Fix segfault
+                    for UTF-16 payloads containing CDATA sections.
+       #485 #486  Autotools: Fix generated CMake files for non-64bit and
+                    non-Linux platforms (e.g. macOS and MinGW in particular)
+                    that were introduced with release 2.3.0
+
+        Other changes:
+       #468 #469  xmlwf: Improve help output and the xmlwf man page
+            #463  xmlwf: Improve maintainability through some refactoring
+            #477  xmlwf: Fix man page DocBook validity
+       #458 #459  CMake: Support absolute paths for both CMAKE_INSTALL_LIBDIR
+                    and CMAKE_INSTALL_INCLUDEDIR
+       #471 #481  CMake: Add support for standard variable BUILD_SHARED_LIBS
+            #457  Unexpose symbol _INTERNAL_trim_to_complete_utf8_characters
+            #467  Resolve macro HAVE_EXPAT_CONFIG_H
+            #472  Delete unused legacy helper file "conftools/PrintPath"
+       #473 #483  Improve attribution
+  #464 #465 #477  doc/reference.html: Fix XHTML validity
+       #475 #478  doc/reference.html: Replace the 90s look by OK.css
+            #479  Version info bumped from 8:0:7 to 9:0:8
+                    due to addition of new symbols and error codes;
+                    see https://verbump.de/ for what these numbers do
+
+        Infrastructure:
+            #456  CI: Enable periodic runs
+            #457  CI: Start covering the list of exported symbols
+            #474  CI: Isolate coverage task
+       #476 #482  CI: Adapt to breaking changes in image "ubuntu-18.04"
+            #477  CI: Cover well-formedness and DocBook/XHTML validity
+                    of doc/reference.html and doc/xmlwf.xml
+
+        Special thanks to:
+            Dimitry Andric
+            Eero Helenius
+            Nick Wellnhofer
+            Rhodri James
+            Tomas Korbar
+            Yury Gribov
+                 and
+            Clang LeakSan
+            JetBrains
+            OSS-Fuzz
+
+Release 2.3.0 Thu March 25 2021
+        Bug fixes:
+            #438  When calling XML_ParseBuffer without a prior successful call to
+                    XML_GetBuffer as a user, no longer trigger undefined behavior
+                    (by adding an integer to a NULL pointer) but rather return
+                    XML_STATUS_ERROR and set the error code to (new) code
+                    XML_ERROR_NO_BUFFER. Found by UBSan (UndefinedBehaviorSanitizer)
+                    of Clang 11 (but not Clang 9).
+            #444  xmlwf: Exit status 2 was used for both:
+                    - malformed input files (documented) and
+                    - invalid command-line arguments (undocumented).
+                    The case of invalid command-line arguments now
+                    has its own exit status 4, resolving the ambiguity.
+
+        Other changes:
+            #439  xmlwf: Add argument -k to allow continuing after
+                    non-fatal errors
+            #439  xmlwf: Add section about exit status to the -h help output
+  #422 #426 #447  Windows: Drop support for Visual Studio <=14.0/2015
+            #434  Windows: CMake: Detect unsupported Visual Studio at
+                    configure time (rather than at compile time)
+       #382 #428  testrunner: Make verbose mode (argument "-v") report
+                    about passed tests, and make default mode report about
+                    failures, as well.
+            #442  CMake: Call "enable_language(CXX)" prior to tinkering
+                    with CMAKE_CXX_* variables
+            #448  Document use of libexpat from a CMake-based project
+            #451  Autotools: Install CMake files as generated by CMake 3.19.6
+                    so that users with "find_package(expat [..] CONFIG [..])"
+                    are served on distributions that are *not* using the CMake
+                    build system inside for libexpat packaging
+       #436 #437  Autotools: Drop obsolescent macro AC_HEADER_STDC
+       #450 #452  Autotools: Resolve use of obsolete macro AC_CONFIG_HEADER
+            #441  Address compiler warnings
+            #443  Version info bumped from 7:12:6 to 8:0:7
+                    due to addition of error code XML_ERROR_NO_BUFFER
+                    (see https://verbump.de/ for what these numbers do)
+
+        Infrastructure:
+       #435 #446  Replace Travis CI by GitHub Actions
+
+        Special thanks to:
+            Alexander Richardson
+            Oleksandr Popovych
+            Thomas Beutlich
+            Tim Bray
+                 and
+            Clang LeakSan, Clang 11 UBSan and the Clang team
+
+Release 2.2.10 Sat October 3 2020
+        Bug fixes:
+  #390 #395 #398  Fix undefined behavior during parsing caused by
+                    pointer arithmetic with NULL pointers
+       #404 #405  Fix reading uninitialized variable during parsing
+            #406  xmlwf: Add missing check for malloc NULL return
+
+        Other changes:
+            #396  Windows: Drop support for Visual Studio <=8.0/2005
+            #409  Windows: Add missing file "Changes" to the installer
+                    to fix compilation with CMake from installed sources
+            #403  xmlwf: Document exit codes in xmlwf manpage and
+                    exit with code 3 (rather than code 1) for output errors
+                    when used with "-d DIRECTORY"
+       #356 #359  MinGW: Provide declaration of rand_s for mingwrt <5.3.0
+       #383 #392  Autotools: Use -Werror while configure tests the compiler
+                    for supported compile flags to avoid false positives
+  #383 #393 #394  Autotools: Improve handling of user (C|CPP|CXX|LD)FLAGS,
+                    e.g. ensure that they have the last word over flags added
+                    while running ./configure
+            #360  CMake: Create libexpatw.{dll,so} and expatw.pc (with emphasis
+                    on suffix "w") with -DEXPAT_CHAR_TYPE=(ushort|wchar_t)
+            #360  CMake: Detect and deny unsupported build combinations
+                    involving -DEXPAT_CHAR_TYPE=(ushort|wchar_t)
+            #360  CMake: Install pre-compiled shipped xmlwf.1 manpage in case
+                    of -DEXPAT_BUILD_DOCS=OFF
+  #375 #380 #419  CMake: Fix use of Expat by means of add_subdirectory
+       #407 #408  CMake: Keep expat target name constant at "expat"
+                    (i.e. refrain from using the target name to control
+                    build artifact filenames)
+            #385  CMake: Fix compilation with -DEXPAT_SHARED_LIBS=OFF for
+                    Windows
+                  CMake: Expose man page compilation as target "xmlwf-manpage"
+       #413 #414  CMake: Introduce option EXPAT_BUILD_PKGCONFIG
+                    to control generation of pkg-config file "expat.pc"
+            #424  CMake: Add minimalistic support for building binary packages
+                    with CMake target "package"; based on CPack
+            #366  CMake: Add option -DEXPAT_OSSFUZZ_BUILD=(ON|OFF) with
+                    default OFF to build fuzzer code against OSS-Fuzz and
+                    related environment variable LIB_FUZZING_ENGINE
+            #354  Fix testsuite for -DEXPAT_DTD=OFF and -DEXPAT_NS=OFF, each
+    #354 #355 ..
+       #356 #412  Address compiler warnings
+       #368 #369  Address pngcheck warnings with doc/*.png images
+            #425  Version info bumped from 7:11:6 to 7:12:6
+
+        Special thanks to:
+            asavah
+            Ben Wagner
+            Bhargava Shastry
+            Frank Landgraf
+            Jeffrey Walton
+            Joe Orton
+            Kleber Tarcísio
+            Ma Lin
+            Maciej Sroczyński
+            Mohammed Khajapasha
+            Vadim Zeitlin
+                 and
+            Cppcheck 2.0 and the Cppcheck team
+
+Release 2.2.9 Wed September 25 2019
         Other changes:
         Other changes:
                   examples: Drop executable bits from elements.c
                   examples: Drop executable bits from elements.c
             #349  Windows: Change the name of the Windows DLLs from expat*.dll
             #349  Windows: Change the name of the Windows DLLs from expat*.dll
@@ -17,7 +218,7 @@ Release 2.2.9 Wed Septemper 25 2019
         Special thanks to:
         Special thanks to:
             Ben Wagner
             Ben Wagner
 
 
-Release 2.2.8 Fri Septemper 13 2019
+Release 2.2.8 Fri September 13 2019
         Security fixes:
         Security fixes:
        #317 #318  CVE-2019-15903 -- Fix heap overflow triggered by
        #317 #318  CVE-2019-15903 -- Fix heap overflow triggered by
                     XML_GetCurrentLineNumber (or XML_GetCurrentColumnNumber),
                     XML_GetCurrentLineNumber (or XML_GetCurrentColumnNumber),
@@ -115,10 +316,10 @@ Release 2.2.8 Fri Septemper 13 2019
         Special thanks to:
         Special thanks to:
             David Loffredo
             David Loffredo
             Joonun Jang
             Joonun Jang
-            Khajapasha Mohammed
             Kishore Kunche
             Kishore Kunche
             Marco Maggi
             Marco Maggi
             Mitch Phillips
             Mitch Phillips
+            Mohammed Khajapasha
             Rolf Ade
             Rolf Ade
             xantares
             xantares
             Zhongyuan Zhou
             Zhongyuan Zhou

+ 17 - 3
libs/expat/Makefile.am

@@ -6,7 +6,8 @@
 #                      \___/_/\_\ .__/ \__,_|\__|
 #                      \___/_/\_\ .__/ \__,_|\__|
 #                               |_| XML parser
 #                               |_| XML parser
 #
 #
-# Copyright (c) 2017 Expat development team
+# Copyright (c) 2017-2021 Sebastian Pipping <[email protected]>
+# Copyright (c) 2018      KangLin <[email protected]>
 # Licensed under the MIT license:
 # Licensed under the MIT license:
 #
 #
 # Permission is  hereby granted,  free of charge,  to any  person obtaining
 # Permission is  hereby granted,  free of charge,  to any  person obtaining
@@ -53,8 +54,22 @@ pkgconfig_DATA = expat.pc
 pkgconfigdir = $(libdir)/pkgconfig
 pkgconfigdir = $(libdir)/pkgconfig
 
 
 
 
+dist_cmake_DATA = \
+    cmake/autotools/expat.cmake
+
+nodist_cmake_DATA = \
+    cmake/autotools/expat-config-version.cmake \
+    cmake/autotools/expat-noconfig.cmake \
+    cmake/expat-config.cmake
+
+cmakedir = $(libdir)/cmake/expat-@PACKAGE_VERSION@
+
+
 _EXTRA_DIST_CMAKE = \
 _EXTRA_DIST_CMAKE = \
-    cmake/expat-config.cmake.in \
+    cmake/autotools/expat-noconfig__linux.cmake.in \
+    cmake/autotools/expat-noconfig__macos.cmake.in \
+    cmake/autotools/expat-noconfig__windows.cmake.in \
+    cmake/autotools/expat-package-init.cmake \
     cmake/mingw-toolchain.cmake \
     cmake/mingw-toolchain.cmake \
     \
     \
     CMakeLists.txt \
     CMakeLists.txt \
@@ -74,7 +89,6 @@ EXTRA_DIST = \
     \
     \
     conftools/expat.m4 \
     conftools/expat.m4 \
     conftools/get-version.sh \
     conftools/get-version.sh \
-    conftools/PrintPath \
     \
     \
     xmlwf/xmlwf_helpgen.py \
     xmlwf/xmlwf_helpgen.py \
     xmlwf/xmlwf_helpgen.sh \
     xmlwf/xmlwf_helpgen.sh \

+ 121 - 25
libs/expat/Makefile.in

@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.16.1 from Makefile.am.
+# Makefile.in generated by automake 1.16.3 from Makefile.am.
 # @configure_input@
 # @configure_input@
 
 
-# Copyright (C) 1994-2018 Free Software Foundation, Inc.
+# Copyright (C) 1994-2020 Free Software Foundation, Inc.
 
 
 # This Makefile.in is free software; the Free Software Foundation
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # gives unlimited permission to copy and/or distribute it,
@@ -22,7 +22,8 @@
 #                      \___/_/\_\ .__/ \__,_|\__|
 #                      \___/_/\_\ .__/ \__,_|\__|
 #                               |_| XML parser
 #                               |_| XML parser
 #
 #
-# Copyright (c) 2017 Expat development team
+# Copyright (c) 2017-2021 Sebastian Pipping <[email protected]>
+# Copyright (c) 2018      KangLin <[email protected]>
 # Licensed under the MIT license:
 # Licensed under the MIT license:
 #
 #
 # Permission is  hereby granted,  free of charge,  to any  person obtaining
 # Permission is  hereby granted,  free of charge,  to any  person obtaining
@@ -138,12 +139,14 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
 	$(ACLOCAL_M4)
 DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \
 DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \
-	$(am__configure_deps) $(am__DIST_COMMON)
+	$(am__configure_deps) $(dist_cmake_DATA) $(am__DIST_COMMON)
 am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
 am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
  configure.lineno config.status.lineno
  configure.lineno config.status.lineno
 mkinstalldirs = $(install_sh) -d
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = expat_config.h
 CONFIG_HEADER = expat_config.h
-CONFIG_CLEAN_FILES = expat.pc run.sh
+CONFIG_CLEAN_FILES = expat.pc cmake/expat-config.cmake \
+	cmake/autotools/expat-config-version.cmake \
+	cmake/autotools/expat-noconfig.cmake run.sh
 CONFIG_CLEAN_VPATH_FILES =
 CONFIG_CLEAN_VPATH_FILES =
 AM_V_P = $(am__v_P_@AM_V@)
 AM_V_P = $(am__v_P_@AM_V@)
 am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
 am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
@@ -199,8 +202,9 @@ am__uninstall_files_from_dir = { \
     || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
     || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
          $(am__cd) "$$dir" && rm -f $$files; }; \
          $(am__cd) "$$dir" && rm -f $$files; }; \
   }
   }
-am__installdirs = "$(DESTDIR)$(pkgconfigdir)"
-DATA = $(pkgconfig_DATA)
+am__installdirs = "$(DESTDIR)$(cmakedir)" "$(DESTDIR)$(cmakedir)" \
+	"$(DESTDIR)$(pkgconfigdir)"
+DATA = $(dist_cmake_DATA) $(nodist_cmake_DATA) $(pkgconfig_DATA)
 RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive	\
 RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive	\
   distclean-recursive maintainer-clean-recursive
   distclean-recursive maintainer-clean-recursive
 am__recursive_targets = \
 am__recursive_targets = \
@@ -209,8 +213,8 @@ am__recursive_targets = \
   $(am__extra_recursive_targets)
   $(am__extra_recursive_targets)
 AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
 AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
 	cscope distdir distdir-am dist dist-all distcheck
 	cscope distdir distdir-am dist dist-all distcheck
-am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \
-	$(LISP)expat_config.h.in
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) \
+	expat_config.h.in
 # Read a list of newline-separated strings from the standard input,
 # Read a list of newline-separated strings from the standard input,
 # and print each of them once, without duplicates.  Input order is
 # and print each of them once, without duplicates.  Input order is
 # *not* preserved.
 # *not* preserved.
@@ -233,6 +237,8 @@ CSCOPE = cscope
 DIST_SUBDIRS = lib examples tests xmlwf doc
 DIST_SUBDIRS = lib examples tests xmlwf doc
 am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/expat.pc.in \
 am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/expat.pc.in \
 	$(srcdir)/expat_config.h.in $(srcdir)/run.sh.in \
 	$(srcdir)/expat_config.h.in $(srcdir)/run.sh.in \
+	$(top_srcdir)/cmake/autotools/expat-config-version.cmake.in \
+	$(top_srcdir)/cmake/expat-config.cmake.in \
 	$(top_srcdir)/conftools/ar-lib $(top_srcdir)/conftools/compile \
 	$(top_srcdir)/conftools/ar-lib $(top_srcdir)/conftools/compile \
 	$(top_srcdir)/conftools/config.guess \
 	$(top_srcdir)/conftools/config.guess \
 	$(top_srcdir)/conftools/config.sub \
 	$(top_srcdir)/conftools/config.sub \
@@ -281,13 +287,19 @@ DIST_ARCHIVES = $(distdir).tar.gz $(distdir).tar.bz2 $(distdir).tar.lz \
 	$(distdir).tar.xz
 	$(distdir).tar.xz
 GZIP_ENV = --best
 GZIP_ENV = --best
 DIST_TARGETS = dist-lzip dist-xz dist-bzip2 dist-gzip
 DIST_TARGETS = dist-lzip dist-xz dist-bzip2 dist-gzip
+# Exists only to be overridden by the user if desired.
+AM_DISTCHECK_DVI_TARGET = dvi
 distuninstallcheck_listfiles = find . -type f -print
 distuninstallcheck_listfiles = find . -type f -print
 am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \
 am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \
   | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$'
   | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$'
 distcleancheck_listfiles = find . -type f -print
 distcleancheck_listfiles = find . -type f -print
 ACLOCAL = @ACLOCAL@
 ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AMTAR = @AMTAR@
+AM_CFLAGS = @AM_CFLAGS@
+AM_CPPFLAGS = @AM_CPPFLAGS@
+AM_CXXFLAGS = @AM_CXXFLAGS@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AM_LDFLAGS = @AM_LDFLAGS@
 AR = @AR@
 AR = @AR@
 AS = @AS@
 AS = @AS@
 AUTOCONF = @AUTOCONF@
 AUTOCONF = @AUTOCONF@
@@ -315,6 +327,13 @@ ECHO_N = @ECHO_N@
 ECHO_T = @ECHO_T@
 ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
 EXEEXT = @EXEEXT@
+EXPAT_ATTR_INFO = @EXPAT_ATTR_INFO@
+EXPAT_CHAR_TYPE = @EXPAT_CHAR_TYPE@
+EXPAT_CONTEXT_BYTES = @EXPAT_CONTEXT_BYTES@
+EXPAT_DTD = @EXPAT_DTD@
+EXPAT_LARGE_SIZE = @EXPAT_LARGE_SIZE@
+EXPAT_MIN_SIZE = @EXPAT_MIN_SIZE@
+EXPAT_NS = @EXPAT_NS@
 FGREP = @FGREP@
 FGREP = @FGREP@
 FILEMAP = @FILEMAP@
 FILEMAP = @FILEMAP@
 GREP = @GREP@
 GREP = @GREP@
@@ -327,6 +346,7 @@ LD = @LD@
 LDFLAGS = @LDFLAGS@
 LDFLAGS = @LDFLAGS@
 LIBAGE = @LIBAGE@
 LIBAGE = @LIBAGE@
 LIBCURRENT = @LIBCURRENT@
 LIBCURRENT = @LIBCURRENT@
+LIBDIR_BASENAME = @LIBDIR_BASENAME@
 LIBOBJS = @LIBOBJS@
 LIBOBJS = @LIBOBJS@
 LIBREVISION = @LIBREVISION@
 LIBREVISION = @LIBREVISION@
 LIBS = @LIBS@
 LIBS = @LIBS@
@@ -356,8 +376,12 @@ RANLIB = @RANLIB@
 SED = @SED@
 SED = @SED@
 SET_MAKE = @SET_MAKE@
 SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
 SHELL = @SHELL@
+SO_MAJOR = @SO_MAJOR@
+SO_MINOR = @SO_MINOR@
+SO_PATCH = @SO_PATCH@
 STRIP = @STRIP@
 STRIP = @STRIP@
 VERSION = @VERSION@
 VERSION = @VERSION@
+_EXPAT_OUTPUT_NAME = @_EXPAT_OUTPUT_NAME@
 abs_builddir = @abs_builddir@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
 abs_srcdir = @abs_srcdir@
 abs_top_builddir = @abs_top_builddir@
 abs_top_builddir = @abs_top_builddir@
@@ -366,6 +390,7 @@ ac_ct_AR = @ac_ct_AR@
 ac_ct_CC = @ac_ct_CC@
 ac_ct_CC = @ac_ct_CC@
 ac_ct_CXX = @ac_ct_CXX@
 ac_ct_CXX = @ac_ct_CXX@
 ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
 ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+ac_cv_sizeof_void_p = @ac_cv_sizeof_void_p@
 am__include = @am__include@
 am__include = @am__include@
 am__leading_dot = @am__leading_dot@
 am__leading_dot = @am__leading_dot@
 am__quote = @am__quote@
 am__quote = @am__quote@
@@ -403,6 +428,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
 srcdir = @srcdir@
@@ -423,8 +449,20 @@ LIBTOOLFLAGS = --verbose
 SUBDIRS = lib $(am__append_1) $(am__append_2) $(am__append_3)
 SUBDIRS = lib $(am__append_1) $(am__append_2) $(am__append_3)
 pkgconfig_DATA = expat.pc
 pkgconfig_DATA = expat.pc
 pkgconfigdir = $(libdir)/pkgconfig
 pkgconfigdir = $(libdir)/pkgconfig
+dist_cmake_DATA = \
+    cmake/autotools/expat.cmake
+
+nodist_cmake_DATA = \
+    cmake/autotools/expat-config-version.cmake \
+    cmake/autotools/expat-noconfig.cmake \
+    cmake/expat-config.cmake
+
+cmakedir = $(libdir)/cmake/expat-@PACKAGE_VERSION@
 _EXTRA_DIST_CMAKE = \
 _EXTRA_DIST_CMAKE = \
-    cmake/expat-config.cmake.in \
+    cmake/autotools/expat-noconfig__linux.cmake.in \
+    cmake/autotools/expat-noconfig__macos.cmake.in \
+    cmake/autotools/expat-noconfig__windows.cmake.in \
+    cmake/autotools/expat-package-init.cmake \
     cmake/mingw-toolchain.cmake \
     cmake/mingw-toolchain.cmake \
     \
     \
     CMakeLists.txt \
     CMakeLists.txt \
@@ -444,7 +482,6 @@ EXTRA_DIST = \
     \
     \
     conftools/expat.m4 \
     conftools/expat.m4 \
     conftools/get-version.sh \
     conftools/get-version.sh \
-    conftools/PrintPath \
     \
     \
     xmlwf/xmlwf_helpgen.py \
     xmlwf/xmlwf_helpgen.py \
     xmlwf/xmlwf_helpgen.sh \
     xmlwf/xmlwf_helpgen.sh \
@@ -509,6 +546,12 @@ distclean-hdr:
 	-rm -f expat_config.h stamp-h1
 	-rm -f expat_config.h stamp-h1
 expat.pc: $(top_builddir)/config.status $(srcdir)/expat.pc.in
 expat.pc: $(top_builddir)/config.status $(srcdir)/expat.pc.in
 	cd $(top_builddir) && $(SHELL) ./config.status $@
 	cd $(top_builddir) && $(SHELL) ./config.status $@
+cmake/expat-config.cmake: $(top_builddir)/config.status $(top_srcdir)/cmake/expat-config.cmake.in
+	cd $(top_builddir) && $(SHELL) ./config.status $@
+cmake/autotools/expat-config-version.cmake: $(top_builddir)/config.status $(top_srcdir)/cmake/autotools/expat-config-version.cmake.in
+	cd $(top_builddir) && $(SHELL) ./config.status $@
+cmake/autotools/expat-noconfig.cmake: $(top_builddir)/config.status 
+	cd $(top_builddir) && $(SHELL) ./config.status $@
 run.sh: $(top_builddir)/config.status $(srcdir)/run.sh.in
 run.sh: $(top_builddir)/config.status $(srcdir)/run.sh.in
 	cd $(top_builddir) && $(SHELL) ./config.status $@
 	cd $(top_builddir) && $(SHELL) ./config.status $@
 
 
@@ -520,6 +563,48 @@ clean-libtool:
 
 
 distclean-libtool:
 distclean-libtool:
 	-rm -f libtool config.lt
 	-rm -f libtool config.lt
+install-dist_cmakeDATA: $(dist_cmake_DATA)
+	@$(NORMAL_INSTALL)
+	@list='$(dist_cmake_DATA)'; test -n "$(cmakedir)" || list=; \
+	if test -n "$$list"; then \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(cmakedir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(cmakedir)" || exit 1; \
+	fi; \
+	for p in $$list; do \
+	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+	  echo "$$d$$p"; \
+	done | $(am__base_list) | \
+	while read files; do \
+	  echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(cmakedir)'"; \
+	  $(INSTALL_DATA) $$files "$(DESTDIR)$(cmakedir)" || exit $$?; \
+	done
+
+uninstall-dist_cmakeDATA:
+	@$(NORMAL_UNINSTALL)
+	@list='$(dist_cmake_DATA)'; test -n "$(cmakedir)" || list=; \
+	files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+	dir='$(DESTDIR)$(cmakedir)'; $(am__uninstall_files_from_dir)
+install-nodist_cmakeDATA: $(nodist_cmake_DATA)
+	@$(NORMAL_INSTALL)
+	@list='$(nodist_cmake_DATA)'; test -n "$(cmakedir)" || list=; \
+	if test -n "$$list"; then \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(cmakedir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(cmakedir)" || exit 1; \
+	fi; \
+	for p in $$list; do \
+	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+	  echo "$$d$$p"; \
+	done | $(am__base_list) | \
+	while read files; do \
+	  echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(cmakedir)'"; \
+	  $(INSTALL_DATA) $$files "$(DESTDIR)$(cmakedir)" || exit $$?; \
+	done
+
+uninstall-nodist_cmakeDATA:
+	@$(NORMAL_UNINSTALL)
+	@list='$(nodist_cmake_DATA)'; test -n "$(cmakedir)" || list=; \
+	files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+	dir='$(DESTDIR)$(cmakedir)'; $(am__uninstall_files_from_dir)
 install-pkgconfigDATA: $(pkgconfig_DATA)
 install-pkgconfigDATA: $(pkgconfig_DATA)
 	@$(NORMAL_INSTALL)
 	@$(NORMAL_INSTALL)
 	@list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \
 	@list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \
@@ -728,6 +813,10 @@ dist-xz: distdir
 	tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz
 	tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz
 	$(am__post_remove_distdir)
 	$(am__post_remove_distdir)
 
 
+dist-zstd: distdir
+	tardir=$(distdir) && $(am__tar) | zstd -c $${ZSTD_CLEVEL-$${ZSTD_OPT--19}} >$(distdir).tar.zst
+	$(am__post_remove_distdir)
+
 dist-tarZ: distdir
 dist-tarZ: distdir
 	@echo WARNING: "Support for distribution archives compressed with" \
 	@echo WARNING: "Support for distribution archives compressed with" \
 		       "legacy program 'compress' is deprecated." >&2
 		       "legacy program 'compress' is deprecated." >&2
@@ -770,6 +859,8 @@ distcheck: dist
 	  eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\
 	  eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\
 	*.zip*) \
 	*.zip*) \
 	  unzip $(distdir).zip ;;\
 	  unzip $(distdir).zip ;;\
+	*.tar.zst*) \
+	  zstd -dc $(distdir).tar.zst | $(am__untar) ;;\
 	esac
 	esac
 	chmod -R a-w $(distdir)
 	chmod -R a-w $(distdir)
 	chmod u+w $(distdir)
 	chmod u+w $(distdir)
@@ -785,7 +876,7 @@ distcheck: dist
 	    $(DISTCHECK_CONFIGURE_FLAGS) \
 	    $(DISTCHECK_CONFIGURE_FLAGS) \
 	    --srcdir=../.. --prefix="$$dc_install_base" \
 	    --srcdir=../.. --prefix="$$dc_install_base" \
 	  && $(MAKE) $(AM_MAKEFLAGS) \
 	  && $(MAKE) $(AM_MAKEFLAGS) \
-	  && $(MAKE) $(AM_MAKEFLAGS) dvi \
+	  && $(MAKE) $(AM_MAKEFLAGS) $(AM_DISTCHECK_DVI_TARGET) \
 	  && $(MAKE) $(AM_MAKEFLAGS) check \
 	  && $(MAKE) $(AM_MAKEFLAGS) check \
 	  && $(MAKE) $(AM_MAKEFLAGS) install \
 	  && $(MAKE) $(AM_MAKEFLAGS) install \
 	  && $(MAKE) $(AM_MAKEFLAGS) installcheck \
 	  && $(MAKE) $(AM_MAKEFLAGS) installcheck \
@@ -841,7 +932,7 @@ check: check-recursive
 all-am: Makefile $(DATA) expat_config.h
 all-am: Makefile $(DATA) expat_config.h
 installdirs: installdirs-recursive
 installdirs: installdirs-recursive
 installdirs-am:
 installdirs-am:
-	for dir in "$(DESTDIR)$(pkgconfigdir)"; do \
+	for dir in "$(DESTDIR)$(cmakedir)" "$(DESTDIR)$(cmakedir)" "$(DESTDIR)$(pkgconfigdir)"; do \
 	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
 	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
 	done
 	done
 install: install-recursive
 install: install-recursive
@@ -896,7 +987,8 @@ info: info-recursive
 
 
 info-am:
 info-am:
 
 
-install-data-am: install-pkgconfigDATA
+install-data-am: install-dist_cmakeDATA install-nodist_cmakeDATA \
+	install-pkgconfigDATA
 
 
 install-dvi: install-dvi-recursive
 install-dvi: install-dvi-recursive
 
 
@@ -942,7 +1034,8 @@ ps: ps-recursive
 
 
 ps-am:
 ps-am:
 
 
-uninstall-am: uninstall-pkgconfigDATA
+uninstall-am: uninstall-dist_cmakeDATA uninstall-nodist_cmakeDATA \
+	uninstall-pkgconfigDATA
 
 
 .MAKE: $(am__recursive_targets) all install-am install-strip
 .MAKE: $(am__recursive_targets) all install-am install-strip
 
 
@@ -950,18 +1043,21 @@ uninstall-am: uninstall-pkgconfigDATA
 	am--refresh check check-am clean clean-cscope clean-generic \
 	am--refresh check check-am clean clean-cscope clean-generic \
 	clean-libtool cscope cscopelist-am ctags ctags-am dist \
 	clean-libtool cscope cscopelist-am ctags ctags-am dist \
 	dist-all dist-bzip2 dist-gzip dist-lzip dist-shar dist-tarZ \
 	dist-all dist-bzip2 dist-gzip dist-lzip dist-shar dist-tarZ \
-	dist-xz dist-zip distcheck distclean distclean-generic \
-	distclean-hdr distclean-libtool distclean-tags distcleancheck \
-	distdir distuninstallcheck dvi dvi-am html html-am info \
-	info-am install install-am install-data install-data-am \
+	dist-xz dist-zip dist-zstd distcheck distclean \
+	distclean-generic distclean-hdr distclean-libtool \
+	distclean-tags distcleancheck distdir distuninstallcheck dvi \
+	dvi-am html html-am info info-am install install-am \
+	install-data install-data-am install-dist_cmakeDATA \
 	install-dvi install-dvi-am install-exec install-exec-am \
 	install-dvi install-dvi-am install-exec install-exec-am \
 	install-html install-html-am install-info install-info-am \
 	install-html install-html-am install-info install-info-am \
-	install-man install-pdf install-pdf-am install-pkgconfigDATA \
-	install-ps install-ps-am install-strip installcheck \
-	installcheck-am installdirs installdirs-am maintainer-clean \
-	maintainer-clean-generic mostlyclean mostlyclean-generic \
-	mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \
-	uninstall-am uninstall-pkgconfigDATA
+	install-man install-nodist_cmakeDATA install-pdf \
+	install-pdf-am install-pkgconfigDATA install-ps install-ps-am \
+	install-strip installcheck installcheck-am installdirs \
+	installdirs-am maintainer-clean maintainer-clean-generic \
+	mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \
+	ps ps-am tags tags-am uninstall uninstall-am \
+	uninstall-dist_cmakeDATA uninstall-nodist_cmakeDATA \
+	uninstall-pkgconfigDATA
 
 
 .PRECIOUS: Makefile
 .PRECIOUS: Makefile
 
 

+ 89 - 8
libs/expat/README.md

@@ -1,12 +1,14 @@
-[![Travis CI Build Status](https://travis-ci.org/libexpat/libexpat.svg?branch=master)](https://travis-ci.org/libexpat/libexpat)
+[![Run Linux Travis CI tasks](https://github.com/libexpat/libexpat/actions/workflows/linux.yml/badge.svg)](https://github.com/libexpat/libexpat/actions/workflows/linux.yml)
 [![AppVeyor Build Status](https://ci.appveyor.com/api/projects/status/github/libexpat/libexpat?svg=true)](https://ci.appveyor.com/project/libexpat/libexpat)
 [![AppVeyor Build Status](https://ci.appveyor.com/api/projects/status/github/libexpat/libexpat?svg=true)](https://ci.appveyor.com/project/libexpat/libexpat)
 [![Packaging status](https://repology.org/badge/tiny-repos/expat.svg)](https://repology.org/metapackage/expat/versions)
 [![Packaging status](https://repology.org/badge/tiny-repos/expat.svg)](https://repology.org/metapackage/expat/versions)
+[![Downloads SourceForge](https://img.shields.io/sourceforge/dt/expat?label=Downloads%20SourceForge)](https://sourceforge.net/projects/expat/files/)
+[![Downloads GitHub](https://img.shields.io/github/downloads/libexpat/libexpat/total?label=Downloads%20GitHub)](https://github.com/libexpat/libexpat/releases)
 
 
 
 
-# Expat, Release 2.2.9
+# Expat, Release 2.4.1
 
 
 This is Expat, a C library for parsing XML, started by
 This is Expat, a C library for parsing XML, started by
-[James Clark](https://en.wikipedia.org/wiki/James_Clark_(programmer)) in 1997.
+[James Clark](https://en.wikipedia.org/wiki/James_Clark_%28programmer%29) in 1997.
 Expat is a stream-oriented XML parser.  This means that you register
 Expat is a stream-oriented XML parser.  This means that you register
 handlers with the parser before starting the parse.  These handlers
 handlers with the parser before starting the parse.  These handlers
 are called when the parser discovers the associated structures in the
 are called when the parser discovers the associated structures in the
@@ -14,13 +16,14 @@ document being parsed.  A start tag is an example of the kind of
 structures for which you may register handlers.
 structures for which you may register handlers.
 
 
 Expat supports the following compilers:
 Expat supports the following compilers:
+
 - GNU GCC >=4.5
 - GNU GCC >=4.5
 - LLVM Clang >=3.5
 - LLVM Clang >=3.5
-- Microsoft Visual Studio >=8.0/2005
+- Microsoft Visual Studio >=15.0/2017 (rolling `${today} minus 5 years`)
 
 
-Windows users should use the
-[`expat_win32` package](https://sourceforge.net/projects/expat/files/expat_win32/),
-which includes both precompiled libraries and executables, and source code for
+Windows users can use the
+[`expat-win32bin-*.*.*.{exe,zip}` download](https://github.com/libexpat/libexpat/releases),
+which includes both pre-compiled libraries and executables, and source code for
 developers.
 developers.
 
 
 Expat is [free software](https://www.gnu.org/philosophy/free-sw.en.html).
 Expat is [free software](https://www.gnu.org/philosophy/free-sw.en.html).
@@ -30,6 +33,67 @@ contained in the file
 distributed with this package.
 distributed with this package.
 This license is the same as the MIT/X Consortium license.
 This license is the same as the MIT/X Consortium license.
 
 
+
+## Using libexpat in your CMake-Based Project
+
+There are two ways of using libexpat with CMake:
+
+### a) Module Mode
+
+This approach leverages CMake's own [module `FindEXPAT`](https://cmake.org/cmake/help/latest/module/FindEXPAT.html).
+
+Notice the *uppercase* `EXPAT` in the following example:
+
+```cmake
+cmake_minimum_required(VERSION 3.0)  # or 3.10, see below
+
+project(hello VERSION 1.0.0)
+
+find_package(EXPAT 2.2.8 MODULE REQUIRED)
+
+add_executable(hello
+    hello.c
+)
+
+# a) for CMake >=3.10 (see CMake's FindEXPAT docs)
+target_link_libraries(hello PUBLIC EXPAT::EXPAT)
+
+# b) for CMake >=3.0
+target_include_directories(hello PRIVATE ${EXPAT_INCLUDE_DIRS})
+target_link_libraries(hello PUBLIC ${EXPAT_LIBRARIES})
+```
+
+### b) Config Mode
+
+This approach requires files from…
+
+- libexpat >=2.2.8 where packaging uses the CMake build system
+or
+- libexpat >=2.3.0 where packaging uses the GNU Autotools build system
+  on Linux
+or
+- libexpat >=2.4.0 where packaging uses the GNU Autotools build system
+  on macOS or MinGW.
+
+Notice the *lowercase* `expat` in the following example:
+
+```cmake
+cmake_minimum_required(VERSION 3.0)
+
+project(hello VERSION 1.0.0)
+
+find_package(expat 2.2.8 CONFIG REQUIRED char dtd ns)
+
+add_executable(hello
+    hello.c
+)
+
+target_link_libraries(hello PUBLIC expat::expat)
+```
+
+
+## Building from a Git Clone
+
 If you are building Expat from a check-out from the
 If you are building Expat from a check-out from the
 [Git repository](https://github.com/libexpat/libexpat/),
 [Git repository](https://github.com/libexpat/libexpat/),
 you need to run a script that generates the configure script using the
 you need to run a script that generates the configure script using the
@@ -43,6 +107,11 @@ autoconf 2.58 or newer. Run the script like this:
 Once this has been done, follow the same instructions as for building
 Once this has been done, follow the same instructions as for building
 from a source distribution.
 from a source distribution.
 
 
+
+## Building from a Source Distribution
+
+### a) Building with the configure script (i.e. GNU Autotools)
+
 To build Expat from a source distribution, you first run the
 To build Expat from a source distribution, you first run the
 configuration shell script in the top level distribution directory:
 configuration shell script in the top level distribution directory:
 
 
@@ -132,8 +201,14 @@ A reference manual is available in the file `doc/reference.html` in this
 distribution.
 distribution.
 
 
 
 
-The CMake build system is still *experimental* and will replace the primary
+### b) Building with CMake
+
+The CMake build system is still *experimental* and may replace the primary
 build system based on GNU Autotools at some point when it is ready.
 build system based on GNU Autotools at some point when it is ready.
+
+
+#### Available Options
+
 For an idea of the available (non-advanced) options for building with CMake:
 For an idea of the available (non-advanced) options for building with CMake:
 
 
 ```console
 ```console
@@ -156,6 +231,9 @@ EXPAT_BUILD_EXAMPLES:BOOL=ON
 // build fuzzers for the expat library
 // build fuzzers for the expat library
 EXPAT_BUILD_FUZZERS:BOOL=OFF
 EXPAT_BUILD_FUZZERS:BOOL=OFF
 
 
+// build pkg-config file
+EXPAT_BUILD_PKGCONFIG:BOOL=ON
+
 // build the tests for expat library
 // build the tests for expat library
 EXPAT_BUILD_TESTS:BOOL=ON
 EXPAT_BUILD_TESTS:BOOL=ON
 
 
@@ -171,6 +249,9 @@ EXPAT_ENABLE_INSTALL:BOOL=ON
 // Use /MT flag (static CRT) when compiling in MSVC
 // Use /MT flag (static CRT) when compiling in MSVC
 EXPAT_MSVC_STATIC_CRT:BOOL=OFF
 EXPAT_MSVC_STATIC_CRT:BOOL=OFF
 
 
+// build fuzzers via ossfuzz for the expat library
+EXPAT_OSSFUZZ_BUILD:BOOL=OFF
+
 // build a shared expat library
 // build a shared expat library
 EXPAT_SHARED_LIBS:BOOL=ON
 EXPAT_SHARED_LIBS:BOOL=ON
 
 

+ 27 - 30
libs/expat/aclocal.m4

@@ -1,6 +1,6 @@
-# generated automatically by aclocal 1.16.1 -*- Autoconf -*-
+# generated automatically by aclocal 1.16.3 -*- Autoconf -*-
 
 
-# Copyright (C) 1996-2018 Free Software Foundation, Inc.
+# Copyright (C) 1996-2020 Free Software Foundation, Inc.
 
 
 # This file is free software; the Free Software Foundation
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # gives unlimited permission to copy and/or distribute it,
@@ -20,7 +20,7 @@ You have another version of autoconf.  It may work, but is not guaranteed to.
 If you have problems, you may need to regenerate the build system entirely.
 If you have problems, you may need to regenerate the build system entirely.
 To do so, use the procedure documented by the package, typically 'autoreconf'.])])
 To do so, use the procedure documented by the package, typically 'autoreconf'.])])
 
 
-# Copyright (C) 2002-2018 Free Software Foundation, Inc.
+# Copyright (C) 2002-2020 Free Software Foundation, Inc.
 #
 #
 # This file is free software; the Free Software Foundation
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # gives unlimited permission to copy and/or distribute it,
@@ -35,7 +35,7 @@ AC_DEFUN([AM_AUTOMAKE_VERSION],
 [am__api_version='1.16'
 [am__api_version='1.16'
 dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
 dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
 dnl require some minimum version.  Point them to the right macro.
 dnl require some minimum version.  Point them to the right macro.
-m4_if([$1], [1.16.1], [],
+m4_if([$1], [1.16.3], [],
       [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
       [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
 ])
 ])
 
 
@@ -51,12 +51,12 @@ m4_define([_AM_AUTOCONF_VERSION], [])
 # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
 # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
 # This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
 # This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
 AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
 AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
-[AM_AUTOMAKE_VERSION([1.16.1])dnl
+[AM_AUTOMAKE_VERSION([1.16.3])dnl
 m4_ifndef([AC_AUTOCONF_VERSION],
 m4_ifndef([AC_AUTOCONF_VERSION],
   [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
   [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
 _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
 _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
 
 
-# Copyright (C) 2011-2018 Free Software Foundation, Inc.
+# Copyright (C) 2011-2020 Free Software Foundation, Inc.
 #
 #
 # This file is free software; the Free Software Foundation
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # gives unlimited permission to copy and/or distribute it,
@@ -118,7 +118,7 @@ AC_SUBST([AR])dnl
 
 
 # AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
 # AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
 
 
-# Copyright (C) 2001-2018 Free Software Foundation, Inc.
+# Copyright (C) 2001-2020 Free Software Foundation, Inc.
 #
 #
 # This file is free software; the Free Software Foundation
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # gives unlimited permission to copy and/or distribute it,
@@ -170,7 +170,7 @@ am_aux_dir=`cd "$ac_aux_dir" && pwd`
 
 
 # AM_CONDITIONAL                                            -*- Autoconf -*-
 # AM_CONDITIONAL                                            -*- Autoconf -*-
 
 
-# Copyright (C) 1997-2018 Free Software Foundation, Inc.
+# Copyright (C) 1997-2020 Free Software Foundation, Inc.
 #
 #
 # This file is free software; the Free Software Foundation
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # gives unlimited permission to copy and/or distribute it,
@@ -201,7 +201,7 @@ AC_CONFIG_COMMANDS_PRE(
 Usually this means the macro was only invoked conditionally.]])
 Usually this means the macro was only invoked conditionally.]])
 fi])])
 fi])])
 
 
-# Copyright (C) 1999-2018 Free Software Foundation, Inc.
+# Copyright (C) 1999-2020 Free Software Foundation, Inc.
 #
 #
 # This file is free software; the Free Software Foundation
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # gives unlimited permission to copy and/or distribute it,
@@ -392,7 +392,7 @@ _AM_SUBST_NOTMAKE([am__nodep])dnl
 
 
 # Generate code to set up dependency tracking.              -*- Autoconf -*-
 # Generate code to set up dependency tracking.              -*- Autoconf -*-
 
 
-# Copyright (C) 1999-2018 Free Software Foundation, Inc.
+# Copyright (C) 1999-2020 Free Software Foundation, Inc.
 #
 #
 # This file is free software; the Free Software Foundation
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # gives unlimited permission to copy and/or distribute it,
@@ -431,7 +431,9 @@ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
   done
   done
   if test $am_rc -ne 0; then
   if test $am_rc -ne 0; then
     AC_MSG_FAILURE([Something went wrong bootstrapping makefile fragments
     AC_MSG_FAILURE([Something went wrong bootstrapping makefile fragments
-    for automatic dependency tracking.  Try re-running configure with the
+    for automatic dependency tracking.  If GNU make was not used, consider
+    re-running the configure script with MAKE="gmake" (or whatever is
+    necessary).  You can also try re-running configure with the
     '--disable-dependency-tracking' option to at least be able to build
     '--disable-dependency-tracking' option to at least be able to build
     the package (albeit without support for automatic dependency tracking).])
     the package (albeit without support for automatic dependency tracking).])
   fi
   fi
@@ -458,7 +460,7 @@ AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
 
 
 # Do all the work for Automake.                             -*- Autoconf -*-
 # Do all the work for Automake.                             -*- Autoconf -*-
 
 
-# Copyright (C) 1996-2018 Free Software Foundation, Inc.
+# Copyright (C) 1996-2020 Free Software Foundation, Inc.
 #
 #
 # This file is free software; the Free Software Foundation
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # gives unlimited permission to copy and/or distribute it,
@@ -655,7 +657,7 @@ for _am_header in $config_headers :; do
 done
 done
 echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
 echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
 
 
-# Copyright (C) 2001-2018 Free Software Foundation, Inc.
+# Copyright (C) 2001-2020 Free Software Foundation, Inc.
 #
 #
 # This file is free software; the Free Software Foundation
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # gives unlimited permission to copy and/or distribute it,
@@ -676,7 +678,7 @@ if test x"${install_sh+set}" != xset; then
 fi
 fi
 AC_SUBST([install_sh])])
 AC_SUBST([install_sh])])
 
 
-# Copyright (C) 2003-2018 Free Software Foundation, Inc.
+# Copyright (C) 2003-2020 Free Software Foundation, Inc.
 #
 #
 # This file is free software; the Free Software Foundation
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # gives unlimited permission to copy and/or distribute it,
@@ -697,7 +699,7 @@ AC_SUBST([am__leading_dot])])
 
 
 # Check to see how 'make' treats includes.	            -*- Autoconf -*-
 # Check to see how 'make' treats includes.	            -*- Autoconf -*-
 
 
-# Copyright (C) 2001-2018 Free Software Foundation, Inc.
+# Copyright (C) 2001-2020 Free Software Foundation, Inc.
 #
 #
 # This file is free software; the Free Software Foundation
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # gives unlimited permission to copy and/or distribute it,
@@ -740,7 +742,7 @@ AC_SUBST([am__quote])])
 
 
 # Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
 # Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
 
 
-# Copyright (C) 1997-2018 Free Software Foundation, Inc.
+# Copyright (C) 1997-2020 Free Software Foundation, Inc.
 #
 #
 # This file is free software; the Free Software Foundation
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # gives unlimited permission to copy and/or distribute it,
@@ -761,12 +763,7 @@ AC_DEFUN([AM_MISSING_HAS_RUN],
 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
 AC_REQUIRE_AUX_FILE([missing])dnl
 AC_REQUIRE_AUX_FILE([missing])dnl
 if test x"${MISSING+set}" != xset; then
 if test x"${MISSING+set}" != xset; then
-  case $am_aux_dir in
-  *\ * | *\	*)
-    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
-  *)
-    MISSING="\${SHELL} $am_aux_dir/missing" ;;
-  esac
+  MISSING="\${SHELL} '$am_aux_dir/missing'"
 fi
 fi
 # Use eval to expand $SHELL
 # Use eval to expand $SHELL
 if eval "$MISSING --is-lightweight"; then
 if eval "$MISSING --is-lightweight"; then
@@ -779,7 +776,7 @@ fi
 
 
 # Helper functions for option handling.                     -*- Autoconf -*-
 # Helper functions for option handling.                     -*- Autoconf -*-
 
 
-# Copyright (C) 2001-2018 Free Software Foundation, Inc.
+# Copyright (C) 2001-2020 Free Software Foundation, Inc.
 #
 #
 # This file is free software; the Free Software Foundation
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # gives unlimited permission to copy and/or distribute it,
@@ -808,7 +805,7 @@ AC_DEFUN([_AM_SET_OPTIONS],
 AC_DEFUN([_AM_IF_OPTION],
 AC_DEFUN([_AM_IF_OPTION],
 [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
 [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
 
 
-# Copyright (C) 1999-2018 Free Software Foundation, Inc.
+# Copyright (C) 1999-2020 Free Software Foundation, Inc.
 #
 #
 # This file is free software; the Free Software Foundation
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # gives unlimited permission to copy and/or distribute it,
@@ -855,7 +852,7 @@ AC_LANG_POP([C])])
 # For backward compatibility.
 # For backward compatibility.
 AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])])
 AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])])
 
 
-# Copyright (C) 2001-2018 Free Software Foundation, Inc.
+# Copyright (C) 2001-2020 Free Software Foundation, Inc.
 #
 #
 # This file is free software; the Free Software Foundation
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # gives unlimited permission to copy and/or distribute it,
@@ -874,7 +871,7 @@ AC_DEFUN([AM_RUN_LOG],
 
 
 # Check to make sure that the build environment is sane.    -*- Autoconf -*-
 # Check to make sure that the build environment is sane.    -*- Autoconf -*-
 
 
-# Copyright (C) 1996-2018 Free Software Foundation, Inc.
+# Copyright (C) 1996-2020 Free Software Foundation, Inc.
 #
 #
 # This file is free software; the Free Software Foundation
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # gives unlimited permission to copy and/or distribute it,
@@ -955,7 +952,7 @@ AC_CONFIG_COMMANDS_PRE(
 rm -f conftest.file
 rm -f conftest.file
 ])
 ])
 
 
-# Copyright (C) 2009-2018 Free Software Foundation, Inc.
+# Copyright (C) 2009-2020 Free Software Foundation, Inc.
 #
 #
 # This file is free software; the Free Software Foundation
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # gives unlimited permission to copy and/or distribute it,
@@ -1015,7 +1012,7 @@ AC_SUBST([AM_BACKSLASH])dnl
 _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
 _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
 ])
 ])
 
 
-# Copyright (C) 2001-2018 Free Software Foundation, Inc.
+# Copyright (C) 2001-2020 Free Software Foundation, Inc.
 #
 #
 # This file is free software; the Free Software Foundation
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # gives unlimited permission to copy and/or distribute it,
@@ -1043,7 +1040,7 @@ fi
 INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
 INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
 AC_SUBST([INSTALL_STRIP_PROGRAM])])
 AC_SUBST([INSTALL_STRIP_PROGRAM])])
 
 
-# Copyright (C) 2006-2018 Free Software Foundation, Inc.
+# Copyright (C) 2006-2020 Free Software Foundation, Inc.
 #
 #
 # This file is free software; the Free Software Foundation
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # gives unlimited permission to copy and/or distribute it,
@@ -1062,7 +1059,7 @@ AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
 
 
 # Check how to create a tarball.                            -*- Autoconf -*-
 # Check how to create a tarball.                            -*- Autoconf -*-
 
 
-# Copyright (C) 2004-2018 Free Software Foundation, Inc.
+# Copyright (C) 2004-2020 Free Software Foundation, Inc.
 #
 #
 # This file is free software; the Free Software Foundation
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # gives unlimited permission to copy and/or distribute it,

+ 2 - 2
libs/expat/bcb5/expat_static.mak

@@ -35,9 +35,9 @@ PATHRC = .;
 LINKER = TLib
 LINKER = TLib
 DEBUGLIBPATH = $(BCB)\lib\debug
 DEBUGLIBPATH = $(BCB)\lib\debug
 RELEASELIBPATH = $(BCB)\lib\release
 RELEASELIBPATH = $(BCB)\lib\release
-USERDEFINES = _WINDOWS;WIN32;NDEBUG;_LIB;XML_STATIC
+USERDEFINES = _WINDOWS;WIN32;NDEBUG;_LIB;XML_STATIC;WINSCP
 SYSDEFINES = _NO_VCL;_ASSERTE;NO_STRICT;_RTLDLL
 SYSDEFINES = _NO_VCL;_ASSERTE;NO_STRICT;_RTLDLL
-INCLUDEPATH = ..\lib;$(BCB)\include
+INCLUDEPATH = ..;..\lib;$(BCB)\include
 LIBPATH = ..\lib;$(BCB)\lib;$(RELEASELIBPATH)
 LIBPATH = ..\lib;$(BCB)\lib;$(RELEASELIBPATH)
 WARNINGS = -w-rch -w-par -w-8027 -w-8026 -w-ccc -w-8012
 WARNINGS = -w-rch -w-par -w-8027 -w-8026 -w-ccc -w-8012
 LISTFILE = 
 LISTFILE = 

+ 67 - 0
libs/expat/cmake/autotools/expat-config-version.cmake.in

@@ -0,0 +1,67 @@
+# This is a basic version file for the Config-mode of find_package().
+# It is used by write_basic_package_version_file() as input file for configure_file()
+# to create a version-file which can be installed along a config.cmake file.
+#
+# The created file sets PACKAGE_VERSION_EXACT if the current version string and
+# the requested version string are exactly the same and it sets
+# PACKAGE_VERSION_COMPATIBLE if the current version is >= requested version,
+# but only if the requested major version is the same as the current one.
+# The variable CVF_VERSION must be set before calling configure_file().
+
+
+set(PACKAGE_VERSION "@PACKAGE_VERSION@")
+
+if(PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION)
+  set(PACKAGE_VERSION_COMPATIBLE FALSE)
+else()
+
+  if("@PACKAGE_VERSION@" MATCHES "^([0-9]+)\\.")
+    set(CVF_VERSION_MAJOR "${CMAKE_MATCH_1}")
+  else()
+    set(CVF_VERSION_MAJOR "@PACKAGE_VERSION@")
+  endif()
+
+  if(PACKAGE_FIND_VERSION_RANGE)
+    # both endpoints of the range must have the expected major version
+    math (EXPR CVF_VERSION_MAJOR_NEXT "${CVF_VERSION_MAJOR} + 1")
+    if (NOT PACKAGE_FIND_VERSION_MIN_MAJOR STREQUAL CVF_VERSION_MAJOR
+        OR ((PACKAGE_FIND_VERSION_RANGE_MAX STREQUAL "INCLUDE" AND NOT PACKAGE_FIND_VERSION_MAX_MAJOR STREQUAL CVF_VERSION_MAJOR)
+          OR (PACKAGE_FIND_VERSION_RANGE_MAX STREQUAL "EXCLUDE" AND NOT PACKAGE_FIND_VERSION_MAX VERSION_LESS_EQUAL CVF_VERSION_MAJOR_NEXT)))
+      set(PACKAGE_VERSION_COMPATIBLE FALSE)
+    elseif(PACKAGE_FIND_VERSION_MIN_MAJOR STREQUAL CVF_VERSION_MAJOR
+        AND ((PACKAGE_FIND_VERSION_RANGE_MAX STREQUAL "INCLUDE" AND PACKAGE_VERSION VERSION_LESS_EQUAL PACKAGE_FIND_VERSION_MAX)
+        OR (PACKAGE_FIND_VERSION_RANGE_MAX STREQUAL "EXCLUDE" AND PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION_MAX)))
+      set(PACKAGE_VERSION_COMPATIBLE TRUE)
+    else()
+      set(PACKAGE_VERSION_COMPATIBLE FALSE)
+    endif()
+  else()
+    if(PACKAGE_FIND_VERSION_MAJOR STREQUAL CVF_VERSION_MAJOR)
+      set(PACKAGE_VERSION_COMPATIBLE TRUE)
+    else()
+      set(PACKAGE_VERSION_COMPATIBLE FALSE)
+    endif()
+
+    if(PACKAGE_FIND_VERSION STREQUAL PACKAGE_VERSION)
+      set(PACKAGE_VERSION_EXACT TRUE)
+    endif()
+  endif()
+endif()
+
+
+# if the installed project requested no architecture check, don't perform the check
+if("FALSE")
+  return()
+endif()
+
+# if the installed or the using project don't have CMAKE_SIZEOF_VOID_P set, ignore it:
+if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "" OR "@ac_cv_sizeof_void_p@" STREQUAL "")
+  return()
+endif()
+
+# check that the installed version has the same 32/64bit-ness as the one which is currently searching:
+if(NOT CMAKE_SIZEOF_VOID_P STREQUAL "@ac_cv_sizeof_void_p@")
+  math(EXPR installedBits "@ac_cv_sizeof_void_p@ * 8")
+  set(PACKAGE_VERSION "${PACKAGE_VERSION} (${installedBits}bit)")
+  set(PACKAGE_VERSION_UNSUITABLE TRUE)
+endif()

+ 19 - 0
libs/expat/cmake/autotools/expat-noconfig.cmake.in

@@ -0,0 +1,19 @@
+#----------------------------------------------------------------
+# Generated CMake target import file.
+#----------------------------------------------------------------
+
+# Commands may need to know the format version.
+set(CMAKE_IMPORT_FILE_VERSION 1)
+
+# Import target "expat::expat" for configuration ""
+set_property(TARGET expat::expat APPEND PROPERTY IMPORTED_CONFIGURATIONS NOCONFIG)
+set_target_properties(expat::expat PROPERTIES
+  IMPORTED_LOCATION_NOCONFIG "${_IMPORT_PREFIX}/@LIBDIR_BASENAME@/libexpat.so.@SO_MAJOR@.@SO_MINOR@.@SO_PATCH@"
+  IMPORTED_SONAME_NOCONFIG "libexpat.so.@SO_MAJOR@"
+  )
+
+list(APPEND _IMPORT_CHECK_TARGETS expat::expat )
+list(APPEND _IMPORT_CHECK_FILES_FOR_expat::expat "${_IMPORT_PREFIX}/@LIBDIR_BASENAME@/libexpat.so.@SO_MAJOR@.@SO_MINOR@.@SO_PATCH@" )
+
+# Commands beyond this point should not need to know the version.
+set(CMAKE_IMPORT_FILE_VERSION)

+ 19 - 0
libs/expat/cmake/autotools/expat-noconfig__linux.cmake.in

@@ -0,0 +1,19 @@
+#----------------------------------------------------------------
+# Generated CMake target import file.
+#----------------------------------------------------------------
+
+# Commands may need to know the format version.
+set(CMAKE_IMPORT_FILE_VERSION 1)
+
+# Import target "expat::expat" for configuration ""
+set_property(TARGET expat::expat APPEND PROPERTY IMPORTED_CONFIGURATIONS NOCONFIG)
+set_target_properties(expat::expat PROPERTIES
+  IMPORTED_LOCATION_NOCONFIG "${_IMPORT_PREFIX}/@LIBDIR_BASENAME@/libexpat.so.@SO_MAJOR@.@SO_MINOR@.@SO_PATCH@"
+  IMPORTED_SONAME_NOCONFIG "libexpat.so.@SO_MAJOR@"
+  )
+
+list(APPEND _IMPORT_CHECK_TARGETS expat::expat )
+list(APPEND _IMPORT_CHECK_FILES_FOR_expat::expat "${_IMPORT_PREFIX}/@LIBDIR_BASENAME@/libexpat.so.@SO_MAJOR@.@SO_MINOR@.@SO_PATCH@" )
+
+# Commands beyond this point should not need to know the version.
+set(CMAKE_IMPORT_FILE_VERSION)

+ 19 - 0
libs/expat/cmake/autotools/expat-noconfig__macos.cmake.in

@@ -0,0 +1,19 @@
+#----------------------------------------------------------------
+# Generated CMake target import file.
+#----------------------------------------------------------------
+
+# Commands may need to know the format version.
+set(CMAKE_IMPORT_FILE_VERSION 1)
+
+# Import target "expat::expat" for configuration ""
+set_property(TARGET expat::expat APPEND PROPERTY IMPORTED_CONFIGURATIONS NOCONFIG)
+set_target_properties(expat::expat PROPERTIES
+  IMPORTED_LOCATION_NOCONFIG "${_IMPORT_PREFIX}/@LIBDIR_BASENAME@/libexpat.@SO_MAJOR@.@SO_MINOR@.@[email protected]"
+  IMPORTED_SONAME_NOCONFIG "@rpath/libexpat.@[email protected]"
+  )
+
+list(APPEND _IMPORT_CHECK_TARGETS expat::expat )
+list(APPEND _IMPORT_CHECK_FILES_FOR_expat::expat "${_IMPORT_PREFIX}/@LIBDIR_BASENAME@/libexpat.@SO_MAJOR@.@SO_MINOR@.@[email protected]" )
+
+# Commands beyond this point should not need to know the version.
+set(CMAKE_IMPORT_FILE_VERSION)

+ 19 - 0
libs/expat/cmake/autotools/expat-noconfig__windows.cmake.in

@@ -0,0 +1,19 @@
+#----------------------------------------------------------------
+# Generated CMake target import file.
+#----------------------------------------------------------------
+
+# Commands may need to know the format version.
+set(CMAKE_IMPORT_FILE_VERSION 1)
+
+# Import target "expat::expat" for configuration ""
+set_property(TARGET expat::expat APPEND PROPERTY IMPORTED_CONFIGURATIONS NOCONFIG)
+set_target_properties(expat::expat PROPERTIES
+  IMPORTED_IMPLIB_NOCONFIG "${_IMPORT_PREFIX}/@LIBDIR_BASENAME@/libexpat.dll.a"
+  IMPORTED_LOCATION_NOCONFIG "${_IMPORT_PREFIX}/bin/libexpat-@[email protected]"
+  )
+
+list(APPEND _IMPORT_CHECK_TARGETS expat::expat )
+list(APPEND _IMPORT_CHECK_FILES_FOR_expat::expat "${_IMPORT_PREFIX}/@LIBDIR_BASENAME@/libexpat.dll.a" "${_IMPORT_PREFIX}/bin/libexpat-@[email protected]" )
+
+# Commands beyond this point should not need to know the version.
+set(CMAKE_IMPORT_FILE_VERSION)

+ 25 - 0
libs/expat/cmake/autotools/expat-package-init.cmake

@@ -0,0 +1,25 @@
+
+####### Expanded from @PACKAGE_INIT@ by configure_package_config_file() #######
+####### Any changes to this file will be overwritten by the next CMake run ####
+####### The input file was expat-config.cmake.in                            ########
+
+get_filename_component(PACKAGE_PREFIX_DIR "${CMAKE_CURRENT_LIST_DIR}/../../../" ABSOLUTE)
+
+macro(set_and_check _var _file)
+  set(${_var} "${_file}")
+  if(NOT EXISTS "${_file}")
+    message(FATAL_ERROR "File or directory ${_file} referenced by variable ${_var} does not exist !")
+  endif()
+endmacro()
+
+macro(check_required_components _NAME)
+  foreach(comp ${${_NAME}_FIND_COMPONENTS})
+    if(NOT ${_NAME}_${comp}_FOUND)
+      if(${_NAME}_FIND_REQUIRED_${comp})
+        set(${_NAME}_FOUND FALSE)
+      endif()
+    endif()
+  endforeach()
+endmacro()
+
+####################################################################################

+ 94 - 0
libs/expat/cmake/autotools/expat.cmake

@@ -0,0 +1,94 @@
+# Generated by CMake
+
+if("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" LESS 2.5)
+   message(FATAL_ERROR "CMake >= 2.6.0 required")
+endif()
+cmake_policy(PUSH)
+cmake_policy(VERSION 2.6...3.18)
+#----------------------------------------------------------------
+# Generated CMake target import file.
+#----------------------------------------------------------------
+
+# Commands may need to know the format version.
+set(CMAKE_IMPORT_FILE_VERSION 1)
+
+# Protect against multiple inclusion, which would fail when already imported targets are added once more.
+set(_targetsDefined)
+set(_targetsNotDefined)
+set(_expectedTargets)
+foreach(_expectedTarget expat::expat)
+  list(APPEND _expectedTargets ${_expectedTarget})
+  if(NOT TARGET ${_expectedTarget})
+    list(APPEND _targetsNotDefined ${_expectedTarget})
+  endif()
+  if(TARGET ${_expectedTarget})
+    list(APPEND _targetsDefined ${_expectedTarget})
+  endif()
+endforeach()
+if("${_targetsDefined}" STREQUAL "${_expectedTargets}")
+  unset(_targetsDefined)
+  unset(_targetsNotDefined)
+  unset(_expectedTargets)
+  set(CMAKE_IMPORT_FILE_VERSION)
+  cmake_policy(POP)
+  return()
+endif()
+if(NOT "${_targetsDefined}" STREQUAL "")
+  message(FATAL_ERROR "Some (but not all) targets in this export set were already defined.\nTargets Defined: ${_targetsDefined}\nTargets not yet defined: ${_targetsNotDefined}\n")
+endif()
+unset(_targetsDefined)
+unset(_targetsNotDefined)
+unset(_expectedTargets)
+
+
+# Compute the installation prefix relative to this file.
+get_filename_component(_IMPORT_PREFIX "${CMAKE_CURRENT_LIST_FILE}" PATH)
+get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH)
+get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH)
+get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH)
+if(_IMPORT_PREFIX STREQUAL "/")
+  set(_IMPORT_PREFIX "")
+endif()
+
+# Create imported target expat::expat
+add_library(expat::expat SHARED IMPORTED)
+
+set_target_properties(expat::expat PROPERTIES
+  INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include"
+)
+
+# Load information for each installed configuration.
+get_filename_component(_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
+file(GLOB CONFIG_FILES "${_DIR}/expat-*.cmake")
+foreach(f ${CONFIG_FILES})
+  include(${f})
+endforeach()
+
+# Cleanup temporary variables.
+set(_IMPORT_PREFIX)
+
+# Loop over all imported files and verify that they actually exist
+foreach(target ${_IMPORT_CHECK_TARGETS} )
+  foreach(file ${_IMPORT_CHECK_FILES_FOR_${target}} )
+    if(NOT EXISTS "${file}" )
+      message(FATAL_ERROR "The imported target \"${target}\" references the file
+   \"${file}\"
+but this file does not exist.  Possible reasons include:
+* The file was deleted, renamed, or moved to another location.
+* An install or uninstall procedure did not complete successfully.
+* The installation package was faulty and contained
+   \"${CMAKE_CURRENT_LIST_FILE}\"
+but not all the files it references.
+")
+    endif()
+  endforeach()
+  unset(_IMPORT_CHECK_FILES_FOR_${target})
+endforeach()
+unset(_IMPORT_CHECK_TARGETS)
+
+# This file does not depend on other imported targets which have
+# been exported from the same project but in a separate export set.
+
+# Commands beyond this point should not need to know the version.
+set(CMAKE_IMPORT_FILE_VERSION)
+cmake_policy(POP)

File diff suppressed because it is too large
+ 350 - 230
libs/expat/configure


+ 140 - 28
libs/expat/configure.ac

@@ -1,21 +1,54 @@
 dnl   configuration script for expat
 dnl   configuration script for expat
 dnl   Process this file with autoconf to produce a configure script.
 dnl   Process this file with autoconf to produce a configure script.
+dnl                            __  __            _
+dnl                         ___\ \/ /_ __   __ _| |_
+dnl                        / _ \\  /| '_ \ / _` | __|
+dnl                       |  __//  \| |_) | (_| | |_
+dnl                        \___/_/\_\ .__/ \__,_|\__|
+dnl                                 |_| XML parser
 dnl
 dnl
-dnl   Copyright 2000 Clark Cooper
+dnl   Copyright (c) 2000      Clark Cooper <[email protected]>
+dnl   Copyright (c) 2000-2005 Fred L. Drake, Jr. <[email protected]>
+dnl   Copyright (c) 2001-2003 Greg Stein <[email protected]>
+dnl   Copyright (c) 2006-2012 Karl Waclawek <[email protected]>
+dnl   Copyright (c) 2016-2021 Sebastian Pipping <[email protected]>
+dnl   Copyright (c) 2017      S. P. Zeidler <[email protected]>
+dnl   Copyright (c) 2017      Stephen Groat <[email protected]>
+dnl   Copyright (c) 2017-2020 Joe Orton <[email protected]>
+dnl   Copyright (c) 2018      Yury Gribov <[email protected]>
+dnl   Copyright (c) 2018      Benjamin Peterson <[email protected]>
+dnl   Copyright (c) 2018      Marco Maggi <[email protected]>
+dnl   Copyright (c) 2018      KangLin <[email protected]>
+dnl   Copyright (c) 2019      Mohammed Khajapasha <[email protected]>
+dnl   Copyright (c) 2019      Kishore Kunche <[email protected]>
+dnl   Copyright (c) 2020      Jeffrey Walton <[email protected]>
+dnl   Licensed under the MIT license:
 dnl
 dnl
-dnl   This file is part of EXPAT.
+dnl   Permission is  hereby granted,  free of charge,  to any  person obtaining
+dnl   a  copy  of  this  software   and  associated  documentation  files  (the
+dnl   "Software"),  to  deal in  the  Software  without restriction,  including
+dnl   without  limitation the  rights  to use,  copy,  modify, merge,  publish,
+dnl   distribute, sublicense, and/or sell copies of the Software, and to permit
+dnl   persons  to whom  the Software  is  furnished to  do so,  subject to  the
+dnl   following conditions:
 dnl
 dnl
-dnl   EXPAT is free software; you can redistribute it and/or modify it
-dnl   under the terms of the License (based on the MIT/X license) contained
-dnl   in the file COPYING that comes with this distribution.
+dnl   The above copyright  notice and this permission notice  shall be included
+dnl   in all copies or substantial portions of the Software.
 dnl
 dnl
+dnl   THE  SOFTWARE  IS  PROVIDED  "AS  IS",  WITHOUT  WARRANTY  OF  ANY  KIND,
+dnl   EXPRESS  OR IMPLIED,  INCLUDING  BUT  NOT LIMITED  TO  THE WARRANTIES  OF
+dnl   MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
+dnl   NO EVENT SHALL THE AUTHORS OR  COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+dnl   DAMAGES OR  OTHER LIABILITY, WHETHER  IN AN  ACTION OF CONTRACT,  TORT OR
+dnl   OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+dnl   USE OR OTHER DEALINGS IN THE SOFTWARE.
 
 
 dnl Ensure that Expat is configured with autoconf 2.69 or newer.
 dnl Ensure that Expat is configured with autoconf 2.69 or newer.
-AC_PREREQ(2.69)
+AC_PREREQ([2.69])
 
 
 dnl Get the version number of Expat, using m4's esyscmd() command to run
 dnl Get the version number of Expat, using m4's esyscmd() command to run
 dnl the command at m4-generation time. This allows us to create an m4
 dnl the command at m4-generation time. This allows us to create an m4
-dnl symbol holding the correct version number. AC_INIT() requires the
+dnl symbol holding the correct version number. AC_INIT requires the
 dnl version number at m4-time, rather than when ./configure is run, so
 dnl version number at m4-time, rather than when ./configure is run, so
 dnl all this must happen as part of m4, not as part of the shell code
 dnl all this must happen as part of m4, not as part of the shell code
 dnl contained in ./configure.
 dnl contained in ./configure.
@@ -27,7 +60,7 @@ m4_define([expat_version],
   m4_ifdef([__gnu__],
   m4_ifdef([__gnu__],
            [esyscmd(conftools/get-version.sh lib/expat.h)],
            [esyscmd(conftools/get-version.sh lib/expat.h)],
            [2.2.x]))
            [2.2.x]))
-AC_INIT(expat, expat_version, [email protected])
+AC_INIT([expat], expat_version, [[email protected]])
 m4_undefine([expat_version])
 m4_undefine([expat_version])
 
 
 AC_CONFIG_SRCDIR([Makefile.in])
 AC_CONFIG_SRCDIR([Makefile.in])
@@ -48,12 +81,11 @@ dnl
 dnl If the API changes incompatibly set LIBAGE back to 0
 dnl If the API changes incompatibly set LIBAGE back to 0
 dnl
 dnl
 
 
-LIBCURRENT=7    # sync
-LIBREVISION=11  # with
-LIBAGE=6        # CMakeLists.txt!
+LIBCURRENT=9   # sync
+LIBREVISION=1  # with
+LIBAGE=8       # CMakeLists.txt!
 
 
-AX_APPEND_FLAG([-DHAVE_EXPAT_CONFIG_H], [CPPFLAGS])
-AC_CONFIG_HEADER([expat_config.h])
+AC_CONFIG_HEADERS([expat_config.h])
 
 
 AM_PROG_AR
 AM_PROG_AR
 AC_PROG_INSTALL
 AC_PROG_INSTALL
@@ -69,30 +101,32 @@ AC_SUBST(LIBAGE)
 
 
 AC_LANG([C])
 AC_LANG([C])
 AC_PROG_CC_C99
 AC_PROG_CC_C99
+
 AS_IF([test "$GCC" = yes],
 AS_IF([test "$GCC" = yes],
-  [AX_APPEND_COMPILE_FLAGS([-Wall -Wextra], [CFLAGS])
+  [AX_APPEND_COMPILE_FLAGS([-Wall -Wextra], [AM_CFLAGS])
    dnl Be careful about adding the -fexceptions option; some versions of
    dnl Be careful about adding the -fexceptions option; some versions of
    dnl GCC don't support it and it causes extra warnings that are only
    dnl GCC don't support it and it causes extra warnings that are only
    dnl distracting; avoid.
    dnl distracting; avoid.
-   AX_APPEND_COMPILE_FLAGS([-fexceptions], [CFLAGS])
-   AX_APPEND_COMPILE_FLAGS([-fno-strict-aliasing -Wmissing-prototypes -Wstrict-prototypes], [CFLAGS])
-   AX_APPEND_COMPILE_FLAGS([-pedantic -Wduplicated-cond -Wduplicated-branches -Wlogical-op], [CFLAGS])
-   AX_APPEND_COMPILE_FLAGS([-Wrestrict -Wnull-dereference -Wjump-misses-init -Wdouble-promotion], [CFLAGS])
-   AX_APPEND_COMPILE_FLAGS([-Wshadow -Wformat=2 -Wmisleading-indentation], [CFLAGS])])
+   AX_APPEND_COMPILE_FLAGS([-fexceptions], [AM_CFLAGS])
+   AX_APPEND_COMPILE_FLAGS([-fno-strict-aliasing -Wmissing-prototypes -Wstrict-prototypes], [AM_CFLAGS])
+   AX_APPEND_COMPILE_FLAGS([-pedantic -Wduplicated-cond -Wduplicated-branches -Wlogical-op], [AM_CFLAGS])
+   AX_APPEND_COMPILE_FLAGS([-Wrestrict -Wnull-dereference -Wjump-misses-init -Wdouble-promotion], [AM_CFLAGS])
+   AX_APPEND_COMPILE_FLAGS([-Wshadow -Wformat=2 -Wno-pedantic-ms-format -Wmisleading-indentation], [AM_CFLAGS])])
 
 
 AC_LANG_PUSH([C++])
 AC_LANG_PUSH([C++])
 AC_PROG_CXX
 AC_PROG_CXX
+
 AS_IF([test "$GCC" = yes],
 AS_IF([test "$GCC" = yes],
-  [AX_APPEND_COMPILE_FLAGS([-Wall -Wextra], [CXXFLAGS])
+  [AX_APPEND_COMPILE_FLAGS([-Wall -Wextra], [AM_CXXFLAGS])
    dnl Be careful about adding the -fexceptions option; some versions of
    dnl Be careful about adding the -fexceptions option; some versions of
    dnl GCC don't support it and it causes extra warnings that are only
    dnl GCC don't support it and it causes extra warnings that are only
    dnl distracting; avoid.
    dnl distracting; avoid.
-   AX_APPEND_COMPILE_FLAGS([-fexceptions], [CXXFLAGS])
-   AX_APPEND_COMPILE_FLAGS([-fno-strict-aliasing], [CXXFLAGS])])
+   AX_APPEND_COMPILE_FLAGS([-fexceptions], [AM_CXXFLAGS])
+   AX_APPEND_COMPILE_FLAGS([-fno-strict-aliasing], [AM_CXXFLAGS])])
 AC_LANG_POP([C++])
 AC_LANG_POP([C++])
 
 
 AS_IF([test "$GCC" = yes],
 AS_IF([test "$GCC" = yes],
-  [AX_APPEND_LINK_FLAGS([-fno-strict-aliasing],[LDFLAGS])])
+  [AX_APPEND_LINK_FLAGS([-fno-strict-aliasing],[AM_LDFLAGS])])
 
 
 dnl patching ${archive_cmds} to affect generation of file "libtool" to fix linking with clang (issue #312)
 dnl patching ${archive_cmds} to affect generation of file "libtool" to fix linking with clang (issue #312)
 AS_CASE(["$LD"],[*clang*],
 AS_CASE(["$LD"],[*clang*],
@@ -100,11 +134,8 @@ AS_CASE(["$LD"],[*clang*],
      [*linux*],[archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'])])
      [*linux*],[archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'])])
 
 
 EXPATCFG_COMPILER_SUPPORTS_VISIBILITY([
 EXPATCFG_COMPILER_SUPPORTS_VISIBILITY([
-  AX_APPEND_FLAG([-fvisibility=hidden],       [CFLAGS])
-  AX_APPEND_FLAG([-DXML_ENABLE_VISIBILITY=1], [CFLAGS])])
-
-dnl Checks for header files.
-AC_HEADER_STDC
+  AX_APPEND_FLAG([-fvisibility=hidden],       [AM_CFLAGS])
+  AX_APPEND_FLAG([-DXML_ENABLE_VISIBILITY=1], [AM_CPPFLAGS])])
 
 
 dnl Checks for typedefs, structures, and compiler characteristics.
 dnl Checks for typedefs, structures, and compiler characteristics.
 
 
@@ -149,7 +180,11 @@ AS_CASE("${host_os}",
    AC_MSG_NOTICE([detected OS: MinGW])])
    AC_MSG_NOTICE([detected OS: MinGW])])
 AM_CONDITIONAL([MINGW], [test x${EXPATCFG_ON_MINGW} = xyes])
 AM_CONDITIONAL([MINGW], [test x${EXPATCFG_ON_MINGW} = xyes])
 
 
+dnl Note: Prefix "_INTERNAL_" here means exclusive use inside of file configure.ac
 AM_CONDITIONAL([UNICODE], [echo -- "${CPPFLAGS}${CFLAGS}" | ${FGREP} XML_UNICODE >/dev/null])
 AM_CONDITIONAL([UNICODE], [echo -- "${CPPFLAGS}${CFLAGS}" | ${FGREP} XML_UNICODE >/dev/null])
+AM_CONDITIONAL([_INTERNAL_UNICODE_WCHAR_T], [echo -- "${CPPFLAGS}${CFLAGS}" | ${FGREP} XML_UNICODE_WCHAR_T >/dev/null])
+AM_CONDITIONAL([_INTERNAL_MIN_SIZE], [echo -- "${CPPFLAGS}${CFLAGS}" | ${FGREP} XML_MIN_SIZE >/dev/null])
+AM_CONDITIONAL([_INTERNAL_LARGE_SIZE], [echo -- "${CPPFLAGS}${CFLAGS}" | ${FGREP} XML_LARGE_SIZE >/dev/null])
 
 
 
 
 AC_ARG_WITH([libbsd],
 AC_ARG_WITH([libbsd],
@@ -307,8 +342,70 @@ AS_IF([test "x${DOCBOOK_TO_MAN}" != x -a "x$with_docbook" != xno],
 
 
 AM_CONDITIONAL(WITH_DOCBOOK, [test "x${DOCBOOK_TO_MAN}" != x])
 AM_CONDITIONAL(WITH_DOCBOOK, [test "x${DOCBOOK_TO_MAN}" != x])
 
 
+
+dnl Configure CMake file templates
+dnl NOTE: The *_TRUE variables read here are Automake conditionals
+dnl       that are either set to "" when enabled or to "#" when disabled
+dnl       (because they are used to dynamically comment out certain things)
+AS_IF([test "x${enable_xml_attr_info}" = xyes],
+  [EXPAT_ATTR_INFO=ON],
+  [EXPAT_ATTR_INFO=OFF])
+EXPAT_DTD=ON
+AS_IF([test "x${_INTERNAL_LARGE_SIZE_TRUE}" = x],
+  [EXPAT_LARGE_SIZE=ON],
+  [EXPAT_LARGE_SIZE=OFF])
+AS_IF([test "x${_INTERNAL_MIN_SIZE_TRUE}" = x],
+  [EXPAT_MIN_SIZE=ON],
+  [EXPAT_MIN_SIZE=OFF])
+EXPAT_NS=ON
+AS_IF([test "x${enable_xml_context}" != xno],
+  [EXPAT_CONTEXT_BYTES=${enable_xml_context}],
+  [EXPAT_CONTEXT_BYTES=OFF])
+AS_IF([test "x${UNICODE_TRUE}" = x],
+  [AS_IF(
+     [test "x${_INTERNAL_UNICODE_WCHAR_T_TRUE}" = x],
+        [EXPAT_CHAR_TYPE=wchar_t],
+        [EXPAT_CHAR_TYPE=ushort])],
+  [EXPAT_CHAR_TYPE=char])
+PACKAGE_INIT="${srcdir}"/cmake/autotools/expat-package-init.cmake
+LIBDIR_BASENAME="$(basename "${libdir}")"
+SO_MAJOR="$(expr "${LIBCURRENT}" - "${LIBAGE}")"
+SO_MINOR="${LIBAGE}"
+SO_PATCH="${LIBREVISION}"
+AC_CHECK_SIZEOF([void *])  # sets ac_cv_sizeof_void_p
+AC_SUBST([EXPAT_ATTR_INFO])
+AC_SUBST([EXPAT_DTD])
+AC_SUBST([EXPAT_LARGE_SIZE])
+AC_SUBST([EXPAT_MIN_SIZE])
+AC_SUBST([EXPAT_NS])
+AC_SUBST([EXPAT_CONTEXT_BYTES])
+AC_SUBST([EXPAT_CHAR_TYPE])
+AC_SUBST_FILE([PACKAGE_INIT])
+AC_SUBST([LIBDIR_BASENAME])
+AC_SUBST([SO_MAJOR])
+AC_SUBST([SO_MINOR])
+AC_SUBST([SO_PATCH])
+AC_SUBST([ac_cv_sizeof_void_p])
+
+
+dnl write the Automake flags we set
+AC_SUBST([AM_CPPFLAGS])
+AC_SUBST([AM_CFLAGS])
+AC_SUBST([AM_CXXFLAGS])
+AC_SUBST([AM_LDFLAGS])
+
+dnl updating _EXPAT_OUTPUT_NAME variable to effect the package name in expat.pc file (issue #361)
+AC_SUBST(_EXPAT_OUTPUT_NAME, ["$PACKAGE_NAME"])
+
+AS_CASE("${host_os}",
+  [darwin*], [CMAKE_NOCONFIG_SOURCE=cmake/autotools/expat-noconfig__macos.cmake.in],
+  [mingw*], [CMAKE_NOCONFIG_SOURCE=cmake/autotools/expat-noconfig__windows.cmake.in],
+  [CMAKE_NOCONFIG_SOURCE=cmake/autotools/expat-noconfig__linux.cmake.in])
 AC_CONFIG_FILES([Makefile]
 AC_CONFIG_FILES([Makefile]
   [expat.pc]
   [expat.pc]
+  [cmake/expat-config.cmake]
+  [cmake/autotools/expat-config-version.cmake]
+  [cmake/autotools/expat-noconfig.cmake:${CMAKE_NOCONFIG_SOURCE}]
   [doc/Makefile]
   [doc/Makefile]
   [examples/Makefile]
   [examples/Makefile]
   [lib/Makefile]
   [lib/Makefile]
@@ -317,3 +414,18 @@ AC_CONFIG_FILES([Makefile]
   [xmlwf/Makefile])
   [xmlwf/Makefile])
 AC_CONFIG_FILES([run.sh], [chmod +x run.sh])
 AC_CONFIG_FILES([run.sh], [chmod +x run.sh])
 AC_OUTPUT
 AC_OUTPUT
+
+
+AC_MSG_NOTICE([
+
+Automake flags (can be overridden by user flags):
+  [AM_CPPFLAGS]: ${AM_CPPFLAGS}
+    [AM_CFLAGS]: ${AM_CFLAGS}
+  [AM_CXXFLAGS]: ${AM_CXXFLAGS}
+   [AM_LDFLAGS]: ${AM_LDFLAGS}
+
+User flags (override Automake flags on conflict):
+     CPPFLAGS: ${CPPFLAGS}
+       CFLAGS: ${CFLAGS}
+     CXXFLAGS: ${CXXFLAGS}
+      LDFLAGS: ${LDFLAGS}])

+ 10 - 9
libs/expat/conftools/ar-lib

@@ -2,9 +2,9 @@
 # Wrapper for Microsoft lib.exe
 # Wrapper for Microsoft lib.exe
 
 
 me=ar-lib
 me=ar-lib
-scriptversion=2012-03-01.08; # UTC
+scriptversion=2019-07-04.01; # UTC
 
 
-# Copyright (C) 2010-2017 Free Software Foundation, Inc.
+# Copyright (C) 2010-2020 Free Software Foundation, Inc.
 # Written by Peter Rosin <[email protected]>.
 # Written by Peter Rosin <[email protected]>.
 #
 #
 # This program is free software; you can redistribute it and/or modify
 # This program is free software; you can redistribute it and/or modify
@@ -18,7 +18,7 @@ scriptversion=2012-03-01.08; # UTC
 # GNU General Public License for more details.
 # GNU General Public License for more details.
 #
 #
 # You should have received a copy of the GNU General Public License
 # You should have received a copy of the GNU General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+# along with this program.  If not, see <https://www.gnu.org/licenses/>.
 
 
 # As a special exception to the GNU General Public License, if you
 # As a special exception to the GNU General Public License, if you
 # distribute this file as part of a program that contains a
 # distribute this file as part of a program that contains a
@@ -53,7 +53,7 @@ func_file_conv ()
 	  MINGW*)
 	  MINGW*)
 	    file_conv=mingw
 	    file_conv=mingw
 	    ;;
 	    ;;
-	  CYGWIN*)
+	  CYGWIN* | MSYS*)
 	    file_conv=cygwin
 	    file_conv=cygwin
 	    ;;
 	    ;;
 	  *)
 	  *)
@@ -65,7 +65,7 @@ func_file_conv ()
 	mingw)
 	mingw)
 	  file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'`
 	  file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'`
 	  ;;
 	  ;;
-	cygwin)
+	cygwin | msys)
 	  file=`cygpath -m "$file" || echo "$file"`
 	  file=`cygpath -m "$file" || echo "$file"`
 	  ;;
 	  ;;
 	wine)
 	wine)
@@ -224,10 +224,11 @@ elif test -n "$extract"; then
       esac
       esac
     done
     done
   else
   else
-    $AR -NOLOGO -LIST "$archive" | sed -e 's/\\/\\\\/g' | while read member
-    do
-      $AR -NOLOGO -EXTRACT:"$member" "$archive" || exit $?
-    done
+    $AR -NOLOGO -LIST "$archive" | tr -d '\r' | sed -e 's/\\/\\\\/g' \
+      | while read member
+        do
+          $AR -NOLOGO -EXTRACT:"$member" "$archive" || exit $?
+        done
   fi
   fi
 
 
 elif test -n "$quick$replace"; then
 elif test -n "$quick$replace"; then

+ 8 - 5
libs/expat/conftools/ax-check-compile-flag.m4

@@ -8,8 +8,8 @@
 #
 #
 # DESCRIPTION
 # DESCRIPTION
 #
 #
-#   Check whether the given FLAG works with the current language's compiler
-#   or gives an error.  (Warnings, however, are ignored)
+#   Check whether the given FLAG plus -Werror works with the current
+#   language's compiler — C or C++ — or gives an error.
 #
 #
 #   ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on
 #   ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on
 #   success/failure.
 #   success/failure.
@@ -28,6 +28,7 @@
 #
 #
 #   Copyright (c) 2008 Guido U. Draheim <[email protected]>
 #   Copyright (c) 2008 Guido U. Draheim <[email protected]>
 #   Copyright (c) 2011 Maarten Bosmans <[email protected]>
 #   Copyright (c) 2011 Maarten Bosmans <[email protected]>
+#   Copyright (c) 2020 Sebastian Pipping <[email protected]>
 #
 #
 #   This program is free software: you can redistribute it and/or modify it
 #   This program is free software: you can redistribute it and/or modify it
 #   under the terms of the GNU General Public License as published by the
 #   under the terms of the GNU General Public License as published by the
@@ -55,15 +56,17 @@
 #   modified version of the Autoconf Macro, you may extend this special
 #   modified version of the Autoconf Macro, you may extend this special
 #   exception to the GPL to apply to your modified version as well.
 #   exception to the GPL to apply to your modified version as well.
 
 
-#serial 4
+#serial 6
 
 
 AC_DEFUN([AX_CHECK_COMPILE_FLAG],
 AC_DEFUN([AX_CHECK_COMPILE_FLAG],
 [AC_PREREQ(2.64)dnl for _AC_LANG_PREFIX and AS_VAR_IF
 [AC_PREREQ(2.64)dnl for _AC_LANG_PREFIX and AS_VAR_IF
 AS_VAR_PUSHDEF([CACHEVAR],[ax_cv_check_[]_AC_LANG_ABBREV[]flags_$4_$1])dnl
 AS_VAR_PUSHDEF([CACHEVAR],[ax_cv_check_[]_AC_LANG_ABBREV[]flags_$4_$1])dnl
 AC_CACHE_CHECK([whether _AC_LANG compiler accepts $1], CACHEVAR, [
 AC_CACHE_CHECK([whether _AC_LANG compiler accepts $1], CACHEVAR, [
   ax_check_save_flags=$[]_AC_LANG_PREFIX[]FLAGS
   ax_check_save_flags=$[]_AC_LANG_PREFIX[]FLAGS
-  _AC_LANG_PREFIX[]FLAGS="$[]_AC_LANG_PREFIX[]FLAGS $4 $1"
-  AC_COMPILE_IFELSE([m4_default([$5],[AC_LANG_PROGRAM()])],
+  _AC_LANG_PREFIX[]FLAGS="$[]_AC_LANG_PREFIX[]FLAGS $4 -Werror $1"
+  AC_COMPILE_IFELSE([m4_default([$5],
+                                [AC_LANG_SOURCE(
+                                   [[int main(void) { return 0; }]])])],
     [AS_VAR_SET(CACHEVAR,[yes])],
     [AS_VAR_SET(CACHEVAR,[yes])],
     [AS_VAR_SET(CACHEVAR,[no])])
     [AS_VAR_SET(CACHEVAR,[no])])
   _AC_LANG_PREFIX[]FLAGS=$ax_check_save_flags])
   _AC_LANG_PREFIX[]FLAGS=$ax_check_save_flags])

+ 6 - 6
libs/expat/conftools/compile

@@ -1,9 +1,9 @@
 #! /bin/sh
 #! /bin/sh
 # Wrapper for compilers which do not understand '-c -o'.
 # Wrapper for compilers which do not understand '-c -o'.
 
 
-scriptversion=2016-01-11.22; # UTC
+scriptversion=2018-03-07.03; # UTC
 
 
-# Copyright (C) 1999-2017 Free Software Foundation, Inc.
+# Copyright (C) 1999-2020 Free Software Foundation, Inc.
 # Written by Tom Tromey <[email protected]>.
 # Written by Tom Tromey <[email protected]>.
 #
 #
 # This program is free software; you can redistribute it and/or modify
 # This program is free software; you can redistribute it and/or modify
@@ -17,7 +17,7 @@ scriptversion=2016-01-11.22; # UTC
 # GNU General Public License for more details.
 # GNU General Public License for more details.
 #
 #
 # You should have received a copy of the GNU General Public License
 # You should have received a copy of the GNU General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+# along with this program.  If not, see <https://www.gnu.org/licenses/>.
 
 
 # As a special exception to the GNU General Public License, if you
 # As a special exception to the GNU General Public License, if you
 # distribute this file as part of a program that contains a
 # distribute this file as part of a program that contains a
@@ -53,7 +53,7 @@ func_file_conv ()
 	  MINGW*)
 	  MINGW*)
 	    file_conv=mingw
 	    file_conv=mingw
 	    ;;
 	    ;;
-	  CYGWIN*)
+	  CYGWIN* | MSYS*)
 	    file_conv=cygwin
 	    file_conv=cygwin
 	    ;;
 	    ;;
 	  *)
 	  *)
@@ -67,7 +67,7 @@ func_file_conv ()
 	mingw/*)
 	mingw/*)
 	  file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'`
 	  file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'`
 	  ;;
 	  ;;
-	cygwin/*)
+	cygwin/* | msys/*)
 	  file=`cygpath -m "$file" || echo "$file"`
 	  file=`cygpath -m "$file" || echo "$file"`
 	  ;;
 	  ;;
 	wine/*)
 	wine/*)
@@ -340,7 +340,7 @@ exit $ret
 # Local Variables:
 # Local Variables:
 # mode: shell-script
 # mode: shell-script
 # sh-indentation: 2
 # sh-indentation: 2
-# eval: (add-hook 'write-file-hooks 'time-stamp)
+# eval: (add-hook 'before-save-hook 'time-stamp)
 # time-stamp-start: "scriptversion="
 # time-stamp-start: "scriptversion="
 # time-stamp-format: "%:y-%02m-%02d.%02H"
 # time-stamp-format: "%:y-%02m-%02d.%02H"
 # time-stamp-time-zone: "UTC0"
 # time-stamp-time-zone: "UTC0"

File diff suppressed because it is too large
+ 326 - 257
libs/expat/conftools/config.guess


File diff suppressed because it is too large
+ 993 - 1072
libs/expat/conftools/config.sub


+ 4 - 4
libs/expat/conftools/depcomp

@@ -1,9 +1,9 @@
 #! /bin/sh
 #! /bin/sh
 # depcomp - compile a program generating dependencies as side-effects
 # depcomp - compile a program generating dependencies as side-effects
 
 
-scriptversion=2016-01-11.22; # UTC
+scriptversion=2018-03-07.03; # UTC
 
 
-# Copyright (C) 1999-2017 Free Software Foundation, Inc.
+# Copyright (C) 1999-2020 Free Software Foundation, Inc.
 
 
 # This program is free software; you can redistribute it and/or modify
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
 # it under the terms of the GNU General Public License as published by
@@ -16,7 +16,7 @@ scriptversion=2016-01-11.22; # UTC
 # GNU General Public License for more details.
 # GNU General Public License for more details.
 
 
 # You should have received a copy of the GNU General Public License
 # You should have received a copy of the GNU General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+# along with this program.  If not, see <https://www.gnu.org/licenses/>.
 
 
 # As a special exception to the GNU General Public License, if you
 # As a special exception to the GNU General Public License, if you
 # distribute this file as part of a program that contains a
 # distribute this file as part of a program that contains a
@@ -783,7 +783,7 @@ exit 0
 # Local Variables:
 # Local Variables:
 # mode: shell-script
 # mode: shell-script
 # sh-indentation: 2
 # sh-indentation: 2
-# eval: (add-hook 'write-file-hooks 'time-stamp)
+# eval: (add-hook 'before-save-hook 'time-stamp)
 # time-stamp-start: "scriptversion="
 # time-stamp-start: "scriptversion="
 # time-stamp-format: "%:y-%02m-%02d.%02H"
 # time-stamp-format: "%:y-%02m-%02d.%02H"
 # time-stamp-time-zone: "UTC0"
 # time-stamp-time-zone: "UTC0"

+ 28 - 2
libs/expat/conftools/get-version.sh

@@ -1,13 +1,39 @@
 #!/bin/sh
 #!/bin/sh
-#
 # USAGE: get-version.sh path/to/expat.h
 # USAGE: get-version.sh path/to/expat.h
 #
 #
 # This script will print Expat's version number on stdout. For example:
 # This script will print Expat's version number on stdout. For example:
 #
 #
 #   $ ./conftools/get-version.sh ./lib/expat.h
 #   $ ./conftools/get-version.sh ./lib/expat.h
 #   1.95.3
 #   1.95.3
-#   $
+#                          __  __            _
+#                       ___\ \/ /_ __   __ _| |_
+#                      / _ \\  /| '_ \ / _` | __|
+#                     |  __//  \| |_) | (_| | |_
+#                      \___/_/\_\ .__/ \__,_|\__|
+#                               |_| XML parser
+#
+# Copyright (c) 2002 Greg Stein <[email protected]>
+# Copyright (c) 2017 Kerin Millar <[email protected]>
+# Licensed under the MIT license:
+#
+# Permission is  hereby granted,  free of charge,  to any  person obtaining
+# a  copy  of  this  software   and  associated  documentation  files  (the
+# "Software"),  to  deal in  the  Software  without restriction,  including
+# without  limitation the  rights  to use,  copy,  modify, merge,  publish,
+# distribute, sublicense, and/or sell copies of the Software, and to permit
+# persons  to whom  the Software  is  furnished to  do so,  subject to  the
+# following conditions:
+#
+# The above copyright  notice and this permission notice  shall be included
+# in all copies or substantial portions of the Software.
 #
 #
+# THE  SOFTWARE  IS  PROVIDED  "AS  IS",  WITHOUT  WARRANTY  OF  ANY  KIND,
+# EXPRESS  OR IMPLIED,  INCLUDING  BUT  NOT LIMITED  TO  THE WARRANTIES  OF
+# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
+# NO EVENT SHALL THE AUTHORS OR  COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+# DAMAGES OR  OTHER LIABILITY, WHETHER  IN AN  ACTION OF CONTRACT,  TORT OR
+# OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+# USE OR OTHER DEALINGS IN THE SOFTWARE.
 
 
 if test $# = 0; then
 if test $# = 0; then
   echo "ERROR: pathname for expat.h was not provided."
   echo "ERROR: pathname for expat.h was not provided."

+ 92 - 69
libs/expat/conftools/install-sh

@@ -1,7 +1,7 @@
 #!/bin/sh
 #!/bin/sh
 # install - install a program, script, or datafile
 # install - install a program, script, or datafile
 
 
-scriptversion=2018-03-11.20; # UTC
+scriptversion=2020-11-14.01; # UTC
 
 
 # This originates from X11R5 (mit/util/scripts/install.sh), which was
 # This originates from X11R5 (mit/util/scripts/install.sh), which was
 # later released in X11R6 (xc/config/util/install.sh) with the
 # later released in X11R6 (xc/config/util/install.sh) with the
@@ -69,6 +69,11 @@ posix_mkdir=
 # Desired mode of installed file.
 # Desired mode of installed file.
 mode=0755
 mode=0755
 
 
+# Create dirs (including intermediate dirs) using mode 755.
+# This is like GNU 'install' as of coreutils 8.32 (2020).
+mkdir_umask=22
+
+backupsuffix=
 chgrpcmd=
 chgrpcmd=
 chmodcmd=$chmodprog
 chmodcmd=$chmodprog
 chowncmd=
 chowncmd=
@@ -99,18 +104,28 @@ Options:
      --version  display version info and exit.
      --version  display version info and exit.
 
 
   -c            (ignored)
   -c            (ignored)
-  -C            install only if different (preserve the last data modification time)
+  -C            install only if different (preserve data modification time)
   -d            create directories instead of installing files.
   -d            create directories instead of installing files.
   -g GROUP      $chgrpprog installed files to GROUP.
   -g GROUP      $chgrpprog installed files to GROUP.
   -m MODE       $chmodprog installed files to MODE.
   -m MODE       $chmodprog installed files to MODE.
   -o USER       $chownprog installed files to USER.
   -o USER       $chownprog installed files to USER.
+  -p            pass -p to $cpprog.
   -s            $stripprog installed files.
   -s            $stripprog installed files.
+  -S SUFFIX     attempt to back up existing files, with suffix SUFFIX.
   -t DIRECTORY  install into DIRECTORY.
   -t DIRECTORY  install into DIRECTORY.
   -T            report an error if DSTFILE is a directory.
   -T            report an error if DSTFILE is a directory.
 
 
 Environment variables override the default commands:
 Environment variables override the default commands:
   CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
   CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
   RMPROG STRIPPROG
   RMPROG STRIPPROG
+
+By default, rm is invoked with -f; when overridden with RMPROG,
+it's up to you to specify -f if you want it.
+
+If -S is not specified, no backups are attempted.
+
+Email bug reports to [email protected].
+Automake home page: https://www.gnu.org/software/automake/
 "
 "
 
 
 while test $# -ne 0; do
 while test $# -ne 0; do
@@ -137,8 +152,13 @@ while test $# -ne 0; do
     -o) chowncmd="$chownprog $2"
     -o) chowncmd="$chownprog $2"
         shift;;
         shift;;
 
 
+    -p) cpprog="$cpprog -p";;
+
     -s) stripcmd=$stripprog;;
     -s) stripcmd=$stripprog;;
 
 
+    -S) backupsuffix="$2"
+        shift;;
+
     -t)
     -t)
         is_target_a_directory=always
         is_target_a_directory=always
         dst_arg=$2
         dst_arg=$2
@@ -255,6 +275,10 @@ do
     dstdir=$dst
     dstdir=$dst
     test -d "$dstdir"
     test -d "$dstdir"
     dstdir_status=$?
     dstdir_status=$?
+    # Don't chown directories that already exist.
+    if test $dstdir_status = 0; then
+      chowncmd=""
+    fi
   else
   else
 
 
     # Waiting for this to be detected by the "$cpprog $src $dsttmp" command
     # Waiting for this to be detected by the "$cpprog $src $dsttmp" command
@@ -301,22 +325,6 @@ do
   if test $dstdir_status != 0; then
   if test $dstdir_status != 0; then
     case $posix_mkdir in
     case $posix_mkdir in
       '')
       '')
-        # Create intermediate dirs using mode 755 as modified by the umask.
-        # This is like FreeBSD 'install' as of 1997-10-28.
-        umask=`umask`
-        case $stripcmd.$umask in
-          # Optimize common cases.
-          *[2367][2367]) mkdir_umask=$umask;;
-          .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
-
-          *[0-7])
-            mkdir_umask=`expr $umask + 22 \
-              - $umask % 100 % 40 + $umask % 20 \
-              - $umask % 10 % 4 + $umask % 2
-            `;;
-          *) mkdir_umask=$umask,go-w;;
-        esac
-
         # With -d, create the new directory with the user-specified mode.
         # With -d, create the new directory with the user-specified mode.
         # Otherwise, rely on $mkdir_umask.
         # Otherwise, rely on $mkdir_umask.
         if test -n "$dir_arg"; then
         if test -n "$dir_arg"; then
@@ -326,52 +334,49 @@ do
         fi
         fi
 
 
         posix_mkdir=false
         posix_mkdir=false
-        case $umask in
-          *[123567][0-7][0-7])
-            # POSIX mkdir -p sets u+wx bits regardless of umask, which
-            # is incompatible with FreeBSD 'install' when (umask & 300) != 0.
-            ;;
-          *)
-            # Note that $RANDOM variable is not portable (e.g. dash);  Use it
-            # here however when possible just to lower collision chance.
-            tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
-
-            trap 'ret=$?; rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null; exit $ret' 0
-
-            # Because "mkdir -p" follows existing symlinks and we likely work
-            # directly in world-writeable /tmp, make sure that the '$tmpdir'
-            # directory is successfully created first before we actually test
-            # 'mkdir -p' feature.
-            if (umask $mkdir_umask &&
-                $mkdirprog $mkdir_mode "$tmpdir" &&
-                exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1
-            then
-              if test -z "$dir_arg" || {
-                   # Check for POSIX incompatibilities with -m.
-                   # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
-                   # other-writable bit of parent directory when it shouldn't.
-                   # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
-                   test_tmpdir="$tmpdir/a"
-                   ls_ld_tmpdir=`ls -ld "$test_tmpdir"`
-                   case $ls_ld_tmpdir in
-                     d????-?r-*) different_mode=700;;
-                     d????-?--*) different_mode=755;;
-                     *) false;;
-                   esac &&
-                   $mkdirprog -m$different_mode -p -- "$test_tmpdir" && {
-                     ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"`
-                     test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
-                   }
-                 }
-              then posix_mkdir=:
-              fi
-              rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir"
-            else
-              # Remove any dirs left behind by ancient mkdir implementations.
-              rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null
-            fi
-            trap '' 0;;
-        esac;;
+	# The $RANDOM variable is not portable (e.g., dash).  Use it
+	# here however when possible just to lower collision chance.
+	tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
+
+	trap '
+	  ret=$?
+	  rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null
+	  exit $ret
+	' 0
+
+	# Because "mkdir -p" follows existing symlinks and we likely work
+	# directly in world-writeable /tmp, make sure that the '$tmpdir'
+	# directory is successfully created first before we actually test
+	# 'mkdir -p'.
+	if (umask $mkdir_umask &&
+	    $mkdirprog $mkdir_mode "$tmpdir" &&
+	    exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1
+	then
+	  if test -z "$dir_arg" || {
+	       # Check for POSIX incompatibilities with -m.
+	       # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
+	       # other-writable bit of parent directory when it shouldn't.
+	       # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
+	       test_tmpdir="$tmpdir/a"
+	       ls_ld_tmpdir=`ls -ld "$test_tmpdir"`
+	       case $ls_ld_tmpdir in
+		 d????-?r-*) different_mode=700;;
+		 d????-?--*) different_mode=755;;
+		 *) false;;
+	       esac &&
+	       $mkdirprog -m$different_mode -p -- "$test_tmpdir" && {
+		 ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"`
+		 test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
+	       }
+	     }
+	  then posix_mkdir=:
+	  fi
+	  rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir"
+	else
+	  # Remove any dirs left behind by ancient mkdir implementations.
+	  rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null
+	fi
+	trap '' 0;;
     esac
     esac
 
 
     if
     if
@@ -382,7 +387,7 @@ do
     then :
     then :
     else
     else
 
 
-      # The umask is ridiculous, or mkdir does not conform to POSIX,
+      # mkdir does not conform to POSIX,
       # or it failed possibly due to a race condition.  Create the
       # or it failed possibly due to a race condition.  Create the
       # directory the slow way, step by step, checking for races as we go.
       # directory the slow way, step by step, checking for races as we go.
 
 
@@ -411,7 +416,7 @@ do
           prefixes=
           prefixes=
         else
         else
           if $posix_mkdir; then
           if $posix_mkdir; then
-            (umask=$mkdir_umask &&
+            (umask $mkdir_umask &&
              $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
              $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
             # Don't fail if two instances are running concurrently.
             # Don't fail if two instances are running concurrently.
             test -d "$prefix" || exit 1
             test -d "$prefix" || exit 1
@@ -451,7 +456,18 @@ do
     trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
     trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
 
 
     # Copy the file name to the temp name.
     # Copy the file name to the temp name.
-    (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&
+    (umask $cp_umask &&
+     { test -z "$stripcmd" || {
+	 # Create $dsttmp read-write so that cp doesn't create it read-only,
+	 # which would cause strip to fail.
+	 if test -z "$doit"; then
+	   : >"$dsttmp" # No need to fork-exec 'touch'.
+	 else
+	   $doit touch "$dsttmp"
+	 fi
+       }
+     } &&
+     $doit_exec $cpprog "$src" "$dsttmp") &&
 
 
     # and set any options; do chmod last to preserve setuid bits.
     # and set any options; do chmod last to preserve setuid bits.
     #
     #
@@ -477,6 +493,13 @@ do
     then
     then
       rm -f "$dsttmp"
       rm -f "$dsttmp"
     else
     else
+      # If $backupsuffix is set, and the file being installed
+      # already exists, attempt a backup.  Don't worry if it fails,
+      # e.g., if mv doesn't support -f.
+      if test -n "$backupsuffix" && test -f "$dst"; then
+        $doit $mvcmd -f "$dst" "$dst$backupsuffix" 2>/dev/null
+      fi
+
       # Rename the file to the real destination.
       # Rename the file to the real destination.
       $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
       $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
 
 
@@ -491,9 +514,9 @@ do
         # file should still install successfully.
         # file should still install successfully.
         {
         {
           test ! -f "$dst" ||
           test ! -f "$dst" ||
-          $doit $rmcmd -f "$dst" 2>/dev/null ||
+          $doit $rmcmd "$dst" 2>/dev/null ||
           { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
           { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
-            { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
+            { $doit $rmcmd "$rmtmp" 2>/dev/null; :; }
           } ||
           } ||
           { echo "$0: cannot unlink or rename $dst" >&2
           { echo "$0: cannot unlink or rename $dst" >&2
             (exit 1); exit 1
             (exit 1); exit 1

+ 1 - 1
libs/expat/conftools/missing

@@ -3,7 +3,7 @@
 
 
 scriptversion=2018-03-07.03; # UTC
 scriptversion=2018-03-07.03; # UTC
 
 
-# Copyright (C) 1996-2018 Free Software Foundation, Inc.
+# Copyright (C) 1996-2020 Free Software Foundation, Inc.
 # Originally written by Fran,cois Pinard <[email protected]>, 1996.
 # Originally written by Fran,cois Pinard <[email protected]>, 1996.
 
 
 # This program is free software; you can redistribute it and/or modify
 # This program is free software; you can redistribute it and/or modify

+ 9 - 7
libs/expat/conftools/test-driver

@@ -1,9 +1,9 @@
 #! /bin/sh
 #! /bin/sh
 # test-driver - basic testsuite driver script.
 # test-driver - basic testsuite driver script.
 
 
-scriptversion=2016-01-11.22; # UTC
+scriptversion=2018-03-07.03; # UTC
 
 
-# Copyright (C) 2011-2017 Free Software Foundation, Inc.
+# Copyright (C) 2011-2020 Free Software Foundation, Inc.
 #
 #
 # This program is free software; you can redistribute it and/or modify
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
 # it under the terms of the GNU General Public License as published by
@@ -16,7 +16,7 @@ scriptversion=2016-01-11.22; # UTC
 # GNU General Public License for more details.
 # GNU General Public License for more details.
 #
 #
 # You should have received a copy of the GNU General Public License
 # You should have received a copy of the GNU General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+# along with this program.  If not, see <https://www.gnu.org/licenses/>.
 
 
 # As a special exception to the GNU General Public License, if you
 # As a special exception to the GNU General Public License, if you
 # distribute this file as part of a program that contains a
 # distribute this file as part of a program that contains a
@@ -42,11 +42,13 @@ print_usage ()
 {
 {
   cat <<END
   cat <<END
 Usage:
 Usage:
-  test-driver --test-name=NAME --log-file=PATH --trs-file=PATH
-              [--expect-failure={yes|no}] [--color-tests={yes|no}]
-              [--enable-hard-errors={yes|no}] [--]
+  test-driver --test-name NAME --log-file PATH --trs-file PATH
+              [--expect-failure {yes|no}] [--color-tests {yes|no}]
+              [--enable-hard-errors {yes|no}] [--]
               TEST-SCRIPT [TEST-SCRIPT-ARGUMENTS]
               TEST-SCRIPT [TEST-SCRIPT-ARGUMENTS]
+
 The '--test-name', '--log-file' and '--trs-file' options are mandatory.
 The '--test-name', '--log-file' and '--trs-file' options are mandatory.
+See the GNU Automake documentation for information.
 END
 END
 }
 }
 
 
@@ -140,7 +142,7 @@ echo ":copy-in-global-log: $gcopy" >> $trs_file
 # Local Variables:
 # Local Variables:
 # mode: shell-script
 # mode: shell-script
 # sh-indentation: 2
 # sh-indentation: 2
-# eval: (add-hook 'write-file-hooks 'time-stamp)
+# eval: (add-hook 'before-save-hook 'time-stamp)
 # time-stamp-start: "scriptversion="
 # time-stamp-start: "scriptversion="
 # time-stamp-format: "%:y-%02m-%02d.%02H"
 # time-stamp-format: "%:y-%02m-%02d.%02H"
 # time-stamp-time-zone: "UTC0"
 # time-stamp-time-zone: "UTC0"

+ 4 - 2
libs/expat/doc/Makefile.am

@@ -6,7 +6,9 @@
 #                      \___/_/\_\ .__/ \__,_|\__|
 #                      \___/_/\_\ .__/ \__,_|\__|
 #                               |_| XML parser
 #                               |_| XML parser
 #
 #
-# Copyright (c) 2017 Expat development team
+# Copyright (c) 2017-2021 Sebastian Pipping <[email protected]>
+# Copyright (c) 2017      Stephen Groat <[email protected]>
+# Copyright (c) 2017      Joe Orton <[email protected]>
 # Licensed under the MIT license:
 # Licensed under the MIT license:
 #
 #
 # Permission is  hereby granted,  free of charge,  to any  person obtaining
 # Permission is  hereby granted,  free of charge,  to any  person obtaining
@@ -52,7 +54,7 @@ clean-local-check:
 	$(RM) xmlwf.1
 	$(RM) xmlwf.1
 
 
 EXTRA_DIST = \
 EXTRA_DIST = \
-    expat.png \
+    ok.min.css \
     reference.html \
     reference.html \
     style.css \
     style.css \
     valid-xhtml10.png \
     valid-xhtml10.png \

+ 24 - 4
libs/expat/doc/Makefile.in

@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.16.1 from Makefile.am.
+# Makefile.in generated by automake 1.16.3 from Makefile.am.
 # @configure_input@
 # @configure_input@
 
 
-# Copyright (C) 1994-2018 Free Software Foundation, Inc.
+# Copyright (C) 1994-2020 Free Software Foundation, Inc.
 
 
 # This Makefile.in is free software; the Free Software Foundation
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # gives unlimited permission to copy and/or distribute it,
@@ -22,7 +22,9 @@
 #                      \___/_/\_\ .__/ \__,_|\__|
 #                      \___/_/\_\ .__/ \__,_|\__|
 #                               |_| XML parser
 #                               |_| XML parser
 #
 #
-# Copyright (c) 2017 Expat development team
+# Copyright (c) 2017-2021 Sebastian Pipping <[email protected]>
+# Copyright (c) 2017      Stephen Groat <[email protected]>
+# Copyright (c) 2017      Joe Orton <[email protected]>
 # Licensed under the MIT license:
 # Licensed under the MIT license:
 #
 #
 # Permission is  hereby granted,  free of charge,  to any  person obtaining
 # Permission is  hereby granted,  free of charge,  to any  person obtaining
@@ -193,7 +195,11 @@ am__DIST_COMMON = $(dist_man_MANS) $(srcdir)/Makefile.in
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AMTAR = @AMTAR@
+AM_CFLAGS = @AM_CFLAGS@
+AM_CPPFLAGS = @AM_CPPFLAGS@
+AM_CXXFLAGS = @AM_CXXFLAGS@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AM_LDFLAGS = @AM_LDFLAGS@
 AR = @AR@
 AR = @AR@
 AS = @AS@
 AS = @AS@
 AUTOCONF = @AUTOCONF@
 AUTOCONF = @AUTOCONF@
@@ -221,6 +227,13 @@ ECHO_N = @ECHO_N@
 ECHO_T = @ECHO_T@
 ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
 EXEEXT = @EXEEXT@
+EXPAT_ATTR_INFO = @EXPAT_ATTR_INFO@
+EXPAT_CHAR_TYPE = @EXPAT_CHAR_TYPE@
+EXPAT_CONTEXT_BYTES = @EXPAT_CONTEXT_BYTES@
+EXPAT_DTD = @EXPAT_DTD@
+EXPAT_LARGE_SIZE = @EXPAT_LARGE_SIZE@
+EXPAT_MIN_SIZE = @EXPAT_MIN_SIZE@
+EXPAT_NS = @EXPAT_NS@
 FGREP = @FGREP@
 FGREP = @FGREP@
 FILEMAP = @FILEMAP@
 FILEMAP = @FILEMAP@
 GREP = @GREP@
 GREP = @GREP@
@@ -233,6 +246,7 @@ LD = @LD@
 LDFLAGS = @LDFLAGS@
 LDFLAGS = @LDFLAGS@
 LIBAGE = @LIBAGE@
 LIBAGE = @LIBAGE@
 LIBCURRENT = @LIBCURRENT@
 LIBCURRENT = @LIBCURRENT@
+LIBDIR_BASENAME = @LIBDIR_BASENAME@
 LIBOBJS = @LIBOBJS@
 LIBOBJS = @LIBOBJS@
 LIBREVISION = @LIBREVISION@
 LIBREVISION = @LIBREVISION@
 LIBS = @LIBS@
 LIBS = @LIBS@
@@ -262,8 +276,12 @@ RANLIB = @RANLIB@
 SED = @SED@
 SED = @SED@
 SET_MAKE = @SET_MAKE@
 SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
 SHELL = @SHELL@
+SO_MAJOR = @SO_MAJOR@
+SO_MINOR = @SO_MINOR@
+SO_PATCH = @SO_PATCH@
 STRIP = @STRIP@
 STRIP = @STRIP@
 VERSION = @VERSION@
 VERSION = @VERSION@
+_EXPAT_OUTPUT_NAME = @_EXPAT_OUTPUT_NAME@
 abs_builddir = @abs_builddir@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
 abs_srcdir = @abs_srcdir@
 abs_top_builddir = @abs_top_builddir@
 abs_top_builddir = @abs_top_builddir@
@@ -272,6 +290,7 @@ ac_ct_AR = @ac_ct_AR@
 ac_ct_CC = @ac_ct_CC@
 ac_ct_CC = @ac_ct_CC@
 ac_ct_CXX = @ac_ct_CXX@
 ac_ct_CXX = @ac_ct_CXX@
 ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
 ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+ac_cv_sizeof_void_p = @ac_cv_sizeof_void_p@
 am__include = @am__include@
 am__include = @am__include@
 am__leading_dot = @am__leading_dot@
 am__leading_dot = @am__leading_dot@
 am__quote = @am__quote@
 am__quote = @am__quote@
@@ -309,6 +328,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
 srcdir = @srcdir@
@@ -319,7 +339,7 @@ top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 top_srcdir = @top_srcdir@
 @WITH_DOCBOOK_TRUE@dist_man_MANS = xmlwf.1
 @WITH_DOCBOOK_TRUE@dist_man_MANS = xmlwf.1
 EXTRA_DIST = \
 EXTRA_DIST = \
-    expat.png \
+    ok.min.css \
     reference.html \
     reference.html \
     style.css \
     style.css \
     valid-xhtml10.png \
     valid-xhtml10.png \

BIN
libs/expat/doc/expat.png


File diff suppressed because it is too large
+ 1 - 0
libs/expat/doc/ok.min.css


+ 292 - 94
libs/expat/doc/reference.html

@@ -3,26 +3,54 @@
                       "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
                       "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
 <html>
 <html>
 <head>
 <head>
-<!-- Copyright 1999,2000 Clark Cooper <[email protected]>
-     All rights reserved.
-     This is free software. You may distribute or modify according to
-     the terms of the MIT/X License -->
+<!--
+                            __  __            _
+                         ___\ \/ /_ __   __ _| |_
+                        / _ \\  /| '_ \ / _` | __|
+                       |  __//  \| |_) | (_| | |_
+                        \___/_/\_\ .__/ \__,_|\__|
+                                 |_| XML parser
+
+   Copyright (c) 2000      Clark Cooper <[email protected]>
+   Copyright (c) 2000-2004 Fred L. Drake, Jr. <[email protected]>
+   Copyright (c) 2002-2012 Karl Waclawek <[email protected]>
+   Copyright (c) 2017-2021 Sebastian Pipping <[email protected]>
+   Copyright (c) 2017      Jakub Wilk <[email protected]>
+   Copyright (c) 2021      Tomas Korbar <[email protected]>
+   Licensed under the MIT license:
+
+   Permission is  hereby granted,  free of charge,  to any  person obtaining
+   a  copy  of  this  software   and  associated  documentation  files  (the
+   "Software"),  to  deal in  the  Software  without restriction,  including
+   without  limitation the  rights  to use,  copy,  modify, merge,  publish,
+   distribute, sublicense, and/or sell copies of the Software, and to permit
+   persons  to whom  the Software  is  furnished to  do so,  subject to  the
+   following conditions:
+
+   The above copyright  notice and this permission notice  shall be included
+   in all copies or substantial portions of the Software.
+
+   THE  SOFTWARE  IS  PROVIDED  "AS  IS",  WITHOUT  WARRANTY  OF  ANY  KIND,
+   EXPRESS  OR IMPLIED,  INCLUDING  BUT  NOT LIMITED  TO  THE WARRANTIES  OF
+   MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
+   NO EVENT SHALL THE AUTHORS OR  COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+   DAMAGES OR  OTHER LIABILITY, WHETHER  IN AN  ACTION OF CONTRACT,  TORT OR
+   OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+   USE OR OTHER DEALINGS IN THE SOFTWARE.
+-->
   <title>Expat XML Parser</title>
   <title>Expat XML Parser</title>
   <meta name="author" content="Clark Cooper, [email protected]" />
   <meta name="author" content="Clark Cooper, [email protected]" />
   <meta http-equiv="Content-Style-Type" content="text/css" />
   <meta http-equiv="Content-Style-Type" content="text/css" />
+  <link href="ok.min.css" rel="stylesheet" type="text/css" />
   <link href="style.css" rel="stylesheet" type="text/css" />
   <link href="style.css" rel="stylesheet" type="text/css" />
 </head>
 </head>
 <body>
 <body>
-  <table cellspacing="0" cellpadding="0" width="100%">
-    <tr>
-      <td class="corner"><img src="expat.png" alt="(Expat logo)" /></td>
-      <td class="banner"><h1>The Expat XML Parser</h1></td>
-    </tr>
-    <tr>
-      <td class="releaseno">Release 2.0.1</td>
-      <td></td>
-    </tr>
-  </table>
+  <div>
+    <h1>
+      The Expat XML Parser
+      <small>Release 2.4.1</small>
+    </h1>
+  </div>
 <div class="content">
 <div class="content">
 
 
 <p>Expat is a library, written in C, for parsing XML documents. It's
 <p>Expat is a library, written in C, for parsing XML documents. It's
@@ -120,6 +148,13 @@ interface.</p>
       <li><a href="#XML_GetInputContext">XML_GetInputContext</a></li>
       <li><a href="#XML_GetInputContext">XML_GetInputContext</a></li>
     </ul>
     </ul>
     </li>
     </li>
+    <li>
+      <a href="#billion-laughs">Billion Laughs Attack Protection</a>
+      <ul>
+        <li><a href="#XML_SetBillionLaughsAttackProtectionMaximumAmplification">XML_SetBillionLaughsAttackProtectionMaximumAmplification</a></li>
+        <li><a href="#XML_SetBillionLaughsAttackProtectionActivationThreshold">XML_SetBillionLaughsAttackProtectionActivationThreshold</a></li>
+      </ul>
+    </li>
     <li><a href="#miscellaneous">Miscellaneous Functions</a>
     <li><a href="#miscellaneous">Miscellaneous Functions</a>
     <ul>
     <ul>
       <li><a href="#XML_SetUserData">XML_SetUserData</a></li>
       <li><a href="#XML_SetUserData">XML_SetUserData</a></li>
@@ -900,7 +935,8 @@ whether the parse can be resumed in the future.</p>
 
 
 <h3><a name="creation">Parser Creation</a></h3>
 <h3><a name="creation">Parser Creation</a></h3>
 
 
-<pre class="fcndec" id="XML_ParserCreate">
+<h4 id="XML_ParserCreate">XML_ParserCreate</h4>
+<pre class="fcndec">
 XML_Parser XMLCALL
 XML_Parser XMLCALL
 XML_ParserCreate(const XML_Char *encoding);
 XML_ParserCreate(const XML_Char *encoding);
 </pre>
 </pre>
@@ -917,7 +953,8 @@ encoding declaration. There are four built-in encodings:
 Any other value will invoke a call to the UnknownEncodingHandler.
 Any other value will invoke a call to the UnknownEncodingHandler.
 </div>
 </div>
 
 
-<pre class="fcndec" id="XML_ParserCreateNS">
+<h4 id="XML_ParserCreateNS">XML_ParserCreateNS</h4>
+<pre class="fcndec">
 XML_Parser XMLCALL
 XML_Parser XMLCALL
 XML_ParserCreateNS(const XML_Char *encoding,
 XML_ParserCreateNS(const XML_Char *encoding,
                    XML_Char sep);
                    XML_Char sep);
@@ -936,7 +973,8 @@ the local part will be concatenated without any separator - this is intended
 to support RDF processors. It is a programming error to use the null separator
 to support RDF processors. It is a programming error to use the null separator
 with <a href= "#XML_SetReturnNSTriplet">namespace triplets</a>.</div>
 with <a href= "#XML_SetReturnNSTriplet">namespace triplets</a>.</div>
 
 
-<pre class="fcndec" id="XML_ParserCreate_MM">
+<h4 id="XML_ParserCreate_MM">XML_ParserCreate_MM</h4>
+<pre class="fcndec">
 XML_Parser XMLCALL
 XML_Parser XMLCALL
 XML_ParserCreate_MM(const XML_Char *encoding,
 XML_ParserCreate_MM(const XML_Char *encoding,
                     const XML_Memory_Handling_Suite *ms,
                     const XML_Memory_Handling_Suite *ms,
@@ -958,7 +996,8 @@ and the character pointed at by sep is used as the separator between
 the namespace URI and the local part of the name.</p>
 the namespace URI and the local part of the name.</p>
 </div>
 </div>
 
 
-<pre class="fcndec" id="XML_ExternalEntityParserCreate">
+<h4 id="XML_ExternalEntityParserCreate">XML_ExternalEntityParserCreate</h4>
+<pre class="fcndec">
 XML_Parser XMLCALL
 XML_Parser XMLCALL
 XML_ExternalEntityParserCreate(XML_Parser p,
 XML_ExternalEntityParserCreate(XML_Parser p,
                                const XML_Char *context,
                                const XML_Char *context,
@@ -974,7 +1013,8 @@ changing functions on this parser (unless you want it to act
 differently than the parent parser).
 differently than the parent parser).
 </div>
 </div>
 
 
-<pre class="fcndec" id="XML_ParserFree">
+<h4 id="XML_ParserFree">XML_ParserFree</h4>
+<pre class="fcndec">
 void XMLCALL
 void XMLCALL
 XML_ParserFree(XML_Parser p);
 XML_ParserFree(XML_Parser p);
 </pre>
 </pre>
@@ -983,7 +1023,8 @@ Free memory used by the parser. Your application is responsible for
 freeing any memory associated with <a href="#userdata">user data</a>.
 freeing any memory associated with <a href="#userdata">user data</a>.
 </div>
 </div>
 
 
-<pre class="fcndec" id="XML_ParserReset">
+<h4 id="XML_ParserReset">XML_ParserReset</h4>
+<pre class="fcndec">
 XML_Bool XMLCALL
 XML_Bool XMLCALL
 XML_ParserReset(XML_Parser p,
 XML_ParserReset(XML_Parser p,
                 const XML_Char *encoding);
                 const XML_Char *encoding);
@@ -1014,7 +1055,7 @@ if they apply to the parser created by
 <code><a href= "#XML_ExternalEntityParserCreate"
 <code><a href= "#XML_ExternalEntityParserCreate"
 >XML_ExternalEntityParserCreate</a></code>.</p>
 >XML_ExternalEntityParserCreate</a></code>.</p>
 
 
-<p>Note: the <code>len</code> argument passed to these functions
+<p>Note: The <code>len</code> argument passed to these functions
 should be considerably less than the maximum value for an integer,
 should be considerably less than the maximum value for an integer,
 as it could create an integer overflow situation if the added
 as it could create an integer overflow situation if the added
 lengths of a buffer and the unprocessed portion of the previous buffer
 lengths of a buffer and the unprocessed portion of the previous buffer
@@ -1022,7 +1063,8 @@ exceed the maximum integer value. Input data at the end of a buffer
 will remain unprocessed if it is part of an XML token for which the
 will remain unprocessed if it is part of an XML token for which the
 end is not part of that buffer.</p>
 end is not part of that buffer.</p>
 
 
-<pre class="fcndec" id="XML_Parse">
+<h4 id="XML_Parse">XML_Parse</h4>
+<pre class="fcndec">
 enum XML_Status XMLCALL
 enum XML_Status XMLCALL
 XML_Parse(XML_Parser p,
 XML_Parse(XML_Parser p,
           const char *s,
           const char *s,
@@ -1049,7 +1091,8 @@ If a parse error occurred, it returns <code>XML_STATUS_ERROR</code>.
 Otherwise it returns <code>XML_STATUS_OK</code> value.
 Otherwise it returns <code>XML_STATUS_OK</code> value.
 </div>
 </div>
 
 
-<pre class="fcndec" id="XML_ParseBuffer">
+<h4 id="XML_ParseBuffer">XML_ParseBuffer</h4>
+<pre class="fcndec">
 enum XML_Status XMLCALL
 enum XML_Status XMLCALL
 XML_ParseBuffer(XML_Parser p,
 XML_ParseBuffer(XML_Parser p,
                 int len,
                 int len,
@@ -1063,7 +1106,8 @@ buffer from Expat with the <code><a href= "#XML_GetBuffer"
 copying of the input.
 copying of the input.
 </div>
 </div>
 
 
-<pre class="fcndec" id="XML_GetBuffer">
+<h4 id="XML_GetBuffer">XML_GetBuffer</h4>
+<pre class="fcndec">
 void * XMLCALL
 void * XMLCALL
 XML_GetBuffer(XML_Parser p,
 XML_GetBuffer(XML_Parser p,
               int len);
               int len);
@@ -1098,7 +1142,8 @@ for (;;) {
 </pre>
 </pre>
 </div>
 </div>
 
 
-<pre class="fcndec" id="XML_StopParser">
+<h4 id="XML_StopParser">XML_StopParser</h4>
+<pre class="fcndec">
 enum XML_Status XMLCALL
 enum XML_Status XMLCALL
 XML_StopParser(XML_Parser p,
 XML_StopParser(XML_Parser p,
                XML_Bool resumable);
                XML_Bool resumable);
@@ -1111,7 +1156,7 @@ XML_StopParser(XML_Parser p,
 call-back handler, except when aborting (when <code>resumable</code>
 call-back handler, except when aborting (when <code>resumable</code>
 is <code>XML_FALSE</code>) an already suspended parser.  Some
 is <code>XML_FALSE</code>) an already suspended parser.  Some
 call-backs may still follow because they would otherwise get
 call-backs may still follow because they would otherwise get
-lost, including
+lost, including</p>
 <ul>
 <ul>
   <li> the end element handler for empty elements when stopped in the
   <li> the end element handler for empty elements when stopped in the
        start element handler,</li>
        start element handler,</li>
@@ -1120,7 +1165,7 @@ lost, including
   <li> the character data handler when stopped in the character data handler
   <li> the character data handler when stopped in the character data handler
        while making multiple call-backs on a contiguous chunk of characters,</li>
        while making multiple call-backs on a contiguous chunk of characters,</li>
 </ul>
 </ul>
-and possibly others.</p>
+<p>and possibly others.</p>
 
 
 <p>This can be called from most handlers, including DTD related
 <p>This can be called from most handlers, including DTD related
 call-backs, except when parsing an external parameter entity and
 call-backs, except when parsing an external parameter entity and
@@ -1166,7 +1211,8 @@ implementation of that handler to call <code><a href=
 <p>New in Expat 1.95.8.</p>
 <p>New in Expat 1.95.8.</p>
 </div>
 </div>
 
 
-<pre class="fcndec" id="XML_ResumeParser">
+<h4 id="XML_ResumeParser">XML_ResumeParser</h4>
+<pre class="fcndec">
 enum XML_Status XMLCALL
 enum XML_Status XMLCALL
 XML_ResumeParser(XML_Parser p);
 XML_ResumeParser(XML_Parser p);
 </pre>
 </pre>
@@ -1191,7 +1237,8 @@ appropriate moment.</p>
 <p>New in Expat 1.95.8.</p>
 <p>New in Expat 1.95.8.</p>
 </div>
 </div>
 
 
-<pre class="fcndec" id="XML_GetParsingStatus">
+<h4 id="XML_GetParsingStatus">XML_GetParsingStatus</h4>
+<pre class="fcndec">
 void XMLCALL
 void XMLCALL
 XML_GetParsingStatus(XML_Parser p,
 XML_GetParsingStatus(XML_Parser p,
                      XML_ParsingStatus *status);
                      XML_ParsingStatus *status);
@@ -1240,7 +1287,8 @@ Note that you'll receive them in this form independent of the original
 encoding of the document.</p>
 encoding of the document.</p>
 
 
 <div class="handler">
 <div class="handler">
-<pre class="setter" id="XML_SetStartElementHandler">
+<h4 id="XML_SetStartElementHandler">XML_SetStartElementHandler</h4>
+<pre class="setter">
 void XMLCALL
 void XMLCALL
 XML_SetStartElementHandler(XML_Parser p,
 XML_SetStartElementHandler(XML_Parser p,
                            XML_StartElementHandler start);
                            XML_StartElementHandler start);
@@ -1261,7 +1309,8 @@ by a null pointer.</p>
 </div>
 </div>
 
 
 <div class="handler">
 <div class="handler">
-<pre class="setter" id="XML_SetEndElementHandler">
+<h4 id="XML_SetEndElementHandler">XML_SetEndElementHandler</h4>
+<pre class="setter">
 void XMLCALL
 void XMLCALL
 XML_SetEndElementHandler(XML_Parser p,
 XML_SetEndElementHandler(XML_Parser p,
                          XML_EndElementHandler);
                          XML_EndElementHandler);
@@ -1276,7 +1325,8 @@ generates a call to both start and end handlers.</p>
 </div>
 </div>
 
 
 <div class="handler">
 <div class="handler">
-<pre class="setter" id="XML_SetElementHandler">
+<h4 id="XML_SetElementHandler">XML_SetElementHandler</h4>
+<pre class="setter">
 void XMLCALL
 void XMLCALL
 XML_SetElementHandler(XML_Parser p,
 XML_SetElementHandler(XML_Parser p,
                       XML_StartElementHandler start,
                       XML_StartElementHandler start,
@@ -1286,7 +1336,8 @@ XML_SetElementHandler(XML_Parser p,
 </div>
 </div>
 
 
 <div class="handler">
 <div class="handler">
-<pre class="setter" id="XML_SetCharacterDataHandler">
+<h4 id="XML_SetCharacterDataHandler">XML_SetCharacterDataHandler</h4>
+<pre class="setter">
 void XMLCALL
 void XMLCALL
 XML_SetCharacterDataHandler(XML_Parser p,
 XML_SetCharacterDataHandler(XML_Parser p,
                             XML_CharacterDataHandler charhndl)
                             XML_CharacterDataHandler charhndl)
@@ -1298,7 +1349,7 @@ typedef void
                                     int len);
                                     int len);
 </pre>
 </pre>
 <p>Set a text handler. The string your handler receives
 <p>Set a text handler. The string your handler receives
-is <em>NOT nul-terminated</em>. You have to use the length argument
+is <em>NOT null-terminated</em>. You have to use the length argument
 to deal with the end of the string. A single block of contiguous text
 to deal with the end of the string. A single block of contiguous text
 free of markup may still result in a sequence of calls to this handler.
 free of markup may still result in a sequence of calls to this handler.
 In other words, if you're searching for a pattern in the text, it may
 In other words, if you're searching for a pattern in the text, it may
@@ -1309,7 +1360,8 @@ will continue calling back until the end of the block is reached.</p>
 </div>
 </div>
 
 
 <div class="handler">
 <div class="handler">
-<pre class="setter" id="XML_SetProcessingInstructionHandler">
+<h4 id="XML_SetProcessingInstructionHandler">XML_SetProcessingInstructionHandler</h4>
+<pre class="setter">
 void XMLCALL
 void XMLCALL
 XML_SetProcessingInstructionHandler(XML_Parser p,
 XML_SetProcessingInstructionHandler(XML_Parser p,
                                     XML_ProcessingInstructionHandler proc)
                                     XML_ProcessingInstructionHandler proc)
@@ -1327,7 +1379,8 @@ it after skipping all whitespace after the initial word.</p>
 </div>
 </div>
 
 
 <div class="handler">
 <div class="handler">
-<pre class="setter" id="XML_SetCommentHandler">
+<h4 id="XML_SetCommentHandler">XML_SetCommentHandler</h4>
+<pre class="setter">
 void XMLCALL
 void XMLCALL
 XML_SetCommentHandler(XML_Parser p,
 XML_SetCommentHandler(XML_Parser p,
                       XML_CommentHandler cmnt)
                       XML_CommentHandler cmnt)
@@ -1342,7 +1395,8 @@ delimiters.</p>
 </div>
 </div>
 
 
 <div class="handler">
 <div class="handler">
-<pre class="setter" id="XML_SetStartCdataSectionHandler">
+<h4 id="XML_SetStartCdataSectionHandler">XML_SetStartCdataSectionHandler</h4>
+<pre class="setter">
 void XMLCALL
 void XMLCALL
 XML_SetStartCdataSectionHandler(XML_Parser p,
 XML_SetStartCdataSectionHandler(XML_Parser p,
                                 XML_StartCdataSectionHandler start);
                                 XML_StartCdataSectionHandler start);
@@ -1355,7 +1409,8 @@ typedef void
 </div>
 </div>
 
 
 <div class="handler">
 <div class="handler">
-<pre class="setter" id="XML_SetEndCdataSectionHandler">
+<h4 id="XML_SetEndCdataSectionHandler">XML_SetEndCdataSectionHandler</h4>
+<pre class="setter">
 void XMLCALL
 void XMLCALL
 XML_SetEndCdataSectionHandler(XML_Parser p,
 XML_SetEndCdataSectionHandler(XML_Parser p,
                               XML_EndCdataSectionHandler end);
                               XML_EndCdataSectionHandler end);
@@ -1368,7 +1423,8 @@ typedef void
 </div>
 </div>
 
 
 <div class="handler">
 <div class="handler">
-<pre class="setter" id="XML_SetCdataSectionHandler">
+<h4 id="XML_SetCdataSectionHandler">XML_SetCdataSectionHandler</h4>
+<pre class="setter">
 void XMLCALL
 void XMLCALL
 XML_SetCdataSectionHandler(XML_Parser p,
 XML_SetCdataSectionHandler(XML_Parser p,
                            XML_StartCdataSectionHandler start,
                            XML_StartCdataSectionHandler start,
@@ -1378,7 +1434,8 @@ XML_SetCdataSectionHandler(XML_Parser p,
 </div>
 </div>
 
 
 <div class="handler">
 <div class="handler">
-<pre class="setter" id="XML_SetDefaultHandler">
+<h4 id="XML_SetDefaultHandler">XML_SetDefaultHandler</h4>
+<pre class="setter">
 void XMLCALL
 void XMLCALL
 XML_SetDefaultHandler(XML_Parser p,
 XML_SetDefaultHandler(XML_Parser p,
                       XML_DefaultHandler hndl)
                       XML_DefaultHandler hndl)
@@ -1409,7 +1466,8 @@ href="#XML_DefaultCurrent">XML_DefaultCurrent</a></code>.</p>
 </div>
 </div>
 
 
 <div class="handler">
 <div class="handler">
-<pre class="setter" id="XML_SetDefaultHandlerExpand">
+<h4 id="XML_SetDefaultHandlerExpand">XML_SetDefaultHandlerExpand</h4>
+<pre class="setter">
 void XMLCALL
 void XMLCALL
 XML_SetDefaultHandlerExpand(XML_Parser p,
 XML_SetDefaultHandlerExpand(XML_Parser p,
                             XML_DefaultHandler hndl)
                             XML_DefaultHandler hndl)
@@ -1429,7 +1487,8 @@ href="#XML_DefaultCurrent">XML_DefaultCurrent</a></code>.</p>
 </div>
 </div>
 
 
 <div class="handler">
 <div class="handler">
-<pre class="setter" id="XML_SetExternalEntityRefHandler">
+<h4 id="XML_SetExternalEntityRefHandler">XML_SetExternalEntityRefHandler</h4>
+<pre class="setter">
 void XMLCALL
 void XMLCALL
 XML_SetExternalEntityRefHandler(XML_Parser p,
 XML_SetExternalEntityRefHandler(XML_Parser p,
                                 XML_ExternalEntityRefHandler hndl)
                                 XML_ExternalEntityRefHandler hndl)
@@ -1482,7 +1541,8 @@ parser, the body of the external entity can be recursively parsed.</p>
 information into global or static variables.</p>
 information into global or static variables.</p>
 </div>
 </div>
 
 
-<pre class="fcndec" id="XML_SetExternalEntityRefHandlerArg">
+<h4 id="XML_SetExternalEntityRefHandlerArg">XML_SetExternalEntityRefHandlerArg</h4>
+<pre class="fcndec">
 void XMLCALL
 void XMLCALL
 XML_SetExternalEntityRefHandlerArg(XML_Parser p,
 XML_SetExternalEntityRefHandlerArg(XML_Parser p,
                                    void *arg)
                                    void *arg)
@@ -1508,7 +1568,8 @@ properly.</p>
 </div>
 </div>
 
 
 <div class="handler">
 <div class="handler">
-<pre class="setter" id="XML_SetSkippedEntityHandler">
+<h4 id="XML_SetSkippedEntityHandler">XML_SetSkippedEntityHandler</h4>
+<pre class="setter">
 void XMLCALL
 void XMLCALL
 XML_SetSkippedEntityHandler(XML_Parser p,
 XML_SetSkippedEntityHandler(XML_Parser p,
                             XML_SkippedEntityHandler handler)
                             XML_SkippedEntityHandler handler)
@@ -1528,14 +1589,15 @@ typedef void
 	   has been called.</li>
 	   has been called.</li>
 </ol>
 </ol>
 <p>The <code>is_parameter_entity</code> argument will be non-zero for
 <p>The <code>is_parameter_entity</code> argument will be non-zero for
-a parameter entity and zero for a general entity.</p> <p>Note: skipped
+a parameter entity and zero for a general entity.</p> <p>Note: Skipped
 parameter entities in declarations and skipped general entities in
 parameter entities in declarations and skipped general entities in
 attribute values cannot be reported, because the event would be out of
 attribute values cannot be reported, because the event would be out of
 sync with the reporting of the declarations or attribute values</p>
 sync with the reporting of the declarations or attribute values</p>
 </div>
 </div>
 
 
 <div class="handler">
 <div class="handler">
-<pre class="setter" id="XML_SetUnknownEncodingHandler">
+<h4 id="XML_SetUnknownEncodingHandler">XML_SetUnknownEncodingHandler</h4>
+<pre class="setter">
 void XMLCALL
 void XMLCALL
 XML_SetUnknownEncodingHandler(XML_Parser p,
 XML_SetUnknownEncodingHandler(XML_Parser p,
                               XML_UnknownEncodingHandler enchandler,
                               XML_UnknownEncodingHandler enchandler,
@@ -1576,7 +1638,7 @@ call to the function pointed at by convert. This function may return -1
 if the sequence itself is invalid. The convert pointer may be null if
 if the sequence itself is invalid. The convert pointer may be null if
 there are only single byte codes. The data parameter passed to the convert
 there are only single byte codes. The data parameter passed to the convert
 function is the data pointer from <code>XML_Encoding</code>. The
 function is the data pointer from <code>XML_Encoding</code>. The
-string s is <em>NOT</em> nul-terminated and points at the sequence of
+string s is <em>NOT</em> null-terminated and points at the sequence of
 bytes to be converted.</p>
 bytes to be converted.</p>
 
 
 <p>The function pointed at by <code>release</code> is called by the
 <p>The function pointed at by <code>release</code> is called by the
@@ -1584,7 +1646,8 @@ parser when it is finished with the encoding. It may be NULL.</p>
 </div>
 </div>
 
 
 <div class="handler">
 <div class="handler">
-<pre class="setter" id="XML_SetStartNamespaceDeclHandler">
+<h4 id="XML_SetStartNamespaceDeclHandler">XML_SetStartNamespaceDeclHandler</h4>
+<pre class="setter">
 void XMLCALL
 void XMLCALL
 XML_SetStartNamespaceDeclHandler(XML_Parser p,
 XML_SetStartNamespaceDeclHandler(XML_Parser p,
 			         XML_StartNamespaceDeclHandler start);
 			         XML_StartNamespaceDeclHandler start);
@@ -1602,7 +1665,8 @@ in that start tag.</p>
 </div>
 </div>
 
 
 <div class="handler">
 <div class="handler">
-<pre class="setter" id="XML_SetEndNamespaceDeclHandler">
+<h4 id="XML_SetEndNamespaceDeclHandler">XML_SetEndNamespaceDeclHandler</h4>
+<pre class="setter">
 void XMLCALL
 void XMLCALL
 XML_SetEndNamespaceDeclHandler(XML_Parser p,
 XML_SetEndNamespaceDeclHandler(XML_Parser p,
 			       XML_EndNamespaceDeclHandler end);
 			       XML_EndNamespaceDeclHandler end);
@@ -1619,7 +1683,8 @@ namespace was declared.</p>
 </div>
 </div>
 
 
 <div class="handler">
 <div class="handler">
-<pre class="setter" id="XML_SetNamespaceDeclHandler">
+<h4 id="XML_SetNamespaceDeclHandler">XML_SetNamespaceDeclHandler</h4>
+<pre class="setter">
 void XMLCALL
 void XMLCALL
 XML_SetNamespaceDeclHandler(XML_Parser p,
 XML_SetNamespaceDeclHandler(XML_Parser p,
                             XML_StartNamespaceDeclHandler start,
                             XML_StartNamespaceDeclHandler start,
@@ -1629,7 +1694,8 @@ XML_SetNamespaceDeclHandler(XML_Parser p,
 </div>
 </div>
 
 
 <div class="handler">
 <div class="handler">
-<pre class="setter" id="XML_SetXmlDeclHandler">
+<h4 id="XML_SetXmlDeclHandler">XML_SetXmlDeclHandler</h4>
+<pre class="setter">
 void XMLCALL
 void XMLCALL
 XML_SetXmlDeclHandler(XML_Parser p,
 XML_SetXmlDeclHandler(XML_Parser p,
 		      XML_XmlDeclHandler xmldecl);
 		      XML_XmlDeclHandler xmldecl);
@@ -1652,7 +1718,8 @@ that it was given as yes.</p>
 </div>
 </div>
 
 
 <div class="handler">
 <div class="handler">
-<pre class="setter" id="XML_SetStartDoctypeDeclHandler">
+<h4 id="XML_SetStartDoctypeDeclHandler">XML_SetStartDoctypeDeclHandler</h4>
+<pre class="setter">
 void XMLCALL
 void XMLCALL
 XML_SetStartDoctypeDeclHandler(XML_Parser p,
 XML_SetStartDoctypeDeclHandler(XML_Parser p,
 			       XML_StartDoctypeDeclHandler start);
 			       XML_StartDoctypeDeclHandler start);
@@ -1672,7 +1739,8 @@ will be non-zero if the DOCTYPE declaration has an internal subset.</p>
 </div>
 </div>
 
 
 <div class="handler">
 <div class="handler">
-<pre class="setter" id="XML_SetEndDoctypeDeclHandler">
+<h4 id="XML_SetEndDoctypeDeclHandler">XML_SetEndDoctypeDeclHandler</h4>
+<pre class="setter">
 void XMLCALL
 void XMLCALL
 XML_SetEndDoctypeDeclHandler(XML_Parser p,
 XML_SetEndDoctypeDeclHandler(XML_Parser p,
 			     XML_EndDoctypeDeclHandler end);
 			     XML_EndDoctypeDeclHandler end);
@@ -1686,7 +1754,8 @@ after parsing any external subset.</p>
 </div>
 </div>
 
 
 <div class="handler">
 <div class="handler">
-<pre class="setter" id="XML_SetDoctypeDeclHandler">
+<h4 id="XML_SetDoctypeDeclHandler">XML_SetDoctypeDeclHandler</h4>
+<pre class="setter">
 void XMLCALL
 void XMLCALL
 XML_SetDoctypeDeclHandler(XML_Parser p,
 XML_SetDoctypeDeclHandler(XML_Parser p,
 			  XML_StartDoctypeDeclHandler start,
 			  XML_StartDoctypeDeclHandler start,
@@ -1696,7 +1765,8 @@ XML_SetDoctypeDeclHandler(XML_Parser p,
 </div>
 </div>
 
 
 <div class="handler">
 <div class="handler">
-<pre class="setter" id="XML_SetElementDeclHandler">
+<h4 id="XML_SetElementDeclHandler">XML_SetElementDeclHandler</h4>
+<pre class="setter">
 void XMLCALL
 void XMLCALL
 XML_SetElementDeclHandler(XML_Parser p,
 XML_SetElementDeclHandler(XML_Parser p,
 			  XML_ElementDeclHandler eldecl);
 			  XML_ElementDeclHandler eldecl);
@@ -1768,7 +1838,8 @@ or sequence and <code>children</code> points to the nodes.</p>
 </div>
 </div>
 
 
 <div class="handler">
 <div class="handler">
-<pre class="setter" id="XML_SetAttlistDeclHandler">
+<h4 id="XML_SetAttlistDeclHandler">XML_SetAttlistDeclHandler</h4>
+<pre class="setter">
 void XMLCALL
 void XMLCALL
 XML_SetAttlistDeclHandler(XML_Parser p,
 XML_SetAttlistDeclHandler(XML_Parser p,
                           XML_AttlistDeclHandler attdecl);
                           XML_AttlistDeclHandler attdecl);
@@ -1801,7 +1872,8 @@ in the <code>dflt</code> parameter.</p>
 </div>
 </div>
 
 
 <div class="handler">
 <div class="handler">
-<pre class="setter" id="XML_SetEntityDeclHandler">
+<h4 id="XML_SetEntityDeclHandler">XML_SetEntityDeclHandler</h4>
+<pre class="setter">
 void XMLCALL
 void XMLCALL
 XML_SetEntityDeclHandler(XML_Parser p,
 XML_SetEntityDeclHandler(XML_Parser p,
 			 XML_EntityDeclHandler handler);
 			 XML_EntityDeclHandler handler);
@@ -1835,7 +1907,8 @@ declarations.</p>
 </div>
 </div>
 
 
 <div class="handler">
 <div class="handler">
-<pre class="setter" id="XML_SetUnparsedEntityDeclHandler">
+<h4 id="XML_SetUnparsedEntityDeclHandler">XML_SetUnparsedEntityDeclHandler</h4>
+<pre class="setter">
 void XMLCALL
 void XMLCALL
 XML_SetUnparsedEntityDeclHandler(XML_Parser p,
 XML_SetUnparsedEntityDeclHandler(XML_Parser p,
                                  XML_UnparsedEntityDeclHandler h)
                                  XML_UnparsedEntityDeclHandler h)
@@ -1861,7 +1934,8 @@ compatibility.  Use instead <a href= "#XML_SetEntityDeclHandler"
 </div>
 </div>
 
 
 <div class="handler">
 <div class="handler">
-<pre class="setter" id="XML_SetNotationDeclHandler">
+<h4 id="XML_SetNotationDeclHandler">XML_SetNotationDeclHandler</h4>
+<pre class="setter">
 void XMLCALL
 void XMLCALL
 XML_SetNotationDeclHandler(XML_Parser p,
 XML_SetNotationDeclHandler(XML_Parser p,
                            XML_NotationDeclHandler h)
                            XML_NotationDeclHandler h)
@@ -1878,7 +1952,8 @@ typedef void
 </div>
 </div>
 
 
 <div class="handler">
 <div class="handler">
-<pre class="setter" id="XML_SetNotStandaloneHandler">
+<h4 id="XML_SetNotStandaloneHandler">XML_SetNotStandaloneHandler</h4>
+<pre class="setter">
 void XMLCALL
 void XMLCALL
 XML_SetNotStandaloneHandler(XML_Parser p,
 XML_SetNotStandaloneHandler(XML_Parser p,
                             XML_NotStandaloneHandler h)
                             XML_NotStandaloneHandler h)
@@ -1904,7 +1979,7 @@ of errors. The position reported is the byte position (in the original
 document or entity encoding) of the first of the sequence of
 document or entity encoding) of the first of the sequence of
 characters that generated the current event (or the error that caused
 characters that generated the current event (or the error that caused
 the parse functions to return <code>XML_STATUS_ERROR</code>.)  The
 the parse functions to return <code>XML_STATUS_ERROR</code>.)  The
-exceptions are callbacks trigged by declarations in the document
+exceptions are callbacks triggered by declarations in the document
 prologue, in which case they exact position reported is somewhere in the
 prologue, in which case they exact position reported is somewhere in the
 relevant markup, but not necessarily as meaningful as for other
 relevant markup, but not necessarily as meaningful as for other
 events.</p>
 events.</p>
@@ -1913,7 +1988,8 @@ events.</p>
 DTD.  In other words, they usually return bogus information when
 DTD.  In other words, they usually return bogus information when
 called from within a DTD declaration handler.</p>
 called from within a DTD declaration handler.</p>
 
 
-<pre class="fcndec" id="XML_GetErrorCode">
+<h4 id="XML_GetErrorCode">XML_GetErrorCode</h4>
+<pre class="fcndec">
 enum XML_Error XMLCALL
 enum XML_Error XMLCALL
 XML_GetErrorCode(XML_Parser p);
 XML_GetErrorCode(XML_Parser p);
 </pre>
 </pre>
@@ -1921,7 +1997,8 @@ XML_GetErrorCode(XML_Parser p);
 Return what type of error has occurred.
 Return what type of error has occurred.
 </div>
 </div>
 
 
-<pre class="fcndec" id="XML_ErrorString">
+<h4 id="XML_ErrorString">XML_ErrorString</h4>
+<pre class="fcndec">
 const XML_LChar * XMLCALL
 const XML_LChar * XMLCALL
 XML_ErrorString(enum XML_Error code);
 XML_ErrorString(enum XML_Error code);
 </pre>
 </pre>
@@ -1931,7 +2008,8 @@ The code should be one of the enums that can be returned from
 <code><a href= "#XML_GetErrorCode" >XML_GetErrorCode</a></code>.
 <code><a href= "#XML_GetErrorCode" >XML_GetErrorCode</a></code>.
 </div>
 </div>
 
 
-<pre class="fcndec" id="XML_GetCurrentByteIndex">
+<h4 id="XML_GetCurrentByteIndex">XML_GetCurrentByteIndex</h4>
+<pre class="fcndec">
 XML_Index XMLCALL
 XML_Index XMLCALL
 XML_GetCurrentByteIndex(XML_Parser p);
 XML_GetCurrentByteIndex(XML_Parser p);
 </pre>
 </pre>
@@ -1942,7 +2020,8 @@ the values returned by <code><a href= "#XML_GetCurrentLineNumber"
 "#XML_GetCurrentColumnNumber" >XML_GetCurrentColumnNumber</a></code>.
 "#XML_GetCurrentColumnNumber" >XML_GetCurrentColumnNumber</a></code>.
 </div>
 </div>
 
 
-<pre class="fcndec" id="XML_GetCurrentLineNumber">
+<h4 id="XML_GetCurrentLineNumber">XML_GetCurrentLineNumber</h4>
+<pre class="fcndec">
 XML_Size XMLCALL
 XML_Size XMLCALL
 XML_GetCurrentLineNumber(XML_Parser p);
 XML_GetCurrentLineNumber(XML_Parser p);
 </pre>
 </pre>
@@ -1951,7 +2030,8 @@ Return the line number of the position.  The first line is reported as
 <code>1</code>.
 <code>1</code>.
 </div>
 </div>
 
 
-<pre class="fcndec" id="XML_GetCurrentColumnNumber">
+<h4 id="XML_GetCurrentColumnNumber">XML_GetCurrentColumnNumber</h4>
+<pre class="fcndec">
 XML_Size XMLCALL
 XML_Size XMLCALL
 XML_GetCurrentColumnNumber(XML_Parser p);
 XML_GetCurrentColumnNumber(XML_Parser p);
 </pre>
 </pre>
@@ -1960,7 +2040,8 @@ Return the offset, from the beginning of the current line, of
 the position.
 the position.
 </div>
 </div>
 
 
-<pre class="fcndec" id="XML_GetCurrentByteCount">
+<h4 id="XML_GetCurrentByteCount">XML_GetCurrentByteCount</h4>
+<pre class="fcndec">
 int XMLCALL
 int XMLCALL
 XML_GetCurrentByteCount(XML_Parser p);
 XML_GetCurrentByteCount(XML_Parser p);
 </pre>
 </pre>
@@ -1972,7 +2053,8 @@ be used to distinguish empty-element tags from empty elements using
 separate start and end tags).
 separate start and end tags).
 </div>
 </div>
 
 
-<pre class="fcndec" id="XML_GetInputContext">
+<h4 id="XML_GetInputContext">XML_GetInputContext</h4>
+<pre class="fcndec">
 const char * XMLCALL
 const char * XMLCALL
 XML_GetInputContext(XML_Parser p,
 XML_GetInputContext(XML_Parser p,
                     int *offset,
                     int *offset,
@@ -1998,12 +2080,105 @@ parse position may be before the beginning of the buffer.</p>
 return NULL.</p>
 return NULL.</p>
 </div>
 </div>
 
 
+<h3><a name="billion-laughs">Billion Laughs Attack Protection</a></h3>
+
+<p>The functions in this section configure the built-in
+  protection against various forms of
+  <a href="https://en.wikipedia.org/wiki/Billion_laughs_attack">billion laughs attacks</a>.</p>
+
+<h4 id="XML_SetBillionLaughsAttackProtectionMaximumAmplification">XML_SetBillionLaughsAttackProtectionMaximumAmplification</h4>
+<pre class="fcndec">
+/* Added in Expat 2.4.0. */
+XML_Bool XMLCALL
+XML_SetBillionLaughsAttackProtectionMaximumAmplification(XML_Parser p,
+                                                         float maximumAmplificationFactor);
+</pre>
+<div class="fcndef">
+  <p>
+    Sets the maximum tolerated amplification factor
+    for protection against
+    <a href="https://en.wikipedia.org/wiki/Billion_laughs_attack">billion laughs attacks</a>
+    (default: <code>100.0</code>)
+    of parser <code>p</code> to <code>maximumAmplificationFactor</code>, and
+    returns <code>XML_TRUE</code> upon success and <code>XML_TRUE</code> upon error.
+  </p>
+
+  The amplification factor is calculated as ..
+  <pre>
+    amplification := (direct + indirect) / direct
+  </pre>
+  .. while parsing, whereas
+  <code>direct</code> is the number of bytes read from the primary document in parsing and
+  <code>indirect</code> is the number of bytes added by expanding entities and reading of external DTD files, combined.
+
+  <p>For a call to <code>XML_SetBillionLaughsAttackProtectionMaximumAmplification</code> to succeed:</p>
+  <ul>
+    <li>parser <code>p</code> must be a non-<code>NULL</code> root parser (without any parent parsers) and</li>
+    <li><code>maximumAmplificationFactor</code> must be non-<code>NaN</code> and greater than or equal to <code>1.0</code>.</li>
+  </ul>
+
+  <p>
+    <strong>Note:</strong>
+    If you ever need to increase this value for non-attack payload,
+    please <a href="https://github.com/libexpat/libexpat/issues">file a bug report</a>.
+  </p>
+
+  <p>
+    <strong>Note:</strong>
+    Peak amplifications
+    of factor 15,000 for the entire payload and
+    of factor 30,000 in the middle of parsing
+    have been observed with small benign files in practice.
+
+    So if you do reduce the maximum allowed amplification,
+    please make sure that the activation threshold is still big enough
+    to not end up with undesired false positives (i.e. benign files being rejected).
+  </p>
+</div>
+
+<h4 id="XML_SetBillionLaughsAttackProtectionActivationThreshold">XML_SetBillionLaughsAttackProtectionActivationThreshold</h4>
+<pre class="fcndec">
+/* Added in Expat 2.4.0. */
+XML_Bool XMLCALL
+XML_SetBillionLaughsAttackProtectionActivationThreshold(XML_Parser p,
+                                                        unsigned long long activationThresholdBytes);
+</pre>
+<div class="fcndef">
+  <p>
+    Sets number of output bytes (including amplification from entity expansion and reading DTD files)
+    needed to activate protection against
+    <a href="https://en.wikipedia.org/wiki/Billion_laughs_attack">billion laughs attacks</a>
+    (default: <code>8 MiB</code>)
+    of parser <code>p</code> to <code>activationThresholdBytes</code>, and
+    returns <code>XML_TRUE</code> upon success and <code>XML_TRUE</code> upon error.
+  </p>
+
+  <p>For a call to <code>XML_SetBillionLaughsAttackProtectionActivationThreshold</code> to succeed:</p>
+  <ul>
+    <li>parser <code>p</code> must be a non-<code>NULL</code> root parser (without any parent parsers).</li>
+  </ul>
+
+  <p>
+    <strong>Note:</strong>
+    If you ever need to increase this value for non-attack payload,
+    please <a href="https://github.com/libexpat/libexpat/issues">file a bug report</a>.
+  </p>
+
+  <p>
+    <strong>Note:</strong>
+    Activation thresholds below 4 MiB are known to break support for
+    <a href="https://en.wikipedia.org/wiki/Darwin_Information_Typing_Architecture">DITA</a> 1.3 payload
+    and are hence not recommended.
+  </p>
+</div>
+
 <h3><a name="miscellaneous">Miscellaneous functions</a></h3>
 <h3><a name="miscellaneous">Miscellaneous functions</a></h3>
 
 
 <p>The functions in this section either obtain state information from
 <p>The functions in this section either obtain state information from
 the parser or can be used to dynamically set parser options.</p>
 the parser or can be used to dynamically set parser options.</p>
 
 
-<pre class="fcndec" id="XML_SetUserData">
+<h4 id="XML_SetUserData">XML_SetUserData</h4>
+<pre class="fcndec">
 void XMLCALL
 void XMLCALL
 XML_SetUserData(XML_Parser p,
 XML_SetUserData(XML_Parser p,
                 void *userData);
                 void *userData);
@@ -2018,7 +2193,8 @@ the memory associated with it, then you've probably just leaked
 memory.
 memory.
 </div>
 </div>
 
 
-<pre class="fcndec" id="XML_GetUserData">
+<h4 id="XML_GetUserData">XML_GetUserData</h4>
+<pre class="fcndec">
 void * XMLCALL
 void * XMLCALL
 XML_GetUserData(XML_Parser p);
 XML_GetUserData(XML_Parser p);
 </pre>
 </pre>
@@ -2027,7 +2203,8 @@ This returns the user data pointer that gets passed to handlers.
 It is actually implemented as a macro.
 It is actually implemented as a macro.
 </div>
 </div>
 
 
-<pre class="fcndec" id="XML_UseParserAsHandlerArg">
+<h4 id="XML_UseParserAsHandlerArg">XML_UseParserAsHandlerArg</h4>
+<pre class="fcndec">
 void XMLCALL
 void XMLCALL
 XML_UseParserAsHandlerArg(XML_Parser p);
 XML_UseParserAsHandlerArg(XML_Parser p);
 </pre>
 </pre>
@@ -2038,7 +2215,8 @@ using the <code><a href= "#XML_GetUserData"
 >XML_GetUserData</a></code> function.
 >XML_GetUserData</a></code> function.
 </div>
 </div>
 
 
-<pre class="fcndec" id="XML_SetBase">
+<h4 id="XML_SetBase">XML_SetBase</h4>
+<pre class="fcndec">
 enum XML_Status XMLCALL
 enum XML_Status XMLCALL
 XML_SetBase(XML_Parser p,
 XML_SetBase(XML_Parser p,
             const XML_Char *base);
             const XML_Char *base);
@@ -2050,7 +2228,8 @@ there's no memory to store base, otherwise it's
 <code>XML_STATUS_OK</code>.
 <code>XML_STATUS_OK</code>.
 </div>
 </div>
 
 
-<pre class="fcndec" id="XML_GetBase">
+<h4 id="XML_GetBase">XML_GetBase</h4>
+<pre class="fcndec">
 const XML_Char * XMLCALL
 const XML_Char * XMLCALL
 XML_GetBase(XML_Parser p);
 XML_GetBase(XML_Parser p);
 </pre>
 </pre>
@@ -2058,7 +2237,8 @@ XML_GetBase(XML_Parser p);
 Return the base for resolving relative URIs.
 Return the base for resolving relative URIs.
 </div>
 </div>
 
 
-<pre class="fcndec" id="XML_GetSpecifiedAttributeCount">
+<h4 id="XML_GetSpecifiedAttributeCount">XML_GetSpecifiedAttributeCount</h4>
+<pre class="fcndec">
 int XMLCALL
 int XMLCALL
 XML_GetSpecifiedAttributeCount(XML_Parser p);
 XML_GetSpecifiedAttributeCount(XML_Parser p);
 </pre>
 </pre>
@@ -2074,7 +2254,8 @@ call to a start handler. If called inside a start handler, then that
 means the current call.
 means the current call.
 </div>
 </div>
 
 
-<pre class="fcndec" id="XML_GetIdAttributeIndex">
+<h4 id="XML_GetIdAttributeIndex">XML_GetIdAttributeIndex</h4>
+<pre class="fcndec">
 int XMLCALL
 int XMLCALL
 XML_GetIdAttributeIndex(XML_Parser p);
 XML_GetIdAttributeIndex(XML_Parser p);
 </pre>
 </pre>
@@ -2086,7 +2267,8 @@ attribute. If called inside a start handler, then that means the
 current call.
 current call.
 </div>
 </div>
 
 
-<pre class="fcndec" id="XML_GetAttributeInfo">
+<h4 id="XML_GetAttributeInfo">XML_GetAttributeInfo</h4>
+<pre class="fcndec">
 const XML_AttrInfo * XMLCALL
 const XML_AttrInfo * XMLCALL
 XML_GetAttributeInfo(XML_Parser parser);
 XML_GetAttributeInfo(XML_Parser parser);
 </pre>
 </pre>
@@ -2107,7 +2289,8 @@ as 1; thus the number of entries in the array is
 <code>XML_GetSpecifiedAttributeCount(parser) / 2</code>.
 <code>XML_GetSpecifiedAttributeCount(parser) / 2</code>.
 </div>
 </div>
 
 
-<pre class="fcndec" id="XML_SetEncoding">
+<h4 id="XML_SetEncoding">XML_SetEncoding</h4>
+<pre class="fcndec">
 enum XML_Status XMLCALL
 enum XML_Status XMLCALL
 XML_SetEncoding(XML_Parser p,
 XML_SetEncoding(XML_Parser p,
                 const XML_Char *encoding);
                 const XML_Char *encoding);
@@ -2122,7 +2305,8 @@ Returns <code>XML_STATUS_OK</code> on success or
 <code>XML_STATUS_ERROR</code> on error.
 <code>XML_STATUS_ERROR</code> on error.
 </div>
 </div>
 
 
-<pre class="fcndec" id="XML_SetParamEntityParsing">
+<h4 id="XML_SetParamEntityParsing">XML_SetParamEntityParsing</h4>
+<pre class="fcndec">
 int XMLCALL
 int XMLCALL
 XML_SetParamEntityParsing(XML_Parser p,
 XML_SetParamEntityParsing(XML_Parser p,
                           enum XML_ParamEntityParsing code);
                           enum XML_ParamEntityParsing code);
@@ -2142,7 +2326,8 @@ The choices for <code>code</code> are:
 no effect and will always return 0.
 no effect and will always return 0.
 </div>
 </div>
 
 
-<pre class="fcndec" id="XML_SetHashSalt">
+<h4 id="XML_SetHashSalt">XML_SetHashSalt</h4>
+<pre class="fcndec">
 int XMLCALL
 int XMLCALL
 XML_SetHashSalt(XML_Parser p,
 XML_SetHashSalt(XML_Parser p,
                 unsigned long hash_salt);
                 unsigned long hash_salt);
@@ -2153,15 +2338,16 @@ Helps in preventing DoS attacks based on predicting hash
 function behavior. In order to have an effect this must be called
 function behavior. In order to have an effect this must be called
 before parsing has started. Returns 1 if successful, 0 when called
 before parsing has started. Returns 1 if successful, 0 when called
 after <code>XML_Parse</code> or <code>XML_ParseBuffer</code>.
 after <code>XML_Parse</code> or <code>XML_ParseBuffer</code>.
-<p><b>Note:</b>This call is optional, as the parser will auto-generate 
+<p><b>Note:</b> This call is optional, as the parser will auto-generate
 a new random salt value if no value has been set at the start of parsing.</p>
 a new random salt value if no value has been set at the start of parsing.</p>
-<p><b>Note:</b>One should not call <code>XML_SetHashSalt</code> with a
+<p><b>Note:</b> One should not call <code>XML_SetHashSalt</code> with a
 hash salt value of 0, as this value is used as sentinel value to indicate
 hash salt value of 0, as this value is used as sentinel value to indicate
 that <code>XML_SetHashSalt</code> has <b>not</b> been called. Consequently
 that <code>XML_SetHashSalt</code> has <b>not</b> been called. Consequently
 such a call will have no effect, even if it returns 1.</p>
 such a call will have no effect, even if it returns 1.</p>
 </div>
 </div>
 
 
-<pre class="fcndec" id="XML_UseForeignDTD">
+<h4 id="XML_UseForeignDTD">XML_UseForeignDTD</h4>
+<pre class="fcndec">
 enum XML_Error XMLCALL
 enum XML_Error XMLCALL
 XML_UseForeignDTD(XML_Parser parser, XML_Bool useDTD);
 XML_UseForeignDTD(XML_Parser parser, XML_Bool useDTD);
 </pre>
 </pre>
@@ -2198,7 +2384,8 @@ the document had a DTD with an external subset. This holds true even if
 the external entity reference handler returns without action.</p>
 the external entity reference handler returns without action.</p>
 </div>
 </div>
 
 
-<pre class="fcndec" id="XML_SetReturnNSTriplet">
+<h4 id="XML_SetReturnNSTriplet">XML_SetReturnNSTriplet</h4>
+<pre class="fcndec">
 void XMLCALL
 void XMLCALL
 XML_SetReturnNSTriplet(XML_Parser parser,
 XML_SetReturnNSTriplet(XML_Parser parser,
                        int        do_nst);
                        int        do_nst);
@@ -2220,7 +2407,8 @@ default manner, URI then local_name separated by the namespace
 separator.</p>
 separator.</p>
 </div>
 </div>
 
 
-<pre class="fcndec" id="XML_DefaultCurrent">
+<h4 id="XML_DefaultCurrent">XML_DefaultCurrent</h4>
+<pre class="fcndec">
 void XMLCALL
 void XMLCALL
 XML_DefaultCurrent(XML_Parser parser);
 XML_DefaultCurrent(XML_Parser parser);
 </pre>
 </pre>
@@ -2234,7 +2422,8 @@ href="#XML_SetDefaultHandler" >XML_SetDefaultHandler</a></code> or
 not a default handler.
 not a default handler.
 </div>
 </div>
 
 
-<pre class="fcndec" id="XML_ExpatVersion">
+<h4 id="XML_ExpatVersion">XML_ExpatVersion</h4>
+<pre class="fcndec">
 XML_LChar * XMLCALL
 XML_LChar * XMLCALL
 XML_ExpatVersion();
 XML_ExpatVersion();
 </pre>
 </pre>
@@ -2242,7 +2431,8 @@ XML_ExpatVersion();
 Return the library version as a string (e.g. <code>"expat_1.95.1"</code>).
 Return the library version as a string (e.g. <code>"expat_1.95.1"</code>).
 </div>
 </div>
 
 
-<pre class="fcndec" id="XML_ExpatVersionInfo">
+<h4 id="XML_ExpatVersionInfo">XML_ExpatVersionInfo</h4>
+<pre class="fcndec">
 struct XML_Expat_Version XMLCALL
 struct XML_Expat_Version XMLCALL
 XML_ExpatVersionInfo();
 XML_ExpatVersionInfo();
 </pre>
 </pre>
@@ -2266,7 +2456,8 @@ Testing these constants is currently the best way to determine if
 particular parts of the Expat API are available.
 particular parts of the Expat API are available.
 </div>
 </div>
 
 
-<pre class="fcndec" id="XML_GetFeatureList">
+<h4 id="XML_GetFeatureList">XML_GetFeatureList</h4>
+<pre class="fcndec">
 const XML_Feature * XMLCALL
 const XML_Feature * XMLCALL
 XML_GetFeatureList();
 XML_GetFeatureList();
 </pre>
 </pre>
@@ -2327,7 +2518,8 @@ time, the following features have been defined to have values:</p>
 </dl>
 </dl>
 </div>
 </div>
 
 
-<pre class="fcndec" id="XML_FreeContentModel">
+<h4 id="XML_FreeContentModel">XML_FreeContentModel</h4>
+<pre class="fcndec">
 void XMLCALL
 void XMLCALL
 XML_FreeContentModel(XML_Parser parser, XML_Content *model);
 XML_FreeContentModel(XML_Parser parser, XML_Content *model);
 </pre>
 </pre>
@@ -2346,7 +2538,8 @@ applications.  This can be essential when using dynamically loaded
 libraries which use different C standard libraries (this can happen on
 libraries which use different C standard libraries (this can happen on
 Windows, at least).</p>
 Windows, at least).</p>
 
 
-<pre class="fcndec" id="XML_MemMalloc">
+<h4 id="XML_MemMalloc">XML_MemMalloc</h4>
+<pre class="fcndec">
 void * XMLCALL
 void * XMLCALL
 XML_MemMalloc(XML_Parser parser, size_t size);
 XML_MemMalloc(XML_Parser parser, size_t size);
 </pre>
 </pre>
@@ -2358,7 +2551,8 @@ way must be freed using <code><a href="#XML_MemFree"
 >XML_MemFree</a></code>.
 >XML_MemFree</a></code>.
 </div>
 </div>
 
 
-<pre class="fcndec" id="XML_MemRealloc">
+<h4 id="XML_MemRealloc">XML_MemRealloc</h4>
+<pre class="fcndec">
 void * XMLCALL
 void * XMLCALL
 XML_MemRealloc(XML_Parser parser, void *ptr, size_t size);
 XML_MemRealloc(XML_Parser parser, void *ptr, size_t size);
 </pre>
 </pre>
@@ -2377,7 +2571,8 @@ original block.  Memory allocated in this way must be freed using
 >XML_MemFree</a></code>.
 >XML_MemFree</a></code>.
 </div>
 </div>
 
 
-<pre class="fcndec" id="XML_MemFree">
+<h4 id="XML_MemFree">XML_MemFree</h4>
+<pre class="fcndec">
 void XMLCALL
 void XMLCALL
 XML_MemFree(XML_Parser parser, void *ptr);
 XML_MemFree(XML_Parser parser, void *ptr);
 </pre>
 </pre>
@@ -2388,9 +2583,12 @@ have been allocated by <code><a href="#XML_MemMalloc"
 </div>
 </div>
 
 
 <hr />
 <hr />
-<p><a href="http://validator.w3.org/check/referer"><img
-        src="valid-xhtml10.png" alt="Valid XHTML 1.0!"
-        height="31" width="88" class="noborder" /></a></p>
+
+  <div class="footer">
+    Found a bug in the documentation?
+    <a href="https://github.com/libexpat/libexpat/issues">Please file a bug report.</a>
+  </div>
+
 </div>
 </div>
 </body>
 </body>
 </html>
 </html>

+ 40 - 94
libs/expat/doc/style.css

@@ -1,101 +1,47 @@
+/*
+                            __  __            _
+                         ___\ \/ /_ __   __ _| |_
+                        / _ \\  /| '_ \ / _` | __|
+                       |  __//  \| |_) | (_| | |_
+                        \___/_/\_\ .__/ \__,_|\__|
+                                 |_| XML parser
+
+   Copyright (c) 2000      Clark Cooper <[email protected]>
+   Copyright (c) 2000-2004 Fred L. Drake, Jr. <[email protected]>
+   Copyright (c) 2021      Sebastian Pipping <[email protected]>
+   Licensed under the MIT license:
+
+   Permission is  hereby granted,  free of charge,  to any  person obtaining
+   a  copy  of  this  software   and  associated  documentation  files  (the
+   "Software"),  to  deal in  the  Software  without restriction,  including
+   without  limitation the  rights  to use,  copy,  modify, merge,  publish,
+   distribute, sublicense, and/or sell copies of the Software, and to permit
+   persons  to whom  the Software  is  furnished to  do so,  subject to  the
+   following conditions:
+
+   The above copyright  notice and this permission notice  shall be included
+   in all copies or substantial portions of the Software.
+
+   THE  SOFTWARE  IS  PROVIDED  "AS  IS",  WITHOUT  WARRANTY  OF  ANY  KIND,
+   EXPRESS  OR IMPLIED,  INCLUDING  BUT  NOT LIMITED  TO  THE WARRANTIES  OF
+   MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
+   NO EVENT SHALL THE AUTHORS OR  COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+   DAMAGES OR  OTHER LIABILITY, WHETHER  IN AN  ACTION OF CONTRACT,  TORT OR
+   OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+   USE OR OTHER DEALINGS IN THE SOFTWARE.
+*/
+
+/* Stop not using half the screen */
 body {
 body {
-  background-color: white;
-  border: 0px;
-  margin: 0px;
-  padding: 0px;
-}
-
-.corner {
-  width: 200px;
-  height: 80px;
-  text-align: center;
-}
-
-.banner {
-  background-color: rgb(110,139,61);
-  color: rgb(255,236,176);
-  padding-left: 2em;
-}
-
-.banner h1 {
-  font-size: 200%;
-}
-
-.content {
-  padding: 0em 2em 1em 2em;
-}
-
-.releaseno {
-  background-color: rgb(110,139,61);
-  color: rgb(255,236,176);
-  padding-bottom: 0.3em;
-  padding-top: 0.5em;
-  text-align: center;
-  font-weight: bold;
-}
-
-.noborder {
-  border-width: 0px;
-}
-
-.eg {
-  padding-left: 1em;
-  padding-top: .5em;
-  padding-bottom: .5em;
-  border: solid thin;
-  margin: 1em 0;
-  background-color: tan;
-  margin-left: 2em;
-  margin-right: 10%;
-}
-
-.pseudocode {
-  padding-left: 1em;
-  padding-top: .5em;
-  padding-bottom: .5em;
-  border: solid thin;
-  margin: 1em 0;
-  background-color: rgb(250,220,180);
-  margin-left: 2em;
-  margin-right: 10%;
-}
-
-.handler {
-  width: 100%;
-  border-top-width: thin;  
-  margin-bottom: 1em;
-}
-
-.handler p {
-  margin-left: 2em;
-}
-
-.setter {
-  font-weight: bold;
-}
-
-.signature {
-  color: navy;
-}
-
-.fcndec {
-  width: 100%;
-  border-top-width: thin;
-  font-weight: bold;
-}
-
-.fcndef {
-  margin-left: 2em;
-  margin-bottom: 2em;
-}
-
-dd {
-  margin-bottom: 2em;
+  max-width: none; /* was: 80ch */
 }
 }
 
 
 .cpp-symbols dt {
 .cpp-symbols dt {
   font-family: monospace;
   font-family: monospace;
 }
 }
-.cpp-symbols dd {
-  margin-bottom: 1em;
+
+/* Resemble style of <footer> which is not part of xhtml1-strict */
+.footer {
+  font-size: var(--ok-fs-5);
+  color: var(--ok-tc-1);
 }
 }

BIN
libs/expat/doc/valid-xhtml10.png


+ 101 - 33
libs/expat/doc/xmlwf.1

@@ -5,7 +5,7 @@
 \\$2 \(la\\$1\(ra\\$3
 \\$2 \(la\\$1\(ra\\$3
 ..
 ..
 .if \n(.g .mso www.tmac
 .if \n(.g .mso www.tmac
-.TH XMLWF 1 "March 11, 2016" "" ""
+.TH XMLWF 1 "May 23, 2021" "" ""
 .SH NAME
 .SH NAME
 xmlwf \- Determines if an XML document is well-formed
 xmlwf \- Determines if an XML document is well-formed
 .SH SYNOPSIS
 .SH SYNOPSIS
@@ -15,7 +15,27 @@ xmlwf \- Determines if an XML document is well-formed
 \fBxmlwf\fR \kx
 \fBxmlwf\fR \kx
 .if (\nx>(\n(.l/2)) .nr x (\n(.l/5)
 .if (\nx>(\n(.l/2)) .nr x (\n(.l/5)
 'in \n(.iu+\nxu
 'in \n(.iu+\nxu
-[\fB-s\fR] [\fB-n\fR] [\fB-p\fR] [\fB-x\fR] [\fB-e \fIencoding\fB\fR] [\fB-w\fR] [\fB-d \fIoutput-dir\fB\fR] [\fB-c\fR] [\fB-m\fR] [\fB-r\fR] [\fB-t\fR] [\fB-N\fR] [\fB-v\fR] [file ...]
+[\fIOPTIONS\fR] [\fIFILE\fR ...]
+'in \n(.iu-\nxu
+.ad b
+'hy
+'nh
+.fi
+.ad l
+\fBxmlwf\fR \kx
+.if (\nx>(\n(.l/2)) .nr x (\n(.l/5)
+'in \n(.iu+\nxu
+\fB-h\fR 
+'in \n(.iu-\nxu
+.ad b
+'hy
+'nh
+.fi
+.ad l
+\fBxmlwf\fR \kx
+.if (\nx>(\n(.l/2)) .nr x (\n(.l/5)
+'in \n(.iu+\nxu
+\fB-v\fR 
 'in \n(.iu-\nxu
 'in \n(.iu-\nxu
 .ad b
 .ad b
 'hy
 'hy
@@ -34,7 +54,7 @@ following rules:
 \(bu
 \(bu
 The file begins with an XML declaration. For instance,
 The file begins with an XML declaration. For instance,
 \*(T<<?xml version="1.0" standalone="yes"?>\*(T>.
 \*(T<<?xml version="1.0" standalone="yes"?>\*(T>.
-\fINOTE:\fR
+\fINOTE\fR:
 \fBxmlwf\fR does not currently
 \fBxmlwf\fR does not currently
 check for a valid XML declaration.
 check for a valid XML declaration.
 .TP 0.2i
 .TP 0.2i
@@ -62,10 +82,42 @@ it does not check the DTD. However, it does support
 external entities (see the \*(T<\fB\-x\fR\*(T> option).
 external entities (see the \*(T<\fB\-x\fR\*(T> option).
 .SH OPTIONS
 .SH OPTIONS
 When an option includes an argument, you may specify the argument either
 When an option includes an argument, you may specify the argument either
-separately ("\*(T<\fB\-d\fR\*(T> output") or concatenated with the
-option ("\*(T<\fB\-d\fR\*(T>output"). \fBxmlwf\fR
+separately ("\*(T<\fB\-d\fR\*(T> \fIoutput\fR") or concatenated with the
+option ("\*(T<\fB\-d\fR\*(T>\fIoutput\fR"). \fBxmlwf\fR
 supports both.
 supports both.
 .TP 
 .TP 
+\*(T<\fB\-a\fR\*(T> \fIfactor\fR
+Sets the maximum tolerated amplification factor
+for protection against billion laughs attacks (default: 100.0).
+The amplification factor is calculated as ..
+
+.nf
+
+            amplification := (direct + indirect) / direct
+          
+.fi
+
+\&.. while parsing, whereas
+<direct> is the number of bytes read
+from the primary document in parsing and
+<indirect> is the number of bytes
+added by expanding entities and reading of external DTD files,
+combined.
+
+\fINOTE\fR:
+If you ever need to increase this value for non-attack payload,
+please file a bug report.
+.TP 
+\*(T<\fB\-b\fR\*(T> \fIbytes\fR
+Sets the number of output bytes (including amplification)
+needed to activate protection against billion laughs attacks
+(default: 8 MiB).
+This can be thought of as an "activation threshold".
+
+\fINOTE\fR:
+If you ever need to increase this value for non-attack payload,
+please file a bug report.
+.TP 
 \*(T<\fB\-c\fR\*(T>
 \*(T<\fB\-c\fR\*(T>
 If the input file is well-formed and \fBxmlwf\fR
 If the input file is well-formed and \fBxmlwf\fR
 doesn't encounter any errors, the input file is simply copied to
 doesn't encounter any errors, the input file is simply copied to
@@ -73,7 +125,7 @@ the output directory unchanged.
 This implies no namespaces (turns off \*(T<\fB\-n\fR\*(T>) and
 This implies no namespaces (turns off \*(T<\fB\-n\fR\*(T>) and
 requires \*(T<\fB\-d\fR\*(T> to specify an output directory.
 requires \*(T<\fB\-d\fR\*(T> to specify an output directory.
 .TP 
 .TP 
-\*(T<\fB\-d output\-dir\fR\*(T>
+\*(T<\fB\-d\fR\*(T> \fIoutput-dir\fR
 Specifies a directory to contain transformed
 Specifies a directory to contain transformed
 representations of the input files.
 representations of the input files.
 By default, \*(T<\fB\-d\fR\*(T> outputs a canonical representation
 By default, \*(T<\fB\-d\fR\*(T> outputs a canonical representation
@@ -96,7 +148,7 @@ is treated equivalently to data.
 More on canonical XML can be found at
 More on canonical XML can be found at
 http://www.jclark.com/xml/canonxml.html .
 http://www.jclark.com/xml/canonxml.html .
 .TP 
 .TP 
-\*(T<\fB\-e encoding\fR\*(T>
+\*(T<\fB\-e\fR\*(T> \fIencoding\fR
 Specifies the character encoding for the document, overriding
 Specifies the character encoding for the document, overriding
 any document encoding declaration. \fBxmlwf\fR
 any document encoding declaration. \fBxmlwf\fR
 supports four built-in encodings:
 supports four built-in encodings:
@@ -106,6 +158,15 @@ supports four built-in encodings:
 \*(T<ISO\-8859\-1\*(T>.
 \*(T<ISO\-8859\-1\*(T>.
 Also see the \*(T<\fB\-w\fR\*(T> option.
 Also see the \*(T<\fB\-w\fR\*(T> option.
 .TP 
 .TP 
+\*(T<\fB\-k\fR\*(T>
+When processing multiple files, \fBxmlwf\fR
+by default halts after the the first file with an error.
+This tells \fBxmlwf\fR to report the error
+but to keep processing.
+This can be useful, for example, when testing a filter that converts
+many files to XML and you want to quickly find out which conversions
+failed.
+.TP 
 \*(T<\fB\-m\fR\*(T>
 \*(T<\fB\-m\fR\*(T>
 Outputs some strange sort of XML file that completely
 Outputs some strange sort of XML file that completely
 describes the input file, including character positions.
 describes the input file, including character positions.
@@ -121,7 +182,7 @@ This matches the example output used by the formal XML test cases.
 Requires \*(T<\fB\-d\fR\*(T> to specify an output file.
 Requires \*(T<\fB\-d\fR\*(T> to specify an output file.
 .TP 
 .TP 
 \*(T<\fB\-p\fR\*(T>
 \*(T<\fB\-p\fR\*(T>
-Tells xmlwf to process external DTDs and parameter
+Tells \fBxmlwf\fR to process external DTDs and parameter
 entities.
 entities.
 
 
 Normally \fBxmlwf\fR never parses parameter
 Normally \fBxmlwf\fR never parses parameter
@@ -165,7 +226,7 @@ then exits.
 Enables support for Windows code pages.
 Enables support for Windows code pages.
 Normally, \fBxmlwf\fR will throw an error if it
 Normally, \fBxmlwf\fR will throw an error if it
 runs across an encoding that it is not equipped to handle itself. With
 runs across an encoding that it is not equipped to handle itself. With
-\*(T<\fB\-w\fR\*(T>, xmlwf will try to use a Windows code
+\*(T<\fB\-w\fR\*(T>, \fBxmlwf\fR will try to use a Windows code
 page. See also \*(T<\fB\-e\fR\*(T>.
 page. See also \*(T<\fB\-e\fR\*(T>.
 .TP 
 .TP 
 \*(T<\fB\-x\fR\*(T>
 \*(T<\fB\-x\fR\*(T>
@@ -210,18 +271,33 @@ will run \fBxmlwf\fR on the file
 Older versions of \fBxmlwf\fR do not support
 Older versions of \fBxmlwf\fR do not support
 reading from standard input.
 reading from standard input.
 .SH OUTPUT
 .SH OUTPUT
-If an input file is not well-formed,
-\fBxmlwf\fR prints a single line describing
-the problem to standard output. If a file is well formed,
-\fBxmlwf\fR outputs nothing.
-Note that the result code is \fInot\fR set.
-.SH BUGS
-\fBxmlwf\fR returns a 0 - noerr result,
-even if the file is not well-formed. There is no good way for
-a program to use \fBxmlwf\fR to quickly
-check a file -- it must parse \fBxmlwf\fR's
-standard output.
+\fBxmlwf\fR outputs nothing for files which are problem-free.
+If any input file is not well-formed, or if the output for any
+input file cannot be opened, \fBxmlwf\fR prints a single
+line describing the problem to standard output.
 .PP
 .PP
+If the \*(T<\fB\-k\fR\*(T> option is not provided, \fBxmlwf\fR
+halts upon encountering a well-formedness or output-file error. 
+If \*(T<\fB\-k\fR\*(T> is provided, \fBxmlwf\fR continues
+processing the remaining input files, describing problems found with any of them.
+.SH "EXIT STATUS"
+For option \*(T<\fB\-v\fR\*(T> or \*(T<\fB\-h\fR\*(T>, \fBxmlwf\fR always exits with status code 0. For other cases, the following exit status codes are returned:
+.TP 
+\*(T<\fB0\fR\*(T>
+The input files are well-formed and the output (if requested) was written successfully.
+.TP 
+\*(T<\fB1\fR\*(T>
+An internal error occurred.
+.TP 
+\*(T<\fB2\fR\*(T>
+One or more input files were not well-formed or could not be parsed.
+.TP 
+\*(T<\fB3\fR\*(T>
+If using the \*(T<\fB\-d\fR\*(T> option, an error occurred opening an output file.
+.TP 
+\*(T<\fB4\fR\*(T>
+There was a command-line argument error in how \fBxmlwf\fR was invoked.
+.SH BUGS
 The errors should go to standard error, not standard output.
 The errors should go to standard error, not standard output.
 .PP
 .PP
 There should be a way to get \*(T<\fB\-d\fR\*(T> to send its
 There should be a way to get \*(T<\fB\-d\fR\*(T> to send its
@@ -232,24 +308,16 @@ I have no idea why anyone would want to use the
 \*(T<\fB\-d\fR\*(T>, \*(T<\fB\-c\fR\*(T>, and
 \*(T<\fB\-d\fR\*(T>, \*(T<\fB\-c\fR\*(T>, and
 \*(T<\fB\-m\fR\*(T> options. If someone could explain it to
 \*(T<\fB\-m\fR\*(T> options. If someone could explain it to
 me, I'd like to add this information to this manpage.
 me, I'd like to add this information to this manpage.
-.SH ALTERNATIVES
-Here are some XML validators on the web:
-
-.nf
-
-http://www.hcrc.ed.ac.uk/~richard/xml\-check.html
-http://www.stg.brown.edu/service/xmlvalid/
-http://www.scripting.com/frontier5/xml/code/xmlValidator.html
-http://www.xml.com/pub/a/tools/ruwf/check.html
-.fi
 .SH "SEE ALSO"
 .SH "SEE ALSO"
 .nf
 .nf
 
 
-The Expat home page:        http://www.libexpat.org/
-The W3 XML specification:   http://www.w3.org/TR/REC\-xml
+The Expat home page:                            https://libexpat.github.io/
+The W3 XML 1.0 specification (fourth edition):  https://www.w3.org/TR/2006/REC\-xml\-20060816/
+Billion laughs attack:                          https://en.wikipedia.org/wiki/Billion_laughs_attack
 .fi
 .fi
 .SH AUTHOR
 .SH AUTHOR
-This manual page was written by Scott Bronson <\*(T<[email protected]\*(T>> for
+This manual page was originally written by Scott Bronson <\*(T<[email protected]\*(T>>
+in December 2001 for
 the Debian GNU/Linux system (but may be used by others). Permission is
 the Debian GNU/Linux system (but may be used by others). Permission is
 granted to copy, distribute and/or modify this document under
 granted to copy, distribute and/or modify this document under
 the terms of the GNU Free Documentation
 the terms of the GNU Free Documentation

+ 148 - 62
libs/expat/doc/xmlwf.xml

@@ -1,11 +1,28 @@
-<!DOCTYPE refentry [
-  <!-- Fill in your name for FIRSTNAME and SURNAME. -->
+<!--
+                            __  __            _
+                         ___\ \/ /_ __   __ _| |_
+                        / _ \\  /| '_ \ / _` | __|
+                       |  __//  \| |_) | (_| | |_
+                        \___/_/\_\ .__/ \__,_|\__|
+                                 |_| XML parser
+
+   Copyright (c) 2001      Scott Bronson <[email protected]>
+   Copyright (c) 2002-2003 Fred L. Drake, Jr. <[email protected]>
+   Copyright (c) 2009      Karl Waclawek <[email protected]>
+   Copyright (c) 2016-2021 Sebastian Pipping <[email protected]>
+   Copyright (c) 2016      Ardo van Rangelrooij <[email protected]>
+   Copyright (c) 2017      Rhodri James <[email protected]>
+   Copyright (c) 2020      Joe Orton <[email protected]>
+   Copyright (c) 2021      Tim Bray <[email protected]>
+   Unlike most of Expat,
+   this file is copyrighted under the GNU Free Documentation License 1.1.
+-->
+<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
+          "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" [
   <!ENTITY dhfirstname "<firstname>Scott</firstname>">
   <!ENTITY dhfirstname "<firstname>Scott</firstname>">
   <!ENTITY dhsurname   "<surname>Bronson</surname>">
   <!ENTITY dhsurname   "<surname>Bronson</surname>">
   <!-- Please adjust the date whenever revising the manpage. -->
   <!-- Please adjust the date whenever revising the manpage. -->
-  <!ENTITY dhdate      "<date>March 11, 2016</date>">
-  <!-- SECTION should be 1-8, maybe w/ subsection other parameters are
-       allowed: see man(7), man(1). -->
+  <!ENTITY dhdate      "<date>May 23, 2021</date>">
   <!ENTITY dhsection   "<manvolnum>1</manvolnum>">
   <!ENTITY dhsection   "<manvolnum>1</manvolnum>">
   <!ENTITY dhemail     "<email>[email protected]</email>">
   <!ENTITY dhemail     "<email>[email protected]</email>">
   <!ENTITY dhusername  "Scott Bronson">
   <!ENTITY dhusername  "Scott Bronson">
@@ -44,25 +61,16 @@
   <refsynopsisdiv>
   <refsynopsisdiv>
     <cmdsynopsis>
     <cmdsynopsis>
       <command>&dhpackage;</command>
       <command>&dhpackage;</command>
-	  <arg><option>-s</option></arg>
-	  <arg><option>-n</option></arg>
-	  <arg><option>-p</option></arg>
-	  <arg><option>-x</option></arg>
-
-	  <arg><option>-e <replaceable>encoding</replaceable></option></arg>
-	  <arg><option>-w</option></arg>
-
-	  <arg><option>-d <replaceable>output-dir</replaceable></option></arg>
-	  <arg><option>-c</option></arg>
-	  <arg><option>-m</option></arg>
-
-	  <arg><option>-r</option></arg>
-	  <arg><option>-t</option></arg>
-          <arg><option>-N</option></arg>
-
-	  <arg><option>-v</option></arg>
-
-	  <arg>file ...</arg>
+      <arg><replaceable>OPTIONS</replaceable></arg>
+      <arg><replaceable>FILE</replaceable> ...</arg>
+    </cmdsynopsis>
+    <cmdsynopsis>
+      <command>&dhpackage;</command>
+      <arg choice="plain"><option>-h</option></arg>
+    </cmdsynopsis>
+    <cmdsynopsis>
+      <command>&dhpackage;</command>
+      <arg choice="plain"><option>-v</option></arg>
     </cmdsynopsis>
     </cmdsynopsis>
   </refsynopsisdiv>
   </refsynopsisdiv>
  
  
@@ -95,7 +103,7 @@
       <listitem><para>
       <listitem><para>
 	    The file begins with an XML declaration.  For instance,
 	    The file begins with an XML declaration.  For instance,
 		<literal>&lt;?xml version="1.0" standalone="yes"?&gt;</literal>.
 		<literal>&lt;?xml version="1.0" standalone="yes"?&gt;</literal>.
-		<emphasis>NOTE:</emphasis>
+		<emphasis>NOTE</emphasis>:
 		<command>&dhpackage;</command> does not currently
 		<command>&dhpackage;</command> does not currently
 		check for a valid XML declaration.
 		check for a valid XML declaration.
       </para></listitem>
       </para></listitem>
@@ -132,13 +140,57 @@
 
 
 <para>
 <para>
 When an option includes an argument, you may specify the argument either
 When an option includes an argument, you may specify the argument either
-separately ("<option>-d</option> output") or concatenated with the
-option ("<option>-d</option>output").  <command>&dhpackage;</command>
+separately ("<option>-d</option> <replaceable>output</replaceable>") or concatenated with the
+option ("<option>-d</option><replaceable>output</replaceable>").  <command>&dhpackage;</command>
 supports both.
 supports both.
 </para>
 </para>
 
 
     <variablelist>
     <variablelist>
 
 
+      <varlistentry>
+        <term><option>-a</option> <replaceable>factor</replaceable></term>
+        <listitem>
+          <para>
+            Sets the maximum tolerated amplification factor
+            for protection against billion laughs attacks (default: 100.0).
+            The amplification factor is calculated as ..
+          </para>
+          <literallayout>
+            amplification := (direct + indirect) / direct
+          </literallayout>
+          <para>
+            .. while parsing, whereas
+            &lt;direct&gt; is the number of bytes read
+              from the primary document in parsing and
+            &lt;indirect&gt; is the number of bytes
+              added by expanding entities and reading of external DTD files,
+              combined.
+          </para>
+          <para>
+            <emphasis>NOTE</emphasis>:
+            If you ever need to increase this value for non-attack payload,
+            please file a bug report.
+          </para>
+        </listitem>
+      </varlistentry>
+
+      <varlistentry>
+        <term><option>-b</option> <replaceable>bytes</replaceable></term>
+        <listitem>
+          <para>
+            Sets the number of output bytes (including amplification)
+            needed to activate protection against billion laughs attacks
+            (default: 8 MiB).
+            This can be thought of as an &quot;activation threshold&quot;.
+          </para>
+          <para>
+            <emphasis>NOTE</emphasis>:
+            If you ever need to increase this value for non-attack payload,
+            please file a bug report.
+          </para>
+        </listitem>
+      </varlistentry>
+
       <varlistentry>
       <varlistentry>
         <term><option>-c</option></term>
         <term><option>-c</option></term>
         <listitem>
         <listitem>
@@ -153,7 +205,7 @@ supports both.
       </varlistentry>
       </varlistentry>
 
 
       <varlistentry>
       <varlistentry>
-        <term><option>-d output-dir</option></term>
+        <term><option>-d</option> <replaceable>output-dir</replaceable></term>
         <listitem>
         <listitem>
 		<para>
 		<para>
   Specifies a directory to contain transformed
   Specifies a directory to contain transformed
@@ -184,7 +236,7 @@ supports both.
       </varlistentry>
       </varlistentry>
 
 
       <varlistentry>
       <varlistentry>
-        <term><option>-e encoding</option></term>
+        <term><option>-e</option> <replaceable>encoding</replaceable></term>
         <listitem>
         <listitem>
 		<para>
 		<para>
    Specifies the character encoding for the document, overriding
    Specifies the character encoding for the document, overriding
@@ -199,6 +251,21 @@ supports both.
         </listitem>
         </listitem>
       </varlistentry>
       </varlistentry>
 
 
+      <varlistentry>
+        <term><option>-k</option></term>
+        <listitem>
+          <para>
+            When processing multiple files, <command>&dhpackage;</command>
+            by default halts after the the first file with an error.
+            This tells <command>&dhpackage;</command> to report the error
+            but to keep processing.
+            This can be useful, for example, when testing a filter that converts
+            many files to XML and you want to quickly find out which conversions
+            failed.
+          </para>
+        </listitem>
+      </varlistentry>
+
       <varlistentry>
       <varlistentry>
         <term><option>-m</option></term>
         <term><option>-m</option></term>
         <listitem>
         <listitem>
@@ -235,7 +302,7 @@ supports both.
         <term><option>-p</option></term>
         <term><option>-p</option></term>
         <listitem>
         <listitem>
 		<para>
 		<para>
-    Tells xmlwf to process external DTDs and parameter
+    Tells <command>&dhpackage;</command> to process external DTDs and parameter
     entities.
     entities.
 	 </para>
 	 </para>
 	 <para>
 	 <para>
@@ -292,7 +359,7 @@ supports both.
 	   </para>
 	   </para>
         </listitem>
         </listitem>
       </varlistentry>
       </varlistentry>
-
+      
       <varlistentry>
       <varlistentry>
         <term><option>-v</option></term>
         <term><option>-v</option></term>
         <listitem>
         <listitem>
@@ -311,7 +378,7 @@ supports both.
   Enables support for Windows code pages.
   Enables support for Windows code pages.
   Normally, <command>&dhpackage;</command> will throw an error if it
   Normally, <command>&dhpackage;</command> will throw an error if it
   runs across an encoding that it is not equipped to handle itself.  With
   runs across an encoding that it is not equipped to handle itself.  With
-  <option>-w</option>, &dhpackage; will try to use a Windows code
+  <option>-w</option>, <command>&dhpackage;</command> will try to use a Windows code
   page.  See also <option>-e</option>.
   page.  See also <option>-e</option>.
 	   </para>
 	   </para>
         </listitem>
         </listitem>
@@ -379,23 +446,55 @@ supports both.
   <refsect1>
   <refsect1>
   <title>OUTPUT</title>
   <title>OUTPUT</title>
     <para>
     <para>
-	If an input file is not well-formed,
-	<command>&dhpackage;</command> prints a single line describing
-	the problem to standard output.  If a file is well formed,
-	<command>&dhpackage;</command> outputs nothing.
-	Note that the result code is <emphasis>not</emphasis> set.
+	<command>&dhpackage;</command> outputs nothing for files which are problem-free.
+        If any input file is not well-formed, or if the output for any
+	input file cannot be opened, <command>&dhpackage;</command> prints a single
+	line describing	the problem to standard output.
+    </para>
+    <para>
+        If the <option>-k</option> option is not provided, <command>&dhpackage;</command>
+	halts upon encountering a well-formedness or output-file error. 
+	If <option>-k</option> is provided, <command>&dhpackage;</command> continues
+	processing the remaining input files, describing problems found with any of them.
+    </para>
+  </refsect1>
+
+  <refsect1>
+  <title>EXIT STATUS</title>
+    <para>For option <option>-v</option> or <option>-h</option>, <command>&dhpackage;</command> always exits with status code 0.  For other cases, the following exit status codes are returned:
+    <variablelist>
+      <varlistentry>
+        <term><option>0</option></term>
+        <listitem><para>The input files are well-formed and the output (if requested) was written successfully.</para>
+        </listitem>
+      </varlistentry>
+      <varlistentry>
+        <term><option>1</option></term>
+        <listitem><para>An internal error occurred.</para>
+        </listitem>
+      </varlistentry>
+      <varlistentry>
+        <term><option>2</option></term>
+        <listitem><para>One or more input files were not well-formed or could not be parsed.</para>
+        </listitem>
+      </varlistentry>
+      <varlistentry>
+        <term><option>3</option></term>
+        <listitem><para>If using the <option>-d</option> option, an error occurred opening an output file.</para>
+        </listitem>
+      </varlistentry>
+      <varlistentry>
+        <term><option>4</option></term>
+        <listitem><para>There was a command-line argument error in how <command>&dhpackage;</command> was invoked.</para>
+        </listitem>
+      </varlistentry>
+    </variablelist>
 	</para>
 	</para>
   </refsect1>
   </refsect1>
+
   
   
   <refsect1>
   <refsect1>
     <title>BUGS</title>
     <title>BUGS</title>
-	<para>
-	<command>&dhpackage;</command> returns a 0 - noerr result,
-	even if the file is not well-formed.  There is no good way for
-	a program to use <command>&dhpackage;</command> to quickly
-	check a file -- it must parse <command>&dhpackage;</command>'s
-	standard output.
-	</para>
 	<para>
 	<para>
 	The errors should go to standard error, not standard output.
 	The errors should go to standard error, not standard output.
 	</para>
 	</para>
@@ -412,28 +511,14 @@ supports both.
 	</para>
 	</para>
   </refsect1>
   </refsect1>
 
 
-  <refsect1>
-    <title>ALTERNATIVES</title>
-	<para>
-	  Here are some XML validators on the web:
-
-<literallayout>
-http://www.hcrc.ed.ac.uk/~richard/xml-check.html
-http://www.stg.brown.edu/service/xmlvalid/
-http://www.scripting.com/frontier5/xml/code/xmlValidator.html
-http://www.xml.com/pub/a/tools/ruwf/check.html
-</literallayout>
-
-		 </para>
-  </refsect1>
-
   <refsect1>
   <refsect1>
     <title>SEE ALSO</title>
     <title>SEE ALSO</title>
 	<para>
 	<para>
 
 
 <literallayout>
 <literallayout>
-The Expat home page:        http://www.libexpat.org/
-The W3 XML specification:   http://www.w3.org/TR/REC-xml
+The Expat home page:                            https://libexpat.github.io/
+The W3 XML 1.0 specification (fourth edition):  https://www.w3.org/TR/2006/REC-xml-20060816/
+Billion laughs attack:                          https://en.wikipedia.org/wiki/Billion_laughs_attack
 </literallayout>
 </literallayout>
 
 
 	</para>
 	</para>
@@ -442,7 +527,8 @@ The W3 XML specification:   http://www.w3.org/TR/REC-xml
   <refsect1>
   <refsect1>
     <title>AUTHOR</title>
     <title>AUTHOR</title>
     <para>
     <para>
-	  This manual page was written by &dhusername; &dhemail; for
+      This manual page was originally written by &dhusername; &dhemail;
+      in December 2001 for
       the &debian; system (but may be used by others).  Permission is
       the &debian; system (but may be used by others).  Permission is
       granted to copy, distribute and/or modify this document under
       granted to copy, distribute and/or modify this document under
       the terms of the <acronym>GNU</acronym> Free Documentation
       the terms of the <acronym>GNU</acronym> Free Documentation

+ 3 - 2
libs/expat/examples/Makefile.am

@@ -6,7 +6,8 @@
 #                      \___/_/\_\ .__/ \__,_|\__|
 #                      \___/_/\_\ .__/ \__,_|\__|
 #                               |_| XML parser
 #                               |_| XML parser
 #
 #
-# Copyright (c) 2017 Expat development team
+# Copyright (c) 2017 Sebastian Pipping <[email protected]>
+# Copyright (c) 2020 Jeffrey Walton <[email protected]>
 # Licensed under the MIT license:
 # Licensed under the MIT license:
 #
 #
 # Permission is  hereby granted,  free of charge,  to any  person obtaining
 # Permission is  hereby granted,  free of charge,  to any  person obtaining
@@ -28,7 +29,7 @@
 # OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
 # OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
 # USE OR OTHER DEALINGS IN THE SOFTWARE.
 # USE OR OTHER DEALINGS IN THE SOFTWARE.
 
 
-AM_CPPFLAGS = -I$(srcdir)/../lib
+AM_CPPFLAGS = @AM_CPPFLAGS@ -I$(srcdir)/../lib
 
 
 noinst_PROGRAMS = elements outline
 noinst_PROGRAMS = elements outline
 
 

+ 22 - 4
libs/expat/examples/Makefile.in

@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.16.1 from Makefile.am.
+# Makefile.in generated by automake 1.16.3 from Makefile.am.
 # @configure_input@
 # @configure_input@
 
 
-# Copyright (C) 1994-2018 Free Software Foundation, Inc.
+# Copyright (C) 1994-2020 Free Software Foundation, Inc.
 
 
 # This Makefile.in is free software; the Free Software Foundation
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # gives unlimited permission to copy and/or distribute it,
@@ -22,7 +22,8 @@
 #                      \___/_/\_\ .__/ \__,_|\__|
 #                      \___/_/\_\ .__/ \__,_|\__|
 #                               |_| XML parser
 #                               |_| XML parser
 #
 #
-# Copyright (c) 2017 Expat development team
+# Copyright (c) 2017 Sebastian Pipping <[email protected]>
+# Copyright (c) 2020 Jeffrey Walton <[email protected]>
 # Licensed under the MIT license:
 # Licensed under the MIT license:
 #
 #
 # Permission is  hereby granted,  free of charge,  to any  person obtaining
 # Permission is  hereby granted,  free of charge,  to any  person obtaining
@@ -217,7 +218,11 @@ am__DIST_COMMON = $(srcdir)/Makefile.in \
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AMTAR = @AMTAR@
+AM_CFLAGS = @AM_CFLAGS@
+AM_CPPFLAGS = @AM_CPPFLAGS@ -I$(srcdir)/../lib
+AM_CXXFLAGS = @AM_CXXFLAGS@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AM_LDFLAGS = @AM_LDFLAGS@
 AR = @AR@
 AR = @AR@
 AS = @AS@
 AS = @AS@
 AUTOCONF = @AUTOCONF@
 AUTOCONF = @AUTOCONF@
@@ -245,6 +250,13 @@ ECHO_N = @ECHO_N@
 ECHO_T = @ECHO_T@
 ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
 EXEEXT = @EXEEXT@
+EXPAT_ATTR_INFO = @EXPAT_ATTR_INFO@
+EXPAT_CHAR_TYPE = @EXPAT_CHAR_TYPE@
+EXPAT_CONTEXT_BYTES = @EXPAT_CONTEXT_BYTES@
+EXPAT_DTD = @EXPAT_DTD@
+EXPAT_LARGE_SIZE = @EXPAT_LARGE_SIZE@
+EXPAT_MIN_SIZE = @EXPAT_MIN_SIZE@
+EXPAT_NS = @EXPAT_NS@
 FGREP = @FGREP@
 FGREP = @FGREP@
 FILEMAP = @FILEMAP@
 FILEMAP = @FILEMAP@
 GREP = @GREP@
 GREP = @GREP@
@@ -257,6 +269,7 @@ LD = @LD@
 LDFLAGS = @LDFLAGS@
 LDFLAGS = @LDFLAGS@
 LIBAGE = @LIBAGE@
 LIBAGE = @LIBAGE@
 LIBCURRENT = @LIBCURRENT@
 LIBCURRENT = @LIBCURRENT@
+LIBDIR_BASENAME = @LIBDIR_BASENAME@
 LIBOBJS = @LIBOBJS@
 LIBOBJS = @LIBOBJS@
 LIBREVISION = @LIBREVISION@
 LIBREVISION = @LIBREVISION@
 LIBS = @LIBS@
 LIBS = @LIBS@
@@ -286,8 +299,12 @@ RANLIB = @RANLIB@
 SED = @SED@
 SED = @SED@
 SET_MAKE = @SET_MAKE@
 SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
 SHELL = @SHELL@
+SO_MAJOR = @SO_MAJOR@
+SO_MINOR = @SO_MINOR@
+SO_PATCH = @SO_PATCH@
 STRIP = @STRIP@
 STRIP = @STRIP@
 VERSION = @VERSION@
 VERSION = @VERSION@
+_EXPAT_OUTPUT_NAME = @_EXPAT_OUTPUT_NAME@
 abs_builddir = @abs_builddir@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
 abs_srcdir = @abs_srcdir@
 abs_top_builddir = @abs_top_builddir@
 abs_top_builddir = @abs_top_builddir@
@@ -296,6 +313,7 @@ ac_ct_AR = @ac_ct_AR@
 ac_ct_CC = @ac_ct_CC@
 ac_ct_CC = @ac_ct_CC@
 ac_ct_CXX = @ac_ct_CXX@
 ac_ct_CXX = @ac_ct_CXX@
 ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
 ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+ac_cv_sizeof_void_p = @ac_cv_sizeof_void_p@
 am__include = @am__include@
 am__include = @am__include@
 am__leading_dot = @am__leading_dot@
 am__leading_dot = @am__leading_dot@
 am__quote = @am__quote@
 am__quote = @am__quote@
@@ -333,6 +351,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
 srcdir = @srcdir@
@@ -341,7 +360,6 @@ target_alias = @target_alias@
 top_build_prefix = @top_build_prefix@
 top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 top_srcdir = @top_srcdir@
-AM_CPPFLAGS = -I$(srcdir)/../lib
 elements_SOURCES = elements.c
 elements_SOURCES = elements.c
 elements_LDADD = ../lib/libexpat.la
 elements_LDADD = ../lib/libexpat.la
 outline_SOURCES = outline.c
 outline_SOURCES = outline.c

+ 6 - 1
libs/expat/examples/elements.c

@@ -11,7 +11,12 @@
                                  |_| XML parser
                                  |_| XML parser
 
 
    Copyright (c) 1997-2000 Thai Open Source Software Center Ltd
    Copyright (c) 1997-2000 Thai Open Source Software Center Ltd
-   Copyright (c) 2000-2017 Expat development team
+   Copyright (c) 2001-2003 Fred L. Drake, Jr. <[email protected]>
+   Copyright (c) 2004-2006 Karl Waclawek <[email protected]>
+   Copyright (c) 2005-2007 Steven Solie <[email protected]>
+   Copyright (c) 2016-2019 Sebastian Pipping <[email protected]>
+   Copyright (c) 2017      Rhodri James <[email protected]>
+   Copyright (c) 2019      Zhongyuan Zhou <[email protected]>
    Licensed under the MIT license:
    Licensed under the MIT license:
 
 
    Permission is  hereby granted,  free of charge,  to any  person obtaining
    Permission is  hereby granted,  free of charge,  to any  person obtaining

+ 6 - 2
libs/expat/examples/outline.c

@@ -8,8 +8,12 @@
                         \___/_/\_\ .__/ \__,_|\__|
                         \___/_/\_\ .__/ \__,_|\__|
                                  |_| XML parser
                                  |_| XML parser
 
 
-   Copyright (c) 1997-2000 Thai Open Source Software Center Ltd
-   Copyright (c) 2000-2017 Expat development team
+   Copyright (c) 2000      Clark Cooper <[email protected]>
+   Copyright (c) 2001-2003 Fred L. Drake, Jr. <[email protected]>
+   Copyright (c) 2005-2007 Steven Solie <[email protected]>
+   Copyright (c) 2005-2006 Karl Waclawek <[email protected]>
+   Copyright (c) 2016-2019 Sebastian Pipping <[email protected]>
+   Copyright (c) 2017      Rhodri James <[email protected]>
    Licensed under the MIT license:
    Licensed under the MIT license:
 
 
    Permission is  hereby granted,  free of charge,  to any  person obtaining
    Permission is  hereby granted,  free of charge,  to any  person obtaining

+ 2 - 2
libs/expat/expat.pc.in

@@ -3,9 +3,9 @@ exec_prefix=@exec_prefix@
 libdir=@libdir@
 libdir=@libdir@
 includedir=@includedir@
 includedir=@includedir@
 
 
-Name: expat
+Name: @_EXPAT_OUTPUT_NAME@
 Version: @PACKAGE_VERSION@
 Version: @PACKAGE_VERSION@
 Description: expat XML parser
 Description: expat XML parser
 URL: http://www.libexpat.org
 URL: http://www.libexpat.org
-Libs: -L${libdir} -lexpat
+Libs: -L${libdir} -l@_EXPAT_OUTPUT_NAME@
 Cflags: -I${includedir}
 Cflags: -I${includedir}

+ 5 - 5
libs/expat/expat_config.h

@@ -23,7 +23,7 @@
 #define HAVE_GETPAGESIZE 1
 #define HAVE_GETPAGESIZE 1
 
 
 /* Define to 1 if you have the `getrandom' function. */
 /* Define to 1 if you have the `getrandom' function. */
-#define HAVE_GETRANDOM 1
+#undef HAVE_GETRANDOM
 
 
 /* Define to 1 if you have the <inttypes.h> header file. */
 /* Define to 1 if you have the <inttypes.h> header file. */
 #define HAVE_INTTYPES_H 1
 #define HAVE_INTTYPES_H 1
@@ -50,7 +50,7 @@
 #define HAVE_STRING_H 1
 #define HAVE_STRING_H 1
 
 
 /* Define to 1 if you have `syscall' and `SYS_getrandom'. */
 /* Define to 1 if you have `syscall' and `SYS_getrandom'. */
-#define HAVE_SYSCALL_GETRANDOM 1
+#undef HAVE_SYSCALL_GETRANDOM
 
 
 /* Define to 1 if you have the <sys/param.h> header file. */
 /* Define to 1 if you have the <sys/param.h> header file. */
 #define HAVE_SYS_PARAM_H 1
 #define HAVE_SYS_PARAM_H 1
@@ -77,7 +77,7 @@
 #define PACKAGE_NAME "expat"
 #define PACKAGE_NAME "expat"
 
 
 /* Define to the full name and version of this package. */
 /* Define to the full name and version of this package. */
-#define PACKAGE_STRING "expat 2.2.9"
+#define PACKAGE_STRING "expat 2.4.1"
 
 
 /* Define to the one symbol short name of this package. */
 /* Define to the one symbol short name of this package. */
 #define PACKAGE_TARNAME "expat"
 #define PACKAGE_TARNAME "expat"
@@ -86,13 +86,13 @@
 #define PACKAGE_URL ""
 #define PACKAGE_URL ""
 
 
 /* Define to the version of this package. */
 /* Define to the version of this package. */
-#define PACKAGE_VERSION "2.2.9"
+#define PACKAGE_VERSION "2.4.1"
 
 
 /* Define to 1 if you have the ANSI C header files. */
 /* Define to 1 if you have the ANSI C header files. */
 #define STDC_HEADERS 1
 #define STDC_HEADERS 1
 
 
 /* Version number of package */
 /* Version number of package */
-#define VERSION "2.2.9"
+#define VERSION "2.4.1"
 
 
 /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
 /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
    significant byte first (like Motorola and SPARC, unlike Intel). */
    significant byte first (like Motorola and SPARC, unlike Intel). */

+ 1 - 1
libs/expat/fix-xmltest-log.sh

@@ -6,7 +6,7 @@
 #                      \___/_/\_\ .__/ \__,_|\__|
 #                      \___/_/\_\ .__/ \__,_|\__|
 #                               |_| XML parser
 #                               |_| XML parser
 #
 #
-# Copyright (c) 2019 Expat development team
+# Copyright (c) 2019 Sebastian Pipping <[email protected]>
 # Licensed under the MIT license:
 # Licensed under the MIT license:
 #
 #
 # Permission is  hereby granted,  free of charge,  to any  person obtaining
 # Permission is  hereby granted,  free of charge,  to any  person obtaining

+ 13 - 2
libs/expat/lib/Makefile.am

@@ -6,7 +6,9 @@
 #                      \___/_/\_\ .__/ \__,_|\__|
 #                      \___/_/\_\ .__/ \__,_|\__|
 #                               |_| XML parser
 #                               |_| XML parser
 #
 #
-# Copyright (c) 2017 Expat development team
+# Copyright (c) 2017-2021 Sebastian Pipping <[email protected]>
+# Copyright (c) 2017      Tomasz Kłoczko <[email protected]>
+# Copyright (c) 2019      David Loffredo <[email protected]>
 # Licensed under the MIT license:
 # Licensed under the MIT license:
 #
 #
 # Permission is  hereby granted,  free of charge,  to any  person obtaining
 # Permission is  hereby granted,  free of charge,  to any  person obtaining
@@ -34,16 +36,25 @@ include_HEADERS = \
     expat_external.h
     expat_external.h
 
 
 lib_LTLIBRARIES = libexpat.la
 lib_LTLIBRARIES = libexpat.la
+noinst_LTLIBRARIES = libexpatinternal.la
 
 
 libexpat_la_LDFLAGS = \
 libexpat_la_LDFLAGS = \
+    @AM_LDFLAGS@ \
     -no-undefined \
     -no-undefined \
     -version-info @LIBCURRENT@:@LIBREVISION@:@LIBAGE@
     -version-info @LIBCURRENT@:@LIBREVISION@:@LIBAGE@
 
 
-libexpat_la_SOURCES = \
+libexpat_la_SOURCES =
+
+# This layer of indirection allows
+# the test suite to access internal symbols
+# despite compiling with -fvisibility=hidden
+libexpatinternal_la_SOURCES = \
     xmlparse.c \
     xmlparse.c \
     xmltok.c \
     xmltok.c \
     xmlrole.c
     xmlrole.c
 
 
+libexpat_la_LIBADD = libexpatinternal.la
+
 doc_DATA = \
 doc_DATA = \
     ../AUTHORS \
     ../AUTHORS \
     ../Changes
     ../Changes

+ 66 - 20
libs/expat/lib/Makefile.in

@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.16.1 from Makefile.am.
+# Makefile.in generated by automake 1.16.3 from Makefile.am.
 # @configure_input@
 # @configure_input@
 
 
-# Copyright (C) 1994-2018 Free Software Foundation, Inc.
+# Copyright (C) 1994-2020 Free Software Foundation, Inc.
 
 
 # This Makefile.in is free software; the Free Software Foundation
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # gives unlimited permission to copy and/or distribute it,
@@ -22,7 +22,9 @@
 #                      \___/_/\_\ .__/ \__,_|\__|
 #                      \___/_/\_\ .__/ \__,_|\__|
 #                               |_| XML parser
 #                               |_| XML parser
 #
 #
-# Copyright (c) 2017 Expat development team
+# Copyright (c) 2017-2021 Sebastian Pipping <[email protected]>
+# Copyright (c) 2017      Tomasz Kłoczko <[email protected]>
+# Copyright (c) 2019      David Loffredo <[email protected]>
 # Licensed under the MIT license:
 # Licensed under the MIT license:
 #
 #
 # Permission is  hereby granted,  free of charge,  to any  person obtaining
 # Permission is  hereby granted,  free of charge,  to any  person obtaining
@@ -171,9 +173,9 @@ am__uninstall_files_from_dir = { \
   }
   }
 am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(docdir)" \
 am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(docdir)" \
 	"$(DESTDIR)$(includedir)"
 	"$(DESTDIR)$(includedir)"
-LTLIBRARIES = $(lib_LTLIBRARIES)
-libexpat_la_LIBADD =
-am_libexpat_la_OBJECTS = xmlparse.lo xmltok.lo xmlrole.lo
+LTLIBRARIES = $(lib_LTLIBRARIES) $(noinst_LTLIBRARIES)
+libexpat_la_DEPENDENCIES = libexpatinternal.la
+am_libexpat_la_OBJECTS =
 libexpat_la_OBJECTS = $(am_libexpat_la_OBJECTS)
 libexpat_la_OBJECTS = $(am_libexpat_la_OBJECTS)
 AM_V_lt = $(am__v_lt_@AM_V@)
 AM_V_lt = $(am__v_lt_@AM_V@)
 am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
 am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
@@ -182,6 +184,9 @@ am__v_lt_1 =
 libexpat_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
 libexpat_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
 	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
 	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
 	$(libexpat_la_LDFLAGS) $(LDFLAGS) -o $@
 	$(libexpat_la_LDFLAGS) $(LDFLAGS) -o $@
+libexpatinternal_la_LIBADD =
+am_libexpatinternal_la_OBJECTS = xmlparse.lo xmltok.lo xmlrole.lo
+libexpatinternal_la_OBJECTS = $(am_libexpatinternal_la_OBJECTS)
 AM_V_P = $(am__v_P_@AM_V@)
 AM_V_P = $(am__v_P_@AM_V@)
 am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
 am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
 am__v_P_0 = false
 am__v_P_0 = false
@@ -218,8 +223,8 @@ AM_V_CCLD = $(am__v_CCLD_@AM_V@)
 am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
 am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
 am__v_CCLD_0 = @echo "  CCLD    " $@;
 am__v_CCLD_0 = @echo "  CCLD    " $@;
 am__v_CCLD_1 = 
 am__v_CCLD_1 = 
-SOURCES = $(libexpat_la_SOURCES)
-DIST_SOURCES = $(libexpat_la_SOURCES)
+SOURCES = $(libexpat_la_SOURCES) $(libexpatinternal_la_SOURCES)
+DIST_SOURCES = $(libexpat_la_SOURCES) $(libexpatinternal_la_SOURCES)
 am__can_run_installinfo = \
 am__can_run_installinfo = \
   case $$AM_UPDATE_INFO_DIR in \
   case $$AM_UPDATE_INFO_DIR in \
     n|no|NO) false;; \
     n|no|NO) false;; \
@@ -251,7 +256,11 @@ am__DIST_COMMON = $(srcdir)/Makefile.in \
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AMTAR = @AMTAR@
+AM_CFLAGS = @AM_CFLAGS@
+AM_CPPFLAGS = @AM_CPPFLAGS@
+AM_CXXFLAGS = @AM_CXXFLAGS@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AM_LDFLAGS = @AM_LDFLAGS@
 AR = @AR@
 AR = @AR@
 AS = @AS@
 AS = @AS@
 AUTOCONF = @AUTOCONF@
 AUTOCONF = @AUTOCONF@
@@ -279,6 +288,13 @@ ECHO_N = @ECHO_N@
 ECHO_T = @ECHO_T@
 ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
 EXEEXT = @EXEEXT@
+EXPAT_ATTR_INFO = @EXPAT_ATTR_INFO@
+EXPAT_CHAR_TYPE = @EXPAT_CHAR_TYPE@
+EXPAT_CONTEXT_BYTES = @EXPAT_CONTEXT_BYTES@
+EXPAT_DTD = @EXPAT_DTD@
+EXPAT_LARGE_SIZE = @EXPAT_LARGE_SIZE@
+EXPAT_MIN_SIZE = @EXPAT_MIN_SIZE@
+EXPAT_NS = @EXPAT_NS@
 FGREP = @FGREP@
 FGREP = @FGREP@
 FILEMAP = @FILEMAP@
 FILEMAP = @FILEMAP@
 GREP = @GREP@
 GREP = @GREP@
@@ -291,6 +307,7 @@ LD = @LD@
 LDFLAGS = @LDFLAGS@
 LDFLAGS = @LDFLAGS@
 LIBAGE = @LIBAGE@
 LIBAGE = @LIBAGE@
 LIBCURRENT = @LIBCURRENT@
 LIBCURRENT = @LIBCURRENT@
+LIBDIR_BASENAME = @LIBDIR_BASENAME@
 LIBOBJS = @LIBOBJS@
 LIBOBJS = @LIBOBJS@
 LIBREVISION = @LIBREVISION@
 LIBREVISION = @LIBREVISION@
 LIBS = @LIBS@
 LIBS = @LIBS@
@@ -320,8 +337,12 @@ RANLIB = @RANLIB@
 SED = @SED@
 SED = @SED@
 SET_MAKE = @SET_MAKE@
 SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
 SHELL = @SHELL@
+SO_MAJOR = @SO_MAJOR@
+SO_MINOR = @SO_MINOR@
+SO_PATCH = @SO_PATCH@
 STRIP = @STRIP@
 STRIP = @STRIP@
 VERSION = @VERSION@
 VERSION = @VERSION@
+_EXPAT_OUTPUT_NAME = @_EXPAT_OUTPUT_NAME@
 abs_builddir = @abs_builddir@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
 abs_srcdir = @abs_srcdir@
 abs_top_builddir = @abs_top_builddir@
 abs_top_builddir = @abs_top_builddir@
@@ -330,6 +351,7 @@ ac_ct_AR = @ac_ct_AR@
 ac_ct_CC = @ac_ct_CC@
 ac_ct_CC = @ac_ct_CC@
 ac_ct_CXX = @ac_ct_CXX@
 ac_ct_CXX = @ac_ct_CXX@
 ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
 ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+ac_cv_sizeof_void_p = @ac_cv_sizeof_void_p@
 am__include = @am__include@
 am__include = @am__include@
 am__leading_dot = @am__leading_dot@
 am__leading_dot = @am__leading_dot@
 am__quote = @am__quote@
 am__quote = @am__quote@
@@ -367,6 +389,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
 srcdir = @srcdir@
@@ -381,15 +404,23 @@ include_HEADERS = \
     expat_external.h
     expat_external.h
 
 
 lib_LTLIBRARIES = libexpat.la
 lib_LTLIBRARIES = libexpat.la
+noinst_LTLIBRARIES = libexpatinternal.la
 libexpat_la_LDFLAGS = \
 libexpat_la_LDFLAGS = \
+    @AM_LDFLAGS@ \
     -no-undefined \
     -no-undefined \
     -version-info @LIBCURRENT@:@LIBREVISION@:@LIBAGE@
     -version-info @LIBCURRENT@:@LIBREVISION@:@LIBAGE@
 
 
-libexpat_la_SOURCES = \
+libexpat_la_SOURCES = 
+
+# This layer of indirection allows
+# the test suite to access internal symbols
+# despite compiling with -fvisibility=hidden
+libexpatinternal_la_SOURCES = \
     xmlparse.c \
     xmlparse.c \
     xmltok.c \
     xmltok.c \
     xmlrole.c
     xmlrole.c
 
 
+libexpat_la_LIBADD = libexpatinternal.la
 doc_DATA = \
 doc_DATA = \
     ../AUTHORS \
     ../AUTHORS \
     ../Changes
     ../Changes
@@ -483,9 +514,23 @@ clean-libLTLIBRARIES:
 	  rm -f $${locs}; \
 	  rm -f $${locs}; \
 	}
 	}
 
 
+clean-noinstLTLIBRARIES:
+	-test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
+	@list='$(noinst_LTLIBRARIES)'; \
+	locs=`for p in $$list; do echo $$p; done | \
+	      sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
+	      sort -u`; \
+	test -z "$$locs" || { \
+	  echo rm -f $${locs}; \
+	  rm -f $${locs}; \
+	}
+
 libexpat.la: $(libexpat_la_OBJECTS) $(libexpat_la_DEPENDENCIES) $(EXTRA_libexpat_la_DEPENDENCIES) 
 libexpat.la: $(libexpat_la_OBJECTS) $(libexpat_la_DEPENDENCIES) $(EXTRA_libexpat_la_DEPENDENCIES) 
 	$(AM_V_CCLD)$(libexpat_la_LINK) -rpath $(libdir) $(libexpat_la_OBJECTS) $(libexpat_la_LIBADD) $(LIBS)
 	$(AM_V_CCLD)$(libexpat_la_LINK) -rpath $(libdir) $(libexpat_la_OBJECTS) $(libexpat_la_LIBADD) $(LIBS)
 
 
+libexpatinternal.la: $(libexpatinternal_la_OBJECTS) $(libexpatinternal_la_DEPENDENCIES) $(EXTRA_libexpatinternal_la_DEPENDENCIES) 
+	$(AM_V_CCLD)$(LINK)  $(libexpatinternal_la_OBJECTS) $(libexpatinternal_la_LIBADD) $(LIBS)
+
 mostlyclean-compile:
 mostlyclean-compile:
 	-rm -f *.$(OBJEXT)
 	-rm -f *.$(OBJEXT)
 
 
@@ -696,7 +741,7 @@ maintainer-clean-generic:
 clean: clean-am
 clean: clean-am
 
 
 clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \
 clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \
-	mostlyclean-am
+	clean-noinstLTLIBRARIES mostlyclean-am
 
 
 distclean: distclean-am
 distclean: distclean-am
 		-rm -f ./$(DEPDIR)/xmlparse.Plo
 		-rm -f ./$(DEPDIR)/xmlparse.Plo
@@ -773,16 +818,17 @@ uninstall-am: uninstall-docDATA uninstall-includeHEADERS \
 .MAKE: install-am install-data-am install-strip
 .MAKE: install-am install-data-am install-strip
 
 
 .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \
 .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \
-	clean-generic clean-libLTLIBRARIES clean-libtool cscopelist-am \
-	ctags ctags-am distclean distclean-compile distclean-generic \
-	distclean-libtool distclean-tags distdir dvi dvi-am html \
-	html-am info info-am install install-am install-data \
-	install-data-am install-data-hook install-docDATA install-dvi \
-	install-dvi-am install-exec install-exec-am install-html \
-	install-html-am install-includeHEADERS install-info \
-	install-info-am install-libLTLIBRARIES install-man install-pdf \
-	install-pdf-am install-ps install-ps-am install-strip \
-	installcheck installcheck-am installdirs maintainer-clean \
+	clean-generic clean-libLTLIBRARIES clean-libtool \
+	clean-noinstLTLIBRARIES cscopelist-am ctags ctags-am distclean \
+	distclean-compile distclean-generic distclean-libtool \
+	distclean-tags distdir dvi dvi-am html html-am info info-am \
+	install install-am install-data install-data-am \
+	install-data-hook install-docDATA install-dvi install-dvi-am \
+	install-exec install-exec-am install-html install-html-am \
+	install-includeHEADERS install-info install-info-am \
+	install-libLTLIBRARIES install-man install-pdf install-pdf-am \
+	install-ps install-ps-am install-strip installcheck \
+	installcheck-am installdirs maintainer-clean \
 	maintainer-clean-generic mostlyclean mostlyclean-compile \
 	maintainer-clean-generic mostlyclean mostlyclean-compile \
 	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
 	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
 	tags tags-am uninstall uninstall-am uninstall-docDATA \
 	tags tags-am uninstall uninstall-am uninstall-docDATA \

+ 5 - 2
libs/expat/lib/ascii.h

@@ -6,8 +6,11 @@
                         \___/_/\_\ .__/ \__,_|\__|
                         \___/_/\_\ .__/ \__,_|\__|
                                  |_| XML parser
                                  |_| XML parser
 
 
-   Copyright (c) 1997-2000 Thai Open Source Software Center Ltd
-   Copyright (c) 2000-2017 Expat development team
+   Copyright (c) 1999-2000 Thai Open Source Software Center Ltd
+   Copyright (c) 2000      Clark Cooper <[email protected]>
+   Copyright (c) 2002      Fred L. Drake, Jr. <[email protected]>
+   Copyright (c) 2007      Karl Waclawek <[email protected]>
+   Copyright (c) 2017      Sebastian Pipping <[email protected]>
    Licensed under the MIT license:
    Licensed under the MIT license:
 
 
    Permission is  hereby granted,  free of charge,  to any  person obtaining
    Permission is  hereby granted,  free of charge,  to any  person obtaining

+ 3 - 1
libs/expat/lib/asciitab.h

@@ -7,7 +7,9 @@
                                  |_| XML parser
                                  |_| XML parser
 
 
    Copyright (c) 1997-2000 Thai Open Source Software Center Ltd
    Copyright (c) 1997-2000 Thai Open Source Software Center Ltd
-   Copyright (c) 2000-2017 Expat development team
+   Copyright (c) 2000      Clark Cooper <[email protected]>
+   Copyright (c) 2002      Fred L. Drake, Jr. <[email protected]>
+   Copyright (c) 2017      Sebastian Pipping <[email protected]>
    Licensed under the MIT license:
    Licensed under the MIT license:
 
 
    Permission is  hereby granted,  free of charge,  to any  person obtaining
    Permission is  hereby granted,  free of charge,  to any  person obtaining

+ 35 - 9
libs/expat/lib/expat.h

@@ -7,7 +7,14 @@
                                  |_| XML parser
                                  |_| XML parser
 
 
    Copyright (c) 1997-2000 Thai Open Source Software Center Ltd
    Copyright (c) 1997-2000 Thai Open Source Software Center Ltd
-   Copyright (c) 2000-2017 Expat development team
+   Copyright (c) 2000      Clark Cooper <[email protected]>
+   Copyright (c) 2000-2005 Fred L. Drake, Jr. <[email protected]>
+   Copyright (c) 2001-2002 Greg Stein <[email protected]>
+   Copyright (c) 2002-2016 Karl Waclawek <[email protected]>
+   Copyright (c) 2016-2021 Sebastian Pipping <[email protected]>
+   Copyright (c) 2016      Cristian Rodríguez <[email protected]>
+   Copyright (c) 2016      Thomas Beutlich <[email protected]>
+   Copyright (c) 2017      Rhodri James <[email protected]>
    Licensed under the MIT license:
    Licensed under the MIT license:
 
 
    Permission is  hereby granted,  free of charge,  to any  person obtaining
    Permission is  hereby granted,  free of charge,  to any  person obtaining
@@ -115,7 +122,11 @@ enum XML_Error {
   XML_ERROR_RESERVED_PREFIX_XMLNS,
   XML_ERROR_RESERVED_PREFIX_XMLNS,
   XML_ERROR_RESERVED_NAMESPACE_URI,
   XML_ERROR_RESERVED_NAMESPACE_URI,
   /* Added in 2.2.1. */
   /* Added in 2.2.1. */
-  XML_ERROR_INVALID_ARGUMENT
+  XML_ERROR_INVALID_ARGUMENT,
+  /* Added in 2.3.0. */
+  XML_ERROR_NO_BUFFER,
+  /* Added in 2.4.0. */
+  XML_ERROR_AMPLIFICATION_LIMIT_BREACH
 };
 };
 
 
 enum XML_Content_Type {
 enum XML_Content_Type {
@@ -318,7 +329,7 @@ typedef void(XMLCALL *XML_EndDoctypeDeclHandler)(void *userData);
 
 
    For internal entities (<!ENTITY foo "bar">), value will
    For internal entities (<!ENTITY foo "bar">), value will
    be non-NULL and systemId, publicID, and notationName will be NULL.
    be non-NULL and systemId, publicID, and notationName will be NULL.
-   The value string is NOT nul-terminated; the length is provided in
+   The value string is NOT null-terminated; the length is provided in
    the value_length argument. Since it is legal to have zero-length
    the value_length argument. Since it is legal to have zero-length
    values, do not use this argument to test for internal entities.
    values, do not use this argument to test for internal entities.
 
 
@@ -513,7 +524,7 @@ typedef struct {
    Otherwise it must return XML_STATUS_ERROR.
    Otherwise it must return XML_STATUS_ERROR.
 
 
    If info does not describe a suitable encoding, then the parser will
    If info does not describe a suitable encoding, then the parser will
-   return an XML_UNKNOWN_ENCODING error.
+   return an XML_ERROR_UNKNOWN_ENCODING error.
 */
 */
 typedef int(XMLCALL *XML_UnknownEncodingHandler)(void *encodingHandlerData,
 typedef int(XMLCALL *XML_UnknownEncodingHandler)(void *encodingHandlerData,
                                                  const XML_Char *name,
                                                  const XML_Char *name,
@@ -707,7 +718,7 @@ XML_GetBase(XML_Parser parser);
 /* Returns the number of the attribute/value pairs passed in last call
 /* Returns the number of the attribute/value pairs passed in last call
    to the XML_StartElementHandler that were specified in the start-tag
    to the XML_StartElementHandler that were specified in the start-tag
    rather than defaulted. Each attribute/value pair counts as 2; thus
    rather than defaulted. Each attribute/value pair counts as 2; thus
-   this correspondds to an index into the atts array passed to the
+   this corresponds to an index into the atts array passed to the
    XML_StartElementHandler.  Returns -1 if parser == NULL.
    XML_StartElementHandler.  Returns -1 if parser == NULL.
 */
 */
 XMLPARSEAPI(int)
 XMLPARSEAPI(int)
@@ -716,7 +727,7 @@ XML_GetSpecifiedAttributeCount(XML_Parser parser);
 /* Returns the index of the ID attribute passed in the last call to
 /* Returns the index of the ID attribute passed in the last call to
    XML_StartElementHandler, or -1 if there is no ID attribute or
    XML_StartElementHandler, or -1 if there is no ID attribute or
    parser == NULL.  Each attribute/value pair counts as 2; thus this
    parser == NULL.  Each attribute/value pair counts as 2; thus this
-   correspondds to an index into the atts array passed to the
+   corresponds to an index into the atts array passed to the
    XML_StartElementHandler.
    XML_StartElementHandler.
 */
 */
 XMLPARSEAPI(int)
 XMLPARSEAPI(int)
@@ -997,7 +1008,10 @@ enum XML_FeatureEnum {
   XML_FEATURE_SIZEOF_XML_LCHAR,
   XML_FEATURE_SIZEOF_XML_LCHAR,
   XML_FEATURE_NS,
   XML_FEATURE_NS,
   XML_FEATURE_LARGE_SIZE,
   XML_FEATURE_LARGE_SIZE,
-  XML_FEATURE_ATTR_INFO
+  XML_FEATURE_ATTR_INFO,
+  /* Added in Expat 2.4.0. */
+  XML_FEATURE_BILLION_LAUGHS_ATTACK_PROTECTION_MAXIMUM_AMPLIFICATION_DEFAULT,
+  XML_FEATURE_BILLION_LAUGHS_ATTACK_PROTECTION_ACTIVATION_THRESHOLD_DEFAULT
   /* Additional features must be added to the end of this enum. */
   /* Additional features must be added to the end of this enum. */
 };
 };
 
 
@@ -1010,12 +1024,24 @@ typedef struct {
 XMLPARSEAPI(const XML_Feature *)
 XMLPARSEAPI(const XML_Feature *)
 XML_GetFeatureList(void);
 XML_GetFeatureList(void);
 
 
+#ifdef XML_DTD
+/* Added in Expat 2.4.0. */
+XMLPARSEAPI(XML_Bool)
+XML_SetBillionLaughsAttackProtectionMaximumAmplification(
+    XML_Parser parser, float maximumAmplificationFactor);
+
+/* Added in Expat 2.4.0. */
+XMLPARSEAPI(XML_Bool)
+XML_SetBillionLaughsAttackProtectionActivationThreshold(
+    XML_Parser parser, unsigned long long activationThresholdBytes);
+#endif
+
 /* Expat follows the semantic versioning convention.
 /* Expat follows the semantic versioning convention.
    See http://semver.org.
    See http://semver.org.
 */
 */
 #define XML_MAJOR_VERSION 2
 #define XML_MAJOR_VERSION 2
-#define XML_MINOR_VERSION 2
-#define XML_MICRO_VERSION 9
+#define XML_MINOR_VERSION 4
+#define XML_MICRO_VERSION 1
 
 
 #ifdef __cplusplus
 #ifdef __cplusplus
 }
 }

+ 8 - 1
libs/expat/lib/expat_external.h

@@ -7,7 +7,14 @@
                                  |_| XML parser
                                  |_| XML parser
 
 
    Copyright (c) 1997-2000 Thai Open Source Software Center Ltd
    Copyright (c) 1997-2000 Thai Open Source Software Center Ltd
-   Copyright (c) 2000-2017 Expat development team
+   Copyright (c) 2000      Clark Cooper <[email protected]>
+   Copyright (c) 2000-2004 Fred L. Drake, Jr. <[email protected]>
+   Copyright (c) 2001-2002 Greg Stein <[email protected]>
+   Copyright (c) 2002-2006 Karl Waclawek <[email protected]>
+   Copyright (c) 2016      Cristian Rodríguez <[email protected]>
+   Copyright (c) 2016-2019 Sebastian Pipping <[email protected]>
+   Copyright (c) 2017      Rhodri James <[email protected]>
+   Copyright (c) 2018      Yury Gribov <[email protected]>
    Licensed under the MIT license:
    Licensed under the MIT license:
 
 
    Permission is  hereby granted,  free of charge,  to any  person obtaining
    Permission is  hereby granted,  free of charge,  to any  person obtaining

+ 3 - 1
libs/expat/lib/iasciitab.h

@@ -7,7 +7,9 @@
                                  |_| XML parser
                                  |_| XML parser
 
 
    Copyright (c) 1997-2000 Thai Open Source Software Center Ltd
    Copyright (c) 1997-2000 Thai Open Source Software Center Ltd
-   Copyright (c) 2000-2017 Expat development team
+   Copyright (c) 2000      Clark Cooper <[email protected]>
+   Copyright (c) 2002      Fred L. Drake, Jr. <[email protected]>
+   Copyright (c) 2017      Sebastian Pipping <[email protected]>
    Licensed under the MIT license:
    Licensed under the MIT license:
 
 
    Permission is  hereby granted,  free of charge,  to any  person obtaining
    Permission is  hereby granted,  free of charge,  to any  person obtaining

+ 49 - 9
libs/expat/lib/internal.h

@@ -25,8 +25,12 @@
                         \___/_/\_\ .__/ \__,_|\__|
                         \___/_/\_\ .__/ \__,_|\__|
                                  |_| XML parser
                                  |_| XML parser
 
 
-   Copyright (c) 1997-2000 Thai Open Source Software Center Ltd
-   Copyright (c) 2000-2017 Expat development team
+   Copyright (c) 2002-2003 Fred L. Drake, Jr. <[email protected]>
+   Copyright (c) 2002-2006 Karl Waclawek <[email protected]>
+   Copyright (c) 2003      Greg Stein <[email protected]>
+   Copyright (c) 2016-2021 Sebastian Pipping <[email protected]>
+   Copyright (c) 2018      Yury Gribov <[email protected]>
+   Copyright (c) 2019      David Loffredo <[email protected]>
    Licensed under the MIT license:
    Licensed under the MIT license:
 
 
    Permission is  hereby granted,  free of charge,  to any  person obtaining
    Permission is  hereby granted,  free of charge,  to any  person obtaining
@@ -101,22 +105,58 @@
 #  endif
 #  endif
 #endif
 #endif
 
 
+#include <limits.h> // ULONG_MAX
+
+#if defined(_WIN32) && ! defined(__USE_MINGW_ANSI_STDIO)
+#  define EXPAT_FMT_ULL(midpart) "%" midpart "I64u"
+#  if defined(_WIN64) // Note: modifiers "td" and "zu" do not work for MinGW
+#    define EXPAT_FMT_PTRDIFF_T(midpart) "%" midpart "I64d"
+#    define EXPAT_FMT_SIZE_T(midpart) "%" midpart "I64u"
+#  else
+#    define EXPAT_FMT_PTRDIFF_T(midpart) "%" midpart "d"
+#    define EXPAT_FMT_SIZE_T(midpart) "%" midpart "u"
+#  endif
+#else
+#  define EXPAT_FMT_ULL(midpart) "%" midpart "llu"
+#  if ! defined(ULONG_MAX)
+#    error Compiler did not define ULONG_MAX for us
+#  elif ULONG_MAX == 18446744073709551615u // 2^64-1
+#    define EXPAT_FMT_PTRDIFF_T(midpart) "%" midpart "ld"
+#    define EXPAT_FMT_SIZE_T(midpart) "%" midpart "lu"
+#  else
+#    define EXPAT_FMT_PTRDIFF_T(midpart) "%" midpart "d"
+#    define EXPAT_FMT_SIZE_T(midpart) "%" midpart "u"
+#  endif
+#endif
+
 #ifndef UNUSED_P
 #ifndef UNUSED_P
 #  define UNUSED_P(p) (void)p
 #  define UNUSED_P(p) (void)p
 #endif
 #endif
 
 
+/* NOTE BEGIN If you ever patch these defaults to greater values
+              for non-attack XML payload in your environment,
+              please file a bug report with libexpat.  Thank you!
+*/
+#define EXPAT_BILLION_LAUGHS_ATTACK_PROTECTION_MAXIMUM_AMPLIFICATION_DEFAULT   \
+  100.0f
+#define EXPAT_BILLION_LAUGHS_ATTACK_PROTECTION_ACTIVATION_THRESHOLD_DEFAULT    \
+  8388608 // 8 MiB, 2^23
+/* NOTE END */
+
+#include "expat.h" // so we can use type XML_Parser below
+
 #ifdef __cplusplus
 #ifdef __cplusplus
 extern "C" {
 extern "C" {
 #endif
 #endif
 
 
-#ifdef XML_ENABLE_VISIBILITY
-#  if XML_ENABLE_VISIBILITY
-__attribute__((visibility("default")))
-#  endif
+void _INTERNAL_trim_to_complete_utf8_characters(const char *from,
+                                                const char **fromLimRef);
+
+#if defined(XML_DTD)
+unsigned long long testingAccountingGetCountBytesDirect(XML_Parser parser);
+unsigned long long testingAccountingGetCountBytesIndirect(XML_Parser parser);
+const char *unsignedCharToPrintable(unsigned char c);
 #endif
 #endif
-void
-_INTERNAL_trim_to_complete_utf8_characters(const char *from,
-                                           const char **fromLimRef);
 
 
 #ifdef __cplusplus
 #ifdef __cplusplus
 }
 }

+ 3 - 1
libs/expat/lib/latin1tab.h

@@ -7,7 +7,9 @@
                                  |_| XML parser
                                  |_| XML parser
 
 
    Copyright (c) 1997-2000 Thai Open Source Software Center Ltd
    Copyright (c) 1997-2000 Thai Open Source Software Center Ltd
-   Copyright (c) 2000-2017 Expat development team
+   Copyright (c) 2000      Clark Cooper <[email protected]>
+   Copyright (c) 2002      Fred L. Drake, Jr. <[email protected]>
+   Copyright (c) 2017      Sebastian Pipping <[email protected]>
    Licensed under the MIT license:
    Licensed under the MIT license:
 
 
    Permission is  hereby granted,  free of charge,  to any  person obtaining
    Permission is  hereby granted,  free of charge,  to any  person obtaining

+ 4 - 2
libs/expat/lib/libexpat.def

@@ -74,5 +74,7 @@ EXPORTS
 ; added with version 2.1.1
 ; added with version 2.1.1
 ; XML_GetAttributeInfo @66
 ; XML_GetAttributeInfo @66
   XML_SetHashSalt @67
   XML_SetHashSalt @67
-; added with version 2.2.5
-  _INTERNAL_trim_to_complete_utf8_characters @68
+; internal @68 removed with version 2.3.1
+; added with version 2.4.0
+  XML_SetBillionLaughsAttackProtectionActivationThreshold @69
+  XML_SetBillionLaughsAttackProtectionMaximumAmplification @70

+ 4 - 2
libs/expat/lib/libexpatw.def

@@ -74,5 +74,7 @@ EXPORTS
 ; added with version 2.1.1
 ; added with version 2.1.1
 ; XML_GetAttributeInfo @66
 ; XML_GetAttributeInfo @66
   XML_SetHashSalt @67
   XML_SetHashSalt @67
-; added with version 2.2.5
-  _INTERNAL_trim_to_complete_utf8_characters @68
+; internal @68 removed with version 2.3.1
+; added with version 2.4.0
+  XML_SetBillionLaughsAttackProtectionActivationThreshold @69
+  XML_SetBillionLaughsAttackProtectionMaximumAmplification @70

+ 2 - 2
libs/expat/lib/nametab.h

@@ -6,8 +6,8 @@
                         \___/_/\_\ .__/ \__,_|\__|
                         \___/_/\_\ .__/ \__,_|\__|
                                  |_| XML parser
                                  |_| XML parser
 
 
-   Copyright (c) 1997-2000 Thai Open Source Software Center Ltd
-   Copyright (c) 2000-2017 Expat development team
+   Copyright (c) 2000 Clark Cooper <[email protected]>
+   Copyright (c) 2017 Sebastian Pipping <[email protected]>
    Licensed under the MIT license:
    Licensed under the MIT license:
 
 
    Permission is  hereby granted,  free of charge,  to any  person obtaining
    Permission is  hereby granted,  free of charge,  to any  person obtaining

+ 4 - 9
libs/expat/lib/siphash.h

@@ -11,6 +11,9 @@
  * --------------------------------------------------------------------------
  * --------------------------------------------------------------------------
  * HISTORY:
  * HISTORY:
  *
  *
+ * 2020-10-03  (Sebastian Pipping)
+ *   - Drop support for Visual Studio 9.0/2008 and earlier
+ *
  * 2019-08-03  (Sebastian Pipping)
  * 2019-08-03  (Sebastian Pipping)
  *   - Mark part of sip24_valid as to be excluded from clang-format
  *   - Mark part of sip24_valid as to be excluded from clang-format
  *   - Re-format code using clang-format 9
  *   - Re-format code using clang-format 9
@@ -96,15 +99,7 @@
 #define SIPHASH_H
 #define SIPHASH_H
 
 
 #include <stddef.h> /* size_t */
 #include <stddef.h> /* size_t */
-
-#if defined(_WIN32) && defined(_MSC_VER) && (_MSC_VER < 1600)
-/* For vs2003/7.1 up to vs2008/9.0; _MSC_VER 1600 is vs2010/10.0 */
-typedef unsigned __int8 uint8_t;
-typedef unsigned __int32 uint32_t;
-typedef unsigned __int64 uint64_t;
-#else
-#  include <stdint.h> /* uint64_t uint32_t uint8_t */
-#endif
+#include <stdint.h> /* uint64_t uint32_t uint8_t */
 
 
 /*
 /*
  * Workaround to not require a C++11 compiler for using ULL suffix
  * Workaround to not require a C++11 compiler for using ULL suffix

+ 3 - 1
libs/expat/lib/utf8tab.h

@@ -7,7 +7,9 @@
                                  |_| XML parser
                                  |_| XML parser
 
 
    Copyright (c) 1997-2000 Thai Open Source Software Center Ltd
    Copyright (c) 1997-2000 Thai Open Source Software Center Ltd
-   Copyright (c) 2000-2017 Expat development team
+   Copyright (c) 2000      Clark Cooper <[email protected]>
+   Copyright (c) 2002      Fred L. Drake, Jr. <[email protected]>
+   Copyright (c) 2017      Sebastian Pipping <[email protected]>
    Licensed under the MIT license:
    Licensed under the MIT license:
 
 
    Permission is  hereby granted,  free of charge,  to any  person obtaining
    Permission is  hereby granted,  free of charge,  to any  person obtaining

+ 6 - 15
libs/expat/lib/winconfig.h

@@ -6,8 +6,10 @@
                         \___/_/\_\ .__/ \__,_|\__|
                         \___/_/\_\ .__/ \__,_|\__|
                                  |_| XML parser
                                  |_| XML parser
 
 
-   Copyright (c) 1997-2000 Thai Open Source Software Center Ltd
-   Copyright (c) 2000-2017 Expat development team
+   Copyright (c) 2000      Clark Cooper <[email protected]>
+   Copyright (c) 2002      Greg Stein <[email protected]>
+   Copyright (c) 2005      Karl Waclawek <[email protected]>
+   Copyright (c) 2017-2021 Sebastian Pipping <[email protected]>
    Licensed under the MIT license:
    Licensed under the MIT license:
 
 
    Permission is  hereby granted,  free of charge,  to any  person obtaining
    Permission is  hereby granted,  free of charge,  to any  person obtaining
@@ -39,18 +41,7 @@
 
 
 #include <memory.h>
 #include <memory.h>
 #include <string.h>
 #include <string.h>
-
-#if defined(HAVE_EXPAT_CONFIG_H) /* e.g. MinGW */
-#  include <expat_config.h>
-#else /* !defined(HAVE_EXPAT_CONFIG_H) */
-
-#  define XML_NS 1
-#  define XML_DTD 1
-#  define XML_CONTEXT_BYTES 1024
-
-/* we will assume all Windows platforms are little endian */
-#  define BYTEORDER 1234
-
-#endif /* !defined(HAVE_EXPAT_CONFIG_H) */
+#include <float.h>
+#define isnan _isnan
 
 
 #endif /* ndef WINCONFIG_H */
 #endif /* ndef WINCONFIG_H */

File diff suppressed because it is too large
+ 397 - 82
libs/expat/lib/xmlparse.c


+ 13 - 6
libs/expat/lib/xmlrole.c

@@ -7,7 +7,14 @@
                                  |_| XML parser
                                  |_| XML parser
 
 
    Copyright (c) 1997-2000 Thai Open Source Software Center Ltd
    Copyright (c) 1997-2000 Thai Open Source Software Center Ltd
-   Copyright (c) 2000-2017 Expat development team
+   Copyright (c) 2000      Clark Cooper <[email protected]>
+   Copyright (c) 2002      Greg Stein <[email protected]>
+   Copyright (c) 2002-2006 Karl Waclawek <[email protected]>
+   Copyright (c) 2002-2003 Fred L. Drake, Jr. <[email protected]>
+   Copyright (c) 2005-2009 Steven Solie <[email protected]>
+   Copyright (c) 2016-2021 Sebastian Pipping <[email protected]>
+   Copyright (c) 2017      Rhodri James <[email protected]>
+   Copyright (c) 2019      David Loffredo <[email protected]>
    Licensed under the MIT license:
    Licensed under the MIT license:
 
 
    Permission is  hereby granted,  free of charge,  to any  person obtaining
    Permission is  hereby granted,  free of charge,  to any  person obtaining
@@ -34,11 +41,9 @@
 
 
 #ifdef _WIN32
 #ifdef _WIN32
 #  include "winconfig.h"
 #  include "winconfig.h"
-#else
-#  ifdef HAVE_EXPAT_CONFIG_H
-#    include <expat_config.h>
-#  endif
-#endif /* ndef _WIN32 */
+#endif
+
+#include <expat_config.h>
 
 
 #include "expat_external.h"
 #include "expat_external.h"
 #include "internal.h"
 #include "internal.h"
@@ -1220,6 +1225,8 @@ common(PROLOG_STATE *state, int tok) {
 #ifdef XML_DTD
 #ifdef XML_DTD
   if (! state->documentEntity && tok == XML_TOK_PARAM_ENTITY_REF)
   if (! state->documentEntity && tok == XML_TOK_PARAM_ENTITY_REF)
     return XML_ROLE_INNER_PARAM_ENTITY_REF;
     return XML_ROLE_INNER_PARAM_ENTITY_REF;
+#else
+  UNUSED_P(tok);
 #endif
 #endif
   state->handler = error;
   state->handler = error;
   return XML_ROLE_ERROR;
   return XML_ROLE_ERROR;

+ 4 - 1
libs/expat/lib/xmlrole.h

@@ -7,7 +7,10 @@
                                  |_| XML parser
                                  |_| XML parser
 
 
    Copyright (c) 1997-2000 Thai Open Source Software Center Ltd
    Copyright (c) 1997-2000 Thai Open Source Software Center Ltd
-   Copyright (c) 2000-2017 Expat development team
+   Copyright (c) 2000      Clark Cooper <[email protected]>
+   Copyright (c) 2002      Karl Waclawek <[email protected]>
+   Copyright (c) 2002      Fred L. Drake, Jr. <[email protected]>
+   Copyright (c) 2017      Sebastian Pipping <[email protected]>
    Licensed under the MIT license:
    Licensed under the MIT license:
 
 
    Permission is  hereby granted,  free of charge,  to any  person obtaining
    Permission is  hereby granted,  free of charge,  to any  person obtaining

+ 27 - 19
libs/expat/lib/xmltok.c

@@ -7,7 +7,19 @@
                                  |_| XML parser
                                  |_| XML parser
 
 
    Copyright (c) 1997-2000 Thai Open Source Software Center Ltd
    Copyright (c) 1997-2000 Thai Open Source Software Center Ltd
-   Copyright (c) 2000-2017 Expat development team
+   Copyright (c) 2000      Clark Cooper <[email protected]>
+   Copyright (c) 2001-2003 Fred L. Drake, Jr. <[email protected]>
+   Copyright (c) 2002      Greg Stein <[email protected]>
+   Copyright (c) 2002-2016 Karl Waclawek <[email protected]>
+   Copyright (c) 2005-2009 Steven Solie <[email protected]>
+   Copyright (c) 2016-2021 Sebastian Pipping <[email protected]>
+   Copyright (c) 2016      Pascal Cuoq <[email protected]>
+   Copyright (c) 2016      Don Lewis <[email protected]>
+   Copyright (c) 2017      Rhodri James <[email protected]>
+   Copyright (c) 2017      Alexander Bluhm <[email protected]>
+   Copyright (c) 2017      Benbuck Nason <[email protected]>
+   Copyright (c) 2017      José Gutiérrez de la Concha <[email protected]>
+   Copyright (c) 2019      David Loffredo <[email protected]>
    Licensed under the MIT license:
    Licensed under the MIT license:
 
 
    Permission is  hereby granted,  free of charge,  to any  person obtaining
    Permission is  hereby granted,  free of charge,  to any  person obtaining
@@ -32,23 +44,13 @@
 
 
 #include <stddef.h>
 #include <stddef.h>
 #include <string.h> /* memcpy */
 #include <string.h> /* memcpy */
-
-#if defined(_MSC_VER) && (_MSC_VER <= 1700)
-/* for vs2012/11.0/1700 and earlier Visual Studio compilers */
-#  define bool int
-#  define false 0
-#  define true 1
-#else
-#  include <stdbool.h>
-#endif
+#include <stdbool.h>
 
 
 #ifdef _WIN32
 #ifdef _WIN32
 #  include "winconfig.h"
 #  include "winconfig.h"
-#else
-#  ifdef HAVE_EXPAT_CONFIG_H
-#    include <expat_config.h>
-#  endif
-#endif /* ndef _WIN32 */
+#endif
+
+#include <expat_config.h>
 
 
 #include "expat_external.h"
 #include "expat_external.h"
 #include "internal.h"
 #include "internal.h"
@@ -269,8 +271,14 @@ sb_byteToAscii(const ENCODING *enc, const char *p) {
 
 
 #define IS_NAME_CHAR(enc, p, n) (AS_NORMAL_ENCODING(enc)->isName##n(enc, p))
 #define IS_NAME_CHAR(enc, p, n) (AS_NORMAL_ENCODING(enc)->isName##n(enc, p))
 #define IS_NMSTRT_CHAR(enc, p, n) (AS_NORMAL_ENCODING(enc)->isNmstrt##n(enc, p))
 #define IS_NMSTRT_CHAR(enc, p, n) (AS_NORMAL_ENCODING(enc)->isNmstrt##n(enc, p))
-#define IS_INVALID_CHAR(enc, p, n)                                             \
-  (AS_NORMAL_ENCODING(enc)->isInvalid##n(enc, p))
+#ifdef XML_MIN_SIZE
+#  define IS_INVALID_CHAR(enc, p, n)                                           \
+    (AS_NORMAL_ENCODING(enc)->isInvalid##n                                     \
+     && AS_NORMAL_ENCODING(enc)->isInvalid##n(enc, p))
+#else
+#  define IS_INVALID_CHAR(enc, p, n)                                           \
+    (AS_NORMAL_ENCODING(enc)->isInvalid##n(enc, p))
+#endif
 
 
 #ifdef XML_MIN_SIZE
 #ifdef XML_MIN_SIZE
 #  define IS_NAME_CHAR_MINBPC(enc, p)                                          \
 #  define IS_NAME_CHAR_MINBPC(enc, p)                                          \
@@ -589,13 +597,13 @@ static const struct normal_encoding ascii_encoding
 static int PTRFASTCALL
 static int PTRFASTCALL
 unicode_byte_type(char hi, char lo) {
 unicode_byte_type(char hi, char lo) {
   switch ((unsigned char)hi) {
   switch ((unsigned char)hi) {
-  /* 0xD8000xDBFF first 16-bit code unit or high surrogate (W1) */
+  /* 0xD800-0xDBFF first 16-bit code unit or high surrogate (W1) */
   case 0xD8:
   case 0xD8:
   case 0xD9:
   case 0xD9:
   case 0xDA:
   case 0xDA:
   case 0xDB:
   case 0xDB:
     return BT_LEAD4;
     return BT_LEAD4;
-  /* 0xDC000xDFFF second 16-bit code unit or low surrogate (W2) */
+  /* 0xDC00-0xDFFF second 16-bit code unit or low surrogate (W2) */
   case 0xDC:
   case 0xDC:
   case 0xDD:
   case 0xDD:
   case 0xDE:
   case 0xDE:

+ 5 - 1
libs/expat/lib/xmltok.h

@@ -7,7 +7,11 @@
                                  |_| XML parser
                                  |_| XML parser
 
 
    Copyright (c) 1997-2000 Thai Open Source Software Center Ltd
    Copyright (c) 1997-2000 Thai Open Source Software Center Ltd
-   Copyright (c) 2000-2017 Expat development team
+   Copyright (c) 2000      Clark Cooper <[email protected]>
+   Copyright (c) 2002      Fred L. Drake, Jr. <[email protected]>
+   Copyright (c) 2002-2005 Karl Waclawek <[email protected]>
+   Copyright (c) 2016-2017 Sebastian Pipping <[email protected]>
+   Copyright (c) 2017      Rhodri James <[email protected]>
    Licensed under the MIT license:
    Licensed under the MIT license:
 
 
    Permission is  hereby granted,  free of charge,  to any  person obtaining
    Permission is  hereby granted,  free of charge,  to any  person obtaining

+ 15 - 6
libs/expat/lib/xmltok_impl.c

@@ -1,4 +1,4 @@
-/* This file is included!
+/* This file is included (from xmltok.c, 1-3 times depending on XML_MIN_SIZE)!
                             __  __            _
                             __  __            _
                          ___\ \/ /_ __   __ _| |_
                          ___\ \/ /_ __   __ _| |_
                         / _ \\  /| '_ \ / _` | __|
                         / _ \\  /| '_ \ / _` | __|
@@ -7,7 +7,15 @@
                                  |_| XML parser
                                  |_| XML parser
 
 
    Copyright (c) 1997-2000 Thai Open Source Software Center Ltd
    Copyright (c) 1997-2000 Thai Open Source Software Center Ltd
-   Copyright (c) 2000-2017 Expat development team
+   Copyright (c) 2000      Clark Cooper <[email protected]>
+   Copyright (c) 2002      Fred L. Drake, Jr. <[email protected]>
+   Copyright (c) 2002-2016 Karl Waclawek <[email protected]>
+   Copyright (c) 2016-2021 Sebastian Pipping <[email protected]>
+   Copyright (c) 2017      Rhodri James <[email protected]>
+   Copyright (c) 2018      Benjamin Peterson <[email protected]>
+   Copyright (c) 2018      Anton Maklakov <[email protected]>
+   Copyright (c) 2019      David Loffredo <[email protected]>
+   Copyright (c) 2020      Boris Kolpackov <[email protected]>
    Licensed under the MIT license:
    Licensed under the MIT license:
 
 
    Permission is  hereby granted,  free of charge,  to any  person obtaining
    Permission is  hereby granted,  free of charge,  to any  person obtaining
@@ -32,7 +40,7 @@
 
 
 #ifdef XML_TOK_IMPL_C
 #ifdef XML_TOK_IMPL_C
 
 
-#  ifndef IS_INVALID_CHAR
+#  ifndef IS_INVALID_CHAR // i.e. for UTF-16 and XML_MIN_SIZE not defined
 #    define IS_INVALID_CHAR(enc, ptr, n) (0)
 #    define IS_INVALID_CHAR(enc, ptr, n) (0)
 #  endif
 #  endif
 
 
@@ -1772,13 +1780,14 @@ PREFIX(updatePosition)(const ENCODING *enc, const char *ptr, const char *end,
         return; \
         return; \
       } \
       } \
     ptr += n;                                                                  \
     ptr += n;                                                                  \
+    pos->columnNumber++;                                                       \
     break;
     break;
       LEAD_CASE(2)
       LEAD_CASE(2)
       LEAD_CASE(3)
       LEAD_CASE(3)
       LEAD_CASE(4)
       LEAD_CASE(4)
 #  undef LEAD_CASE
 #  undef LEAD_CASE
     case BT_LF:
     case BT_LF:
-      pos->columnNumber = (XML_Size)-1;
+      pos->columnNumber = 0;
       pos->lineNumber++;
       pos->lineNumber++;
       ptr += MINBPC(enc);
       ptr += MINBPC(enc);
       break;
       break;
@@ -1787,13 +1796,13 @@ PREFIX(updatePosition)(const ENCODING *enc, const char *ptr, const char *end,
       ptr += MINBPC(enc);
       ptr += MINBPC(enc);
       if (HAS_CHAR(enc, ptr, end) && BYTE_TYPE(enc, ptr) == BT_LF)
       if (HAS_CHAR(enc, ptr, end) && BYTE_TYPE(enc, ptr) == BT_LF)
         ptr += MINBPC(enc);
         ptr += MINBPC(enc);
-      pos->columnNumber = (XML_Size)-1;
+      pos->columnNumber = 0;
       break;
       break;
     default:
     default:
       ptr += MINBPC(enc);
       ptr += MINBPC(enc);
+      pos->columnNumber++;
       break;
       break;
     }
     }
-    pos->columnNumber++;
   }
   }
 }
 }
 
 

+ 2 - 1
libs/expat/lib/xmltok_impl.h

@@ -7,7 +7,8 @@
                                  |_| XML parser
                                  |_| XML parser
 
 
    Copyright (c) 1997-2000 Thai Open Source Software Center Ltd
    Copyright (c) 1997-2000 Thai Open Source Software Center Ltd
-   Copyright (c) 2000-2017 Expat development team
+   Copyright (c) 2000      Clark Cooper <[email protected]>
+   Copyright (c) 2017-2019 Sebastian Pipping <[email protected]>
    Licensed under the MIT license:
    Licensed under the MIT license:
 
 
    Permission is  hereby granted,  free of charge,  to any  person obtaining
    Permission is  hereby granted,  free of charge,  to any  person obtaining

+ 5 - 1
libs/expat/lib/xmltok_ns.c

@@ -7,7 +7,11 @@
                                  |_| XML parser
                                  |_| XML parser
 
 
    Copyright (c) 1997-2000 Thai Open Source Software Center Ltd
    Copyright (c) 1997-2000 Thai Open Source Software Center Ltd
-   Copyright (c) 2000-2017 Expat development team
+   Copyright (c) 2000      Clark Cooper <[email protected]>
+   Copyright (c) 2002      Greg Stein <[email protected]>
+   Copyright (c) 2002      Fred L. Drake, Jr. <[email protected]>
+   Copyright (c) 2002-2006 Karl Waclawek <[email protected]>
+   Copyright (c) 2017      Sebastian Pipping <[email protected]>
    Licensed under the MIT license:
    Licensed under the MIT license:
 
 
    Permission is  hereby granted,  free of charge,  to any  person obtaining
    Permission is  hereby granted,  free of charge,  to any  person obtaining

+ 28 - 2
libs/expat/run.sh.in

@@ -1,6 +1,32 @@
 #! /usr/bin/env bash
 #! /usr/bin/env bash
-# Copyright (C) 2017 Expat development team
-# Licensed under the MIT license
+#                          __  __            _
+#                       ___\ \/ /_ __   __ _| |_
+#                      / _ \\  /| '_ \ / _` | __|
+#                     |  __//  \| |_) | (_| | |_
+#                      \___/_/\_\ .__/ \__,_|\__|
+#                               |_| XML parser
+#
+# Copyright (c) 2017 Sebastian Pipping <[email protected]>
+# Licensed under the MIT license:
+#
+# Permission is  hereby granted,  free of charge,  to any  person obtaining
+# a  copy  of  this  software   and  associated  documentation  files  (the
+# "Software"),  to  deal in  the  Software  without restriction,  including
+# without  limitation the  rights  to use,  copy,  modify, merge,  publish,
+# distribute, sublicense, and/or sell copies of the Software, and to permit
+# persons  to whom  the Software  is  furnished to  do so,  subject to  the
+# following conditions:
+#
+# The above copyright  notice and this permission notice  shall be included
+# in all copies or substantial portions of the Software.
+#
+# THE  SOFTWARE  IS  PROVIDED  "AS  IS",  WITHOUT  WARRANTY  OF  ANY  KIND,
+# EXPRESS  OR IMPLIED,  INCLUDING  BUT  NOT LIMITED  TO  THE WARRANTIES  OF
+# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
+# NO EVENT SHALL THE AUTHORS OR  COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+# DAMAGES OR  OTHER LIABILITY, WHETHER  IN AN  ACTION OF CONTRACT,  TORT OR
+# OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+# USE OR OTHER DEALINGS IN THE SOFTWARE.
 
 
 case "@host@" in
 case "@host@" in
 *-mingw*)
 *-mingw*)

+ 2 - 1
libs/expat/test-driver-wrapper.sh

@@ -6,7 +6,8 @@
 #                      \___/_/\_\ .__/ \__,_|\__|
 #                      \___/_/\_\ .__/ \__,_|\__|
 #                               |_| XML parser
 #                               |_| XML parser
 #
 #
-# Copyright (c) 2017 Expat development team
+# Copyright (c) 2017 Sebastian Pipping <[email protected]>
+# Copyright (c) 2019 Jeffrey Walton <[email protected]>
 # Licensed under the MIT license:
 # Licensed under the MIT license:
 #
 #
 # Permission is  hereby granted,  free of charge,  to any  person obtaining
 # Permission is  hereby granted,  free of charge,  to any  person obtaining

+ 6 - 4
libs/expat/tests/Makefile.am

@@ -6,7 +6,9 @@
 #                      \___/_/\_\ .__/ \__,_|\__|
 #                      \___/_/\_\ .__/ \__,_|\__|
 #                               |_| XML parser
 #                               |_| XML parser
 #
 #
-# Copyright (c) 2017 Expat development team
+# Copyright (c) 2017-2021 Sebastian Pipping <[email protected]>
+# Copyright (c) 2017      Rhodri James <[email protected]>
+# Copyright (c) 2020      Jeffrey Walton <[email protected]>
 # Licensed under the MIT license:
 # Licensed under the MIT license:
 #
 #
 # Permission is  hereby granted,  free of charge,  to any  person obtaining
 # Permission is  hereby granted,  free of charge,  to any  person obtaining
@@ -30,7 +32,7 @@
 
 
 SUBDIRS = . benchmark
 SUBDIRS = . benchmark
 
 
-AM_CPPFLAGS = -I$(srcdir)/../lib
+AM_CPPFLAGS = @AM_CPPFLAGS@ -I$(srcdir)/../lib
 
 
 noinst_LIBRARIES = libruntests.a
 noinst_LIBRARIES = libruntests.a
 
 
@@ -52,8 +54,8 @@ runtests_SOURCES = \
 runtestspp_SOURCES = \
 runtestspp_SOURCES = \
     runtestspp.cpp
     runtestspp.cpp
 
 
-runtests_LDADD = libruntests.a ../lib/libexpat.la
-runtestspp_LDADD = libruntests.a ../lib/libexpat.la
+runtests_LDADD = libruntests.a ../lib/libexpatinternal.la
+runtestspp_LDADD = libruntests.a ../lib/libexpatinternal.la
 
 
 EXTRA_DIST = \
 EXTRA_DIST = \
     chardata.h \
     chardata.h \

+ 29 - 9
libs/expat/tests/Makefile.in

@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.16.1 from Makefile.am.
+# Makefile.in generated by automake 1.16.3 from Makefile.am.
 # @configure_input@
 # @configure_input@
 
 
-# Copyright (C) 1994-2018 Free Software Foundation, Inc.
+# Copyright (C) 1994-2020 Free Software Foundation, Inc.
 
 
 # This Makefile.in is free software; the Free Software Foundation
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # gives unlimited permission to copy and/or distribute it,
@@ -22,7 +22,9 @@
 #                      \___/_/\_\ .__/ \__,_|\__|
 #                      \___/_/\_\ .__/ \__,_|\__|
 #                               |_| XML parser
 #                               |_| XML parser
 #
 #
-# Copyright (c) 2017 Expat development team
+# Copyright (c) 2017-2021 Sebastian Pipping <[email protected]>
+# Copyright (c) 2017      Rhodri James <[email protected]>
+# Copyright (c) 2020      Jeffrey Walton <[email protected]>
 # Licensed under the MIT license:
 # Licensed under the MIT license:
 #
 #
 # Permission is  hereby granted,  free of charge,  to any  person obtaining
 # Permission is  hereby granted,  free of charge,  to any  person obtaining
@@ -154,14 +156,14 @@ am_libruntests_a_OBJECTS = chardata.$(OBJEXT) structdata.$(OBJEXT) \
 libruntests_a_OBJECTS = $(am_libruntests_a_OBJECTS)
 libruntests_a_OBJECTS = $(am_libruntests_a_OBJECTS)
 am_runtests_OBJECTS = runtests.$(OBJEXT)
 am_runtests_OBJECTS = runtests.$(OBJEXT)
 runtests_OBJECTS = $(am_runtests_OBJECTS)
 runtests_OBJECTS = $(am_runtests_OBJECTS)
-runtests_DEPENDENCIES = libruntests.a ../lib/libexpat.la
+runtests_DEPENDENCIES = libruntests.a ../lib/libexpatinternal.la
 AM_V_lt = $(am__v_lt_@AM_V@)
 AM_V_lt = $(am__v_lt_@AM_V@)
 am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
 am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
 am__v_lt_0 = --silent
 am__v_lt_0 = --silent
 am__v_lt_1 = 
 am__v_lt_1 = 
 am_runtestspp_OBJECTS = runtestspp.$(OBJEXT)
 am_runtestspp_OBJECTS = runtestspp.$(OBJEXT)
 runtestspp_OBJECTS = $(am_runtestspp_OBJECTS)
 runtestspp_OBJECTS = $(am_runtestspp_OBJECTS)
-runtestspp_DEPENDENCIES = libruntests.a ../lib/libexpat.la
+runtestspp_DEPENDENCIES = libruntests.a ../lib/libexpatinternal.la
 AM_V_P = $(am__v_P_@AM_V@)
 AM_V_P = $(am__v_P_@AM_V@)
 am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
 am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
 am__v_P_0 = false
 am__v_P_0 = false
@@ -443,6 +445,7 @@ am__set_TESTS_bases = \
   bases='$(TEST_LOGS)'; \
   bases='$(TEST_LOGS)'; \
   bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \
   bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \
   bases=`echo $$bases`
   bases=`echo $$bases`
+AM_TESTSUITE_SUMMARY_HEADER = ' for $(PACKAGE_STRING)'
 RECHECK_LOGS = $(TEST_LOGS)
 RECHECK_LOGS = $(TEST_LOGS)
 TEST_SUITE_LOG = test-suite.log
 TEST_SUITE_LOG = test-suite.log
 TEST_EXTENSIONS = @EXEEXT@ .test
 TEST_EXTENSIONS = @EXEEXT@ .test
@@ -495,7 +498,11 @@ am__relativize = \
   reldir="$$dir2"
   reldir="$$dir2"
 ACLOCAL = @ACLOCAL@
 ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AMTAR = @AMTAR@
+AM_CFLAGS = @AM_CFLAGS@
+AM_CPPFLAGS = @AM_CPPFLAGS@ -I$(srcdir)/../lib
+AM_CXXFLAGS = @AM_CXXFLAGS@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AM_LDFLAGS = @AM_LDFLAGS@
 AR = @AR@
 AR = @AR@
 AS = @AS@
 AS = @AS@
 AUTOCONF = @AUTOCONF@
 AUTOCONF = @AUTOCONF@
@@ -523,6 +530,13 @@ ECHO_N = @ECHO_N@
 ECHO_T = @ECHO_T@
 ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
 EXEEXT = @EXEEXT@
+EXPAT_ATTR_INFO = @EXPAT_ATTR_INFO@
+EXPAT_CHAR_TYPE = @EXPAT_CHAR_TYPE@
+EXPAT_CONTEXT_BYTES = @EXPAT_CONTEXT_BYTES@
+EXPAT_DTD = @EXPAT_DTD@
+EXPAT_LARGE_SIZE = @EXPAT_LARGE_SIZE@
+EXPAT_MIN_SIZE = @EXPAT_MIN_SIZE@
+EXPAT_NS = @EXPAT_NS@
 FGREP = @FGREP@
 FGREP = @FGREP@
 FILEMAP = @FILEMAP@
 FILEMAP = @FILEMAP@
 GREP = @GREP@
 GREP = @GREP@
@@ -535,6 +549,7 @@ LD = @LD@
 LDFLAGS = @LDFLAGS@
 LDFLAGS = @LDFLAGS@
 LIBAGE = @LIBAGE@
 LIBAGE = @LIBAGE@
 LIBCURRENT = @LIBCURRENT@
 LIBCURRENT = @LIBCURRENT@
+LIBDIR_BASENAME = @LIBDIR_BASENAME@
 LIBOBJS = @LIBOBJS@
 LIBOBJS = @LIBOBJS@
 LIBREVISION = @LIBREVISION@
 LIBREVISION = @LIBREVISION@
 LIBS = @LIBS@
 LIBS = @LIBS@
@@ -564,8 +579,12 @@ RANLIB = @RANLIB@
 SED = @SED@
 SED = @SED@
 SET_MAKE = @SET_MAKE@
 SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
 SHELL = @SHELL@
+SO_MAJOR = @SO_MAJOR@
+SO_MINOR = @SO_MINOR@
+SO_PATCH = @SO_PATCH@
 STRIP = @STRIP@
 STRIP = @STRIP@
 VERSION = @VERSION@
 VERSION = @VERSION@
+_EXPAT_OUTPUT_NAME = @_EXPAT_OUTPUT_NAME@
 abs_builddir = @abs_builddir@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
 abs_srcdir = @abs_srcdir@
 abs_top_builddir = @abs_top_builddir@
 abs_top_builddir = @abs_top_builddir@
@@ -574,6 +593,7 @@ ac_ct_AR = @ac_ct_AR@
 ac_ct_CC = @ac_ct_CC@
 ac_ct_CC = @ac_ct_CC@
 ac_ct_CXX = @ac_ct_CXX@
 ac_ct_CXX = @ac_ct_CXX@
 ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
 ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+ac_cv_sizeof_void_p = @ac_cv_sizeof_void_p@
 am__include = @am__include@
 am__include = @am__include@
 am__leading_dot = @am__leading_dot@
 am__leading_dot = @am__leading_dot@
 am__quote = @am__quote@
 am__quote = @am__quote@
@@ -611,6 +631,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
 srcdir = @srcdir@
@@ -620,7 +641,6 @@ top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 top_srcdir = @top_srcdir@
 SUBDIRS = . benchmark
 SUBDIRS = . benchmark
-AM_CPPFLAGS = -I$(srcdir)/../lib
 noinst_LIBRARIES = libruntests.a
 noinst_LIBRARIES = libruntests.a
 
 
 # To support MinGW and Non-MinGW at the same time:
 # To support MinGW and Non-MinGW at the same time:
@@ -637,8 +657,8 @@ runtests_SOURCES = \
 runtestspp_SOURCES = \
 runtestspp_SOURCES = \
     runtestspp.cpp
     runtestspp.cpp
 
 
-runtests_LDADD = libruntests.a ../lib/libexpat.la
-runtestspp_LDADD = libruntests.a ../lib/libexpat.la
+runtests_LDADD = libruntests.a ../lib/libexpatinternal.la
+runtestspp_LDADD = libruntests.a ../lib/libexpatinternal.la
 EXTRA_DIST = \
 EXTRA_DIST = \
     chardata.h \
     chardata.h \
     structdata.h \
     structdata.h \
@@ -981,7 +1001,7 @@ $(TEST_SUITE_LOG): $(TEST_LOGS)
 	  test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG);		\
 	  test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG);		\
 	fi;								\
 	fi;								\
 	echo "$${col}$$br$${std}"; 					\
 	echo "$${col}$$br$${std}"; 					\
-	echo "$${col}Testsuite summary for $(PACKAGE_STRING)$${std}";	\
+	echo "$${col}Testsuite summary"$(AM_TESTSUITE_SUMMARY_HEADER)"$${std}";	\
 	echo "$${col}$$br$${std}"; 					\
 	echo "$${col}$$br$${std}"; 					\
 	create_testsuite_report --maybe-color;				\
 	create_testsuite_report --maybe-color;				\
 	echo "$$col$$br$$std";						\
 	echo "$$col$$br$$std";						\

+ 3 - 2
libs/expat/tests/benchmark/Makefile.am

@@ -6,7 +6,8 @@
 #                      \___/_/\_\ .__/ \__,_|\__|
 #                      \___/_/\_\ .__/ \__,_|\__|
 #                               |_| XML parser
 #                               |_| XML parser
 #
 #
-# Copyright (c) 2017 Expat development team
+# Copyright (c) 2017 Sebastian Pipping <[email protected]>
+# Copyright (c) 2020 Jeffrey Walton <[email protected]>
 # Licensed under the MIT license:
 # Licensed under the MIT license:
 #
 #
 # Permission is  hereby granted,  free of charge,  to any  person obtaining
 # Permission is  hereby granted,  free of charge,  to any  person obtaining
@@ -28,7 +29,7 @@
 # OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
 # OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
 # USE OR OTHER DEALINGS IN THE SOFTWARE.
 # USE OR OTHER DEALINGS IN THE SOFTWARE.
 
 
-AM_CPPFLAGS = -I$(srcdir)/../../lib
+AM_CPPFLAGS = @AM_CPPFLAGS@ -I$(srcdir)/../../lib
 
 
 noinst_PROGRAMS = benchmark
 noinst_PROGRAMS = benchmark
 
 

+ 22 - 4
libs/expat/tests/benchmark/Makefile.in

@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.16.1 from Makefile.am.
+# Makefile.in generated by automake 1.16.3 from Makefile.am.
 # @configure_input@
 # @configure_input@
 
 
-# Copyright (C) 1994-2018 Free Software Foundation, Inc.
+# Copyright (C) 1994-2020 Free Software Foundation, Inc.
 
 
 # This Makefile.in is free software; the Free Software Foundation
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # gives unlimited permission to copy and/or distribute it,
@@ -22,7 +22,8 @@
 #                      \___/_/\_\ .__/ \__,_|\__|
 #                      \___/_/\_\ .__/ \__,_|\__|
 #                               |_| XML parser
 #                               |_| XML parser
 #
 #
-# Copyright (c) 2017 Expat development team
+# Copyright (c) 2017 Sebastian Pipping <[email protected]>
+# Copyright (c) 2020 Jeffrey Walton <[email protected]>
 # Licensed under the MIT license:
 # Licensed under the MIT license:
 #
 #
 # Permission is  hereby granted,  free of charge,  to any  person obtaining
 # Permission is  hereby granted,  free of charge,  to any  person obtaining
@@ -214,7 +215,11 @@ am__DIST_COMMON = $(srcdir)/Makefile.in \
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AMTAR = @AMTAR@
+AM_CFLAGS = @AM_CFLAGS@
+AM_CPPFLAGS = @AM_CPPFLAGS@ -I$(srcdir)/../../lib
+AM_CXXFLAGS = @AM_CXXFLAGS@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AM_LDFLAGS = @AM_LDFLAGS@
 AR = @AR@
 AR = @AR@
 AS = @AS@
 AS = @AS@
 AUTOCONF = @AUTOCONF@
 AUTOCONF = @AUTOCONF@
@@ -242,6 +247,13 @@ ECHO_N = @ECHO_N@
 ECHO_T = @ECHO_T@
 ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
 EXEEXT = @EXEEXT@
+EXPAT_ATTR_INFO = @EXPAT_ATTR_INFO@
+EXPAT_CHAR_TYPE = @EXPAT_CHAR_TYPE@
+EXPAT_CONTEXT_BYTES = @EXPAT_CONTEXT_BYTES@
+EXPAT_DTD = @EXPAT_DTD@
+EXPAT_LARGE_SIZE = @EXPAT_LARGE_SIZE@
+EXPAT_MIN_SIZE = @EXPAT_MIN_SIZE@
+EXPAT_NS = @EXPAT_NS@
 FGREP = @FGREP@
 FGREP = @FGREP@
 FILEMAP = @FILEMAP@
 FILEMAP = @FILEMAP@
 GREP = @GREP@
 GREP = @GREP@
@@ -254,6 +266,7 @@ LD = @LD@
 LDFLAGS = @LDFLAGS@
 LDFLAGS = @LDFLAGS@
 LIBAGE = @LIBAGE@
 LIBAGE = @LIBAGE@
 LIBCURRENT = @LIBCURRENT@
 LIBCURRENT = @LIBCURRENT@
+LIBDIR_BASENAME = @LIBDIR_BASENAME@
 LIBOBJS = @LIBOBJS@
 LIBOBJS = @LIBOBJS@
 LIBREVISION = @LIBREVISION@
 LIBREVISION = @LIBREVISION@
 LIBS = @LIBS@
 LIBS = @LIBS@
@@ -283,8 +296,12 @@ RANLIB = @RANLIB@
 SED = @SED@
 SED = @SED@
 SET_MAKE = @SET_MAKE@
 SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
 SHELL = @SHELL@
+SO_MAJOR = @SO_MAJOR@
+SO_MINOR = @SO_MINOR@
+SO_PATCH = @SO_PATCH@
 STRIP = @STRIP@
 STRIP = @STRIP@
 VERSION = @VERSION@
 VERSION = @VERSION@
+_EXPAT_OUTPUT_NAME = @_EXPAT_OUTPUT_NAME@
 abs_builddir = @abs_builddir@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
 abs_srcdir = @abs_srcdir@
 abs_top_builddir = @abs_top_builddir@
 abs_top_builddir = @abs_top_builddir@
@@ -293,6 +310,7 @@ ac_ct_AR = @ac_ct_AR@
 ac_ct_CC = @ac_ct_CC@
 ac_ct_CC = @ac_ct_CC@
 ac_ct_CXX = @ac_ct_CXX@
 ac_ct_CXX = @ac_ct_CXX@
 ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
 ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+ac_cv_sizeof_void_p = @ac_cv_sizeof_void_p@
 am__include = @am__include@
 am__include = @am__include@
 am__leading_dot = @am__leading_dot@
 am__leading_dot = @am__leading_dot@
 am__quote = @am__quote@
 am__quote = @am__quote@
@@ -330,6 +348,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
 srcdir = @srcdir@
@@ -338,7 +357,6 @@ target_alias = @target_alias@
 top_build_prefix = @top_build_prefix@
 top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 top_srcdir = @top_srcdir@
-AM_CPPFLAGS = -I$(srcdir)/../../lib
 benchmark_SOURCES = benchmark.c
 benchmark_SOURCES = benchmark.c
 benchmark_LDADD = ../../lib/libexpat.la
 benchmark_LDADD = ../../lib/libexpat.la
 EXTRA_DIST = \
 EXTRA_DIST = \

+ 4 - 2
libs/expat/tests/benchmark/benchmark.c

@@ -6,8 +6,10 @@
                         \___/_/\_\ .__/ \__,_|\__|
                         \___/_/\_\ .__/ \__,_|\__|
                                  |_| XML parser
                                  |_| XML parser
 
 
-   Copyright (c) 1997-2000 Thai Open Source Software Center Ltd
-   Copyright (c) 2000-2017 Expat development team
+   Copyright (c) 2003-2006 Karl Waclawek <[email protected]>
+   Copyright (c) 2005-2007 Steven Solie <[email protected]>
+   Copyright (c) 2017      Sebastian Pipping <[email protected]>
+   Copyright (c) 2017      Rhodri James <[email protected]>
    Licensed under the MIT license:
    Licensed under the MIT license:
 
 
    Permission is  hereby granted,  free of charge,  to any  person obtaining
    Permission is  hereby granted,  free of charge,  to any  person obtaining

+ 7 - 5
libs/expat/tests/chardata.c

@@ -6,8 +6,12 @@
                         \___/_/\_\ .__/ \__,_|\__|
                         \___/_/\_\ .__/ \__,_|\__|
                                  |_| XML parser
                                  |_| XML parser
 
 
-   Copyright (c) 1997-2000 Thai Open Source Software Center Ltd
-   Copyright (c) 2000-2017 Expat development team
+   Copyright (c) 2002-2004 Fred L. Drake, Jr. <[email protected]>
+   Copyright (c) 2003      Greg Stein <[email protected]>
+   Copyright (c) 2016      Gilles Espinasse <[email protected]>
+   Copyright (c) 2016-2021 Sebastian Pipping <[email protected]>
+   Copyright (c) 2017      Joe Orton <[email protected]>
+   Copyright (c) 2017      Rhodri James <[email protected]>
    Licensed under the MIT license:
    Licensed under the MIT license:
 
 
    Permission is  hereby granted,  free of charge,  to any  person obtaining
    Permission is  hereby granted,  free of charge,  to any  person obtaining
@@ -30,9 +34,7 @@
    USE OR OTHER DEALINGS IN THE SOFTWARE.
    USE OR OTHER DEALINGS IN THE SOFTWARE.
 */
 */
 
 
-#ifdef HAVE_EXPAT_CONFIG_H
-#  include <expat_config.h>
-#endif
+#include <expat_config.h>
 #include "minicheck.h"
 #include "minicheck.h"
 
 
 #include <assert.h>
 #include <assert.h>

+ 3 - 2
libs/expat/tests/chardata.h

@@ -7,8 +7,9 @@
                         \___/_/\_\ .__/ \__,_|\__|
                         \___/_/\_\ .__/ \__,_|\__|
                                  |_| XML parser
                                  |_| XML parser
 
 
-   Copyright (c) 1997-2000 Thai Open Source Software Center Ltd
-   Copyright (c) 2000-2017 Expat development team
+   Copyright (c) 2002-2004 Fred L. Drake, Jr. <[email protected]>
+   Copyright (c) 2017      Rhodri James <[email protected]>
+   Copyright (c) 2017      Sebastian Pipping <[email protected]>
    Licensed under the MIT license:
    Licensed under the MIT license:
 
 
    Permission is  hereby granted,  free of charge,  to any  person obtaining
    Permission is  hereby granted,  free of charge,  to any  person obtaining

+ 2 - 2
libs/expat/tests/memcheck.c

@@ -6,8 +6,8 @@
                         \___/_/\_\ .__/ \__,_|\__|
                         \___/_/\_\ .__/ \__,_|\__|
                                  |_| XML parser
                                  |_| XML parser
 
 
-   Copyright (c) 1997-2000 Thai Open Source Software Center Ltd
-   Copyright (c) 2000-2017 Expat development team
+   Copyright (c) 2017 Rhodri James <[email protected]>
+   Copyright (c) 2017 Sebastian Pipping <[email protected]>
    Licensed under the MIT license:
    Licensed under the MIT license:
 
 
    Permission is  hereby granted,  free of charge,  to any  person obtaining
    Permission is  hereby granted,  free of charge,  to any  person obtaining

+ 2 - 2
libs/expat/tests/memcheck.h

@@ -7,8 +7,8 @@
                         \___/_/\_\ .__/ \__,_|\__|
                         \___/_/\_\ .__/ \__,_|\__|
                                  |_| XML parser
                                  |_| XML parser
 
 
-   Copyright (c) 1997-2000 Thai Open Source Software Center Ltd
-   Copyright (c) 2000-2017 Expat development team
+   Copyright (c) 2017 Rhodri James <[email protected]>
+   Copyright (c) 2017 Sebastian Pipping <[email protected]>
    Licensed under the MIT license:
    Licensed under the MIT license:
 
 
    Permission is  hereby granted,  free of charge,  to any  person obtaining
    Permission is  hereby granted,  free of charge,  to any  person obtaining

Some files were not shown because too many files changed in this diff