unit CalFnc; interface uses Windows; {$MINENUMSIZE 4} //列挙型の最小サイズを4バイト(DWORD)にする。 const //サブルーチン呼び出しの戻り値 VMX_RET_SUCCESS = 0; VMX_RET_ERROR = -1; VMX_RET_NOTFOUND = 101; VMX_RET_ILLEGALCALL = 102; VMX_RET_INTERNALERROR = 103; VMX_RET_INVALIDPARAMNUM = 104; VMX_RET_INVALIDPARAMTYPE = 105; type //値タイプ TVMValueType = ( vxtUnknown, vxtInteger, //整数 vxtReal, //実数 ); //値 TVMXValue = packed record case ValueType : TVMValueType of vxtInteger : (iValue : Integer); vxtReal : (aValue : Double); vxtUnknown : (Reserved : array[1..28] of Byte); end; PTVMXValue = ^TVMXValue; //定数 TVMXConstant = packed record Size : DWORD; Name : PChar; Comment : PChar; Value : TVMXValue; end; PTVMXConstant = ^TVMXConstant; //関数 TVMXFunction = packed record Size : DWORD; Name : PChar; Comment : PChar; ParamNum : Integer; end; PTVMXFunction = ^TVMXFunction; //モジュール情報 TVMXModuleInfo = packed record Size : DWORD; Name : PChar; Comment : PChar; ModuleType : PChar; Level : PChar; Version : PChar; Author : PChar; Copyright : PChar; end; PTVMXModuleInfo = ^TVMXModuleInfo; //モジュール関数 TVMInit = function() : Integer; stdcall; TVMGetModuleInfo = function() : PTVMXModuleInfo; stdcall; TVMGetConstantsNum = function() : Integer; stdcall; TVMGetConstants = function() : PTVMXConstant; stdcall; TVMGetFunctionsNum = function() : Integer; stdcall; TVMGetFunctions = function() : PTVMXFunction; stdcall; TVMFunctionDispatcher = function(pName : PChar; pResult : PTVMXValue; pParams : PTVMXValue; iParamNum : Integer) : Integer; stdcall; TVMStdout = function(pStr : PChar; iLen : DWORD) : BOOL; stdcall; TVMSetStdout = function(pNewStdout : TVMStdout) : TVMStdout; stdcall; const //構造体のサイズ SizeOfTVMXConstant = SizeOf(TVMXConstant); SizeOfTVMXFunction = SizeOf(TVMXFunction); SizeOfTVMXModuleInfo = SizeOf(TVMXModuleInfo); implementation end.