mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-16 15:39:40 +02:00
--- Merging r30728 into '.':
U rtl/unix/dos.pp --- Recording mergeinfo for merge of r30728 into '.': U . --- Merging r30704 into '.': U rtl/objpas/sysutils/sysuintf.inc --- Recording mergeinfo for merge of r30704 into '.': G . --- Merging r30652 into '.': U packages/cdrom/src/cdrom.pp --- Recording mergeinfo for merge of r30652 into '.': G . --- Merging r30642 into '.': U packages/rtl-objpas/src/inc/strutils.pp --- Recording mergeinfo for merge of r30642 into '.': G . # revisions: 30728,30704,30652,30642 git-svn-id: branches/fixes_3_0@31112 -
This commit is contained in:
parent
2b6c1e12fc
commit
7ca1faa6b4
@ -20,12 +20,23 @@ unit cdrom;
|
|||||||
interface
|
interface
|
||||||
|
|
||||||
Type
|
Type
|
||||||
|
// Frames are 1/75th of a second.
|
||||||
|
// To get the seconds of a track divide the frames by 75.
|
||||||
|
// TrackLen: Double; ...
|
||||||
|
// TrackLen := Frames / 75.
|
||||||
TTocEntry = Record
|
TTocEntry = Record
|
||||||
min, sec, frame : Integer;
|
min, sec, frame : Integer;
|
||||||
end;
|
end;
|
||||||
PTocEntry = ^TTocEntry;
|
PTocEntry = ^TTocEntry;
|
||||||
|
|
||||||
|
// Returns the High value to use in a loop. Each entry is the position of the end
|
||||||
|
// of a track. For audio cd's the zero'th entry is not audio data. If an audio cd
|
||||||
|
// has 10 songs then ReadCDToc will return 10 but there are 11 entries: 0..10.
|
||||||
|
// You still need to use the zero'th entry to get the first track length:
|
||||||
|
// Track1Length := TOC[1].frames = TOC[0].frames.
|
||||||
Function ReadCDTOC(Device : String; Var CDTOC : Array of TTocEntry) : Integer;
|
Function ReadCDTOC(Device : String; Var CDTOC : Array of TTocEntry) : Integer;
|
||||||
|
|
||||||
|
// Returns the number of devices placed in 'Devices'
|
||||||
Function GetCDRomDevices(Var Devices : Array of string) : Integer;
|
Function GetCDRomDevices(Var Devices : Array of string) : Integer;
|
||||||
|
|
||||||
Implementation
|
Implementation
|
||||||
|
@ -1770,10 +1770,55 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
Function isMatch(inputstr,wilds : string; CWild, CinputWord: integer;MaxInputword,maxwilds : word) : Boolean;
|
||||||
|
|
||||||
|
begin
|
||||||
|
Result:=True;
|
||||||
|
repeat
|
||||||
|
if Wilds[CWild] = '*' then { handling of '*' }
|
||||||
|
begin
|
||||||
|
inc(CWild);
|
||||||
|
while Wilds[CWild] = '?' do { equal to '?' }
|
||||||
|
begin
|
||||||
|
{ goto next letter }
|
||||||
|
inc(CWild);
|
||||||
|
inc(CinputWord);
|
||||||
|
end;
|
||||||
|
{ increase until a match }
|
||||||
|
Repeat
|
||||||
|
while (inputStr[CinputWord]<>Wilds[CWild]) and (CinputWord <= MaxinputWord) do
|
||||||
|
inc(CinputWord);
|
||||||
|
Result:=isMatch(inputstr,wilds,CWild, CinputWord,MaxInputword,maxwilds);
|
||||||
|
if not Result then
|
||||||
|
Inc(cInputWord);
|
||||||
|
Until Result or (CinputWord>=MaxinputWord);
|
||||||
|
Continue;
|
||||||
|
end;
|
||||||
|
if Wilds[CWild] = '?' then { equal to '?' }
|
||||||
|
begin
|
||||||
|
{ goto next letter }
|
||||||
|
inc(CWild);
|
||||||
|
inc(CinputWord);
|
||||||
|
Continue;
|
||||||
|
end;
|
||||||
|
if inputStr[CinputWord] = Wilds[CWild] then { equal letters }
|
||||||
|
begin
|
||||||
|
{ goto next letter }
|
||||||
|
inc(CWild);
|
||||||
|
inc(CinputWord);
|
||||||
|
Continue;
|
||||||
|
end;
|
||||||
|
Result:=false;
|
||||||
|
Exit;
|
||||||
|
until (CinputWord > MaxinputWord) or (CWild > MaxWilds);
|
||||||
|
{ no completed evaluation }
|
||||||
|
if (CinputWord <= MaxinputWord) or (CWild <= MaxWilds) then
|
||||||
|
Result:=false;
|
||||||
|
end;
|
||||||
|
|
||||||
function isWild(inputStr, Wilds: string; ignoreCase: boolean): boolean;
|
function isWild(inputStr, Wilds: string; ignoreCase: boolean): boolean;
|
||||||
|
|
||||||
var
|
var
|
||||||
CWild, CinputWord: integer; { counter for positions }
|
|
||||||
i: integer;
|
i: integer;
|
||||||
MaxinputWord, MaxWilds: integer; { Length of inputStr and Wilds }
|
MaxinputWord, MaxWilds: integer; { Length of inputStr and Wilds }
|
||||||
begin
|
begin
|
||||||
@ -1801,45 +1846,7 @@ begin
|
|||||||
inputStr:=AnsiUpperCase(inputStr);
|
inputStr:=AnsiUpperCase(inputStr);
|
||||||
Wilds:=AnsiUpperCase(Wilds);
|
Wilds:=AnsiUpperCase(Wilds);
|
||||||
end;
|
end;
|
||||||
CinputWord:=1;
|
Result:=isMatch(inputStr,wilds,1,1,MaxinputWord, MaxWilds);
|
||||||
CWild:=1;
|
|
||||||
repeat
|
|
||||||
if Wilds[CWild] = '*' then { handling of '*' }
|
|
||||||
begin
|
|
||||||
inc(CWild);
|
|
||||||
while Wilds[CWild] = '?' do { equal to '?' }
|
|
||||||
begin
|
|
||||||
{ goto next letter }
|
|
||||||
inc(CWild);
|
|
||||||
inc(CinputWord);
|
|
||||||
end;
|
|
||||||
{ increase until a match }
|
|
||||||
while (inputStr[CinputWord] <> Wilds[CWild]) and
|
|
||||||
(CinputWord <= MaxinputWord) do
|
|
||||||
inc(CinputWord);
|
|
||||||
Continue;
|
|
||||||
end;
|
|
||||||
if Wilds[CWild] = '?' then { equal to '?' }
|
|
||||||
begin
|
|
||||||
{ goto next letter }
|
|
||||||
inc(CWild);
|
|
||||||
inc(CinputWord);
|
|
||||||
Continue;
|
|
||||||
end;
|
|
||||||
if inputStr[CinputWord] = Wilds[CWild] then { equal letters }
|
|
||||||
begin
|
|
||||||
{ goto next letter }
|
|
||||||
inc(CWild);
|
|
||||||
inc(CinputWord);
|
|
||||||
Continue;
|
|
||||||
end;
|
|
||||||
Result:=false;
|
|
||||||
Exit;
|
|
||||||
until (CinputWord > MaxinputWord) or (CWild > MaxWilds);
|
|
||||||
{ no completed evaluation }
|
|
||||||
if (CinputWord <= MaxinputWord) or
|
|
||||||
(CWild <= MaxWilds) then
|
|
||||||
Result:=false;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
@ -157,7 +157,7 @@ begin
|
|||||||
SetLength(Result, 38);
|
SetLength(Result, 38);
|
||||||
StrLFmt(PChar(Result), 38,'{%.8x-%.4x-%.4x-%.2x%.2x-%.2x%.2x%.2x%.2x%.2x%.2x}',
|
StrLFmt(PChar(Result), 38,'{%.8x-%.4x-%.4x-%.2x%.2x-%.2x%.2x%.2x%.2x%.2x%.2x}',
|
||||||
[
|
[
|
||||||
GUID.D1, GUID.D2, GUID.D3,
|
Longint(GUID.D1), GUID.D2, GUID.D3,
|
||||||
GUID.D4[0], GUID.D4[1], GUID.D4[2], GUID.D4[3],
|
GUID.D4[0], GUID.D4[1], GUID.D4[2], GUID.D4[3],
|
||||||
GUID.D4[4], GUID.D4[5], GUID.D4[6], GUID.D4[7]
|
GUID.D4[4], GUID.D4[5], GUID.D4[6], GUID.D4[7]
|
||||||
]);
|
]);
|
||||||
|
@ -245,6 +245,7 @@ var
|
|||||||
begin
|
begin
|
||||||
GetDate (Year, Month, Day,dow);
|
GetDate (Year, Month, Day,dow);
|
||||||
tv.tv_sec:= LocalToEpoch ( Year, Month, Day, Hour, Minute, Second ) ;
|
tv.tv_sec:= LocalToEpoch ( Year, Month, Day, Hour, Minute, Second ) ;
|
||||||
|
tv.tv_usec:= Sec100 * 10000;
|
||||||
fpSettimeofday(@tv,nil);
|
fpSettimeofday(@tv,nil);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -255,6 +256,7 @@ var
|
|||||||
begin
|
begin
|
||||||
GetTime ( Hour, Min, Sec, Sec100 );
|
GetTime ( Hour, Min, Sec, Sec100 );
|
||||||
tv.tv_sec:= LocalToEpoch ( Year, Month, Day, Hour, Min, Sec ) ;
|
tv.tv_sec:= LocalToEpoch ( Year, Month, Day, Hour, Min, Sec ) ;
|
||||||
|
tv.tv_usec:= Sec100 * 10000;
|
||||||
fpSettimeofday(@tv,nil);
|
fpSettimeofday(@tv,nil);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -264,6 +266,7 @@ var
|
|||||||
tv : timeval;
|
tv : timeval;
|
||||||
begin
|
begin
|
||||||
tv.tv_sec:= LocalToEpoch ( Year, Month, Day, Hour, Minute, Second ) ;
|
tv.tv_sec:= LocalToEpoch ( Year, Month, Day, Hour, Minute, Second ) ;
|
||||||
|
tv.tv_usec:= 0;
|
||||||
SetDatetime:=fpSettimeofday(@tv,nil)=0;
|
SetDatetime:=fpSettimeofday(@tv,nil)=0;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -319,7 +322,7 @@ Begin
|
|||||||
begin
|
begin
|
||||||
doserror:=2;
|
doserror:=2;
|
||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
pid:=fpFork;
|
pid:=fpFork;
|
||||||
if pid=0 then
|
if pid=0 then
|
||||||
begin
|
begin
|
||||||
|
Loading…
Reference in New Issue
Block a user