mirror of
https://github.com/NixOS/nix
synced 2025-06-26 03:21:16 +02:00
The short answer for why we need to do this is so we can consistently do `#include "nix/..."`. Without this change, there are ways to still make that work, but they are hacky, and they have downsides such as making it harder to make sure headers from the wrong Nix library (e..g. `libnixexpr` headers in `libnixutil`) aren't being used. The C API alraedy used `nix_api_*`, so its headers are *not* put in subdirectories accordingly. Progress on #7876 We resisted doing this for a while because it would be annoying to not have the header source file pairs close by / easy to change file path/name from one to the other. But I am ameliorating that with symlinks in the next commit.
64 lines
1 KiB
C++
64 lines
1 KiB
C++
#ifndef NIX_API_EXPR_INTERNAL_H
|
|
#define NIX_API_EXPR_INTERNAL_H
|
|
|
|
#include "nix/fetch-settings.hh"
|
|
#include "nix/eval.hh"
|
|
#include "nix/eval-settings.hh"
|
|
#include "nix/attr-set.hh"
|
|
#include "nix_api_value.h"
|
|
#include "nix/search-path.hh"
|
|
|
|
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;
|
|
};
|
|
|
|
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;
|
|
};
|
|
|
|
#endif // NIX_API_EXPR_INTERNAL_H
|