summaryrefslogtreecommitdiff
path: root/src/cstore/unionfs
diff options
context:
space:
mode:
authorAn-Cheng Huang <ancheng@vyatta.com>2010-07-28 19:08:43 -0700
committerAn-Cheng Huang <ancheng@vyatta.com>2010-07-28 19:08:43 -0700
commita56723cbb6424e1d49289efceeb9c251eed324bb (patch)
tree79f97da29cc8e1aa972ec978703622a61a34ae5b /src/cstore/unionfs
parentde31f1befb8a92cecadd0c716f7313bd578511f9 (diff)
downloadvyatta-cfg-a56723cbb6424e1d49289efceeb9c251eed324bb.tar.gz
vyatta-cfg-a56723cbb6424e1d49289efceeb9c251eed324bb.zip
add cstore-specific header file
Diffstat (limited to 'src/cstore/unionfs')
-rw-r--r--src/cstore/unionfs/cstore-unionfs.cpp19
-rw-r--r--src/cstore/unionfs/cstore-unionfs.hpp13
2 files changed, 15 insertions, 17 deletions
diff --git a/src/cstore/unionfs/cstore-unionfs.cpp b/src/cstore/unionfs/cstore-unionfs.cpp
index 977a597..6e6e5de 100644
--- a/src/cstore/unionfs/cstore-unionfs.cpp
+++ b/src/cstore/unionfs/cstore-unionfs.cpp
@@ -24,12 +24,8 @@
#include <errno.h>
#include <sys/mount.h>
-extern "C" {
-#include "cli_val.h"
-#include "cli_objects.h"
-}
-
-#include "cstore-unionfs.hpp"
+#include <cli_cstore.h>
+#include <cstore/unionfs/cstore-unionfs.hpp>
////// constants
@@ -61,6 +57,9 @@ const string UnionfsCstore::C_MARKER_CHANGED = ".modified";
const string UnionfsCstore::C_MARKER_UNSAVED = ".unsaved";
const string UnionfsCstore::C_COMMITTED_MARKER_FILE = "/tmp/.changes";
const string UnionfsCstore::C_COMMENT_FILE = ".comment";
+const string UnionfsCstore::C_TAG_NAME = "node.tag";
+const string UnionfsCstore::C_VAL_NAME = "node.val";
+const string UnionfsCstore::C_DEF_NAME = "node.def";
////// static
@@ -414,9 +413,9 @@ UnionfsCstore::tmpl_node_exists()
bool
UnionfsCstore::tmpl_parse(vtw_def& def)
{
- push_tmpl_path(DEF_NAME);
+ push_tmpl_path(C_DEF_NAME);
bool ret = (b_fs::exists(tmpl_path) && b_fs::is_regular(tmpl_path)
- && parse_def(&def, tmpl_path.file_string().c_str(), FALSE) == 0);
+ && parse_def(&def, tmpl_path.file_string().c_str(), 0) == 0);
pop_tmpl_path();
return ret;
}
@@ -490,8 +489,8 @@ UnionfsCstore::get_all_child_node_names_impl(vector<string>& cnodes,
* node.val
* def
*/
- if (b_fs::exists(p / VAL_NAME) && b_fs::is_regular(p / VAL_NAME)) {
- cnodes.push_back(VAL_NAME);
+ if (b_fs::exists(p / C_VAL_NAME) && b_fs::is_regular(p / C_VAL_NAME)) {
+ cnodes.push_back(C_VAL_NAME);
}
if (b_fs::exists(p / C_MARKER_DEF_VALUE)
&& b_fs::is_regular(p / C_MARKER_DEF_VALUE)) {
diff --git a/src/cstore/unionfs/cstore-unionfs.hpp b/src/cstore/unionfs/cstore-unionfs.hpp
index 357e307..dd44d9a 100644
--- a/src/cstore/unionfs/cstore-unionfs.hpp
+++ b/src/cstore/unionfs/cstore-unionfs.hpp
@@ -26,13 +26,9 @@
#include <boost/filesystem.hpp>
+#include <cli_cstore.h>
#include <cstore/cstore.hpp>
-extern "C" {
-#include <cli_val.h>
-#include <cli_val_engine.h>
-}
-
namespace b_fs = boost::filesystem;
class UnionfsCstore : public Cstore {
@@ -71,6 +67,9 @@ private:
static const string C_MARKER_UNSAVED;
static const string C_COMMITTED_MARKER_FILE;
static const string C_COMMENT_FILE;
+ static const string C_TAG_NAME;
+ static const string C_VAL_NAME;
+ static const string C_DEF_NAME;
static const size_t MAX_FILE_READ_SIZE = 8192;
@@ -93,7 +92,7 @@ private:
push_path(tmpl_path, new_comp);
};
void push_tmpl_path_tag() {
- push_tmpl_path(TAG_NAME);
+ push_tmpl_path(C_TAG_NAME);
};
string pop_tmpl_path() {
return pop_path(tmpl_path);
@@ -102,7 +101,7 @@ private:
push_path(mutable_cfg_path, new_comp);
};
void push_cfg_path_val() {
- push_cfg_path(VAL_NAME);
+ push_cfg_path(C_VAL_NAME);
};
string pop_cfg_path() {
return pop_path(mutable_cfg_path);