aboutsummaryrefslogtreecommitdiffstats
path: root/evaluator.c
diff options
context:
space:
mode:
authorreinelt <reinelt@3ae390bd-cb1e-0410-b409-cd5a39f66f1f>2004-01-12 03:51:01 +0000
committerreinelt <reinelt@3ae390bd-cb1e-0410-b409-cd5a39f66f1f>2004-01-12 03:51:01 +0000
commit14bc006adad8578e31e557d7ffb57971284a0846 (patch)
tree1ba1b8f86e9e0487f44f37c657997bc3b0055a43 /evaluator.c
parentbbe7f194ee035c6cafdc5102092b7b422541aeab (diff)
downloadlcd4linux-14bc006adad8578e31e557d7ffb57971284a0846.tar.gz
[lcd4linux @ 2004-01-12 03:51:01 by reinelt]
evaluating the 'Variables' section in the config file git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@307 3ae390bd-cb1e-0410-b409-cd5a39f66f1f
Diffstat (limited to 'evaluator.c')
-rw-r--r--evaluator.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/evaluator.c b/evaluator.c
index 2b84dd6..ce0623d 100644
--- a/evaluator.c
+++ b/evaluator.c
@@ -1,4 +1,4 @@
-/* $Id: evaluator.c,v 1.7 2004/01/07 10:15:41 reinelt Exp $
+/* $Id: evaluator.c,v 1.8 2004/01/12 03:51:01 reinelt Exp $
*
* expression evaluation
*
@@ -10,6 +10,9 @@
* FIXME: GPL or not GPL????
*
* $Log: evaluator.c,v $
+ * Revision 1.8 2004/01/12 03:51:01 reinelt
+ * evaluating the 'Variables' section in the config file
+ *
* Revision 1.7 2004/01/07 10:15:41 reinelt
* small glitch in evaluator fixed
* made config table sorted and access with bsearch(),
@@ -77,6 +80,13 @@
/*
* exported functions:
*
+ * void DelResult (RESULT *result)
+ * sets a result to none
+ * frees a probably allocated memory
+ *
+ * int SetVariable (char *name, RESULT *value)
+ * adds a generic variable to the evaluator
+ *
* int AddNumericVariable(char *name, double value)
* adds a numerical variable to the evaluator
*
@@ -168,7 +178,7 @@ char* ErrMsg[] = {
-static void DelResult (RESULT *result)
+void DelResult (RESULT *result)
{
result->type=0;
result->number=0.0;
@@ -348,7 +358,7 @@ static int GetVariable (char *name, RESULT *value)
}
-static int SetVariable (char *name, RESULT *value)
+int SetVariable (char *name, RESULT *value)
{
VARIABLE *V;
@@ -819,7 +829,7 @@ int Eval (char* expression, RESULT *result)
int i, err;
if ((err=setjmp(jb))) {
- error ("Error: %s in expression <%s>", ErrMsg[err], expression);
+ error ("Evaluator: %s in expression <%s>", ErrMsg[err], expression);
return -1;
}
@@ -830,7 +840,7 @@ int Eval (char* expression, RESULT *result)
// sanity check: two functions with the same name?
for (i=1; i<nFunction; i++) {
if (strcmp(Function[i].name, Function[i-1].name)==0) {
- error ("internal error: Function '%s' defined twice!", Function[i].name);
+ error ("Evaluator: internal error: Function '%s' defined twice!", Function[i].name);
}
}
}