2010-03-25 20:36:09 -04:00
|
|
|
library libmml;
|
|
|
|
|
|
|
|
{$mode objfpc}{$H+}
|
|
|
|
|
|
|
|
uses
|
2010-03-26 10:20:50 -04:00
|
|
|
cmem,Classes,interfaces,graphics,client,sysutils,MufasaTypes,dtmutil;
|
2010-03-25 20:36:09 -04:00
|
|
|
|
|
|
|
{$R *.res}
|
|
|
|
|
2010-03-26 07:22:08 -04:00
|
|
|
type
|
|
|
|
PTPoint = ^TPoint;
|
2010-03-26 10:20:50 -04:00
|
|
|
PPDTM = ^PDTM;
|
2010-03-26 07:22:08 -04:00
|
|
|
|
2010-03-25 20:36:09 -04:00
|
|
|
var
|
|
|
|
C: TClient;
|
|
|
|
function test: pchar;
|
|
|
|
begin
|
|
|
|
result := PChar('hello world');
|
|
|
|
end;
|
|
|
|
|
|
|
|
procedure init;
|
|
|
|
begin
|
|
|
|
C:=TCLient.Create('');
|
|
|
|
end;
|
|
|
|
|
2010-03-27 07:44:19 -04:00
|
|
|
function getmousepos: tpoint; cdecl;
|
2010-03-25 20:36:09 -04:00
|
|
|
begin
|
|
|
|
C.IOManager.GetMousePos(result.x,result.y);
|
|
|
|
end;
|
|
|
|
|
2010-03-27 07:44:19 -04:00
|
|
|
function returnpoints: PTPoint; cdecl;
|
2010-03-25 20:36:09 -04:00
|
|
|
|
2010-03-26 07:22:08 -04:00
|
|
|
begin
|
|
|
|
result := AllocMem(sizeof(TPoint) * 2);
|
|
|
|
result[0].x := 5;
|
|
|
|
result[0].y := 10;
|
|
|
|
result[1].x := 20;
|
|
|
|
result[1].y := 30;
|
|
|
|
end;
|
|
|
|
|
2010-03-27 07:44:19 -04:00
|
|
|
function printpoints(b: PTPoint; len: integer): boolean; cdecl;
|
2010-03-26 07:22:08 -04:00
|
|
|
var i:integer;
|
|
|
|
begin
|
|
|
|
for i := 0 to len - 1 do
|
|
|
|
writeln('X, Y: (' + inttostr(b[i].x) + ', ' + inttostr(b[i].y) + ')');
|
|
|
|
end;
|
|
|
|
|
2010-03-27 07:44:19 -04:00
|
|
|
procedure hoi(var i: integer); cdecl;
|
2010-03-26 07:22:08 -04:00
|
|
|
begin
|
|
|
|
i := i + 1;
|
|
|
|
end;
|
2010-03-25 20:36:09 -04:00
|
|
|
|
2010-03-27 07:44:19 -04:00
|
|
|
function givedtm:PPDTM; cdecl;
|
2010-03-26 10:20:50 -04:00
|
|
|
var
|
|
|
|
dtm: PPDTM;
|
|
|
|
begin
|
|
|
|
dtm := AllocMem(sizeof(pdtm));
|
|
|
|
initdtm(dtm^,2);
|
|
|
|
result:=dtm;
|
|
|
|
dtm^.n := PChar('wat');
|
|
|
|
end;
|
|
|
|
|
2010-03-25 20:36:09 -04:00
|
|
|
exports
|
|
|
|
test,
|
|
|
|
init,
|
2010-03-26 07:22:08 -04:00
|
|
|
getmousepos,
|
|
|
|
returnpoints,
|
|
|
|
printpoints,
|
2010-03-26 10:20:50 -04:00
|
|
|
hoi,
|
|
|
|
givedtm;
|
2010-03-25 20:36:09 -04:00
|
|
|
|
|
|
|
|
|
|
|
begin
|
|
|
|
end.
|
|
|
|
|