#![cfg(feature = "vsscript")]
use std::ffi::{c_char, c_int, c_void};
use super::{VSAPI, VSCore, VSMap, VSNode, opaque_struct, vs_make_version};
pub const VSSCRIPT_API_MAJOR: u16 = 4;
pub const VSSCRIPT_API_MINOR: u16 = if cfg!(feature = "vsscript-42") { 2 } else { 1 };
pub const VSSCRIPT_API_VERSION: i32 = vs_make_version(VSSCRIPT_API_MAJOR, VSSCRIPT_API_MINOR);
opaque_struct!(
VSScript
);
#[allow(non_snake_case)]
#[repr(C)]
pub struct VSSCRIPTAPI {
pub getApiVersion: unsafe extern "system-unwind" fn() -> c_int,
pub getVSAPI: unsafe extern "system-unwind" fn(version: c_int) -> *const VSAPI,
pub createScript: unsafe extern "system-unwind" fn(core: *mut VSCore) -> *mut VSScript,
pub getCore: unsafe extern "system-unwind" fn(handle: *mut VSScript) -> *mut VSCore,
pub evaluateBuffer: unsafe extern "system-unwind" fn(
handle: *mut VSScript,
buffer: *const c_char,
scriptFilename: *const c_char,
) -> c_int,
pub evaluateFile: unsafe extern "system-unwind" fn(
handle: *mut VSScript,
scriptFilename: *const c_char,
) -> c_int,
pub getError: unsafe extern "system-unwind" fn(handle: *mut VSScript) -> *const c_char,
pub getExitCode: unsafe extern "system-unwind" fn(handle: *mut VSScript) -> c_int,
pub getVariable: unsafe extern "system-unwind" fn(
handle: *mut VSScript,
name: *const c_char,
dst: *mut VSMap,
) -> c_int,
pub setVariable:
unsafe extern "system-unwind" fn(handle: *mut VSScript, vars: *const VSMap) -> c_int,
pub getOutputNode:
unsafe extern "system-unwind" fn(handle: *mut VSScript, index: c_int) -> *mut VSNode,
pub getOutputAlphaNode:
unsafe extern "system-unwind" fn(handle: *mut VSScript, index: c_int) -> *mut VSNode,
pub getAltOutputMode:
unsafe extern "system-unwind" fn(handle: *mut VSScript, index: c_int) -> c_int,
pub freeScript: unsafe extern "system-unwind" fn(handle: *mut VSScript) -> c_int,
pub evalSetWorkingDir:
unsafe extern "system-unwind" fn(handle: *mut VSScript, setCWD: c_int) -> c_void,
#[cfg(feature = "vsscript-42")]
pub getAvailableOutputNodes: unsafe extern "system-unwind" fn(
handle: *mut VSScript,
size: c_int,
dst: *mut c_int,
) -> c_int,
}
#[cfg(feature = "link-library")]
#[cfg_attr(target_os = "windows", link(name = "VSScript"))]
#[cfg_attr(not(target_os = "windows"), link(name = "vapoursynth-script"))]
unsafe extern "system-unwind" {
pub fn getVSScriptAPI(version: c_int) -> *const VSSCRIPTAPI;
}