[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[augeas-devel] augeas: master - struct error: add pointer back to struct augeas



Gitweb:        http://git.fedorahosted.org/git/augeas.git?p=augeas.git;a=commitdiff;h=919db52da611be583c0ab9371bbaae721268e4f6
Commit:        919db52da611be583c0ab9371bbaae721268e4f6
Parent:        b9cb63d3850d4cf67ee5419ee7cd39f549161f12
Author:        David Lutterkort <lutter redhat com>
AuthorDate:    Wed Nov 11 12:01:47 2009 -0800
Committer:     David Lutterkort <lutter redhat com>
CommitterDate: Thu Jan 14 14:48:38 2010 -0800

struct error: add pointer back to struct augeas

---
 src/augeas.c  |    2 ++
 src/errcode.h |    5 +++++
 2 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/src/augeas.c b/src/augeas.c
index a363f93..209f606 100644
--- a/src/augeas.c
+++ b/src/augeas.c
@@ -333,6 +333,8 @@ struct augeas *aug_init(const char *root, const char *loadpath,
         goto error;
     if (ALLOC(result->error) < 0)
         goto error;
+    result->error->aug = result;
+
     result->origin = make_tree_origin(tree_root);
     if (result->origin == NULL) {
         free_tree(tree_root);
diff --git a/src/errcode.h b/src/errcode.h
index 54dc330..a61fb51 100644
--- a/src/errcode.h
+++ b/src/errcode.h
@@ -35,6 +35,11 @@ struct error {
     int            minor;
     char          *details;       /* Human readable explanation */
     const char    *minor_details; /* Human readable version of MINOR */
+    /* Bit of a kludge to get at struct augeas, but since struct error
+     * is now available in a lot of places (through struct info), this
+     * gives a convenient way to get at the overall state
+     */
+    const struct augeas *aug;
 };
 
 void report_error(struct error *err, aug_errcode_t errcode,



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]