library hello_world;

//Procedure that is given control over some objects to define the DLL usage and functions
function Init():PChar;stdcall;
begin
Result:= 'helloworld';
end;



//Procedure to Init the parameters of a function
Function getparam(func: PChar):PChar;stdcall;
begin
if func = 'helloworld' then begin
Result := '';
end;
end;



function helloworld:PChar;stdcall;
var
  final: string;
begin
    //ok if your function returns a var it must be done like that
    //unlike the ini where you directly type the text you want to be returned,
    //it will not work for string vars or even if you do Result:= Pchar(...)
    //so be sure to alloc then copy it will work fine

    final :='Hello World from a Delphi DLL!';
    Result := Pchar(final);

end; 

exports Init name 'init';
exports getparam name 'getparam';
exports helloworld name 'helloworld';
//here the exports names must match the ones you sended to samurize
begin

end.


