[Nut-upsdev] [RFC apcsmart V3 08/18] drivers/dstate: add dstate_getflags()
Michal Soltys
soltys at ziu.info
Sat Mar 5 10:38:25 UTC 2011
In cases such as immutable flag over readable value, we have
to be able to acquire this info at driver level (to e.g. avoid
polling, if user defined a variable with 'override' prefix).
Signed-off-by: Michal Soltys <soltys at ziu.info>
---
drivers/dstate.c | 5 +++++
drivers/dstate.h | 1 +
2 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/drivers/dstate.c b/drivers/dstate.c
index a3009c5..b486687 100644
--- a/drivers/dstate.c
+++ b/drivers/dstate.c
@@ -696,6 +696,11 @@ const char *dstate_getinfo(const char *var)
return state_getinfo(dtree_root, var);
}
+int dstate_getflags(const char *var)
+{
+ return state_getflags(dtree_root, var);
+}
+
void dstate_addcmd(const char *cmdname)
{
int ret;
diff --git a/drivers/dstate.h b/drivers/dstate.h
index 7ffe899..19f50a1 100644
--- a/drivers/dstate.h
+++ b/drivers/dstate.h
@@ -48,6 +48,7 @@ int dstate_addenum(const char *var, const char *fmt, ...)
void dstate_setflags(const char *var, int flags);
void dstate_setaux(const char *var, int aux);
const char *dstate_getinfo(const char *var);
+int dstate_getflags(const char *var);
void dstate_addcmd(const char *cmdname);
int dstate_delinfo(const char *var);
int dstate_delenum(const char *var, const char *val);
--
1.7.2.1
More information about the Nut-upsdev
mailing list