aboutsummaryrefslogtreecommitdiffstats
path: root/processor.c
diff options
context:
space:
mode:
authorltoetsch <ltoetsch@3ae390bd-cb1e-0410-b409-cd5a39f66f1f>2001-03-07 18:10:21 +0000
committerltoetsch <ltoetsch@3ae390bd-cb1e-0410-b409-cd5a39f66f1f>2001-03-07 18:10:21 +0000
commit21f603cb1ed2fd2ca5e009b50a1f6debc311c1ab (patch)
treed7939a6c6be9993e9a0286db9aa8cdab36333d60 /processor.c
parente8e1dc888de11ad73dbab1ea08d6b995dae83113 (diff)
downloadlcd4linux-21f603cb1ed2fd2ca5e009b50a1f6debc311c1ab.tar.gz
[lcd4linux @ 2001-03-07 18:10:21 by ltoetsch]
added e(x)ec commands git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@100 3ae390bd-cb1e-0410-b409-cd5a39f66f1f
Diffstat (limited to 'processor.c')
-rw-r--r--processor.c28
1 files changed, 24 insertions, 4 deletions
diff --git a/processor.c b/processor.c
index aa320c6..e65b475 100644
--- a/processor.c
+++ b/processor.c
@@ -1,4 +1,4 @@
-/* $Id: processor.c,v 1.15 2001/03/02 10:18:03 ltoetsch Exp $
+/* $Id: processor.c,v 1.16 2001/03/07 18:10:21 ltoetsch Exp $
*
* main data processing
*
@@ -20,6 +20,9 @@
*
*
* $Log: processor.c,v $
+ * Revision 1.16 2001/03/07 18:10:21 ltoetsch
+ * added e(x)ec commands
+ *
* Revision 1.15 2001/03/02 10:18:03 ltoetsch
* added /proc/apm battery stat
*
@@ -118,6 +121,7 @@
#include "mail.h"
#include "battery.h"
#include "seti.h"
+#include "exec.h"
#define ROWS 16
#define GPOS 16
@@ -138,7 +142,7 @@ struct { int perc, stat; double dur; } batt;
struct { double perc, cput; } seti;
struct { int num; } mail[MAILBOXES];
struct { double val, min, max; } sensor[SENSORS];
-
+struct { char s[EXEC_TXT_LEN]; } exec[EXECS];
static double query (int token)
{
@@ -307,6 +311,7 @@ static double query_bar (int token)
static void print_token (int token, char **p)
{
double val;
+ int i;
switch (token) {
case T_PERCENT:
@@ -429,13 +434,22 @@ static void print_token (int token, char **p)
*p+=sprintf(*p, "%2.0f%c", val, eh);
}
break;
-
+
+#if 0
+ never comes here -lt ?
case T_MAIL:
val=query(token);
*p+=sprintf (*p, "%3.0f", val);
break;
+#endif
+
default:
- *p+=sprintf (*p, "%5.0f", query(token));
+ if ((token & 255) == T_EXEC) {
+ i = (token>>8)-'0';
+ *p+=sprintf (*p, "%s", exec[i].s);
+ }
+ else
+ *p+=sprintf (*p, "%5.0f", query(token));
}
}
@@ -504,6 +518,12 @@ static void collect_data (void)
Sensor (i, &sensor[i].val, &sensor[i].min, &sensor[i].max);
}
}
+
+ for (i=1; i<EXECS; i++) {
+ if (token_usage[T_EXEC]&(1<<i)) {
+ Exec (i, &exec[i].s);
+ }
+ }
}
static char *process_row (int r)