From 75068e7d753cf6cbe45a4bf294000dca9bd41d8b Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Mon, 4 Sep 2006 21:06:23 +0000 Subject: * Use a proper namespace. * Optimise header file usage a bit. * Compile the parser as C++. --- src/nix-store/dotgraph.cc | 14 ++++++++++++-- src/nix-store/dotgraph.hh | 6 +++++- src/nix-store/main.cc | 10 +++++++++- 3 files changed, 26 insertions(+), 4 deletions(-) (limited to 'src/nix-store') diff --git a/src/nix-store/dotgraph.cc b/src/nix-store/dotgraph.cc index 053358e3ad85..4b068514e4e5 100644 --- a/src/nix-store/dotgraph.cc +++ b/src/nix-store/dotgraph.cc @@ -1,7 +1,14 @@ +#include "dotgraph.hh" +#include "util.hh" +#include "store.hh" +#include "db.hh" + #include -#include "dotgraph.hh" -#include "build.hh" + +using std::cout; + +namespace nix { static string dotQuote(const string & s) @@ -151,3 +158,6 @@ void printDotGraph(const PathSet & roots) cout << "}\n"; } + + +} diff --git a/src/nix-store/dotgraph.hh b/src/nix-store/dotgraph.hh index 9effa5a884bd..2318e2fde48d 100644 --- a/src/nix-store/dotgraph.hh +++ b/src/nix-store/dotgraph.hh @@ -1,8 +1,12 @@ #ifndef __DOTGRAPH_H #define __DOTGRAPH_H -#include "util.hh" +#include "types.hh" + +namespace nix { void printDotGraph(const PathSet & roots); +} + #endif /* !__DOTGRAPH_H */ diff --git a/src/nix-store/main.cc b/src/nix-store/main.cc index fc458a246c4a..616cb8310631 100644 --- a/src/nix-store/main.cc +++ b/src/nix-store/main.cc @@ -8,9 +8,17 @@ #include "archive.hh" #include "shared.hh" #include "dotgraph.hh" +#include "store.hh" +#include "db.hh" +#include "util.hh" #include "help.txt.hh" +using namespace nix; +using std::cin; +using std::cout; + + typedef void (* Operation) (Strings opFlags, Strings opArgs); @@ -528,7 +536,7 @@ static void opGC(Strings opFlags, Strings opArgs) if (action != gcDeleteDead) { for (PathSet::iterator i = result.begin(); i != result.end(); ++i) - cout << *i << endl; + cout << *i << std::endl; } } -- cgit 1.4.1