unit shiori10;
interface
uses
Classes, IniFiles, SysUtils, Windows;
function getversion( var len:longint ): HGLOBAL; cdecl;
function getaistringrandom( var len:longint ): HGLOBAL; cdecl;
function getaistringfromtargetword( h:HGLOBAL; var len:longint ): HGLOBAL; cdecl;
function getdms( var len:longint ): HGLOBAL; cdecl;
function getword( h:HGLOBAL; var len:longint): HGLOBAL; cdecl;
function getmatchword( h:THandle; var len:longint ): THandle; cdecl;
function getaistate( var len: longint ): HGLOBAL; cdecl;
function load( h:HGLOBAL; len:longint ): boolean; cdecl;
function unload: boolean; cdecl;
implementation
function GetGlobalMemory( Str:String; var Len:Integer ): HGLOBAL;
begin
Len := Length( Str );
Result := GlobalAlloc( GPTR, Len+1 );
CopyMemory( Pointer(Result), PChar(Str), Len );
end;
function getversion(var len: longint): HGLOBAL; cdecl;
const
R = 'SHIORI/1.0';
begin
Result := GetGlobalMemory( R, len );
end;
function getaistringrandom(var len: longint): HGLOBAL; cdecl;
const
R = 'ぶんしょーをつくったり';
begin
try
Result := GetGlobalMemory( R, len );
finally
GlobalFree( H );
end;
end;
function getaistringfromtargetword(h: HGLOBAL; var len: longint): HGLOBAL; cdecl;
const
R = 'ターゲット文字から文を作る';
begin
try
Result := GetGlobalMemory( R, len );
finally
GlobalFree( H );
end;
end;
function getdms(var len: longint): HGLOBAL; cdecl;
const
R = 'げっとながいめいし';
begin
try
Result := GetGlobalMemory( R, len );
finally
GlobalFree( H );
end;
end;
function getword(h: HGLOBAL; var len: longint): HGLOBAL; cdecl;
const
R = 'げっとわーど';
begin
try
Result := GetGlobalMemory( R, len );
finally
GlobalFree( H );
end;
end;
function getmatchword( h:THandle; var len:longint ): THandle; cdecl;
const
R = 'げっとまっちわーど';
begin
try
Result := GetGlobalMemory( R, len );
finally
GlobalFree( H );
end;
end;
function getaistate( var len: longint ): HGLOBAL; cdecl;
const
R = '5,10,15,20,25,30';
begin
Result := GetGlobalMemory( R, len );
end;
function load( h:HGLOBAL; len:longint ): boolean; cdecl;
begin
try
Result := True;
finally
GlobalFree( H );
end;
end;
function unload: boolean; cdecl;
begin
Result := True;
end;
end.
|