summaryrefslogtreecommitdiff
path: root/USearch.pas
diff options
context:
space:
mode:
authorTomas Bzatek <tbzatek@users.sourceforge.net>2009-12-13 14:32:58 +0100
committerTomas Bzatek <tbzatek@users.sourceforge.net>2009-12-13 14:32:58 +0100
commit0f7616a007edaa1d19c4672a4fd390c072b1eba6 (patch)
treea1524927d8986bb54345c47ded84bb3c2a9559c2 /USearch.pas
parentae0047b8a5fa76ea76c66d8c5c580eba39178755 (diff)
downloadtuxcmd-0.6.74.tar.xz
Error system transformation to GErrorv0.6.74
Note that most coreworkers are broken at the moment.
Diffstat (limited to 'USearch.pas')
-rw-r--r--USearch.pas34
1 files changed, 18 insertions, 16 deletions
diff --git a/USearch.pas b/USearch.pas
index 9794e4c..edf4403 100644
--- a/USearch.pas
+++ b/USearch.pas
@@ -594,7 +594,7 @@ begin
if b then begin
DebugMsg(['Found plugin ''', Plugin.ModuleID, ''', trying to open the archive ''', archive, '''']);
AEngine := TVFSEngine.Create(Plugin);
- b := b and ((AEngine as TVFSEngine).VFSOpenEx(archive, nil, nil, nil, nil) = 0);
+ b := b and (AEngine as TVFSEngine).VFSOpenEx(archive, nil, nil, nil, nil, nil);
end;
end;
end else begin
@@ -603,7 +603,8 @@ begin
end;
if b then FMain.EditViewFileInternal(Self, string(PDataItem(FileList.Selected.AsPointer(0))^.FDisplayName), AEngine, True, False)
else Application.MessageBox(Format(LANGCannotLoadFile, [string(PDataItem(FileList.Selected.AsPointer(0))^.FDisplayName)]), [mbOK], mbError, mbNone, mbOK);
- if AEngine is TVFSEngine then (AEngine as TVFSEngine).VFSClose;
+ if AEngine is TVFSEngine then
+ (AEngine as TVFSEngine).VFSClose(nil);
AEngine.Free;
end;
@@ -829,7 +830,8 @@ begin
Processing := False;
Stop := False;
if FileList.Items.Count > 0 then FileList.SetFocus;
- if Engine.ChangeDir(OldDir) <> 0 then DebugMsg(['DoSearch: cannot change back to saved directory']);
+ if not Engine.ChangeDir(OldDir, nil) then
+ DebugMsg(['DoSearch: cannot change back to saved directory']);
// Enable the UI
Table1.Enabled := True;
@@ -904,7 +906,7 @@ var LocalList: TList;
Data: PDataItem;
Plugin: TVFSPlugin;
xEngine: TVFSEngine;
- VFSOpenResult: integer;
+ VFSOpenResult: boolean;
begin
try
if CancelIt then Exit;
@@ -915,9 +917,9 @@ begin
CurrentDir := StartDir;
GUIMutex.Release;
- if FEngine.ChangeDir(StartDir) <> 0 then Exit;
+ if not FEngine.ChangeDir(StartDir, nil) then Exit;
LocalList := TList.Create;
- if FEngine.GetListing(LocalList, StartDir, True, True, False) = 0 then begin
+ if FEngine.GetListing(LocalList, StartDir, True, True, False, nil) then begin
// Processing...
StartDir := IncludeTrailingPathDelimiter(StartDir);
@@ -991,10 +993,11 @@ begin
xEngine.ParentEngine := FEngine;
xEngine.SavePath := StartDir + FileName;
FEngine := xEngine;
- VFSOpenResult := (FEngine as TVFSEngine).VFSOpenEx(IncludeTrailingPathDelimiter(StartDir) + FileName, nil, nil, nil, nil);
- if (VFSOpenResult = 0) and (not CancelIt) then DoRecurse('/');
+ VFSOpenResult := (FEngine as TVFSEngine).VFSOpenEx(IncludeTrailingPathDelimiter(StartDir) + FileName, nil, nil, nil, nil, nil);
+ if VFSOpenResult and (not CancelIt) then DoRecurse('/');
FEngine := FEngine.ParentEngine;
- if not (xEngine as TVFSEngine).VFSClose then DebugMsg(['Error closing the engine...']);
+ if not (xEngine as TVFSEngine).VFSClose(nil) then
+ DebugMsg(['Error closing the engine...']);
xEngine.Free;
end;
end;
@@ -1011,22 +1014,21 @@ end;
function TSearchThread.FindText(FileName: string): boolean;
const BlockSize = 65536;
var fd: TEngineFileDes;
- i, Error, Read, Pos: integer;
+ i, Read, Pos: integer;
Buffer: PByteArray;
x: boolean;
begin
Result := False;
try
- Error := 0;
Buffer := malloc(BlockSize);
if Buffer = nil then Exit;
memset(Buffer, 0, BlockSize);
- fd := FEngine.OpenFile(FileName, omRead, Error);
- if (fd = nil) or (Error <> 0) then Exit;
+ fd := FEngine.OpenFile(FileName, omRead, nil);
+ if fd = nil then Exit;
Pos := 1;
repeat
- Read := FEngine.ReadFile(fd, Buffer, BlockSize, Error);
+ Read := FEngine.ReadFile(fd, Buffer, BlockSize, nil);
if Read > 0 then
for i := 0 to Read - 1 do begin
if FCaseSensitiveStrings then x := Buffer^[i] = byte(FStringFind[Pos])
@@ -1035,7 +1037,7 @@ begin
Inc(Pos);
if Pos > Length(FStringFind) then begin
Result := True;
- FEngine.CloseFile(fd);
+ FEngine.CloseFile(fd, nil);
libc_free(Buffer);
Exit;
end;
@@ -1045,7 +1047,7 @@ begin
// DebugMsg(['Read : ', Read, ' bytes.']);
if CancelIt then Break;
until Read < BlockSize;
- FEngine.CloseFile(fd);
+ FEngine.CloseFile(fd, nil);
libc_free(Buffer);
except
end;