unit Cioina;
interface
const
 MAX_PARAM_COUNT=2147483647;
type
 TUserFunction=function (ParamCount:Integer):Double;stdcall;

{$IFDEF LINUX}
  const ExtDll='libCioina.so';
{$ELSE}
  const ExtDll='Cioina.dll';
{$ENDIF}

 procedure CreateList; stdcall; external ExtDll;
 procedure ClearList; stdcall; external ExtDll;
 procedure ClearSharedVariables; stdcall; external ExtDll;
 procedure ClearUserFunctions; stdcall; external ExtDll;
 procedure FreeAll; stdcall; external ExtDll;
 procedure AddMathExpression; stdcall; external ExtDll;
 procedure AddMathExpressionWithUserFunctions; stdcall; external ExtDll;
 procedure AddSharedVar(const VarName: PChar;
  DefValue: Double; Protect: WordBool); stdcall; external ExtDll;
 procedure AddUserFunction(const FuncName: PChar;
  FuncAddress : TUserFunction; ParamCount: Integer); stdcall; external ExtDll;
 procedure AddUserFunctionInVB(const FuncName: PChar;
  FuncAddress : Integer; ParamCount: Integer); stdcall; external ExtDll;
 procedure ClearMathExpression(id: Integer); stdcall; external ExtDll;
 procedure DeleteParantheses(id: Integer; var res: PChar); stdcall; external ExtDll;
 procedure ExpressionReplace(id: Integer; var res: PChar; const OldPattern: PChar;
                               const NewPattern: PChar) stdcall; external ExtDll;
 procedure Parse(id: Integer; const MathStr, VarStr: PChar;
  CheckUnknownVar: WordBool); stdcall; external ExtDll;
 procedure ParseAndDifferentiate(id: Integer; const MathStr,
  VarStr, DerStr: PChar; CheckUnknownVar: WordBool); stdcall; external ExtDll;
 procedure ParseAndDifferentiateWithSharedVar(id: Integer;
  const MathStr, DerStr: PChar; CheckUnknownVar: WordBool); stdcall; external ExtDll;
 procedure ParseWithSharedVar(id: Integer;
  const MathStr: PChar; CheckUnknownVar: WordBool); stdcall; external ExtDll;
 function DoMathExpression(id: Integer): Double; stdcall; external ExtDll;
 procedure DoVectorOfMathExpressions(id: Integer); stdcall; external ExtDll;
 function GetListCount: Integer; stdcall; external ExtDll;
 function GetErrorFlag(id: Integer): WordBool; stdcall; external ExtDll;
 function GetIsMathExpressionVariable(id: Integer): WordBool; stdcall; external ExtDll;
 function GetIsMathExpressionPublic(id: Integer): WordBool; stdcall; external ExtDll;
 function GetIsMathExpressionProtected(id: Integer): WordBool; stdcall; external ExtDll;
 function GetIsMathExpressionLinear(id: Integer): WordBool; stdcall; external ExtDll;
 procedure GetErrorMessageInfo(id: Integer;var res :PChar); stdcall; external ExtDll;
 function GetErrorNumber(id: Integer): Integer; stdcall; external ExtDll;
 function GetSharedVar(i: Integer): Double; stdcall; external ExtDll;
 function GetSharedVarCount: Integer; stdcall; external ExtDll;
 function GetVariableCount(id: Integer): Integer; stdcall; external ExtDll;
 function GetVariableLowIndex(id: Integer): Integer; stdcall; external ExtDll;
 procedure GetVariableName(id, i: Integer; var res: PChar); stdcall; external ExtDll;
 function GetVariableValue(id, i: Integer): Double; stdcall; external ExtDll;
 function IsValidIdentName(id: Integer;const s: PChar): WordBool; stdcall; external ExtDll;
 procedure ClearDerivativeExpressionString(id: Integer); stdcall; external ExtDll;
 procedure ClearMathExpressionString(id: Integer); stdcall; external ExtDll;
 procedure SetSharedVar(i: Integer; Value: Double); stdcall; external ExtDll;
 procedure SetVariableValue( id, i: Integer;  Value: Double); stdcall; external ExtDll;
 procedure GetMathematicaFormVariableNames(id: Integer; var res: PChar); stdcall; external ExtDll;
 function GetMathExpressionCount(id: Integer): Integer; stdcall; external ExtDll;
 procedure GetMathExpressionString(id: Integer; var res : PChar); stdcall; external ExtDll;
 function GetMaxIterations(id: Integer): Integer; stdcall; external ExtDll;
 function GetProtectVariablesEndedWithNumber(id: Integer): WordBool; stdcall; external ExtDll;
 function GetProtectVariablesEndedWithoutNumber(id: Integer): WordBool; stdcall; external ExtDll;
 function GetValuesVectorCount: Integer; stdcall; external ExtDll;
 function GetValuesVector(i: Integer): Double; stdcall; external ExtDll;
 procedure SetProtectVariablesEndedWithNumber(id: Integer; Value: WordBool); stdcall; external ExtDll;
 procedure SetProtectVariablesEndedWithoutNumber(id: Integer; Value: WordBool); stdcall; external ExtDll;
 function GetMaxStack(id: Integer): Integer; stdcall; external ExtDll;
 function GetSpaceLikeMultiply(id: Integer): WordBool; stdcall; external ExtDll;
 function GetTotalFunctionCount(id: Integer): Integer; stdcall; external ExtDll;
 procedure SetMaxIterations(id, Value: Integer); stdcall; external ExtDll;
 procedure SetMaxStack(id, Value: Integer); stdcall; external ExtDll;
 procedure SetSpaceLikeMultiply(id: Integer; Value: WordBool); stdcall; external ExtDll;
 procedure GetDerivativeExpressionString(id: Integer; var res: PChar); stdcall; external ExtDll;
 procedure GetDerivativeVariableString(id: Integer; var res: PChar); stdcall; external ExtDll;
 procedure GetMathematicaFormDerivativeExpressionString(
  id: Integer; var res : PChar); stdcall; external ExtDll;
 procedure GetMathematicaFormMathExpressionString(
  id: Integer; var res: PChar); stdcall; external ExtDll;
 function GetMathException(id: Integer): Integer; stdcall; external ExtDll;
 function GetPowerOperator(id: Integer): WordBool; stdcall; external ExtDll;
 procedure SetPowerOperator(id: Integer; Value: WordBool); stdcall; external ExtDll;
 function GetAllocDynamicMemoryInfo(id: Integer): Integer; stdcall; external ExtDll;
 function GetRunTimeFunctionCount(id: Integer): Integer; stdcall; external ExtDll;
 procedure GetBuiltInFunctionInfo(id, i: Integer; var res: PChar); stdcall; external ExtDll;
 function GetBuiltInFunctionCount: Integer; stdcall; external ExtDll;
 procedure GetBuiltInFunctionName( i: Integer; var res: PChar); stdcall; external ExtDll;
 procedure GetRunTimeFunctionName(id: Integer; i: Integer; var res: PChar); stdcall; external ExtDll;
 procedure GetRunTimeFunctionDefinition(id: Integer; i: Integer; var res: PChar); stdcall; external ExtDll;
 procedure GetExceptionInfo(id, i: Integer; var res: PChar); stdcall; external ExtDll;
 function GetOriginalMathExpressionString(id: Integer): WordBool; stdcall; external ExtDll;
 procedure GetOwnerInfo(var res: PChar); stdcall; external ExtDll;
 procedure GetTypeInfo(var res: PChar); stdcall; external ExtDll;
 procedure GetVersionInfo(var res: PChar); stdcall; external ExtDll;
 procedure GetDedicationInfo(var res: PChar); stdcall; external ExtDll;
 procedure SetOriginalMathExpressionString(id: Integer; Value: WordBool); stdcall; external ExtDll;
 procedure GetLastErrorMessage(var res: PChar); stdcall; external ExtDll;
 procedure SetLastErrorMessage(s: PChar); stdcall; external ExtDll;
 function GetLastErrorFlag: WordBool; stdcall; external ExtDll;
 procedure SetLastErrorFlag(flg: WordBool); stdcall; external ExtDll;
 function GetLastErrorNumber: Integer; stdcall; external ExtDll;
 procedure SetLastErrorNumber(i: Integer); stdcall; external ExtDll;
 function Prm(i: Integer): Double; stdcall; external ExtDll;
 procedure SetFPU8087CW(w: Word); stdcall; external ExtDll;
 function GetFPU8087CW:Word; stdcall; external ExtDll;

implementation

end.
