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

[augeas-devel] augeas: master - * src/put.c: put/create for recursive lenses



Gitweb:        http://git.fedorahosted.org/git/augeas.git?p=augeas.git;a=commitdiff;h=34cfe80a33334141ac2a19d0239603794b662272
Commit:        34cfe80a33334141ac2a19d0239603794b662272
Parent:        a391169ac94d1111d2f9c44fbab3a968581ca912
Author:        David Lutterkort <lutter redhat com>
AuthorDate:    Wed Nov 11 16:09:14 2009 -0800
Committer:     David Lutterkort <lutter redhat com>
CommitterDate: Thu Jan 14 14:48:38 2010 -0800

* src/put.c: put/create for recursive lenses

---
 src/put.c |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/src/put.c b/src/put.c
index 2b4e60f..16026cd 100644
--- a/src/put.c
+++ b/src/put.c
@@ -409,6 +409,8 @@ static int skel_instance_of(struct lens *lens, struct skel *skel) {
                 return 0;
         }
         return 1;
+    case L_REC:
+        return skel_instance_of(lens->body, skel);
     default:
         assert_error_at(__FILE__, __LINE__, lens->info,
                         "illegal lens tag %d", lens->tag);
@@ -554,6 +556,10 @@ static void put_store(struct lens *lens, struct state *state) {
     }
 }
 
+static void put_rec(struct lens *lens, struct state *state) {
+    put_lens(lens->body, state);
+}
+
 static void put_lens(struct lens *lens, struct state *state) {
     if (state->error != NULL)
         return;
@@ -592,6 +598,9 @@ static void put_lens(struct lens *lens, struct state *state) {
     case L_MAYBE:
         put_quant_maybe(lens, state);
         break;
+    case L_REC:
+        put_rec(lens, state);
+        break;
     default:
         assert(0);
         break;
@@ -667,6 +676,10 @@ static void create_quant_maybe(struct lens *lens, struct state *state) {
     }
 }
 
+static void create_rec(struct lens *lens, struct state *state) {
+    create_lens(lens->body, state);
+}
+
 static void create_lens(struct lens *lens, struct state *state) {
     if (state->error != NULL)
         return;
@@ -704,6 +717,9 @@ static void create_lens(struct lens *lens, struct state *state) {
     case L_MAYBE:
         create_quant_maybe(lens, state);
         break;
+    case L_REC:
+        create_rec(lens, state);
+        break;
     default:
         assert(0);
         break;



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