1
0
mirror of https://github.com/moparisthebest/Simba synced 2024-11-14 05:15:16 -05:00
Simba/Projects/MMLLib/libmml.lpr
2010-03-27 12:44:19 +01:00

76 lines
1.1 KiB
ObjectPascal

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