]> git.webhop.me Git - lcd4linux.git/commitdiff
[lcd4linux @ 2003-08-24 05:17:58 by reinelt]
authorreinelt <reinelt@3ae390bd-cb1e-0410-b409-cd5a39f66f1f>
Sun, 24 Aug 2003 05:17:58 +0000 (05:17 +0000)
committerreinelt <reinelt@3ae390bd-cb1e-0410-b409-cd5a39f66f1f>
Sun, 24 Aug 2003 05:17:58 +0000 (05:17 +0000)
liblcd4linux patch from Patrick Schemitz

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

25 files changed:
BeckmannEgle.c
Crystalfontz.c
Cwlinux.c
HD44780.c
M50530.c
Makefile.am
Makefile.in
MatrixOrbital.c
PalmPilot.c
Raster.c
SIN.c
Text.c
USBLCD.c
cfg.c
cfg.h
debug.c
debug.h
display.c
display.h
icon.c
lcd4linux.c
parport.c
processor.c
seti.c
system.c

index 21504d77a0d8e1e29c82b2da2e17ea5355ade107..622dcb6e79269e0b0a89bc9e979925e87af605e8 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: BeckmannEgle.c,v 1.14 2003/08/16 07:31:35 reinelt Exp $
+/* $Id: BeckmannEgle.c,v 1.15 2003/08/24 05:17:58 reinelt Exp $
  *
  * driver for Beckmann+Egle mini terminals
  *
@@ -20,6 +20,9 @@
  *
  *
  * $Log: BeckmannEgle.c,v $
+ * Revision 1.15  2003/08/24 05:17:58  reinelt
+ * liblcd4linux patch from Patrick Schemitz
+ *
  * Revision 1.14  2003/08/16 07:31:35  reinelt
  * double buffering in all drivers
  *
@@ -229,14 +232,14 @@ int BE_init (LCD *Self)
 
   port=cfg_get ("Port", NULL);
   if (port==NULL || *port=='\0') {
-    error ("BeckmannEgle: no 'Port' entry in %s", cfg_file());
+    error ("BeckmannEgle: no 'Port' entry in %s", cfg_source());
     return -1;
   }
   Port=strdup(port);
 
   s=cfg_get("Type", NULL);
   if (s==NULL || *s=='\0') {
-    error ("BeckmannEgle: no 'Type' entry in %s", cfg_file());
+    error ("BeckmannEgle: no 'Type' entry in %s", cfg_source());
     return -1;
   }
   if (sscanf(s,"%dx%d",&cols,&rows)!=2 || rows<1 || cols<1) {
index 628abe06d1218b0cb3ebe4f2be2bb31d61858919..8e11d3590718647390b01b72934cdd460ac7a649 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: Crystalfontz.c,v 1.12 2003/08/19 04:28:41 reinelt Exp $
+/* $Id: Crystalfontz.c,v 1.13 2003/08/24 05:17:58 reinelt Exp $
  *
  * driver for display modules from Crystalfontz
  *
@@ -19,6 +19,9 @@
  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  *
  * $Log: Crystalfontz.c,v $
+ * Revision 1.13  2003/08/24 05:17:58  reinelt
+ * liblcd4linux patch from Patrick Schemitz
+ *
  * Revision 1.12  2003/08/19 04:28:41  reinelt
  * more Icon stuff, minor glitches fixed
  *
@@ -208,7 +211,7 @@ static int CF_init (LCD *Self)
 
   port=cfg_get ("Port",NULL);
   if (port==NULL || *port=='\0') {
-    error ("Crystalfontz: no 'Port' entry in %s", cfg_file());
+    error ("Crystalfontz: no 'Port' entry in %s", cfg_source());
     return -1;
   }
   Port=strdup(port);
@@ -229,7 +232,7 @@ static int CF_init (LCD *Self)
     Speed=B19200;
     break;
   default:
-    error ("Crystalfontz: unsupported speed '%s' in %s", speed, cfg_file());
+    error ("Crystalfontz: unsupported speed '%s' in %s", speed, cfg_source());
     return -1;
   }    
 
index 4866a61205760fc74ba9c69f9385e16cb06b72f9..bd61317ccc1a257b06ec227412e2366803bc415a 100644 (file)
--- a/Cwlinux.c
+++ b/Cwlinux.c
@@ -1,4 +1,4 @@
-/* $Id: Cwlinux.c,v 1.11 2003/08/16 07:31:35 reinelt Exp $
+/* $Id: Cwlinux.c,v 1.12 2003/08/24 05:17:58 reinelt Exp $
  *
  * driver for Cwlinux serial display modules
  *
@@ -20,6 +20,9 @@
  *
  *
  * $Log: Cwlinux.c,v $
+ * Revision 1.12  2003/08/24 05:17:58  reinelt
+ * liblcd4linux patch from Patrick Schemitz
+ *
  * Revision 1.11  2003/08/16 07:31:35  reinelt
  * double buffering in all drivers
  *
@@ -285,7 +288,7 @@ int CW_init(LCD * Self)
 
   port = cfg_get("Port",NULL);
   if (port == NULL || *port == '\0') {
-    error("Cwlinux: no 'Port' entry in %s", cfg_file());
+    error("Cwlinux: no 'Port' entry in %s", cfg_source());
     return -1;
   }
   Port = strdup(port);
@@ -300,7 +303,7 @@ int CW_init(LCD * Self)
     Speed = B19200;
     break;
   default:
-    error("Cwlinux: unsupported speed '%s' in %s", speed, cfg_file());
+    error("Cwlinux: unsupported speed '%s' in %s", speed, cfg_source());
     return -1;
   }
 
index d4b27e42ec6cf618a07e47669247c4c39cd64c91..5ba23589f81d3abe34a20902f31ebc29be859176 100644 (file)
--- a/HD44780.c
+++ b/HD44780.c
@@ -1,4 +1,4 @@
-/* $Id: HD44780.c,v 1.35 2003/08/22 03:45:08 reinelt Exp $
+/* $Id: HD44780.c,v 1.36 2003/08/24 05:17:58 reinelt Exp $
  *
  * driver for display modules based on the HD44780 chip
  *
@@ -27,6 +27,9 @@
  *
  *
  * $Log: HD44780.c,v $
+ * Revision 1.36  2003/08/24 05:17:58  reinelt
+ * liblcd4linux patch from Patrick Schemitz
+ *
  * Revision 1.35  2003/08/22 03:45:08  reinelt
  * bug in parallel port code fixed, more icons stuff
  *
@@ -401,7 +404,7 @@ int HD_init (LCD *Self)
   
   s=cfg_get("Size",NULL);
   if (s==NULL || *s=='\0') {
-    error ("HD44780: no 'Size' entry in %s", cfg_file());
+    error ("HD44780: no 'Size' entry in %s", cfg_source());
     return -1;
   }
   if (sscanf(s,"%dx%d",&cols,&rows)!=2 || rows<1 || cols<1) {
@@ -416,7 +419,7 @@ int HD_init (LCD *Self)
   else {
     gpos=strtol(s, &e, 0);
     if (*e!='\0' || gpos<0 || gpos>8) {
-      error ("HD44780: bad GPOs '%s' in %s", s, cfg_file());
+      error ("HD44780: bad GPOs '%s' in %s", s, cfg_source());
       return -1;
     }    
   }
@@ -424,7 +427,7 @@ int HD_init (LCD *Self)
   s=cfg_get("Controllers", "1");
   Controllers=strtol(s, &e, 0);
   if (*e!='\0' || Controllers<1 || Controllers>2) {
-    error ("HD44780: bad Controllers '%s' in %s, should be '1' or '2'", s, cfg_file());
+    error ("HD44780: bad Controllers '%s' in %s, should be '1' or '2'", s, cfg_source());
     return -1;
   }    
   info ("wiring: using display with %d controllers", Controllers);
@@ -448,7 +451,7 @@ int HD_init (LCD *Self)
   s=cfg_get("Bits", "8");
   Bits=strtol(s, &e, 0);
   if (*e!='\0' || (Bits!=4 && Bits!=8)) {
-    error ("HD44780: bad Bits '%s' in %s, should be '4' or '8'", s, cfg_file());
+    error ("HD44780: bad Bits '%s' in %s, should be '4' or '8'", s, cfg_source());
     return -1;
   }    
   info ("wiring: using %d bit mode", Bits);
index f5709952af10b1d5e93cbd6917019942fbe70c37..1544a252b9ecfd8facb0ff70f603f7c7d76f3223 100644 (file)
--- a/M50530.c
+++ b/M50530.c
@@ -1,4 +1,4 @@
-/* $Id: M50530.c,v 1.11 2003/08/16 07:31:35 reinelt Exp $
+/* $Id: M50530.c,v 1.12 2003/08/24 05:17:58 reinelt Exp $
  *
  * driver for display modules based on the M50530 chip
  *
@@ -20,6 +20,9 @@
  *
  *
  * $Log: M50530.c,v $
+ * Revision 1.12  2003/08/24 05:17:58  reinelt
+ * liblcd4linux patch from Patrick Schemitz
+ *
  * Revision 1.11  2003/08/16 07:31:35  reinelt
  * double buffering in all drivers
  *
@@ -180,7 +183,7 @@ int M5_init (LCD *Self)
   
   s=cfg_get("Size",NULL);
   if (s==NULL || *s=='\0') {
-    error ("M50530: no 'Size' entry in %s", cfg_file());
+    error ("M50530: no 'Size' entry in %s", cfg_source());
     return -1;
   }
   if (sscanf(s,"%dx%d",&cols,&rows)!=2 || rows<1 || cols<1) {
@@ -194,7 +197,7 @@ int M5_init (LCD *Self)
   } else {
     gpos=strtol(s, &e, 0);
     if (*e!='\0' || gpos<0 || gpos>8) {
-      error ("M50530: bad GPOs '%s' in %s", s, cfg_file());
+      error ("M50530: bad GPOs '%s' in %s", s, cfg_source());
       return -1;
     }    
   }
index 4b6704a316757697be189aaa2113a5980b61a796..754532b57448a4a9e27bc2642f4cef7a593dac87 100644 (file)
@@ -7,10 +7,14 @@ bin_PROGRAMS = lcd4linux
 noinst_LIBRARIES = liblcd4linux.a
 
 AM_CFLAGS = $(X_CFLAGS) -D_GNU_SOURCE -Wall
+
 lcd4linux_LDFLAGS = $(X_LIBS)
 lcd4linux_LDADD = @DRIVERS@ @DRVLIBS@
 lcd4linux_DEPENDENCIES = @DRIVERS@
 
+liblcd4linux_a_LIBADD = @DRIVERS@
+liblcd4linux_a_DEPENDENCIES = @DRIVERS@
+
 lcd4linux_SOURCES = \
 lcd4linux.c \
 debug.c debug.h \
@@ -54,21 +58,16 @@ XWindow.c \
 Text.c
 
 liblcd4linux_a_SOURCES = \
+display.c display.h \
+debug.c debug.h \
+cfg.c cfg.h \
+lock.c lock.h \
+pixmap.c pixmap.h \
+bar.c bar.h \
+icon.c icon.h \
+fontmap.c fontmap.h \
 parport.c parport.h \
-BeckmannEgle.c \
-Crystalfontz.c \
-Cwlinux.c \
-HD44780.c \
-M50530.c \
-T6963.c \
-USBLCD.c \
-MatrixOrbital.c \
-PalmPilot.c \
-Raster.c \
-SIN.c \
-Skeleton.c \
-XWindow.c \
-Text.c
+udelay.c udelay.h
 
 EXTRA_DIST = \
 lcd4linux.conf.sample \
index 5f72b3ca4d1b9b7baf474775f2cc533ae29e4fd6..1e3f7f558e49e54508e9f2965390dc71dae50bfb 100644 (file)
@@ -79,17 +79,21 @@ bin_PROGRAMS = lcd4linux
 noinst_LIBRARIES = liblcd4linux.a
 
 AM_CFLAGS = $(X_CFLAGS) -D_GNU_SOURCE -Wall
+
 lcd4linux_LDFLAGS = $(X_LIBS)
 lcd4linux_LDADD = @DRIVERS@ @DRVLIBS@
 lcd4linux_DEPENDENCIES = @DRIVERS@
 
+liblcd4linux_a_LIBADD = @DRIVERS@
+liblcd4linux_a_DEPENDENCIES = @DRIVERS@
+
 lcd4linux_SOURCES =  lcd4linux.c debug.c debug.h cfg.c cfg.h lock.c lock.h pid.c pid.h parser.c parser.h processor.c processor.h system.c system.h isdn.c isdn.h mail.c mail.h seti.c seti.h battery.c battery.h dvb.c dvb.h filter.c filter.h udelay.c udelay.h display.c display.h pixmap.c pixmap.h bar.c bar.h icon.c icon.h fontmap.c fontmap.h exec.c exec.h mail2.c socket.c socket.h
 
 
 EXTRA_lcd4linux_SOURCES =  parport.c parport.h BeckmannEgle.c Crystalfontz.c Cwlinux.c HD44780.c M50530.c T6963.c USBLCD.c MatrixOrbital.c PalmPilot.c Raster.c SIN.c Skeleton.c XWindow.c Text.c
 
 
-liblcd4linux_a_SOURCES =  parport.c parport.h BeckmannEgle.c Crystalfontz.c Cwlinux.c HD44780.c M50530.c T6963.c USBLCD.c MatrixOrbital.c PalmPilot.c Raster.c SIN.c Skeleton.c XWindow.c Text.c
+liblcd4linux_a_SOURCES =  display.c display.h debug.c debug.h cfg.c cfg.h lock.c lock.h pixmap.c pixmap.h bar.c bar.h icon.c icon.h fontmap.c fontmap.h parport.c parport.h udelay.c udelay.h
 
 
 EXTRA_DIST =  lcd4linux.conf.sample lcd4kde.conf lcd4linux.kdelnk lcd4linux.xpm lcd4linux.lsm curses.m4 AUTHORS CREDITS FAQ NEWS TODO README README.Drivers README.KDE
@@ -109,10 +113,8 @@ X_CFLAGS = @X_CFLAGS@
 X_LIBS = @X_LIBS@
 X_EXTRA_LIBS = @X_EXTRA_LIBS@
 X_PRE_LIBS = @X_PRE_LIBS@
-liblcd4linux_a_LIBADD = 
-liblcd4linux_a_OBJECTS =  parport.o BeckmannEgle.o Crystalfontz.o \
-Cwlinux.o HD44780.o M50530.o T6963.o USBLCD.o MatrixOrbital.o \
-PalmPilot.o Raster.o SIN.o Skeleton.o XWindow.o Text.o
+liblcd4linux_a_OBJECTS =  display.o debug.o cfg.o lock.o pixmap.o bar.o \
+icon.o fontmap.o parport.o udelay.o
 AR = ar
 PROGRAMS =  $(bin_PROGRAMS)
 
index 6848a7eb2cf16293f24cf3d59179f15fd85bca78..f392db0810bddc27ddc8fa9e991932d8ac29bc19 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: MatrixOrbital.c,v 1.33 2003/08/24 04:31:56 reinelt Exp $
+/* $Id: MatrixOrbital.c,v 1.34 2003/08/24 05:17:58 reinelt Exp $
  *
  * driver for Matrix Orbital serial display modules
  *
@@ -20,6 +20,9 @@
  *
  *
  * $Log: MatrixOrbital.c,v $
+ * Revision 1.34  2003/08/24 05:17:58  reinelt
+ * liblcd4linux patch from Patrick Schemitz
+ *
  * Revision 1.33  2003/08/24 04:31:56  reinelt
  * icon.c icon.h added
  *
@@ -326,7 +329,7 @@ static int MO_init (LCD *Self, int protocol)
 
   port=cfg_get ("Port",NULL);
   if (port==NULL || *port=='\0') {
-    error ("MatrixOrbital: no 'Port' entry in %s", cfg_file());
+    error ("MatrixOrbital: no 'Port' entry in %s", cfg_source());
     return -1;
   }
   Port=strdup(port);
@@ -347,7 +350,7 @@ static int MO_init (LCD *Self, int protocol)
     Speed=B19200;
     break;
   default:
-    error ("MatrixOrbital: unsupported speed '%s' in %s", s, cfg_file());
+    error ("MatrixOrbital: unsupported speed '%s' in %s", s, cfg_source());
     return -1;
   }    
 
@@ -360,7 +363,7 @@ static int MO_init (LCD *Self, int protocol)
   Icons=strtol(s, &e, 0);
   if (*e!='\0' || Icons<0 || Icons>8) {
     debug ("Icons=%d e=<%s>", Icons, e);
-    error ("MatrixOrbital: bad Icons '%s' in %s, must be between 0 and 8", s, cfg_file());
+    error ("MatrixOrbital: bad Icons '%s' in %s, must be between 0 and 8", s, cfg_source());
     return -1;
   }    
   if (Icons>0) {
index 92d2d88fcd2a3b68f10c6157e3242f339dec8f64..7b1a8bba9de412163be05446d7a035d531cbe248 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: PalmPilot.c,v 1.10 2003/08/17 12:11:58 reinelt Exp $
+/* $Id: PalmPilot.c,v 1.11 2003/08/24 05:17:58 reinelt Exp $
  *
  * driver for 3Com Palm Pilot
  *
@@ -20,6 +20,9 @@
  *
  *
  * $Log: PalmPilot.c,v $
+ * Revision 1.11  2003/08/24 05:17:58  reinelt
+ * liblcd4linux patch from Patrick Schemitz
+ *
  * Revision 1.10  2003/08/17 12:11:58  reinelt
  * framework for icons prepared
  *
@@ -222,7 +225,7 @@ int Palm_init (LCD *Self)
 
   port=cfg_get ("Port",NULL);
   if (port==NULL || *port=='\0') {
-    error ("PalmPilot: no 'Port' entry in %s", cfg_file());
+    error ("PalmPilot: no 'Port' entry in %s", cfg_source());
     return -1;
   }
   Port=strdup(port);
@@ -246,7 +249,7 @@ int Palm_init (LCD *Self)
     Speed=B19200;
     break;
   default:
-    error ("PalmPilot: unsupported speed '%s' in %s", speed, cfg_file());
+    error ("PalmPilot: unsupported speed '%s' in %s", speed, cfg_source());
     return -1;
   }    
 
index 65b7f63e007baad618096170f38af11328e0f274..631074bf23737a6dad51693ecdeae535effe472b 100644 (file)
--- a/Raster.c
+++ b/Raster.c
@@ -1,4 +1,4 @@
-/* $Id: Raster.c,v 1.24 2003/08/17 12:11:58 reinelt Exp $
+/* $Id: Raster.c,v 1.25 2003/08/24 05:17:58 reinelt Exp $
  *
  * driver for raster formats
  *
@@ -20,6 +20,9 @@
  *
  *
  * $Log: Raster.c,v $
+ * Revision 1.25  2003/08/24 05:17:58  reinelt
+ * liblcd4linux patch from Patrick Schemitz
+ *
  * Revision 1.24  2003/08/17 12:11:58  reinelt
  * framework for icons prepared
  *
@@ -166,8 +169,6 @@ static unsigned int foreground=0;
 static unsigned int halfground=0;
 static unsigned int background=0;
 
-extern char* output;
-
 
 #ifdef WITH_PPM
 int PPM_flush (void)
diff --git a/SIN.c b/SIN.c
index 52312c635f690834a75cfddfd3ee4bd1fa673ae5..48f6233016332d14aff36dc31eb95ad851f80fc2 100644 (file)
--- a/SIN.c
+++ b/SIN.c
@@ -1,4 +1,4 @@
-/* $Id: SIN.c,v 1.11 2003/08/17 12:11:58 reinelt Exp $
+/* $Id: SIN.c,v 1.12 2003/08/24 05:17:58 reinelt Exp $
  *
  * driver for SIN router displays
  *
@@ -20,6 +20,9 @@
  *
  *
  * $Log: SIN.c,v $
+ * Revision 1.12  2003/08/24 05:17:58  reinelt
+ * liblcd4linux patch from Patrick Schemitz
+ *
  * Revision 1.11  2003/08/17 12:11:58  reinelt
  * framework for icons prepared
  *
@@ -193,7 +196,7 @@ int SIN_init (LCD *Self)
 
   port=cfg_get ("Port",NULL);
   if (port==NULL || *port=='\0') {
-    error ("SIN: no 'Port' entry in %s", cfg_file());
+    error ("SIN: no 'Port' entry in %s", cfg_source());
     return -1;
   }
   Port=strdup(port);
diff --git a/Text.c b/Text.c
index abd663379400b39a9e5e801087d307267e9f6b20..8b242668941f7dfb719dae7c369f4f2bfc50cc8e 100644 (file)
--- a/Text.c
+++ b/Text.c
@@ -1,4 +1,4 @@
-/* $Id: Text.c,v 1.9 2003/07/24 04:48:09 reinelt Exp $
+/* $Id: Text.c,v 1.10 2003/08/24 05:17:58 reinelt Exp $
  *
  * pure ncurses based text driver
  *
@@ -20,6 +20,9 @@
  *
  *
  * $Log: Text.c,v $
+ * Revision 1.10  2003/08/24 05:17:58  reinelt
+ * liblcd4linux patch from Patrick Schemitz
+ *
  * Revision 1.9  2003/07/24 04:48:09  reinelt
  * 'soft clear' needed for virtual rows
  *
@@ -93,7 +96,7 @@ int main(int argc, char *argv[])
 #include "display.h"
 #include "bar.h"
 
-extern int foreground;
+extern int running_foreground;
 
 static LCD Lcd;
 static WINDOW *w, *err_win;
@@ -121,7 +124,7 @@ int Text_init (LCD *Self)
   int cols=-1, rows=-1;
   int scr_cols, scr_rows;
   char *s;
-  if (!foreground) {
+  if (!running_foreground) {
     error("Text: you want me to display on /dev/null: sorry, I can't");
     error("Text: Maybe you want me to run in foreground? Try '-F'");
     return -1;
index c9a098677cd793e34c459e654432cfe6b1900aa6..a3871aa7959daad02636be8fa4946f46cd9b8b89 100644 (file)
--- a/USBLCD.c
+++ b/USBLCD.c
@@ -1,4 +1,4 @@
-/* $Id: USBLCD.c,v 1.11 2003/08/16 07:31:35 reinelt Exp $
+/* $Id: USBLCD.c,v 1.12 2003/08/24 05:17:58 reinelt Exp $
  *
  * Driver for USBLCD ( see http://www.usblcd.de )
  * This Driver is based on HD44780.c
@@ -22,6 +22,9 @@
  *
  *
  * $Log: USBLCD.c,v $
+ * Revision 1.12  2003/08/24 05:17:58  reinelt
+ * liblcd4linux patch from Patrick Schemitz
+ *
  * Revision 1.11  2003/08/16 07:31:35  reinelt
  * double buffering in all drivers
  *
@@ -221,7 +224,7 @@ int USBLCD_init (LCD *Self)
     Port=NULL;
   }
   if ((port=cfg_get("Port",NULL))==NULL || *port=='\0') {
-    error ("USBLCD: no 'Port' entry in %s", cfg_file());
+    error ("USBLCD: no 'Port' entry in %s", cfg_source());
     return -1;
   }
   if (port[0]=='/') {
@@ -235,7 +238,7 @@ int USBLCD_init (LCD *Self)
 
   s=cfg_get("Size",NULL);
   if (s==NULL || *s=='\0') {
-    error ("USBLCD: no 'Size' entry in %s", cfg_file());
+    error ("USBLCD: no 'Size' entry in %s", cfg_source());
     return -1;
   }
   if (sscanf(s,"%dx%d",&cols,&rows)!=2 || rows<1 || cols<1) {
diff --git a/cfg.c b/cfg.c
index 6fd6e075d73651a3f061382d72c75e140ac15278..708bf5901d0a37279bef5ae2fd57727a4c50184a 100644 (file)
--- a/cfg.c
+++ b/cfg.c
@@ -1,4 +1,4 @@
-/* $Id: cfg.c,v 1.14 2003/08/14 03:47:40 reinelt Exp $
+/* $Id: cfg.c,v 1.15 2003/08/24 05:17:58 reinelt Exp $
  *
  * config file stuff
  *
@@ -20,6 +20,9 @@
  *
  *
  * $Log: cfg.c,v $
+ * Revision 1.15  2003/08/24 05:17:58  reinelt
+ * liblcd4linux patch from Patrick Schemitz
+ *
  * Revision 1.14  2003/08/14 03:47:40  reinelt
  * remove PID file if driver initialisation fails
  *
 /* 
  * exported functions:
  *
+ * cfg_init (source)
+ *   read configuration from source
+ *   returns  0 if successful
+ *   returns -1 in case of an error
+ * 
+ * cfg_source (void)
+ *   returns the file the configuration was read from
+ * 
  * cfg_cmd (arg)
  *   allows us to overwrite entries in the 
  *   config-file from the command line.
  *   cfg_cmd can be called _before_ cfg_read()
  *   returns 0 if ok, -1 if arg cannot be parsed
  *
- * cfg_set (key, value)
- *   pre-set key's value
- *   should be called before cfg_read()
- *   so we can specify 'default values'
- *
  * cfg_get (key, defval) 
  *   return the a value for a given key 
  *   or <defval> if key does not exist
  *
- * cfg_read (file)
- *   read configuration from file   
- *   returns  0 if successful
- *   returns -1 in case of an error
- * 
- * cfg_file (void)
- *   returns the file the configuration was read from
- * 
  */
 
 
@@ -193,7 +191,7 @@ static void cfg_add (char *key, char *val, int lock)
   Config[i].lock=lock;
 }
 
-int cfg_cmd (char *arg)
+int l4l_cfg_cmd (char *arg)
 {
   char *key, *val;
   char buffer[256];
@@ -211,12 +209,7 @@ int cfg_cmd (char *arg)
   return 0;
 }
 
-void cfg_set (char *key, char *val)
-{
-  cfg_add (key, val, 0);
-}
-
-char *cfg_get (char *key, char *defval)
+char *l4l_cfg_get (char *key, char *defval)
 {
   int i;
 
@@ -228,7 +221,7 @@ char *cfg_get (char *key, char *defval)
   return defval;
 }
 
-static int check_cfg_file(char *file)
+static int check_cfg_source(char *file)
 {
   /* as passwords and commands are stored in the config file,
    * we will check that:
@@ -268,13 +261,13 @@ static int check_cfg_file(char *file)
   return error;
 }
 
-int cfg_read (char *file)
+int l4l_cfg_init (char *file)
 {
   FILE *stream;
   char buffer[256];
   char *line, *p, *s;
 
-  if (check_cfg_file(file) == -1) {
+  if (check_cfg_source(file) == -1) {
     error("config file '%s' is insecure, aborting", file);
     return -1;
   }
@@ -307,16 +300,23 @@ int cfg_read (char *file)
       *s='\0';
       p++;
     }
-    cfg_set (line, p);
+    cfg_add (line, p, 0);
   }
   fclose (stream);
   return 0;
 }
 
-char *cfg_file (void)
+char *l4l_cfg_source (void)
 {
   if (Config_File)
     return Config_File;
   else
     return "";
 }
+
+
+int   (*cfg_init)   (char *source)            = l4l_cfg_init;
+char *(*cfg_source) (void)                    = l4l_cfg_source;
+int   (*cfg_cmd)    (char *arg)               = l4l_cfg_cmd;
+char *(*cfg_get)    (char *key, char *defval) = l4l_cfg_get;
+
diff --git a/cfg.h b/cfg.h
index 612528ebe5ba6ff1dd1adceeda60c6e9e89713f3..cb4b86a916fc2c212c6edd01e0934ac237f6a3de 100644 (file)
--- a/cfg.h
+++ b/cfg.h
@@ -1,4 +1,4 @@
-/* $Id: cfg.h,v 1.3 2003/02/22 07:53:10 reinelt Exp $
+/* $Id: cfg.h,v 1.4 2003/08/24 05:17:58 reinelt Exp $
  *
  * config file stuff
  *
@@ -20,6 +20,9 @@
  *
  *
  * $Log: cfg.h,v $
+ * Revision 1.4  2003/08/24 05:17:58  reinelt
+ * liblcd4linux patch from Patrick Schemitz
+ *
  * Revision 1.3  2003/02/22 07:53:10  reinelt
  * cfg_get(key,defval)
  *
 #ifndef _CFG_H_
 #define _CFG_H_
 
-int   cfg_cmd (char *arg);
-void  cfg_set (char *key, char *value);
-char *cfg_get (char *key, char *defval);
-int   cfg_read (char *file);
-char *cfg_file (void);
+extern int   (*cfg_init)   (char *source);
+extern char *(*cfg_source) (void);
+extern int   (*cfg_cmd)    (char *arg);
+extern char *(*cfg_get)    (char *key, char *defval);
+
+int   l4l_cfg_init   (char *file);
+char *l4l_cfg_source (void);
+int   l4l_cfg_cmd    (char *arg);
+char *l4l_cfg_get    (char *key, char *defval);
 
 #endif
diff --git a/debug.c b/debug.c
index a90fec7dd03427cb1337e8022512d0ce15e68389..5ff185cd28a1a486b522dd9ad680d668393a8205 100644 (file)
--- a/debug.c
+++ b/debug.c
@@ -1,4 +1,4 @@
-/* $Id: debug.c,v 1.4 2003/08/08 06:58:06 reinelt Exp $
+/* $Id: debug.c,v 1.5 2003/08/24 05:17:58 reinelt Exp $
  *
  * debug() and error() functions
  *
@@ -20,6 +20,9 @@
  *
  *
  * $Log: debug.c,v $
+ * Revision 1.5  2003/08/24 05:17:58  reinelt
+ * liblcd4linux patch from Patrick Schemitz
+ *
  * Revision 1.4  2003/08/08 06:58:06  reinelt
  * improved forking
  *
 
 #include "debug.h"
 
+int running_foreground = 0;
+int running_background = 0;
+
+int verbose_level = 0;
+
 void message (int level, const char *format, ...)
 {
   va_list ap;
   char buffer[256];
   static int log_open=0;
-  extern int debugging;
-  extern int foreground;
-  extern int background;
 
-  if (level>debugging) return;
+  if (level>verbose_level) return;
 
   va_start(ap, format);
   (void) vsnprintf(buffer, sizeof(buffer), format, ap);
   va_end(ap);
   
-  if (!background) {
+  if (!running_background) {
 #ifdef WITH_TEXT
     extern int curs_err(char *);
     if (!curs_err(buffer))
@@ -81,7 +86,7 @@ void message (int level, const char *format, ...)
       fprintf (level?stdout:stderr, "%s\n", buffer);
   }
   
-  if (foreground)
+  if (running_foreground)
     return;
   
   if (!log_open) {
diff --git a/debug.h b/debug.h
index 9bc452f95e94798ef265a9205016e6ec4a81f81c..c1abd37364e4362cee6f804d8ff5e5496ae798e4 100644 (file)
--- a/debug.h
+++ b/debug.h
@@ -1,4 +1,4 @@
-/* $Id: debug.h,v 1.4 2001/09/12 05:37:22 reinelt Exp $
+/* $Id: debug.h,v 1.5 2003/08/24 05:17:58 reinelt Exp $
  *
  * debug messages
  *
@@ -20,6 +20,9 @@
  *
  *
  * $Log: debug.h,v $
+ * Revision 1.5  2003/08/24 05:17:58  reinelt
+ * liblcd4linux patch from Patrick Schemitz
+ *
  * Revision 1.4  2001/09/12 05:37:22  reinelt
  *
  * fixed a bug in seti.c (file was never closed, lcd4linux run out of fd's
 #ifndef _DEBUG_H_
 #define _DEBUG_H_
 
+extern int running_foreground;
+extern int running_background;
+extern int verbose_level;
+
 void message (int level, const char *format, ...);
 
 #define debug(args...) message (2, __FILE__ ": " args)
index 6896928336addfff730f862058216d235d0f0b9a..294bf8e42e8f7ade62be047bbc86e319def6ae80 100644 (file)
--- a/display.c
+++ b/display.c
@@ -1,4 +1,4 @@
-/* $Id: display.c,v 1.38 2003/08/24 04:31:56 reinelt Exp $
+/* $Id: display.c,v 1.39 2003/08/24 05:17:58 reinelt Exp $
  *
  * framework for device drivers
  *
@@ -20,6 +20,9 @@
  *
  *
  * $Log: display.c,v $
+ * Revision 1.39  2003/08/24 05:17:58  reinelt
+ * liblcd4linux patch from Patrick Schemitz
+ *
  * Revision 1.38  2003/08/24 04:31:56  reinelt
  * icon.c icon.h added
  *
@@ -230,6 +233,11 @@ extern LCD Skeleton[];
 extern LCD XWindow[];
 extern LCD Text[];
 
+// output file for Raster driver
+// has to be defined here because it's referenced
+// even if the raster driver is not included!
+char *output=NULL;
+
 FAMILY Driver[] = {
 #ifdef WITH_BECKMANNEGLE
   { "Beckmann+Egle", BeckmannEgle },
index fa0ddae302d96c859366fae5ffa5e4445012eace..9446e7e40fa776799544594193a5f9ac1b9345e9 100644 (file)
--- a/display.h
+++ b/display.h
@@ -1,4 +1,4 @@
-/* $Id: display.h,v 1.18 2003/08/17 16:37:39 reinelt Exp $
+/* $Id: display.h,v 1.19 2003/08/24 05:17:58 reinelt Exp $
  *
  * framework for device drivers
  *
@@ -20,6 +20,9 @@
  *
  *
  * $Log: display.h,v $
+ * Revision 1.19  2003/08/24 05:17:58  reinelt
+ * liblcd4linux patch from Patrick Schemitz
+ *
  * Revision 1.18  2003/08/17 16:37:39  reinelt
  * more icon framework
  *
@@ -120,6 +123,12 @@ typedef struct {
   LCD *Model;
 } FAMILY;
 
+
+// output file for Raster driver
+// has to be defined here because it's referenced
+// even if the raster driver is not included!
+extern char *output;
+
 int lcd_list  (void);
 int lcd_init  (char *driver);
 int lcd_query (int *rows, int *cols, int *xres, int *yres, int *bars, int *icons, int *gpos);
diff --git a/icon.c b/icon.c
index ee9440b78dc62174e71e5b997b09aa6e29df5e65..fdd9fbab4458ac70e70810d138821265a0e17add 100644 (file)
--- a/icon.c
+++ b/icon.c
@@ -1,4 +1,4 @@
-/* $Id: icon.c,v 1.1 2003/08/24 04:31:56 reinelt Exp $
+/* $Id: icon.c,v 1.2 2003/08/24 05:17:58 reinelt Exp $
  *
  * generic icon and heartbeat handling
  *
@@ -20,6 +20,9 @@
  *
  *
  * $Log: icon.c,v $
+ * Revision 1.2  2003/08/24 05:17:58  reinelt
+ * liblcd4linux patch from Patrick Schemitz
+ *
  * Revision 1.1  2003/08/24 04:31:56  reinelt
  * icon.c icon.h added
  *
 
 
 #include <stdlib.h>
+#include <stdio.h>
 
-#include "icon.h"
 #include "debug.h"
+#include "cfg.h"
+#include "icon.h"
 
 
 static int ROWS=0;
@@ -42,6 +47,7 @@ static int ICONS=0;
 static int *Screen;
 
 
+#if 0
 static int icon_get_bitmap (int num)
 {
   int row, col;
@@ -53,6 +59,7 @@ static int icon_get_bitmap (int num)
     val=cfg_get(key);
   }
 }
+#endif
 
 
 int icon_init (int rows, int cols, int xres, int yres, int icons)
index 91f42a9ba41f13f847a5428c6ec5d76841bb1b5a..f4e5b2886f8335e8b23c814fde2ea1dab5122eb6 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: lcd4linux.c,v 1.43 2003/08/17 16:37:39 reinelt Exp $
+/* $Id: lcd4linux.c,v 1.44 2003/08/24 05:17:58 reinelt Exp $
  *
  * LCD4Linux
  *
@@ -20,6 +20,9 @@
  *
  *
  * $Log: lcd4linux.c,v $
+ * Revision 1.44  2003/08/24 05:17:58  reinelt
+ * liblcd4linux patch from Patrick Schemitz
+ *
  * Revision 1.43  2003/08/17 16:37:39  reinelt
  * more icon framework
  *
 
 char *release="LCD4Linux " VERSION " (c) 2003 Michael Reinelt <reinelt@eunet.at>";
 char **my_argv;
-char *output=NULL;
 int got_signal=0;
-int debugging=0;
-int foreground=0;
-int background=0;
 int tick, tack;
 
+extern char* output;
+
+
 static void usage(void)
 {
   printf ("%s\n", release);
@@ -327,6 +329,9 @@ int main (int argc, char *argv[])
   }
   my_argv[c]=NULL;
 
+  running_foreground=0;
+  running_background=0;
+
 #ifdef USE_OLD_UDELAY
   while ((c=getopt (argc, argv, "c:dFf:hlo:qv"))!=EOF) {
 #else
@@ -348,7 +353,7 @@ int main (int argc, char *argv[])
       exit(1);
 #endif
     case 'F':
-      foreground++;
+      running_foreground++;
       break;
     case 'f':
       cfg=optarg;
@@ -367,7 +372,7 @@ int main (int argc, char *argv[])
       quiet++;
       break;
     case 'v':
-      debugging++;
+      verbose_level++;
       break;
     default:
       exit(2);
@@ -380,26 +385,20 @@ int main (int argc, char *argv[])
   }
 
   info ("Version " VERSION " starting");
-  if (!foreground && (my_argv[0]==NULL || my_argv[0][0]!='/')) {
+  if (!running_foreground && (my_argv[0]==NULL || my_argv[0][0]!='/')) {
     info ("invoked without full path; restart may not work!");
   }
   
-  // set default values
-  cfg_set ("row1", "*** %o %v ***");
-  cfg_set ("row2", "%p CPU  %r MB RAM");
-  cfg_set ("row3", "Busy %cu%% $r10cu");
-  cfg_set ("row4", "Load %l1%L$r10l1");
-
-  if (cfg_read (cfg)==-1)
+  if (cfg_init (cfg)==-1)
     exit (1);
   
   driver=cfg_get("display",NULL);
   if (driver==NULL || *driver=='\0') {
-    error ("missing 'display' entry in %s!", cfg_file());
+    error ("missing 'display' entry in %s!", cfg_source());
     exit (1);
   }
   
-  if (!foreground) {
+  if (!running_foreground) {
     pid_t i;
     int fd;
     debug ("going background...");
@@ -448,7 +447,7 @@ int main (int argc, char *argv[])
     }
 
     // now we are a daemon
-    background=1;
+    running_background=1;
   }
   
   debug ("initializing driver %s", driver);
index b638ceaf469c7ed8fb49525100dd45c40b6fc9c1..5c9956d895e88bd4c9124390e50dcd6b775a2fa9 100644 (file)
--- a/parport.c
+++ b/parport.c
@@ -1,4 +1,4 @@
-/* $Id: parport.c,v 1.6 2003/08/22 03:45:09 reinelt Exp $
+/* $Id: parport.c,v 1.7 2003/08/24 05:17:58 reinelt Exp $
  *
  * generic parallel port handling
  *
@@ -20,6 +20,9 @@
  *
  *
  * $Log: parport.c,v $
+ * Revision 1.7  2003/08/24 05:17:58  reinelt
+ * liblcd4linux patch from Patrick Schemitz
+ *
  * Revision 1.6  2003/08/22 03:45:09  reinelt
  * bug in parallel port code fixed, more icons stuff
  *
@@ -144,11 +147,11 @@ int parport_open (void)
 #ifdef USE_OLD_UDELAY
   s=cfg_get ("Delay",NULL);
   if (s==NULL || *s=='\0') {
-    error ("parport: no 'Delay' entry in %s", cfg_file());
+    error ("parport: no 'Delay' entry in %s", cfg_source());
     return -1;
   }
   if ((loops_per_usec=strtol(s, &e, 0))==0 || *e!='\0') {
-    error ("parport: bad delay '%s' in %s", s, cfg_file());
+    error ("parport: bad delay '%s' in %s", s, cfg_source());
     return -1;
   }    
 #else
@@ -157,7 +160,7 @@ int parport_open (void)
   
   s=cfg_get ("Port",NULL);
   if (s==NULL || *s=='\0') {
-    error ("parport: no 'Port' entry in %s", cfg_file());
+    error ("parport: no 'Port' entry in %s", cfg_source());
     return -1;
   }
   PPdev=NULL;
@@ -166,7 +169,7 @@ int parport_open (void)
     Port=0;
     PPdev=s;
 #else
-    error ("parport: bad Port '%s' in %s", s, cfg_file());
+    error ("parport: bad Port '%s' in %s", s, cfg_source());
     return -1;
 #endif
   }
index ca3f91efc93fc92aa70d8bca48c98023b46f2355..3972485d87320bf0110cb2d905378ea088299ebf 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: processor.c,v 1.36 2003/08/17 16:37:39 reinelt Exp $
+/* $Id: processor.c,v 1.37 2003/08/24 05:17:58 reinelt Exp $
  *
  * main data processing
  *
@@ -20,6 +20,9 @@
  *
  *
  * $Log: processor.c,v $
+ * Revision 1.37  2003/08/24 05:17:58  reinelt
+ * liblcd4linux patch from Patrick Schemitz
+ *
  * Revision 1.36  2003/08/17 16:37:39  reinelt
  * more icon framework
  *
@@ -751,7 +754,7 @@ void process_init (void)
 
   lines=atoi(cfg_get("Rows","1"));
   if (lines<1) {
-    error ("bad 'Rows' entry in %s, ignoring.", cfg_file());
+    error ("bad 'Rows' entry in %s, ignoring.", cfg_source());
     lines=1;
   }
   if (lines>ROWS) {
@@ -761,16 +764,16 @@ void process_init (void)
   if (lines>rows) {
     scroll=atoi(cfg_get("Scroll","1"));
     if (scroll<1) {
-      error ("bad 'Scroll' entry in %s, ignoring and using '1'", cfg_file());
+      error ("bad 'Scroll' entry in %s, ignoring and using '1'", cfg_source());
       scroll=1;
     }
     if (scroll>rows) {
-      error ("'Scroll' entry in %s is %d, > %d display rows.", cfg_file(), scroll, rows);
+      error ("'Scroll' entry in %s is %d, > %d display rows.", cfg_source(), scroll, rows);
       error ("This may lead to unexpected results!");
     }
     turn=atoi(cfg_get("Turn","1000"));
     if (turn<1) {
-      error ("bad 'Turn' entry in %s, ignoring and using '1000'", cfg_file());
+      error ("bad 'Turn' entry in %s, ignoring and using '1000'", cfg_source());
       turn=1;
     }
     debug ("Virtual: %d rows, scroll %d lines every %d msec", lines, scroll, turn);
diff --git a/seti.c b/seti.c
index ede4b5e3e947a2f43935ccca83fc4f096bd79cd9..6743e6ece738d1c7d075c1c5c905d08483d16266 100644 (file)
--- a/seti.c
+++ b/seti.c
@@ -1,4 +1,4 @@
-/* $Id: seti.c,v 1.8 2003/06/13 05:11:11 reinelt Exp $
+/* $Id: seti.c,v 1.9 2003/08/24 05:17:58 reinelt Exp $
  *
  * seti@home specific functions
  *
@@ -20,6 +20,9 @@
  *
  *
  * $Log: seti.c,v $
+ * Revision 1.9  2003/08/24 05:17:58  reinelt
+ * liblcd4linux patch from Patrick Schemitz
+ *
  * Revision 1.8  2003/06/13 05:11:11  reinelt
  * error message cosmetics
  *
@@ -102,12 +105,12 @@ int Seti (double *perc, double *cput)
   if (fd==-2) {
     char *dir=cfg_get("SetiDir",NULL);
     if (dir==NULL || *dir=='\0') {
-      error ("no 'SetiDir' entry in %s!\n", cfg_file());
+      error ("no 'SetiDir' entry in %s!\n", cfg_source());
       fd=-1;
       return -1;
     }
     if (strlen(dir)>sizeof(fn)-sizeof(STATEFILE)-2) {
-      error ("entry 'SetiDir' too long in %s!\n", cfg_file());
+      error ("entry 'SetiDir' too long in %s!\n", cfg_source());
       fd=-1;
       return -1;
     }
index 6a47e7e1fc2b9cd74fa9b5aa4f68cd9650701a94..2b075c917c13eb3d189b25b373e952459b7fb26b 100644 (file)
--- a/system.c
+++ b/system.c
@@ -1,4 +1,4 @@
-/* $Id: system.c,v 1.28 2003/06/26 05:31:16 reinelt Exp $
+/* $Id: system.c,v 1.29 2003/08/24 05:17:58 reinelt Exp $
  *
  * system status retreivement
  *
@@ -20,6 +20,9 @@
  *
  *
  * $Log: system.c,v $
+ * Revision 1.29  2003/08/24 05:17:58  reinelt
+ * liblcd4linux patch from Patrick Schemitz
+ *
  * Revision 1.28  2003/06/26 05:31:16  reinelt
  * bug in /proc/net/dev parsing fixed
  *
@@ -774,7 +777,7 @@ int Sensor (int index, double *val, double *min, double *max)
     snprintf(buffer, 32, "Sensor%d", index);
     sensor[index]=cfg_get(buffer, NULL);
     if (sensor[index]==NULL || *sensor[index]=='\0') {
-      error ("no entry for '%s' in %s", buffer, cfg_file());
+      error ("no entry for '%s' in %s", buffer, cfg_source());
       fd[index]=-1;
       return -1;
     }