init: Add support "&&" operator in property triggers
"&&" operator can now be used to test the validity
of two of more properties.
For example:
on property:test.a=1 && property:test.b=1
setprop test.c 1
The above stub sets the test.c to 1 only when
both test.a=1 and test.b=1
(cherry-pick of 162f7d797c67019a7a3f08c3b0f0ffc91d548ddc.)
Change-Id: I72c19f7aa92231372a416193618ee6c7fd368141
Signed-off-by: Badhri Jagan Sridharan <badhri@google.com>
diff --git a/init/init.h b/init/init.h
index a7615a3..e03bd53 100644
--- a/init/init.h
+++ b/init/init.h
@@ -37,6 +37,11 @@
char *args[1];
};
+struct trigger {
+ struct listnode nlist;
+ const char *name;
+};
+
struct action {
/* node in list of all actions */
struct listnode alist;
@@ -46,12 +51,15 @@
struct listnode tlist;
unsigned hash;
- const char *name;
+ /* list of actions which triggers the commands*/
+ struct listnode triggers;
struct listnode commands;
struct command *current;
};
+void build_triggers_string(char *name_str, int length, struct action *cur_action);
+
struct socketinfo {
struct socketinfo *next;
const char *name;