Nix 2.17.0
Nix, the purely functional package manager; stable external interfaces
Loading...
Searching...
No Matches
nix_api_expr.h
Go to the documentation of this file.
1#ifndef NIX_API_EXPR_H
2#define NIX_API_EXPR_H
31#include "nix_api_store.h"
32#include "nix_api_util.h"
33
34#ifdef __cplusplus
35extern "C" {
36#endif
37// cffi start
38
39// Type definitions
47typedef struct State State; // nix::EvalState
55typedef void Value; // nix::Value
56
57// Function prototypes
68
81 const char *expr, const char *path,
82 Value *value);
83
95 Value *arg, Value *value);
96
117
133 Value *value);
134
143State *nix_state_create(nix_c_context *context, const char **searchPath,
144 Store *store);
145
154
177nix_err nix_gc_incref(nix_c_context *context, const void *object);
184nix_err nix_gc_decref(nix_c_context *context, const void *object);
185
192
202void nix_gc_register_finalizer(void *obj, void *cd,
203 void (*finalizer)(void *obj, void *cd));
204
206// cffi end
207#ifdef __cplusplus
208}
209#endif
210
213#endif // NIX_API_EXPR_H
void nix_gc_register_finalizer(void *obj, void *cd, void(*finalizer)(void *obj, void *cd))
Register a callback that gets called when the object is garbage collected.
nix_err nix_gc_decref(nix_c_context *context, const void *object)
Decrease the GC refcount.
void nix_gc_now()
Trigger the garbage collector manually.
nix_err nix_gc_incref(nix_c_context *context, const void *object)
Increase the GC refcount.
int nix_err
Type for error codes in the NIX system.
Definition: nix_api_util.h:59
nix_err nix_value_call(nix_c_context *context, State *state, Value *fn, Value *arg, Value *value)
Calls a Nix function with an argument.
nix_err nix_libexpr_init(nix_c_context *context)
Initializes the Nix expression evaluator.
nix_err nix_expr_eval_from_string(nix_c_context *context, State *state, const char *expr, const char *path, Value *value)
Parses and evaluates a Nix expression from a string.
State * nix_state_create(nix_c_context *context, const char **searchPath, Store *store)
Creates a new Nix state.
nix_err nix_value_force_deep(nix_c_context *context, State *state, Value *value)
Forces the deep evaluation of a Nix value.
nix_err nix_value_force(nix_c_context *context, State *state, Value *value)
Forces the evaluation of a Nix value.
void nix_state_free(State *state)
Frees a Nix state.
struct Store Store
reference to a nix store
Definition: nix_api_store.h:23
Main entry for the libstore C bindings.
Main entry for the libutil C bindings.
Represents a nix evaluator state.
Represents a nix value.
This object stores error state.