/* ----------------------------------------------------------------------------
 * This file was automatically generated by SWIG (http://www.swig.org).
 * Version 2.0.8
 *
 * Do not make changes to this file unless you know what you are doing--modify
 * the SWIG interface file instead.
 * ----------------------------------------------------------------------------- */


using System;
using System.Runtime.InteropServices;

class CoolPropPINVOKE {

  protected class SWIGExceptionHelper {

    public delegate void ExceptionDelegate(string message);
    public delegate void ExceptionArgumentDelegate(string message, string paramName);

    static ExceptionDelegate applicationDelegate = new ExceptionDelegate(SetPendingApplicationException);
    static ExceptionDelegate arithmeticDelegate = new ExceptionDelegate(SetPendingArithmeticException);
    static ExceptionDelegate divideByZeroDelegate = new ExceptionDelegate(SetPendingDivideByZeroException);
    static ExceptionDelegate indexOutOfRangeDelegate = new ExceptionDelegate(SetPendingIndexOutOfRangeException);
    static ExceptionDelegate invalidCastDelegate = new ExceptionDelegate(SetPendingInvalidCastException);
    static ExceptionDelegate invalidOperationDelegate = new ExceptionDelegate(SetPendingInvalidOperationException);
    static ExceptionDelegate ioDelegate = new ExceptionDelegate(SetPendingIOException);
    static ExceptionDelegate nullReferenceDelegate = new ExceptionDelegate(SetPendingNullReferenceException);
    static ExceptionDelegate outOfMemoryDelegate = new ExceptionDelegate(SetPendingOutOfMemoryException);
    static ExceptionDelegate overflowDelegate = new ExceptionDelegate(SetPendingOverflowException);
    static ExceptionDelegate systemDelegate = new ExceptionDelegate(SetPendingSystemException);

    static ExceptionArgumentDelegate argumentDelegate = new ExceptionArgumentDelegate(SetPendingArgumentException);
    static ExceptionArgumentDelegate argumentNullDelegate = new ExceptionArgumentDelegate(SetPendingArgumentNullException);
    static ExceptionArgumentDelegate argumentOutOfRangeDelegate = new ExceptionArgumentDelegate(SetPendingArgumentOutOfRangeException);

    [DllImport("CoolProp", EntryPoint="SWIGRegisterExceptionCallbacks_CoolProp")]
    public static extern void SWIGRegisterExceptionCallbacks_CoolProp(
                                ExceptionDelegate applicationDelegate,
                                ExceptionDelegate arithmeticDelegate,
                                ExceptionDelegate divideByZeroDelegate, 
                                ExceptionDelegate indexOutOfRangeDelegate, 
                                ExceptionDelegate invalidCastDelegate,
                                ExceptionDelegate invalidOperationDelegate,
                                ExceptionDelegate ioDelegate,
                                ExceptionDelegate nullReferenceDelegate,
                                ExceptionDelegate outOfMemoryDelegate, 
                                ExceptionDelegate overflowDelegate, 
                                ExceptionDelegate systemExceptionDelegate);

    [DllImport("CoolProp", EntryPoint="SWIGRegisterExceptionArgumentCallbacks_CoolProp")]
    public static extern void SWIGRegisterExceptionCallbacksArgument_CoolProp(
                                ExceptionArgumentDelegate argumentDelegate,
                                ExceptionArgumentDelegate argumentNullDelegate,
                                ExceptionArgumentDelegate argumentOutOfRangeDelegate);

    static void SetPendingApplicationException(string message) {
      SWIGPendingException.Set(new System.ApplicationException(message, SWIGPendingException.Retrieve()));
    }
    static void SetPendingArithmeticException(string message) {
      SWIGPendingException.Set(new System.ArithmeticException(message, SWIGPendingException.Retrieve()));
    }
    static void SetPendingDivideByZeroException(string message) {
      SWIGPendingException.Set(new System.DivideByZeroException(message, SWIGPendingException.Retrieve()));
    }
    static void SetPendingIndexOutOfRangeException(string message) {
      SWIGPendingException.Set(new System.IndexOutOfRangeException(message, SWIGPendingException.Retrieve()));
    }
    static void SetPendingInvalidCastException(string message) {
      SWIGPendingException.Set(new System.InvalidCastException(message, SWIGPendingException.Retrieve()));
    }
    static void SetPendingInvalidOperationException(string message) {
      SWIGPendingException.Set(new System.InvalidOperationException(message, SWIGPendingException.Retrieve()));
    }
    static void SetPendingIOException(string message) {
      SWIGPendingException.Set(new System.IO.IOException(message, SWIGPendingException.Retrieve()));
    }
    static void SetPendingNullReferenceException(string message) {
      SWIGPendingException.Set(new System.NullReferenceException(message, SWIGPendingException.Retrieve()));
    }
    static void SetPendingOutOfMemoryException(string message) {
      SWIGPendingException.Set(new System.OutOfMemoryException(message, SWIGPendingException.Retrieve()));
    }
    static void SetPendingOverflowException(string message) {
      SWIGPendingException.Set(new System.OverflowException(message, SWIGPendingException.Retrieve()));
    }
    static void SetPendingSystemException(string message) {
      SWIGPendingException.Set(new System.SystemException(message, SWIGPendingException.Retrieve()));
    }

    static void SetPendingArgumentException(string message, string paramName) {
      SWIGPendingException.Set(new System.ArgumentException(message, paramName, SWIGPendingException.Retrieve()));
    }
    static void SetPendingArgumentNullException(string message, string paramName) {
      Exception e = SWIGPendingException.Retrieve();
      if (e != null) message = message + " Inner Exception: " + e.Message;
      SWIGPendingException.Set(new System.ArgumentNullException(paramName, message));
    }
    static void SetPendingArgumentOutOfRangeException(string message, string paramName) {
      Exception e = SWIGPendingException.Retrieve();
      if (e != null) message = message + " Inner Exception: " + e.Message;
      SWIGPendingException.Set(new System.ArgumentOutOfRangeException(paramName, message));
    }

    static SWIGExceptionHelper() {
      SWIGRegisterExceptionCallbacks_CoolProp(
                                applicationDelegate,
                                arithmeticDelegate,
                                divideByZeroDelegate,
                                indexOutOfRangeDelegate,
                                invalidCastDelegate,
                                invalidOperationDelegate,
                                ioDelegate,
                                nullReferenceDelegate,
                                outOfMemoryDelegate,
                                overflowDelegate,
                                systemDelegate);

      SWIGRegisterExceptionCallbacksArgument_CoolProp(
                                argumentDelegate,
                                argumentNullDelegate,
                                argumentOutOfRangeDelegate);
    }
  }

  protected static SWIGExceptionHelper swigExceptionHelper = new SWIGExceptionHelper();

  public class SWIGPendingException {
    [ThreadStatic]
    private static Exception pendingException = null;
    private static int numExceptionsPending = 0;

    public static bool Pending {
      get {
        bool pending = false;
        if (numExceptionsPending > 0)
          if (pendingException != null)
            pending = true;
        return pending;
      } 
    }

    public static void Set(Exception e) {
      if (pendingException != null)
        throw new ApplicationException("FATAL: An earlier pending exception from unmanaged code was missed and thus not thrown (" + pendingException.ToString() + ")", e);
      pendingException = e;
      lock(typeof(CoolPropPINVOKE)) {
        numExceptionsPending++;
      }
    }

    public static Exception Retrieve() {
      Exception e = null;
      if (numExceptionsPending > 0) {
        if (pendingException != null) {
          e = pendingException;
          pendingException = null;
          lock(typeof(CoolPropPINVOKE)) {
            numExceptionsPending--;
          }
        }
      }
      return e;
    }
  }


  protected class SWIGStringHelper {

    public delegate string SWIGStringDelegate(string message);
    static SWIGStringDelegate stringDelegate = new SWIGStringDelegate(CreateString);

    [DllImport("CoolProp", EntryPoint="SWIGRegisterStringCallback_CoolProp")]
    public static extern void SWIGRegisterStringCallback_CoolProp(SWIGStringDelegate stringDelegate);

    static string CreateString(string cString) {
      return cString;
    }

    static SWIGStringHelper() {
      SWIGRegisterStringCallback_CoolProp(stringDelegate);
    }
  }

  static protected SWIGStringHelper swigStringHelper = new SWIGStringHelper();


  static CoolPropPINVOKE() {
  }


  [DllImport("CoolProp", EntryPoint="CSharp_get_global_param_string")]
  public static extern string get_global_param_string(string jarg1);

  [DllImport("CoolProp", EntryPoint="CSharp_get_fluid_param_string")]
  public static extern string get_fluid_param_string(string jarg1, string jarg2);

  [DllImport("CoolProp", EntryPoint="CSharp_PropsS")]
  public static extern double PropsS(string jarg1, string jarg2, double jarg3, string jarg4, double jarg5, string jarg6);

  [DllImport("CoolProp", EntryPoint="CSharp_Props")]
  public static extern double Props(string jarg1, char jarg2, double jarg3, char jarg4, double jarg5, string jarg6);

  [DllImport("CoolProp", EntryPoint="CSharp_Props1")]
  public static extern double Props1(string jarg1, string jarg2);

  [DllImport("CoolProp", EntryPoint="CSharp_IProps")]
  public static extern double IProps(int jarg1, int jarg2, double jarg3, int jarg4, double jarg5, int jarg6);

  [DllImport("CoolProp", EntryPoint="CSharp_IsFluidType")]
  public static extern int IsFluidType(string jarg1, string jarg2);

  [DllImport("CoolProp", EntryPoint="CSharp_DerivTerms")]
  public static extern double DerivTerms(string jarg1, double jarg2, double jarg3, string jarg4);

  [DllImport("CoolProp", EntryPoint="CSharp_Phase")]
  public static extern int Phase(string jarg1, double jarg2, double jarg3, string jarg4);

  [DllImport("CoolProp", EntryPoint="CSharp_Phase_Trho")]
  public static extern int Phase_Trho(string jarg1, double jarg2, double jarg3, string jarg4);

  [DllImport("CoolProp", EntryPoint="CSharp_Phase_Tp")]
  public static extern int Phase_Tp(string jarg1, double jarg2, double jarg3, string jarg4);

  [DllImport("CoolProp", EntryPoint="CSharp_set_phase")]
  public static extern void set_phase(string jarg1);

  [DllImport("CoolProp", EntryPoint="CSharp_F2K")]
  public static extern double F2K(double jarg1);

  [DllImport("CoolProp", EntryPoint="CSharp_K2F")]
  public static extern double K2F(double jarg1);

  [DllImport("CoolProp", EntryPoint="CSharp_get_param_index")]
  public static extern int get_param_index(string jarg1);

  [DllImport("CoolProp", EntryPoint="CSharp_get_Fluid_index")]
  public static extern int get_Fluid_index(string jarg1);

  [DllImport("CoolProp", EntryPoint="CSharp_get_index_units")]
  public static extern int get_index_units(int jarg1, string jarg2);

  [DllImport("CoolProp", EntryPoint="CSharp_rhosatL_anc")]
  public static extern double rhosatL_anc(string jarg1, double jarg2);

  [DllImport("CoolProp", EntryPoint="CSharp_rhosatV_anc")]
  public static extern double rhosatV_anc(string jarg1, double jarg2);

  [DllImport("CoolProp", EntryPoint="CSharp_psatL_anc")]
  public static extern double psatL_anc(string jarg1, double jarg2);

  [DllImport("CoolProp", EntryPoint="CSharp_psatV_anc")]
  public static extern double psatV_anc(string jarg1, double jarg2);

  [DllImport("CoolProp", EntryPoint="CSharp_enable_TTSE_LUT")]
  public static extern bool enable_TTSE_LUT(string jarg1);

  [DllImport("CoolProp", EntryPoint="CSharp_isenabled_TTSE_LUT")]
  public static extern bool isenabled_TTSE_LUT(string jarg1);

  [DllImport("CoolProp", EntryPoint="CSharp_disable_TTSE_LUT")]
  public static extern bool disable_TTSE_LUT(string jarg1);

  [DllImport("CoolProp", EntryPoint="CSharp_enable_TTSE_LUT_writing")]
  public static extern bool enable_TTSE_LUT_writing(string jarg1);

  [DllImport("CoolProp", EntryPoint="CSharp_isenabled_TTSE_LUT_writing")]
  public static extern bool isenabled_TTSE_LUT_writing(string jarg1);

  [DllImport("CoolProp", EntryPoint="CSharp_disable_TTSE_LUT_writing")]
  public static extern bool disable_TTSE_LUT_writing(string jarg1);

  [DllImport("CoolProp", EntryPoint="CSharp_set_TTSESat_LUT_size")]
  public static extern bool set_TTSESat_LUT_size(string jarg1, int jarg2);

  [DllImport("CoolProp", EntryPoint="CSharp_set_TTSESinglePhase_LUT_size")]
  public static extern bool set_TTSESinglePhase_LUT_size(string jarg1, int jarg2, int jarg3);

  [DllImport("CoolProp", EntryPoint="CSharp_set_TTSESinglePhase_LUT_range")]
  public static extern bool set_TTSESinglePhase_LUT_range(string jarg1, double jarg2, double jarg3, double jarg4, double jarg5);

  [DllImport("CoolProp", EntryPoint="CSharp_get_TTSESinglePhase_LUT_range")]
  public static extern bool get_TTSESinglePhase_LUT_range(string jarg1, HandleRef jarg2, HandleRef jarg3, HandleRef jarg4, HandleRef jarg5);

  [DllImport("CoolProp", EntryPoint="CSharp_set_TTSE_mode")]
  public static extern int set_TTSE_mode(string jarg1, string jarg2);

  [DllImport("CoolProp", EntryPoint="CSharp_set_reference_stateS")]
  public static extern int set_reference_stateS(string jarg1, string jarg2);

  [DllImport("CoolProp", EntryPoint="CSharp_set_reference_stateD")]
  public static extern int set_reference_stateD(string jarg1, double jarg2, double jarg3, double jarg4, double jarg5);

  [DllImport("CoolProp", EntryPoint="CSharp_get_standard_unit_system")]
  public static extern int get_standard_unit_system();

  [DllImport("CoolProp", EntryPoint="CSharp_set_standard_unit_system")]
  public static extern void set_standard_unit_system(int jarg1);

  [DllImport("CoolProp", EntryPoint="CSharp_viscosity_dilute")]
  public static extern double viscosity_dilute(string jarg1, double jarg2);

  [DllImport("CoolProp", EntryPoint="CSharp_viscosity_residual")]
  public static extern double viscosity_residual(string jarg1, double jarg2, double jarg3);

  [DllImport("CoolProp", EntryPoint="CSharp_conductivity_critical")]
  public static extern double conductivity_critical(string jarg1, double jarg2, double jarg3);

  [DllImport("CoolProp", EntryPoint="CSharp_conductivity_background")]
  public static extern double conductivity_background(string jarg1, double jarg2, double jarg3);

  [DllImport("CoolProp", EntryPoint="CSharp_conformal_Trho")]
  public static extern double conformal_Trho(string jarg1, string jarg2, double jarg3, double jarg4, HandleRef jarg5, HandleRef jarg6);

  [DllImport("CoolProp", EntryPoint="CSharp_HAProps")]
  public static extern double HAProps(string jarg1, string jarg2, double jarg3, string jarg4, double jarg5, string jarg6, double jarg7);

  [DllImport("CoolProp", EntryPoint="CSharp_HAProps_Aux")]
  public static extern double HAProps_Aux(string jarg1, double jarg2, double jarg3, double jarg4, string jarg5);

  [DllImport("CoolProp", EntryPoint="CSharp_IceProps")]
  public static extern double IceProps(string jarg1, double jarg2, double jarg3);

  [DllImport("CoolProp", EntryPoint="CSharp_UseVirialCorrelations")]
  public static extern void UseVirialCorrelations(int jarg1);

  [DllImport("CoolProp", EntryPoint="CSharp_UseIsothermCompressCorrelation")]
  public static extern void UseIsothermCompressCorrelation(int jarg1);

  [DllImport("CoolProp", EntryPoint="CSharp_UseIdealGasEnthalpyCorrelations")]
  public static extern void UseIdealGasEnthalpyCorrelations(int jarg1);

  [DllImport("CoolProp", EntryPoint="CSharp_HAHelp")]
  public static extern void HAHelp();

  [DllImport("CoolProp", EntryPoint="CSharp_returnHumAirCode")]
  public static extern int returnHumAirCode(string jarg1);

  [DllImport("CoolProp", EntryPoint="CSharp_cair_sat")]
  public static extern double cair_sat(double jarg1);
}
