mirror of
https://github.com/NixOS/nix.git
synced 2025-11-09 03:56:01 +01:00
nix_store_realise: Improve typing of store path
Use `StorePath *` not `const char *`.
This commit is contained in:
parent
fa76b6e215
commit
f6bc47bc50
2 changed files with 4 additions and 4 deletions
|
|
@ -131,7 +131,7 @@ nix_err nix_store_realise(
|
||||||
Store * store,
|
Store * store,
|
||||||
StorePath * path,
|
StorePath * path,
|
||||||
void * userdata,
|
void * userdata,
|
||||||
void (*callback)(void * userdata, const char *, const char *))
|
void (*callback)(void * userdata, const char *, const StorePath *))
|
||||||
{
|
{
|
||||||
if (context)
|
if (context)
|
||||||
context->last_err_code = NIX_OK;
|
context->last_err_code = NIX_OK;
|
||||||
|
|
@ -146,8 +146,8 @@ nix_err nix_store_realise(
|
||||||
if (callback) {
|
if (callback) {
|
||||||
for (const auto & result : results) {
|
for (const auto & result : results) {
|
||||||
for (const auto & [outputName, realisation] : result.builtOutputs) {
|
for (const auto & [outputName, realisation] : result.builtOutputs) {
|
||||||
auto op = store->ptr->printStorePath(realisation.outPath);
|
StorePath p{realisation.outPath};
|
||||||
callback(userdata, outputName.c_str(), op.c_str());
|
callback(userdata, outputName.c_str(), &p);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -190,7 +190,7 @@ nix_err nix_store_realise(
|
||||||
Store * store,
|
Store * store,
|
||||||
StorePath * path,
|
StorePath * path,
|
||||||
void * userdata,
|
void * userdata,
|
||||||
void (*callback)(void * userdata, const char * outname, const char * out));
|
void (*callback)(void * userdata, const char * outname, const StorePath * out));
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief get the version of a nix store.
|
* @brief get the version of a nix store.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue