Skip to content

Commit bec7506

Browse files
libstore-c: remove nix_derivation_output
1 parent 22a04d9 commit bec7506

File tree

3 files changed

+4
-39
lines changed

3 files changed

+4
-39
lines changed

src/libstore-c/nix_api_store.cc

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ nix_err nix_derivation_get_outputs_and_optpaths(
334334
const nix_derivation * drv,
335335
const Store * store,
336336
void (*callback)(
337-
void * userdata, const char * name, const nix_derivation_output * drv_output, const StorePath * path),
337+
void * userdata, const char * name, const StorePath * path),
338338
void * userdata)
339339
{
340340
if (context)
@@ -343,28 +343,16 @@ nix_err nix_derivation_get_outputs_and_optpaths(
343343
auto value = drv->drv.outputsAndOptPaths(store->ptr->config);
344344
if (callback) {
345345
for (const auto & [name, result] : value) {
346-
const nix_derivation_output tmp_output{result.first};
347-
348346
if (auto store_path = result.second) {
349347
const StorePath tmp_path{*store_path};
350-
callback(userdata, name.c_str(), &tmp_output, &tmp_path);
348+
callback(userdata, name.c_str(), &tmp_path);
351349
} else {
352-
callback(userdata, name.c_str(), &tmp_output, nullptr);
350+
callback(userdata, name.c_str(), nullptr);
353351
}
354352
}
355353
}
356354
}
357355
NIXC_CATCH_ERRS
358356
}
359357

360-
nix_derivation_output * nix_derivation_output_clone(const nix_derivation_output * o)
361-
{
362-
return new nix_derivation_output{o->drv_out};
363-
}
364-
365-
void nix_derivation_output_free(nix_derivation_output * o)
366-
{
367-
delete o;
368-
}
369-
370358
} // extern "C"

src/libstore-c/nix_api_store.h

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@ typedef struct Store Store;
2525
typedef struct StorePath StorePath;
2626
/** @brief Nix Derivation */
2727
typedef struct nix_derivation nix_derivation;
28-
/** @brief Nix Derivation Output */
29-
typedef struct nix_derivation_output nix_derivation_output;
3028

3129
/**
3230
* @brief Initializes the Nix store library
@@ -353,25 +351,9 @@ nix_err nix_derivation_get_outputs_and_optpaths(
353351
const nix_derivation * drv,
354352
const Store * store,
355353
void (*callback)(
356-
void * userdata, const char * name, const nix_derivation_output * drv_output, const StorePath * path),
354+
void * userdata, const char * name, const StorePath * path),
357355
void * userdata);
358356

359-
/**
360-
* @brief Copy of a 'nix_derivation_output'
361-
*
362-
* @param[in] o the derivation output to copy
363-
* @return a new 'nix_derivation_output'
364-
*/
365-
nix_derivation_output * nix_derivation_output_clone(const nix_derivation_output * o);
366-
367-
/**
368-
* @brief Deallocate a 'nix_derivation_output'
369-
*
370-
* Does not fail.
371-
* @param[in] o the derivation output to free
372-
*/
373-
void nix_derivation_output_free(nix_derivation_output * o);
374-
375357
// cffi end
376358
#ifdef __cplusplus
377359
}

src/libstore-c/nix_api_store_internal.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,6 @@ struct nix_derivation
2020
nix::Derivation drv;
2121
};
2222

23-
struct nix_derivation_output
24-
{
25-
nix::DerivationOutput drv_out;
26-
};
27-
2823
} // extern "C"
2924

3025
#endif

0 commit comments

Comments
 (0)