forked from lix-project/lix
eldritch horrors
992d99592f
(cherry picked from commit 2a8fe9a93837733e9dd9ed5c078734a35b203e14)
Change-Id: I71dadfef6b24d9272b206e9e2c408040559d8a1c
41 lines
773 B
C++
41 lines
773 B
C++
#pragma once
|
|
///@file
|
|
|
|
#include "eval.hh"
|
|
|
|
#if HAVE_BOEHMGC
|
|
#define GC_INCLUDE_NEW
|
|
#include <gc/gc_cpp.h>
|
|
#endif
|
|
|
|
namespace nix {
|
|
|
|
struct AbstractNixRepl
|
|
{
|
|
ref<EvalState> state;
|
|
Bindings * autoArgs;
|
|
|
|
AbstractNixRepl(ref<EvalState> state)
|
|
: state(state)
|
|
{ }
|
|
|
|
virtual ~AbstractNixRepl()
|
|
{ }
|
|
|
|
typedef std::vector<std::pair<Value*,std::string>> AnnotatedValues;
|
|
|
|
static std::unique_ptr<AbstractNixRepl> create(
|
|
const SearchPath & searchPath, nix::ref<Store> store, ref<EvalState> state,
|
|
std::function<AnnotatedValues()> getValues);
|
|
|
|
static ReplExitStatus runSimple(
|
|
ref<EvalState> evalState,
|
|
const ValMap & extraEnv);
|
|
|
|
virtual void initEnv() = 0;
|
|
|
|
virtual ReplExitStatus mainLoop() = 0;
|
|
};
|
|
|
|
}
|