1 diff -Nru dalc-0.1/AUTHORS dalc-0.1.new/AUTHORS
2 --- dalc-0.1/AUTHORS Thu Jan 1 01:00:00 1970
3 +++ dalc-0.1.new/AUTHORS Fri Nov 24 16:46:10 2000
6 \ No newline at end of file
7 diff -Nru dalc-0.1/ChangeLog dalc-0.1.new/ChangeLog
8 --- dalc-0.1/ChangeLog Thu Jan 1 01:00:00 1970
9 +++ dalc-0.1.new/ChangeLog Fri Nov 24 16:46:08 2000
12 \ No newline at end of file
13 diff -Nru dalc-0.1/INSTALL dalc-0.1.new/INSTALL
14 --- dalc-0.1/INSTALL Thu Jan 1 01:00:00 1970
15 +++ dalc-0.1.new/INSTALL Fri Nov 24 16:46:12 2000
18 \ No newline at end of file
19 diff -Nru dalc-0.1/Makefile dalc-0.1.new/Makefile
20 --- dalc-0.1/Makefile Thu Dec 9 06:17:36 1999
21 +++ dalc-0.1.new/Makefile Thu Jan 1 01:00:00 1970
25 -MANDIR =/usr/local/man/man1
27 -BINDIR =/usr/local/bin
28 -CFLAGS =-O3 -Wall -m486 -DVIEWER=\"xv\" -DCONVERTER=\"ppmtogif\"
29 -LDFLAGS =-L/usr/X11R6/lib
30 -LIBS =-lm -lncurses -lmenu
31 -INSTALL =install -o root -g root
36 - g++ $(CFLAGS) -o $*.o -c $*.C
40 -dalc: dalc.o dalexpr.o
41 - g++ $(LIBS) $(LDFLAGS) -o $@ $^
44 - $(INSTALL) -m 0755 $(BINARIES) $(BINDIR)
45 - $(INSTALL) -m 0644 $(MANFILES) $(MANDIR)
50 diff -Nru dalc-0.1/Makefile.am dalc-0.1.new/Makefile.am
51 --- dalc-0.1/Makefile.am Thu Jan 1 01:00:00 1970
52 +++ dalc-0.1.new/Makefile.am Fri Nov 24 16:38:02 2000
55 +INCLUDES = $(CURSES_INCLUDEDIR) \
56 + -DVIEWER=\"xv\" -DCONVERTER=\"ppmtogif\"
60 +dalc_SOURCES = dalc.cc dalexpr.cc dalexpr.h
63 diff -Nru dalc-0.1/NEWS dalc-0.1.new/NEWS
64 --- dalc-0.1/NEWS Thu Jan 1 01:00:00 1970
65 +++ dalc-0.1.new/NEWS Fri Nov 24 16:46:00 2000
68 \ No newline at end of file
69 diff -Nru dalc-0.1/README dalc-0.1.new/README
70 --- dalc-0.1/README Thu Jan 1 01:00:00 1970
71 +++ dalc-0.1.new/README Fri Nov 24 16:45:52 2000
74 \ No newline at end of file
75 diff -Nru dalc-0.1/acconfig.h dalc-0.1.new/acconfig.h
76 --- dalc-0.1/acconfig.h Thu Jan 1 01:00:00 1970
77 +++ dalc-0.1.new/acconfig.h Fri Nov 24 16:32:42 2000
79 +/* Define if you want to turn on SCO-specific code */
82 +/* Found some version of curses that we're going to use */
85 +/* Are you using other type of curses? */
88 +/* Use SunOS SysV curses? */
89 +#undef USE_SUNOS_CURSES
91 +/* Use old BSD curses? */
92 +#undef USE_BSD_CURSES
94 +/* Use SystemV curses? */
95 +#undef USE_SYSV_CURSES
100 +/* If you Curses does not have color define this one */
101 +#undef NO_COLOR_CURSES
103 +/* If Slang library should use termcap */
106 +/* Version of ncurses */
107 +#undef NCURSES_970530
108 diff -Nru dalc-0.1/acinclude.m4 dalc-0.1.new/acinclude.m4
109 --- dalc-0.1/acinclude.m4 Thu Jan 1 01:00:00 1970
110 +++ dalc-0.1.new/acinclude.m4 Thu Aug 3 00:26:45 2000
112 +dnl Curses detection: Munged from Midnight Commander's configure.in
117 +dnl - Determine which version of curses is installed on your system
118 +dnl and set the -I/-L/-l compiler entries and add a few preprocessor
120 +dnl - Do an AC_SUBST on the CURSES_INCLUDEDIR and CURSES_LIBS so that
121 +dnl @CURSES_INCLUDEDIR@ and @CURSES_LIBS@ will be available in
123 +dnl - Modify the following configure variables (these are the only
124 +dnl curses.m4 variables you can access from within configure.in)
125 +dnl CURSES_INCLUDEDIR - contains -I's and possibly -DRENAMED_CURSES if
126 +dnl an ncurses.h that's been renamed to curses.h
128 +dnl CURSES_LIBS - sets -L and -l's appropriately
129 +dnl CFLAGS - if --with-sco, add -D_SVID3
130 +dnl has_curses - exports result of tests to rest of configure
134 +dnl 1) Add lines indicated below to acconfig.h
135 +dnl 2) call AC_CHECK_CURSES after AC_PROG_CC in your configure.in
136 +dnl 3) Instead of #include <curses.h> you should use the following to
137 +dnl properly locate ncurses or curses header file
139 +dnl #if defined(USE_NCURSES) && !defined(RENAMED_NCURSES)
140 +dnl #include <ncurses.h>
142 +dnl #include <curses.h>
145 +dnl 4) Make sure to add @CURSES_INCLUDEDIR@ to your preprocessor flags
146 +dnl 5) Make sure to add @CURSES_LIBS@ to your linker flags or LIBS
148 +dnl Notes with automake:
149 +dnl - call AM_CONDITIONAL(HAS_CURSES, test "$has_curses" = true) from
151 +dnl - your Makefile.am can look something like this
152 +dnl -----------------------------------------------
153 +dnl INCLUDES= blah blah blah $(CURSES_INCLUDEDIR)
155 +dnl CURSES_TARGETS=name_of_curses_prog
157 +dnl bin_PROGRAMS = other_programs $(CURSES_TARGETS)
158 +dnl other_programs_SOURCES = blah blah blah
159 +dnl name_of_curses_prog_SOURCES = blah blah blah
160 +dnl other_programs_LDADD = blah
161 +dnl name_of_curses_prog_LDADD = blah $(CURSES_LIBS)
162 +dnl -----------------------------------------------
165 +dnl The following lines should be added to acconfig.h:
166 +dnl ==================================================
168 +dnl /*=== Curses version detection defines ===*/
169 +dnl /* Found some version of curses that we're going to use */
170 +dnl #undef HAS_CURSES
172 +dnl /* Use SunOS SysV curses? */
173 +dnl #undef USE_SUNOS_CURSES
175 +dnl /* Use old BSD curses - not used right now */
176 +dnl #undef USE_BSD_CURSES
178 +dnl /* Use SystemV curses? */
179 +dnl #undef USE_SYSV_CURSES
181 +dnl /* Use Ncurses? */
182 +dnl #undef USE_NCURSES
184 +dnl /* If you Curses does not have color define this one */
185 +dnl #undef NO_COLOR_CURSES
187 +dnl /* Define if you want to turn on SCO-specific code */
188 +dnl #undef SCO_FLAVOR
190 +dnl /* Set to reflect version of ncurses *
191 +dnl * 0 = version 1.*
192 +dnl * 1 = version 1.9.9g
193 +dnl * 2 = version 4.0/4.1 */
194 +dnl #undef NCURSES_970530
196 +dnl /*=== End new stuff for acconfig.h ===*/
200 +AC_DEFUN(AC_CHECK_CURSES,[
201 + search_ncurses=true
205 + CFLAGS=${CFLAGS--O}
207 + AC_SUBST(CURSES_LIBS)
208 + AC_SUBST(CURSES_INCLUDEDIR)
211 + [ --with-sco Use this to turn on SCO-specific code],[
212 + if test x$withval = xyes; then
213 + AC_DEFINE(SCO_FLAVOR)
214 + CFLAGS="$CFLAGS -D_SVID3"
218 + AC_ARG_WITH(sunos-curses,
219 + [ --with-sunos-curses Used to force SunOS 4.x curses],[
220 + if test x$withval = xyes; then
221 + AC_USE_SUNOS_CURSES
225 + AC_ARG_WITH(osf1-curses,
226 + [ --with-osf1-curses Used to force OSF/1 curses],[
227 + if test x$withval = xyes; then
232 + AC_ARG_WITH(vcurses,
233 + [ --with-vcurses[=incdir] Used to force SysV curses],
234 + if test x$withval != xyes; then
235 + CURSES_INCLUDEDIR="-I$withval"
240 + AC_ARG_WITH(ncurses,
241 + [ --with-ncurses[=dir] Compile with ncurses/locate base dir],
242 + if test x$withval = xno ; then
243 + search_ncurses=false
244 + elif test x$withval != xyes ; then
245 + CURSES_LIBS="$LIBS -L$withval/lib -lncurses"
246 + CURSES_INCLUDEDIR="-I$withval/include"
247 + search_ncurses=false
248 + screen_manager="ncurses"
249 + AC_DEFINE(USE_NCURSES)
250 + AC_DEFINE(HAS_CURSES)
257 + AC_SEARCH_NCURSES()
264 +AC_DEFUN(AC_USE_SUNOS_CURSES, [
265 + search_ncurses=false
266 + screen_manager="SunOS 4.x /usr/5include curses"
267 + AC_MSG_RESULT(Using SunOS 4.x /usr/5include curses)
268 + AC_DEFINE(USE_SUNOS_CURSES)
269 + AC_DEFINE(HAS_CURSES)
271 + AC_DEFINE(NO_COLOR_CURSES)
272 + AC_DEFINE(USE_SYSV_CURSES)
273 + CURSES_INCLUDEDIR="-I/usr/5include"
274 + CURSES_LIBS="/usr/5lib/libcurses.a /usr/5lib/libtermcap.a"
275 + AC_MSG_RESULT(Please note that some screen refreshs may fail)
278 +AC_DEFUN(AC_USE_OSF1_CURSES, [
279 + AC_MSG_RESULT(Using OSF1 curses)
280 + search_ncurses=false
281 + screen_manager="OSF1 curses"
282 + AC_DEFINE(HAS_CURSES)
284 + AC_DEFINE(NO_COLOR_CURSES)
285 + AC_DEFINE(USE_SYSV_CURSES)
286 + CURSES_LIBS="-lcurses"
289 +AC_DEFUN(AC_USE_SYSV_CURSES, [
290 + AC_MSG_RESULT(Using SysV curses)
291 + AC_DEFINE(HAS_CURSES)
293 + AC_DEFINE(USE_SYSV_CURSES)
294 + search_ncurses=false
295 + screen_manager="SysV/curses"
296 + CURSES_LIBS="-lcurses"
299 +dnl AC_ARG_WITH(bsd-curses,
300 +dnl [--with-bsd-curses Used to compile with bsd curses, not very fancy],
301 +dnl search_ncurses=false
302 +dnl screen_manager="Ultrix/cursesX"
303 +dnl if test $system = ULTRIX
305 +dnl THIS_CURSES=cursesX
307 +dnl THIS_CURSES=curses
310 +dnl CURSES_LIBS="-l$THIS_CURSES -ltermcap"
311 +dnl AC_DEFINE(HAS_CURSES)
313 +dnl AC_DEFINE(USE_BSD_CURSES)
314 +dnl AC_MSG_RESULT(Please note that some screen refreshs may fail)
315 +dnl AC_MSG_WARN(Use of the bsdcurses extension has some)
316 +dnl AC_MSG_WARN(display/input problems.)
317 +dnl AC_MSG_WARN(Reconsider using xcurses)
322 +dnl Parameters: directory filename cureses_LIBS curses_INCLUDEDIR nicename
324 +AC_DEFUN(AC_NCURSES, [
329 + AC_MSG_RESULT(Found ncurses on $1/$2)
331 + CURSES_INCLUDEDIR="$4"
332 + search_ncurses=false
334 + AC_DEFINE(HAS_CURSES)
336 + AC_DEFINE(USE_NCURSES)
341 +AC_DEFUN(AC_SEARCH_NCURSES, [
342 + AC_CHECKING("location of ncurses.h file")
344 + AC_NCURSES(/usr/include, ncurses.h, -lncurses,, "ncurses on /usr/include")
345 + AC_NCURSES(/usr/include/ncurses, ncurses.h, -lncurses, -I/usr/include/ncurses, "ncurses on /usr/include/ncurses")
346 + AC_NCURSES(/usr/local/include, ncurses.h, -L/usr/local/lib -lncurses, -I/usr/local/include, "ncurses on /usr/local")
347 + AC_NCURSES(/usr/local/include/ncurses, ncurses.h, -L/usr/local/lib -L/usr/local/lib/ncurses -lncurses, -I/usr/local/include/ncurses, "ncurses on /usr/local/include/ncurses")
349 + AC_NCURSES(/usr/local/include/ncurses, curses.h, -L/usr/local/lib -lncurses, -I/usr/local/include/ncurses -DRENAMED_NCURSES, "renamed ncurses on /usr/local/.../ncurses")
351 + AC_NCURSES(/usr/include/ncurses, curses.h, -lncurses, -I/usr/include/ncurses -DRENAMED_NCURSES, "renamed ncurses on /usr/include/ncurses")
354 + dnl We couldn't find ncurses, try SysV curses
358 + AC_EGREP_HEADER(init_color, /usr/include/curses.h,
359 + AC_USE_SYSV_CURSES)
360 + AC_EGREP_CPP(USE_NCURSES,[
367 + CURSES_INCLUDEDIR="$CURSES_INCLUDEDIR -DRENAMED_NCURSES"
368 + AC_DEFINE(HAS_CURSES)
370 + AC_DEFINE(USE_NCURSES)
371 + search_ncurses=false
372 + screen_manager="ncurses installed as curses"
377 + dnl Try SunOS 4.x /usr/5{lib,include} ncurses
378 + dnl The flags USE_SUNOS_CURSES, USE_BSD_CURSES and BUGGY_CURSES
379 + dnl should be replaced by a more fine grained selection routine
383 + if test -f /usr/5include/curses.h
385 + AC_USE_SUNOS_CURSES
388 + # check for ncurses version, to properly ifdef mouse-fix
389 + AC_MSG_CHECKING(for ncurses version)
390 + ncurses_version=unknown
391 +cat > conftest.$ac_ext <<EOF
392 +[#]line __oline__ "configure"
393 +#include "confdefs.h"
394 +#ifdef RENAMED_NCURSES
397 +#include <ncurses.h>
400 +VERSION:NCURSES_VERSION
402 + if (eval "$ac_cpp conftest.$ac_ext") 2>&AC_FD_CC |
403 + egrep "VERSION:" >conftest.out 2>&1; then
405 + ncurses_version=`cat conftest.out|sed -e 's/^[^"]*"//' -e 's/".*//'`
409 + AC_MSG_RESULT($ncurses_version)
410 + case "$ncurses_version" in
414 + AC_DEFINE(NCURSES_970530,2)
417 + AC_DEFINE(NCURSES_970530,1)
420 + AC_DEFINE(NCURSES_970530,0)
430 diff -Nru dalc-0.1/aclocal.m4 dalc-0.1.new/aclocal.m4
431 --- dalc-0.1/aclocal.m4 Thu Jan 1 01:00:00 1970
432 +++ dalc-0.1.new/aclocal.m4 Fri Nov 24 16:35:53 2000
434 +dnl aclocal.m4 generated automatically by aclocal 1.4a
436 +dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
437 +dnl This file is free software; the Free Software Foundation
438 +dnl gives unlimited permission to copy and/or distribute it,
439 +dnl with or without modifications, as long as this notice is preserved.
441 +dnl This program is distributed in the hope that it will be useful,
442 +dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
443 +dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
444 +dnl PARTICULAR PURPOSE.
446 +dnl Curses detection: Munged from Midnight Commander's configure.in
451 +dnl - Determine which version of curses is installed on your system
452 +dnl and set the -I/-L/-l compiler entries and add a few preprocessor
454 +dnl - Do an AC_SUBST on the CURSES_INCLUDEDIR and CURSES_LIBS so that
455 +dnl @CURSES_INCLUDEDIR@ and @CURSES_LIBS@ will be available in
457 +dnl - Modify the following configure variables (these are the only
458 +dnl curses.m4 variables you can access from within configure.in)
459 +dnl CURSES_INCLUDEDIR - contains -I's and possibly -DRENAMED_CURSES if
460 +dnl an ncurses.h that's been renamed to curses.h
462 +dnl CURSES_LIBS - sets -L and -l's appropriately
463 +dnl CFLAGS - if --with-sco, add -D_SVID3
464 +dnl has_curses - exports result of tests to rest of configure
468 +dnl 1) Add lines indicated below to acconfig.h
469 +dnl 2) call AC_CHECK_CURSES after AC_PROG_CC in your configure.in
470 +dnl 3) Instead of #include <curses.h> you should use the following to
471 +dnl properly locate ncurses or curses header file
473 +dnl #if defined(USE_NCURSES) && !defined(RENAMED_NCURSES)
474 +dnl #include <ncurses.h>
476 +dnl #include <curses.h>
479 +dnl 4) Make sure to add @CURSES_INCLUDEDIR@ to your preprocessor flags
480 +dnl 5) Make sure to add @CURSES_LIBS@ to your linker flags or LIBS
482 +dnl Notes with automake:
483 +dnl - call AM_CONDITIONAL(HAS_CURSES, test "$has_curses" = true) from
485 +dnl - your Makefile.am can look something like this
486 +dnl -----------------------------------------------
487 +dnl INCLUDES= blah blah blah $(CURSES_INCLUDEDIR)
489 +dnl CURSES_TARGETS=name_of_curses_prog
491 +dnl bin_PROGRAMS = other_programs $(CURSES_TARGETS)
492 +dnl other_programs_SOURCES = blah blah blah
493 +dnl name_of_curses_prog_SOURCES = blah blah blah
494 +dnl other_programs_LDADD = blah
495 +dnl name_of_curses_prog_LDADD = blah $(CURSES_LIBS)
496 +dnl -----------------------------------------------
499 +dnl The following lines should be added to acconfig.h:
500 +dnl ==================================================
502 +dnl /*=== Curses version detection defines ===*/
503 +dnl /* Found some version of curses that we're going to use */
504 +dnl #undef HAS_CURSES
506 +dnl /* Use SunOS SysV curses? */
507 +dnl #undef USE_SUNOS_CURSES
509 +dnl /* Use old BSD curses - not used right now */
510 +dnl #undef USE_BSD_CURSES
512 +dnl /* Use SystemV curses? */
513 +dnl #undef USE_SYSV_CURSES
515 +dnl /* Use Ncurses? */
516 +dnl #undef USE_NCURSES
518 +dnl /* If you Curses does not have color define this one */
519 +dnl #undef NO_COLOR_CURSES
521 +dnl /* Define if you want to turn on SCO-specific code */
522 +dnl #undef SCO_FLAVOR
524 +dnl /* Set to reflect version of ncurses *
525 +dnl * 0 = version 1.*
526 +dnl * 1 = version 1.9.9g
527 +dnl * 2 = version 4.0/4.1 */
528 +dnl #undef NCURSES_970530
530 +dnl /*=== End new stuff for acconfig.h ===*/
534 +AC_DEFUN(AC_CHECK_CURSES,[
535 + search_ncurses=true
539 + CFLAGS=${CFLAGS--O}
541 + AC_SUBST(CURSES_LIBS)
542 + AC_SUBST(CURSES_INCLUDEDIR)
545 + [ --with-sco Use this to turn on SCO-specific code],[
546 + if test x$withval = xyes; then
547 + AC_DEFINE(SCO_FLAVOR)
548 + CFLAGS="$CFLAGS -D_SVID3"
552 + AC_ARG_WITH(sunos-curses,
553 + [ --with-sunos-curses Used to force SunOS 4.x curses],[
554 + if test x$withval = xyes; then
555 + AC_USE_SUNOS_CURSES
559 + AC_ARG_WITH(osf1-curses,
560 + [ --with-osf1-curses Used to force OSF/1 curses],[
561 + if test x$withval = xyes; then
566 + AC_ARG_WITH(vcurses,
567 + [ --with-vcurses[=incdir] Used to force SysV curses],
568 + if test x$withval != xyes; then
569 + CURSES_INCLUDEDIR="-I$withval"
574 + AC_ARG_WITH(ncurses,
575 + [ --with-ncurses[=dir] Compile with ncurses/locate base dir],
576 + if test x$withval = xno ; then
577 + search_ncurses=false
578 + elif test x$withval != xyes ; then
579 + CURSES_LIBS="$LIBS -L$withval/lib -lncurses"
580 + CURSES_INCLUDEDIR="-I$withval/include"
581 + search_ncurses=false
582 + screen_manager="ncurses"
583 + AC_DEFINE(USE_NCURSES)
584 + AC_DEFINE(HAS_CURSES)
591 + AC_SEARCH_NCURSES()
598 +AC_DEFUN(AC_USE_SUNOS_CURSES, [
599 + search_ncurses=false
600 + screen_manager="SunOS 4.x /usr/5include curses"
601 + AC_MSG_RESULT(Using SunOS 4.x /usr/5include curses)
602 + AC_DEFINE(USE_SUNOS_CURSES)
603 + AC_DEFINE(HAS_CURSES)
605 + AC_DEFINE(NO_COLOR_CURSES)
606 + AC_DEFINE(USE_SYSV_CURSES)
607 + CURSES_INCLUDEDIR="-I/usr/5include"
608 + CURSES_LIBS="/usr/5lib/libcurses.a /usr/5lib/libtermcap.a"
609 + AC_MSG_RESULT(Please note that some screen refreshs may fail)
612 +AC_DEFUN(AC_USE_OSF1_CURSES, [
613 + AC_MSG_RESULT(Using OSF1 curses)
614 + search_ncurses=false
615 + screen_manager="OSF1 curses"
616 + AC_DEFINE(HAS_CURSES)
618 + AC_DEFINE(NO_COLOR_CURSES)
619 + AC_DEFINE(USE_SYSV_CURSES)
620 + CURSES_LIBS="-lcurses"
623 +AC_DEFUN(AC_USE_SYSV_CURSES, [
624 + AC_MSG_RESULT(Using SysV curses)
625 + AC_DEFINE(HAS_CURSES)
627 + AC_DEFINE(USE_SYSV_CURSES)
628 + search_ncurses=false
629 + screen_manager="SysV/curses"
630 + CURSES_LIBS="-lcurses"
633 +dnl AC_ARG_WITH(bsd-curses,
634 +dnl [--with-bsd-curses Used to compile with bsd curses, not very fancy],
635 +dnl search_ncurses=false
636 +dnl screen_manager="Ultrix/cursesX"
637 +dnl if test $system = ULTRIX
639 +dnl THIS_CURSES=cursesX
641 +dnl THIS_CURSES=curses
644 +dnl CURSES_LIBS="-l$THIS_CURSES -ltermcap"
645 +dnl AC_DEFINE(HAS_CURSES)
647 +dnl AC_DEFINE(USE_BSD_CURSES)
648 +dnl AC_MSG_RESULT(Please note that some screen refreshs may fail)
649 +dnl AC_MSG_WARN(Use of the bsdcurses extension has some)
650 +dnl AC_MSG_WARN(display/input problems.)
651 +dnl AC_MSG_WARN(Reconsider using xcurses)
656 +dnl Parameters: directory filename cureses_LIBS curses_INCLUDEDIR nicename
658 +AC_DEFUN(AC_NCURSES, [
663 + AC_MSG_RESULT(Found ncurses on $1/$2)
665 + CURSES_INCLUDEDIR="$4"
666 + search_ncurses=false
668 + AC_DEFINE(HAS_CURSES)
670 + AC_DEFINE(USE_NCURSES)
675 +AC_DEFUN(AC_SEARCH_NCURSES, [
676 + AC_CHECKING("location of ncurses.h file")
678 + AC_NCURSES(/usr/include, ncurses.h, -lncurses,, "ncurses on /usr/include")
679 + AC_NCURSES(/usr/include/ncurses, ncurses.h, -lncurses, -I/usr/include/ncurses, "ncurses on /usr/include/ncurses")
680 + AC_NCURSES(/usr/local/include, ncurses.h, -L/usr/local/lib -lncurses, -I/usr/local/include, "ncurses on /usr/local")
681 + AC_NCURSES(/usr/local/include/ncurses, ncurses.h, -L/usr/local/lib -L/usr/local/lib/ncurses -lncurses, -I/usr/local/include/ncurses, "ncurses on /usr/local/include/ncurses")
683 + AC_NCURSES(/usr/local/include/ncurses, curses.h, -L/usr/local/lib -lncurses, -I/usr/local/include/ncurses -DRENAMED_NCURSES, "renamed ncurses on /usr/local/.../ncurses")
685 + AC_NCURSES(/usr/include/ncurses, curses.h, -lncurses, -I/usr/include/ncurses -DRENAMED_NCURSES, "renamed ncurses on /usr/include/ncurses")
688 + dnl We couldn't find ncurses, try SysV curses
692 + AC_EGREP_HEADER(init_color, /usr/include/curses.h,
693 + AC_USE_SYSV_CURSES)
694 + AC_EGREP_CPP(USE_NCURSES,[
701 + CURSES_INCLUDEDIR="$CURSES_INCLUDEDIR -DRENAMED_NCURSES"
702 + AC_DEFINE(HAS_CURSES)
704 + AC_DEFINE(USE_NCURSES)
705 + search_ncurses=false
706 + screen_manager="ncurses installed as curses"
711 + dnl Try SunOS 4.x /usr/5{lib,include} ncurses
712 + dnl The flags USE_SUNOS_CURSES, USE_BSD_CURSES and BUGGY_CURSES
713 + dnl should be replaced by a more fine grained selection routine
717 + if test -f /usr/5include/curses.h
719 + AC_USE_SUNOS_CURSES
722 + # check for ncurses version, to properly ifdef mouse-fix
723 + AC_MSG_CHECKING(for ncurses version)
724 + ncurses_version=unknown
725 +cat > conftest.$ac_ext <<EOF
726 +[#]line __oline__ "configure"
727 +#include "confdefs.h"
728 +#ifdef RENAMED_NCURSES
731 +#include <ncurses.h>
734 +VERSION:NCURSES_VERSION
736 + if (eval "$ac_cpp conftest.$ac_ext") 2>&AC_FD_CC |
737 + egrep "VERSION:" >conftest.out 2>&1; then
739 + ncurses_version=`cat conftest.out|sed -e 's/^[^"]*"//' -e 's/".*//'`
743 + AC_MSG_RESULT($ncurses_version)
744 + case "$ncurses_version" in
748 + AC_DEFINE(NCURSES_970530,2)
751 + AC_DEFINE(NCURSES_970530,1)
754 + AC_DEFINE(NCURSES_970530,0)
765 +# Define a conditional.
767 +AC_DEFUN(AM_CONDITIONAL,
778 +# Do all the work for Automake. This macro actually does too much --
779 +# some checks are only needed if your package does certain things.
780 +# But this isn't really a big deal.
785 +dnl AM_INIT_AUTOMAKE(package,version, [no-define])
787 +AC_DEFUN(AM_INIT_AUTOMAKE,
788 +[AC_REQUIRE([AC_PROG_INSTALL])
789 +dnl We require 2.13 because we rely on SHELL being computed by configure.
795 +dnl test to see if srcdir already configured
796 +if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
797 + AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
800 +AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
801 +AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
802 +AC_REQUIRE([AM_SANITY_CHECK])
803 +AC_REQUIRE([AC_ARG_PROGRAM])
804 +dnl FIXME This is truly gross.
805 +missing_dir=`cd $ac_aux_dir && pwd`
806 +AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
807 +AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
808 +AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
809 +AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
810 +AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
811 +AC_REQUIRE([AC_PROG_MAKE_SET])])
814 +# Check to make sure that the build environment is sane.
817 +AC_DEFUN(AM_SANITY_CHECK,
818 +[AC_MSG_CHECKING([whether build environment is sane])
821 +echo timestamp > conftestfile
822 +# Do `set' in a subshell so we don't clobber the current shell's
823 +# arguments. Must try -L first in case configure is actually a
824 +# symlink; some systems play weird games with the mod time of symlinks
825 +# (eg FreeBSD returns the mod time of the symlink's containing
828 + set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
829 + if test "[$]*" = "X"; then
831 + set X `ls -t $srcdir/configure conftestfile`
833 + if test "[$]*" != "X $srcdir/configure conftestfile" \
834 + && test "[$]*" != "X conftestfile $srcdir/configure"; then
836 + # If neither matched, then we have a broken ls. This can happen
837 + # if, for instance, CONFIG_SHELL is bash and it inherits a
838 + # broken ls alias from the environment. This has actually
839 + # happened. Such a system could not be considered "sane".
840 + AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
841 +alias in your environment])
844 + test "[$]2" = conftestfile
850 + AC_MSG_ERROR([newly created file is older than distributed files!
851 +Check your system clock])
854 +AC_MSG_RESULT(yes)])
856 +dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
857 +dnl The program must properly implement --version.
858 +AC_DEFUN(AM_MISSING_PROG,
859 +[AC_MSG_CHECKING(for working $2)
860 +# Run test in a subshell; some versions of sh will print an error if
861 +# an executable is not found, even if stderr is redirected.
862 +# Redirect stdin to placate older versions of autoconf. Sigh.
863 +if ($2 --version) < /dev/null > /dev/null 2>&1; then
865 + AC_MSG_RESULT(found)
868 + AC_MSG_RESULT(missing)
872 +# Like AC_CONFIG_HEADER, but automatically create stamp file.
874 +AC_DEFUN(AM_CONFIG_HEADER,
876 +AC_CONFIG_HEADER([$1])
877 +dnl When config.status generates a header, we must update the stamp-h file.
878 +dnl This file resides in the same directory as the config header
879 +dnl that is generated. We must strip everything past the first ":",
880 +dnl and everything past the last "/".
881 +AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
882 +ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>,
883 +<<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>,
885 +for am_file in <<$1>>; do
886 + case " <<$>>CONFIG_HEADERS " in
887 + *" <<$>>am_file "*<<)>>
888 + echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx
891 + am_indx=`expr "<<$>>am_indx" + 1`
896 +# serial 40 AC_PROG_LIBTOOL
897 +AC_DEFUN(AC_PROG_LIBTOOL,
898 +[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
900 +# Save cache, so that ltconfig can load it
903 +# Actually configure libtool. ac_aux_dir is where install-sh is found.
904 +CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
905 +LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
906 +LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" \
907 +DLLTOOL="$DLLTOOL" AS="$AS" OBJDUMP="$OBJDUMP" \
908 +${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \
909 +$libtool_flags --no-verify $ac_aux_dir/ltmain.sh $lt_target \
910 +|| AC_MSG_ERROR([libtool configure failed])
912 +# Reload cache, that may have been modified by ltconfig
915 +# This can be used to rebuild libtool when needed
916 +LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh"
918 +# Always use our own libtool.
919 +LIBTOOL='$(SHELL) $(top_builddir)/libtool'
920 +AC_SUBST(LIBTOOL)dnl
922 +# Redirect the config.log output again, so that the ltconfig log is not
923 +# clobbered by the next message.
924 +exec 5>>./config.log
927 +AC_DEFUN(AC_LIBTOOL_SETUP,
929 +AC_REQUIRE([AC_ENABLE_SHARED])dnl
930 +AC_REQUIRE([AC_ENABLE_STATIC])dnl
931 +AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
932 +AC_REQUIRE([AC_CANONICAL_HOST])dnl
933 +AC_REQUIRE([AC_CANONICAL_BUILD])dnl
934 +AC_REQUIRE([AC_PROG_RANLIB])dnl
935 +AC_REQUIRE([AC_PROG_CC])dnl
936 +AC_REQUIRE([AC_PROG_LD])dnl
937 +AC_REQUIRE([AC_PROG_NM])dnl
938 +AC_REQUIRE([AC_PROG_LN_S])dnl
942 +NONE) lt_target="$host" ;;
943 +*) lt_target="$target" ;;
946 +# Check for any special flags to pass to ltconfig.
948 +# the following will cause an existing older ltconfig to fail, so
949 +# we ignore this at the expense of the cache file... Checking this
950 +# will just take longer ... bummer!
951 +#libtool_flags="--cache-file=$cache_file"
953 +test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
954 +test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
955 +test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install"
956 +test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
957 +test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
958 +ifdef([AC_PROVIDE_AC_LIBTOOL_DLOPEN],
959 +[libtool_flags="$libtool_flags --enable-dlopen"])
960 +ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
961 +[libtool_flags="$libtool_flags --enable-win32-dll"])
962 +AC_ARG_ENABLE(libtool-lock,
963 + [ --disable-libtool-lock avoid locking (might break parallel builds)])
964 +test "x$enable_libtool_lock" = xno && libtool_flags="$libtool_flags --disable-lock"
965 +test x"$silent" = xyes && libtool_flags="$libtool_flags --silent"
967 +# Some flags need to be propagated to the compiler or linker for good
969 +case "$lt_target" in
971 + # Find out which ABI we are using.
972 + echo '[#]line __oline__ "configure"' > conftest.$ac_ext
973 + if AC_TRY_EVAL(ac_compile); then
974 + case "`/usr/bin/file conftest.o`" in
990 + # On SCO OpenServer 5, we need -belf to get full-featured binaries.
991 + SAVE_CFLAGS="$CFLAGS"
992 + CFLAGS="$CFLAGS -belf"
993 + AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
994 + [AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])])
995 + if test x"$lt_cv_cc_needs_belf" != x"yes"; then
996 + # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
997 + CFLAGS="$SAVE_CFLAGS"
1001 +ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
1002 +[*-*-cygwin* | *-*-mingw*)
1003 + AC_CHECK_TOOL(DLLTOOL, dlltool, false)
1004 + AC_CHECK_TOOL(AS, as, false)
1005 + AC_CHECK_TOOL(OBJDUMP, objdump, false)
1011 +# AC_LIBTOOL_DLOPEN - enable checks for dlopen support
1012 +AC_DEFUN(AC_LIBTOOL_DLOPEN, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])])
1014 +# AC_LIBTOOL_WIN32_DLL - declare package support for building win32 dll's
1015 +AC_DEFUN(AC_LIBTOOL_WIN32_DLL, [AC_BEFORE([$0], [AC_LIBTOOL_SETUP])])
1017 +# AC_ENABLE_SHARED - implement the --enable-shared flag
1018 +# Usage: AC_ENABLE_SHARED[(DEFAULT)]
1019 +# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
1021 +AC_DEFUN(AC_ENABLE_SHARED, [dnl
1022 +define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
1023 +AC_ARG_ENABLE(shared,
1024 +changequote(<<, >>)dnl
1025 +<< --enable-shared[=PKGS] build shared libraries [default=>>AC_ENABLE_SHARED_DEFAULT],
1026 +changequote([, ])dnl
1027 +[p=${PACKAGE-default}
1028 +case "$enableval" in
1029 +yes) enable_shared=yes ;;
1030 +no) enable_shared=no ;;
1033 + # Look at the argument we got. We use all the common list separators.
1034 + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
1035 + for pkg in $enableval; do
1036 + if test "X$pkg" = "X$p"; then
1040 + IFS="$ac_save_ifs"
1043 +enable_shared=AC_ENABLE_SHARED_DEFAULT)dnl
1046 +# AC_DISABLE_SHARED - set the default shared flag to --disable-shared
1047 +AC_DEFUN(AC_DISABLE_SHARED, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
1048 +AC_ENABLE_SHARED(no)])
1050 +# AC_ENABLE_STATIC - implement the --enable-static flag
1051 +# Usage: AC_ENABLE_STATIC[(DEFAULT)]
1052 +# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
1054 +AC_DEFUN(AC_ENABLE_STATIC, [dnl
1055 +define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
1056 +AC_ARG_ENABLE(static,
1057 +changequote(<<, >>)dnl
1058 +<< --enable-static[=PKGS] build static libraries [default=>>AC_ENABLE_STATIC_DEFAULT],
1059 +changequote([, ])dnl
1060 +[p=${PACKAGE-default}
1061 +case "$enableval" in
1062 +yes) enable_static=yes ;;
1063 +no) enable_static=no ;;
1066 + # Look at the argument we got. We use all the common list separators.
1067 + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
1068 + for pkg in $enableval; do
1069 + if test "X$pkg" = "X$p"; then
1073 + IFS="$ac_save_ifs"
1076 +enable_static=AC_ENABLE_STATIC_DEFAULT)dnl
1079 +# AC_DISABLE_STATIC - set the default static flag to --disable-static
1080 +AC_DEFUN(AC_DISABLE_STATIC, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
1081 +AC_ENABLE_STATIC(no)])
1084 +# AC_ENABLE_FAST_INSTALL - implement the --enable-fast-install flag
1085 +# Usage: AC_ENABLE_FAST_INSTALL[(DEFAULT)]
1086 +# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
1088 +AC_DEFUN(AC_ENABLE_FAST_INSTALL, [dnl
1089 +define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
1090 +AC_ARG_ENABLE(fast-install,
1091 +changequote(<<, >>)dnl
1092 +<< --enable-fast-install[=PKGS] optimize for fast installation [default=>>AC_ENABLE_FAST_INSTALL_DEFAULT],
1093 +changequote([, ])dnl
1094 +[p=${PACKAGE-default}
1095 +case "$enableval" in
1096 +yes) enable_fast_install=yes ;;
1097 +no) enable_fast_install=no ;;
1099 + enable_fast_install=no
1100 + # Look at the argument we got. We use all the common list separators.
1101 + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
1102 + for pkg in $enableval; do
1103 + if test "X$pkg" = "X$p"; then
1104 + enable_fast_install=yes
1107 + IFS="$ac_save_ifs"
1110 +enable_fast_install=AC_ENABLE_FAST_INSTALL_DEFAULT)dnl
1113 +# AC_ENABLE_FAST_INSTALL - set the default to --disable-fast-install
1114 +AC_DEFUN(AC_DISABLE_FAST_INSTALL, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
1115 +AC_ENABLE_FAST_INSTALL(no)])
1117 +# AC_PROG_LD - find the path to the GNU or non-GNU linker
1118 +AC_DEFUN(AC_PROG_LD,
1119 +[AC_ARG_WITH(gnu-ld,
1120 +[ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
1121 +test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
1122 +AC_REQUIRE([AC_PROG_CC])dnl
1123 +AC_REQUIRE([AC_CANONICAL_HOST])dnl
1124 +AC_REQUIRE([AC_CANONICAL_BUILD])dnl
1126 +if test "$ac_cv_prog_gcc" = yes; then
1127 + # Check if gcc -print-prog-name=ld gives a path.
1128 + AC_MSG_CHECKING([for ld used by GCC])
1129 + ac_prog=`($CC -print-prog-name=ld) 2>&5`
1130 + case "$ac_prog" in
1131 + # Accept absolute paths.
1133 + [\\/]* | [A-Za-z]:[\\/]*)
1134 + re_direlt='/[^/][^/]*/\.\./'
1135 +changequote([,])dnl
1136 + # Canonicalize the path of ld
1137 + ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
1138 + while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
1139 + ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
1141 + test -z "$LD" && LD="$ac_prog"
1144 + # If it fails, then pretend we aren't using GCC.
1148 + # If it is relative, then search for the first ld in PATH.
1149 + with_gnu_ld=unknown
1152 +elif test "$with_gnu_ld" = yes; then
1153 + AC_MSG_CHECKING([for GNU ld])
1155 + AC_MSG_CHECKING([for non-GNU ld])
1157 +AC_CACHE_VAL(ac_cv_path_LD,
1158 +[if test -z "$LD"; then
1159 + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
1160 + for ac_dir in $PATH; do
1161 + test -z "$ac_dir" && ac_dir=.
1162 + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
1163 + ac_cv_path_LD="$ac_dir/$ac_prog"
1164 + # Check to see if the program is GNU ld. I'd rather use --version,
1165 + # but apparently some GNU ld's only accept -v.
1166 + # Break only if it was the GNU/non-GNU ld that we prefer.
1167 + if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
1168 + test "$with_gnu_ld" != no && break
1170 + test "$with_gnu_ld" != yes && break
1174 + IFS="$ac_save_ifs"
1176 + ac_cv_path_LD="$LD" # Let the user override the test with a path.
1178 +LD="$ac_cv_path_LD"
1179 +if test -n "$LD"; then
1180 + AC_MSG_RESULT($LD)
1184 +test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
1188 +AC_DEFUN(AC_PROG_LD_GNU,
1189 +[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], ac_cv_prog_gnu_ld,
1190 +[# I'd rather use --version here, but apparently some GNU ld's only accept -v.
1191 +if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
1192 + ac_cv_prog_gnu_ld=yes
1194 + ac_cv_prog_gnu_ld=no
1198 +# AC_PROG_NM - find the path to a BSD-compatible name lister
1199 +AC_DEFUN(AC_PROG_NM,
1200 +[AC_MSG_CHECKING([for BSD-compatible nm])
1201 +AC_CACHE_VAL(ac_cv_path_NM,
1202 +[if test -n "$NM"; then
1203 + # Let the user override the test.
1204 + ac_cv_path_NM="$NM"
1206 + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
1207 + for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
1208 + test -z "$ac_dir" && ac_dir=.
1209 + if test -f $ac_dir/nm || test -f $ac_dir/nm$ac_exeext ; then
1210 + # Check to see if the nm accepts a BSD-compat flag.
1211 + # Adding the `sed 1q' prevents false positives on HP-UX, which says:
1212 + # nm: unknown option "B" ignored
1213 + if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
1214 + ac_cv_path_NM="$ac_dir/nm -B"
1216 + elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
1217 + ac_cv_path_NM="$ac_dir/nm -p"
1220 + ac_cv_path_NM=${ac_cv_path_NM="$ac_dir/nm"} # keep the first match, but
1221 + continue # so that we can try to find one that supports BSD flags
1225 + IFS="$ac_save_ifs"
1226 + test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
1228 +NM="$ac_cv_path_NM"
1229 +AC_MSG_RESULT([$NM])
1232 +# AC_CHECK_LIBM - check for math library
1233 +AC_DEFUN(AC_CHECK_LIBM,
1234 +[AC_REQUIRE([AC_CANONICAL_HOST])dnl
1236 +case "$lt_target" in
1237 +*-*-beos* | *-*-cygwin*)
1238 + # These system don't have libm
1241 + AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
1242 + AC_CHECK_LIB(m, main, LIBM="$LIBM -lm")
1245 + AC_CHECK_LIB(m, main, LIBM="-lm")
1250 +# AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for
1251 +# the libltdl convenience library and INCLTDL to the include flags for
1252 +# the libltdl header and adds --enable-ltdl-convenience to the
1253 +# configure arguments. Note that LIBLTDL and INCLTDL are not
1254 +# AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called. If DIR is not
1255 +# provided, it is assumed to be `libltdl'. LIBLTDL will be prefixed
1256 +# with '${top_builddir}/' and INCLTDL will be prefixed with
1257 +# '${top_srcdir}/' (note the single quotes!). If your package is not
1258 +# flat and you're not using automake, define top_builddir and
1259 +# top_srcdir appropriately in the Makefiles.
1260 +AC_DEFUN(AC_LIBLTDL_CONVENIENCE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
1261 + case "$enable_ltdl_convenience" in
1262 + no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
1263 + "") enable_ltdl_convenience=yes
1264 + ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
1266 + LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la
1267 + INCLTDL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
1270 +# AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for
1271 +# the libltdl installable library and INCLTDL to the include flags for
1272 +# the libltdl header and adds --enable-ltdl-install to the configure
1273 +# arguments. Note that LIBLTDL and INCLTDL are not AC_SUBSTed, nor is
1274 +# AC_CONFIG_SUBDIRS called. If DIR is not provided and an installed
1275 +# libltdl is not found, it is assumed to be `libltdl'. LIBLTDL will
1276 +# be prefixed with '${top_builddir}/' and INCLTDL will be prefixed
1277 +# with '${top_srcdir}/' (note the single quotes!). If your package is
1278 +# not flat and you're not using automake, define top_builddir and
1279 +# top_srcdir appropriately in the Makefiles.
1280 +# In the future, this macro may have to be called after AC_PROG_LIBTOOL.
1281 +AC_DEFUN(AC_LIBLTDL_INSTALLABLE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
1282 + AC_CHECK_LIB(ltdl, main,
1283 + [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no],
1284 + [if test x"$enable_ltdl_install" = xno; then
1285 + AC_MSG_WARN([libltdl not installed, but installation disabled])
1287 + enable_ltdl_install=yes
1290 + if test x"$enable_ltdl_install" = x"yes"; then
1291 + ac_configure_args="$ac_configure_args --enable-ltdl-install"
1292 + LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la
1293 + INCLTDL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
1295 + ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
1302 +AC_DEFUN(AM_PROG_LIBTOOL, [indir([AC_PROG_LIBTOOL])])dnl
1303 +AC_DEFUN(AM_ENABLE_SHARED, [indir([AC_ENABLE_SHARED], $@)])dnl
1304 +AC_DEFUN(AM_ENABLE_STATIC, [indir([AC_ENABLE_STATIC], $@)])dnl
1305 +AC_DEFUN(AM_DISABLE_SHARED, [indir([AC_DISABLE_SHARED], $@)])dnl
1306 +AC_DEFUN(AM_DISABLE_STATIC, [indir([AC_DISABLE_STATIC], $@)])dnl
1307 +AC_DEFUN(AM_PROG_LD, [indir([AC_PROG_LD])])dnl
1308 +AC_DEFUN(AM_PROG_NM, [indir([AC_PROG_NM])])dnl
1310 +dnl This is just to silence aclocal about the macro not being used
1311 +ifelse([AC_DISABLE_FAST_INSTALL])dnl
1313 diff -Nru dalc-0.1/configure.in dalc-0.1.new/configure.in
1314 --- dalc-0.1/configure.in Thu Jan 1 01:00:00 1970
1315 +++ dalc-0.1.new/configure.in Fri Nov 24 16:28:43 2000
1317 +dnl Process this file with autoconf to produce a configure script.
1320 +AM_INIT_AUTOMAKE(dalc, 0.1)
1321 +AM_CONFIG_HEADER(config.h)
1323 +dnl Checks for programs.
1328 +dnl Checks for libraries.
1329 +dnl Replace `main' with a function in -lm:
1330 +AC_CHECK_LIB(m, main)
1331 +dnl Replace `main' with a function in -lmenu:
1332 +AC_CHECK_LIB(menu, main)
1333 +dnl Replace `main' with a function in -lncurses:
1334 +AC_CHECK_LIB(ncurses, main)
1336 +dnl Checks for header files.
1338 +AC_CHECK_HEADERS(unistd.h)
1340 +dnl Checks for typedefs, structures, and compiler characteristics.
1343 +dnl Checks for library functions.
1344 +AC_CHECK_FUNCS(strerror strstr)
1348 +AC_OUTPUT(Makefile)
1349 diff -Nru dalc-0.1/dalc.C dalc-0.1.new/dalc.C
1350 --- dalc-0.1/dalc.C Thu Dec 9 08:01:35 1999
1351 +++ dalc-0.1.new/dalc.C Thu Jan 1 01:00:00 1970
1355 - * A powerful scientific DAL calculator
1356 - * Copyright (C) 1999 Daniel Beer
1358 - * This program is free software; you can redistribute it and/or modify
1359 - * it under the terms of the GNU General Public License as published by
1360 - * the Free Software Foundation; either version 2 of the License, or
1361 - * (at your option) any later version.
1363 - * This program is distributed in the hope that it will be useful,
1364 - * but WITHOUT ANY WARRANTY; without even the implied warranty of
1365 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1366 - * GNU General Public License for more details.
1368 - * You should have received a copy of the GNU General Public License
1369 - * along with this program; if not, write to the Free Software
1370 - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
1373 -#include <ncurses.h>
1376 -#include <strings.h>
1378 -#include <unistd.h>
1379 -#include <stdlib.h>
1382 -#include "dalexpr.h"
1384 -#define MAXITEMS 12
1385 -#define MAXINPUT 70
1390 -#define MAXSTAT 100
1394 -typedef void (*callback_t)(void);
1399 - char text[MAXINPUT];
1401 -} history[HISTORY];
1409 - ITEM *bar[MAXITEMS];
1410 - callback_t funcs[MAXITEMS];
1420 -double xpoints[MAXSTAT], ypoints[MAXSTAT];
1422 -char messages[MAXMSG][MSGSIZE];
1425 -addMessage(char *text) {
1428 - for(i=MAXMSG-1;i;i--) strcpy(messages[i], messages[i-1]);
1429 - strncpy(messages[0], text, MSGSIZE);
1438 - for(i=0;i<MAXMSG;i++) mvaddstr(LINES-3-i, 0, messages[i]);
1440 - mvaddstr(LINES-2, 0, " Dalc version 0.1");
1442 - mvaddstr(LINES-2, COLS/2, "Copyright (C) 1999 Daniel Beer");
1452 - sprintf(inp, "%s/.dalcrc", getenv("HOME"));
1453 - if((io=fopen(inp, "w"))!=NULL) {
1454 - fprintf(io, "%e %e\n", foo.dtr, foo.ans);
1455 - for(i=0;i<26;i++) fprintf(io, "%e\n", foo.vars[i]);
1468 - mvaddstr(LINES-1, 0, "Stats file: ");
1472 - getnstr(inp, sizeof(inp));
1474 - if((io=fopen(inp, "r"))==NULL) {
1475 - addMessage(strerror(errno));
1480 - fscanf(io, "%s", inp);
1481 - while(!feof(io)) {
1482 - temp=strstr(inp, ";");
1484 - stats[numstat].val=atof(inp);
1485 - stats[numstat].freq=1;
1486 - foo.vars[13]+=1.0;
1489 - stats[numstat].val=atof(inp);
1490 - stats[numstat].freq=atoi(temp);
1491 - foo.vars[13]+=stats[numstat].freq;
1493 - if(numstat<MAXSTAT-1) numstat++;
1494 - fscanf(io, "%s", inp);
1506 - mvaddstr(LINES-1, 0, "Points file: ");
1510 - getnstr(inp, sizeof(inp));
1512 - if((io=fopen(inp, "r"))==NULL) {
1513 - addMessage(strerror(errno));
1516 - fscanf(io, "%s", inp);
1518 - while(!feof(io)) {
1519 - temp=strstr(inp, ",");
1522 - if(temp[0]=='_') temp[0]='-';
1524 - if(inp[0]=='_') inp[0]='-';
1525 - xpoints[numpoints]=atof(inp);
1526 - ypoints[numpoints]=atof(temp);
1527 - if(numpoints<MAXSTAT-1) numpoints++;
1528 - fscanf(io, "%s", inp);
1534 -angleRadians(void) {
1536 - addMessage("Working in radians.");
1540 -angleDegrees(void) {
1541 - foo.dtr=M_PI/180.0;
1542 - addMessage("Working in degrees.");
1546 -angleCustom(void) {
1550 - mvaddstr(LINES-1, 0, "Number of units in a circle: ");
1554 - getnstr(inp, sizeof(inp));
1556 - foo.dtr=(M_PI*2)/atof(inp);
1564 - mvaddstr(LINES-1, 0, "Variable (A-Z) or F2 to cancel: ");
1566 - while(!isalpha(k)) {
1568 - if(k==KEY_F(2)) return;
1570 - if(islower(k)) k-=32;
1571 - foo.vars[k-'A']=foo.ans;
1581 - mvaddstr(LINES-1, 0, "Expression: ");
1585 - getnstr(inp, sizeof(inp));
1587 - for(i=0;i<numstat;i++) {
1588 - foo.vars[23]=stats[i].val;
1589 - foo.evaluate(inp);
1590 - sum+=foo.ans*stats[i].freq;
1595 - snprintf(messages[0], MSGSIZE, " (sum) = %e, %f", foo.ans, foo.ans);
1602 - x=foo.regressQuadratic(xpoints, ypoints, numpoints);
1604 - snprintf(messages[0], MSGSIZE, "Match = %f", x);
1606 - snprintf(messages[0], MSGSIZE, "f(X) = %fX^2 + %fX + %f",
1607 - foo.coeff.a, foo.coeff.b, foo.coeff.c);
1609 - snprintf(messages[0], MSGSIZE, "fd(X) = %fX + %f",
1610 - foo.coeff.a*2, foo.coeff.b);
1612 - snprintf(messages[0], MSGSIZE, "fi(X) = %fX^3 + %fX^2 + %fX",
1613 - foo.coeff.a/3, foo.coeff.b/2, foo.coeff.c);
1619 - x=foo.regressLinear(xpoints, ypoints, numpoints);
1621 - snprintf(messages[0], MSGSIZE, "Match = %f", x);
1623 - snprintf(messages[0], MSGSIZE, "f(X) = %fX + %f",
1624 - foo.coeff.a, foo.coeff.b);
1626 - snprintf(messages[0], MSGSIZE, "fd(X) = %f",
1629 - snprintf(messages[0], MSGSIZE, "fi(X) = %fX^2 + %fX",
1630 - foo.coeff.a/2, foo.coeff.b);
1635 - char inp[200], inp2[200];
1636 - int values[GSIZE+1], valuesS[GSIZE+1];
1641 - mvaddstr(LINES-1, 0, "Function: ");
1645 - getnstr(inp, sizeof(inp));
1648 - mvaddstr(LINES-1, 0, "Second function (enter if none): ");
1652 - getnstr(inp2, sizeof(inp2));
1654 - for(x=0;x<=GSIZE;x++) {
1655 - foo.vars[23]=((double)x-GSIZE/2)/GSPACE;
1656 - foo.evaluate(inp);
1657 - values[x]=(int)((0.0-foo.ans)*GSPACE+GSIZE/2);
1660 - for(x=0;x<=GSIZE;x++) {
1661 - foo.vars[23]=((double)x-GSIZE/2)/GSPACE;
1662 - foo.evaluate(inp2);
1663 - valuesS[x]=(int)((0.0-foo.ans)*GSPACE+GSIZE/2);
1666 - sprintf(inp, "/tmp/dalc%d.ppm", getpid());
1667 - if((io=fopen(inp, "w"))==NULL) {
1668 - addMessage(strerror(errno));
1671 - fprintf(io, "P6\n%d %d\n255\n", GSIZE, GSIZE);
1672 - for(y=0;y<GSIZE;y++) for(x=0;x<GSIZE;x++) {
1673 - if(y>=values[x]&&y<=values[x+1]) fprintf(io, "%c%c%c", 0, 0, 0);
1674 - else if(y<=values[x]&&y>=values[x+1]) fprintf(io, "%c%c%c", 0, 0, 0);
1675 - else if(y>=valuesS[x]&&y<=valuesS[x+1]&&inp2[0])
1676 - fprintf(io, "%c%c%c", 192, 0, 0);
1677 - else if(y<=valuesS[x]&&y>=valuesS[x+1]&&inp2[0])
1678 - fprintf(io, "%c%c%c", 192, 0, 0);
1679 - else if(abs(x-GSIZE/2)<=1||abs(y-GSIZE/2)<=1||!(x%GSPACE&&y%GSPACE))
1680 - fprintf(io, "%c%c%c", 0, 0, 192);
1681 - else fprintf(io, "%c%c%c", 255, 255, 255);
1684 - if(getenv("DISPLAY")!=NULL) {
1687 - addMessage(strerror(errno));
1690 - execlp(VIEWER, VIEWER, inp, NULL);
1695 - mvaddstr(LINES-1, 0, "Save file as (*.gif, press enter to not save): ");
1699 - getnstr(inp2, sizeof(inp2));
1702 - sprintf(inp, "%s /tmp/dalc%d.ppm > %s", CONVERTER, getpid(), inp2);
1703 - if(system(inp)<0) addMessage(strerror(errno));
1705 - snprintf(inp, sizeof(inp), "/tmp/dalc%d.ppm", getpid());
1715 - sprintf(inp, "%s/.dalcrc", getenv("HOME"));
1716 - if((io=fopen(inp, "r"))!=NULL) {
1717 - fscanf(io, "%le%le", &foo.dtr, &foo.ans);
1718 - for(i=0;i<26;i++) fscanf(io, "%le", &foo.vars[i]);
1722 - for(i=0;i<MAXMSG;i++) messages[i][0]=0;
1723 - addMessage("Press F2 to toggle a menu.");
1726 - menu.bar[0]=new_item(" Store ", " Store last result as a variable. ");
1727 - menu.funcs[0]=saveVar;
1728 - menu.bar[1]=new_item(" Load stats ", " Load statistical data from file. ");
1729 - menu.funcs[1]=loadStats;
1730 - menu.bar[2]=new_item(" Sumstat ", " Evaluate an expression for each stat. ");
1731 - menu.funcs[2]=sumStat;
1732 - menu.bar[3]=new_item(" Graph ", " Graph a function. ");
1733 - menu.funcs[3]=graphFunc;
1734 - menu.bar[4]=new_item(" Load points ", " Load graph points from a file. ");
1735 - menu.funcs[4]=loadPoints;
1736 - menu.bar[5]=new_item(" Quadratic ", " Attempt a quadratic regression. ");
1737 - menu.funcs[5]=quadratic;
1738 - menu.bar[6]=new_item(" Linear ", " Attempt a linear regression. ");
1739 - menu.funcs[6]=linear;
1740 - menu.bar[7]=new_item(" Radians ", " Measure angles in radians. ");
1741 - menu.funcs[7]=angleRadians;
1742 - menu.bar[8]=new_item(" Degrees ", " Measure angles in degrees. ");
1743 - menu.funcs[8]=angleDegrees;
1744 - menu.bar[9]=new_item(" Custom angles ",
1745 - " Specify an angular measurement system. ");
1746 - menu.funcs[9]=angleCustom;
1747 - menu.bar[10]=new_item(" Exit ", " Exit the program. ");
1748 - menu.funcs[10]=quitProg;
1749 - menu.bar[11]=NULL;
1751 - menu.foo=new_menu(menu.bar);
1752 - set_menu_mark(menu.foo, "* ");
1763 - post_menu(menu.foo);
1764 - while(k!=KEY_F(2)) {
1768 - if(--menu.s<0) menu.s=menu.max-1;
1769 - set_current_item(menu.foo, menu.bar[menu.s]);
1772 - if(++menu.s>=menu.max) menu.s=0;
1773 - set_current_item(menu.foo, menu.bar[menu.s]);
1776 - menu.funcs[menu.s]();
1781 - unpost_menu(menu.foo);
1786 -expressionMode(void) {
1787 - unsigned int k=0, y=0, i, j;
1789 - history[y].text[0]=0;
1794 - mvaddstr(LINES-1, 0, "> ");
1796 - addstr(history[y].text);
1798 - move(LINES-1, history[y].x+LMARGIN);
1800 - if(k>=' '&&k<127&&(j=strlen(history[y].text))<MAXINPUT-1) {
1801 - history[y].text[j+1]=0;
1802 - for(i=j;i>history[y].x;i--) history[y].text[i]=history[y].text[i-1];
1803 - history[y].text[history[y].x++]=k;
1804 - } else if((k==8||k==127||k==KEY_BACKSPACE)&&
1805 - history[y].text[0]&&history[y].x) {
1806 - j=strlen(history[y].text);
1808 - for(i=history[y].x;i<j;) history[y].text[i]=history[y].text[++i];
1809 - } else if(k==4&&history[y].x<strlen(history[y].text)) {
1810 - j=strlen(history[y].text);
1811 - for(i=history[y].x;i<j;) history[y].text[i]=history[y].text[++i];
1812 - } else if(k==KEY_LEFT&&history[y].x) history[y].x--;
1813 - else if(k==KEY_RIGHT&&history[y].x<strlen(history[y].text)) history[y].x++;
1814 - else if(k==KEY_F(2)) showMenu();
1815 - else if(k==1) history[y].x=0;
1816 - else if(k==5) history[y].x=strlen(history[y].text);
1817 - else if(k=='\n'&&history[y].text[0]) {
1818 - foo.evaluate(history[y].text);
1819 - addMessage(history[y].text);
1821 - snprintf(messages[0], MSGSIZE, " = %e, %f", foo.ans, foo.ans);
1823 - strcpy(history[0].text, history[y].text);
1824 - history[0].x=history[y].x;
1825 - for(i=HISTORY-1;i;i--) {
1826 - history[i].x=history[i-1].x;
1827 - strcpy(history[i].text, history[i-1].text);
1829 - history[0].text[0]=0;
1832 - } else if(k==KEY_UP&&y<HISTORY-1) y++;
1833 - else if(k==KEY_DOWN&&y) y--;
1834 - else if(k==12) drawScreen();
1843 - keypad(stdscr, TRUE);
1848 diff -Nru dalc-0.1/dalc.cc dalc-0.1.new/dalc.cc
1849 --- dalc-0.1/dalc.cc Thu Jan 1 01:00:00 1970
1850 +++ dalc-0.1.new/dalc.cc Fri Nov 24 15:58:24 2000
1854 + * A powerful scientific DAL calculator
1855 + * Copyright (C) 1999 Daniel Beer
1857 + * This program is free software; you can redistribute it and/or modify
1858 + * it under the terms of the GNU General Public License as published by
1859 + * the Free Software Foundation; either version 2 of the License, or
1860 + * (at your option) any later version.
1862 + * This program is distributed in the hope that it will be useful,
1863 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
1864 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1865 + * GNU General Public License for more details.
1867 + * You should have received a copy of the GNU General Public License
1868 + * along with this program; if not, write to the Free Software
1869 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
1872 +#include <ncurses.h>
1875 +#include <string.h>
1877 +#include <unistd.h>
1878 +#include <stdlib.h>
1881 +#include "dalexpr.h"
1883 +#define MAXITEMS 12
1884 +#define MAXINPUT 70
1889 +#define MAXSTAT 100
1893 +typedef void (*callback_t)(void);
1898 + char text[MAXINPUT];
1900 +} history[HISTORY];
1908 + ITEM *bar[MAXITEMS];
1909 + callback_t funcs[MAXITEMS];
1919 +double xpoints[MAXSTAT], ypoints[MAXSTAT];
1921 +char messages[MAXMSG][MSGSIZE];
1924 +addMessage(char *text) {
1927 + for(i=MAXMSG-1;i;i--) strcpy(messages[i], messages[i-1]);
1928 + strncpy(messages[0], text, MSGSIZE);
1937 + for(i=0;i<MAXMSG;i++) mvaddstr(LINES-3-i, 0, messages[i]);
1939 + mvaddstr(LINES-2, 0, " Dalc version 0.1");
1941 + mvaddstr(LINES-2, COLS/2, "Copyright (C) 1999 Daniel Beer");
1951 + sprintf(inp, "%s/.dalcrc", getenv("HOME"));
1952 + if((io=fopen(inp, "w"))!=NULL) {
1953 + fprintf(io, "%e %e\n", foo.dtr, foo.ans);
1954 + for(i=0;i<26;i++) fprintf(io, "%e\n", foo.vars[i]);
1967 + mvaddstr(LINES-1, 0, "Stats file: ");
1971 + getnstr(inp, sizeof(inp));
1973 + if((io=fopen(inp, "r"))==NULL) {
1974 + addMessage(strerror(errno));
1979 + fscanf(io, "%s", inp);
1980 + while(!feof(io)) {
1981 + temp=strstr(inp, ";");
1983 + stats[numstat].val=atof(inp);
1984 + stats[numstat].freq=1;
1985 + foo.vars[13]+=1.0;
1988 + stats[numstat].val=atof(inp);
1989 + stats[numstat].freq=atoi(temp);
1990 + foo.vars[13]+=stats[numstat].freq;
1992 + if(numstat<MAXSTAT-1) numstat++;
1993 + fscanf(io, "%s", inp);
2005 + mvaddstr(LINES-1, 0, "Points file: ");
2009 + getnstr(inp, sizeof(inp));
2011 + if((io=fopen(inp, "r"))==NULL) {
2012 + addMessage(strerror(errno));
2015 + fscanf(io, "%s", inp);
2017 + while(!feof(io)) {
2018 + temp=strstr(inp, ",");
2021 + if(temp[0]=='_') temp[0]='-';
2023 + if(inp[0]=='_') inp[0]='-';
2024 + xpoints[numpoints]=atof(inp);
2025 + ypoints[numpoints]=atof(temp);
2026 + if(numpoints<MAXSTAT-1) numpoints++;
2027 + fscanf(io, "%s", inp);
2033 +angleRadians(void) {
2035 + addMessage("Working in radians.");
2039 +angleDegrees(void) {
2040 + foo.dtr=M_PI/180.0;
2041 + addMessage("Working in degrees.");
2045 +angleCustom(void) {
2049 + mvaddstr(LINES-1, 0, "Number of units in a circle: ");
2053 + getnstr(inp, sizeof(inp));
2055 + foo.dtr=(M_PI*2)/atof(inp);
2063 + mvaddstr(LINES-1, 0, "Variable (A-Z) or F2 to cancel: ");
2065 + while(!isalpha(k)) {
2067 + if(k==KEY_F(2)) return;
2069 + if(islower(k)) k-=32;
2070 + foo.vars[k-'A']=foo.ans;
2080 + mvaddstr(LINES-1, 0, "Expression: ");
2084 + getnstr(inp, sizeof(inp));
2086 + for(i=0;i<numstat;i++) {
2087 + foo.vars[23]=stats[i].val;
2088 + foo.evaluate(inp);
2089 + sum+=foo.ans*stats[i].freq;
2094 + snprintf(messages[0], MSGSIZE, " (sum) = %e, %f", foo.ans, foo.ans);
2101 + x=foo.regressQuadratic(xpoints, ypoints, numpoints);
2103 + snprintf(messages[0], MSGSIZE, "Match = %f", x);
2105 + snprintf(messages[0], MSGSIZE, "f(X) = %fX^2 + %fX + %f",
2106 + foo.coeff.a, foo.coeff.b, foo.coeff.c);
2108 + snprintf(messages[0], MSGSIZE, "fd(X) = %fX + %f",
2109 + foo.coeff.a*2, foo.coeff.b);
2111 + snprintf(messages[0], MSGSIZE, "fi(X) = %fX^3 + %fX^2 + %fX",
2112 + foo.coeff.a/3, foo.coeff.b/2, foo.coeff.c);
2118 + x=foo.regressLinear(xpoints, ypoints, numpoints);
2120 + snprintf(messages[0], MSGSIZE, "Match = %f", x);
2122 + snprintf(messages[0], MSGSIZE, "f(X) = %fX + %f",
2123 + foo.coeff.a, foo.coeff.b);
2125 + snprintf(messages[0], MSGSIZE, "fd(X) = %f",
2128 + snprintf(messages[0], MSGSIZE, "fi(X) = %fX^2 + %fX",
2129 + foo.coeff.a/2, foo.coeff.b);
2134 + char inp[200], inp2[200];
2135 + int values[GSIZE+1], valuesS[GSIZE+1];
2140 + mvaddstr(LINES-1, 0, "Function: ");
2144 + getnstr(inp, sizeof(inp));
2147 + mvaddstr(LINES-1, 0, "Second function (enter if none): ");
2151 + getnstr(inp2, sizeof(inp2));
2153 + for(x=0;x<=GSIZE;x++) {
2154 + foo.vars[23]=((double)x-GSIZE/2)/GSPACE;
2155 + foo.evaluate(inp);
2156 + values[x]=(int)((0.0-foo.ans)*GSPACE+GSIZE/2);
2159 + for(x=0;x<=GSIZE;x++) {
2160 + foo.vars[23]=((double)x-GSIZE/2)/GSPACE;
2161 + foo.evaluate(inp2);
2162 + valuesS[x]=(int)((0.0-foo.ans)*GSPACE+GSIZE/2);
2165 + sprintf(inp, "/tmp/dalc%d.ppm", getpid());
2166 + if((io=fopen(inp, "w"))==NULL) {
2167 + addMessage(strerror(errno));
2170 + fprintf(io, "P6\n%d %d\n255\n", GSIZE, GSIZE);
2171 + for(y=0;y<GSIZE;y++) for(x=0;x<GSIZE;x++) {
2172 + if(y>=values[x]&&y<=values[x+1]) fprintf(io, "%c%c%c", 0, 0, 0);
2173 + else if(y<=values[x]&&y>=values[x+1]) fprintf(io, "%c%c%c", 0, 0, 0);
2174 + else if(y>=valuesS[x]&&y<=valuesS[x+1]&&inp2[0])
2175 + fprintf(io, "%c%c%c", 192, 0, 0);
2176 + else if(y<=valuesS[x]&&y>=valuesS[x+1]&&inp2[0])
2177 + fprintf(io, "%c%c%c", 192, 0, 0);
2178 + else if(abs(x-GSIZE/2)<=1||abs(y-GSIZE/2)<=1||!(x%GSPACE&&y%GSPACE))
2179 + fprintf(io, "%c%c%c", 0, 0, 192);
2180 + else fprintf(io, "%c%c%c", 255, 255, 255);
2183 + if(getenv("DISPLAY")!=NULL) {
2186 + addMessage(strerror(errno));
2189 + execlp(VIEWER, VIEWER, inp, NULL);
2194 + mvaddstr(LINES-1, 0, "Save file as (*.gif, press enter to not save): ");
2198 + getnstr(inp2, sizeof(inp2));
2201 + sprintf(inp, "%s /tmp/dalc%d.ppm > %s", CONVERTER, getpid(), inp2);
2202 + if(system(inp)<0) addMessage(strerror(errno));
2204 + snprintf(inp, sizeof(inp), "/tmp/dalc%d.ppm", getpid());
2214 + sprintf(inp, "%s/.dalcrc", getenv("HOME"));
2215 + if((io=fopen(inp, "r"))!=NULL) {
2216 + fscanf(io, "%le%le", &foo.dtr, &foo.ans);
2217 + for(i=0;i<26;i++) fscanf(io, "%le", &foo.vars[i]);
2221 + for(i=0;i<MAXMSG;i++) messages[i][0]=0;
2222 + addMessage("Press F2 to toggle a menu.");
2225 + menu.bar[0]=new_item(" Store ", " Store last result as a variable. ");
2226 + menu.funcs[0]=saveVar;
2227 + menu.bar[1]=new_item(" Load stats ", " Load statistical data from file. ");
2228 + menu.funcs[1]=loadStats;
2229 + menu.bar[2]=new_item(" Sumstat ", " Evaluate an expression for each stat. ");
2230 + menu.funcs[2]=sumStat;
2231 + menu.bar[3]=new_item(" Graph ", " Graph a function. ");
2232 + menu.funcs[3]=graphFunc;
2233 + menu.bar[4]=new_item(" Load points ", " Load graph points from a file. ");
2234 + menu.funcs[4]=loadPoints;
2235 + menu.bar[5]=new_item(" Quadratic ", " Attempt a quadratic regression. ");
2236 + menu.funcs[5]=quadratic;
2237 + menu.bar[6]=new_item(" Linear ", " Attempt a linear regression. ");
2238 + menu.funcs[6]=linear;
2239 + menu.bar[7]=new_item(" Radians ", " Measure angles in radians. ");
2240 + menu.funcs[7]=angleRadians;
2241 + menu.bar[8]=new_item(" Degrees ", " Measure angles in degrees. ");
2242 + menu.funcs[8]=angleDegrees;
2243 + menu.bar[9]=new_item(" Custom angles ",
2244 + " Specify an angular measurement system. ");
2245 + menu.funcs[9]=angleCustom;
2246 + menu.bar[10]=new_item(" Exit ", " Exit the program. ");
2247 + menu.funcs[10]=quitProg;
2248 + menu.bar[11]=NULL;
2250 + menu.foo=new_menu(menu.bar);
2251 + set_menu_mark(menu.foo, "* ");
2262 + post_menu(menu.foo);
2263 + while(k!=KEY_F(2)) {
2267 + if(--menu.s<0) menu.s=menu.max-1;
2268 + set_current_item(menu.foo, menu.bar[menu.s]);
2271 + if(++menu.s>=menu.max) menu.s=0;
2272 + set_current_item(menu.foo, menu.bar[menu.s]);
2275 + menu.funcs[menu.s]();
2280 + unpost_menu(menu.foo);
2285 +expressionMode(void) {
2286 + unsigned int k=0, y=0, i, j;
2288 + history[y].text[0]=0;
2293 + mvaddstr(LINES-1, 0, "> ");
2295 + addstr(history[y].text);
2297 + move(LINES-1, history[y].x+LMARGIN);
2299 + if(k>=' '&&k<127&&(j=strlen(history[y].text))<MAXINPUT-1) {
2300 + history[y].text[j+1]=0;
2301 + for(i=j;i>history[y].x;i--) history[y].text[i]=history[y].text[i-1];
2302 + history[y].text[history[y].x++]=k;
2303 + } else if((k==8||k==127||k==KEY_BACKSPACE)&&
2304 + history[y].text[0]&&history[y].x) {
2305 + j=strlen(history[y].text);
2307 + for(i=history[y].x;i<j;) history[y].text[i]=history[y].text[++i];
2308 + } else if(k==4&&history[y].x<strlen(history[y].text)) {
2309 + j=strlen(history[y].text);
2310 + for(i=history[y].x;i<j;) history[y].text[i]=history[y].text[++i];
2311 + } else if(k==KEY_LEFT&&history[y].x) history[y].x--;
2312 + else if(k==KEY_RIGHT&&history[y].x<strlen(history[y].text)) history[y].x++;
2313 + else if(k==KEY_F(2)) showMenu();
2314 + else if(k==1) history[y].x=0;
2315 + else if(k==5) history[y].x=strlen(history[y].text);
2316 + else if(k=='\n'&&history[y].text[0]) {
2317 + foo.evaluate(history[y].text);
2318 + addMessage(history[y].text);
2320 + snprintf(messages[0], MSGSIZE, " = %e, %f", foo.ans, foo.ans);
2322 + strcpy(history[0].text, history[y].text);
2323 + history[0].x=history[y].x;
2324 + for(i=HISTORY-1;i;i--) {
2325 + history[i].x=history[i-1].x;
2326 + strcpy(history[i].text, history[i-1].text);
2328 + history[0].text[0]=0;
2331 + } else if(k==KEY_UP&&y<HISTORY-1) y++;
2332 + else if(k==KEY_DOWN&&y) y--;
2333 + else if(k==12) drawScreen();
2342 + keypad(stdscr, TRUE);
2347 diff -Nru dalc-0.1/dalexpr.C dalc-0.1.new/dalexpr.C
2348 --- dalc-0.1/dalexpr.C Thu Dec 9 08:17:05 1999
2349 +++ dalc-0.1.new/dalexpr.C Thu Jan 1 01:00:00 1970
2353 - * A powerful scientific DAL calculator
2354 - * Copyright (C) 1999 Daniel Beer
2356 - * This program is free software; you can redistribute it and/or modify
2357 - * it under the terms of the GNU General Public License as published by
2358 - * the Free Software Foundation; either version 2 of the License, or
2359 - * (at your option) any later version.
2361 - * This program is distributed in the hope that it will be useful,
2362 - * but WITHOUT ANY WARRANTY; without even the implied warranty of
2363 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2364 - * GNU General Public License for more details.
2366 - * You should have received a copy of the GNU General Public License
2367 - * along with this program; if not, write to the Free Software
2368 - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
2372 -#include <stdlib.h>
2374 -#include <strings.h>
2377 -#include "dalexpr.h"
2379 -DALExpr::DALExpr(void) {
2382 - for(i=0;i<26;i++) vars[i]=0.0;
2387 -DALExpr::~DALExpr(void) {
2391 -DALExpr::evaluate(const char *e) {
2394 - srandom(time(NULL));
2395 - for(i=0;i<MAXTOKENS;i++) tokens[i][0]=0;
2399 - for(i=0;e[i];i++) {
2402 - tokens[num][0]=')';
2405 - tokens[num][0]='(';
2409 - if(lt!=tType(e[i])) advanceToken();
2410 - if(tType(e[i])&&strlen(tokens[num])<TOKENSIZE-1) {
2411 - tokens[num][strlen(tokens[num])+1]=0;
2412 - tokens[num][strlen(tokens[num])]=e[i];
2415 - if(!(lt%2)) lt=-1;
2418 - if(tokens[num][0]) advanceToken();
2425 -DALExpr::functionF(double x) {
2426 - switch(coeff.type) {
2427 - case F_QUADRATIC: return x*x*coeff.a+x*coeff.b+coeff.c;
2428 - case F_LINEAR: return x*coeff.a+coeff.b;
2434 -DALExpr::derivativeF(double x) {
2435 - switch(coeff.type) {
2436 - case F_QUADRATIC: return x*coeff.a*2.0+coeff.b;
2437 - case F_LINEAR: return coeff.a;
2443 -DALExpr::integralF(double x) {
2444 - switch(coeff.type) {
2445 - case F_QUADRATIC: return (x*x*x*coeff.a)/3.0+(x*x*coeff.b)/2.0+x*coeff.c;
2446 - case F_LINEAR: return (x*x*coeff.a)/2+x*coeff.b;
2452 -DALExpr::regressQuadratic(double *xpoints, double *ypoints, int numpoints) {
2453 - double a, b, c, aa, bb, cc, diff, bdiff=10000000.0, step;
2456 - coeff.type=F_QUADRATIC;
2460 - for(step=1000.0;step>=0.0000001;step/=10) {
2464 - for(a=aa-step*10;a<=aa+step*10;a+=step)
2465 - for(b=bb-step*10;b<=bb+step*10;b+=step)
2466 - for(c=cc-step*10;c<=cc+step*10;c+=step) {
2468 - for(i=0;i<numpoints;i++)
2469 - diff+=fabs(ypoints[i]-(a*xpoints[i]*xpoints[i]+b*xpoints[i]+c));
2482 -DALExpr::regressLinear(double *xpoints, double *ypoints, int numpoints) {
2483 - double a, b, aa, bb, diff, bdiff=10000000.0, step;
2486 - coeff.type=F_LINEAR;
2489 - for(step=1000.0;step>=0.0000001;step/=10) {
2492 - for(a=aa-step*10;a<=aa+step*10;a+=step)
2493 - for(b=bb-step*10;b<=bb+step*10;b+=step) {
2495 - for(i=0;i<numpoints;i++) diff+=fabs(ypoints[i]-(a*xpoints[i]+b));
2507 -DALExpr::breakDown(int from) {
2511 - for(i=from;i<num;i++)
2512 - if(!strcmp(tokens[i], "(")) {
2517 - for(i=from;i<num&&strcmp(tokens[i], ")");i++) {
2518 - if(!strcmp(tokens[i], "pi")) {
2521 - } else if(!strcmp(tokens[i], "e")) {
2524 - } else if(!strcmp(tokens[i], "ans")) {
2527 - } else if(!strcmp(tokens[i], "rand")) {
2528 - tokenVal[i]=random()%10000;
2529 - tokenVal[i]/=10000.0;
2531 - } else if(isupper(tokens[i][0])) {
2532 - tokenVal[i]=vars[tokens[i][0]-'A'];
2536 - for(i=from;i<num&&strcmp(tokens[i], ")");i++) {
2537 - if(!(strcmp(tokens[i], "^")&&strcmp(tokens[i], "**"))) {
2538 - tokenVal[i-1]=pow(tokenVal[i-1], tokenVal[i+1]);
2542 - } else if(!strcmp(tokens[i], "root")) {
2543 - tokenVal[i-1]=pow(tokenVal[i+1], 1.0/tokenVal[i-1]);
2549 - for(i=from;i<num&&strcmp(tokens[i], ")");i++) {
2550 - if(!strcmp(tokens[i], "sin")) {
2551 - tokenVal[i+1]=sin(tokenVal[i+1]*dtr);
2553 - } else if(!strcmp(tokens[i], "cos")) {
2554 - tokenVal[i+1]=cos(tokenVal[i+1]*dtr);
2556 - } else if(!strcmp(tokens[i], "tan")) {
2557 - tokenVal[i+1]=tan(tokenVal[i+1]*dtr);
2559 - } else if(!strcmp(tokens[i], "sec")) {
2560 - tokenVal[i+1]=1.0/cos(tokenVal[i+1]*dtr);
2562 - } else if(!strcmp(tokens[i], "asin")) {
2563 - tokenVal[i+1]=asin(tokenVal[i+1])/dtr;
2565 - } else if(!strcmp(tokens[i], "acos")) {
2566 - tokenVal[i+1]=acos(tokenVal[i+1])/dtr;
2568 - } else if(!strcmp(tokens[i], "atan")) {
2569 - tokenVal[i+1]=atan(tokenVal[i+1])/dtr;
2571 - } else if(!strcmp(tokens[i], "atanr")) {
2572 - tokenVal[i+1]=atan2(tokenVal[i+1], tokenVal[i+2])/dtr;
2575 - } else if(!strcmp(tokens[i], "asec")) {
2576 - tokenVal[i+1]=acos(1.0/tokenVal[i+1])/dtr;
2578 - } else if(!strcmp(tokens[i], "sinh")) {
2579 - tokenVal[i+1]=sinh(tokenVal[i+1])/dtr;
2581 - } else if(!strcmp(tokens[i], "cosh")) {
2582 - tokenVal[i+1]=cosh(tokenVal[i+1])/dtr;
2584 - } else if(!strcmp(tokens[i], "tanh")) {
2585 - tokenVal[i+1]=tanh(tokenVal[i+1])/dtr;
2587 - } else if(!strcmp(tokens[i], "hypot")) {
2588 - tokenVal[i+1]=hypot(tokenVal[i+1], tokenVal[i+2]);
2591 - } else if(!strcmp(tokens[i], "abs")) {
2592 - tokenVal[i+1]=fabs(tokenVal[i+1]);
2594 - } else if(!strcmp(tokens[i], "sqrt")) {
2595 - tokenVal[i+1]=sqrt(tokenVal[i+1]);
2597 - } else if(!strcmp(tokens[i], "log")) {
2598 - tokenVal[i+1]=log10(tokenVal[i+1]);
2600 - } else if(!strcmp(tokens[i], "f")) {
2601 - tokenVal[i+1]=functionF(tokenVal[i+1]);
2603 - } else if(!strcmp(tokens[i], "fi")) {
2604 - tokenVal[i+1]=integralF(tokenVal[i+1]);
2606 - } else if(!strcmp(tokens[i], "fd")) {
2607 - tokenVal[i+1]=derivativeF(tokenVal[i+1]);
2609 - } else if(!strcmp(tokens[i], "ln")) {
2610 - tokenVal[i+1]=log(tokenVal[i+1]);
2612 - } else if(!strcmp(tokens[i], "ceil")) {
2613 - tokenVal[i+1]=ceil(tokenVal[i+1]);
2615 - } else if(!strcmp(tokens[i], "floor")) {
2616 - tokenVal[i+1]=floor(tokenVal[i+1]);
2618 - } else if(!strcmp(tokens[i], "round")) {
2619 - tokenVal[i+1]=rint(tokenVal[i+1]);
2621 - } else if(!strcmp(tokens[i], "!")) {
2623 - if(j<0) tokenVal[i-1]=asin(2.0);
2625 - tokenVal[i-1]=1.0;
2626 - for(;j>0;j-=1.0) tokenVal[i-1]*=j;
2630 - } else if(!strcmp(tokens[i], "int")) {
2631 - if(tokenVal[i+1]>0.0) tokenVal[i+1]=floor(tokenVal[i+1]);
2632 - else tokenVal[i+1]=ceil(tokenVal[i+1]);
2634 - } else if(!strcmp(tokens[i], "frac")) {
2635 - if(tokenVal[i+1]>0.0) tokenVal[i+1]-=floor(tokenVal[i+1]);
2636 - else tokenVal[i+1]-=ceil(tokenVal[i+1]);
2640 - for(i=from;i<num&&strcmp(tokens[i], ")");i++) {
2641 - if(!strcmp(tokens[i], "*")) {
2642 - tokenVal[i-1]*=tokenVal[i+1];
2646 - } else if(!strcmp(tokens[i], "/")) {
2647 - tokenVal[i-1]/=tokenVal[i+1];
2651 - } else if(tokens[i][0]=='#'&&tokens[i+1][0]=='#'&&i+1<num) {
2652 - tokenVal[i]*=tokenVal[i+1];
2657 - for(i=from;i<num&&strcmp(tokens[i], ")");i++) {
2658 - if(!strcmp(tokens[i], "+")) {
2659 - tokenVal[i-1]+=tokenVal[i+1];
2663 - } else if(!strcmp(tokens[i], "-")) {
2664 - tokenVal[i-1]-=tokenVal[i+1];
2673 -DALExpr::getValue(int which) {
2674 - if(which<0||which>=num) return 0.0;
2675 - return atof(tokens[which]);
2679 -DALExpr::remove(int which) {
2682 - for(i=which+1;i<num;i++) {
2683 - strcpy(tokens[i-1], tokens[i]);
2684 - tokenVal[i-1]=tokenVal[i];
2690 -DALExpr::tType(char k) {
2691 - if(k<=' ') return 0;
2692 - if(islower(k)) return 3;
2693 - if(isupper(k)) return 2;
2694 - if(isdigit(k)||k=='_'||k=='.') return 5;
2695 - if(k=='('||k==')') return 4;
2700 -DALExpr::advanceToken(void) {
2701 - if(!tokens[num][0]||num>=MAXTOKENS-1) return;
2702 - if(tType(tokens[num][0])==5) {
2703 - if(tokens[num][0]=='_') tokens[num][0]='-';
2704 - tokenVal[num]=atof(tokens[num]);
2705 - tokens[num][0]='#';
2709 diff -Nru dalc-0.1/dalexpr.cc dalc-0.1.new/dalexpr.cc
2710 --- dalc-0.1/dalexpr.cc Thu Jan 1 01:00:00 1970
2711 +++ dalc-0.1.new/dalexpr.cc Fri Nov 24 15:58:24 2000
2715 + * A powerful scientific DAL calculator
2716 + * Copyright (C) 1999 Daniel Beer
2718 + * This program is free software; you can redistribute it and/or modify
2719 + * it under the terms of the GNU General Public License as published by
2720 + * the Free Software Foundation; either version 2 of the License, or
2721 + * (at your option) any later version.
2723 + * This program is distributed in the hope that it will be useful,
2724 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
2725 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2726 + * GNU General Public License for more details.
2728 + * You should have received a copy of the GNU General Public License
2729 + * along with this program; if not, write to the Free Software
2730 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
2734 +#include <stdlib.h>
2736 +#include <string.h>
2739 +#include "dalexpr.h"
2741 +DALExpr::DALExpr(void) {
2744 + for(i=0;i<26;i++) vars[i]=0.0;
2749 +DALExpr::~DALExpr(void) {
2753 +DALExpr::evaluate(const char *e) {
2756 + srandom(time(NULL));
2757 + for(i=0;i<MAXTOKENS;i++) tokens[i][0]=0;
2761 + for(i=0;e[i];i++) {
2764 + tokens[num][0]=')';
2767 + tokens[num][0]='(';
2771 + if(lt!=tType(e[i])) advanceToken();
2772 + if(tType(e[i])&&strlen(tokens[num])<TOKENSIZE-1) {
2773 + tokens[num][strlen(tokens[num])+1]=0;
2774 + tokens[num][strlen(tokens[num])]=e[i];
2777 + if(!(lt%2)) lt=-1;
2780 + if(tokens[num][0]) advanceToken();
2787 +DALExpr::functionF(double x) {
2788 + switch(coeff.type) {
2789 + case F_QUADRATIC: return x*x*coeff.a+x*coeff.b+coeff.c;
2790 + case F_LINEAR: return x*coeff.a+coeff.b;
2796 +DALExpr::derivativeF(double x) {
2797 + switch(coeff.type) {
2798 + case F_QUADRATIC: return x*coeff.a*2.0+coeff.b;
2799 + case F_LINEAR: return coeff.a;
2805 +DALExpr::integralF(double x) {
2806 + switch(coeff.type) {
2807 + case F_QUADRATIC: return (x*x*x*coeff.a)/3.0+(x*x*coeff.b)/2.0+x*coeff.c;
2808 + case F_LINEAR: return (x*x*coeff.a)/2+x*coeff.b;
2814 +DALExpr::regressQuadratic(double *xpoints, double *ypoints, int numpoints) {
2815 + double a, b, c, aa, bb, cc, diff, bdiff=10000000.0, step;
2818 + coeff.type=F_QUADRATIC;
2822 + for(step=1000.0;step>=0.0000001;step/=10) {
2826 + for(a=aa-step*10;a<=aa+step*10;a+=step)
2827 + for(b=bb-step*10;b<=bb+step*10;b+=step)
2828 + for(c=cc-step*10;c<=cc+step*10;c+=step) {
2830 + for(i=0;i<numpoints;i++)
2831 + diff+=fabs(ypoints[i]-(a*xpoints[i]*xpoints[i]+b*xpoints[i]+c));
2844 +DALExpr::regressLinear(double *xpoints, double *ypoints, int numpoints) {
2845 + double a, b, aa, bb, diff, bdiff=10000000.0, step;
2848 + coeff.type=F_LINEAR;
2851 + for(step=1000.0;step>=0.0000001;step/=10) {
2854 + for(a=aa-step*10;a<=aa+step*10;a+=step)
2855 + for(b=bb-step*10;b<=bb+step*10;b+=step) {
2857 + for(i=0;i<numpoints;i++) diff+=fabs(ypoints[i]-(a*xpoints[i]+b));
2869 +DALExpr::breakDown(int from) {
2873 + for(i=from;i<num;i++)
2874 + if(!strcmp(tokens[i], "(")) {
2879 + for(i=from;i<num&&strcmp(tokens[i], ")");i++) {
2880 + if(!strcmp(tokens[i], "pi")) {
2883 + } else if(!strcmp(tokens[i], "e")) {
2886 + } else if(!strcmp(tokens[i], "ans")) {
2889 + } else if(!strcmp(tokens[i], "rand")) {
2890 + tokenVal[i]=random()%10000;
2891 + tokenVal[i]/=10000.0;
2893 + } else if(isupper(tokens[i][0])) {
2894 + tokenVal[i]=vars[tokens[i][0]-'A'];
2898 + for(i=from;i<num&&strcmp(tokens[i], ")");i++) {
2899 + if(!(strcmp(tokens[i], "^")&&strcmp(tokens[i], "**"))) {
2900 + tokenVal[i-1]=pow(tokenVal[i-1], tokenVal[i+1]);
2904 + } else if(!strcmp(tokens[i], "root")) {
2905 + tokenVal[i-1]=pow(tokenVal[i+1], 1.0/tokenVal[i-1]);
2911 + for(i=from;i<num&&strcmp(tokens[i], ")");i++) {
2912 + if(!strcmp(tokens[i], "sin")) {
2913 + tokenVal[i+1]=sin(tokenVal[i+1]*dtr);
2915 + } else if(!strcmp(tokens[i], "cos")) {
2916 + tokenVal[i+1]=cos(tokenVal[i+1]*dtr);
2918 + } else if(!strcmp(tokens[i], "tan")) {
2919 + tokenVal[i+1]=tan(tokenVal[i+1]*dtr);
2921 + } else if(!strcmp(tokens[i], "sec")) {
2922 + tokenVal[i+1]=1.0/cos(tokenVal[i+1]*dtr);
2924 + } else if(!strcmp(tokens[i], "asin")) {
2925 + tokenVal[i+1]=asin(tokenVal[i+1])/dtr;
2927 + } else if(!strcmp(tokens[i], "acos")) {
2928 + tokenVal[i+1]=acos(tokenVal[i+1])/dtr;
2930 + } else if(!strcmp(tokens[i], "atan")) {
2931 + tokenVal[i+1]=atan(tokenVal[i+1])/dtr;
2933 + } else if(!strcmp(tokens[i], "atanr")) {
2934 + tokenVal[i+1]=atan2(tokenVal[i+1], tokenVal[i+2])/dtr;
2937 + } else if(!strcmp(tokens[i], "asec")) {
2938 + tokenVal[i+1]=acos(1.0/tokenVal[i+1])/dtr;
2940 + } else if(!strcmp(tokens[i], "sinh")) {
2941 + tokenVal[i+1]=sinh(tokenVal[i+1])/dtr;
2943 + } else if(!strcmp(tokens[i], "cosh")) {
2944 + tokenVal[i+1]=cosh(tokenVal[i+1])/dtr;
2946 + } else if(!strcmp(tokens[i], "tanh")) {
2947 + tokenVal[i+1]=tanh(tokenVal[i+1])/dtr;
2949 + } else if(!strcmp(tokens[i], "hypot")) {
2950 + tokenVal[i+1]=hypot(tokenVal[i+1], tokenVal[i+2]);
2953 + } else if(!strcmp(tokens[i], "abs")) {
2954 + tokenVal[i+1]=fabs(tokenVal[i+1]);
2956 + } else if(!strcmp(tokens[i], "sqrt")) {
2957 + tokenVal[i+1]=sqrt(tokenVal[i+1]);
2959 + } else if(!strcmp(tokens[i], "log")) {
2960 + tokenVal[i+1]=log10(tokenVal[i+1]);
2962 + } else if(!strcmp(tokens[i], "f")) {
2963 + tokenVal[i+1]=functionF(tokenVal[i+1]);
2965 + } else if(!strcmp(tokens[i], "fi")) {
2966 + tokenVal[i+1]=integralF(tokenVal[i+1]);
2968 + } else if(!strcmp(tokens[i], "fd")) {
2969 + tokenVal[i+1]=derivativeF(tokenVal[i+1]);
2971 + } else if(!strcmp(tokens[i], "ln")) {
2972 + tokenVal[i+1]=log(tokenVal[i+1]);
2974 + } else if(!strcmp(tokens[i], "ceil")) {
2975 + tokenVal[i+1]=ceil(tokenVal[i+1]);
2977 + } else if(!strcmp(tokens[i], "floor")) {
2978 + tokenVal[i+1]=floor(tokenVal[i+1]);
2980 + } else if(!strcmp(tokens[i], "round")) {
2981 + tokenVal[i+1]=rint(tokenVal[i+1]);
2983 + } else if(!strcmp(tokens[i], "!")) {
2985 + if(j<0) tokenVal[i-1]=asin(2.0);
2987 + tokenVal[i-1]=1.0;
2988 + for(;j>0;j-=1.0) tokenVal[i-1]*=j;
2992 + } else if(!strcmp(tokens[i], "int")) {
2993 + if(tokenVal[i+1]>0.0) tokenVal[i+1]=floor(tokenVal[i+1]);
2994 + else tokenVal[i+1]=ceil(tokenVal[i+1]);
2996 + } else if(!strcmp(tokens[i], "frac")) {
2997 + if(tokenVal[i+1]>0.0) tokenVal[i+1]-=floor(tokenVal[i+1]);
2998 + else tokenVal[i+1]-=ceil(tokenVal[i+1]);
3002 + for(i=from;i<num&&strcmp(tokens[i], ")");i++) {
3003 + if(!strcmp(tokens[i], "*")) {
3004 + tokenVal[i-1]*=tokenVal[i+1];
3008 + } else if(!strcmp(tokens[i], "/")) {
3009 + tokenVal[i-1]/=tokenVal[i+1];
3013 + } else if(tokens[i][0]=='#'&&tokens[i+1][0]=='#'&&i+1<num) {
3014 + tokenVal[i]*=tokenVal[i+1];
3019 + for(i=from;i<num&&strcmp(tokens[i], ")");i++) {
3020 + if(!strcmp(tokens[i], "+")) {
3021 + tokenVal[i-1]+=tokenVal[i+1];
3025 + } else if(!strcmp(tokens[i], "-")) {
3026 + tokenVal[i-1]-=tokenVal[i+1];
3035 +DALExpr::getValue(int which) {
3036 + if(which<0||which>=num) return 0.0;
3037 + return atof(tokens[which]);
3041 +DALExpr::remove(int which) {
3044 + for(i=which+1;i<num;i++) {
3045 + strcpy(tokens[i-1], tokens[i]);
3046 + tokenVal[i-1]=tokenVal[i];
3052 +DALExpr::tType(char k) {
3053 + if(k<=' ') return 0;
3054 + if(islower(k)) return 3;
3055 + if(isupper(k)) return 2;
3056 + if(isdigit(k)||k=='_'||k=='.') return 5;
3057 + if(k=='('||k==')') return 4;
3062 +DALExpr::advanceToken(void) {
3063 + if(!tokens[num][0]||num>=MAXTOKENS-1) return;
3064 + if(tType(tokens[num][0])==5) {
3065 + if(tokens[num][0]=='_') tokens[num][0]='-';
3066 + tokenVal[num]=atof(tokens[num]);
3067 + tokens[num][0]='#';