mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-01 03:30:46 +02:00
--- Merging r43026 into '.':
U utils/instantfpc/instantfpc.pas --- Recording mergeinfo for merge of r43026 into '.': U . --- Merging r43087 into '.': U packages/hash/src/hmac.pp --- Recording mergeinfo for merge of r43087 into '.': G . --- Merging r43091 into '.': U packages/winunits-base/src/winhttp.pp --- Recording mergeinfo for merge of r43091 into '.': G . --- Merging r43095 into '.': G packages/winunits-base/src/winhttp.pp --- Recording mergeinfo for merge of r43095 into '.': G . --- Merging r43097 into '.': U rtl/unix/dl.pp --- Recording mergeinfo for merge of r43097 into '.': G . --- Merging r43098 into '.': G packages/winunits-base/src/winhttp.pp --- Recording mergeinfo for merge of r43098 into '.': G . --- Merging r43117 into '.': U packages/chm/src/chmwriter.pas --- Recording mergeinfo for merge of r43117 into '.': G . # revisions: 43026,43087,43091,43095,43097,43098,43117 git-svn-id: branches/fixes_3_2@43172 -
This commit is contained in:
parent
8349a39d6e
commit
5ab703bffd
@ -117,6 +117,8 @@ Type
|
|||||||
procedure Execute;
|
procedure Execute;
|
||||||
procedure AddStreamToArchive(AFileName, APath: String; AStream: TStream; Compress: Boolean = True);
|
procedure AddStreamToArchive(AFileName, APath: String; AStream: TStream; Compress: Boolean = True);
|
||||||
procedure PostAddStreamToArchive(AFileName, APath: String; AStream: TStream; Compress: Boolean = True);
|
procedure PostAddStreamToArchive(AFileName, APath: String; AStream: TStream; Compress: Boolean = True);
|
||||||
|
procedure LocaleToLanguageID(Locale: LongWord);
|
||||||
|
function LocaleFromLanguageID: LongWord;
|
||||||
property WindowSize: LongWord read FWindowSize write FWindowSize default 2; // in $8000 blocks
|
property WindowSize: LongWord read FWindowSize write FWindowSize default 2; // in $8000 blocks
|
||||||
property FrameSize: LongWord read FFrameSize write FFrameSize default 1; // in $8000 blocks
|
property FrameSize: LongWord read FFrameSize write FFrameSize default 1; // in $8000 blocks
|
||||||
property FilesToCompress: TStrings read FFileNames;
|
property FilesToCompress: TStrings read FFileNames;
|
||||||
@ -127,7 +129,7 @@ Type
|
|||||||
property ReadmeMessage : String read fReadmeMessage write fReadmeMessage;
|
property ReadmeMessage : String read fReadmeMessage write fReadmeMessage;
|
||||||
property Cores : integer read fcores write fcores;
|
property Cores : integer read fcores write fcores;
|
||||||
{ MS Locale ID code }
|
{ MS Locale ID code }
|
||||||
property LocaleID: dword read ITSFHeader.LanguageID write ITSFHeader.LanguageID;
|
property LocaleID: LongWord read LocaleFromLanguageID write LocaleToLanguageID;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ TChmWriter }
|
{ TChmWriter }
|
||||||
@ -274,6 +276,16 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TITSFWriter.LocaleToLanguageID(Locale: LongWord);
|
||||||
|
begin
|
||||||
|
ITSFHeader.LanguageID := NToLE(Locale);
|
||||||
|
end;
|
||||||
|
|
||||||
|
function TITSFWriter.LocaleFromLanguageID: LongWord;
|
||||||
|
begin
|
||||||
|
Result := LEToN(ITSFHeader.LanguageID);
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TITSFWriter.InitHeaderSectionTable;
|
procedure TITSFWriter.InitHeaderSectionTable;
|
||||||
begin
|
begin
|
||||||
// header section 0
|
// header section 0
|
||||||
@ -315,7 +327,7 @@ begin
|
|||||||
|
|
||||||
Unknown2 := NToLE(Longint(-1));
|
Unknown2 := NToLE(Longint(-1));
|
||||||
//DirectoryChunkCount: LongWord;
|
//DirectoryChunkCount: LongWord;
|
||||||
LanguageID := NToLE(DWord($0409));
|
LanguageID := ITSFHeader.LanguageID;
|
||||||
GUID := ITSPHeaderGUID;
|
GUID := ITSPHeaderGUID;
|
||||||
LengthAgain := NToLE(DWord($54));
|
LengthAgain := NToLE(DWord($54));
|
||||||
Unknown3 := NToLE(Longint(-1));
|
Unknown3 := NToLE(Longint(-1));
|
||||||
@ -798,6 +810,7 @@ begin
|
|||||||
FPostStream := TMemoryStream.Create;;
|
FPostStream := TMemoryStream.Create;;
|
||||||
FDestroyStream := FreeStreamOnDestroy;
|
FDestroyStream := FreeStreamOnDestroy;
|
||||||
FFileNames := TStringList.Create;
|
FFileNames := TStringList.Create;
|
||||||
|
InitITSFHeader;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
destructor TITSFWriter.Destroy;
|
destructor TITSFWriter.Destroy;
|
||||||
@ -815,7 +828,6 @@ end;
|
|||||||
|
|
||||||
procedure TITSFWriter.Execute;
|
procedure TITSFWriter.Execute;
|
||||||
begin
|
begin
|
||||||
InitITSFHeader;
|
|
||||||
FOutStream.Position := 0;
|
FOutStream.Position := 0;
|
||||||
FSection1Size := 0;
|
FSection1Size := 0;
|
||||||
|
|
||||||
@ -987,7 +999,7 @@ begin
|
|||||||
FSection0.WriteWord(NToLE(Word(4)));
|
FSection0.WriteWord(NToLE(Word(4)));
|
||||||
FSection0.WriteWord(NToLE(Word(36))); // size
|
FSection0.WriteWord(NToLE(Word(36))); // size
|
||||||
|
|
||||||
FSection0.WriteDWord(NToLE(DWord($0409)));
|
FSection0.WriteDWord(ITSFHeader.LanguageID);
|
||||||
FSection0.WriteDWord(0);
|
FSection0.WriteDWord(0);
|
||||||
FSection0.WriteDWord(NToLE(DWord(Ord(FFullTextSearch and FFullTextSearchAvailable))));
|
FSection0.WriteDWord(NToLE(DWord(Ord(FFullTextSearch and FFullTextSearchAvailable))));
|
||||||
|
|
||||||
|
@ -181,7 +181,7 @@ end;
|
|||||||
|
|
||||||
function HMACSHA1Match(const ADigest1, ADigest2: THMACSHA1Digest): boolean;
|
function HMACSHA1Match(const ADigest1, ADigest2: THMACSHA1Digest): boolean;
|
||||||
begin
|
begin
|
||||||
Result := HMACSHA1Match(ADigest1, ADigest2);
|
Result := SHA1Match(ADigest1, ADigest2);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function HMACSHA1(const AKey, AMessage: string): string;
|
function HMACSHA1(const AKey, AMessage: string): string;
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -66,6 +66,8 @@ const
|
|||||||
RTLD_NEXT = pointer(-1);
|
RTLD_NEXT = pointer(-1);
|
||||||
{$ifdef LINUX}
|
{$ifdef LINUX}
|
||||||
RTLD_DEFAULT = nil;
|
RTLD_DEFAULT = nil;
|
||||||
|
RTLD_NOLOAD = $00004; // GLIBC 2.2 and above
|
||||||
|
RTLD_DI_LINKMAP = 2;
|
||||||
{$endif}
|
{$endif}
|
||||||
{$ifdef BSD}
|
{$ifdef BSD}
|
||||||
RTLD_DEFAULT = pointer(-2);
|
RTLD_DEFAULT = pointer(-2);
|
||||||
@ -90,11 +92,30 @@ function dlvsym(Lib : Pointer; Name : Pchar; Version: Pchar) : Pointer; cdecl; e
|
|||||||
{$endif}
|
{$endif}
|
||||||
function dlclose(Lib : Pointer) : Longint; cdecl; external libdl;
|
function dlclose(Lib : Pointer) : Longint; cdecl; external libdl;
|
||||||
function dlerror() : Pchar; cdecl; external libdl;
|
function dlerror() : Pchar; cdecl; external libdl;
|
||||||
|
|
||||||
{ overloaded for compatibility with hmodule }
|
{ overloaded for compatibility with hmodule }
|
||||||
function dlsym(Lib : PtrInt; Name : Pchar) : Pointer; cdecl; external Libdl;
|
function dlsym(Lib : PtrInt; Name : Pchar) : Pointer; cdecl; external Libdl;
|
||||||
function dlclose(Lib : PtrInt) : Longint; cdecl; external libdl;
|
function dlclose(Lib : PtrInt) : Longint; cdecl; external libdl;
|
||||||
function dladdr(Lib: pointer; info: Pdl_info): Longint; cdecl; {$if not defined(aix) and not defined(android)} external; {$endif}
|
function dladdr(Lib: pointer; info: Pdl_info): Longint; cdecl; {$if not defined(aix) and not defined(android)} external; {$endif}
|
||||||
|
|
||||||
|
type
|
||||||
|
plink_map = ^link_map;
|
||||||
|
link_map = record
|
||||||
|
l_addr:pointer; { Difference between the address in the ELF file and the address in memory }
|
||||||
|
l_name:Pchar; { Absolute pathname where object was found }
|
||||||
|
l_ld:pointer; { Dynamic section of the shared object }
|
||||||
|
l_next, l_prev:^link_map; { Chain of loaded objects }
|
||||||
|
{Plus additional fields private to the implementation }
|
||||||
|
end;
|
||||||
|
|
||||||
|
{$if defined(BSD) or defined(LINUX)}
|
||||||
|
function dlinfo(Lib:pointer;request:longint;info:pointer):longint;cdecl;external Libdl;
|
||||||
|
{$else}
|
||||||
|
{ Fortunately investigating the sources of open source projects brought the understanding, that
|
||||||
|
`handle` is just a `struct link_map*` that contains full library name.}
|
||||||
|
{$endif}
|
||||||
|
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
uses
|
uses
|
||||||
|
@ -65,6 +65,8 @@ begin
|
|||||||
writeln;
|
writeln;
|
||||||
writeln('Options:');
|
writeln('Options:');
|
||||||
writeln;
|
writeln;
|
||||||
|
writeln(' --');
|
||||||
|
Writeln(' Read program from standard input');
|
||||||
writeln(' --set-cache=<path to cache>');
|
writeln(' --set-cache=<path to cache>');
|
||||||
writeln(' Set the cache to be used. Otherwise using environment variable');
|
writeln(' Set the cache to be used. Otherwise using environment variable');
|
||||||
writeln(' INSTANTFPCCACHE.');
|
writeln(' INSTANTFPCCACHE.');
|
||||||
@ -95,7 +97,8 @@ var
|
|||||||
CacheDir: String;
|
CacheDir: String;
|
||||||
CacheFilename: String;
|
CacheFilename: String;
|
||||||
OutputFilename: String;
|
OutputFilename: String;
|
||||||
E : String;
|
S,E : String;
|
||||||
|
DeleteCache : Boolean = False;
|
||||||
RunIt: boolean = true;
|
RunIt: boolean = true;
|
||||||
|
|
||||||
// Return true if filename found.
|
// Return true if filename found.
|
||||||
@ -131,6 +134,11 @@ begin
|
|||||||
begin
|
begin
|
||||||
Filename:=p;
|
Filename:=p;
|
||||||
Result:=True;
|
Result:=True;
|
||||||
|
end
|
||||||
|
else if (p='--') then
|
||||||
|
begin
|
||||||
|
Filename:='--';
|
||||||
|
Result:=True;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -173,7 +181,18 @@ begin
|
|||||||
CheckSourceName(Filename);
|
CheckSourceName(Filename);
|
||||||
Src:=TStringList.Create;
|
Src:=TStringList.Create;
|
||||||
try
|
try
|
||||||
Src.LoadFromFile(Filename);
|
if FileName<>'--' then
|
||||||
|
Src.LoadFromFile(Filename)
|
||||||
|
else
|
||||||
|
begin
|
||||||
|
While not EOF do
|
||||||
|
begin
|
||||||
|
Readln(S);
|
||||||
|
Src.Add(S);
|
||||||
|
end;
|
||||||
|
FileName:=ChangeFileExt(GetTempFileName,'.pp');
|
||||||
|
DeleteCache:=true;
|
||||||
|
end;
|
||||||
CommentShebang(Src);
|
CommentShebang(Src);
|
||||||
CacheDir:=GetCacheDir;
|
CacheDir:=GetCacheDir;
|
||||||
|
|
||||||
@ -187,10 +206,14 @@ begin
|
|||||||
// save source in cache to find out next time if something changed
|
// save source in cache to find out next time if something changed
|
||||||
Src.SaveToFile(CacheFilename);
|
Src.SaveToFile(CacheFilename);
|
||||||
Compile(Filename,CacheFilename,OutputFilename);
|
Compile(Filename,CacheFilename,OutputFilename);
|
||||||
|
if deleteCache then
|
||||||
|
DeleteFile(CacheFileName);
|
||||||
end;
|
end;
|
||||||
// run
|
// run
|
||||||
if RunIt then
|
if RunIt then
|
||||||
Run(OutputFilename);
|
Run(OutputFilename);
|
||||||
|
if DeleteCache then
|
||||||
|
DeleteFile(OutputFileName);
|
||||||
finally
|
finally
|
||||||
// memory is freed by OS, but for debugging puposes you can do it manually
|
// memory is freed by OS, but for debugging puposes you can do it manually
|
||||||
{$IFDEF IFFreeMem}
|
{$IFDEF IFFreeMem}
|
||||||
|
Loading…
Reference in New Issue
Block a user