-/* $Id: BeckmannEgle.c,v 1.19 2004/01/29 04:40:02 reinelt Exp $
+/* $Id: BeckmannEgle.c,v 1.20 2004/01/30 20:57:55 reinelt Exp $
*
* driver for Beckmann+Egle mini terminals
*
*
*
* $Log: BeckmannEgle.c,v $
+ * Revision 1.20 2004/01/30 20:57:55 reinelt
+ * HD44780 patch from Martin Hejl
+ * dmalloc integrated
+ *
* Revision 1.19 2004/01/29 04:40:02 reinelt
* every .c file includes "config.h" now
*
#include "bar.h"
#include "icon.h"
+#ifdef WITH_DMALLOC
+#include <dmalloc.h>
+#endif
+
#define XRES 5
#define YRES 8
#define CHARS 8
-/* $Id: Crystalfontz.c,v 1.19 2004/01/29 04:40:02 reinelt Exp $
+/* $Id: Crystalfontz.c,v 1.20 2004/01/30 20:57:55 reinelt Exp $
*
* driver for display modules from Crystalfontz
*
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
* $Log: Crystalfontz.c,v $
+ * Revision 1.20 2004/01/30 20:57:55 reinelt
+ * HD44780 patch from Martin Hejl
+ * dmalloc integrated
+ *
* Revision 1.19 2004/01/29 04:40:02 reinelt
* every .c file includes "config.h" now
*
#include "bar.h"
#include "icon.h"
+#ifdef WITH_DMALLOC
+#include <dmalloc.h>
+#endif
+
#define XRES 6
#define YRES 8
#define CHARS 8
-/* $Id: Cwlinux.c,v 1.18 2004/01/29 04:40:02 reinelt Exp $
+/* $Id: Cwlinux.c,v 1.19 2004/01/30 20:57:55 reinelt Exp $
*
* driver for Cwlinux serial display modules
*
*
*
* $Log: Cwlinux.c,v $
+ * Revision 1.19 2004/01/30 20:57:55 reinelt
+ * HD44780 patch from Martin Hejl
+ * dmalloc integrated
+ *
* Revision 1.18 2004/01/29 04:40:02 reinelt
* every .c file includes "config.h" now
*
#include "bar.h"
#include "icon.h"
+#ifdef WITH_DMALLOC
+#include <dmalloc.h>
+#endif
+
#define CHARS 8
static LCD Lcd;
-/* $Id: HD44780.c,v 1.49 2004/01/09 04:16:06 reinelt Exp $
+/* $Id: HD44780.c,v 1.50 2004/01/30 20:57:55 reinelt Exp $
*
* driver for display modules based on the HD44780 chip
*
*
*
* $Log: HD44780.c,v $
+ * Revision 1.50 2004/01/30 20:57:55 reinelt
+ * HD44780 patch from Martin Hejl
+ * dmalloc integrated
+ *
* Revision 1.49 2004/01/09 04:16:06 reinelt
* added 'section' argument to cfg_get(), but NULLed it on all calls by now.
*
#include "parport.h"
#include "udelay.h"
+#ifdef WITH_DMALLOC
+#include <dmalloc.h>
+#endif
+
#define XRES 5
#define YRES 8
#define CHARS 8
-/* $Id: M50530.c,v 1.17 2004/01/09 04:16:06 reinelt Exp $
+/* $Id: M50530.c,v 1.18 2004/01/30 20:57:55 reinelt Exp $
*
* driver for display modules based on the M50530 chip
*
*
*
* $Log: M50530.c,v $
+ * Revision 1.18 2004/01/30 20:57:55 reinelt
+ * HD44780 patch from Martin Hejl
+ * dmalloc integrated
+ *
* Revision 1.17 2004/01/09 04:16:06 reinelt
* added 'section' argument to cfg_get(), but NULLed it on all calls by now.
*
#include "parport.h"
#include "udelay.h"
+#ifdef WITH_DMALLOC
+#include <dmalloc.h>
+#endif
+
#define XRES 5
#define YRES 8
#define CHARS 8
-/* $Id: MatrixOrbital.c,v 1.51 2004/01/29 04:40:02 reinelt Exp $
+/* $Id: MatrixOrbital.c,v 1.52 2004/01/30 20:57:55 reinelt Exp $
*
* driver for Matrix Orbital serial display modules
*
*
*
* $Log: MatrixOrbital.c,v $
+ * Revision 1.52 2004/01/30 20:57:55 reinelt
+ * HD44780 patch from Martin Hejl
+ * dmalloc integrated
+ *
* Revision 1.51 2004/01/29 04:40:02 reinelt
* every .c file includes "config.h" now
*
#include "bar.h"
#include "icon.h"
+#ifdef WITH_DMALLOC
+#include <dmalloc.h>
+#endif
+
#define XRES 5
#define YRES 8
#define CHARS 8
-/* $Id: MilfordInstruments.c,v 1.6 2004/01/29 04:40:02 reinelt Exp $
+/* $Id: MilfordInstruments.c,v 1.7 2004/01/30 20:57:55 reinelt Exp $
*
* driver for Milford Instruments 'BPK' piggy-back serial interface board
* for standard Hitachi 44780 compatible lcd modules.
*
*
* $Log: MilfordInstruments.c,v $
+ * Revision 1.7 2004/01/30 20:57:55 reinelt
+ * HD44780 patch from Martin Hejl
+ * dmalloc integrated
+ *
* Revision 1.6 2004/01/29 04:40:02 reinelt
* every .c file includes "config.h" now
*
#include "bar.h"
#include "icon.h"
+#ifdef WITH_DMALLOC
+#include <dmalloc.h>
+#endif
+
#define XRES 5
#define YRES 8
#define CHARS 8
-/* $Id: PalmPilot.c,v 1.16 2004/01/29 04:40:02 reinelt Exp $
+/* $Id: PalmPilot.c,v 1.17 2004/01/30 20:57:55 reinelt Exp $
*
* driver for 3Com Palm Pilot
*
*
*
* $Log: PalmPilot.c,v $
+ * Revision 1.17 2004/01/30 20:57:55 reinelt
+ * HD44780 patch from Martin Hejl
+ * dmalloc integrated
+ *
* Revision 1.16 2004/01/29 04:40:02 reinelt
* every .c file includes "config.h" now
*
#include "icon.h"
#include "pixmap.h"
+#ifdef WITH_DMALLOC
+#include <dmalloc.h>
+#endif
+
static LCD Lcd;
static char *Port=NULL;
-/* $Id: Raster.c,v 1.29 2004/01/09 04:16:06 reinelt Exp $
+/* $Id: Raster.c,v 1.30 2004/01/30 20:57:55 reinelt Exp $
*
* driver for raster formats
*
*
*
* $Log: Raster.c,v $
+ * Revision 1.30 2004/01/30 20:57:55 reinelt
+ * HD44780 patch from Martin Hejl
+ * dmalloc integrated
+ *
* Revision 1.29 2004/01/09 04:16:06 reinelt
* added 'section' argument to cfg_get(), but NULLed it on all calls by now.
*
#include "icon.h"
#include "pixmap.h"
+#ifdef WITH_DMALLOC
+#include <dmalloc.h>
+#endif
+
static LCD Lcd;
static int pixel=-1;
-/* $Id: T6963.c,v 1.14 2004/01/09 04:16:06 reinelt Exp $
+/* $Id: T6963.c,v 1.15 2004/01/30 20:57:55 reinelt Exp $
*
* driver for display modules based on the Toshiba T6963 chip
*
*
*
* $Log: T6963.c,v $
+ * Revision 1.15 2004/01/30 20:57:55 reinelt
+ * HD44780 patch from Martin Hejl
+ * dmalloc integrated
+ *
* Revision 1.14 2004/01/09 04:16:06 reinelt
* added 'section' argument to cfg_get(), but NULLed it on all calls by now.
*
#include "udelay.h"
#include "pixmap.h"
+#ifdef WITH_DMALLOC
+#include <dmalloc.h>
+#endif
+
#define XRES 6
#define YRES 8
-/* $Id: USBLCD.c,v 1.20 2004/01/09 04:16:06 reinelt Exp $
+/* $Id: USBLCD.c,v 1.21 2004/01/30 20:57:55 reinelt Exp $
*
* Driver for USBLCD (see http://www.usblcd.de)
*
*
*
* $Log: USBLCD.c,v $
+ * Revision 1.21 2004/01/30 20:57:55 reinelt
+ * HD44780 patch from Martin Hejl
+ * dmalloc integrated
+ *
* Revision 1.20 2004/01/09 04:16:06 reinelt
* added 'section' argument to cfg_get(), but NULLed it on all calls by now.
*
#include "icon.h"
#include "bar.h"
+#ifdef WITH_DMALLOC
+#include <dmalloc.h>
+#endif
+
#define GET_HARD_VERSION 1
#define GET_DRV_VERSION 2
-/* $Id: XWindow.c,v 1.39 2004/01/29 04:40:02 reinelt Exp $
+/* $Id: XWindow.c,v 1.40 2004/01/30 20:57:55 reinelt Exp $
*
* X11 Driver for LCD4Linux
*
*
*
* $Log: XWindow.c,v $
+ * Revision 1.40 2004/01/30 20:57:55 reinelt
+ * HD44780 patch from Martin Hejl
+ * dmalloc integrated
+ *
* Revision 1.39 2004/01/29 04:40:02 reinelt
* every .c file includes "config.h" now
*
#include "icon.h"
#include "pixmap.h"
+#ifdef WITH_DMALLOC
+#include <dmalloc.h>
+#endif
+
/* glibc 2.1 requires defining semun ourselves */
#ifdef _SEM_SEMUN_UNDEFINED
AC_MSG_RESULT([$SED])
])
+
+# serial 1
+
+AC_DEFUN([AM_WITH_DMALLOC],
+[AC_MSG_CHECKING(if malloc debugging is wanted)
+AC_ARG_WITH(dmalloc,
+[ --with-dmalloc use dmalloc, as in
+ ftp://ftp.letters.com/src/dmalloc/dmalloc.tar.gz],
+[if test "$withval" = yes; then
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(WITH_DMALLOC,1,
+ [Define if using the dmalloc debugging malloc package])
+ LIBS="$LIBS -ldmalloc"
+ LDFLAGS="$LDFLAGS -g"
+else
+ AC_MSG_RESULT(no)
+fi], [AC_MSG_RESULT(no)])
+])
+
-/* $Id: bar.c,v 1.10 2004/01/29 04:40:02 reinelt Exp $
+/* $Id: bar.c,v 1.11 2004/01/30 20:57:55 reinelt Exp $
*
* generic bar handling
*
*
*
* $Log: bar.c,v $
+ * Revision 1.11 2004/01/30 20:57:55 reinelt
+ * HD44780 patch from Martin Hejl
+ * dmalloc integrated
+ *
* Revision 1.10 2004/01/29 04:40:02 reinelt
* every .c file includes "config.h" now
*
#include "bar.h"
#include "debug.h"
+#ifdef WITH_DMALLOC
+#include <dmalloc.h>
+#endif
+
static int ROWS=0;
static int COLS=0;
-/* $Id: cfg.c,v 1.31 2004/01/29 04:40:02 reinelt Exp $^
+/* $Id: cfg.c,v 1.32 2004/01/30 20:57:55 reinelt Exp $^
*
* config file stuff
*
*
*
* $Log: cfg.c,v $
+ * Revision 1.32 2004/01/30 20:57:55 reinelt
+ * HD44780 patch from Martin Hejl
+ * dmalloc integrated
+ *
* Revision 1.31 2004/01/29 04:40:02 reinelt
* every .c file includes "config.h" now
*
#include "evaluator.h"
#include "cfg.h"
+#ifdef WITH_DMALLOC
+#include <dmalloc.h>
+#endif
+
typedef struct {
char *key;
char *val;
nConfig++;
Config=realloc(Config, nConfig*sizeof(ENTRY));
- Config[nConfig-1].key=strdup(buffer);
+ Config[nConfig-1].key=buffer;
Config[nConfig-1].val=dequote(strdup(val));
Config[nConfig-1].lock=lock;
}
+int l4l_cfg_exit (void)
+{
+ int i;
+
+ for (i=0; i<nConfig; i++) {
+ if (Config[i].key) free (Config[i].key);
+ if (Config[i].val) free (Config[i].val);
+ }
+
+ if (Config) {
+ free (Config);
+ Config=NULL;
+ }
+
+ if (Config_File) {
+ free (Config_File);
+ Config_File=NULL;
+ }
+
+ return 0;
+}
+
+
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 *section, char *key, char *defval) = l4l_cfg_get;
int (*cfg_number) (char *section, char *key, int defval,
int min, int max, int *value) = l4l_cfg_number;
+int (*cfg_exit) (void) = l4l_cfg_exit;
-/* $Id: cfg.h,v 1.9 2004/01/14 11:33:00 reinelt Exp $
+/* $Id: cfg.h,v 1.10 2004/01/30 20:57:55 reinelt Exp $
*
* config file stuff
*
*
*
* $Log: cfg.h,v $
+ * Revision 1.10 2004/01/30 20:57:55 reinelt
+ * HD44780 patch from Martin Hejl
+ * dmalloc integrated
+ *
* Revision 1.9 2004/01/14 11:33:00 reinelt
* new plugin 'uname' which does what it's called
* text widget nearly finished
extern char *(*cfg_get) (char *section, char *key, char *defval);
extern int (*cfg_number) (char *section, char *key, int defval,
int min, int max, int *value);
+extern int (*cfg_exit) (void);
int l4l_cfg_init (char *file);
char *l4l_cfg_source (void);
char *l4l_cfg_get (char *section, char *key, char *defval);
int l4l_cfg_number (char *section, char *key, int defval,
int min, int max, int *value);
+int l4l_cfg_exit (void);
#endif
/* junk */
#undef WITH_CWLINUX
+/* Define if using the dmalloc debugging malloc package */
+#undef WITH_DMALLOC
+
/* junk */
#undef WITH_HD44780
both]
--with-tags[=TAGS]
include additional configurations [automatic]
+ --with-dmalloc use dmalloc, as in
+ ftp://ftp.letters.com/src/dmalloc/dmalloc.tar.gz
--with-sco Use this to turn on SCO-specific code
--with-sunos-curses Used to force SunOS 4.x curses
--with-osf1-curses Used to force OSF/1 curses
;;
*-*-irix6*)
# Find out which ABI we are using.
- echo '#line 4047 "configure"' > conftest.$ac_ext
+ echo '#line 4049 "configure"' > conftest.$ac_ext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
# Provide some information about the compiler.
-echo "$as_me:4917:" \
+echo "$as_me:4919:" \
"checking for Fortran 77 compiler version" >&5
ac_compiler=`set X $ac_compile; echo $2`
{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5
-e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:5949: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:5951: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:5953: \$? = $ac_status" >&5
+ echo "$as_me:5955: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings
-e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:6182: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:6184: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:6186: \$? = $ac_status" >&5
+ echo "$as_me:6188: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings
-e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:6249: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:6251: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:6253: \$? = $ac_status" >&5
+ echo "$as_me:6255: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<EOF
-#line 8424 "configure"
+#line 8426 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<EOF
-#line 8522 "configure"
+#line 8524 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
-e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:10699: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:10701: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:10703: \$? = $ac_status" >&5
+ echo "$as_me:10705: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings
-e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:10766: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:10768: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:10770: \$? = $ac_status" >&5
+ echo "$as_me:10772: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<EOF
-#line 12120 "configure"
+#line 12122 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<EOF
-#line 12218 "configure"
+#line 12220 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
-e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:13045: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:13047: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:13049: \$? = $ac_status" >&5
+ echo "$as_me:13051: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings
-e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:13112: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:13114: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:13116: \$? = $ac_status" >&5
+ echo "$as_me:13118: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
-e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:15144: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:15146: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:15148: \$? = $ac_status" >&5
+ echo "$as_me:15150: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings
-e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:15377: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:15379: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:15381: \$? = $ac_status" >&5
+ echo "$as_me:15383: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings
-e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:15444: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:15446: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:15448: \$? = $ac_status" >&5
+ echo "$as_me:15450: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<EOF
-#line 17619 "configure"
+#line 17621 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<EOF
-#line 17717 "configure"
+#line 17719 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
+
+# dmalloc
+echo "$as_me:$LINENO: checking if malloc debugging is wanted" >&5
+echo $ECHO_N "checking if malloc debugging is wanted... $ECHO_C" >&6
+
+# Check whether --with-dmalloc or --without-dmalloc was given.
+if test "${with_dmalloc+set}" = set; then
+ withval="$with_dmalloc"
+ if test "$withval" = yes; then
+ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+
+cat >>confdefs.h <<\_ACEOF
+#define WITH_DMALLOC 1
+_ACEOF
+
+ LIBS="$LIBS -ldmalloc"
+ LDFLAGS="$LDFLAGS -g"
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi;
+
# Checks for libraries.
echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
ncurses_version=unknown
cat > conftest.$ac_ext <<EOF
-#line 19256 "configure"
+#line 19285 "configure"
#include "confdefs.h"
#ifdef RENAMED_NCURSES
#include <curses.h>
#AC_PROG_RANLIB
AC_PROG_LIBTOOL
+# dmalloc
+AM_WITH_DMALLOC
+
# Checks for libraries.
AC_CHECK_LIB(m, log)
-/* $Id: drv_Crystalfontz.c,v 1.6 2004/01/29 04:40:02 reinelt Exp $
+/* $Id: drv_Crystalfontz.c,v 1.7 2004/01/30 20:57:56 reinelt Exp $
*
* new style driver for Crystalfontz display modules
*
*
*
* $Log: drv_Crystalfontz.c,v $
+ * Revision 1.7 2004/01/30 20:57:56 reinelt
+ * HD44780 patch from Martin Hejl
+ * dmalloc integrated
+ *
* Revision 1.6 2004/01/29 04:40:02 reinelt
* every .c file includes "config.h" now
*
// *** hardware dependant functions ***
// ****************************************
+// x^0 + x^5 + x^12
+#define CRCPOLY 0x8408
+
+static unsigned short CRC=0xffff;
+
+static unsigned short CRC16 (unsigned short crc, unsigned char *p, size_t len)
+{
+ int i;
+ while (len--) {
+ crc ^= *p++;
+ for (i = 0; i < 8; i++)
+ crc = (crc >> 1) ^ ((crc & 1) ? CRCPOLY : 0);
+ }
+ return ~crc;
+}
+
+
+static void drv_CF_write_crc (char *string, int len)
+{
+ unsigned char buffer[16+2];
+
+ if (len>sizeof(buffer)-2) {
+ error ("%s: internal error: packet length %d exceeds buffer size %d", Name, len, sizeof(buffer)-2);
+ len=sizeof(buffer)-1;
+ }
+
+ strcpy (buffer, string);
+ CRC = CRC16(CRC, buffer, len);
+ buffer[len] = (CRC >> 8);
+ buffer[len+1] = CRC & 0xff;
+}
+
+
+static void drv_CF_write (char *string, int len)
+{
+ switch (Protocol) {
+ case 1:
+ drv_generic_serial_write (string, len);
+ break;
+ case 2:
+ drv_CF_write_crc (string, len);
+ break;
+ }
+}
+
+
static void drv_CF_goto (int row, int col)
{
char cmd[3]="\021xy"; // set cursor position
}
Model=i;
info ("%s: using model '%s'", Name, Models[Model].name);
+ Protocol = Models[Model].protocol;
} else {
info ("%s: no '%s.Model' entry from %s, auto-dedecting", Name, section, cfg_source());
Model=-1;
+ Protocol=2; //auto-dedect only newer displays
}
// open serial port
if (drv_generic_serial_open(section, Name)<0) return -1;
-
+
// MR: why such a large delay?
usleep(350*1000);
-
+
// read display type
memset(buffer, 0, sizeof(buffer));
- drv_generic_serial_write ("\1", 2);
+ drv_CF_write ("\1", 2);
usleep(250*1000);
#if 1
{
-/* $Id: drv_generic_text.c,v 1.7 2004/01/29 04:40:02 reinelt Exp $
+/* $Id: drv_generic_text.c,v 1.8 2004/01/30 20:57:56 reinelt Exp $
*
* generic driver helper for text-based displays
*
*
*
* $Log: drv_generic_text.c,v $
+ * Revision 1.8 2004/01/30 20:57:56 reinelt
+ * HD44780 patch from Martin Hejl
+ * dmalloc integrated
+ *
* Revision 1.7 2004/01/29 04:40:02 reinelt
* every .c file includes "config.h" now
*
#include "drv.h"
#include "drv_generic_text.h"
+#ifdef WITH_DMALLOC
+#include <dmalloc.h>
+#endif
+
typedef struct {
int val1;
-/* $Id: evaluator.c,v 1.10 2004/01/29 04:40:02 reinelt Exp $
+/* $Id: evaluator.c,v 1.11 2004/01/30 20:57:56 reinelt Exp $
*
* expression evaluation
*
* FIXME: GPL or not GPL????
*
* $Log: evaluator.c,v $
+ * Revision 1.11 2004/01/30 20:57:56 reinelt
+ * HD44780 patch from Martin Hejl
+ * dmalloc integrated
+ *
* Revision 1.10 2004/01/29 04:40:02 reinelt
* every .c file includes "config.h" now
*
#include "debug.h"
#include "evaluator.h"
+#ifdef WITH_DMALLOC
+#include <dmalloc.h>
+#endif
+
// Token types
#define T_DELIMITER 1
if ((err=setjmp(jb))) {
error ("Evaluator: %s in expression <%s>", ErrMsg[err], expression);
+ if (Token) {
+ free (Token);
+ Token=NULL;
+ }
return -1;
}
if (*Token=='\0') ERROR (E_EMPTY);
Level01(result);
if (*Token!='\0') ERROR (E_SYNTAX);
+ free (Token);
+ Token=NULL;
+
return 0;
}
-/* $Id: filter.c,v 1.11 2004/01/29 04:40:02 reinelt Exp $
+/* $Id: filter.c,v 1.12 2004/01/30 20:57:56 reinelt Exp $
*
* smooth and damp functions
*
*
*
* $Log: filter.c,v $
+ * Revision 1.12 2004/01/30 20:57:56 reinelt
+ * HD44780 patch from Martin Hejl
+ * dmalloc integrated
+ *
* Revision 1.11 2004/01/29 04:40:02 reinelt
* every .c file includes "config.h" now
*
#include "cfg.h"
#include "filter.h"
+#ifdef WITH_DMALLOC
+#include <dmalloc.h>
+#endif
+
extern int tick;
#define SLOTS 64
-/* $Id: hash.c,v 1.11 2004/01/29 04:40:02 reinelt Exp $
+/* $Id: hash.c,v 1.12 2004/01/30 20:57:56 reinelt Exp $
*
* hashes (associative arrays)
*
*
*
* $Log: hash.c,v $
+ * Revision 1.12 2004/01/30 20:57:56 reinelt
+ * HD44780 patch from Martin Hejl
+ * dmalloc integrated
+ *
* Revision 1.11 2004/01/29 04:40:02 reinelt
* every .c file includes "config.h" now
*
#include "debug.h"
#include "hash.h"
+#ifdef WITH_DMALLOC
+#include <dmalloc.h>
+#endif
+
#define DELTA_SLOTS 64
-/* $Id: icon.c,v 1.13 2004/01/29 04:40:02 reinelt Exp $
+/* $Id: icon.c,v 1.14 2004/01/30 20:57:56 reinelt Exp $
*
* generic icon and heartbeat handling
*
*
*
* $Log: icon.c,v $
+ * Revision 1.14 2004/01/30 20:57:56 reinelt
+ * HD44780 patch from Martin Hejl
+ * dmalloc integrated
+ *
* Revision 1.13 2004/01/29 04:40:02 reinelt
* every .c file includes "config.h" now
*
#include "cfg.h"
#include "icon.h"
+#ifdef WITH_DMALLOC
+#include <dmalloc.h>
+#endif
+
typedef struct BITMAP {
int nData;
-/* $Id: layout.c,v 1.6 2004/01/14 11:33:00 reinelt Exp $
+/* $Id: layout.c,v 1.7 2004/01/30 20:57:56 reinelt Exp $
*
* new layouter framework
*
*
*
* $Log: layout.c,v $
+ * Revision 1.7 2004/01/30 20:57:56 reinelt
+ * HD44780 patch from Martin Hejl
+ * dmalloc integrated
+ *
* Revision 1.6 2004/01/14 11:33:00 reinelt
* new plugin 'uname' which does what it's called
* text widget nearly finished
#include "widget.h"
#include "layout.h"
+#ifdef WITH_DMALLOC
+#include <dmalloc.h>
+#endif
+
int layout_addItem (char *name, int row, int col)
{
-/* $Id: lcd4linux.c,v 1.61 2004/01/14 11:33:00 reinelt Exp $
+/* $Id: lcd4linux.c,v 1.62 2004/01/30 20:57:56 reinelt Exp $
*
* LCD4Linux
*
*
*
* $Log: lcd4linux.c,v $
+ * Revision 1.62 2004/01/30 20:57:56 reinelt
+ * HD44780 patch from Martin Hejl
+ * dmalloc integrated
+ *
* Revision 1.61 2004/01/14 11:33:00 reinelt
* new plugin 'uname' which does what it's called
* text widget nearly finished
#include "layout.h"
#include "plugin.h"
+#ifdef WITH_DMALLOC
+#include <dmalloc.h>
+#endif
+
#define PIDFILE "/var/run/lcd4linux.pid"
static char *release="LCD4Linux " VERSION " (c) 2003 Michael Reinelt <reinelt@eunet.at>";
drv_quit();
}
pid_exit(PIDFILE);
+ cfg_exit();
exit (0);
}
} else {
drv_quit();
}
+
pid_exit(PIDFILE);
-
+ cfg_exit();
+
if (got_signal==SIGHUP) {
long fd;
debug ("restarting...");
Speed 19200
}
+Display CF633 {
+ Icons 1
+ Driver 'Crystalfontz'
+ Model '633'
+ Port '/dev/tts/0'
+ Speed 19200
+}
+
Display HD44780-20x4 {
Driver 'HD44780'
Port '/dev/parports/0'
}
#Display 'LK204'
-Display 'HD44780-20x4'
-#Display 'CF632'
+#Display 'HD44780-20x4'
#Display 'CF631'
+#Display 'CF632'
+Display 'CF633'
#Layout 'Default'
Layout 'L16x2'
-/* $Id: mail2.c,v 1.11 2004/01/29 04:40:02 reinelt Exp $
+/* $Id: mail2.c,v 1.12 2004/01/30 20:57:56 reinelt Exp $
*
* mail: pop3, imap, news functions
*
*
*
* $Log: mail2.c,v $
+ * Revision 1.12 2004/01/30 20:57:56 reinelt
+ * HD44780 patch from Martin Hejl
+ * dmalloc integrated
+ *
* Revision 1.11 2004/01/29 04:40:02 reinelt
* every .c file includes "config.h" now
*
#include "cfg.h"
#include "socket.h"
+#ifdef WITH_DMALLOC
+#include <dmalloc.h>
+#endif
+
#define PROTO_UNKNOWN -1
#define PROTO_POP3 110
#define PROTO_NNTP 119
-/* $Id: pixmap.c,v 1.13 2004/01/29 04:40:02 reinelt Exp $
+/* $Id: pixmap.c,v 1.14 2004/01/30 20:57:56 reinelt Exp $
*
* generic pixmap driver
*
*
*
* $Log: pixmap.c,v $
+ * Revision 1.14 2004/01/30 20:57:56 reinelt
+ * HD44780 patch from Martin Hejl
+ * dmalloc integrated
+ *
* Revision 1.13 2004/01/29 04:40:02 reinelt
* every .c file includes "config.h" now
*
#include "fontmap.h"
#include "debug.h"
+#ifdef WITH_DMALLOC
+#include <dmalloc.h>
+#endif
+
static int ROWS=0;
static int COLS=0;
static int XRES=0;
-/* $Id: plugin_cfg.c,v 1.3 2004/01/29 04:40:02 reinelt Exp $
+/* $Id: plugin_cfg.c,v 1.4 2004/01/30 20:57:56 reinelt Exp $
*
* plugin for config file access
*
*
*
* $Log: plugin_cfg.c,v $
+ * Revision 1.4 2004/01/30 20:57:56 reinelt
+ * HD44780 patch from Martin Hejl
+ * dmalloc integrated
+ *
* Revision 1.3 2004/01/29 04:40:02 reinelt
* every .c file includes "config.h" now
*
#include "plugin.h"
#include "cfg.h"
+#ifdef WITH_DMALLOC
+#include <dmalloc.h>
+#endif
+
static void load_variables (void)
{
-/* $Id: plugin_i2c_sensors.c,v 1.6 2004/01/30 07:12:35 reinelt Exp $
+/* $Id: plugin_i2c_sensors.c,v 1.7 2004/01/30 20:57:56 reinelt Exp $
*
* I2C sensors plugin
*
*
*
* $Log: plugin_i2c_sensors.c,v $
+ * Revision 1.7 2004/01/30 20:57:56 reinelt
+ * HD44780 patch from Martin Hejl
+ * dmalloc integrated
+ *
* Revision 1.6 2004/01/30 07:12:35 reinelt
* HD44780 busy-flag support from Martin Hejl
* loadavg() uClibc replacement from Martin Heyl
#include "cfg.h"
#include "hash.h"
+#ifdef WITH_DMALLOC
+#include <dmalloc.h>
+#endif
+
static char *path=NULL;
static HASH I2Csensors = { 0, };
-/* $Id: plugin_sample.c,v 1.3 2004/01/29 04:40:02 reinelt Exp $
+/* $Id: plugin_sample.c,v 1.4 2004/01/30 20:57:56 reinelt Exp $
*
* plugin template
*
*
*
* $Log: plugin_sample.c,v $
+ * Revision 1.4 2004/01/30 20:57:56 reinelt
+ * HD44780 patch from Martin Hejl
+ * dmalloc integrated
+ *
* Revision 1.3 2004/01/29 04:40:02 reinelt
* every .c file includes "config.h" now
*
#include "debug.h"
#include "plugin.h"
+#ifdef WITH_DMALLOC
+#include <dmalloc.h>
+#endif
+
// sample function 'mul2'
-/* $Id: timer.c,v 1.3 2004/01/29 04:40:03 reinelt Exp $
+/* $Id: timer.c,v 1.4 2004/01/30 20:57:56 reinelt Exp $
*
* generic timer handling
*
*
*
* $Log: timer.c,v $
+ * Revision 1.4 2004/01/30 20:57:56 reinelt
+ * HD44780 patch from Martin Hejl
+ * dmalloc integrated
+ *
* Revision 1.3 2004/01/29 04:40:03 reinelt
* every .c file includes "config.h" now
*
#include "cfg.h"
#include "timer.h"
+#ifdef WITH_DMALLOC
+#include <dmalloc.h>
+#endif
+
typedef struct TIMER {
void (*callback)(void *data);
-/* $Id: widget.c,v 1.10 2004/01/29 04:40:03 reinelt Exp $
+/* $Id: widget.c,v 1.11 2004/01/30 20:57:56 reinelt Exp $
*
* generic widget handling
*
*
*
* $Log: widget.c,v $
+ * Revision 1.11 2004/01/30 20:57:56 reinelt
+ * HD44780 patch from Martin Hejl
+ * dmalloc integrated
+ *
* Revision 1.10 2004/01/29 04:40:03 reinelt
* every .c file includes "config.h" now
*
#include "cfg.h"
#include "widget.h"
+#ifdef WITH_DMALLOC
+#include <dmalloc.h>
+#endif
+
// we use a static array of widgets and not realloc()
#define MAX_WIDGETS 256
-/* $Id: widget_bar.c,v 1.6 2004/01/29 04:40:03 reinelt Exp $
+/* $Id: widget_bar.c,v 1.7 2004/01/30 20:57:56 reinelt Exp $
*
* bar widget handling
*
*
*
* $Log: widget_bar.c,v $
+ * Revision 1.7 2004/01/30 20:57:56 reinelt
+ * HD44780 patch from Martin Hejl
+ * dmalloc integrated
+ *
* Revision 1.6 2004/01/29 04:40:03 reinelt
* every .c file includes "config.h" now
*
#include "widget.h"
#include "widget_bar.h"
+#ifdef WITH_DMALLOC
+#include <dmalloc.h>
+#endif
+
void widget_bar_update (void *Self)
{
-/* $Id: widget_icon.c,v 1.3 2004/01/29 04:40:03 reinelt Exp $
+/* $Id: widget_icon.c,v 1.4 2004/01/30 20:57:56 reinelt Exp $
*
* icon widget handling
*
*
*
* $Log: widget_icon.c,v $
+ * Revision 1.4 2004/01/30 20:57:56 reinelt
+ * HD44780 patch from Martin Hejl
+ * dmalloc integrated
+ *
* Revision 1.3 2004/01/29 04:40:03 reinelt
* every .c file includes "config.h" now
*
#include "widget.h"
#include "widget_icon.h"
+#ifdef WITH_DMALLOC
+#include <dmalloc.h>
+#endif
+
// icons always are 8 pixels high
#define YRES 8
-/* $Id: widget_text.c,v 1.10 2004/01/29 04:40:03 reinelt Exp $
+/* $Id: widget_text.c,v 1.11 2004/01/30 20:57:56 reinelt Exp $
*
* simple text widget handling
*
*
*
* $Log: widget_text.c,v $
+ * Revision 1.11 2004/01/30 20:57:56 reinelt
+ * HD44780 patch from Martin Hejl
+ * dmalloc integrated
+ *
* Revision 1.10 2004/01/29 04:40:03 reinelt
* every .c file includes "config.h" now
*
#include "widget.h"
#include "widget_text.h"
+#ifdef WITH_DMALLOC
+#include <dmalloc.h>
+#endif
+
void widget_text_scroll (void *Self)
{