mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-22 22:16:16 +02:00
nix_api_store: add userdata param to nix_store_build
This commit is contained in:
parent
1e583c4ebd
commit
1777e4a5bb
2 changed files with 8 additions and 3 deletions
|
@ -93,7 +93,9 @@ StorePath *nix_store_parse_path(nix_c_context *context, Store *store,
|
||||||
}
|
}
|
||||||
|
|
||||||
nix_err nix_store_build(nix_c_context *context, Store *store, StorePath *path,
|
nix_err nix_store_build(nix_c_context *context, Store *store, StorePath *path,
|
||||||
void (*iter)(const char *, const char *)) {
|
void *userdata,
|
||||||
|
void (*iter)(void *userdata, const char *,
|
||||||
|
const char *)) {
|
||||||
if (context)
|
if (context)
|
||||||
context->last_err_code = NIX_OK;
|
context->last_err_code = NIX_OK;
|
||||||
try {
|
try {
|
||||||
|
@ -107,7 +109,7 @@ nix_err nix_store_build(nix_c_context *context, Store *store, StorePath *path,
|
||||||
for (auto &[outputName, outputPath] :
|
for (auto &[outputName, outputPath] :
|
||||||
store->ptr->queryDerivationOutputMap(path->path)) {
|
store->ptr->queryDerivationOutputMap(path->path)) {
|
||||||
auto op = store->ptr->printStorePath(outputPath);
|
auto op = store->ptr->printStorePath(outputPath);
|
||||||
iter(outputName.c_str(), op.c_str());
|
iter(userdata, outputName.c_str(), op.c_str());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -98,10 +98,13 @@ bool nix_store_is_valid_path(nix_c_context *context, Store *store,
|
||||||
* @param[out] context Optional, stores error information
|
* @param[out] context Optional, stores error information
|
||||||
* @param[in] store nix store reference
|
* @param[in] store nix store reference
|
||||||
* @param[in] path Path to build
|
* @param[in] path Path to build
|
||||||
|
* @param[in] userdata data to pass to every callback invocation
|
||||||
* @param[in] cb called for every built output
|
* @param[in] cb called for every built output
|
||||||
*/
|
*/
|
||||||
nix_err nix_store_build(nix_c_context *context, Store *store, StorePath *path,
|
nix_err nix_store_build(nix_c_context *context, Store *store, StorePath *path,
|
||||||
void (*cb)(const char *outname, const char *out));
|
void *userdata,
|
||||||
|
void (*cb)(void *userdata, const char *outname,
|
||||||
|
const char *out));
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief get the version of a nix store
|
* @brief get the version of a nix store
|
||||||
|
|
Loading…
Reference in a new issue