Crate nix_bindings_expr_sys

Crate nix_bindings_expr_sys 

Source
Expand description

Raw bindings to Nix C API

This crate contains automatically generated bindings from the Nix C headers. The bindings are generated by bindgen and include C-style naming conventions and documentation comments that don’t always conform to Rust standards.

Normally you don’t have to use this crate directly. Instead use nix-expr.

Structs§

BindingsBuilder
EvalState
ExternalValue
ListBuilder
PrimOp
StorePath
__fsid_t
derivation
eval_state_builder
max_align_t
realised_string
store_path_hash_part
@brief A store path hash
value

Constants§

INT8_MAX
INT8_MIN
INT8_WIDTH
INT16_MAX
INT16_MIN
INT16_WIDTH
INT32_MAX
INT32_MIN
INT32_WIDTH
INT64_WIDTH
INTMAX_WIDTH
INTPTR_MAX
INTPTR_MIN
INTPTR_WIDTH
INT_FAST8_MAX
INT_FAST8_MIN
INT_FAST8_WIDTH
INT_FAST16_MAX
INT_FAST16_MIN
INT_FAST16_WIDTH
INT_FAST32_MAX
INT_FAST32_MIN
INT_FAST32_WIDTH
INT_FAST64_WIDTH
INT_LEAST8_MAX
INT_LEAST8_MIN
INT_LEAST8_WIDTH
INT_LEAST16_MAX
INT_LEAST16_MIN
INT_LEAST16_WIDTH
INT_LEAST32_MAX
INT_LEAST32_MIN
INT_LEAST32_WIDTH
INT_LEAST64_WIDTH
PTRDIFF_MAX
PTRDIFF_MIN
PTRDIFF_WIDTH
SIG_ATOMIC_MAX
SIG_ATOMIC_MIN
SIG_ATOMIC_WIDTH
SIZE_MAX
SIZE_WIDTH
UINT8_MAX
UINT8_WIDTH
UINT16_MAX
UINT16_WIDTH
UINT32_MAX
UINT32_WIDTH
UINT64_WIDTH
UINTMAX_WIDTH
UINTPTR_MAX
UINTPTR_WIDTH
UINT_FAST8_MAX
UINT_FAST8_WIDTH
UINT_FAST16_MAX
UINT_FAST16_WIDTH
UINT_FAST32_MAX
UINT_FAST32_WIDTH
UINT_FAST64_WIDTH
UINT_LEAST8_MAX
UINT_LEAST8_WIDTH
UINT_LEAST16_MAX
UINT_LEAST16_WIDTH
UINT_LEAST32_MAX
UINT_LEAST32_WIDTH
UINT_LEAST64_WIDTH
ValueType_NIX_TYPE_ATTRS
@brief Attribute set (key-value mapping) @see https://nix.dev/manual/nix/latest/language/types.html#type-attrs
ValueType_NIX_TYPE_BOOL
@brief Boolean true or false value @see https://nix.dev/manual/nix/latest/language/types.html#type-bool
ValueType_NIX_TYPE_EXTERNAL
@brief External value from C++ plugins or C API @see Externals
ValueType_NIX_TYPE_FLOAT
@brief IEEE 754 double precision floating point number @see https://nix.dev/manual/nix/latest/language/types.html#type-float
ValueType_NIX_TYPE_FUNCTION
@brief Function (lambda or builtin) @see https://nix.dev/manual/nix/latest/language/types.html#type-function
ValueType_NIX_TYPE_INT
A 64 bit signed integer.
ValueType_NIX_TYPE_LIST
@brief Ordered list of values @see https://nix.dev/manual/nix/latest/language/types.html#type-list
ValueType_NIX_TYPE_NULL
@brief Null value @see https://nix.dev/manual/nix/latest/language/types.html#type-null
ValueType_NIX_TYPE_PATH
@brief Filesystem path @see https://nix.dev/manual/nix/latest/language/types.html#type-path
ValueType_NIX_TYPE_STRING
@brief String value with context
ValueType_NIX_TYPE_THUNK
Unevaluated expression
WCHAR_WIDTH
WINT_MAX
WINT_MIN
WINT_WIDTH
_ATFILE_SOURCE
_BITS_STDINT_INTN_H
_BITS_STDINT_LEAST_H
_BITS_STDINT_UINTN_H
_BITS_TIME64_H
_BITS_TYPESIZES_H
_BITS_TYPES_H
_BITS_WCHAR_H
_DEFAULT_SOURCE
_DYNAMIC_STACK_SIZE_SOURCE
_FEATURES_H
_ISOC2Y_SOURCE
_ISOC11_SOURCE
_ISOC23_SOURCE
_ISOC95_SOURCE
_ISOC99_SOURCE
_LARGEFILE64_SOURCE
_LARGEFILE_SOURCE
_POSIX_C_SOURCE
_POSIX_SOURCE
_STDC_PREDEF_H
_STDINT_H
_SYS_CDEFS_H
_XOPEN_SOURCE
_XOPEN_SOURCE_EXTENDED
__FD_SETSIZE
__GLIBC_MINOR__
__GLIBC_USE_C23_STRTOL
__GLIBC_USE_DEPRECATED_GETS
__GLIBC_USE_DEPRECATED_SCANF
__GLIBC_USE_IEC_60559_BFP_EXT
__GLIBC_USE_IEC_60559_BFP_EXT_C23
__GLIBC_USE_IEC_60559_EXT
__GLIBC_USE_IEC_60559_FUNCS_EXT
__GLIBC_USE_IEC_60559_FUNCS_EXT_C23
__GLIBC_USE_IEC_60559_TYPES_EXT
__GLIBC_USE_ISOC2Y
__GLIBC_USE_ISOC23
__GLIBC_USE_LIB_EXT2
__GLIBC__
__GNU_LIBRARY__
__HAVE_GENERIC_SELECTION
__INO_T_MATCHES_INO64_T
__KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64
__LDOUBLE_REDIRECTS_TO_FLOAT128_ABI
__OFF_T_MATCHES_OFF64_T
__RLIM_T_MATCHES_RLIM64_T
__STATFS_MATCHES_STATFS64
__STDC_IEC_559_COMPLEX__
__STDC_IEC_559__
__STDC_IEC_60559_BFP__
__STDC_IEC_60559_COMPLEX__
__STDC_ISO_10646__
__SYSCALL_WORDSIZE
__TIMESIZE
__USE_ATFILE
__USE_DYNAMIC_STACK_SIZE
__USE_FORTIFY_LEVEL
__USE_GNU
__USE_ISOC11
__USE_ISOC95
__USE_ISOC99
__USE_ISOCXX11
__USE_LARGEFILE
__USE_LARGEFILE64
__USE_MISC
__USE_POSIX
__USE_POSIX2
__USE_POSIX199309
__USE_POSIX199506
__USE_TIME_BITS64
__USE_UNIX98
__USE_XOPEN
__USE_XOPEN2K
__USE_XOPEN2K8
__USE_XOPEN2K8XSI
__USE_XOPEN2KXSI
__USE_XOPEN_EXTENDED
__WORDSIZE
__WORDSIZE_TIME64_COMPAT32
__bool_true_false_are_defined
__glibc_c99_flexarr_available

Functions§

alloc_primop
@brief Allocate a PrimOp @ingroup primops
alloc_value
@brief Allocate a Nix value @ingroup value_create
bindings_builder_free
@brief Free a bindings builder
bindings_builder_insert
@brief Insert bindings into a builder @param[out] context Optional, stores error information @param[in] builder BindingsBuilder to insert into @param[in] name attribute name, only used for the duration of the call. @param[in] value value to give the binding @return error code, NIX_OK on success.
copy_value
@brief Copy from another value @ingroup value_create @param[out] context Optional, stores error information @param[out] value Nix value to modify @param[in] source value to copy from @return error code, NIX_OK on success.
derivation_clone
@brief Copy a nix_derivation
derivation_free
@brief Deallocate a nix_derivation
derivation_to_json
@brief Gets the derivation as a JSON string
eval_state_build
@brief Create a new Nix language evaluator state @ingroup libexpr_init
eval_state_builder_free
@brief Free a nix_eval_state_builder @ingroup libexpr_init
eval_state_builder_load
@brief Read settings from the ambient environment @ingroup libexpr_init
eval_state_builder_new
@brief Create a new nix_eval_state_builder @ingroup libexpr_init
eval_state_builder_set_lookup_path
@brief Set the lookup path for <...> expressions @ingroup libexpr_init
expr_eval_from_string
@brief Parses and evaluates a Nix expression from a string. @ingroup value_create
gc_decref
@brief Decrement the garbage collector reference counter for the given object
gc_incref
@brief Increment the garbage collector reference counter for the given object.
gc_now
@brief Trigger the garbage collector manually
gc_register_finalizer
@brief Register a callback that gets called when the object is garbage collected. @note Objects can only have a single finalizer. This function overwrites existing values silently. @param[in] obj the object to watch @param[in] cd the data to pass to the finalizer @param[in] finalizer the callback function, called with obj and cd
get_attr_byidx
@brief Get an attribute by index @ingroup value_extract
get_attr_byidx_lazy
@brief Get an attribute by index, without forcing evaluation of the attribute’s value @ingroup value_extract
get_attr_byname
@brief Get an attr by name @ingroup value_extract
get_attr_byname_lazy
@brief Get an attribute value by attribute name, without forcing evaluation of the attribute’s value @ingroup value_extract
get_attr_name_byidx
@brief Get an attribute name by index @ingroup value_extract
get_attrs_size
@brief Get the element count of an attrset @ingroup value_extract @param[out] context Optional, stores error information @param[in] value Nix value to inspect @return attrset element count, error info via context
get_bool
@brief Get boolean value @ingroup value_extract @param[out] context Optional, stores error information @param[in] value Nix value to inspect @return true or false, error info via context
get_external
@brief Get external reference @ingroup value_extract @param[out] context Optional, stores error information @param[in] value Nix value to inspect @return reference valid while value is valid. Call nix_gc_incref() if you need it to live longer, then only in that case call nix_gc_decref() when done. NULL in case of error
get_float
@brief Get float value in 64 bits @ingroup value_extract @param[out] context Optional, stores error information @param[in] value Nix value to inspect @return float contents, error info via context
get_int
@brief Get int value @ingroup value_extract @param[out] context Optional, stores error information @param[in] value Nix value to inspect @return int contents, error info via context
get_list_byidx
@brief Get the ix’th element of a list @ingroup value_extract
get_list_byidx_lazy
@brief Get the ix’th element of a list without forcing evaluation of the element @ingroup value_extract
get_list_size
@brief Get the length of a list @ingroup value_extract @param[out] context Optional, stores error information @param[in] value Nix value to inspect @return length of list, error info via context
get_path_string
@brief Get path as string @ingroup value_extract @param[out] context Optional, stores error information @param[in] value Nix value to inspect @return string valid while value is valid, NULL in case of error
get_string
@brief Get the raw string @ingroup value_extract
get_type
@brief Get value type @ingroup value_extract @param[out] context Optional, stores error information @param[in] value Nix value to inspect @return type of nix value
get_typename
@brief Get type name of value as defined in the evaluator @ingroup value_extract @param[out] context Optional, stores error information @param[in] value Nix value to inspect @return type name string, free with free()
has_attr_byname
@brief Check if an attribute name exists on a value @ingroup value_extract @param[out] context Optional, stores error information @param[in] value Nix value to inspect @param[in] state nix evaluator state @param[in] name attribute name @return value, error info via context
init_apply
@brief Set the value to a thunk that will perform a function application when needed. @ingroup value_create
init_bool
@name Initializers
init_external
@brief Set an external value @ingroup value_create @param[out] context Optional, stores error information @param[out] value Nix value to modify @param[in] val the external value to set. Will be GC-referenced by the value. @return error code, NIX_OK on success.
init_float
@brief Set a float @ingroup value_create @param[out] context Optional, stores error information @param[out] value Nix value to modify @param[in] d the float, 64-bits @return error code, NIX_OK on success.
init_int
@brief Set an int @ingroup value_create @param[out] context Optional, stores error information @param[out] value Nix value to modify @param[in] i the int @return error code, NIX_OK on success.
init_null
@brief Set null @ingroup value_create @param[out] context Optional, stores error information @param[out] value Nix value to modify @return error code, NIX_OK on success.
init_path_string
@brief Set a path @ingroup value_create @param[out] context Optional, stores error information @param[out] value Nix value to modify @param[in] str the path string, copied @return error code, NIX_OK on success.
init_primop
@brief Set primop @ingroup value_create @param[out] context Optional, stores error information @param[out] value Nix value to modify @param[in] op primop, will be gc-referenced by the value @see nix_alloc_primop @return error code, NIX_OK on success.
init_string
@brief Set a string @ingroup value_create @param[out] context Optional, stores error information @param[out] value Nix value to modify @param[in] str the string, copied @return error code, NIX_OK on success.
libexpr_init
@brief Initialize the Nix language evaluator. @ingroup libexpr_init
list_builder_free
@brief Free a list builder
list_builder_insert
@brief Insert bindings into a builder @param[out] context Optional, stores error information @param[in] list_builder ListBuilder to insert into @param[in] index index to manipulate @param[in] value value to insert @return error code, NIX_OK on success.
make_attrs
@brief Create an attribute set from a bindings builder @ingroup value_create
make_bindings_builder
@brief Create a bindings builder @param[out] context Optional, stores error information @param[in] state nix evaluator state @param[in] capacity how many bindings you’ll add. Don’t exceed. @return bindings builder. Call nix_bindings_builder_free() when you’re done.
make_list
@brief Create a list from a list builder @ingroup value_create
make_list_builder
@brief Create a list builder @ingroup value_create @param[out] context Optional, stores error information @param[in] state nix evaluator state @param[in] capacity how many bindings you’ll add. Don’t exceed. @return list builder. Call nix_list_builder_free() when you’re done.
realised_string_free
@brief Free a realised string @param[in] realised_string
realised_string_get_buffer_size
@brief Length of the string @param[in] realised_string @return length of the string in bytes
realised_string_get_buffer_start
@brief Start of the string @param[in] realised_string @return pointer to the start of the string, valid until realised_string is freed. It may not be null-terminated.
realised_string_get_store_path
@brief Get a store path. The store paths are stored in an arbitrary order. @param[in] realised_string @param[in] index index of the store path, must be less than the count @return store path valid until realised_string is freed
realised_string_get_store_path_count
@brief Number of realised store paths @param[in] realised_string @return number of realised store paths that were referenced by the string via its context
register_primop
@brief add a primop to the builtins attribute set @ingroup primops
state_create
@brief Create a new Nix language evaluator state @ingroup libexpr_init
state_free
@brief Frees a Nix state. @ingroup libexpr_init
store_create_from_parts
@brief Create a StorePath from its constituent parts (hash and name)
store_path_clone
@brief Copy a StorePath
store_path_free
@brief Deallocate a StorePath
store_path_hash
@brief Get the path hash (e.g. “” in /nix/store/-)
store_path_name
@brief Get the path name (e.g. “” in /nix/store/-)
string_realise
@brief Realise a string context.
value_call
@brief Calls a Nix function with an argument. @ingroup value_create
value_call_multi
@brief Calls a Nix function with multiple arguments. @ingroup value_create
value_decref
@brief Decrement the garbage collector reference counter for the given object @ingroup value
value_force
@brief Forces the evaluation of a Nix value. @ingroup value_create
value_force_deep
@brief Forces the deep evaluation of a Nix value.
value_incref
@brief Increment the garbage collector reference counter for the given nix_value. @ingroup value

Type Aliases§

PrimOpFun
@brief Function pointer for primops @ingroup primops
Value
@deprecated Use nix_value instead
ValueType
@brief Represents the state of a Nix value
__blkcnt64_t
__blkcnt_t
__blksize_t
__caddr_t
__clock_t
__clockid_t
__daddr_t
__dev_t
__fsblkcnt64_t
__fsblkcnt_t
__fsfilcnt64_t
__fsfilcnt_t
__fsword_t
__gid_t
__id_t
__ino64_t
__ino_t
__int8_t
__int16_t
__int32_t
__int64_t
__int_least8_t
__int_least16_t
__int_least32_t
__int_least64_t
__intmax_t
__intptr_t
__key_t
__loff_t
__mode_t
__nlink_t
__off64_t
__off_t
__pid_t
__quad_t
__rlim64_t
__rlim_t
__sig_atomic_t
__socklen_t
__ssize_t
__suseconds64_t
__suseconds_t
__syscall_slong_t
__syscall_ulong_t
__time_t
__timer_t
__u_char
__u_int
__u_long
__u_quad_t
__u_short
__uid_t
__uint8_t
__uint16_t
__uint32_t
__uint64_t
__uint_least8_t
__uint_least16_t
__uint_least32_t
__uint_least64_t
__uintmax_t
__useconds_t
int_fast8_t
int_fast16_t
int_fast32_t
int_fast64_t
int_least8_t
int_least16_t
int_least32_t
int_least64_t
intmax_t
uint_fast8_t
uint_fast16_t
uint_fast32_t
uint_fast64_t
uint_least8_t
uint_least16_t
uint_least32_t
uint_least64_t
uintmax_t