2024-03-25 16:12:02 +01:00
|
|
|
unit ATBGit;
|
|
|
|
|
|
|
|
{$mode ObjFPC}{$H+}
|
|
|
|
|
|
|
|
interface
|
|
|
|
|
2024-03-26 17:02:59 +01:00
|
|
|
uses SysUtils, fpjson, jsonparser;
|
2024-03-25 16:12:02 +01:00
|
|
|
|
2024-03-26 17:02:59 +01:00
|
|
|
//
|
|
|
|
// public interface
|
|
|
|
//
|
|
|
|
procedure SetReposRootDirectory(const rootDir: UTF8String);
|
|
|
|
function GetReposRootDirectory(): UTF8String;
|
|
|
|
function GetLocalRepositoryPath(const localrepo: UTF8String): UTF8String;
|
|
|
|
|
|
|
|
// private c-interface
|
|
|
|
procedure SetReposRootDirectoryInternal(const rootDir: PChar); stdcall;
|
|
|
|
function GetReposRootDirectoryInternal(): PChar; stdcall;
|
|
|
|
function GetLocalRepositoryPathInternal(const localRepo: PChar): PChar; stdcall;
|
2024-03-25 16:12:02 +01:00
|
|
|
|
|
|
|
implementation
|
|
|
|
const DLLName = 'CalculatorCInterface.dll';
|
|
|
|
|
2024-03-26 17:02:59 +01:00
|
|
|
///
|
|
|
|
procedure SetReposRootDirectory(const rootDir: UTF8String);
|
|
|
|
begin
|
|
|
|
try
|
|
|
|
SetReposRootDirectoryInternal(PChar(Utf8toAnsi(rootDir)));
|
|
|
|
finally
|
|
|
|
end;
|
|
|
|
end;
|
|
|
|
|
|
|
|
///
|
|
|
|
function GetReposRootDirectory(): UTF8String;
|
|
|
|
begin
|
|
|
|
try
|
|
|
|
Result := UTF8String(GetReposRootDirectoryInternal());
|
|
|
|
finally
|
|
|
|
end;
|
|
|
|
end;
|
|
|
|
|
|
|
|
function GetLocalRepositoryPath(const localRepo: UTF8String): UTF8String;
|
|
|
|
begin
|
|
|
|
try
|
|
|
|
Result := UTF8String(GetLocalRepositoryPathInternal(PChar(Utf8toAnsi(localRepo))));
|
|
|
|
finally
|
|
|
|
end;
|
|
|
|
end;
|
|
|
|
|
|
|
|
//
|
|
|
|
// external c-interface
|
|
|
|
//
|
|
|
|
procedure SetReposRootDirectoryInternal(const rootDir: PChar); stdcall;
|
|
|
|
external DLLName;
|
|
|
|
|
|
|
|
function GetReposRootDirectoryInternal(): PChar; stdcall;
|
|
|
|
external DLLName;
|
|
|
|
|
|
|
|
function GetLocalRepositoryPathInternal(const localRepo: PChar): PChar; stdcall;
|
|
|
|
external DLLName;
|
|
|
|
|
2024-03-25 16:12:02 +01:00
|
|
|
end.
|
|
|
|
|