dftd4 0.2.2

FFI bindings and wrappers of dftd4
Documentation
//! FFI bindings for dftd4.
//!
//! # API Version Features
//!
//! This crate provides versioned FFI bindings through cargo features:
//!
//! - `api-v3_0`: Base API (default)
//! - `api-v3_1`: Extends api-v3_0, adds custom D4 model and properties
//! - `api-v3_2`: Extends api-v3_1, adds pairwise dispersion
//! - `api-v3_3`: Extends api-v3_2
//! - `api-v3_4`: Extends api-v3_3
//! - `api-v3_5`: Extends api-v3_4, adds numerical hessian
//! - `api-v4_0`: Extends api-v3_5, adds D4S model
//! - `api-v4_2`: Extends api-v4_0, adds realspace cutoff setters
//!
//! Features are cumulative: enabling `api-v3_5` also enables all functions from
//! earlier versions (api-v3_0, api-v3_1, api-v3_2, api-v3_3, api-v3_4).

#![allow(non_camel_case_types)]

use core::ffi::{c_char, c_int};

/* automatically generated by rust-bindgen 0.72.1 */

#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct _dftd4_error {
    _unused: [u8; 0],
}
#[doc = " Error handle class"]
pub type dftd4_error = *mut _dftd4_error;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct _dftd4_structure {
    _unused: [u8; 0],
}
#[doc = " Molecular structure data class"]
pub type dftd4_structure = *mut _dftd4_structure;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct _dftd4_model {
    _unused: [u8; 0],
}
#[doc = " Dispersion model class"]
pub type dftd4_model = *mut _dftd4_model;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct _dftd4_param {
    _unused: [u8; 0],
}
#[doc = " Damping parameter class"]
pub type dftd4_param = *mut _dftd4_param;
unsafe extern "C" {
    #[cfg(feature = "api-v3_0")]
    #[doc = " Obtain library version as major * 10000 + minor * 100 + patch"]
    pub fn dftd4_get_version() -> c_int;
    #[cfg(feature = "api-v3_0")]
    #[doc = " Create new error handle object"]
    pub fn dftd4_new_error() -> dftd4_error;
    #[cfg(feature = "api-v3_0")]
    #[doc = " Check error handle status"]
    pub fn dftd4_check_error(arg1: dftd4_error) -> c_int;
    #[cfg(feature = "api-v3_0")]
    #[doc = " Get error message from error handle"]
    pub fn dftd4_get_error(arg1: dftd4_error, arg2: *mut c_char, arg3: *const c_int);
    #[cfg(feature = "api-v3_0")]
    #[doc = " Delete error handle object"]
    pub fn dftd4_delete_error(arg1: *mut dftd4_error);
    #[cfg(feature = "api-v3_0")]
    #[doc = " Create new molecular structure data (quantities in Bohr)"]
    pub fn dftd4_new_structure(
        arg1: dftd4_error,
        arg2: c_int,
        arg3: *const c_int,
        arg4: *const f64,
        arg5: *const f64,
        arg6: *const f64,
        arg7: *const bool,
    ) -> dftd4_structure;
    #[cfg(feature = "api-v3_0")]
    #[doc = " Delete molecular structure data"]
    pub fn dftd4_delete_structure(arg1: *mut dftd4_structure);
    #[cfg(feature = "api-v3_0")]
    #[doc = " Update coordinates and lattice parameters (quantities in Bohr)"]
    pub fn dftd4_update_structure(
        arg1: dftd4_error,
        arg2: dftd4_structure,
        arg3: *const f64,
        arg4: *const f64,
    );
    #[cfg(feature = "api-v3_0")]
    #[doc = " Create new D4 dispersion model"]
    pub fn dftd4_new_d4_model(arg1: dftd4_error, arg2: dftd4_structure) -> dftd4_model;
    #[cfg(feature = "api-v4_0")]
    #[doc = " Create new D4 dispersion model"]
    pub fn dftd4_new_d4s_model(arg1: dftd4_error, arg2: dftd4_structure) -> dftd4_model;
    #[cfg(feature = "api-v3_1")]
    #[doc = " Create new D4 dispersion model"]
    pub fn dftd4_custom_d4_model(
        arg1: dftd4_error,
        arg2: dftd4_structure,
        arg3: f64,
        arg4: f64,
        arg5: f64,
    ) -> dftd4_model;
    #[cfg(feature = "api-v4_0")]
    #[doc = " Create new D4 dispersion model"]
    pub fn dftd4_custom_d4s_model(
        arg1: dftd4_error,
        arg2: dftd4_structure,
        arg3: f64,
        arg4: f64,
    ) -> dftd4_model;
    #[cfg(feature = "api-v3_0")]
    #[doc = " Delete dispersion model"]
    pub fn dftd4_delete_model(arg1: *mut dftd4_model);
    #[cfg(feature = "api-v4_2")]
    #[doc = " Set realspace cutoffs (quantities in Bohr)"]
    pub fn dftd4_set_model_realspace_cutoff(
        arg1: dftd4_error,
        arg2: dftd4_model,
        arg3: f64,
        arg4: f64,
        arg5: f64,
    );
    #[cfg(feature = "api-v4_2")]
    #[doc = " Set realspace cutoffs with smoothing widths (quantities in Bohr)"]
    pub fn dftd4_set_model_realspace_cutoff_smooth(
        arg1: dftd4_error,
        arg2: dftd4_model,
        arg3: f64,
        arg4: f64,
        arg5: f64,
        arg6: f64,
        arg7: f64,
    );
    #[cfg(feature = "api-v3_0")]
    #[doc = " Create new rational damping parameters"]
    pub fn dftd4_new_rational_damping(
        arg1: dftd4_error,
        arg2: f64,
        arg3: f64,
        arg4: f64,
        arg5: f64,
        arg6: f64,
        arg7: f64,
    ) -> dftd4_param;
    #[cfg(feature = "api-v3_0")]
    #[doc = " Load rational damping parameters from internal storage"]
    pub fn dftd4_load_rational_damping(
        arg1: dftd4_error,
        arg2: *mut c_char,
        arg3: bool,
    ) -> dftd4_param;
    #[cfg(feature = "api-v3_0")]
    #[doc = " Delete damping parameters"]
    pub fn dftd4_delete_param(arg1: *mut dftd4_param);
    #[cfg(feature = "api-v3_1")]
    #[doc = " Evaluate properties related to the dispersion model"]
    pub fn dftd4_get_properties(
        arg1: dftd4_error,
        arg2: dftd4_structure,
        arg3: dftd4_model,
        arg4: *mut f64,
        arg5: *mut f64,
        arg6: *mut f64,
        arg7: *mut f64,
    );
    #[cfg(feature = "api-v3_0")]
    #[doc = " Evaluate the dispersion energy and its derivative"]
    pub fn dftd4_get_dispersion(
        arg1: dftd4_error,
        arg2: dftd4_structure,
        arg3: dftd4_model,
        arg4: dftd4_param,
        arg5: *mut f64,
        arg6: *mut f64,
        arg7: *mut f64,
    );
    #[cfg(feature = "api-v3_5")]
    #[doc = " Evaluate the dispersion hessian numerically"]
    pub fn dftd4_get_numerical_hessian(
        arg1: dftd4_error,
        arg2: dftd4_structure,
        arg3: dftd4_model,
        arg4: dftd4_param,
        arg5: *mut f64,
    );
    #[cfg(feature = "api-v3_2")]
    #[doc = " Evaluate the pairwise representation of the dispersion energy"]
    pub fn dftd4_get_pairwise_dispersion(
        arg1: dftd4_error,
        arg2: dftd4_structure,
        arg3: dftd4_model,
        arg4: dftd4_param,
        arg5: *mut f64,
        arg6: *mut f64,
    );
}