Skip to main content

nix_value_auto_call_function

Function nix_value_auto_call_function 

Source
pub unsafe extern "C" fn nix_value_auto_call_function(
    context: *mut nix_c_context,
    state: *mut EvalState,
    auto_args: *mut nix_value,
    fn_val: *mut nix_value,
    result: *mut nix_value,
) -> nix_err
Expand description

Call a function, drawing its arguments from an attribute set. Forces fn_val and writes its application into result. If fn_val is a function that expects named arguments, each argument is looked up in auto_args; formals with defaults that are absent from auto_args use their defaults. If auto_args is NULL or not an attribute set, empty bindings are supplied (every formal must then have a default value).

§Arguments

  • context [out] - Optional. Stores error information.
  • state [in] - Evaluator state.
  • auto_args [in] - Attribute set value supplying named arguments, or NULL.
  • fn_val [in] - The value to call.
  • result [out] - Pre-allocated nix_value that receives the result.

§Returns

NIX_OK on success, an error code otherwise.