Преглед на файлове

--- Merging r17650 into '.':
U rtl/win/wininc/ascdef.inc
--- Merging r17661 into '.':
U packages/winunits-base/src/activex.pp
--- Merging r17679 into '.':
U packages/winunits-jedi/src/jwaadstlb.pas
--- Merging r17723 into '.':
U rtl/objpas/sysutils/sysutils.inc
--- Merging r17747 into '.':
U packages/fcl-image/src/fpreadpnm.pp
U packages/fcl-image/src/fpwritepnm.pp
--- Merging r17749 into '.':
U packages/paszlib/src/zipper.pp
--- Merging r17753 into '.':
U packages/fcl-base/src/win/fileinfo.pp
--- Merging r17768 into '.':
U packages/gtk2/src/pango/pango-font.inc
--- Merging r17791 into '.':
U packages/chm/src/chmreader.pas
--- Merging r17792 into '.':
G packages/fcl-base/src/win/fileinfo.pp
--- Merging r17799 into '.':
G packages/chm/src/chmreader.pas
--- Merging r17838 into '.':
U packages/numlib/src/ipf.pas
--- Merging r17839 into '.':
U packages/numlib/src/sle.pas
U packages/numlib/src/mdt.pas
U packages/numlib/src/spe.pas
--- Merging r17856 into '.':
U packages/fpvectorial/src/epsvectorialreader.pas
U packages/fpvectorial/src/fpvtocanvas.pas
--- Merging r17860 into '.':
U packages/fcl-passrc/src/pparser.pp
--- Merging r17910 into '.':
U rtl/solaris/unxsockh.inc

# revisions: 17650,17661,17679,17716,17717,17723,17747,17749,17753,17768,17791,17792,17799,17838,17839,17856,17860,17910
------------------------------------------------------------------------
r17650 | florian | 2011-06-03 15:02:30 +0200 (Fri, 03 Jun 2011) | 1 line
Changed paths:
M /trunk/rtl/win/wininc/ascdef.inc

* line > 255 chars wrapped
------------------------------------------------------------------------
------------------------------------------------------------------------
r17661 | florian | 2011-06-05 12:06:37 +0200 (Sun, 05 Jun 2011) | 1 line
Changed paths:
M /trunk/packages/winunits-base/src/activex.pp

* fixed naming of IConnectionPoint.EnumConnections method, resolves #19485
------------------------------------------------------------------------
------------------------------------------------------------------------
r17679 | marco | 2011-06-06 22:20:36 +0200 (Mon, 06 Jun 2011) | 2 lines
Changed paths:
M /trunk/packages/winunits-jedi/src/jwaadstlb.pas

* correct sys_win64. Mantis #19492

------------------------------------------------------------------------
------------------------------------------------------------------------
r17716 | marco | 2011-06-11 10:46:35 +0200 (Sat, 11 Jun 2011) | 2 lines
Changed paths:
M /trunk/packages/fcl-image/src/fpwritepng.pp

* ability to set png writer's zlib Compressionlevel, fixes Mantis #19224

------------------------------------------------------------------------
------------------------------------------------------------------------
r17717 | michael | 2011-06-11 13:36:51 +0200 (Sat, 11 Jun 2011) | 6 lines
Changed paths:
M /trunk/rtl/objpas/sysutils/filutilh.inc
M /trunk/rtl/objpas/sysutils/sysutils.inc

* Changed FileSearch to handle a set of options instead of boolean.
Options now include stripquotes
* Changed ExeSearch so dirlist is optional and PATH is used if omitted.
It uses stripQuotes on windows. (bug 19282)


------------------------------------------------------------------------
------------------------------------------------------------------------
r17723 | marco | 2011-06-12 00:26:42 +0200 (Sun, 12 Jun 2011) | 1 line
Changed paths:
M /trunk/rtl/objpas/sysutils/sysutils.inc

* fix typos in windows implementation r17717
------------------------------------------------------------------------
------------------------------------------------------------------------
r17747 | michael | 2011-06-13 21:07:29 +0200 (Mon, 13 Jun 2011) | 1 line
Changed paths:
M /trunk/packages/fcl-image/src/fpreadpnm.pp
M /trunk/packages/fcl-image/src/fpwritepnm.pp

* Applied patches by "circular", bug #18863
------------------------------------------------------------------------
------------------------------------------------------------------------
r17749 | michael | 2011-06-14 08:39:38 +0200 (Tue, 14 Jun 2011) | 1 line
Changed paths:
M /trunk/packages/paszlib/src/zipper.pp

* Deprecated files property. Files and entries can now be used simultaneously
------------------------------------------------------------------------
------------------------------------------------------------------------
r17753 | michael | 2011-06-14 20:18:05 +0200 (Tue, 14 Jun 2011) | 1 line
Changed paths:
M /trunk/packages/fcl-base/src/win/fileinfo.pp

* More flexible fileinfo unit (bug 17252)
------------------------------------------------------------------------
------------------------------------------------------------------------
r17768 | marco | 2011-06-19 19:04:03 +0200 (Sun, 19 Jun 2011) | 2 lines
Changed paths:
M /trunk/packages/gtk2/src/pango/pango-font.inc

* add pango_font_family_is_monospace, patch from C. Western. Mantis #19585

------------------------------------------------------------------------
------------------------------------------------------------------------
r17791 | marco | 2011-06-22 11:25:32 +0200 (Wed, 22 Jun 2011) | 2 lines
Changed paths:
M /trunk/packages/chm/src/chmreader.pas

* fixed two memleaks in chmreader. Patch based on the one in Mantis #19599 by Anton

------------------------------------------------------------------------
------------------------------------------------------------------------
r17792 | marco | 2011-06-22 11:29:32 +0200 (Wed, 22 Jun 2011) | 2 lines
Changed paths:
M /trunk/packages/fcl-base/src/win/fileinfo.pp

* Patch from Mantis #19596 that reads comment again, which was erased by the last commit.

------------------------------------------------------------------------
------------------------------------------------------------------------
r17799 | marco | 2011-06-22 18:41:42 +0200 (Wed, 22 Jun 2011) | 2 lines
Changed paths:
M /trunk/packages/chm/src/chmreader.pas

* Fix typo in earlier commit

------------------------------------------------------------------------
------------------------------------------------------------------------
r17838 | marco | 2011-06-26 22:14:13 +0200 (Sun, 26 Jun 2011) | 2 lines
Changed paths:
M /trunk/packages/numlib/src/ipf.pas

* Fix from A. Klenin wrt out of bounds in ipfisn, mantis #19634

------------------------------------------------------------------------
------------------------------------------------------------------------
r17839 | marco | 2011-06-26 22:20:01 +0200 (Sun, 26 Jun 2011) | 3 lines
Changed paths:
M /trunk/packages/numlib/src/mdt.pas
M /trunk/packages/numlib/src/sle.pas
M /trunk/packages/numlib/src/spe.pas

* Fixes Mantis #19635, various small issues reported by A. Klenin.
Slightly different than the patch though (commenting/ifdefing instead of removal)

------------------------------------------------------------------------
------------------------------------------------------------------------
r17856 | sekelsenmat | 2011-06-28 17:55:35 +0200 (Tue, 28 Jun 2011) | 1 line
Changed paths:
M /trunk/packages/fpvectorial/src/epsvectorialreader.pas
M /trunk/packages/fpvectorial/src/fpvtocanvas.pas

fpvectorial: Vast improvements to the PostScript interpreter, fixes running procedures
------------------------------------------------------------------------
------------------------------------------------------------------------
r17860 | marco | 2011-06-28 22:34:33 +0200 (Tue, 28 Jun 2011) | 2 lines
Changed paths:
M /trunk/packages/fcl-passrc/src/pparser.pp

* small checks added to avoid accessing potentially unalloced mem.

------------------------------------------------------------------------
------------------------------------------------------------------------
r17910 | marco | 2011-07-01 22:50:49 +0200 (Fri, 01 Jul 2011) | 2 lines
Changed paths:
M /trunk/rtl/solaris/unxsockh.inc

* constants for sockets unit of Solaris by L. Brands, mantis #19665

------------------------------------------------------------------------

git-svn-id: branches/fixes_2_4@17974 -

marco преди 14 години
родител
ревизия
dec818941f

+ 10 - 2
packages/chm/src/chmreader.pas

@@ -1205,7 +1205,8 @@ begin
     begin
       sitemap.free;
       Result:=AbortAndTryTextual;
-    end;
+    end
+  else Index.Free;
 end;
 
 function TChmReader.GetTOCSitemap(ForceXML:boolean=false): TChmSiteMap;
@@ -1281,7 +1282,7 @@ begin
      Exit;
    end;
 
-   // Binary Toc Exists
+     // Binary Toc Exists
    Result := TChmSiteMap.Create(stTOC);
 
    EntryInfoOffset := NtoLE(TOC.ReadDWord);
@@ -1289,10 +1290,17 @@ begin
    EntryCount      := NtoLE(TOC.ReadDWord);
    TOPICSOffset    := NtoLE(TOC.ReadDWord);
 
+   if EntryCount = 0 then
+     begin
+       Toc.Free;
+       Exit;
+     end;
+
    NextItem := EntryInfoOffset;
    repeat
      NextItem := AddTOCItem(Toc, NextItem, Result.Items);
    until NextItem = 0;
+   TOC.Free;
 end;
 
 function TChmReader.HasContextList: Boolean;

+ 130 - 68
packages/fcl-base/src/win/fileinfo.pp

@@ -15,6 +15,12 @@
 
  Based on getver by Bernd Juergens - Munich, Germany
  email :[email protected]
+ 
+ reworked by Stoian Ivanov ([email protected])
+     Added ExtraVersionStrings,TryHardcodedTrans.
+     Using VersionCategories.Objects as TransID storage,
+     which is used later by getVersionSetting
+
 
  Usage : Drop component on form. Set desired file name using
          FileVersionInfo.filename := 'c:\winnt\system32\comctl32.dll'
@@ -26,7 +32,9 @@
          showMessage(FileVersionInfo1.getVersionSetting('ProductVersion'));
 }
 unit fileinfo;
+
 {$mode objfpc}
+{$h+}
 interface
 
 uses
@@ -35,28 +43,39 @@ uses
 
 { Record to receive charset }
 type TTranslation = record
-   langID  : WORD;
-   charset  : WORD;
+  case byte of 
+   1: (langID,charset  : WORD);
+   2: (transid:Dword);
 end;
 
+PTranslation=^TTranslation;
+
 type
+  { TFileVersionInfo }
+
   TFileVersionInfo = class(TComponent)
   private
     FFileName : String;
     FmyVersionStrings : TStringList;
-    FmyVersionCategories    : TStringList;
+    FmyVersionCategories : TStringList;
 
-    procedure SetFileName (inp : string);
+    FmyExtraVersionStrings :TStringList;
+    FmyTryHardcodedTrans :TStringList;
+  
+    procedure SetFileName (Const inp : string);
     procedure readVersionFromFile;
-  protected
   public
-     constructor Create(AOwner: TComponent);  override;
-     destructor Destroy; override;
-     function getVersionSetting(inp : string): String;
+    constructor Create(AOwner: TComponent);  override;
+    destructor Destroy; override;
+    procedure AddExtraVersionString (Const extrafield:string);
+    procedure AddTryHardcodedTrans (Const hardtrans:string);
+    function getVersionSetting(Const inp : string; transid:dword=0): String;
   published
     property fileName : string  read FFileName write SetFileName;
     property VersionStrings  : TStringList  read FmyVersionStrings;
     property VersionCategories : TStringList read FmyVersionCategories;
+    property ExtraVersionStrings : TStringList read FmyExtraVersionStrings;
+    property TryHardcodedTrans :TStringList read FmyTryHardcodedTrans;
   end;
 
 implementation
@@ -67,7 +86,13 @@ constructor TFileVersionInfo.Create(AOwner: TComponent);
 begin
   inherited Create(AOwner);
   FmyVersionStrings := TStringList.Create;
+  FmyVersionStrings.Duplicates:=dupAccept;
   FmyVersionCategories  := TStringList.Create;
+  FmyVersionCategories.Duplicates:=dupAccept;
+  FmyExtraVersionStrings := TStringList.Create;
+  FmyExtraVersionStrings.Duplicates:= dupIgnore;
+  FmyTryHardcodedTrans:=TStringList.Create;
+  FmyTryHardcodedTrans.Duplicates:=dupIgnore;
   FFileName := '';
 end;
 
@@ -75,41 +100,56 @@ destructor TFileVersionInfo.Destroy;
 begin
   FmyVersionCategories.Free;
   FmyVersionStrings.Free;
+  FmyExtraVersionStrings.Free;
+  FmyTryHardcodedTrans.free;
   inherited;
 end;
 
-{ Get filename, check if file exists and read info from file }
-procedure TFileVersionInfo.SetFileName (inp : string);
+{if you need other version strings extracted you add them here}
+procedure TFileVersionInfo.AddExtraVersionString(Const extrafield: string); 
 begin
-    FmyVersionStrings.clear;
-    FmyVersionCategories.clear;
+  FmyExtraVersionStrings.add (extrafield);
+end;
 
-    if fileexists(inp) then
+{some broken DLLs report wrong translations and you need to try some hardcoded transes
+like NPSWF32.dll reports 040904b0(English/Unicode) but they are actualy 040904E4 (English/Latin1)}
+procedure TFileVersionInfo.AddTryHardcodedTrans(Const hardtrans: string);
+begin
+  FmyTryHardcodedTrans.add(hardtrans);
+end;
+
+{ Get filename, check if file exists and read info from file }
+procedure TFileVersionInfo.SetFileName (Const inp : string);
+begin
+  FmyVersionStrings.clear;
+  FmyVersionCategories.clear;
+  if FileExists(inp) then
     begin
-         FFileName := inp;
-         readVersionFromFile;
+    FFileName := inp;
+    readVersionFromFile;
     end
-    else
-    begin
-         FFileName := '';
-    end;
+  else
+    FFileName := '';
 end;
 
 { read info from file }
 procedure TFileVersionInfo.readVersionFromFile;
-var struSize : Dword;
-    dwBytes,someDummy : Dword;
-    a,txt : array[0..256] of char;
-    p : pchar;
-    i : integer;
-    pp : pointer;
-    theFixedInfo : TVSFixedFileInfo;
-    theTrans : TTranslation;
-    s : string;
-    ts  : TStringList;
+var
+  struSize : Dword;
+  dwBytes : Dword;
+  dwTransBytes:Dword;
+  vi : pointer;
+  ti,i,hti : integer;
+  pp : pointer;
+  theTrans : PTranslation;
+  s : string;
+  ts  : TStringList;
+  transstr:String;
+  //s_w : Widestring; //urf or not really does not matter
 begin
   ts := TStringList.Create;
   try
+    ts.Assign(FmyExtraVersionStrings);
     ts.add('Comments');
     ts.add('CompanyName');
     ts.add('FileDescription');
@@ -119,58 +159,80 @@ begin
     ts.add('OriginalFilename');
     ts.add('ProductName');
     ts.add('ProductVersion');
-
-    strPCopy(a,FFileName);
-    { get size of data }
-    struSize := GetFileVersionInfoSize(a,@someDummy);
+    struSize := GetFileVersionInfoSize(Pchar(FFileName),nil);
     if struSize=0 then exit;
-    p := NIL;
+    vi := NIL;
+    { get memory }
+    GetMem(vi,struSize+10);
     try
-      { get memory }
-      GetMem(p,struSize+10);
+      if (vi=nil) then
+        exit;
       { get data }
-      if not GetFileVersionInfo(a,0,struSize,p) then exit;
-      { get root info }
-      if not VerQueryValue(p,'\',pp,dwBytes) then exit;
-      move(pp^,theFixedInfo,dwBytes);
-
+      if not GetFileVersionInfo(PChar(FFileName),0,struSize,vi) then
+        exit;
       { get translation info }
-      if not VerQueryValue(p,'\VarFileInfo\Translation',pp,dwBytes) then
+      if not VerQueryValue(vi,'\VarFileInfo\Translation',theTrans,dwTransBytes) then 
         exit;
-      move(pp^,theTrans,dwBytes);
-
-      { iterate over defined items }
-      for i:=0 to ts.count-1 do
-      begin
-        s := '\StringFileInfo\'+inttohex(theTrans.langID,4)+inttohex(theTrans.charset,4)+'\'+ts[i];
-        StrPCopy(a,s);
-        if not VerQueryValue(p,a,pp,dwBytes) then Continue;
-        if dwBytes>0 then
+      while (dwTransBytes>=sizeof(TTranslation)) do 
         begin
-         move(pp^,txt,dwBytes);
-         FmyVersionCategories.add(ts[i]);
-         FmyVersionStrings.add(StrPas(txt));
-        end
-      end;
+        transstr:=inttohex(theTrans^.langID,4)+inttohex(theTrans^.charset,4);
+        { iterate over defined items }
+        for i:=0 to ts.count-1 do 
+          begin
+          s:='\StringFileInfo\'+transstr+'\'+ts[i]+#0;
+          if not VerQueryValue(vi,@s[1],pp,dwBytes) then continue;
+          if dwBytes>0 then 
+            begin
+            SetLength(s,dwBytes-1);
+            move(pp^,s[1],dwBytes-1);
+            FmyVersionCategories.AddObject(LowerCase(ts[i]),TObject(pointer(theTrans^.transid)));
+            FmyVersionStrings.add(s);
+            end
+          end;
+        inc (theTrans);
+        dec (dwTransBytes,sizeof(TTranslation));
+        end;
+        
+      {Now with the dirty hardcoded hack}
+      for hti:=0 to FmyTryHardcodedTrans.Count-1 do 
+        begin
+        transstr:=FmyTryHardcodedTrans[hti];
+        for i:=0 to ts.count-1 do 
+          begin
+          s := '\StringFileInfo\'+transstr+'\'+ts[i]+#0;
+          if VerQueryValue(vi,@s[1],pp,dwBytes) and (dwbytes>0) then
+            begin
+            SetLength(s,dwBytes-1);
+            move(pp^,s[1],dwBytes-1);
+            FmyVersionCategories.AddObject(LowerCase(ts[i]),TObject(pointer(theTrans^.transid)));
+            FmyVersionStrings.add(s);
+            end
+          end;
+        end;
     finally
-      { release memory }
-      FreeMem(p);
-    end;
-  finally ts.Free end;
+      FreeMem(vi);
+    end;  
+  Finally  
+    ts.Free
+  end;  
 end;
 
 { get single version string }
-function TFileVersionInfo.getVersionSetting(inp : string): String;
-var i : integer;
+function TFileVersionInfo.getVersionSetting(Const inp : string; transid:dword=0): String;
+var
+  i : integer;
+  s,v : string;
 begin
-  inp:=LowerCase(inp);
-  for i:= 0 to FmyVersionCategories.Count -1 do
-    if LowerCase(FmyVersionCategories[i])=inp then
+  s:=LowerCase(inp);
+  I:=0;
+  Result:='';
+  While (Result='') and (i<FmyVersionCategories.Count -1) do
     begin
-      result := FmyVersionStrings[i];
-      Exit;
+    V:=FmyVersionCategories[i];
+    if (V=S) and ((transid=0) or (transid=dword(pointer(FmyVersionCategories.Objects[i])))) then
+      Result:=FmyVersionStrings[i];
+    inc(I);
     end;
-  result := '';
 end;
 
 end.

+ 26 - 21
packages/fcl-image/src/fpreadpnm.pp

@@ -19,7 +19,7 @@ The PNM (Portable aNyMaps) is a generic name for :
   PBM : Portable BitMaps,
   PGM : Portable GrayMaps,
   PPM : Portable PixMaps.
-There is no file format associated  with PNM itself.}
+There is normally no file format associated  with PNM itself.}
 
 {$mode objfpc}{$h+}
 unit FPReadPNM;
@@ -85,7 +85,7 @@ begin
     repeat
       Inc(s[0]);
       ReadBuffer(s[Length(s)+1],1)
-    until s[Length(s)+1] in WhiteSpaces;
+    until (s[0]=#7) or (s[Length(s)+1] in WhiteSpaces);
   Result:=StrToInt(s);
 end;
 
@@ -112,10 +112,10 @@ begin
   If (FWidth<=0) or (FHeight<=0) or (FMaxVal<=0) then
     Raise Exception.Create('Invalid PNM header data');
   case FBitMapType of
-    1: FBitPP := SizeOf(Word);
+    1: FBitPP := 1;                  // 1bit PP (text)
     2: FBitPP := 8 * SizeOf(Word);   // Grayscale (text)
     3: FBitPP := 8 * SizeOf(Word)*3; // RGB (text)
-    4: FBitPP := 1; // 1bit PP (row)
+    4: FBitPP := 1;            // 1bit PP (raw)
     5: If (FMaxval>255) then   // Grayscale (raw);
          FBitPP:= 8 * 2
        else
@@ -136,7 +136,7 @@ var
 begin
   ReadHeader(Stream);
   Img.SetSize(FWidth,FHeight);
-  FScanLineSize:=(FBitPP*FWidth+7) shr 3;  // (bits/line +7)
+  FScanLineSize:=FBitPP*((FWidth+7)shr 3);
   GetMem(FScanLine,FScanLineSize);
   try
     for Row:=0 to img.Height-1 do
@@ -153,18 +153,21 @@ procedure TFPReaderPNM.ReadScanLine(Row : Integer; Stream:TStream);
 
 Var
   P : PWord;
-  I,j : Integer;
+  I,j,bitsLeft : Integer;
+  PB: PByte;
 
 begin
   Case FBitmapType of
     1 : begin
-        P:=PWord(FScanLine);
+        PB:=FScanLine;
         For I:=0 to ((FWidth+7)shr 3)-1 do
           begin
-            P^:=0;
-            for j:=0 to 7 do
-              P^:=(P^ shr 1)or ReadInteger(Stream);
-            Inc(P);
+            PB^:=0;
+            bitsLeft := FWidth-(I shl 3)-1;
+            if bitsLeft > 7 then bitsLeft := 7;
+            for j:=0 to bitsLeft do
+              PB^:=PB^ or (ReadInteger(Stream) shl (7-j));
+            Inc(PB);
           end;
         end;
     2 : begin
@@ -219,26 +222,26 @@ Var
 
   Var
     P : PByte;
-    I,j,x : Integer;
+    I,j,x,bitsLeft : Integer;
 
   begin
     P:=PByte(FScanLine);
-    x:=7;
     For I:=0 to ((FWidth+7)shr 3)-1 do
       begin
       L:=P^;
-      for j:=0 to 7 do
+      x := I shl 3;
+      bitsLeft := FWidth-x-1;
+      if bitsLeft > 7 then bitsLeft := 7;
+      for j:=0 to bitsLeft do
         begin
-        if x < FWidth then
-          if odd(L) then
+          if L and $80 <> 0 then
             Img.Colors[x,Row]:=colBlack
           else
             Img.Colors[x,Row]:=colWhite;
-        L:=L shr 1;
-        dec(x);
+          L:=L shl 1;
+          inc(x);
         end;
       Inc(P);
-      Inc(x,16);
       end;
   end;
 
@@ -324,7 +327,7 @@ begin
   C.Alpha:=AlphaOpaque;
   Scale := FMaxVal*(FMaxVal+1) + FMaxVal;
   Case FBitmapType of
-    1 : ;
+    1 : ByteBnWScanLine;
     2 : WordGrayScanline;
     3 : WordRGBScanline;
     4 : ByteBnWScanLine;
@@ -340,5 +343,7 @@ begin
 end;
 
 initialization
-  ImageHandlers.RegisterImageReader ('PNM Format', 'PNM;PGM;PBM', TFPReaderPNM);
+
+  ImageHandlers.RegisterImageReader ('Netpbm format', 'PNM;PGM;PBM;PPM', TFPReaderPNM);
+
 end.

+ 156 - 18
packages/fcl-image/src/fpwritepnm.pp

@@ -19,29 +19,103 @@
     * PPM (P5,P6) : Portable PixelMap foramt : 24 bits per pixel}
 {$mode objfpc}{$h+}
 unit FPWritePNM;
+
 interface
 
 uses FPImage, classes, sysutils;
 
 type
+  TPNMColorDepth = (pcdAuto,pcdBlackWhite, pcdGrayscale, pcdRGB);
+
+  { TFPWriterPNM }
 
   TFPWriterPNM = class(TFPCustomImageWriter)
-    private
-      BitMapType:Integer;
     protected
       procedure InternalWrite(Stream:TStream;Img:TFPCustomImage);override;
     public
-      constructor Create(aBitMapType:Integer);
+      ColorDepth: TPNMColorDepth;
+      BinaryFormat: boolean;
+      function GuessColorDepthOfImage(Img: TFPCustomImage): TPNMColorDepth;
+      function GetColorDepthOfExtension(AExtension: string): TPNMColorDepth;
+      function GetFileExtension(AColorDepth: TPNMColorDepth): string;
+      constructor Create; override;
+  end;
+
+  { TFPWriterPBM }
+
+  TFPWriterPBM = class(TFPWriterPNM)
+      constructor Create; override;
   end;
 
+  { TFPWriterPGM }
+
+  TFPWriterPGM = class(TFPWriterPNM)
+      constructor Create; override;
+  end;
+
+  { TFPWriterPPM }
+
+  TFPWriterPPM = class(TFPWriterPNM)
+      constructor Create; override;
+  end;
+
+procedure SaveImageToPNMFile(Img: TFPCustomImage; filename: string; UseBinaryFormat: boolean = true);
+
 implementation
 
-constructor TFPWriterPNM.Create(aBitMapType:Integer);
+procedure SaveImageToPNMFile(Img: TFPCustomImage; filename: string; UseBinaryFormat: boolean = true);
+var writer: TFPWriterPNM;
+    curExt: string;
+begin
+  writer := TFPWriterPNM.Create;
+  writer.BinaryFormat := UseBinaryFormat;
+  curExt := Lowercase(ExtractFileExt(filename));
+  if (curExt='.pnm') or (curExt='') then
   begin
-    inherited Create;
-    BitMapType:=aBitMapType;
-  end;
+    writer.ColorDepth := writer.GuessColorDepthOfImage(Img);
+    filename := ChangeFileExt(filename,'.'+writer.GetFileExtension(writer.ColorDepth));
+  end else
+    writer.ColorDepth := writer.GetColorDepthOfExtension(curExt);
+  Img.SaveToFile(filename,writer);
+  writer.Free;
+end;
+
+{ TFPWriterPPM }
+
+constructor TFPWriterPPM.Create;
+begin
+  inherited Create;
+  ColorDepth := pcdRGB;
+end;
+
+{ TFPWriterPGM }
+
+constructor TFPWriterPGM.Create;
+begin
+  inherited Create;
+  ColorDepth := pcdGrayscale;
+end;
+
+{ TFPWriterPBM }
+
+constructor TFPWriterPBM.Create;
+begin
+  inherited Create;
+  ColorDepth:= pcdBlackWhite;
+end;
+
+{ TFPWriterPNM }
+
+constructor TFPWriterPNM.Create;
+begin
+  inherited Create;
+  ColorDepth := pcdAuto;
+  BinaryFormat := True;
+end;
+
 procedure TFPWriterPNM.InternalWrite(Stream:TStream;Img:TFPCustomImage);
+var useBitMapType: integer;
+
   function SaveHeader(stream:TStream):boolean;
     const
       MagicWords:Array[1..6]OF String[2]=('P1','P2','P3','P4','P5','P6');
@@ -55,8 +129,8 @@ procedure TFPWriterPNM.InternalWrite(Stream:TStream;Img:TFPCustomImage);
           Str(Img.Width,StrWidth);
           Str(Img.Height,StrHeight);
         end;
-      PNMInfo:=Concat(MagicWords[BitMapType],#10,StrWidth,#32,StrHeight,#10);
-      if BitMapType in [2,3,5,6]
+      PNMInfo:=Concat(MagicWords[useBitMapType],#10,StrWidth,#32,StrHeight,#10);
+      if useBitMapType in [2,3,5,6]
       then
         PNMInfo:=Concat(PNMInfo,'255'#10);
       stream.seek(0,soFromBeginning);
@@ -68,18 +142,31 @@ procedure TFPWriterPNM.InternalWrite(Stream:TStream;Img:TFPCustomImage);
     aColor:TFPColor;
     aLine:PByte;
     strCol:String[3];
+    LinuxEndOfLine: char;
+    UseColorDepth: TPNMColorDepth;
+
   begin
+    LinuxEndOfLine := #10;
+
+    //determine color depth
+    if ColorDepth = pcdAuto then
+      UseColorDepth := GuessColorDepthOfImage(Img) else
+      UseColorDepth := ColorDepth;
+
+    //determine file format number (1-6)
+    case UseColorDepth of
+      pcdBlackWhite: useBitMapType := 1;
+      pcdGrayscale: useBitMapType := 2;
+      pcdRGB: useBitMapType := 3;
+    end;
+    if BinaryFormat then inc(useBitMapType,3);
+
     SaveHeader(Stream);
-    case BitMapType of
+    case useBitMapType of
       1:nBpLine:=Img.Width*2;{p p p}
       2:nBpLine:=Img.Width*4;{lll lll lll}
       3:nBpLine:=Img.Width*3*4;{rrr ggg bbb rrr ggg bbb}
-      4:begin
-          nBpLine:=Img.Width SHR 3;
-          if(Img.Width AND $0F)<>0
-          then
-            Inc(nBpLine);
-        end;
+      4:nBpLine:=(Img.Width+7) SHR 3;
       5:nBpLine:=Img.Width;
       6:nBpLine:=Img.Width*3;
     end;
@@ -91,7 +178,7 @@ procedure TFPWriterPNM.InternalWrite(Stream:TStream;Img:TFPCustomImage);
           begin
             aColor:=img.Colors[Coulumn,Row];
             with aColor do
-              case BitMapType of
+              case useBitMapType of
                 1:begin
                     if(Red<=$2F00)or(Green<=$2F00)or(Blue<=$2F00)
                     then
@@ -136,10 +223,61 @@ procedure TFPWriterPNM.InternalWrite(Stream:TStream;Img:TFPCustomImage);
             end;
           end;
         Stream.Write(aLine^,nBpLine);
+        if useBitMapType in[1..3] then Stream.Write(LinuxEndOfLine,1);
       end;
     FreeMem(aLine,nBpLine);
   end;
 
+function TFPWriterPNM.GetColorDepthOfExtension(AExtension: string
+  ): TPNMColorDepth;
+begin
+  if (length(AExtension) > 0) and (AExtension[1]='.') then
+    delete(AExtension,1,1);
+  AExtension := LowerCase(AExtension);
+  if AExtension='pbm' then result := pcdBlackWhite else
+  if AExtension='pgm' then result := pcdGrayscale else
+  if AExtension='ppm' then result := pcdRGB else
+    result := pcdAuto;
+end;
+
+function TFPWriterPNM.GuessColorDepthOfImage(Img: TFPCustomImage): TPNMColorDepth;
+var Row, Col: integer;
+    aColor: TFPColor;
+begin
+   result := pcdBlackWhite;
+   for Row:=0 to img.Height-1 do
+     for Col:=0 to img.Width-1 do
+     begin
+       aColor:=img.Colors[Col,Row];
+       if (AColor.red >= 256) and (AColor.green >= 256) and (AColor.blue >= 256) and
+          (AColor.red < $FF00) and (AColor.green < $FF00) and (AColor.blue < $FF00) then
+       begin
+          if (AColor.red shr 8 <> AColor.Green shr 8) or
+             (AColor.blue shr 8 <> AColor.Green shr 8) or
+             (AColor.red shr 8 <> AColor.blue shr 8) then
+          begin
+             result := pcdRGB;
+             exit;
+          end else
+            result := pcdGrayscale;
+       end;
+     end;
+end;
+
+function TFPWriterPNM.GetFileExtension(AColorDepth: TPNMColorDepth): string;
+begin
+  case AColorDepth of
+    pcdBlackWhite: result := 'pbm';
+    pcdGrayscale: result := 'pgm';
+    pcdRGB: result := 'ppm';
+  else
+    result := 'pnm';
+  end;
+end;
+
 initialization
-  ImageHandlers.RegisterImageWriter ('PBM Format', 'pbm', TFPWriterPNM);
+  ImageHandlers.RegisterImageWriter ('Netpbm Portable aNyMap', 'pnm', TFPWriterPNM);
+  ImageHandlers.RegisterImageWriter ('Netpbm Portable BitMap', 'pbm', TFPWriterPBM);
+  ImageHandlers.RegisterImageWriter ('Netpbm Portable GrayMap', 'pgm', TFPWriterPGM);
+  ImageHandlers.RegisterImageWriter ('Netpbm Portable PixelMap', 'ppm', TFPWriterPPM);
 end.

+ 3 - 3
packages/fcl-passrc/src/pparser.pp

@@ -3524,18 +3524,18 @@ var
       Move(Start^, s[1], l)
     else
       exit;
-    if s[1] = '-' then
+    if (s[1] = '-') and (length(s)>1) then
     begin
       case s[2] of
         'd': // -d define
           Scanner.Defines.Append(UpperCase(Copy(s, 3, Length(s))));
         'F': // -F
-          if s[3] = 'i' then // -Fi include path
+          if (length(s)>2) and (s[3] = 'i') then // -Fi include path
             FileResolver.AddIncludePath(Copy(s, 4, Length(s)));
         'I': // -I include path
           FileResolver.AddIncludePath(Copy(s, 3, Length(s)));
         'S': // -S mode
-          if s[3]='d' then
+          if  (length(s)>2) and (s[3]='d') then
             begin // -Sd mode delphi
               include(Scanner.Options,po_delphi);
               include(Parser.Options,po_delphi);

Файловите разлики са ограничени, защото са твърде много
+ 602 - 105
packages/fpvectorial/src/epsvectorialreader.pas


+ 43 - 17
packages/fpvectorial/src/fpvtocanvas.pas

@@ -31,7 +31,7 @@ procedure DrawFPVTextToCanvas(ASource: TvVectorialDocument; CurText: TvText;
 implementation
 
 {$ifndef Windows}
-{$define FPVECTORIALDEBUG}
+{.$define FPVECTORIAL_TOCANVAS_DEBUG}
 {$endif}
 
 function Rotate2DPoint(P,Fix :TPoint; alpha:double): TPoint;
@@ -112,6 +112,10 @@ begin
 
   for i := 0 to ASource.GetEntitiesCount - 1 do
   begin
+    {$ifdef FPVECTORIAL_TOCANVAS_DEBUG}
+    Write(Format('[Path] ID=%d', [i]));
+    {$endif}
+
     CurEntity := ASource.GetEntity(i);
 
     if CurEntity is TPath then DrawFPVPathToCanvas(ASource, TPath(CurEntity), ADest, ADestX, ADestY, AMulX, AMulY)
@@ -119,7 +123,7 @@ begin
     else DrawFPVEntityToCanvas(ASource, CurEntity, ADest, ADestX, ADestY, AMulX, AMulY);
   end;
 
-  {$ifdef FPVECTORIALDEBUG}
+  {$ifdef FPVECTORIAL_TOCANVAS_DEBUG}
   WriteLn(':<DrawFPVectorialToCanvas');
   {$endif}
 end;
@@ -140,7 +144,8 @@ procedure DrawFPVPathToCanvas(ASource: TvVectorialDocument; CurPath: TPath;
 
 var
   j, k: Integer;
-  PosX, PosY: Integer; // Not modified by ADestX, etc
+  PosX, PosY: Double; // Not modified by ADestX, etc
+  CoordX, CoordY: Integer;
   CurSegment: TPathSegment;
   Cur2DSegment: T2DSegment absolute CurSegment;
   Cur2DBSegment: T2DBezierSegment absolute CurSegment;
@@ -164,10 +169,6 @@ begin
   ADest.Pen.FPColor := CurPath.Pen.Color;
   ADest.Brush.FPColor := CurPath.Brush.Color;
 
-  {$ifdef FPVECTORIAL_TOCANVAS_DEBUG}
-  Write(Format('[Path] ID=%d', [i]));
-  {$endif}
-
   for j := 0 to CurPath.Len - 1 do
   begin
     //WriteLn('j = ', j);
@@ -176,9 +177,13 @@ begin
     case CurSegment.SegmentType of
     stMoveTo:
     begin
-      ADest.MoveTo(CoordToCanvasX(Cur2DSegment.X), CoordToCanvasY(Cur2DSegment.Y));
+      CoordX := CoordToCanvasX(Cur2DSegment.X);
+      CoordY := CoordToCanvasY(Cur2DSegment.Y);
+      ADest.MoveTo(CoordX, CoordY);
+      PosX := Cur2DSegment.X;
+      PosY := Cur2DSegment.Y;
       {$ifdef FPVECTORIAL_TOCANVAS_DEBUG}
-      Write(Format(' M%d,%d', [CoordToCanvasX(Cur2DSegment.X), CoordToCanvasY(Cur2DSegment.Y)]));
+      Write(Format(' M%d,%d', [CoordY, CoordY]));
       {$endif}
     end;
     // This element can override temporarely the Pen
@@ -186,7 +191,11 @@ begin
     begin
       ADest.Pen.FPColor := T2DSegmentWithPen(Cur2DSegment).Pen.Color;
 
-      ADest.LineTo(CoordToCanvasX(Cur2DSegment.X), CoordToCanvasY(Cur2DSegment.Y));
+      CoordX := CoordToCanvasX(Cur2DSegment.X);
+      CoordY := CoordToCanvasY(Cur2DSegment.Y);
+      ADest.LineTo(CoordX, CoordY);
+      PosX := Cur2DSegment.X;
+      PosY := Cur2DSegment.Y;
 
       ADest.Pen.FPColor := CurPath.Pen.Color;
 
@@ -196,9 +205,13 @@ begin
     end;
     st2DLine, st3DLine:
     begin
-      ADest.LineTo(CoordToCanvasX(Cur2DSegment.X), CoordToCanvasY(Cur2DSegment.Y));
+      CoordX := CoordToCanvasX(Cur2DSegment.X);
+      CoordY := CoordToCanvasY(Cur2DSegment.Y);
+      ADest.LineTo(CoordX, CoordY);
+      PosX := Cur2DSegment.X;
+      PosY := Cur2DSegment.Y;
       {$ifdef FPVECTORIAL_TOCANVAS_DEBUG}
-      Write(Format(' L%d,%d', [CoordToCanvasX(Cur2DSegment.X), CoordToCanvasY(Cur2DSegment.Y)]));
+      Write(Format(' L%d,%d', [CoordX, CoordY]));
       {$endif}
     end;
     { To draw a bezier we need to divide the interval in parts and make
@@ -206,8 +219,8 @@ begin
     st2DBezier, st3DBezier:
     begin
       CurveLength :=
-        Round(sqrt(sqr(Cur2DBSegment.X3 - PosX) + sqr(Cur2DBSegment.Y3 - PosY))) +
-        Round(sqrt(sqr(Cur2DBSegment.X2 - Cur2DBSegment.X3) + sqr(Cur2DBSegment.Y2 - Cur2DBSegment.Y3))) +
+        Round(sqrt(sqr(Cur2DBSegment.X2 - PosX) + sqr(Cur2DBSegment.Y2 - PosY))) +
+        Round(sqrt(sqr(Cur2DBSegment.X3 - Cur2DBSegment.X2) + sqr(Cur2DBSegment.Y3 - Cur2DBSegment.Y2))) +
         Round(sqrt(sqr(Cur2DBSegment.X - Cur2DBSegment.X3) + sqr(Cur2DBSegment.Y - Cur2DBSegment.Y3)));
 
       for k := 1 to CurveLength do
@@ -215,10 +228,23 @@ begin
         t := k / CurveLength;
         CurX := Round(sqr(1 - t) * (1 - t) * PosX + 3 * t * sqr(1 - t) * Cur2DBSegment.X2 + 3 * t * t * (1 - t) * Cur2DBSegment.X3 + t * t * t * Cur2DBSegment.X);
         CurY := Round(sqr(1 - t) * (1 - t) * PosY + 3 * t * sqr(1 - t) * Cur2DBSegment.Y2 + 3 * t * t * (1 - t) * Cur2DBSegment.Y3 + t * t * t * Cur2DBSegment.Y);
-        ADest.LineTo(CoordToCanvasX(CurX), CoordToCanvasY(CurY));
+        CoordX := CoordToCanvasX(CurX);
+        CoordY := CoordToCanvasY(CurY);
+        ADest.LineTo(CoordX, CoordY);
+//        {$ifdef FPVECTORIAL_TOCANVAS_DEBUG}
+//        Write(Format(' CL%d,%d', [CoordX, CoordY]));
+//        {$endif}
       end;
-      PosX := Round(Cur2DBSegment.X);
-      PosY := Round(Cur2DBSegment.Y);
+      PosX := Cur2DSegment.X;
+      PosY := Cur2DSegment.Y;
+
+      {$ifdef FPVECTORIAL_TOCANVAS_DEBUG}
+      Write(Format(' ***C%d,%d %d,%d %d,%d %d,%d',
+        [CoordToCanvasX(PosX), CoordToCanvasY(PosY),
+         CoordToCanvasX(Cur2DBSegment.X2), CoordToCanvasY(Cur2DBSegment.Y2),
+         CoordToCanvasX(Cur2DBSegment.X3), CoordToCanvasY(Cur2DBSegment.Y3),
+         CoordToCanvasX(Cur2DBSegment.X), CoordToCanvasY(Cur2DBSegment.Y)]));
+      {$endif}
     end;
     end;
   end;

+ 1 - 0
packages/gtk2/src/pango/pango-font.inc

@@ -233,6 +233,7 @@ function pango_font_family_get_type:GType; cdecl; external pangolib;
 procedure pango_font_family_list_faces(family:PPangoFontFamily;
                      faces:PPPPangoFontFace; n_faces:Plongint); cdecl; external pangolib;
 function pango_font_family_get_name(family:PPangoFontFamily):Pchar; cdecl; external pangolib;
+function pango_font_family_is_monospace(family:PPangoFontFamily):gboolean; cdecl; external pangolib;
 
 {$ifdef PANGO_ENABLE_BACKEND}
 function PANGO_FONT_FAMILY_CLASS(klass : pointer) : PPangoFontFamilyClass;

+ 1 - 1
packages/numlib/src/ipf.pas

@@ -578,7 +578,7 @@ begin
     begin
       q:=1/h^[i-1]; b^[i-2]:=py^[i]*q-py^[i-1]*(p+q)+py^[i-2]*p; p:=q
     end;
-  slegpb(n-1, 1, {2,} t^[0], b^[0], pd2s^[1], ca, term);
+  slegpb(n-1, 1, {2,} t^[1], b^[0], pd2s^[1], ca, term);
   freemem(h, n*s);
   freemem(b, (n-1)*s);
   freemem(t, 2*(n-1)*s);

+ 2 - 0
packages/numlib/src/mdt.pas

@@ -946,5 +946,7 @@ Begin
 End; {mdtdtr}
 
 Begin
+ {$ifdef fixate_random}
   randseed := 12345
+ {$endif}
 End.

+ 2 - 0
packages/numlib/src/sle.pas

@@ -2272,5 +2272,7 @@ Begin
 End; {slegtr}
 
 Begin
+  {$ifdef fixate_random}
   randseed := 12345
+  {$endif}
 End.

+ 5 - 5
packages/numlib/src/spe.pas

@@ -1279,18 +1279,18 @@ const ErrorS : array[400..408,1..6] of char =
       'spegam',
       'spelga');
 
-var ErrFil : text;
+//var ErrFil : text;
 
 begin
      ExitProc := ExitSave;
-     Assign(ErrFil, 'CON');
-     ReWrite(ErrFil);
+//     Assign(ErrFil, 'CON');
+//    ReWrite(ErrFil);
      if (ExitCode>=400) AND (ExitCode<=408) then
        begin
-         write(ErrFil, 'critical error in ', ErrorS[ExitCode]);
+//         write(ErrFil, 'critical error in ', ErrorS[ExitCode]);
          ExitCode := 201
        end;
-     Close(ErrFil)
+//     Close(ErrFil)
 end;
 
 begin

+ 17 - 9
packages/paszlib/src/zipper.pp

@@ -289,6 +289,7 @@ Type
     Function AddFileEntry(Const ADiskFileName : String): TZipFileEntry;
     Function AddFileEntry(Const ADiskFileName, AArchiveFileName : String): TZipFileEntry;
     Function AddFileEntry(Const AStream : TSTream; Const AArchiveFileName : String): TZipFileEntry;
+    Procedure AddFileEntries(Const List : TStrings);
     Property Entries[AIndex : Integer] : TZipFileEntry Read GetZ Write SetZ; default;
   end;
 
@@ -343,7 +344,8 @@ Type
     Property OnStartFile : TOnStartFileEvent Read FOnStartFile Write FOnStartFile;
     Property OnEndFile : TOnEndOfFileEvent Read FOnEndOfFile Write FOnEndOfFile;
     Property FileName : String Read FFileName Write SetFileName;
-    Property Files : TStrings Read FFiles;
+    // Deprecated. Use Entries.AddFileEntry(FileName) or Entries.AddFileEntries(List) instead.
+    Property Files : TStrings Read FFiles; deprecated;
     Property InMemSize : Integer Read FInMemSize Write FInMemSize;
     Property Entries : TZipFileEntries Read FEntries Write SetEntries;
   end;
@@ -1434,6 +1436,9 @@ Begin
     end;
   finally
     FZipping:=False;
+    // Remove entries that have been added by CheckEntries from Files.
+    For I:=0 to FFiles.Count-1 do
+      FEntries.Delete(FEntries.Count-1);
   end;
 end;
 
@@ -1510,14 +1515,8 @@ Var
   I : Integer;
 
 begin
-  If (FFiles.Count>0) and (FEntries.Count=0) then
-    begin
-    FEntries.Clear;
-    For I:=0 to FFiles.Count-1 do
-      begin
-      FEntries.AddFileEntry(FFiles[i]);
-      end;
-    end;
+  For I:=0 to FFiles.Count-1 do
+    FEntries.AddFileEntry(FFiles[i]);
   Result:=FEntries.Count;
 end;
 
@@ -2063,6 +2062,15 @@ begin
   Result.ArchiveFileName:=AArchiveFileName;
 end;
 
+Procedure TZipFileEntries.AddFileEntries(Const List : TStrings);
+
+Var
+  I : integer;
+  
+begin
+  For I:=0 to List.Count-1 do
+    AddFileEntry(List[i]);
+end;
 { TFullZipFileEntries }
 
 function TFullZipFileEntries.GetFZ(AIndex : Integer): TFullZipFileEntry;

+ 1 - 1
packages/winunits-base/src/activex.pp

@@ -2462,7 +2462,7 @@ TYPE
        Function GetConnectionPointContainer(out CPC : IConnectionPointContainer):HResult;StdCall;
        Function Advise(Const unkSink : IUnknown;Out dwCookie : DWord):HResult;StdCall;
        Function UnAdvise(dwCookie : DWord):HResult;StdCall;
-       Function EnumConnection(out pEnum : IEnumConnections):HResult;stdCall;
+       Function EnumConnections(out pEnum : IEnumConnections):HResult;StdCall;
       End;
 
     IConnectionPointContainer = Interface (IUnknown)

+ 1 - 1
packages/winunits-jedi/src/jwaadstlb.pas

@@ -438,7 +438,7 @@ const
   SYS_WIN16 = $00000000;
   SYS_WIN32 = $00000001;
   SYS_MAC = $00000002;
-  SYS_WIN64 = $00000001;
+  SYS_WIN64 = $00000003;
 
 // Constants for enum __MIDL___MIDL_itf_ads_0120_0001
 type

+ 1 - 1
rtl/objpas/sysutils/sysutils.inc

@@ -77,7 +77,7 @@
     {$ifdef unix}
       O:=[];
     {$else unix}
-      O:=(sfoImplicitCurrentDir,sfoStripQuotes);
+      O:=[sfoImplicitCurrentDir,sfoStripQuotes];
     {$endif unix}
       Result := FileSearch(Name, D, False);
     end;

+ 221 - 1
rtl/solaris/unxsockh.inc

@@ -167,7 +167,7 @@ const
   MSG_NOTIFICATION = $0100;           { Notification, not data }
   MSG_XPG4_2       = $8000;	      { Private: XPG4.2 flag }
   MSG_MAXIOVLEN    =    16;
-  
+ 
      TCP_NODELAY = $01;
   { set maximum segment size  }
      TCP_MAXSEG = $02;
@@ -183,3 +183,223 @@ const
      TCP_KEEPALIVE_ABORT_THRESHOLD = $17;
      TCP_CORK = $18;
 
+//from /usr/include/netinet/in.h
+
+    IPPROTO_IP = 0;    
+  { Hop by hop header for IPv6  }
+    IPPROTO_HOPOPTS = 0;    
+  { control message protocol  }
+    IPPROTO_ICMP = 1;    
+  { group control protocol  }
+    IPPROTO_IGMP = 2;    
+  { gateway^2 (deprecated)  }
+    IPPROTO_GGP = 3;    
+  { IP in IP encapsulation  }
+    IPPROTO_ENCAP = 4;    
+  { tcp  }
+    IPPROTO_TCP = 6;    
+  { exterior gateway protocol  }
+    IPPROTO_EGP = 8;    
+  { pup  }
+    IPPROTO_PUP = 12;    
+  { user datagram protocol  }
+    IPPROTO_UDP = 17;    
+  { xns idp  }
+    IPPROTO_IDP = 22;    
+  { IPv6 encapsulated in IP  }
+    IPPROTO_IPV6 = 41;    
+  { Routing header for IPv6  }
+    IPPROTO_ROUTING = 43;    
+  { Fragment header for IPv6  }
+    IPPROTO_FRAGMENT = 44;    
+  { rsvp  }
+    IPPROTO_RSVP = 46;    
+  { IPsec Encap. Sec. Payload  }
+    IPPROTO_ESP = 50;    
+  { IPsec Authentication Hdr.  }
+    IPPROTO_AH = 51;    
+  { ICMP for IPv6  }
+    IPPROTO_ICMPV6 = 58;    
+  { No next header for IPv6  }
+    IPPROTO_NONE = 59;    
+  { Destination options  }
+    IPPROTO_DSTOPTS = 60;    
+  { "hello" routing protocol  }
+    IPPROTO_HELLO = 63;    
+  { UNOFFICIAL net disk proto  }
+    IPPROTO_ND = 77;    
+  { ISO clnp  }
+    IPPROTO_EON = 80;    
+  { OSPF  }
+    IPPROTO_OSPF = 89;    
+  { PIM routing protocol  }
+    IPPROTO_PIM = 103;    
+  { Stream Control  }
+    IPPROTO_SCTP = 132;    
+  { Transmission Protocol  }
+  { raw IP packet  }
+    IPPROTO_RAW = 255;    
+    IPPROTO_MAX = 256;    
+
+    
+  { set/get IP per-packet options    }
+    IP_OPTIONS = 1;    
+  { int; header is included with data (raw)  }
+    IP_HDRINCL = 2;    
+  { int; IP type of service and precedence  }
+    IP_TOS = 3;    
+
+  { int; IP time to live  }
+    IP_TTL = 4;    
+  { int; receive all IP options w/datagram  }
+    IP_RECVOPTS = $5;    
+  { int; receive IP options for response  }
+    IP_RECVRETOPTS = $6;    
+  { int; receive IP dst addr w/datagram  }
+    IP_RECVDSTADDR = $7;    
+  { ip_opts; set/get IP per-packet options  }
+    IP_RETOPTS = $8;    
+  { int; receive the inbound interface index  }
+    IP_RECVIF = $9;    
+  { sockaddr_dl; get source link layer address  }
+    IP_RECVSLLA = $a;    
+  { uint8_t; get TTL for inbound packet  }
+    IP_RECVTTL = $b;    
+  { set/get IP multicast interface   }
+    IP_MULTICAST_IF = $10;    
+  { set/get IP multicast timetolive  }
+    IP_MULTICAST_TTL = $11;    
+  { set/get IP multicast loopback    }
+    IP_MULTICAST_LOOP = $12;    
+  { add	an IP group membership	    }
+    IP_ADD_MEMBERSHIP = $13;    
+  { drop an IP group membership	    }
+    IP_DROP_MEMBERSHIP = $14;    
+  { block   mcast pkts from source   }
+    IP_BLOCK_SOURCE = $15;    
+  { unblock mcast pkts from source   }
+    IP_UNBLOCK_SOURCE = $16;    
+  { add  mcast group/source pair	    }
+    IP_ADD_SOURCE_MEMBERSHIP = $17;    
+  { drop mcast group/source pair	    }
+    IP_DROP_SOURCE_MEMBERSHIP = $18;    
+  { send directly to next hop	    }
+    IP_NEXTHOP = $19;    
+  {
+   * IP_PKTINFO and IP_RECVPKTINFO have same value. Size of argument passed in
+   * is used to differentiate b/w the two.
+    }
+  { specify src address and/or index  }
+    IP_PKTINFO = $1a;    
+  { recv dest/matched addr and index  }
+    IP_RECVPKTINFO = $1a;    
+    {
+     * IPv6 options
+      }
+    { hop limit value for unicast  }
+      IPV6_UNICAST_HOPS = $5;      
+    { packets.  }
+    { argument type: uint_t  }
+    { outgoing interface for  }
+      IPV6_MULTICAST_IF = $6;      
+    { multicast packets.  }
+    { argument type: struct in6_addr  }
+    { hop limit value to use for  }
+      IPV6_MULTICAST_HOPS = $7;      
+    { multicast packets.  }
+    { argument type: uint_t  }
+    { enable/disable delivery of  }
+      IPV6_MULTICAST_LOOP = $8;      
+    { multicast packets on same socket.  }
+    { argument type: uint_t  }
+    { join an IPv6 multicast group.  }
+      IPV6_JOIN_GROUP = $9;      
+    { argument type: struct ipv6_mreq  }
+    { leave an IPv6 multicast group  }
+      IPV6_LEAVE_GROUP = $a;      
+    { argument type: struct ipv6_mreq  }
+    {
+     * IPV6_ADD_MEMBERSHIP and IPV6_DROP_MEMBERSHIP are being kept
+     * for backward compatibility. They have the same meaning as IPV6_JOIN_GROUP
+     * and IPV6_LEAVE_GROUP respectively.
+      }
+    { join an IPv6 multicast group.  }
+      IPV6_ADD_MEMBERSHIP = $9;      
+    { argument type: struct ipv6_mreq  }
+    { leave an IPv6 multicast group  }
+      IPV6_DROP_MEMBERSHIP = $a;      
+    { argument type: struct ipv6_mreq  }
+    { addr plus interface index  }
+      IPV6_PKTINFO = $b;      
+    { arg type: "struct in6_pktingo" -  }
+    { hoplimit for datagram  }
+      IPV6_HOPLIMIT = $c;      
+    { next hop address   }
+      IPV6_NEXTHOP = $d;      
+    { hop by hop options  }
+      IPV6_HOPOPTS = $e;      
+    { destination options - after  }
+      IPV6_DSTOPTS = $f;      
+    { the routing header  }
+    { routing header   }
+      IPV6_RTHDR = $10;      
+    { destination options - before  }
+      IPV6_RTHDRDSTOPTS = $11;      
+    { the routing header  }
+    { enable/disable IPV6_PKTINFO  }
+      IPV6_RECVPKTINFO = $12;      
+    { enable/disable IPV6_HOPLIMIT  }
+      IPV6_RECVHOPLIMIT = $13;      
+    { enable/disable IPV6_HOPOPTS  }
+      IPV6_RECVHOPOPTS = $14;      
+    {
+     * This options exists for backwards compatability and should no longer be
+     * used.  Use IPV6_RECVDSTOPTS instead.
+      }
+      _OLD_IPV6_RECVDSTOPTS = $15;      
+    { enable/disable IPV6_RTHDR  }
+      IPV6_RECVRTHDR = $16;      
+    {
+     * enable/disable IPV6_RTHDRDSTOPTS.  Now obsolete.  IPV6_RECVDSTOPTS enables
+     * the receipt of both headers.
+      }
+      IPV6_RECVRTHDRDSTOPTS = $17;      
+    { Control checksum on raw sockets  }
+      IPV6_CHECKSUM = $18;      
+    { enable/disable IPV6_CLASS  }
+      IPV6_RECVTCLASS = $19;      
+    { send packets with minimum MTU  }
+      IPV6_USE_MIN_MTU = $20;      
+    { don't fragment packets  }
+      IPV6_DONTFRAG = $21;      
+    { Used to set IPSEC options  }
+      IPV6_SEC_OPT = $22;      
+    { Control socket's src addr select  }
+      IPV6_SRC_PREFERENCES = $23;      
+    { receive PMTU info  }
+      IPV6_RECVPATHMTU = $24;      
+    { get the PMTU  }
+      IPV6_PATHMTU = $25;      
+    { traffic class  }
+      IPV6_TCLASS = $26;      
+    { v6 only socket option  }
+      IPV6_V6ONLY = $27;      
+    {
+     * enable/disable receipt of both both IPV6_DSTOPTS headers.
+      }
+      IPV6_RECVDSTOPTS = $28;      
+    {
+     * protocol-independent multicast membership options.
+      }
+    { join group for all sources  }
+      MCAST_JOIN_GROUP = $29;      
+    { leave group  }
+      MCAST_LEAVE_GROUP = $2a;      
+    { block specified source  }
+      MCAST_BLOCK_SOURCE = $2b;      
+    { unblock specified source  }
+      MCAST_UNBLOCK_SOURCE = $2c;      
+    { join group for specified source  }
+      MCAST_JOIN_SOURCE_GROUP = $2d;      
+    { leave source/group pair  }
+      MCAST_LEAVE_SOURCE_GROUP = $2e;      

+ 2 - 1
rtl/win/wininc/ascdef.inc

@@ -476,7 +476,8 @@ function CreateProcessAsUser(_para1:HANDLE; _para2:LPCTSTR; _para3:LPTSTR; _para
   _para10:LPSTARTUPINFO; _para11:LPPROCESS_INFORMATION):WINBOOL; external 'advapi32' name 'CreateProcessAsUserA';
 function FindFirstFileEx(lpfilename : LPCStr;fInfoLevelId:FINDEX_INFO_LEVELS ;lpFindFileData:pointer;fSearchOp : FINDEX_SEARCH_OPS;lpSearchFilter:pointer;dwAdditionalFlags:dword):Handle; stdcall; external name 'FindFirstFileExA';
 // winver>$0600
-function FindFirstFileTransacted(lpfilename : LPCStr;fInfoLevelId:FINDEX_INFO_LEVELS ;lpFindFileData:pointer;fSearchOp : FINDEX_SEARCH_OPS;lpSearchFilter:pointer;dwAdditionalFlags:dword;htransaction : HANDLE):Handle; stdcall; external name 'FindFirstFileTransactedA';
+function FindFirstFileTransacted(lpfilename : LPCStr;fInfoLevelId:FINDEX_INFO_LEVELS ;lpFindFileData:pointer;fSearchOp : FINDEX_SEARCH_OPS;lpSearchFilter:pointer;dwAdditionalFlags:dword;htransaction : HANDLE):Handle; stdcall;
+    external name 'FindFirstFileTransactedA';
 {$endif read_interface}
 
 

Някои файлове не бяха показани, защото твърде много файлове са промени