[augeas-devel] [PATCH 07/11] Rename aug_tree_replace to tree_replace

David Lutterkort lutter at redhat.com
Mon Jan 26 05:41:20 UTC 2009


We reserve the aug_ prefix for public functions. There is also no need to
pass struct augeas here, a tree root is enough.
---
 src/augeas.c    |    4 ++--
 src/internal.h  |    2 +-
 src/transform.c |    2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/augeas.c b/src/augeas.c
index 7586ee7..b3ec44b 100644
--- a/src/augeas.c
+++ b/src/augeas.c
@@ -426,11 +426,11 @@ int aug_rm(struct augeas *aug, const char *path) {
     return tree_rm(aug->origin, path);
 }
 
-int aug_tree_replace(struct augeas *aug, const char *path, struct tree *sub) {
+int tree_replace(struct tree *origin, const char *path, struct tree *sub) {
     struct tree *parent;
     int r;
 
-    r = aug_rm(aug, path);
+    r = tree_rm(origin, path);
     if (r == -1)
         goto error;
 
diff --git a/src/internal.h b/src/internal.h
index 57be267..a241e8e 100644
--- a/src/internal.h
+++ b/src/internal.h
@@ -304,7 +304,7 @@ struct tree *make_tree(char *label, char *value,
  */
 struct tree  *make_tree_origin(struct tree *root);
 
-int aug_tree_replace(struct augeas *aug, const char *path, struct tree *sub);
+int tree_replace(struct tree *origin, const char *path, struct tree *sub);
 
 int tree_rm(struct tree *origin, const char *path);
 struct tree *tree_set(struct tree *origin, const char *path, const char *value);
diff --git a/src/transform.c b/src/transform.c
index 67f1d77..1efc589 100644
--- a/src/transform.c
+++ b/src/transform.c
@@ -372,7 +372,7 @@ static int load_file(struct augeas *aug, struct lens *lens, char *filename) {
         goto done;
     }
 
-    aug_tree_replace(aug, path, tree);
+    tree_replace(aug->origin, path, tree);
     tree = NULL;
 
     result = 0;
-- 
1.6.0.6




More information about the augeas-devel mailing list