Nix 2.29.0
Nix, the purely functional package manager: C API (experimental)
|
Deal with external values. More...
Files | |
file | nix_api_external.h |
libexpr C bindings dealing with external values |
Data Structures | |
struct | NixCExternalValueDesc |
Definition for a class of external values. More... |
Typedefs | |
typedef struct nix_string_return | nix_string_return |
Represents a string owned by the Nix language evaluator. | |
typedef struct nix_printer | nix_printer |
Wraps a stream that can output multiple string pieces. | |
typedef struct nix_string_context | nix_string_context |
A list of string context items. | |
typedef struct NixCExternalValueDesc | NixCExternalValueDesc |
Definition for a class of external values. | |
typedef struct ExternalValue | ExternalValue |
External Value. |
Functions | |
void | nix_set_string_return (nix_string_return *str, const char *c) |
Sets the contents of a nix_string_return. | |
nix_err | nix_external_print (nix_c_context *context, nix_printer *printer, const char *str) |
nix_err | nix_external_add_string_context (nix_c_context *context, nix_string_context *string_context, const char *c) |
ExternalValue * | nix_create_external_value (nix_c_context *context, NixCExternalValueDesc *desc, void *v) |
Create an external value, that can be given to nix_init_external. | |
void * | nix_get_external_value_content (nix_c_context *context, ExternalValue *b) |
Extract the pointer from a nix c external value. |
Deal with external values.
typedef struct ExternalValue ExternalValue |
External Value.
Owned by the GC
typedef struct nix_string_return nix_string_return |
Represents a string owned by the Nix language evaluator.
typedef struct NixCExternalValueDesc NixCExternalValueDesc |
Definition for a class of external values.
Create and implement one of these, then pass it to nix_create_external_value Make sure to keep it alive while the external value lives.
Optional functions can be set to NULL
ExternalValue * nix_create_external_value | ( | nix_c_context * | context, |
NixCExternalValueDesc * | desc, | ||
void * | v ) |
Create an external value, that can be given to nix_init_external.
Owned by the GC. Use nix_gc_decref when you're done with the pointer.
[out] | context | Optional, stores error information |
[in] | desc | a NixCExternalValueDesc, you should keep this alive as long as the ExternalValue lives |
[in] | v | the value to store |
nix_err nix_external_add_string_context | ( | nix_c_context * | context, |
nix_string_context * | string_context, | ||
const char * | c ) |
Add string context to the nix_string_context object
[out] | context | Optional, stores error information |
[out] | string_context | The nix_string_context to add to |
[in] | c | The context string to add |
nix_err nix_external_print | ( | nix_c_context * | context, |
nix_printer * | printer, | ||
const char * | str ) |
Print to the nix_printer
[out] | context | Optional, stores error information |
[out] | printer | The nix_printer to print to |
[in] | str | The string to print |
void * nix_get_external_value_content | ( | nix_c_context * | context, |
ExternalValue * | b ) |
Extract the pointer from a nix c external value.
[out] | context | Optional, stores error information |
[in] | b | The external value |
void nix_set_string_return | ( | nix_string_return * | str, |
const char * | c ) |
Sets the contents of a nix_string_return.
Copies the passed string.
[out] | str | the nix_string_return to write to |
[in] | c | The string to copy |