Merge pull request #475 from JonWel/Julia-0.3-wrapper

Julia 0.3 wrapper, fixes #473 Thank you for the contribution.
This commit is contained in:
Jorrit Wronski
2015-02-18 21:33:02 +01:00
3 changed files with 26 additions and 3 deletions

View File

@@ -14,7 +14,7 @@ Option A: Calling shared library directly
.. warning::
For now, only 64-bit architectures are supported, and you need Julia version >= 0.4
For now, only 64-bit architectures are supported.
Download a precompiled shared library appropriate to the computer you are using from :sfdownloads:`sourceforge <shared_library>` or the development version from :sfnightly:`the nightly snapshots <shared_library>`.
@@ -63,4 +63,4 @@ Usage::
User-Compiled Binaries
======================
Build the 64-bit shared library for your architecture following the instructions at :ref:`shared_library`.
Build the 64-bit shared library for your architecture following the instructions at :ref:`shared_library`.

View File

@@ -0,0 +1,23 @@
module CoolProp
export F2K, HAPropsSI, PropsSI, PhaseSI
function F2K(TF::Float64)
return ccall( (:F2K, "CoolProp"), Cdouble, (Cdouble,), TF)
end
function HAPropsSI(Output::String, Name1::String, Value1::Float64, Name2::String, Value2::Float64, Name3::String, Value3::Float64)
return ccall( (:HAPropsSI, "CoolProp"), Cdouble, (Ptr{Uint8},Ptr{Uint8},Float64,Ptr{Uint8},Float64,Ptr{Uint8},Float64), Output,Name1,Value1,Name2,Value2,Name3,Value3)
end
function PropsSI(Output::String, Name1::String, Value1::Float64, Name2::String, Value2::Float64, Fluid::String)
return ccall( (:PropsSI, "CoolProp"), Cdouble, (Ptr{Uint8},Ptr{Uint8},Float64,Ptr{Uint8},Float64,Ptr{Uint8}), Output,Name1,Value1,Name2,Value2,Fluid)
end
function PhaseSI(Name1::String, Value1::Float64, Name2::String, Value2::Float64, Fluid::String)
outstring = Array(Uint8, 255)
val = ccall( (:PhaseSI, "CoolProp"), Int32, (Ptr{Uint8},Float64,Ptr{Uint8},Float64,Ptr{Uint8}, Ptr{Uint8}, Int), Name1,Value1,Name2,Value2,Fluid,outstring,length(outstring))
return bytestring(convert(Ptr{Uint8}, outstring))
end
end #module

View File

@@ -20,4 +20,4 @@ function PhaseSI(Name1::String, Value1::Float64, Name2::String, Value2::Float64,
return bytestring(convert(Ptr{UInt8}, outstring))
end
end #module
end #module