Skip to content

Commit 96b3f09

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

File tree

3 files changed

+4
-41
lines changed

3 files changed

+4
-41
lines changed

src/libstore-c/nix_api_store.cc

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -333,8 +333,7 @@ nix_err nix_derivation_get_outputs_and_optpaths(
333333
nix_c_context * context,
334334
const nix_derivation * drv,
335335
const Store * store,
336-
void (*callback)(
337-
void * userdata, const char * name, const nix_derivation_output * drv_output, const StorePath * path),
336+
void (*callback)(void * userdata, const char * name, const StorePath * path),
338337
void * userdata)
339338
{
340339
if (context)
@@ -343,28 +342,16 @@ nix_err nix_derivation_get_outputs_and_optpaths(
343342
auto value = drv->drv.outputsAndOptPaths(store->ptr->config);
344343
if (callback) {
345344
for (const auto & [name, result] : value) {
346-
const nix_derivation_output tmp_output{result.first};
347-
348345
if (auto store_path = result.second) {
349346
const StorePath tmp_path{*store_path};
350-
callback(userdata, name.c_str(), &tmp_output, &tmp_path);
347+
callback(userdata, name.c_str(), &tmp_path);
351348
} else {
352-
callback(userdata, name.c_str(), &tmp_output, nullptr);
349+
callback(userdata, name.c_str(), nullptr);
353350
}
354351
}
355352
}
356353
}
357354
NIXC_CATCH_ERRS
358355
}
359356

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-
370357
} // extern "C"

src/libstore-c/nix_api_store.h

Lines changed: 1 addition & 20 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
@@ -352,26 +350,9 @@ nix_err nix_derivation_get_outputs_and_optpaths(
352350
nix_c_context * context,
353351
const nix_derivation * drv,
354352
const Store * store,
355-
void (*callback)(
356-
void * userdata, const char * name, const nix_derivation_output * drv_output, const StorePath * path),
353+
void (*callback)(void * userdata, const char * name, const StorePath * path),
357354
void * userdata);
358355

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-
375356
// cffi end
376357
#ifdef __cplusplus
377358
}

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)