| 1 |
library EverythingDsx; |
| 2 |
|
| 3 |
{$mode objfpc}{$H+} |
| 4 |
|
| 5 |
uses |
| 6 |
Classes, Everything, DsxPlugin, DCConvertEncoding; |
| 7 |
|
| 8 |
threadvar |
| 9 |
AddFileProc: TSAddFileProc; |
| 10 |
|
| 11 |
procedure FoundCallback(FileName: PWideChar); |
| 12 |
var |
| 13 |
S: String; |
| 14 |
begin |
| 15 |
S:= CeUtf16ToUtf8(UnicodeString(FileName)); |
| 16 |
AddFileProc(0, PAnsiChar(S)); |
| 17 |
end; |
| 18 |
|
| 19 |
function Init(dps: PDsxDefaultParamStruct; pAddFileProc: TSAddFileProc; |
| 20 |
pUpdateStatus: TSUpdateStatusProc): Integer; stdcall; |
| 21 |
|
| 22 |
begin |
| 23 |
AddFileProc:= pAddFileProc; |
| 24 |
end; |
| 25 |
|
| 26 |
procedure StartSearch(FPluginNr: Integer; pSearchRecRec: PDsxSearchRecord); stdcall; |
| 27 |
var |
| 28 |
Flags: Integer = 0; |
| 29 |
begin |
| 30 |
if pSearchRecRec^.CaseSensitive then Flags:= Flags or EVERYTHING_IPC_MATCHCASE; |
| 31 |
Start(pSearchRecRec^.FileMask, Flags, @FoundCallback); |
| 32 |
end; |
| 33 |
|
| 34 |
procedure StopSearch(FPluginNr: Integer); stdcall; |
| 35 |
begin |
| 36 |
|
| 37 |
end; |
| 38 |
|
| 39 |
procedure Finalize(FPluginNr: Integer); stdcall; |
| 40 |
begin |
| 41 |
|
| 42 |
end; |
| 43 |
|
| 44 |
exports |
| 45 |
Init, |
| 46 |
StartSearch, |
| 47 |
StopSearch, |
| 48 |
Finalize; |
| 49 |
|
| 50 |
begin |
| 51 |
end. |
| 52 |
|