#remove next line for liblcd4linux
lcd4linux_DEPENDENCIES = @DRIVERS@
-lcd4linux_SOURCES = lcd4linux.c cfg.c cfg.h debug.c debug.h drv.c drv.h evaluator.c evaluator.h hash.c hash.h layout.c layout.h lock.c lock.h pid.c pid.h timer.c timer.h udelay.c udelay.h qprintf.c qprintf.h widget.c widget.h widget_text.c widget_text.h widget_bar.c widget_bar.h widget_icon.c widget_icon.h plugin.c plugin.h plugin_math.c plugin_string.c plugin_cfg.c plugin_uname.c plugin_loadavg.c plugin_proc_stat.c plugin_cpuinfo.c plugin_meminfo.c plugin_netdev.c plugin_ppp.c plugin_dvb.c plugin_i2c_sensors.c plugin_imon.c plugin_xmms.c
+lcd4linux_SOURCES = lcd4linux.c cfg.c cfg.h debug.c debug.h drv.c drv.h evaluator.c evaluator.h hash.c hash.h layout.c layout.h lock.c lock.h pid.c pid.h timer.c timer.h udelay.c udelay.h qprintf.c qprintf.h widget.c widget.h widget_text.c widget_text.h widget_bar.c widget_bar.h widget_icon.c widget_icon.h plugin.c plugin.h plugin_math.c plugin_string.c plugin_cfg.c plugin_uname.c plugin_loadavg.c plugin_proc_stat.c plugin_cpuinfo.c plugin_meminfo.c plugin_netdev.c plugin_ppp.c plugin_dvb.c plugin_i2c_sensors.c plugin_imon.c plugin_xmms.c
#liblcd4linux_la_DEPENDENCIES = @DRIVERS@
-/* $Id: cfg.c,v 1.37 2004/03/06 20:31:16 reinelt Exp $^
+/* $Id: cfg.c,v 1.38 2004/03/08 16:26:26 reinelt Exp $^
*
* config file stuff
*
*
*
* $Log: cfg.c,v $
+ * Revision 1.38 2004/03/08 16:26:26 reinelt
+ * re-introduced \nnn (octal) characters in strings
+ * text widgets can have a 'update' speed of 0 which means 'never'
+ * (may be used for static content)
+ *
* Revision 1.37 2004/03/06 20:31:16 reinelt
* Complete rewrite of the evaluator to get rid of the code
* from mark Morley (because of license issues).
// unquote a string
static char *dequote (char *string)
{
- char *s=string;
- char *p=string;
+ int quote=0;
+ char *s = string;
+ char *p = string;
do {
- if (*s=='\\' && *(s+1)=='#') {
- *p++=*++s;
- } else {
- *p++=*s;
+ if (*s == '\'') {
+ quote = !quote;
+ *p++ = *s;
+ }
+ else if (quote && *s == '\\') {
+ s++;
+ if (*s >= '0' && *s <= '7') {
+ int n;
+ unsigned int c = 0;
+ sscanf (s, "%3o%n", &c, &n);
+ if (c == 0 || c > 255) {
+ error ("WARNING: illegal '\\' in <%s>", string);
+ } else {
+ *p++ = c;
+ s += n-1;
+ }
+ } else {
+ *p++ = *s;
+ }
+ }
+ else {
+ *p++ = *s;
}
} while (*s++);
-/* $Id: widget_text.c,v 1.15 2004/03/06 20:31:16 reinelt Exp $
+/* $Id: widget_text.c,v 1.16 2004/03/08 16:26:26 reinelt Exp $
*
* simple text widget handling
*
*
*
* $Log: widget_text.c,v $
+ * Revision 1.16 2004/03/08 16:26:26 reinelt
+ * re-introduced \nnn (octal) characters in strings
+ * text widgets can have a 'update' speed of 0 which means 'never'
+ * (may be used for static content)
+ *
* Revision 1.15 2004/03/06 20:31:16 reinelt
* Complete rewrite of the evaluator to get rid of the code
* from mark Morley (because of license issues).
}
free (c);
- // update interval (msec), default 1 sec
- cfg_number (section, "update", 1000, 10, 99999, &(Text->update));
+ // update interval (msec), default 1 sec, 0 stands for never
+ cfg_number (section, "update", 1000, 0, 99999, &(Text->update));
+ // limit update interval to min 10 msec
+ if (Text->update > 0 && Text->update < 10) Text->update = 10;
// marquee scroller speed: interval (msec), default 500msec
if (Text->align==ALIGN_MARQUEE) {
free (section);
Self->data=Text;
- timer_add (widget_text_update, Self, Text->update, 0);
+ // add update timer, use one-shot if 'update' is zero
+ timer_add (widget_text_update, Self, Text->update, Text->update==0);
// a marquee scroller has its own timer and callback
if (Text->align==ALIGN_MARQUEE) {