aboutsummaryrefslogtreecommitdiffstats
path: root/processor.c
diff options
context:
space:
mode:
authorltoetsch <>2001-03-14 13:19:29 +0000
committerltoetsch <>2001-03-14 13:19:29 +0000
commitc79da23905ffae3dafcdfe1bab8d7afb053f47b8 (patch)
tree1570430e8eda1b1ba400ad2c2b67e4e37f42afeb /processor.c
parent6465b5a730a285a6e57b87de3004b5cfa1668e01 (diff)
downloadlcd4linux-c79da23905ffae3dafcdfe1bab8d7afb053f47b8.tar.gz
[lcd4linux @ 2001-03-14 13:19:29 by ltoetsch]
Added pop3/imap4 mail support
Diffstat (limited to 'processor.c')
-rw-r--r--processor.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/processor.c b/processor.c
index 8676747..45eaff7 100644
--- a/processor.c
+++ b/processor.c
@@ -1,4 +1,4 @@
-/* $Id: processor.c,v 1.19 2001/03/13 08:34:15 reinelt Exp $
+/* $Id: processor.c,v 1.20 2001/03/14 13:19:29 ltoetsch Exp $
*
* main data processing
*
@@ -20,6 +20,9 @@
*
*
* $Log: processor.c,v $
+ * Revision 1.20 2001/03/14 13:19:29 ltoetsch
+ * Added pop3/imap4 mail support
+ *
* Revision 1.19 2001/03/13 08:34:15 reinelt
*
* corrected a off-by-one bug with sensors
@@ -152,7 +155,7 @@ struct { int usage, in, out, total, max, peak; } isdn;
struct { int rx, tx, total, max, peak; } ppp;
struct { int perc, stat; double dur; } batt;
struct { double perc, cput; } seti;
-struct { int num; } mail[MAILBOXES+1];
+struct { int num, unseen;} mail[MAILBOXES+1];
struct { double val, min, max; } sensor[SENSORS+1];
static double query (int token)
@@ -245,6 +248,9 @@ static double query (int token)
case T_MAIL:
return mail[(token>>8)-'0'].num;
+ case T_MAIL_UNSEEN:
+ return mail[(token>>8)-'0'].unseen;
+
case T_SENSOR:
return sensor[(token>>8)-'0'].val;
@@ -450,6 +456,7 @@ static void print_token (int token, char **p, char *start, int maxlen)
break;
case T_MAIL:
+ case T_MAIL_UNSEEN:
val=query(token);
*p+=sprintf (*p, "%3.0f", val);
break;
@@ -521,8 +528,8 @@ static void collect_data (void)
}
for (i=0; i<=MAILBOXES; i++) {
- if (token_usage[T_MAIL]&(1<<i)) {
- Mail (i, &mail[i].num);
+ if (token_usage[T_MAIL]&(1<<i) || token_usage[T_MAIL_UNSEEN]&(1<<i) ) {
+ Mail (i, &mail[i].num, &mail[i].unseen);
}
}