Deal with external values.
More...
Deal with external values.
◆ ExternalValue
External Value.
Owned by the GC
◆ nix_string_return
Represents a string owned by nix.
- See also
- nix_set_owned_string
◆ 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_set_external.
Owned by the GC. Use nix_gc_decref when you're done with the pointer.
- Parameters
-
[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 |
- Returns
- external value, owned by the garbage collector
- See also
- nix_set_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 |
| 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 external value.
- Parameters
-
[out] | context | Optional, stores error information |
[in] | b | The external value |
- Returns
- The pointer, or null if the external value was not from nix c.
- See also
- nix_get_external
◆ nix_set_string_return()
Sets the contents of a nix_string_return.
Copies the passed string.
- Parameters
-
[out] | str | the nix_string_return to write to |
[in] | c | The string to copy |