forked from NixOS/nix
-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathnix_api_expr_internal.h
More file actions
74 lines (61 loc) · 1.46 KB
/
nix_api_expr_internal.h
File metadata and controls
74 lines (61 loc) · 1.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#ifndef NIX_API_EXPR_INTERNAL_H
#define NIX_API_EXPR_INTERNAL_H
#include "nix/fetchers/fetch-settings.hh"
#include "nix/expr/eval.hh"
#include "nix/expr/eval-settings.hh"
#include "nix/expr/attr-set.hh"
#include "nix_api_value.h"
#include "nix/expr/search-path.hh"
extern "C" {
struct nix_eval_state_builder
{
nix::ref<nix::Store> store;
nix::EvalSettings * settings;
nix::fetchers::Settings * fetchSettings;
nix::LookupPath lookupPath;
// TODO: make an EvalSettings setting own this instead?
bool readOnlyMode;
};
struct EvalState
{
nix::fetchers::Settings * fetchSettings;
nix::EvalSettings * settings;
nix::EvalState state;
};
struct BindingsBuilder
{
nix::BindingsBuilder builder;
};
struct ListBuilder
{
nix::ListBuilder builder;
};
struct nix_value
{
nix::Value * value;
/**
* As we move to a managed heap, we need EvalMemory in more places. Ideally, we would take in EvalState or
* EvalMemory as an argument when we need it, but we don't want to make changes to the stable C api, so we stuff it
* into the nix_value that will get passed in to the relevant functions.
*/
nix::EvalMemory * mem;
};
struct nix_string_return
{
std::string str;
};
struct nix_printer
{
std::ostream & s;
};
struct nix_string_context
{
nix::NixStringContext & ctx;
};
struct nix_realised_string
{
std::string str;
std::vector<StorePath> storePaths;
};
} // extern "C"
#endif // NIX_API_EXPR_INTERNAL_H