1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-27 04:21:16 +02:00

C API: nix_get_string now accepts a callback to return the value

This commit is contained in:
José Luis Lafuente 2024-04-15 21:05:52 +02:00
parent 74e4bc9b1d
commit c75b143b6c
No known key found for this signature in database
GPG key ID: 8A3455EBE455489A
6 changed files with 65 additions and 35 deletions

View file

@ -178,10 +178,13 @@ bool nix_get_bool(nix_c_context * context, const Value * value);
*
* @param[out] context Optional, stores error information
* @param[in] value Nix value to inspect
* @param[in] callback Called with the string value.
* @param[in] user_data optional, arbitrary data, passed to the callback when it's called.
* @return string
* @return NULL in case of error.
* @return error code, NIX_OK on success.
*/
const char * nix_get_string(nix_c_context * context, const Value * value);
nix_err
nix_get_string(nix_c_context * context, const Value * value, nix_get_string_callback callback, void * user_data);
/** @brief Get path as string
* @param[out] context Optional, stores error information
@ -482,7 +485,6 @@ const StorePath * nix_realised_string_get_store_path(nix_realised_string * reali
*/
void nix_realised_string_free(nix_realised_string * realised_string);
// cffi end
#ifdef __cplusplus
}