]> git.webhop.me Git - lcd4linux.git/commitdiff
[lcd4linux @ 2004-03-08 16:26:26 by reinelt]
authorreinelt <reinelt@3ae390bd-cb1e-0410-b409-cd5a39f66f1f>
Mon, 8 Mar 2004 16:26:26 +0000 (16:26 +0000)
committerreinelt <reinelt@3ae390bd-cb1e-0410-b409-cd5a39f66f1f>
Mon, 8 Mar 2004 16:26:26 +0000 (16:26 +0000)
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)

git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@389 3ae390bd-cb1e-0410-b409-cd5a39f66f1f

Makefile.am
Makefile.in
cfg.c
lcd4linux.conf.sample
widget_text.c

index 528eeff45b596de37823a278798f64fe395b3676..22dea966ba546a85faa91f4f1fe2a3e26a159a7f 100644 (file)
@@ -48,7 +48,7 @@ plugin_ppp.c                \
 plugin_dvb.c                \
 plugin_i2c_sensors.c        \
 plugin_imon.c               \
-plugin_xmms.c               
+plugin_xmms.c
 
 #liblcd4linux_la_DEPENDENCIES = @DRIVERS@
 #liblcd4linux_la_LDFLAGS = -version-info 9:12:9
index f596ea59524cc623b7de3dd3d23afac3eadc0d9a..842a8a8ae95599f3ebc6ac3877890fcc9ac83292 100644 (file)
@@ -106,7 +106,7 @@ lcd4linux_LDADD = @DRIVERS@ @DRVLIBS@
 #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@
diff --git a/cfg.c b/cfg.c
index 0b4aec79e83f43ea961a066ac92a3d12a22b1a4c..a39fbf4c26d2a626d71a0340a8dfa066ed82d66a 100644 (file)
--- a/cfg.c
+++ b/cfg.c
@@ -1,4 +1,4 @@
-/* $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).
@@ -307,14 +312,33 @@ static char *strip (char *s, int strip_comments)
 // 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++);
   
index 114723661f664fba9227b23d18da2afeedf63aa1..707e7d7fdcc9dc1592160ca282976924b02e803d 100644 (file)
@@ -9,13 +9,13 @@ Display LK204 {
 
 
 Display CF631 {
-    Icons 5
     Driver 'Crystalfontz'
     Model '631'
     Port '/dev/usb/tts/0'
     Speed 115200
     Contrast 95
     Backlight 100
+    Icons 1
 }
 
 Display CF632 {
index 06102207925792d743b699cc41022dd5d221c66e..3c8d2dc2abf787e8d72fd7ce6d1122e8b40e561c 100644 (file)
@@ -1,4 +1,4 @@
-/* $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).
@@ -373,8 +378,10 @@ int widget_text_init (WIDGET *Self)
   }
   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) {
@@ -387,7 +394,8 @@ int widget_text_init (WIDGET *Self)
   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) {