aboutsummaryrefslogtreecommitdiffstats
path: root/expr.c
diff options
context:
space:
mode:
authorreinelt <>2004-01-09 04:16:06 +0000
committerreinelt <>2004-01-09 04:16:06 +0000
commitc8d1a94e34b59f94c8bf7af1a5dde282515a2e19 (patch)
tree97337d07d0693302ca3031d256bff023a4d18f82 /expr.c
parent28ae14208cef01ae0ca6293b88968ec31bec855e (diff)
downloadlcd4linux-c8d1a94e34b59f94c8bf7af1a5dde282515a2e19.tar.gz
[lcd4linux @ 2004-01-09 04:16:06 by reinelt]
added 'section' argument to cfg_get(), but NULLed it on all calls by now.
Diffstat (limited to 'expr.c')
-rw-r--r--expr.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/expr.c b/expr.c
index 87d370b..2464a99 100644
--- a/expr.c
+++ b/expr.c
@@ -1,4 +1,4 @@
-/* $Id: expr.c,v 1.1 2004/01/05 11:57:38 reinelt Exp $
+/* $Id: expr.c,v 1.2 2004/01/09 04:16:06 reinelt Exp $
*
* expr ('y*') functions
* This is only a workaround to make the Evaluator usable until
@@ -24,6 +24,9 @@
*
*
* $Log: expr.c,v $
+ * Revision 1.2 2004/01/09 04:16:06 reinelt
+ * added 'section' argument to cfg_get(), but NULLed it on all calls by now.
+ *
* Revision 1.1 2004/01/05 11:57:38 reinelt
* added %y tokens to make the Evaluator useable
*
@@ -56,7 +59,7 @@ int Expr(int index, char result[EXPR_TXT_LEN], double *val)
return -1;
sprintf(yn, "y%d", index);
- expression = cfg_get(yn,NULL);
+ expression = cfg_get(NULL, yn, NULL);
if (!expression || !*expression) {
error("Empty expression for 'y%d'", index);
@@ -73,9 +76,9 @@ int Expr(int index, char result[EXPR_TXT_LEN], double *val)
double max, min;
*val = atof(result);
sprintf(yn, "Max_y%d", index);
- max = atof(cfg_get(yn,"100"));
+ max = atof(cfg_get(NULL, yn, "100"));
sprintf(yn, "Min_y%d", index);
- min = atof(cfg_get(yn,"0"));
+ min = atof(cfg_get(NULL, yn, "0"));
if (max != min)
*val = (*val - min)/(max - min);
}