Function nix_expr_eval_from_string

Source
pub unsafe extern "C" fn nix_expr_eval_from_string(
    context: *mut nix_c_context,
    state: *mut EvalState,
    expr: *const c_char,
    path: *const c_char,
    value: *mut nix_value,
) -> nix_err
Expand description

Parses and evaluates a Nix expression from a string.

§Arguments

  • context [out] - Optional, stores error information
  • state [in] - The state of the evaluation.
  • expr [in] - The Nix expression to parse.
  • path [in] - The file path to associate with the expression. This is required for expressions that contain relative paths (such as ./.) that are resolved relative to the given directory.
  • value [out] - The result of the evaluation. You must allocate this yourself.

§Returns

NIX_OK if the evaluation was successful, an error code otherwise.