mirror of
https://github.com/NixOS/nix
synced 2025-06-27 12:41:15 +02:00
C API: clarify some documentation
This commit is contained in:
parent
5d82d6e733
commit
9d380c0f76
5 changed files with 22 additions and 19 deletions
|
@ -59,8 +59,9 @@ typedef void Value; // nix::Value
|
|||
/**
|
||||
* @brief Initialize the Nix language evaluator.
|
||||
*
|
||||
* This function should be called before creating a State.
|
||||
* This function can be called multiple times.
|
||||
* This function must be called at least once,
|
||||
* at some point before constructing a State for the first time.
|
||||
* This function can be called multiple times, and is idempotent.
|
||||
*
|
||||
* @param[out] context Optional, stores error information
|
||||
* @return NIX_OK if the initialization was successful, an error code otherwise.
|
||||
|
@ -106,7 +107,8 @@ nix_err nix_value_call(nix_c_context *context, State *state, Value *fn,
|
|||
*
|
||||
* @note You don't need this function for basic API usage, since all functions
|
||||
* that return a value call it for you. The only place you will see a
|
||||
* NIX_TYPE_THUNK is in the primop callback.
|
||||
* NIX_TYPE_THUNK is in the arguments that are passed to a PrimOp function
|
||||
* you supplied to nix_alloc_primop.
|
||||
*
|
||||
* @param[out] context Optional, stores error information
|
||||
* @param[in] state The state of the evaluation.
|
||||
|
|
|
@ -66,12 +66,12 @@ typedef struct ExternalValue ExternalValue;
|
|||
*/
|
||||
/** @brief Function pointer for primops
|
||||
* @param[in] state Evaluator state
|
||||
* @param[in] pos position of function call
|
||||
* @param[in] args list of arguments
|
||||
* @param[out] v return value
|
||||
* @param[in] pos Call position, opaque index into the state's position table.
|
||||
* @param[in] args list of arguments. Note that these can be thunks and should be forced using nix_value_force before use.
|
||||
* @param[out] ret return value
|
||||
* @see nix_alloc_primop, nix_set_primop
|
||||
*/
|
||||
typedef void (*PrimOpFun)(State *state, int pos, Value **args, Value *v);
|
||||
typedef void (*PrimOpFun)(State *state, int pos, Value **args, Value *ret);
|
||||
|
||||
/** @brief Allocate a PrimOp
|
||||
*
|
||||
|
@ -80,9 +80,9 @@ typedef void (*PrimOpFun)(State *state, int pos, Value **args, Value *v);
|
|||
*
|
||||
* @param[out] context Optional, stores error information
|
||||
* @param[in] fun callback
|
||||
* @param[in] arity expected amount of function arguments
|
||||
* @param[in] arity expected number of function arguments
|
||||
* @param[in] name function name
|
||||
* @param[in] args array of argument names
|
||||
* @param[in] args array of argument names, NULL-terminated
|
||||
* @param[in] doc optional, documentation for this primop
|
||||
* @return primop, or null in case of errors
|
||||
* @see nix_set_primop
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue