mirror of
https://github.com/NixOS/nix
synced 2025-06-25 10:41:16 +02:00
C API: Add nix_value_call_multi, NIX_VALUE_CALL
_multi can be implemented more efficiently. NIX_VALUE_CALL is a convenient way to invoke it.
This commit is contained in:
parent
ab106c5ca3
commit
2497d10351
3 changed files with 100 additions and 1 deletions
|
@ -65,6 +65,17 @@ nix_err nix_value_call(nix_c_context * context, EvalState * state, Value * fn, V
|
|||
NIXC_CATCH_ERRS
|
||||
}
|
||||
|
||||
nix_err nix_value_call_multi(nix_c_context * context, EvalState * state, Value * fn, size_t nargs, Value ** args, Value * value)
|
||||
{
|
||||
if (context)
|
||||
context->last_err_code = NIX_OK;
|
||||
try {
|
||||
state->state.callFunction(*(nix::Value *) fn, nargs, (nix::Value * *)args, *(nix::Value *) value, nix::noPos);
|
||||
state->state.forceValue(*(nix::Value *) value, nix::noPos);
|
||||
}
|
||||
NIXC_CATCH_ERRS
|
||||
}
|
||||
|
||||
nix_err nix_value_force(nix_c_context * context, EvalState * state, Value * value)
|
||||
{
|
||||
if (context)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue