aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Makefile.am3
-rw-r--r--Makefile.in12
-rw-r--r--README15
-rw-r--r--README.Drivers24
-rw-r--r--README.Text31
-rw-r--r--Skeleton.c13
-rw-r--r--Text.c209
-rwxr-xr-xconfigure133
-rw-r--r--configure.in8
-rw-r--r--debug.c9
-rw-r--r--display.c9
-rw-r--r--lcd4linux.conf.sample4
12 files changed, 384 insertions, 86 deletions
diff --git a/Makefile.am b/Makefile.am
index c9186b7..844adfc 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -39,7 +39,8 @@ PNG.c \
PPM.c \
SIN.c \
Skeleton.c \
-XWindow.c
+XWindow.c \
+Text.c
EXTRA_DIST = \
lcd4linux.conf.sample \
diff --git a/Makefile.in b/Makefile.in
index 3ab5e2e..87183e1 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -79,7 +79,7 @@ lcd4linux_DEPENDENCIES = @DRIVERS@
lcd4linux_SOURCES = lcd4linux.c debug.c debug.h cfg.c cfg.h lock.c lock.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 filter.c filter.h udelay.c udelay.h display.c display.h pixmap.c pixmap.h fontmap.c fontmap.h exec.c exec.h
-EXTRA_lcd4linux_SOURCES = BeckmannEgle.c Crystalfontz.c Crystalfontz.h HD44780.c MatrixOrbital.c PalmPilot.c PNG.c PPM.c SIN.c Skeleton.c XWindow.c
+EXTRA_lcd4linux_SOURCES = BeckmannEgle.c Crystalfontz.c Crystalfontz.h HD44780.c MatrixOrbital.c PalmPilot.c PNG.c PPM.c SIN.c Skeleton.c XWindow.c Text.c
EXTRA_DIST = lcd4linux.conf.sample lcd4kde.conf lcd4linux.kdelnk lcd4linux.xpm lcd4linux.lsm CREDITS FAQ TODO README.Drivers README.MatrixOrbital README.HD44780 README.Crystalfontz README.X11 README.KDE README.Raster README.Png
@@ -115,11 +115,11 @@ TAR = tar
GZIP_ENV = --best
DEP_FILES = .deps/BeckmannEgle.P .deps/Crystalfontz.P .deps/HD44780.P \
.deps/MatrixOrbital.P .deps/PNG.P .deps/PPM.P .deps/PalmPilot.P \
-.deps/SIN.P .deps/Skeleton.P .deps/XWindow.P .deps/battery.P \
-.deps/cfg.P .deps/debug.P .deps/display.P .deps/exec.P .deps/filter.P \
-.deps/fontmap.P .deps/isdn.P .deps/lcd4linux.P .deps/lock.P \
-.deps/mail.P .deps/parser.P .deps/pixmap.P .deps/processor.P \
-.deps/seti.P .deps/system.P .deps/udelay.P
+.deps/SIN.P .deps/Skeleton.P .deps/Text.P .deps/XWindow.P \
+.deps/battery.P .deps/cfg.P .deps/debug.P .deps/display.P .deps/exec.P \
+.deps/filter.P .deps/fontmap.P .deps/isdn.P .deps/lcd4linux.P \
+.deps/lock.P .deps/mail.P .deps/parser.P .deps/pixmap.P \
+.deps/processor.P .deps/seti.P .deps/system.P .deps/udelay.P
SOURCES = $(lcd4linux_SOURCES) $(EXTRA_lcd4linux_SOURCES)
OBJECTS = $(lcd4linux_OBJECTS)
diff --git a/README b/README
index 4d014ce..0ce7f46 100644
--- a/README
+++ b/README
@@ -1,5 +1,5 @@
#
-# $Id: README,v 1.14 2001/03/08 15:25:38 ltoetsch Exp $
+# $Id: README,v 1.15 2001/03/09 13:08:11 ltoetsch Exp $
#
This is the README file for lcd4linux
@@ -8,7 +8,8 @@ This is the README file for lcd4linux
INTRODUCTION
lcd4linux is a small program that reads various information from the kernel
-(and probably from other subsystems, especially ISDN) and displays them on a LCD.
+(and probably from other subsystems, especially ISDN) and displays them on a
+LCD.
It supports displaying text values and different types of bars: Horizontal and
vertical bars, logarithmic bars, split bars (two independent bars in one row).
@@ -34,6 +35,14 @@ lcd4linux [-c key=val] [-F] [-f config-file] [-o output] [-q] [-v]
suppress startup splash screen with '-q'
generate info messages with '-v'
generate debugging messages with '-vv'
+
+DIAGNOSTICS
+
+ lcd4linux on foreground writes (depending on level) to stdout or stderr.
+ The Text-Driver has ist's own diagnostics window.
+
+ Started in the background (the default), lcd4linux uses your syslog daemon
+ for logging. Facility is USER, levels are ERR, INFO and DEBUG.
SUPPORTED DISPLAYS
@@ -78,6 +87,8 @@ SUPPORTED DISPLAYS
PPM (portable pixmap)
PNG (with libgd)
+* Text:
+ This is a ncurses based text driver, mainly intended for debugging.
* other displays: lcd4linux and especially the display driver code is very
modular, so it should be quite easy to write a driver for any display. See
diff --git a/README.Drivers b/README.Drivers
index 1e8ce49..98628ec 100644
--- a/README.Drivers
+++ b/README.Drivers
@@ -1,5 +1,5 @@
#
-# $Id: README.Drivers,v 1.3 2000/05/21 06:20:35 reinelt Exp $
+# $Id: README.Drivers,v 1.4 2001/03/09 13:08:11 ltoetsch Exp $
#
How to write new display drivers for lcd4linux
@@ -7,9 +7,13 @@ How to write new display drivers for lcd4linux
If you plan to write a new display driver for lcd4linux, you should follow
this guidelines:
-* use Skeleton.c as a start point
+* use Skeleton.c as a start point.
+ You might also have a look at Text.c
-* create a new sourcefile <drivername>.c and add it to the bottom of Makefile.am
+* create a new sourcefile <drivername>.c and add it to the bottom of
+ Makefile.am
+
+* add an entry to configure.in
* there's no need for a <drivername>.h
@@ -45,10 +49,10 @@ this guidelines:
{ "" }
};
-* write the correspondig init(), clear(), put(), bar() and flush()-functions.
- There's no need to use a framebuffer and display its contents with the flush()-
- call (as in MatrixOrbital.c), you can directly write to the display in the put()-
- and bar()-functions, and use an empty flush()-function. But if you have a limited
- number of user-defined characters, and therefore you have to do some sort of
- 'character reduction' or similar stuff, you will have to use a framebuffer and
- the flush()-call.
+* write the correspondig init(), clear(), put(), bar(), quit() and
+ flush()-functions. There's no need to use a framebuffer and display its
+ contents with the flush()- call (as in MatrixOrbital.c), you can directly
+ write to the display in the put()- and bar()-functions, and use an empty
+ flush()-function. But if you have a limited number of user-defined
+ characters, and therefore you have to do some sort of 'character reduction'
+ or similar stuff, you will have to use a framebuffer and the flush()-call.
diff --git a/README.Text b/README.Text
new file mode 100644
index 0000000..77d419d
--- /dev/null
+++ b/README.Text
@@ -0,0 +1,31 @@
+#
+# $Id: README.Text,v 1.1 2001/03/09 13:08:11 ltoetsch Exp $
+#
+
+This is the README file for the Text display driver for lcd4linux.
+
+This driver is mainly for debugging purposes.
+It needs ncurses for display.
+
+The driver understands the following options:
+
+Display: must be "Text"
+size: [columns]x[rows], e.g. "20x4"
+TextBar: if this is set, Bars display the values max, len1 and len2.
+
+Of course, lcd4linux should be started in the foreground with this driver.
+The driver shows also a window with lcd4linux's diagnostics.
+
+Example:
+./lcd4linux -q -vv -F -cDisplay=Text -ctick=1000 -ctack=1000
+
+
+BUGS:
+- A resize of the term window messes up the display.
+- Vertical bars are not supported.
+- BAR_L is ignored.
+
+Have fun
+ -lt
+
+
diff --git a/Skeleton.c b/Skeleton.c
index eada5cf..c37124b 100644
--- a/Skeleton.c
+++ b/Skeleton.c
@@ -1,4 +1,4 @@
-/* $Id: Skeleton.c,v 1.6 2001/02/13 09:00:13 reinelt Exp $
+/* $Id: Skeleton.c,v 1.7 2001/03/09 13:08:11 ltoetsch Exp $
*
* skeleton driver for new display modules
*
@@ -20,6 +20,9 @@
*
*
* $Log: Skeleton.c,v $
+ * Revision 1.7 2001/03/09 13:08:11 ltoetsch
+ * Added Text driver
+ *
* Revision 1.6 2001/02/13 09:00:13 reinelt
*
* prepared framework for GPO's (general purpose outputs)
@@ -104,8 +107,14 @@ int Skel_flush (void)
return 0;
}
+int Skel_quit (void)
+{
+ info("Skeleton: we shut down now.");
+ return 0;
+}
+
LCD Skeleton[] = {
- { "Skeleton",4,20,5,8,BAR_L|BAR_R,0,Skel_init,Skel_clear,Skel_put,Skel_bar,Skel_gpo,Skel_flush },
+ { "Skeleton",4,20,5,8,BAR_L|BAR_R,0,Skel_init,Skel_clear,Skel_put,Skel_bar,Skel_gpo,Skel_flush, Skel_quit },
{ NULL }
};
diff --git a/Text.c b/Text.c
new file mode 100644
index 0000000..f20efba
--- /dev/null
+++ b/Text.c
@@ -0,0 +1,209 @@
+/* $Id: Text.c,v 1.1 2001/03/09 13:08:11 ltoetsch Exp $
+ *
+ * pure ncurses based text driver
+ *
+ * Copyright 2001 by Leopold Tötsch (lt@toetsch.at)
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ *
+ * $Log: Text.c,v $
+ * Revision 1.1 2001/03/09 13:08:11 ltoetsch
+ * Added Text driver
+ *
+ *
+ */
+
+/*
+ *
+ * exported fuctions:
+ *
+ * struct LCD Text[]
+ *
+ */
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <curses.h>
+
+#ifdef STANDALONE
+
+int main(int argc, char *argv[])
+{
+ WINDOW *w;
+ int x,y;
+
+ w = initscr();
+
+ for (x=0; x < 255; x++)
+ addch(acs_map[x]);
+ refresh();
+ sleep(5);
+ endwin();
+ return 0;
+
+}
+
+#else
+
+#include <string.h>
+#include "debug.h"
+#include "cfg.h"
+#include "display.h"
+extern int foreground;
+
+static LCD Lcd;
+static WINDOW *w;
+WINDOW *err_win;
+#define BARS ( BAR_R | BAR_H2 )
+int err_rows;
+
+int Text_clear (void)
+{
+ werase(w);
+ box(w, 0, 0);
+ return 0;
+}
+
+int Text_quit(void) {
+ endwin();
+ return 0;
+}
+
+int Text_init (LCD *Self)
+{
+ int cols=-1, rows=-1;
+ int scr_cols, scr_rows;
+ char *s;
+ if (!foreground) {
+ error("Text: you want me to display on /dev/null: sorry, I can't");
+ return -1;
+ }
+
+ if (sscanf(s=cfg_get("size")?:"20x4", "%dx%d", &cols, &rows)!=2 || rows<1 || cols<1) {
+ error ("Raster: bad size '%s'", s);
+ return -1;
+ }
+ Self->rows=rows;
+ Self->cols=cols;
+ Self->xres=1;
+ Self->yres=1;
+ Lcd=*Self;
+
+ w = initscr();
+ scr_cols=COLS;
+ scr_rows=LINES;
+ delwin(w);
+ w = newwin(rows+2,cols+2,0,0);
+ err_rows = scr_rows-rows-3;
+ if (err_rows >= 4) {
+ err_win = newwin(err_rows, scr_cols, rows+3, 0);
+ err_rows -= 3;
+ box(err_win, 0, 0);
+ mvwprintw(err_win,0,3, "Stderr:");
+ wmove(err_win, 1 , 0);
+ wrefresh(err_win);
+ }
+ Text_clear();
+ return w ? 0 : -1;
+}
+
+/* ncures scroll SIGSEGVs on my system, so this is a workaroud */
+
+int curs_err(char *buffer)
+{
+ static int lines;
+ static char *lb[100];
+ int start, i;
+
+ if (err_win) {
+ if (lines >= err_rows) {
+ free(lb[0]);
+ for (i=1; i<=err_rows; i++)
+ lb[i-1] = lb[i];
+ start = 0;
+ }
+ else
+ start = lines;
+ lb[lines] = strdup(buffer);
+ for (i=start; i<=lines; i++) {
+ mvwprintw(err_win,i+1,1, "%s", lb[i]);
+ wclrtoeol(err_win);
+ }
+ box(err_win, 0, 0);
+ mvwprintw(err_win,0,3, "Stderr:");
+ wrefresh(err_win);
+ if (lines < err_rows)
+ lines++;
+ return 1;
+ }
+ return 0;
+}
+
+int Text_put (int row, int col, char *text)
+{
+ if (col < Lcd.cols)
+ mvwprintw(w, row+1 , col+1, "%.*s", Lcd.cols-col, text);
+ return 0;
+}
+
+#define min(x,y) (x)<(y)?x:y
+int Text_bar (int type, int row, int col, int max, int len1, int len2)
+{
+ int len, i;
+ if (cfg_get("TextBar"))
+ mvwprintw(w, row+1 , col+1, "%d %d %d", max, len1, len2);
+ else {
+ len = min(len1, len2);
+ len = min(len, Lcd.cols-col-1);
+ if (len) {
+ wmove(w, row+1 , col+1);
+ for (i=0; i<len;i++)
+ waddch(w,ACS_BLOCK);
+ }
+ col += len;
+ len1 -= len;
+ len2 -= len;
+ len1 = min(len1, Lcd.cols-col-1);
+ for (i=0; i<len1;i++)
+ waddch(w,ACS_S1);
+ len2 = min(len2, Lcd.cols-col-1);
+ for (i=0; i<len2;i++)
+ waddch(w,ACS_S9);
+ }
+
+ return 0;
+}
+
+int Text_gpo (int num, int val)
+{
+ return 0;
+}
+
+int Text_flush (void)
+{
+ box(w, 0, 0);
+ wrefresh(w);
+ return 0;
+}
+
+
+LCD Text[] = {
+ { "Text",4,20,1,1,BARS,0,
+ Text_init,Text_clear,Text_put,Text_bar,0,Text_flush,Text_quit },
+ { NULL }
+};
+
+#endif
diff --git a/configure b/configure
index 3181489..4138c51 100755
--- a/configure
+++ b/configure
@@ -2102,7 +2102,8 @@ else
fi
if test "$drivers" = "all"; then
- drivers=BeckmannEgle,CrystalFontz,HD44780,MatrixOrbital,PalmPilot,PNG,PPM,X11
+
+drivers=BeckmannEgle,CrystalFontz,HD44780,MatrixOrbital,PalmPilot,PNG,PPM,X11,Text
fi
drivers=`echo $drivers|sed 's/,/ /g'`
for driver in $drivers; do
@@ -2179,6 +2180,14 @@ EOF
EOF
;;
+ Text)
+ DRIVERS="$DRIVERS Text.o"
+ DRVLIBS="$DRVLIBS -lncurses"
+ cat >> confdefs.h <<\EOF
+#define WITH_Text 1
+EOF
+
+ ;;
*)
{ echo "configure: error: Unknown driver '$driver'" 1>&2; exit 1; }
;;
@@ -2191,12 +2200,12 @@ DRIVERS="$DRIVERS $RASTER"
echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:2195: checking for ANSI C header files" >&5
+echo "configure:2204: checking for ANSI C header files" >&5
if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2200 "configure"
+#line 2209 "configure"
#include "confdefs.h"
#include <stdlib.h>
#include <stdarg.h>
@@ -2204,7 +2213,7 @@ else
#include <float.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2208: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2217: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -2221,7 +2230,7 @@ rm -f conftest*
if test $ac_cv_header_stdc = yes; then
# SunOS 4.x string.h does not declare mem*, contrary to ANSI.
cat > conftest.$ac_ext <<EOF
-#line 2225 "configure"
+#line 2234 "configure"
#include "confdefs.h"
#include <string.h>
EOF
@@ -2239,7 +2248,7 @@ fi
if test $ac_cv_header_stdc = yes; then
# ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
cat > conftest.$ac_ext <<EOF
-#line 2243 "configure"
+#line 2252 "configure"
#include "confdefs.h"
#include <stdlib.h>
EOF
@@ -2260,7 +2269,7 @@ if test "$cross_compiling" = yes; then
:
else
cat > conftest.$ac_ext <<EOF
-#line 2264 "configure"
+#line 2273 "configure"
#include "confdefs.h"
#include <ctype.h>
#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
@@ -2271,7 +2280,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
exit (0); }
EOF
-if { (eval echo configure:2275: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:2284: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
:
else
@@ -2299,12 +2308,12 @@ for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6
-echo "configure:2303: checking for $ac_hdr that defines DIR" >&5
+echo "configure:2312: checking for $ac_hdr that defines DIR" >&5
if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2308 "configure"
+#line 2317 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <$ac_hdr>
@@ -2312,7 +2321,7 @@ int main() {
DIR *dirp = 0;
; return 0; }
EOF
-if { (eval echo configure:2316: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2325: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
eval "ac_cv_header_dirent_$ac_safe=yes"
else
@@ -2337,7 +2346,7 @@ done
# Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
if test $ac_header_dirent = dirent.h; then
echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6
-echo "configure:2341: checking for opendir in -ldir" >&5
+echo "configure:2350: checking for opendir in -ldir" >&5
ac_lib_var=`echo dir'_'opendir | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -2345,7 +2354,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-ldir $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 2349 "configure"
+#line 2358 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -2356,7 +2365,7 @@ int main() {
opendir()
; return 0; }
EOF
-if { (eval echo configure:2360: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2369: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -2378,7 +2387,7 @@ fi
else
echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6
-echo "configure:2382: checking for opendir in -lx" >&5
+echo "configure:2391: checking for opendir in -lx" >&5
ac_lib_var=`echo x'_'opendir | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -2386,7 +2395,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lx $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 2390 "configure"
+#line 2399 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -2397,7 +2406,7 @@ int main() {
opendir()
; return 0; }
EOF
-if { (eval echo configure:2401: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2410: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -2420,12 +2429,12 @@ fi
fi
echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6
-echo "configure:2424: checking for sys/wait.h that is POSIX.1 compatible" >&5
+echo "configure:2433: checking for sys/wait.h that is POSIX.1 compatible" >&5
if eval "test \"`echo '$''{'ac_cv_header_sys_wait_h'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2429 "configure"
+#line 2438 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/wait.h>
@@ -2441,7 +2450,7 @@ wait (&s);
s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
; return 0; }
EOF
-if { (eval echo configure:2445: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2454: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_header_sys_wait_h=yes
else
@@ -2465,17 +2474,17 @@ for ac_hdr in fcntl.h limits.h strings.h sys/ioctl.h sys/time.h syslog.h unistd.
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2469: checking for $ac_hdr" >&5
+echo "configure:2478: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2474 "configure"
+#line 2483 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2479: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2488: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -2505,17 +2514,17 @@ for ac_hdr in sys/io.h asm/io.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2509: checking for $ac_hdr" >&5
+echo "configure:2518: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2514 "configure"
+#line 2523 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2519: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2528: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -2545,17 +2554,17 @@ for ac_hdr in gd/gd.h gd.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2549: checking for $ac_hdr" >&5
+echo "configure:2558: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2554 "configure"
+#line 2563 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2559: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2568: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -2585,17 +2594,17 @@ for ac_hdr in net/if_ppp.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2589: checking for $ac_hdr" >&5
+echo "configure:2598: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2594 "configure"
+#line 2603 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2599: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2608: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -2623,12 +2632,12 @@ done
echo $ac_n "checking for working const""... $ac_c" 1>&6
-echo "configure:2627: checking for working const" >&5
+echo "configure:2636: checking for working const" >&5
if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2632 "configure"
+#line 2641 "configure"
#include "confdefs.h"
int main() {
@@ -2677,7 +2686,7 @@ ccp = (char const *const *) p;
; return 0; }
EOF
-if { (eval echo configure:2681: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2690: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_c_const=yes
else
@@ -2698,21 +2707,21 @@ EOF
fi
echo $ac_n "checking for inline""... $ac_c" 1>&6
-echo "configure:2702: checking for inline" >&5
+echo "configure:2711: checking for inline" >&5
if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_cv_c_inline=no
for ac_kw in inline __inline__ __inline; do
cat > conftest.$ac_ext <<EOF
-#line 2709 "configure"
+#line 2718 "configure"
#include "confdefs.h"
int main() {
} $ac_kw foo() {
; return 0; }
EOF
-if { (eval echo configure:2716: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2725: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_c_inline=$ac_kw; break
else
@@ -2738,12 +2747,12 @@ EOF
esac
echo $ac_n "checking for pid_t""... $ac_c" 1>&6
-echo "configure:2742: checking for pid_t" >&5
+echo "configure:2751: checking for pid_t" >&5
if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2747 "configure"
+#line 2756 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
@@ -2771,12 +2780,12 @@ EOF
fi
echo $ac_n "checking for size_t""... $ac_c" 1>&6
-echo "configure:2775: checking for size_t" >&5
+echo "configure:2784: checking for size_t" >&5
if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2780 "configure"
+#line 2789 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
@@ -2804,12 +2813,12 @@ EOF
fi
echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
-echo "configure:2808: checking whether time.h and sys/time.h may both be included" >&5
+echo "configure:2817: checking whether time.h and sys/time.h may both be included" >&5
if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2813 "configure"
+#line 2822 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/time.h>
@@ -2818,7 +2827,7 @@ int main() {
struct tm *tp;
; return 0; }
EOF
-if { (eval echo configure:2822: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2831: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_header_time=yes
else
@@ -2839,12 +2848,12 @@ EOF
fi
echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6
-echo "configure:2843: checking whether struct tm is in sys/time.h or time.h" >&5
+echo "configure:2852: checking whether struct tm is in sys/time.h or time.h" >&5
if eval "test \"`echo '$''{'ac_cv_struct_tm'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2848 "configure"
+#line 2857 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <time.h>
@@ -2852,7 +2861,7 @@ int main() {
struct tm *tp; tp->tm_sec;
; return 0; }
EOF
-if { (eval echo configure:2856: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2865: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_struct_tm=time.h
else
@@ -2873,12 +2882,12 @@ EOF
fi
echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6
-echo "configure:2877: checking for uid_t in sys/types.h" >&5
+echo "configure:2886: checking for uid_t in sys/types.h" >&5
if eval "test \"`echo '$''{'ac_cv_type_uid_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2882 "configure"
+#line 2891 "configure"
#include "confdefs.h"
#include <sys/types.h>
EOF
@@ -2909,13 +2918,13 @@ fi
if test $ac_cv_prog_gcc = yes; then
echo $ac_n "checking whether ${CC-cc} needs -traditional""... $ac_c" 1>&6
-echo "configure:2913: checking whether ${CC-cc} needs -traditional" >&5
+echo "configure:2922: checking whether ${CC-cc} needs -traditional" >&5
if eval "test \"`echo '$''{'ac_cv_prog_gcc_traditional'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_pattern="Autoconf.*'x'"
cat > conftest.$ac_ext <<EOF
-#line 2919 "configure"
+#line 2928 "configure"
#include "confdefs.h"
#include <sgtty.h>
Autoconf TIOCGETP
@@ -2933,7 +2942,7 @@ rm -f conftest*
if test $ac_cv_prog_gcc_traditional = no; then
cat > conftest.$ac_ext <<EOF
-#line 2937 "configure"
+#line 2946 "configure"
#include "confdefs.h"
#include <termio.h>
Autoconf TCGETA
@@ -2955,7 +2964,7 @@ echo "$ac_t""$ac_cv_prog_gcc_traditional" 1>&6
fi
echo $ac_n "checking for 8-bit clean memcmp""... $ac_c" 1>&6
-echo "configure:2959: checking for 8-bit clean memcmp" >&5
+echo "configure:2968: checking for 8-bit clean memcmp" >&5
if eval "test \"`echo '$''{'ac_cv_func_memcmp_clean'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2963,7 +2972,7 @@ else
ac_cv_func_memcmp_clean=no
else
cat > conftest.$ac_ext <<EOF
-#line 2967 "configure"
+#line 2976 "configure"
#include "confdefs.h"
main()
@@ -2973,7 +2982,7 @@ main()
}
EOF
-if { (eval echo configure:2977: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:2986: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_func_memcmp_clean=yes
else
@@ -2991,12 +3000,12 @@ echo "$ac_t""$ac_cv_func_memcmp_clean" 1>&6
test $ac_cv_func_memcmp_clean = no && LIBOBJS="$LIBOBJS memcmp.${ac_objext}"
echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
-echo "configure:2995: checking return type of signal handlers" >&5
+echo "configure:3004: checking return type of signal handlers" >&5
if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3000 "configure"
+#line 3009 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <signal.h>
@@ -3013,7 +3022,7 @@ int main() {
int i;
; return 0; }
EOF
-if { (eval echo configure:3017: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3026: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_type_signal=void
else
@@ -3034,12 +3043,12 @@ EOF
for ac_func in gettimeofday select socket strdup strerror strstr strtol uname
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3038: checking for $ac_func" >&5
+echo "configure:3047: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3043 "configure"
+#line 3052 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -3063,7 +3072,7 @@ f = $ac_func;
; return 0; }
EOF
-if { (eval echo configure:3067: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3076: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
diff --git a/configure.in b/configure.in
index b6e7a27..04a545e 100644
--- a/configure.in
+++ b/configure.in
@@ -27,7 +27,8 @@ AC_ARG_WITH(
drivers=all
)
if test "$drivers" = "all"; then
- drivers=[BeckmannEgle,CrystalFontz,HD44780,MatrixOrbital,PalmPilot,PNG,PPM,X11]
+
+drivers=[BeckmannEgle,CrystalFontz,HD44780,MatrixOrbital,PalmPilot,PNG,PPM,X11,Text]
fi
drivers=`echo $drivers|sed 's/,/ /g'`
for driver in $drivers; do
@@ -74,6 +75,11 @@ for driver in $drivers; do
DRVLIBS="$DRVLIBS -lX11"
AC_DEFINE(WITH_X11)
;;
+ Text)
+ DRIVERS="$DRIVERS Text.o"
+ DRVLIBS="$DRVLIBS -lncurses"
+ AC_DEFINE(WITH_Text)
+ ;;
*)
AC_MSG_ERROR([Unknown driver '$driver'])
;;
diff --git a/debug.c b/debug.c
index 56f3684..e5f99eb 100644
--- a/debug.c
+++ b/debug.c
@@ -1,4 +1,4 @@
-/* $Id: debug.c,v 1.1 2000/11/28 20:20:38 reinelt Exp $
+/* $Id: debug.c,v 1.2 2001/03/09 13:08:11 ltoetsch Exp $
*
* debug() and error() functions
*
@@ -20,6 +20,9 @@
*
*
* $Log: debug.c,v $
+ * Revision 1.2 2001/03/09 13:08:11 ltoetsch
+ * Added Text driver
+ *
* Revision 1.1 2000/11/28 20:20:38 reinelt
*
* added debug.c
@@ -62,6 +65,10 @@ void message (int level, const char *format, ...)
va_end(ap);
if (foreground) {
+#ifdef WITH_Text
+ extern int curs_err(char *);
+ if (!curs_err(buffer))
+#endif
fprintf (level?stdout:stderr, "%s\n", buffer);
return;
}
diff --git a/display.c b/display.c
index 4ead6b8..4f0207e 100644
--- a/display.c
+++ b/display.c
@@ -1,4 +1,4 @@
-/* $Id: display.c,v 1.24 2001/03/01 11:08:16 reinelt Exp $
+/* $Id: display.c,v 1.25 2001/03/09 13:08:11 ltoetsch Exp $
*
* framework for device drivers
*
@@ -20,6 +20,9 @@
*
*
* $Log: display.c,v $
+ * Revision 1.25 2001/03/09 13:08:11 ltoetsch
+ * Added Text driver
+ *
* Revision 1.24 2001/03/01 11:08:16 reinelt
*
* reworked configure to allow selection of drivers
@@ -176,6 +179,7 @@ extern LCD Raster[];
extern LCD SIN[];
extern LCD Skeleton[];
extern LCD XWindow[];
+extern LCD Text[];
FAMILY Driver[] = {
#ifdef WITH_BECKMANNEGLE
@@ -205,6 +209,9 @@ FAMILY Driver[] = {
#ifdef WITH_X11
{ "X Window System", XWindow },
#endif
+#ifdef WITH_Text
+ { "X Ncurses Text", Text },
+#endif
{ NULL }
};
diff --git a/lcd4linux.conf.sample b/lcd4linux.conf.sample
index 1e7283f..5c9a2b2 100644
--- a/lcd4linux.conf.sample
+++ b/lcd4linux.conf.sample
@@ -51,6 +51,10 @@ background \#80d000
#halfground \#90c000
#background \#a0d000
+#Display Text
+#size 40x8
+#TextBar 1
+
#Display SIN
#Port /dev/tty9