[augeas-devel] augeas: master - Calls to __aug_load_module need to go through api_entry/api_exit

David Lutterkort lutter at fedoraproject.org
Tue Nov 10 17:24:31 UTC 2009


Gitweb:        http://git.fedorahosted.org/git/augeas.git?p=augeas.git;a=commitdiff;h=82c1ce78e549144d24c57edbb49618d594e0ec55
Commit:        82c1ce78e549144d24c57edbb49618d594e0ec55
Parent:        07b6a88064776e75f9c3296046cc05f9e4e1b405
Author:        David Lutterkort <lutter at redhat.com>
AuthorDate:    Thu Oct 22 16:35:56 2009 +0200
Committer:     David Lutterkort <lutter at redhat.com>
CommitterDate: Tue Nov 10 09:21:28 2009 -0800

Calls to __aug_load_module need to go through api_entry/api_exit

---
 src/augeas.c   |    7 +++++++
 src/internal.h |    3 +++
 src/syntax.c   |    4 ++--
 src/syntax.h   |    3 +--
 4 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/src/augeas.c b/src/augeas.c
index f29dbb7..59d3743 100644
--- a/src/augeas.c
+++ b/src/augeas.c
@@ -1136,6 +1136,13 @@ void aug_close(struct augeas *aug) {
     free(aug);
 }
 
+int __aug_load_module_file(struct augeas *aug, const char *filename) {
+    api_entry(aug);
+    int r = load_module_file(aug, filename);
+    api_exit(aug);
+    return r;
+}
+
 int tree_equal(const struct tree *t1, const struct tree *t2) {
     while (t1 != NULL && t2 != NULL) {
         if (!streqv(t1->label, t2->label))
diff --git a/src/internal.h b/src/internal.h
index fa286bb..55aa551 100644
--- a/src/internal.h
+++ b/src/internal.h
@@ -302,6 +302,9 @@ static inline struct error *err_of_aug(const struct augeas *aug) {
     return ((struct augeas *) aug)->error;
 }
 
+/* Used by augparse for loading tests */
+int __aug_load_module_file(struct augeas *aug, const char *filename);
+
 /* Struct: tree
  * An entry in the global config tree. The data structure allows associating
  * values with interior nodes, but the API currently marks that as an error.
diff --git a/src/syntax.c b/src/syntax.c
index 63c88ea..edaa873 100644
--- a/src/syntax.c
+++ b/src/syntax.c
@@ -1913,7 +1913,7 @@ static char *module_filename(struct augeas *aug, const char *modname) {
     return filename;
 }
 
-int __aug_load_module_file(struct augeas *aug, const char *filename) {
+int load_module_file(struct augeas *aug, const char *filename) {
     struct term *term = NULL;
     int result = -1;
 
@@ -1945,7 +1945,7 @@ static int load_module(struct augeas *aug, const char *name) {
     if ((filename = module_filename(aug, name)) == NULL)
         return -1;
 
-    if (__aug_load_module_file(aug, filename) == -1)
+    if (load_module_file(aug, filename) == -1)
         goto error;
 
     free(filename);
diff --git a/src/syntax.h b/src/syntax.h
index e0698bb..cf5024a 100644
--- a/src/syntax.h
+++ b/src/syntax.h
@@ -264,8 +264,7 @@ int define_native_intl(const char *fname, int line,
 
 struct module *builtin_init(struct error *);
 
-/* Used by augparse for some testing */
-int __aug_load_module_file(struct augeas *aug, const char *filename);
+int load_module_file(struct augeas *aug, const char *filename);
 
 int interpreter_init(struct augeas *aug);
 




More information about the augeas-devel mailing list