aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2016-02-04 14:48:42 +0100
committerEelco Dolstra <eelco.dolstra@logicblox.com>2016-02-04 14:48:42 +0100
commitfa7cd5369b7d9f947b0b26ca681e94b81068a3ef (patch)
treec31cd0f58e516929a21000de609958b73b7059c7 /src
parentc10c61449f954702ae6d8092120321744acd82ff (diff)
StoreAPI -> Store
Calling a class an API is a bit redundant...
Diffstat (limited to 'src')
-rw-r--r--src/libexpr/common-opts.hh2
-rw-r--r--src/libexpr/eval.cc2
-rw-r--r--src/libexpr/eval.hh6
-rw-r--r--src/libmain/shared.cc4
-rw-r--r--src/libmain/shared.hh6
-rw-r--r--src/libstore/derivations.cc4
-rw-r--r--src/libstore/derivations.hh6
-rw-r--r--src/libstore/download.cc2
-rw-r--r--src/libstore/download.hh4
-rw-r--r--src/libstore/gc.cc2
-rw-r--r--src/libstore/local-store.hh2
-rw-r--r--src/libstore/misc.cc8
-rw-r--r--src/libstore/profiles.cc2
-rw-r--r--src/libstore/profiles.hh4
-rw-r--r--src/libstore/remote-store.hh2
-rw-r--r--src/libstore/store-api.cc10
-rw-r--r--src/libstore/store-api.hh8
-rw-r--r--src/nix-instantiate/nix-instantiate.cc2
-rw-r--r--src/nix-store/dotgraph.cc2
-rw-r--r--src/nix-store/dotgraph.hh4
-rw-r--r--src/nix-store/nix-store.cc8
-rw-r--r--src/nix-store/xmlgraph.cc2
-rw-r--r--src/nix-store/xmlgraph.hh4
23 files changed, 48 insertions, 48 deletions
diff --git a/src/libexpr/common-opts.hh b/src/libexpr/common-opts.hh
index 0500b0a83..cb2732d6f 100644
--- a/src/libexpr/common-opts.hh
+++ b/src/libexpr/common-opts.hh
@@ -4,7 +4,7 @@
namespace nix {
-class StoreAPI;
+class Store;
/* Some common option parsing between nix-env and nix-instantiate. */
bool parseAutoArgs(Strings::iterator & i,
diff --git a/src/libexpr/eval.cc b/src/libexpr/eval.cc
index 702b12ee4..de9454422 100644
--- a/src/libexpr/eval.cc
+++ b/src/libexpr/eval.cc
@@ -244,7 +244,7 @@ static Strings parseNixPath(const string & in)
}
-EvalState::EvalState(const Strings & _searchPath, ref<StoreAPI> store)
+EvalState::EvalState(const Strings & _searchPath, ref<Store> store)
: sWith(symbols.create("<with>"))
, sOutPath(symbols.create("outPath"))
, sDrvPath(symbols.create("drvPath"))
diff --git a/src/libexpr/eval.hh b/src/libexpr/eval.hh
index a4286ce1f..cf2d57864 100644
--- a/src/libexpr/eval.hh
+++ b/src/libexpr/eval.hh
@@ -16,7 +16,7 @@
namespace nix {
-class StoreAPI;
+class Store;
class EvalState;
@@ -83,7 +83,7 @@ public:
Value vEmptySet;
- const ref<StoreAPI> store;
+ const ref<Store> store;
private:
SrcToStore srcToStore;
@@ -100,7 +100,7 @@ private:
public:
- EvalState(const Strings & _searchPath, ref<StoreAPI> store);
+ EvalState(const Strings & _searchPath, ref<Store> store);
~EvalState();
void addToSearchPath(const string & s, bool warn = false);
diff --git a/src/libmain/shared.cc b/src/libmain/shared.cc
index 656d04cab..88ed52497 100644
--- a/src/libmain/shared.cc
+++ b/src/libmain/shared.cc
@@ -46,7 +46,7 @@ void printGCWarning()
}
-void printMissing(ref<StoreAPI> store, const PathSet & paths)
+void printMissing(ref<Store> store, const PathSet & paths)
{
unsigned long long downloadSize, narSize;
PathSet willBuild, willSubstitute, unknown;
@@ -55,7 +55,7 @@ void printMissing(ref<StoreAPI> store, const PathSet & paths)
}
-void printMissing(ref<StoreAPI> store, const PathSet & willBuild,
+void printMissing(ref<Store> store, const PathSet & willBuild,
const PathSet & willSubstitute, const PathSet & unknown,
unsigned long long downloadSize, unsigned long long narSize)
{
diff --git a/src/libmain/shared.hh b/src/libmain/shared.hh
index 6f826d8f6..e4b984f06 100644
--- a/src/libmain/shared.hh
+++ b/src/libmain/shared.hh
@@ -31,11 +31,11 @@ void printVersion(const string & programName);
/* Ugh. No better place to put this. */
void printGCWarning();
-class StoreAPI;
+class Store;
-void printMissing(ref<StoreAPI> store, const PathSet & paths);
+void printMissing(ref<Store> store, const PathSet & paths);
-void printMissing(ref<StoreAPI> store, const PathSet & willBuild,
+void printMissing(ref<Store> store, const PathSet & willBuild,
const PathSet & willSubstitute, const PathSet & unknown,
unsigned long long downloadSize, unsigned long long narSize);
diff --git a/src/libstore/derivations.cc b/src/libstore/derivations.cc
index da1747da0..d9b009d40 100644
--- a/src/libstore/derivations.cc
+++ b/src/libstore/derivations.cc
@@ -68,7 +68,7 @@ bool BasicDerivation::canBuildLocally() const
}
-Path writeDerivation(ref<StoreAPI> store,
+Path writeDerivation(ref<Store> store,
const Derivation & drv, const string & name, bool repair)
{
PathSet references;
@@ -274,7 +274,7 @@ DrvHashes drvHashes;
paths have been replaced by the result of a recursive call to this
function, and that for fixed-output derivations we return a hash of
its output path. */
-Hash hashDerivationModulo(StoreAPI & store, Derivation drv)
+Hash hashDerivationModulo(Store & store, Derivation drv)
{
/* Return a fixed hash for fixed-output derivations. */
if (drv.isFixedOutput()) {
diff --git a/src/libstore/derivations.hh b/src/libstore/derivations.hh
index 4dda10b45..6f98869b0 100644
--- a/src/libstore/derivations.hh
+++ b/src/libstore/derivations.hh
@@ -80,11 +80,11 @@ struct Derivation : BasicDerivation
};
-class StoreAPI;
+class Store;
/* Write a derivation to the Nix store, and return its path. */
-Path writeDerivation(ref<StoreAPI> store,
+Path writeDerivation(ref<Store> store,
const Derivation & drv, const string & name, bool repair = false);
/* Read a derivation from a file. */
@@ -94,7 +94,7 @@ Derivation readDerivation(const Path & drvPath);
derivations. */
bool isDerivation(const string & fileName);
-Hash hashDerivationModulo(StoreAPI & store, Derivation drv);
+Hash hashDerivationModulo(Store & store, Derivation drv);
/* Memoisation of hashDerivationModulo(). */
typedef std::map<Path, Hash> DrvHashes;
diff --git a/src/libstore/download.cc b/src/libstore/download.cc
index 5e50c1480..01ce1ea2f 100644
--- a/src/libstore/download.cc
+++ b/src/libstore/download.cc
@@ -188,7 +188,7 @@ DownloadResult downloadFile(string url, const DownloadOptions & options)
}
-Path downloadFileCached(ref<StoreAPI> store, const string & url, bool unpack)
+Path downloadFileCached(ref<Store> store, const string & url, bool unpack)
{
Path cacheDir = getEnv("XDG_CACHE_HOME", getEnv("HOME", "") + "/.cache") + "/nix/tarballs";
createDirs(cacheDir);
diff --git a/src/libstore/download.hh b/src/libstore/download.hh
index a727936d1..7aec8de73 100644
--- a/src/libstore/download.hh
+++ b/src/libstore/download.hh
@@ -19,11 +19,11 @@ struct DownloadResult
string data, etag;
};
-class StoreAPI;
+class Store;
DownloadResult downloadFile(string url, const DownloadOptions & options);
-Path downloadFileCached(ref<StoreAPI> store, const string & url, bool unpack);
+Path downloadFileCached(ref<Store> store, const string & url, bool unpack);
MakeError(DownloadError, Error)
diff --git a/src/libstore/gc.cc b/src/libstore/gc.cc
index 9c158c3ee..48fb2167a 100644
--- a/src/libstore/gc.cc
+++ b/src/libstore/gc.cc
@@ -83,7 +83,7 @@ void LocalStore::addIndirectRoot(const Path & path)
}
-Path addPermRoot(ref<StoreAPI> store, const Path & _storePath,
+Path addPermRoot(ref<Store> store, const Path & _storePath,
const Path & _gcRoot, bool indirect, bool allowOutsideRootsDir)
{
Path storePath(canonPath(_storePath));
diff --git a/src/libstore/local-store.hh b/src/libstore/local-store.hh
index 3ef042b61..b6d39d345 100644
--- a/src/libstore/local-store.hh
+++ b/src/libstore/local-store.hh
@@ -80,7 +80,7 @@ struct SQLiteStmt
};
-class LocalStore : public StoreAPI
+class LocalStore : public Store
{
private:
typedef std::map<Path, RunningSubstituter> RunningSubstituters;
diff --git a/src/libstore/misc.cc b/src/libstore/misc.cc
index 032dfe658..12472f017 100644
--- a/src/libstore/misc.cc
+++ b/src/libstore/misc.cc
@@ -7,7 +7,7 @@
namespace nix {
-Derivation StoreAPI::derivationFromPath(const Path & drvPath)
+Derivation Store::derivationFromPath(const Path & drvPath)
{
assertStorePath(drvPath);
ensurePath(drvPath);
@@ -15,7 +15,7 @@ Derivation StoreAPI::derivationFromPath(const Path & drvPath)
}
-void StoreAPI::computeFSClosure(const Path & path,
+void Store::computeFSClosure(const Path & path,
PathSet & paths, bool flipDirection, bool includeOutputs, bool includeDerivers)
{
if (paths.find(path) != paths.end()) return;
@@ -59,7 +59,7 @@ void StoreAPI::computeFSClosure(const Path & path,
}
-void StoreAPI::queryMissing(const PathSet & targets,
+void Store::queryMissing(const PathSet & targets,
PathSet & willBuild, PathSet & willSubstitute, PathSet & unknown,
unsigned long long & downloadSize, unsigned long long & narSize)
{
@@ -173,7 +173,7 @@ void StoreAPI::queryMissing(const PathSet & targets,
}
-Paths StoreAPI::topoSortPaths(const PathSet & paths)
+Paths Store::topoSortPaths(const PathSet & paths)
{
Paths sorted;
PathSet visited, parents;
diff --git a/src/libstore/profiles.cc b/src/libstore/profiles.cc
index 4903b12f6..8ab23cd31 100644
--- a/src/libstore/profiles.cc
+++ b/src/libstore/profiles.cc
@@ -74,7 +74,7 @@ static void makeName(const Path & profile, unsigned int num,
}
-Path createGeneration(ref<StoreAPI> store, Path profile, Path outPath)
+Path createGeneration(ref<Store> store, Path profile, Path outPath)
{
/* The new generation number should be higher than old the
previous ones. */
diff --git a/src/libstore/profiles.hh b/src/libstore/profiles.hh
index 37d8ec999..d758d94b6 100644
--- a/src/libstore/profiles.hh
+++ b/src/libstore/profiles.hh
@@ -31,9 +31,9 @@ typedef list<Generation> Generations;
profile, sorted by generation number. */
Generations findGenerations(Path profile, int & curGen);
-class StoreAPI;
+class Store;
-Path createGeneration(ref<StoreAPI> store, Path profile, Path outPath);
+Path createGeneration(ref<Store> store, Path profile, Path outPath);
void deleteGeneration(const Path & profile, unsigned int gen);
diff --git a/src/libstore/remote-store.hh b/src/libstore/remote-store.hh
index b0787c072..f15182285 100644
--- a/src/libstore/remote-store.hh
+++ b/src/libstore/remote-store.hh
@@ -14,7 +14,7 @@ struct FdSink;
struct FdSource;
-class RemoteStore : public StoreAPI
+class RemoteStore : public Store
{
public:
diff --git a/src/libstore/store-api.cc b/src/libstore/store-api.cc
index 98399cc48..e205fd0e8 100644
--- a/src/libstore/store-api.cc
+++ b/src/libstore/store-api.cc
@@ -220,7 +220,7 @@ Path computeStorePathForText(const string & name, const string & s,
/* Return a string accepted by decodeValidPathInfo() that
registers the specified paths as valid. Note: it's the
responsibility of the caller to provide a closure. */
-string StoreAPI::makeValidityRegistration(const PathSet & paths,
+string Store::makeValidityRegistration(const PathSet & paths,
bool showDerivers, bool showHash)
{
string s = "";
@@ -284,7 +284,7 @@ string showPaths(const PathSet & paths)
}
-void StoreAPI::exportPaths(const Paths & paths,
+void Store::exportPaths(const Paths & paths,
bool sign, Sink & sink)
{
for (auto & i : paths) {
@@ -306,7 +306,7 @@ void StoreAPI::exportPaths(const Paths & paths,
namespace nix {
-ref<StoreAPI> openStore(bool reserveSpace)
+ref<Store> openStore(bool reserveSpace)
{
enum { mDaemon, mLocal, mAuto } mode;
@@ -322,8 +322,8 @@ ref<StoreAPI> openStore(bool reserveSpace)
}
return mode == mDaemon
- ? make_ref<StoreAPI, RemoteStore>()
- : make_ref<StoreAPI, LocalStore>(reserveSpace);
+ ? make_ref<Store, RemoteStore>()
+ : make_ref<Store, LocalStore>(reserveSpace);
}
diff --git a/src/libstore/store-api.hh b/src/libstore/store-api.hh
index ce085ff55..1e4306439 100644
--- a/src/libstore/store-api.hh
+++ b/src/libstore/store-api.hh
@@ -135,11 +135,11 @@ struct BasicDerivation;
struct Derivation;
-class StoreAPI
+class Store
{
public:
- virtual ~StoreAPI() { }
+ virtual ~Store() { }
/* Check whether a path is valid. */
virtual bool isValidPath(const Path & path) = 0;
@@ -407,13 +407,13 @@ void removeTempRoots();
/* Register a permanent GC root. */
-Path addPermRoot(ref<StoreAPI> store, const Path & storePath,
+Path addPermRoot(ref<Store> store, const Path & storePath,
const Path & gcRoot, bool indirect, bool allowOutsideRootsDir = false);
/* Factory method: open the Nix database, either through the local or
remote implementation. */
-ref<StoreAPI> openStore(bool reserveSpace = true);
+ref<Store> openStore(bool reserveSpace = true);
/* Display a set of paths in human-readable form (i.e., between quotes
diff --git a/src/nix-instantiate/nix-instantiate.cc b/src/nix-instantiate/nix-instantiate.cc
index a20c5ce63..1604c0817 100644
--- a/src/nix-instantiate/nix-instantiate.cc
+++ b/src/nix-instantiate/nix-instantiate.cc
@@ -32,7 +32,7 @@ static bool indirectRoot = false;
enum OutputKind { okPlain, okXML, okJSON };
-void processExpr(ref<StoreAPI> store, EvalState & state, const Strings & attrPaths,
+void processExpr(ref<Store> store, EvalState & state, const Strings & attrPaths,
bool parseOnly, bool strict, Bindings & autoArgs,
bool evalOnly, OutputKind output, bool location, Expr * e)
{
diff --git a/src/nix-store/dotgraph.cc b/src/nix-store/dotgraph.cc
index 326c668e0..83472b0a3 100644
--- a/src/nix-store/dotgraph.cc
+++ b/src/nix-store/dotgraph.cc
@@ -94,7 +94,7 @@ void printClosure(const Path & nePath, const StoreExpr & fs)
#endif
-void printDotGraph(StoreAPI & store, const PathSet & roots)
+void printDotGraph(Store & store, const PathSet & roots)
{
PathSet workList(roots);
PathSet doneSet;
diff --git a/src/nix-store/dotgraph.hh b/src/nix-store/dotgraph.hh
index d3b37642c..d03c7d5b7 100644
--- a/src/nix-store/dotgraph.hh
+++ b/src/nix-store/dotgraph.hh
@@ -4,8 +4,8 @@
namespace nix {
-class StoreAPI;
+class Store;
-void printDotGraph(StoreAPI & store, const PathSet & roots);
+void printDotGraph(Store & store, const PathSet & roots);
}
diff --git a/src/nix-store/nix-store.cc b/src/nix-store/nix-store.cc
index d5242492e..b384ad2ab 100644
--- a/src/nix-store/nix-store.cc
+++ b/src/nix-store/nix-store.cc
@@ -37,7 +37,7 @@ static Path gcRoot;
static int rootNr = 0;
static bool indirectRoot = false;
static bool noOutput = false;
-static std::shared_ptr<StoreAPI> store;
+static std::shared_ptr<Store> store;
LocalStore & ensureLocalStore()
@@ -84,7 +84,7 @@ static PathSet realisePath(Path path, bool build = true)
Path rootName = gcRoot;
if (rootNr > 1) rootName += "-" + std::to_string(rootNr);
if (i->first != "out") rootName += "-" + i->first;
- outPath = addPermRoot(ref<StoreAPI>(store), outPath, rootName, indirectRoot);
+ outPath = addPermRoot(ref<Store>(store), outPath, rootName, indirectRoot);
}
outputs.insert(outPath);
}
@@ -100,7 +100,7 @@ static PathSet realisePath(Path path, bool build = true)
Path rootName = gcRoot;
rootNr++;
if (rootNr > 1) rootName += "-" + std::to_string(rootNr);
- path = addPermRoot(ref<StoreAPI>(store), path, rootName, indirectRoot);
+ path = addPermRoot(ref<Store>(store), path, rootName, indirectRoot);
}
return singleton<PathSet>(path);
}
@@ -142,7 +142,7 @@ static void opRealise(Strings opFlags, Strings opArgs)
}
if (settings.get("print-missing", true))
- printMissing(ref<StoreAPI>(store), willBuild, willSubstitute, unknown, downloadSize, narSize);
+ printMissing(ref<Store>(store), willBuild, willSubstitute, unknown, downloadSize, narSize);
if (dryRun) return;
diff --git a/src/nix-store/xmlgraph.cc b/src/nix-store/xmlgraph.cc
index f88266bbb..ccb218408 100644
--- a/src/nix-store/xmlgraph.cc
+++ b/src/nix-store/xmlgraph.cc
@@ -33,7 +33,7 @@ static string makeNode(const string & id)
}
-void printXmlGraph(StoreAPI & store, const PathSet & roots)
+void printXmlGraph(Store & store, const PathSet & roots)
{
PathSet workList(roots);
PathSet doneSet;
diff --git a/src/nix-store/xmlgraph.hh b/src/nix-store/xmlgraph.hh
index 6d6d12a06..6454d3a28 100644
--- a/src/nix-store/xmlgraph.hh
+++ b/src/nix-store/xmlgraph.hh
@@ -4,8 +4,8 @@
namespace nix {
-class StoreAPI;
+class Store;
-void printXmlGraph(StoreAPI & store, const PathSet & roots);
+void printXmlGraph(Store & store, const PathSet & roots);
}