Externals let Nix expressions work with foreign values that aren't part of the normal Nix value data model.
More...
Externals let Nix expressions work with foreign values that aren't part of the normal Nix value data model.
◆ nix_string_return
Represents a string owned by the Nix language evaluator.
- See also
- nix_set_owned_string
◆ NixCExternalValueDesc
| 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
- See also
- nix_create_external_value
◆ nix_create_external_value()
Create an external value, that can be given to nix_init_external.
Call nix_gc_decref() when you're done with the pointer.
- Parameters
-
- Returns
- external value, owned by the garbage collector
- See also
- nix_init_external
◆ nix_external_add_string_context()
Add string context to the nix_string_context object
- Parameters
-
| [out] | context | Optional, stores error information |
| [out] | string_context | The nix_string_context to add to |
| [in] | c | The context string to add |
- Returns
- NIX_OK if everything worked
◆ nix_external_print()
Print to the nix_printer
- Parameters
-
| [out] | context | Optional, stores error information |
| [out] | printer | The nix_printer to print to |
| [in] | str | The string to print |
- Returns
- NIX_OK if everything worked
◆ nix_get_external_value_content()
Extract the pointer from a Nix C API external value.
- Parameters
-
| [out] | context | Optional, stores error information |
| [in] | b | The external value |
- Returns
- The pointer, valid while the external value is valid, or null if the external value was not from the Nix C API.
- See also
- nix_get_external
◆ nix_set_string_return()