mirror of
https://github.com/CoolProp/CoolProp.git
synced 2026-01-22 20:38:01 -05:00
Update cpIntf.pas
This commit is contained in:
@@ -1,6 +1,14 @@
|
||||
{
|
||||
Delphi Interface for CoolProp
|
||||
Bruce Wernick, 10 December 2015
|
||||
Bruce Wernick, 13 December 2015
|
||||
|
||||
Notes:
|
||||
All of the char parameters are PAnsiChar, the floating point numbers are
|
||||
Double and the integer types are either LongInt or Integer depending on the
|
||||
type in the dll. Where there is an output string, the calling program must
|
||||
create the space for the result. Be aware here that insufficient space will
|
||||
result in a empty string. So for example, you should ensure sufficient space
|
||||
for the refrigerant list.
|
||||
}
|
||||
|
||||
unit cpIntf;
|
||||
@@ -10,41 +18,42 @@ interface
|
||||
const
|
||||
cpdll = 'CoolProp.dll';
|
||||
|
||||
type
|
||||
CoolChar = AnsiChar;
|
||||
PCoolChar = PAnsiChar;
|
||||
CoolStr = AnsiString;
|
||||
CoolVec = array[0..1023] of CoolChar;
|
||||
|
||||
function get_global_param_string(
|
||||
param: PCoolChar;
|
||||
var res: CoolVec;
|
||||
param: PAnsiChar;
|
||||
res: PAnsiChar;
|
||||
n: Integer): LongInt; stdcall;
|
||||
external cpdll name '_get_global_param_string@12';
|
||||
|
||||
function get_fluid_param_string(
|
||||
fluid: PCoolChar; param: PCoolChar;
|
||||
var Output: CoolVec;
|
||||
fluid: PAnsiChar;
|
||||
param: PAnsiChar;
|
||||
res: PAnsiChar;
|
||||
n: Integer): Longint; stdcall;
|
||||
external cpdll name '_get_fluid_param_string@12';
|
||||
|
||||
function PropsSI(spec: PCoolChar;
|
||||
prop1: PCoolChar; val1: Double;
|
||||
prop2: PCoolChar; val2: Double;
|
||||
ref: CoolStr): Double; stdcall;
|
||||
function PropsSI(
|
||||
spec: PAnsiChar;
|
||||
prop1: PAnsiChar; val1: Double;
|
||||
prop2: PAnsiChar; val2: Double;
|
||||
fluid: PAnsiChar): Double; stdcall;
|
||||
external cpdll name '_PropsSI@32';
|
||||
|
||||
function Props1SI(spec: PCoolChar;
|
||||
ref: CoolStr): Double; stdcall;
|
||||
function Props1SI(
|
||||
fluid: PAnsiChar;
|
||||
res: PAnsiChar): Double; stdcall;
|
||||
external cpdll name '_Props1SI@8';
|
||||
|
||||
function HAPropsSI(spec: PCoolChar;
|
||||
prop1: PCoolChar; val1: Double;
|
||||
prop2: PCoolChar; val2: Double;
|
||||
prop3: PCoolChar; val3: Double): Double; stdcall;
|
||||
function HAPropsSI(
|
||||
spec: PAnsiChar;
|
||||
prop1: PAnsiChar; val1: Double;
|
||||
prop2: PAnsiChar; val2: Double;
|
||||
prop3: PAnsiChar; val3: Double): Double; stdcall;
|
||||
external cpdll name '_HAPropsSI@40';
|
||||
|
||||
implementation
|
||||
|
||||
begin
|
||||
initialization
|
||||
{Disable floating point exception
|
||||
This is a problem with the Delphi compiler only}
|
||||
Set8087CW($133f);
|
||||
end.
|
||||
|
||||
Reference in New Issue
Block a user