@@ -186,6 +186,8 @@ nix_err nix_store_real_path(
186186 * @param[in] path Path to build
187187 * @param[in] userdata data to pass to every callback invocation
188188 * @param[in] callback called for every realised output
189+ * @return NIX_OK if the build succeeded, or an error code if the build/scheduling/outputs/copying/etc failed.
190+ * On error, the callback is never invoked and error information is stored in context.
189191 */
190192nix_err nix_store_realise (
191193 nix_c_context * context ,
@@ -245,6 +247,35 @@ void nix_derivation_free(nix_derivation * drv);
245247 */
246248nix_err nix_store_copy_closure (nix_c_context * context , Store * srcStore , Store * dstStore , StorePath * path );
247249
250+ /**
251+ * @brief Gets the closure of a specific store path
252+ *
253+ * @note The callback borrows each StorePath only for the duration of the call.
254+ *
255+ * @param[out] context Optional, stores error information
256+ * @param[in] store nix store reference
257+ * @param[in] store_path The path to compute from
258+ * @param[in] flip_direction If false, compute the forward closure (paths referenced by any store path in the closure).
259+ * If true, compute the backward closure (paths that reference any store path in the closure).
260+ * @param[in] include_outputs If flip_direction is false: for any derivation in the closure, include its outputs.
261+ * If flip_direction is true: for any output in the closure, include derivations that produce
262+ * it.
263+ * @param[in] include_derivers If flip_direction is false: for any output in the closure, include the derivation that
264+ * produced it.
265+ * If flip_direction is true: for any derivation in the closure, include its outputs.
266+ * @param[in] callback The function to call for every store path, in no particular order
267+ * @param[in] userdata The userdata to pass to the callback
268+ */
269+ nix_err nix_store_get_fs_closure (
270+ nix_c_context * context ,
271+ Store * store ,
272+ const StorePath * store_path ,
273+ bool flip_direction ,
274+ bool include_outputs ,
275+ bool include_derivers ,
276+ void * userdata ,
277+ void (* callback )(nix_c_context * context , void * userdata , const StorePath * store_path ));
278+
248279// cffi end
249280#ifdef __cplusplus
250281}
0 commit comments