aboutsummaryrefslogtreecommitdiffstats
path: root/widget_timer.c
diff options
context:
space:
mode:
authorgeronet <geronet@3ae390bd-cb1e-0410-b409-cd5a39f66f1f>2006-02-25 13:36:33 +0000
committergeronet <geronet@3ae390bd-cb1e-0410-b409-cd5a39f66f1f>2006-02-25 13:36:33 +0000
commitf5ca09365013ad01f33db2d2f58b222d6391b38d (patch)
tree14f52fa897c91489fa612827ff7bbdab42cf0d7b /widget_timer.c
parentc5130183e05c6dcb274b6341a05f496acf64aa1f (diff)
downloadlcd4linux-f5ca09365013ad01f33db2d2f58b222d6391b38d.tar.gz
[lcd4linux @ 2006-02-25 13:36:33 by geronet]
updated indent.sh, applied coding style git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@647 3ae390bd-cb1e-0410-b409-cd5a39f66f1f
Diffstat (limited to 'widget_timer.c')
-rw-r--r--widget_timer.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/widget_timer.c b/widget_timer.c
index 6c9c832..0190acd 100644
--- a/widget_timer.c
+++ b/widget_timer.c
@@ -1,4 +1,4 @@
-/* $Id: widget_timer.c,v 1.1 2006/01/23 06:17:18 reinelt Exp $
+/* $Id: widget_timer.c,v 1.2 2006/02/25 13:36:33 geronet Exp $
*
* timer widget handling
*
@@ -21,6 +21,9 @@
*
*
* $Log: widget_timer.c,v $
+ * Revision 1.2 2006/02/25 13:36:33 geronet
+ * updated indent.sh, applied coding style
+ *
* Revision 1.1 2006/01/23 06:17:18 reinelt
* timer widget added
*
@@ -69,7 +72,7 @@ void widget_timer_update(void *Self)
Timer->update = 10;
DelResult(&result);
}
-
+
Timer->active = 1;
if (Timer->active_tree != NULL) {
Eval(Timer->active_tree, &result);
@@ -78,13 +81,13 @@ void widget_timer_update(void *Self)
Timer->active = 0;
DelResult(&result);
}
-
+
/* finally, fire it! */
if (Timer->active) {
Eval(Timer->expr_tree, &result);
DelResult(&result);
}
-
+
/* add a new one-shot timer */
timer_add(widget_timer_update, Self, Timer->update, 1);
}
@@ -101,7 +104,7 @@ int widget_timer_init(WIDGET * Self)
section = malloc(strlen(Self->name) + 8);
strcpy(section, "Widget:");
strcat(section, Self->name);
-
+
Timer = malloc(sizeof(WIDGET_TIMER));
memset(Timer, 0, sizeof(WIDGET_TIMER));
@@ -109,7 +112,7 @@ int widget_timer_init(WIDGET * Self)
Timer->expression = cfg_get_raw(section, "axpression", NULL);
Timer->update_expr = cfg_get_raw(section, "update", "100");
Timer->active_expr = cfg_get_raw(section, "active", "1");
-
+
/* sanity checks */
if (Timer->expression == NULL || *Timer->expression == '\0') {
error("Timer %s has no expression, using '1'", Self->name);
@@ -124,11 +127,11 @@ int widget_timer_init(WIDGET * Self)
Compile(Timer->expression, &Timer->expr_tree);
Compile(Timer->update_expr, &Timer->update_tree);
Compile(Timer->active_expr, &Timer->active_tree);
-
-
+
+
free(section);
Self->data = Timer;
-
+
/* just do it! */
widget_timer_update(Self);