Nix 2.30.1
Nix, the purely functional package manager: C API (experimental)
 
Loading...
Searching...
No Matches
nix_api_store.h
Go to the documentation of this file.
1#ifndef NIX_API_STORE_H
2#define NIX_API_STORE_H
13
14#include "nix_api_util.h"
15#include <stdbool.h>
16
17#ifdef __cplusplus
18extern "C" {
19#endif
20// cffi start
21
23typedef struct Store Store;
25typedef struct StorePath StorePath;
26
37
44
74Store * nix_store_open(nix_c_context * context, const char * uri, const char *** params);
75
83void nix_store_free(Store * store);
84
94nix_err nix_store_get_uri(nix_c_context * context, Store * store, nix_get_string_callback callback, void * user_data);
95
106nix_store_get_storedir(nix_c_context * context, Store * store, nix_get_string_callback callback, void * user_data);
107
117StorePath * nix_store_parse_path(nix_c_context * context, Store * store, const char * path);
118
126void nix_store_path_name(const StorePath * store_path, nix_get_string_callback callback, void * user_data);
127
135
142
151bool nix_store_is_valid_path(nix_c_context * context, Store * store, StorePath * path);
152
170 nix_c_context * context, Store * store, StorePath * path, nix_get_string_callback callback, void * user_data);
171
172// nix_err nix_store_ensure(Store*, const char*);
173// nix_err nix_store_build_paths(Store*);
189 nix_c_context * context,
190 Store * store,
191 StorePath * path,
192 void * userdata,
193 void (*callback)(void * userdata, const char * outname, const char * out));
194
208nix_store_get_version(nix_c_context * context, Store * store, nix_get_string_callback callback, void * user_data);
209
218nix_err nix_store_copy_closure(nix_c_context * context, Store * srcStore, Store * dstStore, StorePath * path);
219
220// cffi end
221#ifdef __cplusplus
222}
223#endif
227#endif // NIX_API_STORE_H
void(* nix_get_string_callback)(const char *start, unsigned int n, void *user_data)
Called to get the value of a string owned by Nix.
Definition nix_api_util.h:133
nix_err
Type for error codes in the Nix system.
Definition nix_api_util.h:59
void nix_store_free(Store *store)
Deallocate a nix store and free any resources if not also held by other Store instances.
bool nix_store_is_valid_path(nix_c_context *context, Store *store, StorePath *path)
Check if a StorePath is valid (i.e. that corresponding store object and its closure of references exi...
nix_err nix_store_copy_closure(nix_c_context *context, Store *srcStore, Store *dstStore, StorePath *path)
Copy the closure of path from srcStore to dstStore.
nix_err nix_store_get_storedir(nix_c_context *context, Store *store, nix_get_string_callback callback, void *user_data)
get the storeDir of a Nix store, typically "/nix/store"
nix_err nix_libstore_init(nix_c_context *context)
Initializes the Nix store library.
struct Store Store
Reference to a Nix store.
Definition nix_api_store.h:23
nix_err nix_store_real_path(nix_c_context *context, Store *store, StorePath *path, nix_get_string_callback callback, void *user_data)
Get the physical location of a store path.
nix_err nix_libstore_init_no_load_config(nix_c_context *context)
Like nix_libstore_init, but does not load the Nix configuration.
Store * nix_store_open(nix_c_context *context, const char *uri, const char ***params)
Open a nix store.
nix_err nix_store_get_uri(nix_c_context *context, Store *store, nix_get_string_callback callback, void *user_data)
get the URI of a nix store
struct StorePath StorePath
Nix store path.
Definition nix_api_store.h:25
nix_err nix_store_realise(nix_c_context *context, Store *store, StorePath *path, void *userdata, void(*callback)(void *userdata, const char *outname, const char *out))
Realise a Nix store path.
StorePath * nix_store_path_clone(const StorePath *p)
Copy a StorePath.
void nix_store_path_name(const StorePath *store_path, nix_get_string_callback callback, void *user_data)
Get the path name (e.g. "name" in /nix/store/...-name)
void nix_store_path_free(StorePath *p)
Deallocate a StorePath.
StorePath * nix_store_parse_path(nix_c_context *context, Store *store, const char *path)
Parse a Nix store path into a StorePath.
nix_err nix_store_get_version(nix_c_context *context, Store *store, nix_get_string_callback callback, void *user_data)
get the version of a nix store.
Main entry for the libutil C bindings.
This object stores error state.