From 1260ae08dbfce7e50d20d1a75e05cf0c0041c220 Mon Sep 17 00:00:00 2001 From: pnenzi Date: Fri, 9 Jul 2004 18:37:25 +0000 Subject: [PATCH] Update autoconf scripts and applied Niessner patch to remove compiler warnings. --- ChangeLog | 9 + acconfig.h | 4 + configure.in | 50 +- doc/texinfo.tex | 6975 +++++++++------- src/conf.c | 6 +- src/frontend/com_history.c | 2 +- src/frontend/control.c | 4 +- src/frontend/device.c | 1 - src/frontend/dotcards.c | 2 +- src/frontend/evaluate.c | 9 +- src/frontend/parse.c | 18 +- src/frontend/plotting/x11.c | 21 +- src/frontend/rawfile.c | 4 + src/frontend/shyu.c | 12 +- src/frontend/spiceif.c | 46 +- src/frontend/subckt.c | 4 - src/frontend/wdisp/windisp.c | 2 +- src/include/cktdefs.h | 2 +- src/include/fteext.h | 86 +- src/include/fteparse.h | 2 +- src/include/ngspice.h | 6 +- src/maths/cmaths/cmath2.c | 32 +- src/maths/cmaths/cmath2.h | 32 +- src/maths/sparse/spbuild.c | 1 - src/maths/sparse/sputils.c | 1 + src/misc/alloc.c | 16 +- src/misc/stringutil.h | 2 + src/misc/tilde.c | 2 +- src/nghelp.c | 2 + src/ngmultidec.c | 3 +- src/ngnutmeg.c | 3 - src/ngspice.c | 2 - src/spicelib/analysis/ckt.h | 2 +- src/spicelib/analysis/cktmcrt.c | 20 +- src/spicelib/analysis/cktmkcur.c | 8 +- src/spicelib/analysis/cktmkvol.c | 8 +- src/spicelib/analysis/cktpzstr.c | 2 +- src/spicelib/analysis/cktsens.c | 10 +- src/spicelib/analysis/cktsopt.c | 24 +- src/spicelib/analysis/noisean.c | 16 +- src/spicelib/analysis/tfanal.c | 2 +- src/spicelib/devices/bjt/bjtdset.c | 4 +- src/spicelib/devices/bjt/bjtsacl.c | 6 +- src/spicelib/devices/bjt/bjtsetup.c | 26 +- src/spicelib/devices/bjt/bjtsload.c | 8 +- src/spicelib/devices/bjt2/bjt2disto.c | 24 +- src/spicelib/devices/bjt2/bjt2dset.c | 13 +- src/spicelib/devices/bjt2/bjt2load.c | 5 +- src/spicelib/devices/bjt2/bjt2noise.c | 1 - src/spicelib/devices/bjt2/bjt2sacl.c | 18 +- src/spicelib/devices/bjt2/bjt2setup.c | 26 +- src/spicelib/devices/bjt2/bjt2sload.c | 8 +- src/spicelib/devices/bsim1/b1eval.c | 26 +- src/spicelib/devices/bsim1/b1set.c | 18 +- src/spicelib/devices/bsim2/b2eval.c | 11 +- src/spicelib/devices/bsim2/b2ld.c | 4 +- src/spicelib/devices/bsim2/b2set.c | 20 +- src/spicelib/devices/bsim3/b3acld.c | 3 +- src/spicelib/devices/bsim3/b3ld.c | 14 +- src/spicelib/devices/bsim3/b3pzld.c | 3 +- src/spicelib/devices/bsim3/b3set.c | 18 +- src/spicelib/devices/bsim3soi/b3soiacld.c | 2 +- src/spicelib/devices/bsim3soi/b3soild.c | 152 +- src/spicelib/devices/bsim3soi/b3soinoi.c | 12 +- src/spicelib/devices/bsim3soi/b3soipzld.c | 5 +- src/spicelib/devices/bsim3soi/b3soiset.c | 22 +- src/spicelib/devices/bsim3soi/b3soitemp.c | 8 +- .../devices/bsim3soi_dd/b3soiddacld.c | 5 +- src/spicelib/devices/bsim3soi_dd/b3soiddld.c | 291 +- src/spicelib/devices/bsim3soi_dd/b3soiddnoi.c | 10 +- .../devices/bsim3soi_dd/b3soiddpzld.c | 5 +- src/spicelib/devices/bsim3soi_dd/b3soiddset.c | 19 +- .../devices/bsim3soi_dd/b3soiddtemp.c | 4 +- .../devices/bsim3soi_fd/b3soifdacld.c | 5 +- src/spicelib/devices/bsim3soi_fd/b3soifdld.c | 266 +- src/spicelib/devices/bsim3soi_fd/b3soifdnoi.c | 10 +- .../devices/bsim3soi_fd/b3soifdpzld.c | 5 +- src/spicelib/devices/bsim3soi_fd/b3soifdset.c | 19 +- .../devices/bsim3soi_fd/b3soifdtemp.c | 4 +- .../devices/bsim3soi_pd/b3soipdacld.c | 2 +- src/spicelib/devices/bsim3soi_pd/b3soipdld.c | 113 +- src/spicelib/devices/bsim3soi_pd/b3soipdnoi.c | 12 +- .../devices/bsim3soi_pd/b3soipdpzld.c | 5 +- src/spicelib/devices/bsim3soi_pd/b3soipdset.c | 22 +- .../devices/bsim3soi_pd/b3soipdtemp.c | 8 +- src/spicelib/devices/bsim3v0/b3v0ld.c | 69 +- src/spicelib/devices/bsim3v0/b3v0noi.c | 9 +- src/spicelib/devices/bsim3v0/b3v0set.c | 20 +- src/spicelib/devices/bsim3v0/b3v0temp.c | 6 +- src/spicelib/devices/bsim3v0/bsim3v0itf.h | 3 +- src/spicelib/devices/bsim3v1/b3v1ld.c | 67 +- src/spicelib/devices/bsim3v1/b3v1noi.c | 9 +- src/spicelib/devices/bsim3v1/b3v1set.c | 20 +- src/spicelib/devices/bsim3v1/b3v1temp.c | 6 +- src/spicelib/devices/bsim3v1a/b3v1ald.c | 68 +- src/spicelib/devices/bsim3v1a/b3v1anoi.c | 9 +- src/spicelib/devices/bsim3v1a/b3v1aset.c | 20 +- src/spicelib/devices/bsim3v1a/b3v1atemp.c | 6 +- src/spicelib/devices/bsim3v1s/b3v1sld.c | 8 +- src/spicelib/devices/bsim3v1s/b3v1sset.c | 18 +- src/spicelib/devices/bsim3v1s/b3v1stemp.c | 2 +- src/spicelib/devices/bsim3v1s/bsim3v1sinit.c | 22 +- src/spicelib/devices/bsim4/b4acld.c | 14 +- src/spicelib/devices/bsim4/b4geo.c | 9 +- src/spicelib/devices/bsim4/b4ld.c | 68 +- src/spicelib/devices/bsim4/b4noi.c | 11 +- src/spicelib/devices/bsim4/b4pzld.c | 14 +- src/spicelib/devices/bsim4/b4set.c | 8 +- src/spicelib/devices/bsim4/b4temp.c | 13 +- src/spicelib/devices/cktcrte.c | 21 +- src/spicelib/devices/csw/cswload.c | 1 + src/spicelib/devices/dio/diosetup.c | 10 +- src/spicelib/devices/dio/diosload.c | 2 +- src/spicelib/devices/hfet1/hfetload.c | 16 +- src/spicelib/devices/hfet1/hfetsetup.c | 50 +- src/spicelib/devices/hfet2/hfet2load.c | 8 +- src/spicelib/devices/hfet2/hfet2setup.c | 48 +- src/spicelib/devices/hisim/hsm1eval102.c | 143 +- src/spicelib/devices/hisim/hsm1eval112.c | 135 +- src/spicelib/devices/hisim/hsm1eval120.c | 162 +- src/spicelib/devices/hisim/hsm1ld.c | 7 +- src/spicelib/devices/hisim/hsm1noi.c | 2 +- src/spicelib/devices/hisim/hsm1set.c | 18 +- src/spicelib/devices/jfet/jfetdist.c | 2 +- src/spicelib/devices/jfet/jfetload.c | 4 +- src/spicelib/devices/jfet/jfetset.c | 20 +- src/spicelib/devices/jfet2/jfet2load.c | 4 +- src/spicelib/devices/jfet2/jfet2set.c | 20 +- src/spicelib/devices/ltra/ltraload.c | 8 +- src/spicelib/devices/ltra/ltramisc.c | 22 +- src/spicelib/devices/mes/mesdisto.c | 2 +- src/spicelib/devices/mes/mesload.c | 4 +- src/spicelib/devices/mes/messetup.c | 20 +- src/spicelib/devices/mesa/mesaload.c | 4 +- src/spicelib/devices/mesa/mesasetup.c | 50 +- src/spicelib/devices/mos1/mos1dist.c | 2 +- src/spicelib/devices/mos1/mos1dset.c | 2 +- src/spicelib/devices/mos1/mos1load.c | 8 +- src/spicelib/devices/mos1/mos1sacl.c | 4 +- src/spicelib/devices/mos1/mos1set.c | 20 +- src/spicelib/devices/mos2/mos2dist.c | 2 +- src/spicelib/devices/mos2/mos2dset.c | 14 +- src/spicelib/devices/mos2/mos2load.c | 40 +- src/spicelib/devices/mos2/mos2sacl.c | 4 +- src/spicelib/devices/mos2/mos2set.c | 18 +- src/spicelib/devices/mos3/mos3dist.c | 2 +- src/spicelib/devices/mos3/mos3dset.c | 6 +- src/spicelib/devices/mos3/mos3load.c | 28 +- src/spicelib/devices/mos3/mos3sacl.c | 4 +- src/spicelib/devices/mos3/mos3set.c | 18 +- src/spicelib/devices/mos6/mos6load.c | 12 +- src/spicelib/devices/mos6/mos6set.c | 18 +- src/spicelib/devices/mos9/mos9dist.c | 2 +- src/spicelib/devices/mos9/mos9dset.c | 10 +- src/spicelib/devices/mos9/mos9load.c | 29 +- src/spicelib/devices/mos9/mos9noi.c | 1 - src/spicelib/devices/mos9/mos9sacl.c | 16 +- src/spicelib/devices/mos9/mos9set.c | 18 +- src/spicelib/devices/soi3/soi3ask.c | 16 +- src/spicelib/devices/soi3/soi3cap.c | 4 - src/spicelib/devices/soi3/soi3conv.c | 3 +- src/spicelib/devices/soi3/soi3load.c | 31 +- src/spicelib/devices/soi3/soi3nois.c | 1 - src/spicelib/devices/soi3/soi3set.c | 18 +- src/spicelib/devices/sw/swinit.c | 2 +- src/spicelib/devices/sw/swload.c | 2 +- src/spicelib/devices/urc/urcsetup.c | 88 +- src/spicelib/devices/vbic/vbicask.c | 2 +- src/spicelib/devices/vbic/vbicsetup.c | 34 +- src/xspice/cmpp/ifs_lex.l | 1 + src/xspice/cmpp/ifs_yacc.y | 7 +- src/xspice/cmpp/main.c | 12 +- src/xspice/cmpp/mod_lex.l | 1 + src/xspice/cmpp/mod_yacc.y | 8 +- src/xspice/cmpp/pp_ifs.c | 1 + src/xspice/cmpp/pp_lst.c | 11 +- src/xspice/cmpp/pp_mod.c | 9 + src/xspice/cmpp/read_ifs.c | 5 + src/xspice/cmpp/util.c | 4 +- src/xspice/cmpp/writ_ifs.c | 17 +- src/xspice/evt/evtinit.c | 10 +- src/xspice/evt/evtprint.c | 2 +- src/xspice/icm/analog/ilimit/cfunc.mod | 2 +- src/xspice/icm/analog/oneshot/cfunc.mod | 6 +- src/xspice/icm/analog/pwl/cfunc.mod | 2 + src/xspice/icm/analog/s_xfer/cfunc.mod | 19 +- src/xspice/icm/analog/sine/cfunc.mod | 5 +- src/xspice/icm/analog/square/cfunc.mod | 5 +- src/xspice/icm/analog/triangle/cfunc.mod | 6 +- src/xspice/icm/digital/adc_bridge/cfunc.mod | 2 + src/xspice/icm/digital/d_buffer/cfunc.mod | 2 +- src/xspice/icm/digital/d_dff/cfunc.mod | 4 +- src/xspice/icm/digital/d_dlatch/cfunc.mod | 2 +- src/xspice/icm/digital/d_inverter/cfunc.mod | 2 +- src/xspice/icm/digital/d_jkff/cfunc.mod | 2 +- src/xspice/icm/digital/d_open_c/cfunc.mod | 2 +- src/xspice/icm/digital/d_open_e/cfunc.mod | 2 +- src/xspice/icm/digital/d_osc/cfunc.mod | 8 +- src/xspice/icm/digital/d_ram/cfunc.mod | 7 +- src/xspice/icm/digital/d_source/cfunc.mod | 11 +- src/xspice/icm/digital/d_srff/cfunc.mod | 6 +- src/xspice/icm/digital/d_srlatch/cfunc.mod | 4 +- src/xspice/icm/digital/d_state/cfunc.mod | 38 +- src/xspice/icm/digital/d_tff/cfunc.mod | 6 +- src/xspice/icm/digital/d_xnor/cfunc.mod | 4 +- src/xspice/icm/digital/d_xor/cfunc.mod | 6 +- src/xspice/icm/makedefs.in | 4 +- .../icm/spice2poly/icm_spice2poly/cfunc.mod | 2 +- src/xspice/icm/xtradev/core/cfunc.mod | 2 + src/xspice/icm/xtradev/lcouple/cfunc.mod | 2 +- src/xspice/icm/xtradev/zener/cfunc.mod | 2 + src/xspice/icm/xtraevt/int/udnfunc.c | 2 +- src/xspice/icm/xtraevt/real/udnfunc.c | 2 +- src/xspice/icm/xtraevt/real_to_v/cfunc.mod | 2 +- src/xspice/ipc/ipcsockets.c | 2 +- src/xspice/ipc/ipctiein.c | 1 + src/xspice/mif/mif_inp2.c | 48 +- tests/Makefile.am | 1 - xgraph/Makefile.am | 6 + xgraph/aclocal.m4 | 1045 ++- xgraph/autoconf.h.in | 60 +- xgraph/configure | 7017 +++++++++++++---- xgraph/configure.in | 14 +- 223 files changed, 12420 insertions(+), 6509 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2215610c7..bf117e7fb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2004-07-08 Paolo Nenzi + + * Applied Al Niessner negabyte patch + that removed all compiler warnings. + + * configure.in, src/xspice/icm/makedefs.in, tests/Makefile.am, + xgraph/aclocal.m4, xgraph/configure.in, xgraph/configure: updated + configuration files for autoconf V2.59 automake V1.8. + 2004-07-05 Paolo Nenzi * src/frontend/resource.c: added __APPLE__ for mac osx support as in diff --git a/acconfig.h b/acconfig.h index 4dfeb1592..6681120c7 100644 --- a/acconfig.h +++ b/acconfig.h @@ -97,3 +97,7 @@ /* get system memory and time */ #undef HAVE__MEMAVL + +/* define whether size_t is int or is long */ +#undef IS_SIZE_T_LONG + diff --git a/configure.in b/configure.in index fe051afbf..35b8cfad8 100644 --- a/configure.in +++ b/configure.in @@ -3,10 +3,11 @@ dnl dnl This file is part of ngspice. dnl dnl (Process this file with autoconf to produce a configure script.) -AC_INIT(src/main.c) +AC_INIT +AC_CONFIG_SRCDIR([src/main.c]) dnl Create a configuration header -AM_CONFIG_HEADER(config.h) +AC_CONFIG_HEADERS([config.h]) dnl Initialize automake stuff AM_INIT_AUTOMAKE(ng-spice-rework,15) @@ -174,7 +175,14 @@ dnl Checks for ANSI-C header files. AC_HEADER_STDC if test "$enable_ansi" = "yes"; then - AM_PROG_CC_STDC + AC_PROG_CC() +AC_DIAGNOSE([obsolete],[AM_PROG_CC_STDC: + your code should no longer depend upon `am_cv_prog_cc_stdc', but upon + `ac_cv_prog_cc_stdc'. Remove this warning and the assignment when + you adjust the code. You can also remove the above call to + AC_PROG_CC if you already called it elsewhere.]) +am_cv_prog_cc_stdc=$ac_cv_prog_cc_stdc + if test ! "$am_cv_prog_cc_stdc"="yes"; then AC_MSG_WARN(Failed to find Ansi flag!) fi @@ -265,6 +273,18 @@ AC_STRUCT_TM AC_STRUCT_TIMEZONE AC_CHECK_FUNCS(localtime) +dnl Some special AMD64 processor issues. This change may be common to many +dnl 64 bit processors, but I have only this platform to work with and did not +dnl find a good way of automatically determining this information. +case $host in + x86_64-*-linux*) + AC_DEFINE(IS_SIZE_T_LONG, 1) + ;; + *) + AC_DEFINE(IS_SIZE_T_LONG, 0) + ;; +esac + case $host_os in *cygwin* ) AC_CHECK_FUNCS(ftime) @@ -280,7 +300,7 @@ AC_CHECK_HEADERS(termios.h termio.h sgtty.h , break) AC_CHECK_FUNCS(isatty tcgetattr tcsetattr) dnl Check for a few functions: -AC_FUNC_VFORK +AC_FUNC_FORK([]) AC_CHECK_FUNCS(access bcopy qsort dup2 popen) AC_CHECK_FUNCS(strchr index , break) AC_CHECK_FUNCS(getcwd getwd , break) @@ -303,26 +323,18 @@ AC_CHECK_FUNCS(asprintf,,AC_CHECK_LIB(iberty,asprintf,AC_DEFINE(HAVE_ASPRINTF) L dnl Check for va_copy AC_CACHE_CHECK([for va_copy], ac_cv_c_va_copy, - AC_TRY_LINK( - [#include ], - [va_list ap1, ap2; + AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include ]], [[va_list ap1, ap2; va_copy(ap1,ap2); - ], - [ac_cv_c_va_copy="yes"], - [ac_cv_c_va_copy="no"]) + ]])],[ac_cv_c_va_copy="yes"],[ac_cv_c_va_copy="no"]) ) if test "$ac_cv_c_va_copy" = "yes" then AC_DEFINE(HAVE_VA_COPY, 1, [Define if we have va_copy]) fi AC_CACHE_CHECK([for __va_copy], ac_cv_c___va_copy, - AC_TRY_LINK( - [#include ], - [va_list ap1, ap2; + AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include ]], [[va_list ap1, ap2; __va_copy(ap1,ap2); - ], - [ac_cv_c___va_copy="yes"], - [ac_cv_c___va_copy="no"]) + ]])],[ac_cv_c___va_copy="yes"],[ac_cv_c___va_copy="no"]) ) if test "$ac_cv_c___va_copy" = "yes" then @@ -572,7 +584,7 @@ fi -AC_OUTPUT( \ +AC_CONFIG_FILES([\ Makefile \ doc/Makefile \ man/Makefile \ @@ -603,7 +615,6 @@ src/spicelib/devices/ccvs/Makefile \ src/spicelib/devices/csw/Makefile \ src/spicelib/devices/cpl/Makefile \ src/spicelib/devices/dio/Makefile \ -dnl src/spicelib/devices/ekv/Makefile \ src/spicelib/devices/ind/Makefile \ src/spicelib/devices/isrc/Makefile \ src/spicelib/devices/hfet1/Makefile \ @@ -708,4 +719,5 @@ tests/proc2mod/Makefile \ tests/transmission/Makefile \ tests/resistance/Makefile \ tests/vbic/Makefile -) +]) +AC_OUTPUT diff --git a/doc/texinfo.tex b/doc/texinfo.tex index d375c2c09..6c8536c4d 100644 --- a/doc/texinfo.tex +++ b/doc/texinfo.tex @@ -3,10 +3,11 @@ % Load plain if necessary, i.e., if running under initex. \expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi % -\def\texinfoversion{1999-07-19.16}% +\def\texinfoversion{2004-05-16.08} % -% Copyright (C) 1985, 86, 88, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99 -% Free Software Foundation, Inc. +% Copyright (C) 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995, +% 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 Free Software +% Foundation, Inc. % % This texinfo.tex file is free software; you can redistribute it and/or % modify it under the terms of the GNU General Public License as @@ -23,21 +24,17 @@ % to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, % Boston, MA 02111-1307, USA. % -% In other words, you are welcome to use, share and improve this program. -% You are forbidden to forbid anyone else to use, share and improve -% what you give them. Help stamp out software-hoarding! +% As a special exception, when this file is read by TeX when processing +% a Texinfo source document, you may use the result without +% restriction. (This has been our intent since Texinfo was invented.) % % Please try the latest version of texinfo.tex before submitting bug % reports; you can get the latest version from: -% ftp://ftp.gnu.org/pub/gnu/texinfo.tex -% (and all GNU mirrors, see http://www.gnu.org/order/ftp.html) +% http://www.gnu.org/software/texinfo/ (the Texinfo home page), or % ftp://tug.org/tex/texinfo.tex -% ftp://ctan.org/macros/texinfo/texinfo.tex -% (and all CTAN mirrors, finger ctan@ctan.org for a list). -% /home/gd/gnu/doc/texinfo.tex on the GNU machines. -% The texinfo.tex in any given Texinfo distribution could well be out +% (and all CTAN mirrors, see http://www.ctan.org). +% The texinfo.tex in any given distribution could well be out % of date, so if that's what you're using, please check. -% There is a small home page for Texinfo at http://texinfo.org/. % % Send bug reports to bug-texinfo@gnu.org. Please include including a % complete document in each bug report with which we can reproduce the @@ -50,13 +47,17 @@ % texindex foo.?? % tex foo.texi % tex foo.texi -% dvips foo.dvi -o # or whatever, to process the dvi file; this makes foo.ps. -% The extra runs of TeX get the cross-reference information correct. +% dvips foo.dvi -o # or whatever; this makes foo.ps. +% The extra TeX runs get the cross-reference information correct. % Sometimes one run after texindex suffices, and sometimes you need more % than two; texi2dvi does it as many times as necessary. % -% It is possible to adapt texinfo.tex for other languages. You can get -% the existing language-specific files from ftp://ftp.gnu.org/gnu/texinfo/. +% It is possible to adapt texinfo.tex for other languages, to some +% extent. You can get the existing language-specific files from the +% full Texinfo distribution. +% +% The GNU Texinfo home page is http://www.gnu.org/software/texinfo. + \message{Loading texinfo [version \texinfoversion]:} @@ -66,7 +67,14 @@ \everyjob{\message{[Texinfo version \texinfoversion]}% \catcode`+=\active \catcode`\_=\active} -% Save some parts of plain tex whose names we will redefine. +\message{Basics,} +\chardef\other=12 + +% We never want plain's \outer definition of \+ in Texinfo. +% For @tex, we can use \tabalign. +\let\+ = \relax + +% Save some plain tex macros whose names we will redefine. \let\ptexb=\b \let\ptexbullet=\bullet \let\ptexc=\c @@ -76,23 +84,34 @@ \let\ptexend=\end \let\ptexequiv=\equiv \let\ptexexclam=\! +\let\ptexfootnote=\footnote +\let\ptexgtr=> +\let\ptexhat=^ \let\ptexi=\i +\let\ptexindent=\indent +\let\ptexnoindent=\noindent +\let\ptexinsert=\insert \let\ptexlbrace=\{ +\let\ptexless=< +\let\ptexplus=+ \let\ptexrbrace=\} +\let\ptexslash=\/ \let\ptexstar=\* \let\ptext=\t -% We never want plain's outer \+ definition in Texinfo. -% For @tex, we can use \tabalign. -\let\+ = \relax - -\message{Basics,} -\chardef\other=12 - % If this character appears in an error message or help string, it % starts a new line in the output. \newlinechar = `^^J +% Use TeX 3.0's \inputlineno to get the line number, for better error +% messages, but if we're using an old version of TeX, don't do anything. +% +\ifx\inputlineno\thisisundefined + \let\linenumber = \empty % Pre-3.0. +\else + \def\linenumber{l.\the\inputlineno:\space} +\fi + % Set up fixed words for English if not already set. \ifx\putwordAppendix\undefined \gdef\putwordAppendix{Appendix}\fi \ifx\putwordChapter\undefined \gdef\putwordChapter{Chapter}\fi @@ -131,44 +150,117 @@ \ifx\putwordDefspec\undefined \gdef\putwordDefspec{Special Form}\fi \ifx\putwordDefvar\undefined \gdef\putwordDefvar{Variable}\fi \ifx\putwordDefopt\undefined \gdef\putwordDefopt{User Option}\fi -\ifx\putwordDeftypevar\undefined\gdef\putwordDeftypevar{Variable}\fi \ifx\putwordDeffunc\undefined \gdef\putwordDeffunc{Function}\fi -\ifx\putwordDeftypefun\undefined\gdef\putwordDeftypefun{Function}\fi + +% In some macros, we cannot use the `\? notation---the left quote is +% in some cases the escape char. +\chardef\colonChar = `\: +\chardef\commaChar = `\, +\chardef\dotChar = `\. +\chardef\exclamChar= `\! +\chardef\questChar = `\? +\chardef\semiChar = `\; +\chardef\underChar = `\_ + +\chardef\spaceChar = `\ % +\chardef\spacecat = 10 +\def\spaceisspace{\catcode\spaceChar=\spacecat} % Ignore a token. % \def\gobble#1{} -\hyphenation{ap-pen-dix} -\hyphenation{mini-buf-fer mini-buf-fers} -\hyphenation{eshell} -\hyphenation{white-space} +% The following is used inside several \edef's. +\def\makecsname#1{\expandafter\noexpand\csname#1\endcsname} + +% Hyphenation fixes. +\hyphenation{ + Flor-i-da Ghost-script Ghost-view Mac-OS Post-Script + ap-pen-dix bit-map bit-maps + data-base data-bases eshell fall-ing half-way long-est man-u-script + man-u-scripts mini-buf-fer mini-buf-fers over-view par-a-digm + par-a-digms rath-er rec-tan-gu-lar ro-bot-ics se-vere-ly set-up spa-ces + spell-ing spell-ings + stand-alone strong-est time-stamp time-stamps which-ever white-space + wide-spread wrap-around +} % Margin to add to right of even pages, to left of odd pages. -\newdimen \bindingoffset -\newdimen \normaloffset +\newdimen\bindingoffset +\newdimen\normaloffset \newdimen\pagewidth \newdimen\pageheight +% For a final copy, take out the rectangles +% that mark overfull boxes (in case you have decided +% that the text looks ok even though it passes the margin). +% +\def\finalout{\overfullrule=0pt} + +% @| inserts a changebar to the left of the current line. It should +% surround any changed text. This approach does *not* work if the +% change spans more than two lines of output. To handle that, we would +% have adopt a much more difficult approach (putting marks into the main +% vertical list for the beginning and end of each change). +% +\def\|{% + % \vadjust can only be used in horizontal mode. + \leavevmode + % + % Append this vertical mode material after the current line in the output. + \vadjust{% + % We want to insert a rule with the height and depth of the current + % leading; that is exactly what \strutbox is supposed to record. + \vskip-\baselineskip + % + % \vadjust-items are inserted at the left edge of the type. So + % the \llap here moves out into the left-hand margin. + \llap{% + % + % For a thicker or thinner bar, change the `1pt'. + \vrule height\baselineskip width1pt + % + % This is the space between the bar and the text. + \hskip 12pt + }% + }% +} + % Sometimes it is convenient to have everything in the transcript file % and nothing on the terminal. We don't just call \tracingall here, -% since that produces some useless output on the terminal. +% since that produces some useless output on the terminal. We also make +% some effort to order the tracing commands to reduce output in the log +% file; cf. trace.sty in LaTeX. % \def\gloggingall{\begingroup \globaldefs = 1 \loggingall \endgroup}% -\ifx\eTeXversion\undefined -\def\loggingall{\tracingcommands2 \tracingstats2 - \tracingpages1 \tracingoutput1 \tracinglostchars1 - \tracingmacros2 \tracingparagraphs1 \tracingrestores1 - \showboxbreadth\maxdimen\showboxdepth\maxdimen +\def\loggingall{% + \tracingstats2 + \tracingpages1 + \tracinglostchars2 % 2 gives us more in etex + \tracingparagraphs1 + \tracingoutput1 + \tracingmacros2 + \tracingrestores1 + \showboxbreadth\maxdimen \showboxdepth\maxdimen + \ifx\eTeXversion\undefined\else % etex gives us more logging + \tracingscantokens1 + \tracingifs1 + \tracinggroups1 + \tracingnesting2 + \tracingassigns1 + \fi + \tracingcommands3 % 3 gives us more in etex + \errorcontextlines16 }% -\else -\def\loggingall{\tracingcommands3 \tracingstats2 - \tracingpages1 \tracingoutput1 \tracinglostchars1 - \tracingmacros2 \tracingparagraphs1 \tracingrestores1 - \tracingscantokens1 \tracingassigns1 \tracingifs1 - \tracinggroups1 \tracingnesting2 - \showboxbreadth\maxdimen\showboxdepth\maxdimen -}% -\fi + +% add check for \lastpenalty to plain's definitions. If the last thing +% we did was a \nobreak, we don't want to insert more space. +% +\def\smallbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\smallskipamount + \removelastskip\penalty-50\smallskip\fi\fi} +\def\medbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\medskipamount + \removelastskip\penalty-100\medskip\fi\fi} +\def\bigbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\bigskipamount + \removelastskip\penalty-200\bigskip\fi\fi} % For @cropmarks command. % Do @cropmarks to get crop marks. @@ -214,6 +306,9 @@ \normalturnoffactive % \ in index entries must not stay \, e.g., if % the page break happens to be in the middle of an example. \shipout\vbox{% + % Do this early so pdf references go to the beginning of the page. + \ifpdfmakepagedest \pdfdest name{\the\pageno} xyz\fi + % \ifcropmarks \vbox to \outervsize\bgroup \hsize = \outerhsize \vskip-\topandbottommargin @@ -243,8 +338,6 @@ \unvbox\footlinebox \fi % - \ifpdfmakepagedest \pdfmkdest{\the\pageno} \fi - % \ifcropmarks \egroup % end of \vbox\bgroup \hfil\egroup % end of (centering) \line\bgroup @@ -262,7 +355,7 @@ \egroup % \vbox from first cropmarks clause \fi }% end of \shipout\vbox - }% end of group with \turnoffactive + }% end of group with \normalturnoffactive \advancepageno \ifnum\outputpenalty>-20000 \else\dosupereject\fi } @@ -295,143 +388,162 @@ % the input line (except we remove a trailing comment). #1 should be a % macro which expects an ordinary undelimited TeX argument. % -\def\parsearg#1{% - \let\next = #1% +\def\parsearg{\parseargusing{}} +\def\parseargusing#1#2{% + \def\next{#2}% \begingroup \obeylines - \futurelet\temp\parseargx + \spaceisspace + #1% + \parseargline\empty% Insert the \empty token, see \finishparsearg below. } -% If the next token is an obeyed space (from an @example environment or -% the like), remove it and recurse. Otherwise, we're done. -\def\parseargx{% - % \obeyedspace is defined far below, after the definition of \sepspaces. - \ifx\obeyedspace\temp - \expandafter\parseargdiscardspace - \else - \expandafter\parseargline - \fi -} - -% Remove a single space (as the delimiter token to the macro call). -{\obeyspaces % - \gdef\parseargdiscardspace {\futurelet\temp\parseargx}} - {\obeylines % \gdef\parseargline#1^^M{% \endgroup % End of the group started in \parsearg. - % - % First remove any @c comment, then any @comment. - % Result of each macro is put in \toks0. - \argremovec #1\c\relax % - \expandafter\argremovecomment \the\toks0 \comment\relax % - % - % Call the caller's macro, saved as \next in \parsearg. - \expandafter\next\expandafter{\the\toks0}% + \argremovecomment #1\comment\ArgTerm% }% } -% Since all \c{,omment} does is throw away the argument, we can let TeX -% do that for us. The \relax here is matched by the \relax in the call -% in \parseargline; it could be more or less anything, its purpose is -% just to delimit the argument to the \c. -\def\argremovec#1\c#2\relax{\toks0 = {#1}} -\def\argremovecomment#1\comment#2\relax{\toks0 = {#1}} +% First remove any @comment, then any @c comment. +\def\argremovecomment#1\comment#2\ArgTerm{\argremovec #1\c\ArgTerm} +\def\argremovec#1\c#2\ArgTerm{\argcheckspaces#1\^^M\ArgTerm} -% \argremovec{,omment} might leave us with trailing spaces, though; e.g., +% Each occurence of `\^^M' or `\^^M' is replaced by a single space. +% +% \argremovec might leave us with trailing space, e.g., % @end itemize @c foo -% will have two active spaces as part of the argument with the -% `itemize'. Here we remove all active spaces from #1, and assign the -% result to \toks0. +% This space token undergoes the same procedure and is eventually removed +% by \finishparsearg. % -% This loses if there are any *other* active characters besides spaces -% in the argument -- _ ^ +, for example -- since they get expanded. -% Fortunately, Texinfo does not define any such commands. (If it ever -% does, the catcode of the characters in questionwill have to be changed -% here.) But this means we cannot call \removeactivespaces as part of -% \argremovec{,omment}, since @c uses \parsearg, and thus the argument -% that \parsearg gets might well have any character at all in it. -% -\def\removeactivespaces#1{% - \begingroup - \ignoreactivespaces - \edef\temp{#1}% - \global\toks0 = \expandafter{\temp}% - \endgroup +\def\argcheckspaces#1\^^M{\argcheckspacesX#1\^^M \^^M} +\def\argcheckspacesX#1 \^^M{\argcheckspacesY#1\^^M} +\def\argcheckspacesY#1\^^M#2\^^M#3\ArgTerm{% + \def\temp{#3}% + \ifx\temp\empty + % We cannot use \next here, as it holds the macro to run; + % thus we reuse \temp. + \let\temp\finishparsearg + \else + \let\temp\argcheckspaces + \fi + % Put the space token in: + \temp#1 #3\ArgTerm } -% Change the active space to expand to nothing. +% If a _delimited_ argument is enclosed in braces, they get stripped; so +% to get _exactly_ the rest of the line, we had to prevent such situation. +% We prepended an \empty token at the very beginning and we expand it now, +% just before passing the control to \next. +% (Similarily, we have to think about #3 of \argcheckspacesY above: it is +% either the null string, or it ends with \^^M---thus there is no danger +% that a pair of braces would be stripped. % -\begingroup +% But first, we have to remove the trailing space token. +% +\def\finishparsearg#1 \ArgTerm{\expandafter\next\expandafter{#1}} + +% \parseargdef\foo{...} +% is roughly equivalent to +% \def\foo{\parsearg\Xfoo} +% \def\Xfoo#1{...} +% +% Actually, I use \csname\string\foo\endcsname, ie. \\foo, as it is my +% favourite TeX trick. --kasal, 16nov03 + +\def\parseargdef#1{% + \expandafter \doparseargdef \csname\string#1\endcsname #1% +} +\def\doparseargdef#1#2{% + \def#2{\parsearg#1}% + \def#1##1% +} + +% Several utility definitions with active space: +{ \obeyspaces - \gdef\ignoreactivespaces{\obeyspaces\let =\empty} -\endgroup + \gdef\obeyedspace{ } + + % Make each space character in the input produce a normal interword + % space in the output. Don't allow a line break at this space, as this + % is used only in environments like @example, where each line of input + % should produce a line of output anyway. + % + \gdef\sepspaces{\obeyspaces\let =\tie} + + % If an index command is used in an @example environment, any spaces + % therein should become regular spaces in the raw index file, not the + % expansion of \tie (\leavevmode \penalty \@M \ ). + \gdef\unsepspaces{\let =\space} +} \def\flushcr{\ifx\par\lisppar \def\next##1{}\else \let\next=\relax \fi \next} -%% These are used to keep @begin/@end levels from running away -%% Call \inENV within environments (after a \begingroup) -\newif\ifENV \ENVfalse \def\inENV{\ifENV\relax\else\ENVtrue\fi} -\def\ENVcheck{% -\ifENV\errmessage{Still within an environment; press RETURN to continue} -\endgroup\fi} % This is not perfect, but it should reduce lossage - -% @begin foo is the same as @foo, for now. -\newhelp\EMsimple{Press RETURN to continue.} - -\outer\def\begin{\parsearg\beginxxx} - -\def\beginxxx #1{% -\expandafter\ifx\csname #1\endcsname\relax -{\errhelp=\EMsimple \errmessage{Undefined command @begin #1}}\else -\csname #1\endcsname\fi} - -% @end foo executes the definition of \Efoo. +% Define the framework for environments in texinfo.tex. It's used like this: % -\def\end{\parsearg\endxxx} -\def\endxxx #1{% - \removeactivespaces{#1}% - \edef\endthing{\the\toks0}% - % - \expandafter\ifx\csname E\endthing\endcsname\relax - \expandafter\ifx\csname \endthing\endcsname\relax - % There's no \foo, i.e., no ``environment'' foo. - \errhelp = \EMsimple - \errmessage{Undefined command `@end \endthing'}% - \else - \unmatchedenderror\endthing - \fi +% \envdef\foo{...} +% \def\Efoo{...} +% +% It's the responsibility of \envdef to insert \begingroup before the +% actual body; @end closes the group after calling \Efoo. \envdef also +% defines \thisenv, so the current environment is known; @end checks +% whether the environment name matches. The \checkenv macro can also be +% used to check whether the current environment is the one expected. +% +% Non-false conditionals (@iftex, @ifset) don't fit into this, so they +% are not treated as enviroments; they don't open a group. (The +% implementation of @end takes care not to call \endgroup in this +% special case.) + + +% At runtime, environments start with this: +\def\startenvironment#1{\begingroup\def\thisenv{#1}} +% initialize +\let\thisenv\empty + +% ... but they get defined via ``\envdef\foo{...}'': +\long\def\envdef#1#2{\def#1{\startenvironment#1#2}} +\def\envparseargdef#1#2{\parseargdef#1{\startenvironment#1#2}} + +% Check whether we're in the right environment: +\def\checkenv#1{% + \def\temp{#1}% + \ifx\thisenv\temp \else - % Everything's ok; the right environment has been started. - \csname E\endthing\endcsname + \badenverr \fi } -% There is an environment #1, but it hasn't been started. Give an error. -% -\def\unmatchedenderror#1{% +% Evironment mismatch, #1 expected: +\def\badenverr{% \errhelp = \EMsimple - \errmessage{This `@end #1' doesn't have a matching `@#1'}% + \errmessage{This command can appear only \inenvironment\temp, + not \inenvironment\thisenv}% +} +\def\inenvironment#1{% + \ifx#1\empty + out of any environment% + \else + in environment \expandafter\string#1% + \fi } -% Define the control sequence \E#1 to give an unmatched @end error. +% @end foo executes the definition of \Efoo. +% But first, it executes a specialized version of \checkenv % -\def\defineunmatchedend#1{% - \expandafter\def\csname E#1\endcsname{\unmatchedenderror{#1}}% +\parseargdef\end{% + \if 1\csname iscond.#1\endcsname + \else + % The general wording of \badenverr may not be ideal, but... --kasal, 06nov03 + \expandafter\checkenv\csname#1\endcsname + \csname E#1\endcsname + \endgroup + \fi } +\newhelp\EMsimple{Press RETURN to continue.} -% Single-spacing is done by various environments (specifically, in -% \nonfillstart and \quotations). -\newskip\singlespaceskip \singlespaceskip = 12.5pt -\def\singlespace{% - % Why was this kern here? It messes up equalizing space above and below - % environments. --karl, 6may93 - %{\advance \baselineskip by -\singlespaceskip - %\kern \baselineskip}% - \setleading \singlespaceskip -} %% Simple single-character @ commands @@ -452,16 +564,22 @@ \let\{=\mylbrace \let\}=\myrbrace \begingroup - % Definitions to produce actual \{ & \} command in an index. - \catcode`\{ = 12 \catcode`\} = 12 + % Definitions to produce \{ and \} commands for indices, + % and @{ and @} for the aux file. + \catcode`\{ = \other \catcode`\} = \other \catcode`\[ = 1 \catcode`\] = 2 - \catcode`\@ = 0 \catcode`\\ = 12 - @gdef@lbracecmd[\{]% - @gdef@rbracecmd[\}]% -@endgroup + \catcode`\! = 0 \catcode`\\ = \other + !gdef!lbracecmd[\{]% + !gdef!rbracecmd[\}]% + !gdef!lbraceatcmd[@{]% + !gdef!rbraceatcmd[@}]% +!endgroup + +% @comma{} to avoid , parsing problems. +\let\comma = , % Accents: @, @dotaccent @ringaccent @ubaraccent @udotaccent -% Others are defined by plain TeX: @` @' @" @^ @~ @= @v @H. +% Others are defined by plain TeX: @` @' @" @^ @~ @= @u @v @H. \let\, = \c \let\dotaccent = \. \def\ringaccent#1{{\accent23 #1}} @@ -469,10 +587,12 @@ \let\ubaraccent = \b \let\udotaccent = \d -% Other special characters: @questiondown @exclamdown -% Plain TeX defines: @AA @AE @O @OE @L (and lowercase versions) @ss. +% Other special characters: @questiondown @exclamdown @ordf @ordm +% Plain TeX defines: @AA @AE @O @OE @L (plus lowercase versions) @ss. \def\questiondown{?`} \def\exclamdown{!`} +\def\ordf{\leavevmode\raise1ex\hbox{\selectfonts\lllsize \underbar{a}}} +\def\ordm{\leavevmode\raise1ex\hbox{\selectfonts\lllsize \underbar{o}}} % Dotless i and dotless j, used for accents. \def\imacro{i} @@ -485,6 +605,25 @@ \fi\fi } +% The \TeX{} logo, as in plain, but resetting the spacing so that a +% period following counts as ending a sentence. (Idea found in latex.) +% +\edef\TeX{\TeX \spacefactor=3000 } + +% @LaTeX{} logo. Not quite the same results as the definition in +% latex.ltx, since we use a different font for the raised A; it's most +% convenient for us to use an explicitly smaller font, rather than using +% the \scriptstyle font (since we don't reset \scriptstyle and +% \scriptscriptstyle). +% +\def\LaTeX{% + L\kern-.36em + {\setbox0=\hbox{T}% + \vbox to \ht0{\hbox{\selectfonts\lllsize A}\vss}}% + \kern-.15em + \TeX +} + % Be sure we're in horizontal mode when doing a tie, since we make space % equivalent to this in @example-like environments. Otherwise, a space % at the beginning of a line will start with \penalty -- and @@ -503,6 +642,9 @@ % @* forces a line break. \def\*{\hfil\break\hbox{}\ignorespaces} +% @/ allows a line break. +\let\/=\allowbreak + % @. is an end-of-sentence period. \def\.{.\spacefactor=3000 } @@ -525,47 +667,24 @@ % therefore, no glue is inserted, and the space between the headline and % the text is small, which looks bad. % -\def\group{\begingroup - \ifnum\catcode13=\active \else +% Another complication is that the group might be very large. This can +% cause the glue on the previous page to be unduly stretched, because it +% does not have much material. In this case, it's better to add an +% explicit \vfill so that the extra space is at the bottom. The +% threshold for doing this is if the group is more than \vfilllimit +% percent of a page (\vfilllimit can be changed inside of @tex). +% +\newbox\groupbox +\def\vfilllimit{0.7} +% +\envdef\group{% + \ifnum\catcode`\^^M=\active \else \errhelp = \groupinvalidhelp \errmessage{@group invalid in context where filling is enabled}% \fi + \startsavinginserts % - % The \vtop we start below produces a box with normal height and large - % depth; thus, TeX puts \baselineskip glue before it, and (when the - % next line of text is done) \lineskip glue after it. (See p.82 of - % the TeXbook.) Thus, space below is not quite equal to space - % above. But it's pretty close. - \def\Egroup{% - \egroup % End the \vtop. - \endgroup % End the \group. - }% - % - \vtop\bgroup - % We have to put a strut on the last line in case the @group is in - % the midst of an example, rather than completely enclosing it. - % Otherwise, the interline space between the last line of the group - % and the first line afterwards is too small. But we can't put the - % strut in \Egroup, since there it would be on a line by itself. - % Hence this just inserts a strut at the beginning of each line. - \everypar = {\strut}% - % - % Since we have a strut on every line, we don't need any of TeX's - % normal interline spacing. - \offinterlineskip - % - % OK, but now we have to do something about blank - % lines in the input in @example-like environments, which normally - % just turn into \lisppar, which will insert no space now that we've - % turned off the interline space. Simplest is to make them be an - % empty paragraph. - \ifx\par\lisppar - \edef\par{\leavevmode \par}% - % - % Reset ^^M's definition to new definition of \par. - \obeylines - \fi - % + \setbox\groupbox = \vtop\bgroup % Do @comment since we are called inside an environment such as % @example, where each end-of-line in the input causes an % end-of-line in the output. We don't want the end-of-line after @@ -575,6 +694,32 @@ \comment } % +% The \vtop produces a box with normal height and large depth; thus, TeX puts +% \baselineskip glue before it, and (when the next line of text is done) +% \lineskip glue after it. Thus, space below is not quite equal to space +% above. But it's pretty close. +\def\Egroup{% + % To get correct interline space between the last line of the group + % and the first line afterwards, we have to propagate \prevdepth. + \endgraf % Not \par, as it may have been set to \lisppar. + \global\dimen1 = \prevdepth + \egroup % End the \vtop. + % \dimen0 is the vertical size of the group's box. + \dimen0 = \ht\groupbox \advance\dimen0 by \dp\groupbox + % \dimen2 is how much space is left on the page (more or less). + \dimen2 = \pageheight \advance\dimen2 by -\pagetotal + % if the group doesn't fit on the current page, and it's a big big + % group, force a page break. + \ifdim \dimen0 > \dimen2 + \ifdim \pagetotal < \vfilllimit\pageheight + \page + \fi + \fi + \box\groupbox + \prevdepth = \dimen1 + \checkinserts +} +% % TeX puts in an \escapechar (i.e., `@') at the beginning of the help % message, so this ends up printing `@group can only ...'. % @@ -587,10 +732,8 @@ where each line of input produces a line of output.} \newdimen\mil \mil=0.001in -\def\need{\parsearg\needx} - % Old definition--didn't work. -%\def\needx #1{\par % +%\parseargdef\need{\par % %% This method tries to make TeX break the page naturally %% if the depth of the box does not fit. %{\baselineskip=0pt% @@ -598,70 +741,50 @@ where each line of input produces a line of output.} %\prevdepth=-1000pt %}} -\def\needx#1{% - % Go into vertical mode, so we don't make a big box in the middle of a +\parseargdef\need{% + % Ensure vertical mode, so we don't make a big box in the middle of a % paragraph. \par % - % Don't add any leading before our big empty box, but allow a page - % break, since the best break might be right here. - \allowbreak - \nointerlineskip - \vtop to #1\mil{\vfil}% - % - % TeX does not even consider page breaks if a penalty added to the - % main vertical list is 10000 or more. But in order to see if the - % empty box we just added fits on the page, we must make it consider - % page breaks. On the other hand, we don't want to actually break the - % page after the empty box. So we use a penalty of 9999. - % - % There is an extremely small chance that TeX will actually break the - % page at this \penalty, if there are no other feasible breakpoints in - % sight. (If the user is using lots of big @group commands, which - % almost-but-not-quite fill up a page, TeX will have a hard time doing - % good page breaking, for example.) However, I could not construct an - % example where a page broke at this \penalty; if it happens in a real - % document, then we can reconsider our strategy. - \penalty9999 - % - % Back up by the size of the box, whether we did a page break or not. - \kern -#1\mil - % - % Do not allow a page break right after this kern. - \nobreak + % If the @need value is less than one line space, it's useless. + \dimen0 = #1\mil + \dimen2 = \ht\strutbox + \advance\dimen2 by \dp\strutbox + \ifdim\dimen0 > \dimen2 + % + % Do a \strut just to make the height of this box be normal, so the + % normal leading is inserted relative to the preceding line. + % And a page break here is fine. + \vtop to #1\mil{\strut\vfil}% + % + % TeX does not even consider page breaks if a penalty added to the + % main vertical list is 10000 or more. But in order to see if the + % empty box we just added fits on the page, we must make it consider + % page breaks. On the other hand, we don't want to actually break the + % page after the empty box. So we use a penalty of 9999. + % + % There is an extremely small chance that TeX will actually break the + % page at this \penalty, if there are no other feasible breakpoints in + % sight. (If the user is using lots of big @group commands, which + % almost-but-not-quite fill up a page, TeX will have a hard time doing + % good page breaking, for example.) However, I could not construct an + % example where a page broke at this \penalty; if it happens in a real + % document, then we can reconsider our strategy. + \penalty9999 + % + % Back up by the size of the box, whether we did a page break or not. + \kern -#1\mil + % + % Do not allow a page break right after this kern. + \nobreak + \fi } -% @br forces paragraph break +% @br forces paragraph break (and is undocumented). \let\br = \par -% @dots{} output an ellipsis using the current font. -% We do .5em per period so that it has the same spacing in a typewriter -% font as three actual period characters. -% -\def\dots{% - \leavevmode - \hbox to 1.5em{% - \hskip 0pt plus 0.25fil minus 0.25fil - .\hss.\hss.% - \hskip 0pt plus 0.5fil minus 0.5fil - }% -} - -% @enddots{} is an end-of-sentence ellipsis. -% -\def\enddots{% - \leavevmode - \hbox to 2em{% - \hskip 0pt plus 0.25fil minus 0.25fil - .\hss.\hss.\hss.% - \hskip 0pt plus 0.5fil minus 0.5fil - }% - \spacefactor=3000 -} - - -% @page forces the start of a new page +% @page forces the start of a new page. % \def\page{\par\vfill\supereject} @@ -673,57 +796,127 @@ where each line of input produces a line of output.} \newskip\exdentamount % This defn is used inside fill environments such as @defun. -\def\exdent{\parsearg\exdentyyy} -\def\exdentyyy #1{{\hfil\break\hbox{\kern -\exdentamount{\rm#1}}\hfil\break}} +\parseargdef\exdent{\hfil\break\hbox{\kern -\exdentamount{\rm#1}}\hfil\break} % This defn is used inside nofill environments such as @example. -\def\nofillexdent{\parsearg\nofillexdentyyy} -\def\nofillexdentyyy #1{{\advance \leftskip by -\exdentamount -\leftline{\hskip\leftskip{\rm#1}}}} +\parseargdef\nofillexdent{{\advance \leftskip by -\exdentamount + \leftline{\hskip\leftskip{\rm#1}}}} -% @inmargin{TEXT} puts TEXT in the margin next to the current paragraph. - -\def\inmargin#1{% -\strut\vadjust{\nobreak\kern-\strutdepth - \vtop to \strutdepth{\baselineskip\strutdepth\vss - \llap{\rightskip=\inmarginspacing \vbox{\noindent #1}}\null}}} +% @inmargin{WHICH}{TEXT} puts TEXT in the WHICH margin next to the current +% paragraph. For more general purposes, use the \margin insertion +% class. WHICH is `l' or `r'. +% \newskip\inmarginspacing \inmarginspacing=1cm \def\strutdepth{\dp\strutbox} - -%\hbox{{\rm#1}}\hfil\break}} +% +\def\doinmargin#1#2{\strut\vadjust{% + \nobreak + \kern-\strutdepth + \vtop to \strutdepth{% + \baselineskip=\strutdepth + \vss + % if you have multiple lines of stuff to put here, you'll need to + % make the vbox yourself of the appropriate size. + \ifx#1l% + \llap{\ignorespaces #2\hskip\inmarginspacing}% + \else + \rlap{\hskip\hsize \hskip\inmarginspacing \ignorespaces #2}% + \fi + \null + }% +}} +\def\inleftmargin{\doinmargin l} +\def\inrightmargin{\doinmargin r} +% +% @inmargin{TEXT [, RIGHT-TEXT]} +% (if RIGHT-TEXT is given, use TEXT for left page, RIGHT-TEXT for right; +% else use TEXT for both). +% +\def\inmargin#1{\parseinmargin #1,,\finish} +\def\parseinmargin#1,#2,#3\finish{% not perfect, but better than nothing. + \setbox0 = \hbox{\ignorespaces #2}% + \ifdim\wd0 > 0pt + \def\lefttext{#1}% have both texts + \def\righttext{#2}% + \else + \def\lefttext{#1}% have only one text + \def\righttext{#1}% + \fi + % + \ifodd\pageno + \def\temp{\inrightmargin\righttext}% odd page -> outside is right margin + \else + \def\temp{\inleftmargin\lefttext}% + \fi + \temp +} % @include file insert text of that file as input. -% Allow normal characters that we make active in the argument (a file name). -\def\include{\begingroup - \catcode`\\=12 - \catcode`~=12 - \catcode`^=12 - \catcode`_=12 - \catcode`|=12 - \catcode`<=12 - \catcode`>=12 - \catcode`+=12 - \parsearg\includezzz} -% Restore active chars for included file. -\def\includezzz#1{\endgroup\begingroup - % Read the included file in a group so nested @include's work. +% +\def\include{\parseargusing\filenamecatcodes\includezzz} +\def\includezzz#1{% + \pushthisfilestack \def\thisfile{#1}% - \input\thisfile -\endgroup} + {% + \makevalueexpandable + \def\temp{\input #1 }% + \expandafter + }\temp + \popthisfilestack +} +\def\filenamecatcodes{% + \catcode`\\=\other + \catcode`~=\other + \catcode`^=\other + \catcode`_=\other + \catcode`|=\other + \catcode`<=\other + \catcode`>=\other + \catcode`+=\other + \catcode`-=\other +} + +\def\pushthisfilestack{% + \expandafter\pushthisfilestackX\popthisfilestack\StackTerm +} +\def\pushthisfilestackX{% + \expandafter\pushthisfilestackY\thisfile\StackTerm +} +\def\pushthisfilestackY #1\StackTerm #2\StackTerm {% + \gdef\popthisfilestack{\gdef\thisfile{#1}\gdef\popthisfilestack{#2}}% +} + +\def\popthisfilestack{\errthisfilestackempty} +\def\errthisfilestackempty{\errmessage{Internal error: + the stack of filenames is empty.}} \def\thisfile{} -% @center line outputs that line, centered - -\def\center{\parsearg\centerzzz} -\def\centerzzz #1{{\advance\hsize by -\leftskip -\advance\hsize by -\rightskip -\centerline{#1}}} +% @center line +% outputs that line, centered. +% +\parseargdef\center{% + \ifhmode + \let\next\centerH + \else + \let\next\centerV + \fi + \next{\hfil \ignorespaces#1\unskip \hfil}% +} +\def\centerH#1{% + {% + \hfil\break + \advance\hsize by -\leftskip + \advance\hsize by -\rightskip + \line{#1}% + \break + }% +} +\def\centerV#1{\line{\kern\leftskip #1\kern\rightskip}} % @sp n outputs n lines of vertical space -\def\sp{\parsearg\spxxx} -\def\spxxx #1{\vskip #1\baselineskip} +\parseargdef\sp{\vskip #1\baselineskip} % @comment ...line which is ignored... % @c is the same as @comment @@ -738,13 +931,13 @@ where each line of input produces a line of output.} % @paragraphindent NCHARS % We'll use ems for NCHARS, close enough. -% We cannot implement @paragraphindent asis, though. -% +% NCHARS can also be the word `asis' or `none'. +% We cannot feasibly implement @paragraphindent asis, though. +% \def\asisword{asis} % no translation, these are keywords \def\noneword{none} % -\def\paragraphindent{\parsearg\doparagraphindent} -\def\doparagraphindent#1{% +\parseargdef\paragraphindent{% \def\temp{#1}% \ifx\temp\asisword \else @@ -761,8 +954,7 @@ where each line of input produces a line of output.} % We'll use ems for NCHARS like @paragraphindent. % It seems @exampleindent asis isn't necessary, but % I preserve it to make it similar to @paragraphindent. -\def\exampleindent{\parsearg\doexampleindent} -\def\doexampleindent#1{% +\parseargdef\exampleindent{% \def\temp{#1}% \ifx\temp\asisword \else @@ -774,26 +966,138 @@ where each line of input produces a line of output.} \fi } +% @firstparagraphindent WORD +% If WORD is `none', then suppress indentation of the first paragraph +% after a section heading. If WORD is `insert', then do indent at such +% paragraphs. +% +% The paragraph indentation is suppressed or not by calling +% \suppressfirstparagraphindent, which the sectioning commands do. +% We switch the definition of this back and forth according to WORD. +% By default, we suppress indentation. +% +\def\suppressfirstparagraphindent{\dosuppressfirstparagraphindent} +\def\insertword{insert} +% +\parseargdef\firstparagraphindent{% + \def\temp{#1}% + \ifx\temp\noneword + \let\suppressfirstparagraphindent = \dosuppressfirstparagraphindent + \else\ifx\temp\insertword + \let\suppressfirstparagraphindent = \relax + \else + \errhelp = \EMsimple + \errmessage{Unknown @firstparagraphindent option `\temp'}% + \fi\fi +} + +% Here is how we actually suppress indentation. Redefine \everypar to +% \kern backwards by \parindent, and then reset itself to empty. +% +% We also make \indent itself not actually do anything until the next +% paragraph. +% +\gdef\dosuppressfirstparagraphindent{% + \gdef\indent{% + \restorefirstparagraphindent + \indent + }% + \gdef\noindent{% + \restorefirstparagraphindent + \noindent + }% + \global\everypar = {% + \kern -\parindent + \restorefirstparagraphindent + }% +} + +\gdef\restorefirstparagraphindent{% + \global \let \indent = \ptexindent + \global \let \noindent = \ptexnoindent + \global \everypar = {}% +} + + % @asis just yields its argument. Used with @table, for example. % \def\asis#1{#1} -% @math means output in math mode. -% We don't use $'s directly in the definition of \math because control -% sequences like \math are expanded when the toc file is written. Then, -% we read the toc file back, the $'s will be normal characters (as they -% should be, according to the definition of Texinfo). So we must use a -% control sequence to switch into and out of math mode. +% @math outputs its argument in math mode. % -% This isn't quite enough for @math to work properly in indices, but it -% seems unlikely it will ever be needed there. +% One complication: _ usually means subscripts, but it could also mean +% an actual _ character, as in @math{@var{some_variable} + 1}. So make +% _ active, and distinguish by seeing if the current family is \slfam, +% which is what @var uses. +{ + \catcode\underChar = \active + \gdef\mathunderscore{% + \catcode\underChar=\active + \def_{\ifnum\fam=\slfam \_\else\sb\fi}% + } +} +% Another complication: we want \\ (and @\) to output a \ character. +% FYI, plain.tex uses \\ as a temporary control sequence (why?), but +% this is not advertised and we don't care. Texinfo does not +% otherwise define @\. % -\let\implicitmath = $ -\def\math#1{\implicitmath #1\implicitmath} +% The \mathchar is class=0=ordinary, family=7=ttfam, position=5C=\. +\def\mathbackslash{\ifnum\fam=\ttfam \mathchar"075C \else\backslash \fi} +% +\def\math{% + \tex + \mathunderscore + \let\\ = \mathbackslash + \mathactive + $\finishmath +} +\def\finishmath#1{#1$\endgroup} % Close the group opened by \tex. + +% Some active characters (such as <) are spaced differently in math. +% We have to reset their definitions in case the @math was an argument +% to a command which sets the catcodes (such as @item or @section). +% +{ + \catcode`^ = \active + \catcode`< = \active + \catcode`> = \active + \catcode`+ = \active + \gdef\mathactive{% + \let^ = \ptexhat + \let< = \ptexless + \let> = \ptexgtr + \let+ = \ptexplus + } +} % @bullet and @minus need the same treatment as @math, just above. -\def\bullet{\implicitmath\ptexbullet\implicitmath} -\def\minus{\implicitmath-\implicitmath} +\def\bullet{$\ptexbullet$} +\def\minus{$-$} + +% @dots{} outputs an ellipsis using the current font. +% We do .5em per period so that it has the same spacing in a typewriter +% font as three actual period characters. +% +\def\dots{% + \leavevmode + \hbox to 1.5em{% + \hskip 0pt plus 0.25fil + .\hfil.\hfil.% + \hskip 0pt plus 0.5fil + }% +} + +% @enddots{} is an end-of-sentence ellipsis. +% +\def\enddots{% + \dots + \spacefactor=3000 +} + +% @comma{} is so commas can be inserted into text without messing up +% Texinfo's parsing. +% +\let\comma = , % @refill is a no-op. \let\refill=\relax @@ -809,20 +1113,20 @@ where each line of input produces a line of output.} % So open here the files we need to have open while reading the input. % This makes it possible to make a .fmt file for texinfo. \def\setfilename{% + \fixbackslash % Turn off hack to swallow `\input texinfo'. \iflinks - \readauxfile + \tryauxfile + % Open the new aux file. TeX will close it automatically at exit. + \immediate\openout\auxfile=\jobname.aux \fi % \openindices needs to do some work in any case. \openindices - \fixbackslash % Turn off hack to swallow `\input texinfo'. - \global\let\setfilename=\comment % Ignore extra @setfilename cmds. + \let\setfilename=\comment % Ignore extra @setfilename cmds. % % If texinfo.cnf is present on the system, read it. % Useful for site-wide @afourpaper, etc. - % Just to be on the safe side, close the input stream before the \input. \openin 1 texinfo.cnf - \ifeof1 \let\temp=\relax \else \def\temp{\input texinfo.cnf }\fi - \closein1 - \temp + \ifeof 1 \else \input texinfo.cnf \fi + \closein 1 % \comment % Ignore the actual filename. } @@ -858,77 +1162,146 @@ where each line of input produces a line of output.} \newif\ifpdf \newif\ifpdfmakepagedest +% when pdftex is run in dvi mode, \pdfoutput is defined (so \pdfoutput=1 +% can be set). So we test for \relax and 0 as well as \undefined, +% borrowed from ifpdf.sty. \ifx\pdfoutput\undefined - \pdffalse - \let\pdfmkdest = \gobble - \let\pdfurl = \gobble - \let\endlink = \relax - \let\linkcolor = \relax - \let\pdfmakeoutlines = \relax \else - \pdftrue - \pdfoutput = 1 - \input pdfcolor - \def\dopdfimage#1#2#3#4{ - \def\imagewidth{#2} - \def\imageheight{#3} - \ifnum\pdftexversion < 14 - \pdfimage + \ifx\pdfoutput\relax + \else + \ifcase\pdfoutput \else - \pdfximage + \pdftrue + \fi + \fi +\fi +% +\ifpdf + \input pdfcolor + \pdfcatalog{/PageMode /UseOutlines}% + \def\dopdfimage#1#2#3{% + \def\imagewidth{#2}% + \def\imageheight{#3}% + % without \immediate, pdftex seg faults when the same image is + % included twice. (Version 3.14159-pre-1.0-unofficial-20010704.) + \ifnum\pdftexversion < 14 + \immediate\pdfimage + \else + \immediate\pdfximage \fi \ifx\empty\imagewidth\else width \imagewidth \fi \ifx\empty\imageheight\else height \imageheight \fi - {#1.pdf} + \ifnum\pdftexversion<13 + #1.pdf% + \else + {#1.pdf}% + \fi \ifnum\pdftexversion < 14 \else - \pdfrefxform \pdflastxform + \pdfrefximage \pdflastximage \fi} - \def\pdfmkdest#1{\pdfdest name{#1@} xyz} - \def\pdfmkpgn#1{#1@} -% \let\linkcolor = \RoyalBlue - \let\linkcolor = \Cyan + \def\pdfmkdest#1{{% + % We have to set dummies so commands such as @code in a section title + % aren't expanded. + \atdummies + \normalturnoffactive + \pdfdest name{#1} xyz% + }} + \def\pdfmkpgn#1{#1} + \let\linkcolor = \Blue % was Cyan, but that seems light? \def\endlink{\Black\pdfendlink} % Adding outlines to PDF; macros for calculating structure of outlines % come from Petr Olsak \def\expnumber#1{\expandafter\ifx\csname#1\endcsname\relax 0% \else \csname#1\endcsname \fi} \def\advancenumber#1{\tempnum=\expnumber{#1}\relax - \advance\tempnum by1 + \advance\tempnum by 1 \expandafter\xdef\csname#1\endcsname{\the\tempnum}} - \def\pdfmakeoutlines{{% - \openin 1 \jobname.toc - \ifeof 1\else\bgroup - \closein 1 + % + % #1 is the section text. #2 is the pdf expression for the number + % of subentries (or empty, for subsubsections). #3 is the node + % text, which might be empty if this toc entry had no + % corresponding node. #4 is the page number. + % + \def\dopdfoutline#1#2#3#4{% + % Generate a link to the node text if that exists; else, use the + % page number. We could generate a destination for the section + % text in the case where a section has no node, but it doesn't + % seem worthwhile, since most documents are normally structured. + \def\pdfoutlinedest{#3}% + \ifx\pdfoutlinedest\empty \def\pdfoutlinedest{#4}\fi + % + \pdfoutline goto name{\pdfmkpgn{\pdfoutlinedest}}#2{#1}% + } + % + \def\pdfmakeoutlines{% + \begingroup + % Thanh's hack / proper braces in bookmarks + \edef\mylbrace{\iftrue \string{\else}\fi}\let\{=\mylbrace + \edef\myrbrace{\iffalse{\else\string}\fi}\let\}=\myrbrace + % + % Read toc silently, to get counts of subentries for \pdfoutline. + \def\numchapentry##1##2##3##4{% + \def\thischapnum{##2}% + \let\thissecnum\empty + \let\thissubsecnum\empty + }% + \def\numsecentry##1##2##3##4{% + \advancenumber{chap\thischapnum}% + \def\thissecnum{##2}% + \let\thissubsecnum\empty + }% + \def\numsubsecentry##1##2##3##4{% + \advancenumber{sec\thissecnum}% + \def\thissubsecnum{##2}% + }% + \def\numsubsubsecentry##1##2##3##4{% + \advancenumber{subsec\thissubsecnum}% + }% + \let\thischapnum\empty + \let\thissecnum\empty + \let\thissubsecnum\empty + % + % use \def rather than \let here because we redefine \chapentry et + % al. a second time, below. + \def\appentry{\numchapentry}% + \def\appsecentry{\numsecentry}% + \def\appsubsecentry{\numsubsecentry}% + \def\appsubsubsecentry{\numsubsubsecentry}% + \def\unnchapentry{\numchapentry}% + \def\unnsecentry{\numsecentry}% + \def\unnsubsecentry{\numsubsecentry}% + \def\unnsubsubsecentry{\numsubsubsecentry}% + \input \jobname.toc + % + % Read toc second time, this time actually producing the outlines. + % The `-' means take the \expnumber as the absolute number of + % subentries, which we calculated on our first read of the .toc above. + % + % We use the node names as the destinations. + \def\numchapentry##1##2##3##4{% + \dopdfoutline{##1}{count-\expnumber{chap##2}}{##3}{##4}}% + \def\numsecentry##1##2##3##4{% + \dopdfoutline{##1}{count-\expnumber{sec##2}}{##3}{##4}}% + \def\numsubsecentry##1##2##3##4{% + \dopdfoutline{##1}{count-\expnumber{subsec##2}}{##3}{##4}}% + \def\numsubsubsecentry##1##2##3##4{% count is always zero + \dopdfoutline{##1}{}{##3}{##4}}% + % + % PDF outlines are displayed using system fonts, instead of + % document fonts. Therefore we cannot use special characters, + % since the encoding is unknown. For example, the eogonek from + % Latin 2 (0xea) gets translated to a | character. Info from + % Staszek Wawrykiewicz, 19 Jan 2004 04:09:24 +0100. + % + % xx to do this right, we have to translate 8-bit characters to + % their "best" equivalent, based on the @documentencoding. Right + % now, I guess we'll just let the pdf reader have its way. \indexnofonts - \def\char{char}% because \expnumber uses the section title in a \csname - \def\chapentry ##1##2##3{} - \def\unnumbchapentry ##1##2{} - \def\secentry ##1##2##3##4{\advancenumber{chap##2}} - \def\unnumbsecentry ##1##2{} - \def\subsecentry ##1##2##3##4##5{\advancenumber{sec##2.##3}} - \def\unnumbsubsecentry ##1##2{} - \def\subsubsecentry ##1##2##3##4##5##6{\advancenumber{subsec##2.##3.##4}} - \def\unnumbsubsubsecentry ##1##2{} + \turnoffactive \input \jobname.toc - \def\chapentry ##1##2##3{% - \pdfoutline goto name{\pdfmkpgn{##3}}count-\expnumber{chap##2}{##1}} - \def\unnumbchapentry ##1##2{% - \pdfoutline goto name{\pdfmkpgn{##2}}{##1}} - \def\secentry ##1##2##3##4{% - \pdfoutline goto name{\pdfmkpgn{##4}}count-\expnumber{sec##2.##3}{##1}} - \def\unnumbsecentry ##1##2{% - \pdfoutline goto name{\pdfmkpgn{##2}}{##1}} - \def\subsecentry ##1##2##3##4##5{% - \pdfoutline goto name{\pdfmkpgn{##5}}count-\expnumber{subsec##2.##3.##4}{##1}} - \def\unnumbsubsecentry ##1##2{% - \pdfoutline goto name{\pdfmkpgn{##2}}{##1}} - \def\subsubsecentry ##1##2##3##4##5##6{% - \pdfoutline goto name{\pdfmkpgn{##6}}{##1}} - \def\unnumbsubsubsecentry ##1##2{% - \pdfoutline goto name{\pdfmkpgn{##2}}{##1}} - \input \jobname.toc - \egroup\fi - }} + \endgroup + } + % \def\makelinks #1,{% \def\params{#1}\def\E{END}% \ifx\params\E @@ -937,7 +1310,7 @@ where each line of input produces a line of output.} \let\nextmakelinks=\makelinks \ifnum\lnkcount>0,\fi \picknum{#1}% - \startlink attr{/Border [0 0 0]} + \startlink attr{/Border [0 0 0]} goto name{\pdfmkpgn{\the\pgn}}% \linkcolor #1% \advance\lnkcount by 1% @@ -959,7 +1332,6 @@ where each line of input produces a line of output.} \def\ppn#1{\pgn=#1\gobble} \def\ppnn{\pgn=\first} \def\pdfmklnk#1{\lnkcount=0\makelinks #1,END,} - \def\addtokens#1#2{\edef\addtoks{\noexpand#1={\the#1#2}}\addtoks} \def\skipspaces#1{\def\PP{#1}\def\D{|}% \ifx\PP\D\let\nextsp\relax \else\let\nextsp\skipspaces @@ -975,25 +1347,23 @@ where each line of input produces a line of output.} \let \startlink \pdfstartlink \fi \def\pdfurl#1{% - \leavevmode\Red \begingroup \normalturnoffactive\def\@{@}% - \startlink - attr{/Border [0 0 0]}% + \makevalueexpandable + \leavevmode\Red + \startlink attr{/Border [0 0 0]}% user{/Subtype /Link /A << /S /URI /URI (#1) >>}% - #1 - \endlink \endgroup} \def\pdfgettoks#1.{\setbox\boxA=\hbox{\toksA={#1.}\toksB={}\maketoks}} \def\addtokens#1#2{\edef\addtoks{\noexpand#1={\the#1#2}}\addtoks} \def\adn#1{\addtokens{\toksC}{#1}\global\countA=1\let\next=\maketoks} \def\poptoks#1#2|ENDTOKS|{\let\first=#1\toksD={#1}\toksA={#2}} \def\maketoks{% - \expandafter\poptoks\the\toksA|ENDTOKS| + \expandafter\poptoks\the\toksA|ENDTOKS|\relax \ifx\first0\adn0 \else\ifx\first1\adn1 \else\ifx\first2\adn2 \else\ifx\first3\adn3 \else\ifx\first4\adn4 \else\ifx\first5\adn5 \else\ifx\first6\adn6 - \else\ifx\first7\adn7 \else\ifx\first8\adn8 \else\ifx\first9\adn9 + \else\ifx\first7\adn7 \else\ifx\first8\adn8 \else\ifx\first9\adn9 \else \ifnum0=\countA\else\makelink\fi \ifx\first.\let\next=\done\else @@ -1006,28 +1376,68 @@ where each line of input produces a line of output.} \def\makelink{\addtokens{\toksB}% {\noexpand\pdflink{\the\toksC}}\toksC={}\global\countA=0} \def\pdflink#1{% - \startlink attr{/Border [0 0 0]} goto name{\mkpgn{#1}} + \startlink attr{/Border [0 0 0]} goto name{\pdfmkpgn{#1}} \linkcolor #1\endlink} - \def\mkpgn#1{#1@} \def\done{\edef\st{\global\noexpand\toksA={\the\toksB}}\st} -\fi % \ifx\pdfoutput +\else + \let\pdfmkdest = \gobble + \let\pdfurl = \gobble + \let\endlink = \relax + \let\linkcolor = \relax + \let\pdfmakeoutlines = \relax +\fi % \ifx\pdfoutput \message{fonts,} -% Font-change commands. + +% Change the current font style to #1, remembering it in \curfontstyle. +% For now, we do not accumulate font styles: @b{@i{foo}} prints foo in +% italics, not bold italics. +% +\def\setfontstyle#1{% + \def\curfontstyle{#1}% not as a control sequence, because we are \edef'd. + \csname ten#1\endcsname % change the current font +} + +% Select #1 fonts with the current style. +% +\def\selectfonts#1{\csname #1fonts\endcsname \csname\curfontstyle\endcsname} + +\def\rm{\fam=0 \setfontstyle{rm}} +\def\it{\fam=\itfam \setfontstyle{it}} +\def\sl{\fam=\slfam \setfontstyle{sl}} +\def\bf{\fam=\bffam \setfontstyle{bf}} +\def\tt{\fam=\ttfam \setfontstyle{tt}} % Texinfo sort of supports the sans serif font style, which plain TeX does not. -% So we set up a \sf analogous to plain's \rm, etc. +% So we set up a \sf. \newfam\sffam -\def\sf{\fam=\sffam \tensf} +\def\sf{\fam=\sffam \setfontstyle{sf}} \let\li = \sf % Sometimes we call it \li, not \sf. -% We don't need math for this one. -\def\ttsl{\tenttsl} +% We don't need math for this font style. +\def\ttsl{\setfontstyle{ttsl}} -% Use Computer Modern fonts at \magstephalf (11pt). -\newcount\mainmagstep -\mainmagstep=\magstephalf +% Default leading. +\newdimen\textleading \textleading = 13.2pt + +% Set the baselineskip to #1, and the lineskip and strut size +% correspondingly. There is no deep meaning behind these magic numbers +% used as factors; they just match (closely enough) what Knuth defined. +% +\def\lineskipfactor{.08333} +\def\strutheightpercent{.70833} +\def\strutdepthpercent {.29167} +% +\def\setleading#1{% + \normalbaselineskip = #1\relax + \normallineskip = \lineskipfactor\normalbaselineskip + \normalbaselines + \setbox\strutbox =\hbox{% + \vrule width0pt height\strutheightpercent\baselineskip + depth \strutdepthpercent \baselineskip + }% +} % Set the font macro #1 to the font named #2, adding on the % specified font prefix (normally `cm'). @@ -1057,17 +1467,18 @@ where each line of input produces a line of output.} \def\scshape{csc} \def\scbshape{csc} +% Text fonts (11.2pt, magstep1). +\newcount\mainmagstep \ifx\bigger\relax -\let\mainmagstep=\magstep1 -\setfont\textrm\rmshape{12}{1000} -\setfont\texttt\ttshape{12}{1000} + % not really supported. + \mainmagstep=\magstep1 + \setfont\textrm\rmshape{12}{1000} + \setfont\texttt\ttshape{12}{1000} \else -\setfont\textrm\rmshape{10}{\mainmagstep} -\setfont\texttt\ttshape{10}{\mainmagstep} + \mainmagstep=\magstephalf + \setfont\textrm\rmshape{10}{\mainmagstep} + \setfont\texttt\ttshape{10}{\mainmagstep} \fi -% Instead of cmb10, you many want to use cmbx10. -% cmbx10 is a prettier font on its own, but cmb10 -% looks better when embedded in a line with cmr10. \setfont\textbf\bfshape{10}{\mainmagstep} \setfont\textit\itshape{10}{\mainmagstep} \setfont\textsl\slshape{10}{\mainmagstep} @@ -1077,30 +1488,37 @@ where each line of input produces a line of output.} \font\texti=cmmi10 scaled \mainmagstep \font\textsy=cmsy10 scaled \mainmagstep -% A few fonts for @defun, etc. -\setfont\defbf\bxshape{10}{\magstep1} %was 1314 +% A few fonts for @defun names and args. +\setfont\defbf\bfshape{10}{\magstep1} \setfont\deftt\ttshape{10}{\magstep1} -\def\df{\let\tentt=\deftt \let\tenbf = \defbf \bf} +\setfont\defttsl\ttslshape{10}{\magstep1} +\def\df{\let\tentt=\deftt \let\tenbf = \defbf \let\tenttsl=\defttsl \bf} -% Fonts for indices and small examples (9pt). -% We actually use the slanted font rather than the italic, -% because texinfo normally uses the slanted fonts for that. -% Do not make many font distinctions in general in the index, since they -% aren't very useful. -\setfont\ninett\ttshape{9}{1000} -\setfont\ninettsl\ttslshape{10}{900} -\setfont\indrm\rmshape{9}{1000} -\setfont\indit\itshape{9}{1000} -\setfont\indsl\slshape{9}{1000} -\let\indtt=\ninett -\let\indttsl=\ninettsl -\let\indsf=\indrm -\let\indbf=\indrm -\setfont\indsc\scshape{10}{900} -\font\indi=cmmi9 -\font\indsy=cmsy9 +% Fonts for indices, footnotes, small examples (9pt). +\setfont\smallrm\rmshape{9}{1000} +\setfont\smalltt\ttshape{9}{1000} +\setfont\smallbf\bfshape{10}{900} +\setfont\smallit\itshape{9}{1000} +\setfont\smallsl\slshape{9}{1000} +\setfont\smallsf\sfshape{9}{1000} +\setfont\smallsc\scshape{10}{900} +\setfont\smallttsl\ttslshape{10}{900} +\font\smalli=cmmi9 +\font\smallsy=cmsy9 -% Fonts for title page: +% Fonts for small examples (8pt). +\setfont\smallerrm\rmshape{8}{1000} +\setfont\smallertt\ttshape{8}{1000} +\setfont\smallerbf\bfshape{10}{800} +\setfont\smallerit\itshape{8}{1000} +\setfont\smallersl\slshape{8}{1000} +\setfont\smallersf\sfshape{8}{1000} +\setfont\smallersc\scshape{10}{800} +\setfont\smallerttsl\ttslshape{10}{800} +\font\smalleri=cmmi8 +\font\smallersy=cmsy8 + +% Fonts for title page (20.4pt): \setfont\titlerm\rmbshape{12}{\magstep3} \setfont\titleit\itbshape{10}{\magstep4} \setfont\titlesl\slbshape{10}{\magstep4} @@ -1112,6 +1530,7 @@ where each line of input produces a line of output.} \font\titlei=cmmi12 scaled \magstep3 \font\titlesy=cmsy10 scaled \magstep4 \def\authorrm{\secrm} +\def\authortt{\sectt} % Chapter (and unnumbered) fonts (17.28pt). \setfont\chaprm\rmbshape{12}{\magstep2} @@ -1137,20 +1556,6 @@ where each line of input produces a line of output.} \font\seci=cmmi12 scaled \magstep1 \font\secsy=cmsy10 scaled \magstep2 -% \setfont\ssecrm\bxshape{10}{\magstep1} % This size an font looked bad. -% \setfont\ssecit\itshape{10}{\magstep1} % The letters were too crowded. -% \setfont\ssecsl\slshape{10}{\magstep1} -% \setfont\ssectt\ttshape{10}{\magstep1} -% \setfont\ssecsf\sfshape{10}{\magstep1} - -%\setfont\ssecrm\bfshape{10}{1315} % Note the use of cmb rather than cmbx. -%\setfont\ssecit\itshape{10}{1315} % Also, the size is a little larger than -%\setfont\ssecsl\slshape{10}{1315} % being scaled magstep1. -%\setfont\ssectt\ttshape{10}{1315} -%\setfont\ssecsf\sfshape{10}{1315} - -%\let\ssecbf=\ssecrm - % Subsection fonts (13.15pt). \setfont\ssecrm\rmbshape{12}{\magstephalf} \setfont\ssecit\itbshape{10}{1315} @@ -1159,68 +1564,124 @@ where each line of input produces a line of output.} \setfont\ssecttsl\ttslshape{10}{1315} \setfont\ssecsf\sfbshape{12}{\magstephalf} \let\ssecbf\ssecrm -\setfont\ssecsc\scbshape{10}{\magstep1} +\setfont\ssecsc\scbshape{10}{1315} \font\sseci=cmmi12 scaled \magstephalf \font\ssecsy=cmsy10 scaled 1315 -% The smallcaps and symbol fonts should actually be scaled \magstep1.5, -% but that is not a standard magnification. + +% Reduced fonts for @acro in text (10pt). +\setfont\reducedrm\rmshape{10}{1000} +\setfont\reducedtt\ttshape{10}{1000} +\setfont\reducedbf\bfshape{10}{1000} +\setfont\reducedit\itshape{10}{1000} +\setfont\reducedsl\slshape{10}{1000} +\setfont\reducedsf\sfshape{10}{1000} +\setfont\reducedsc\scshape{10}{1000} +\setfont\reducedttsl\ttslshape{10}{1000} +\font\reducedi=cmmi10 +\font\reducedsy=cmsy10 % In order for the font changes to affect most math symbols and letters, % we have to define the \textfont of the standard families. Since -% texinfo doesn't allow for producing subscripts and superscripts, we -% don't bother to reset \scriptfont and \scriptscriptfont (which would -% also require loading a lot more fonts). +% texinfo doesn't allow for producing subscripts and superscripts except +% in the main text, we don't bother to reset \scriptfont and +% \scriptscriptfont (which would also require loading a lot more fonts). % \def\resetmathfonts{% - \textfont0 = \tenrm \textfont1 = \teni \textfont2 = \tensy - \textfont\itfam = \tenit \textfont\slfam = \tensl \textfont\bffam = \tenbf - \textfont\ttfam = \tentt \textfont\sffam = \tensf + \textfont0=\tenrm \textfont1=\teni \textfont2=\tensy + \textfont\itfam=\tenit \textfont\slfam=\tensl \textfont\bffam=\tenbf + \textfont\ttfam=\tentt \textfont\sffam=\tensf } - % The font-changing commands redefine the meanings of \tenSTYLE, instead -% of just \STYLE. We do this so that font changes will continue to work -% in math mode, where it is the current \fam that is relevant in most -% cases, not the current font. Plain TeX does \def\bf{\fam=\bffam -% \tenbf}, for example. By redefining \tenbf, we obviate the need to -% redefine \bf itself. +% of just \STYLE. We do this because \STYLE needs to also set the +% current \fam for math mode. Our \STYLE (e.g., \rm) commands hardwire +% \tenSTYLE to set the current font. +% +% Each font-changing command also sets the names \lsize (one size lower) +% and \lllsize (three sizes lower). These relative commands are used in +% the LaTeX logo and acronyms. +% +% This all needs generalizing, badly. +% \def\textfonts{% \let\tenrm=\textrm \let\tenit=\textit \let\tensl=\textsl \let\tenbf=\textbf \let\tentt=\texttt \let\smallcaps=\textsc - \let\tensf=\textsf \let\teni=\texti \let\tensy=\textsy \let\tenttsl=\textttsl - \resetmathfonts} + \let\tensf=\textsf \let\teni=\texti \let\tensy=\textsy + \let\tenttsl=\textttsl + \def\lsize{reduced}\def\lllsize{smaller}% + \resetmathfonts \setleading{\textleading}} \def\titlefonts{% \let\tenrm=\titlerm \let\tenit=\titleit \let\tensl=\titlesl \let\tenbf=\titlebf \let\tentt=\titlett \let\smallcaps=\titlesc \let\tensf=\titlesf \let\teni=\titlei \let\tensy=\titlesy \let\tenttsl=\titlettsl + \def\lsize{chap}\def\lllsize{subsec}% \resetmathfonts \setleading{25pt}} \def\titlefont#1{{\titlefonts\rm #1}} \def\chapfonts{% \let\tenrm=\chaprm \let\tenit=\chapit \let\tensl=\chapsl \let\tenbf=\chapbf \let\tentt=\chaptt \let\smallcaps=\chapsc \let\tensf=\chapsf \let\teni=\chapi \let\tensy=\chapsy \let\tenttsl=\chapttsl + \def\lsize{sec}\def\lllsize{text}% \resetmathfonts \setleading{19pt}} \def\secfonts{% \let\tenrm=\secrm \let\tenit=\secit \let\tensl=\secsl \let\tenbf=\secbf \let\tentt=\sectt \let\smallcaps=\secsc - \let\tensf=\secsf \let\teni=\seci \let\tensy=\secsy \let\tenttsl=\secttsl + \let\tensf=\secsf \let\teni=\seci \let\tensy=\secsy + \let\tenttsl=\secttsl + \def\lsize{subsec}\def\lllsize{reduced}% \resetmathfonts \setleading{16pt}} \def\subsecfonts{% \let\tenrm=\ssecrm \let\tenit=\ssecit \let\tensl=\ssecsl \let\tenbf=\ssecbf \let\tentt=\ssectt \let\smallcaps=\ssecsc - \let\tensf=\ssecsf \let\teni=\sseci \let\tensy=\ssecsy \let\tenttsl=\ssecttsl + \let\tensf=\ssecsf \let\teni=\sseci \let\tensy=\ssecsy + \let\tenttsl=\ssecttsl + \def\lsize{text}\def\lllsize{small}% \resetmathfonts \setleading{15pt}} -\let\subsubsecfonts = \subsecfonts % Maybe make sssec fonts scaled magstephalf? -\def\indexfonts{% - \let\tenrm=\indrm \let\tenit=\indit \let\tensl=\indsl - \let\tenbf=\indbf \let\tentt=\indtt \let\smallcaps=\indsc - \let\tensf=\indsf \let\teni=\indi \let\tensy=\indsy \let\tenttsl=\indttsl - \resetmathfonts \setleading{12pt}} +\let\subsubsecfonts = \subsecfonts +\def\reducedfonts{% + \let\tenrm=\reducedrm \let\tenit=\reducedit \let\tensl=\reducedsl + \let\tenbf=\reducedbf \let\tentt=\reducedtt \let\reducedcaps=\reducedsc + \let\tensf=\reducedsf \let\teni=\reducedi \let\tensy=\reducedsy + \let\tenttsl=\reducedttsl + \def\lsize{small}\def\lllsize{smaller}% + \resetmathfonts \setleading{10.5pt}} +\def\smallfonts{% + \let\tenrm=\smallrm \let\tenit=\smallit \let\tensl=\smallsl + \let\tenbf=\smallbf \let\tentt=\smalltt \let\smallcaps=\smallsc + \let\tensf=\smallsf \let\teni=\smalli \let\tensy=\smallsy + \let\tenttsl=\smallttsl + \def\lsize{smaller}\def\lllsize{smaller}% + \resetmathfonts \setleading{10.5pt}} +\def\smallerfonts{% + \let\tenrm=\smallerrm \let\tenit=\smallerit \let\tensl=\smallersl + \let\tenbf=\smallerbf \let\tentt=\smallertt \let\smallcaps=\smallersc + \let\tensf=\smallersf \let\teni=\smalleri \let\tensy=\smallersy + \let\tenttsl=\smallerttsl + \def\lsize{smaller}\def\lllsize{smaller}% + \resetmathfonts \setleading{9.5pt}} + +% Set the fonts to use with the @small... environments. +\let\smallexamplefonts = \smallfonts + +% About \smallexamplefonts. If we use \smallfonts (9pt), @smallexample +% can fit this many characters: +% 8.5x11=86 smallbook=72 a4=90 a5=69 +% If we use \scriptfonts (8pt), then we can fit this many characters: +% 8.5x11=90+ smallbook=80 a4=90+ a5=77 +% For me, subjectively, the few extra characters that fit aren't worth +% the additional smallness of 8pt. So I'm making the default 9pt. +% +% By the way, for comparison, here's what fits with @example (10pt): +% 8.5x11=71 smallbook=60 a4=75 a5=58 +% +% I wish the USA used A4 paper. +% --karl, 24jan03. + % Set up the default fonts, so we can use them for creating boxes. % -\textfonts +\textfonts \rm % Define these so they can be easily changed for other fonts. \def\angleleft{$\langle$} @@ -1231,23 +1692,32 @@ where each line of input produces a line of output.} % Fonts for short table of contents. \setfont\shortcontrm\rmshape{12}{1000} -\setfont\shortcontbf\bxshape{12}{1000} +\setfont\shortcontbf\bfshape{10}{\magstep1} % no cmb12 \setfont\shortcontsl\slshape{12}{1000} +\setfont\shortconttt\ttshape{12}{1000} %% Add scribe-like font environments, plus @l for inline lisp (usually sans %% serif) and @ii for TeX italic % \smartitalic{ARG} outputs arg in italics, followed by an italic correction % unless the following character is such as not to need one. -\def\smartitalicx{\ifx\next,\else\ifx\next-\else\ifx\next.\else\/\fi\fi\fi} -\def\smartslanted#1{{\sl #1}\futurelet\next\smartitalicx} -\def\smartitalic#1{{\it #1}\futurelet\next\smartitalicx} +\def\smartitalicx{\ifx\next,\else\ifx\next-\else\ifx\next.\else + \ptexslash\fi\fi\fi} +\def\smartslanted#1{{\ifusingtt\ttsl\sl #1}\futurelet\next\smartitalicx} +\def\smartitalic#1{{\ifusingtt\ttsl\it #1}\futurelet\next\smartitalicx} + +% like \smartslanted except unconditionally uses \ttsl. +% @var is set to this for defun arguments. +\def\ttslanted#1{{\ttsl #1}\futurelet\next\smartitalicx} + +% like \smartslanted except unconditionally use \sl. We never want +% ttsl for book titles, do we? +\def\cite#1{{\sl #1}\futurelet\next\smartitalicx} \let\i=\smartitalic \let\var=\smartslanted \let\dfn=\smartslanted \let\emph=\smartitalic -\let\cite=\smartslanted \def\b#1{{\bf #1}} \let\strong=\b @@ -1259,15 +1729,25 @@ where each line of input produces a line of output.} \def\nohyphenation{\hyphenchar\font = -1 \aftergroup\restorehyphenation} \def\restorehyphenation{\hyphenchar\font = `- } +% Set sfcode to normal for the chars that usually have another value. +% Can't use plain's \frenchspacing because it uses the `\x notation, and +% sometimes \x has an active definition that messes things up. +% +\catcode`@=11 + \def\frenchspacing{% + \sfcode\dotChar =\@m \sfcode\questChar=\@m \sfcode\exclamChar=\@m + \sfcode\colonChar=\@m \sfcode\semiChar =\@m \sfcode\commaChar =\@m + } +\catcode`@=\other + \def\t#1{% {\tt \rawbackslash \frenchspacing #1}% \null } -\let\ttfont=\t \def\samp#1{`\tclose{#1}'\null} -\setfont\smallrm\rmshape{8}{1000} -\font\smallsy=cmsy9 -\def\key#1{{\smallrm\textfont2=\smallsy \leavevmode\hbox{% +\setfont\keyrm\rmshape{8}{1000} +\font\keysy=cmsy9 +\def\key#1{{\keyrm\textfont2=\keysy \leavevmode\hbox{% \raise0.4pt\hbox{\angleleft}\kern-.08em\vtop{% \vbox{\hrule\kern-0.4pt \hbox{\raise0.4pt\hbox{\vphantom{\angleleft}}#1}}% @@ -1304,7 +1784,7 @@ where each line of input produces a line of output.} \null } -% We *must* turn on hyphenation at `-' and `_' in \code. +% We *must* turn on hyphenation at `-' and `_' in @code. % Otherwise, it is too hard to avoid overfull hboxes % in the Emacs manual, the Library manual, etc. @@ -1322,27 +1802,30 @@ where each line of input produces a line of output.} \catcode`\_=\active \let_\codeunder \codex } - % - % If we end up with any active - characters when handling the index, - % just treat them as a normal -. - \global\def\indexbreaks{\catcode`\-=\active \let-\realdash} } \def\realdash{-} \def\codedash{-\discretionary{}{}{}} -\def\codeunder{\ifusingtt{\normalunderscore\discretionary{}{}{}}{\_}} +\def\codeunder{% + % this is all so @math{@code{var_name}+1} can work. In math mode, _ + % is "active" (mathcode"8000) and \normalunderscore (or \char95, etc.) + % will therefore expand the active definition of _, which is us + % (inside @code that is), therefore an endless loop. + \ifusingtt{\ifmmode + \mathchar"075F % class 0=ordinary, family 7=ttfam, pos 0x5F=_. + \else\normalunderscore \fi + \discretionary{}{}{}}% + {\_}% +} \def\codex #1{\tclose{#1}\endgroup} -%\let\exp=\tclose %Was temporary - % @kbd is like @code, except that if the argument is just one @key command, % then @kbd has no effect. % @kbdinputstyle -- arg is `distinct' (@kbd uses slanted tty font always), % `example' (@kbd uses ttsl only inside of @example and friends), % or `code' (@kbd uses normal tty font always). -\def\kbdinputstyle{\parsearg\kbdinputstylexxx} -\def\kbdinputstylexxx#1{% +\parseargdef\kbdinputstyle{% \def\arg{#1}% \ifx\arg\worddistinct \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\ttsl}% @@ -1350,15 +1833,17 @@ where each line of input produces a line of output.} \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\tt}% \else\ifx\arg\wordcode \gdef\kbdexamplefont{\tt}\gdef\kbdfont{\tt}% + \else + \errhelp = \EMsimple + \errmessage{Unknown @kbdinputstyle option `\arg'}% \fi\fi\fi } \def\worddistinct{distinct} \def\wordexample{example} \def\wordcode{code} -% Default is kbdinputdistinct. (Too much of a hassle to call the macro, -% the catcodes are wrong for parsearg to work.) -\gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\ttsl} +% Default is `distinct.' +\kbdinputstyle distinct \def\xkey{\key} \def\kbdfoo#1#2#3\par{\def\one{#1}\def\three{#3}\def\threex{??}% @@ -1366,8 +1851,8 @@ where each line of input produces a line of output.} \else{\tclose{\kbdfont\look}}\fi \else{\tclose{\kbdfont\look}}\fi} -% For @url, @env, @command quotes seem unnecessary, so use \code. -\let\url=\code +% For @indicateurl, @env, @command quotes seem unnecessary, so use \code. +\let\indicateurl=\code \let\env=\code \let\command=\code @@ -1378,7 +1863,8 @@ where each line of input produces a line of output.} % a hypertex \special here. % \def\uref#1{\douref #1,,,\finish} -\def\douref#1,#2,#3,#4\finish{% +\def\douref#1,#2,#3,#4\finish{\begingroup + \unsepspaces \pdfurl{#1}% \setbox0 = \hbox{\ignorespaces #3}% \ifdim\wd0 > 0pt @@ -1395,22 +1881,26 @@ where each line of input produces a line of output.} \code{#1}% only url given, so show it \fi \fi - % \endlink -} +\endgroup} + +% @url synonym for @uref, since that's how everyone uses it. +% +\let\url=\uref % rms does not like angle brackets --karl, 17may97. % So now @email is just like @uref, unless we are pdf. -% +% %\def\email#1{\angleleft{\tt #1}\angleright} \ifpdf \def\email#1{\doemail#1,,\finish} - \def\doemail#1,#2,#3\finish{% + \def\doemail#1,#2,#3\finish{\begingroup + \unsepspaces \pdfurl{mailto:#1}% \setbox0 = \hbox{\ignorespaces #2}% \ifdim\wd0>0pt\unhbox0\else\code{#1}\fi \endlink - } + \endgroup} \else \let\email=\uref \fi @@ -1439,12 +1929,37 @@ where each line of input produces a line of output.} \def\sc#1{{\smallcaps#1}} % smallcaps font \def\ii#1{{\it #1}} % italic font -% @acronym downcases the argument and prints in smallcaps. -\def\acronym#1{{\smallcaps \lowercase{#1}}} +\def\acronym#1{\doacronym #1,,\finish} +\def\doacronym#1,#2,#3\finish{% + {\selectfonts\lsize #1}% + \def\temp{#2}% + \ifx\temp\empty \else + \space ({\unsepspaces \ignorespaces \temp \unskip})% + \fi +} -% @pounds{} is a sterling sign. +% @pounds{} is a sterling sign, which is in the CM italic font. +% \def\pounds{{\it\$}} +% @registeredsymbol - R in a circle. The font for the R should really +% be smaller yet, but lllsize is the best we can do for now. +% Adapted from the plain.tex definition of \copyright. +% +\def\registeredsymbol{% + $^{{\ooalign{\hfil\raise.07ex\hbox{\selectfonts\lllsize R}% + \hfil\crcr\Orb}}% + }$% +} + +% Laurent Siebenmann reports \Orb undefined with: +% Textures 1.7.7 (preloaded format=plain 93.10.14) (68K) 16 APR 2004 02:38 +% so we'll define it if necessary. +% +\ifx\Orb\undefined +\def\Orb{\mathhexbox20D} +\fi + \message{page headings,} @@ -1463,87 +1978,103 @@ where each line of input produces a line of output.} \newif\ifsetshortcontentsaftertitlepage \let\setshortcontentsaftertitlepage = \setshortcontentsaftertitlepagetrue -\def\shorttitlepage{\parsearg\shorttitlepagezzz} -\def\shorttitlepagezzz #1{\begingroup\hbox{}\vskip 1.5in \chaprm \centerline{#1}% +\parseargdef\shorttitlepage{\begingroup\hbox{}\vskip 1.5in \chaprm \centerline{#1}% \endgroup\page\hbox{}\page} -\def\titlepage{\begingroup \parindent=0pt \textfonts - \let\subtitlerm=\tenrm - \def\subtitlefont{\subtitlerm \normalbaselineskip = 13pt \normalbaselines}% - % - \def\authorfont{\authorrm \normalbaselineskip = 16pt \normalbaselines}% - % - % Leave some space at the very top of the page. - \vglue\titlepagetopglue - % - % Now you can print the title using @title. - \def\title{\parsearg\titlezzz}% - \def\titlezzz##1{\leftline{\titlefonts\rm ##1} - % print a rule at the page bottom also. - \finishedtitlepagefalse - \vskip4pt \hrule height 4pt width \hsize \vskip4pt}% - % No rule at page bottom unless we print one at the top with @title. - \finishedtitlepagetrue - % - % Now you can put text using @subtitle. - \def\subtitle{\parsearg\subtitlezzz}% - \def\subtitlezzz##1{{\subtitlefont \rightline{##1}}}% - % - % @author should come last, but may come many times. - \def\author{\parsearg\authorzzz}% - \def\authorzzz##1{\ifseenauthor\else\vskip 0pt plus 1filll\seenauthortrue\fi - {\authorfont \leftline{##1}}}% - % - % Most title ``pages'' are actually two pages long, with space - % at the top of the second. We don't want the ragged left on the second. - \let\oldpage = \page - \def\page{% +\envdef\titlepage{% + % Open one extra group, as we want to close it in the middle of \Etitlepage. + \begingroup + \parindent=0pt \textfonts + % Leave some space at the very top of the page. + \vglue\titlepagetopglue + % No rule at page bottom unless we print one at the top with @title. + \finishedtitlepagetrue + % + % Most title ``pages'' are actually two pages long, with space + % at the top of the second. We don't want the ragged left on the second. + \let\oldpage = \page + \def\page{% \iffinishedtitlepage\else - \finishtitlepage + \finishtitlepage \fi - \oldpage \let\page = \oldpage - \hbox{}}% -% \def\page{\oldpage \hbox{}} + \page + \null + }% } \def\Etitlepage{% - \iffinishedtitlepage\else - \finishtitlepage - \fi - % It is important to do the page break before ending the group, - % because the headline and footline are only empty inside the group. - % If we use the new definition of \page, we always get a blank page - % after the title page, which we certainly don't want. - \oldpage - \endgroup - % - % If they want short, they certainly want long too. - \ifsetshortcontentsaftertitlepage - \shortcontents - \contents - \global\let\shortcontents = \relax - \global\let\contents = \relax - \fi - % - \ifsetcontentsaftertitlepage - \contents - \global\let\contents = \relax - \global\let\shortcontents = \relax - \fi - % - \ifpdf \pdfmakepagedesttrue \fi - % - \HEADINGSon + \iffinishedtitlepage\else + \finishtitlepage + \fi + % It is important to do the page break before ending the group, + % because the headline and footline are only empty inside the group. + % If we use the new definition of \page, we always get a blank page + % after the title page, which we certainly don't want. + \oldpage + \endgroup + % + % Need this before the \...aftertitlepage checks so that if they are + % in effect the toc pages will come out with page numbers. + \HEADINGSon + % + % If they want short, they certainly want long too. + \ifsetshortcontentsaftertitlepage + \shortcontents + \contents + \global\let\shortcontents = \relax + \global\let\contents = \relax + \fi + % + \ifsetcontentsaftertitlepage + \contents + \global\let\contents = \relax + \global\let\shortcontents = \relax + \fi } \def\finishtitlepage{% - \message{FINISH TITLE} - \vskip4pt \hrule height 2pt width \hsize - \vskip\titlepagebottomglue - \finishedtitlepagetrue + \vskip4pt \hrule height 2pt width \hsize + \vskip\titlepagebottomglue + \finishedtitlepagetrue } +%%% Macros to be used within @titlepage: + +\let\subtitlerm=\tenrm +\def\subtitlefont{\subtitlerm \normalbaselineskip = 13pt \normalbaselines} + +\def\authorfont{\authorrm \normalbaselineskip = 16pt \normalbaselines + \let\tt=\authortt} + +\parseargdef\title{% + \checkenv\titlepage + \leftline{\titlefonts\rm #1} + % print a rule at the page bottom also. + \finishedtitlepagefalse + \vskip4pt \hrule height 4pt width \hsize \vskip4pt +} + +\parseargdef\subtitle{% + \checkenv\titlepage + {\subtitlefont \rightline{#1}}% +} + +% @author should come last, but may come many times. +% It can also be used inside @quotation. +% +\parseargdef\author{% + \def\temp{\quotation}% + \ifx\thisenv\temp + \def\quotationauthor{#1}% printed in \Equotation. + \else + \checkenv\titlepage + \ifseenauthor\else \vskip 0pt plus 1filll \seenauthortrue \fi + {\authorfont \leftline{#1}}% + \fi +} + + %%% Set up page headings and footings. \let\thispage=\folio @@ -1553,7 +2084,7 @@ where each line of input produces a line of output.} \newtoks\evenfootline % footline on even pages \newtoks\oddfootline % footline on odd pages -% Now make Tex use those variables +% Now make TeX use those variables \headline={{\textfonts\rm \ifodd\pageno \the\oddheadline \else \the\evenheadline \fi}} \footline={{\textfonts\rm \ifodd\pageno \the\oddfootline @@ -1567,32 +2098,27 @@ where each line of input produces a line of output.} % @evenfooting @thisfile|| % @oddfooting ||@thisfile + \def\evenheading{\parsearg\evenheadingxxx} -\def\oddheading{\parsearg\oddheadingxxx} -\def\everyheading{\parsearg\everyheadingxxx} - -\def\evenfooting{\parsearg\evenfootingxxx} -\def\oddfooting{\parsearg\oddfootingxxx} -\def\everyfooting{\parsearg\everyfootingxxx} - -{\catcode`\@=0 % - -\gdef\evenheadingxxx #1{\evenheadingyyy #1@|@|@|@|\finish} -\gdef\evenheadingyyy #1@|#2@|#3@|#4\finish{% +\def\evenheadingxxx #1{\evenheadingyyy #1\|\|\|\|\finish} +\def\evenheadingyyy #1\|#2\|#3\|#4\finish{% \global\evenheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}} -\gdef\oddheadingxxx #1{\oddheadingyyy #1@|@|@|@|\finish} -\gdef\oddheadingyyy #1@|#2@|#3@|#4\finish{% +\def\oddheading{\parsearg\oddheadingxxx} +\def\oddheadingxxx #1{\oddheadingyyy #1\|\|\|\|\finish} +\def\oddheadingyyy #1\|#2\|#3\|#4\finish{% \global\oddheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}} -\gdef\everyheadingxxx#1{\oddheadingxxx{#1}\evenheadingxxx{#1}}% +\parseargdef\everyheading{\oddheadingxxx{#1}\evenheadingxxx{#1}}% -\gdef\evenfootingxxx #1{\evenfootingyyy #1@|@|@|@|\finish} -\gdef\evenfootingyyy #1@|#2@|#3@|#4\finish{% +\def\evenfooting{\parsearg\evenfootingxxx} +\def\evenfootingxxx #1{\evenfootingyyy #1\|\|\|\|\finish} +\def\evenfootingyyy #1\|#2\|#3\|#4\finish{% \global\evenfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}}} -\gdef\oddfootingxxx #1{\oddfootingyyy #1@|@|@|@|\finish} -\gdef\oddfootingyyy #1@|#2@|#3@|#4\finish{% +\def\oddfooting{\parsearg\oddfootingxxx} +\def\oddfootingxxx #1{\oddfootingyyy #1\|\|\|\|\finish} +\def\oddfootingyyy #1\|#2\|#3\|#4\finish{% \global\oddfootline = {\rlap{\centerline{#2}}\line{#1\hfil#3}}% % % Leave some space for the footline. Hopefully ok to assume @@ -1601,9 +2127,8 @@ where each line of input produces a line of output.} \global\advance\vsize by -\baselineskip } -\gdef\everyfootingxxx#1{\oddfootingxxx{#1}\evenfootingxxx{#1}} -% -}% unbind the catcode of @. +\parseargdef\everyfooting{\oddfootingxxx{#1}\evenfootingxxx{#1}} + % @headings double turns headings on for double-sided printing. % @headings single turns headings on for single-sided printing. @@ -1617,7 +2142,7 @@ where each line of input produces a line of output.} \def\headings #1 {\csname HEADINGS#1\endcsname} -\def\HEADINGSoff{ +\def\HEADINGSoff{% \global\evenheadline={\hfil} \global\evenfootline={\hfil} \global\oddheadline={\hfil} \global\oddfootline={\hfil}} \HEADINGSoff @@ -1626,7 +2151,7 @@ where each line of input produces a line of output.} % chapter name on inside top of right hand pages, document % title on inside top of left hand pages, and page numbers on outside top % edge of all pages. -\def\HEADINGSdouble{ +\def\HEADINGSdouble{% \global\pageno=1 \global\evenfootline={\hfil} \global\oddfootline={\hfil} @@ -1638,7 +2163,7 @@ where each line of input produces a line of output.} % For single-sided printing, chapter title goes across top left of page, % page number on top right. -\def\HEADINGSsingle{ +\def\HEADINGSsingle{% \global\pageno=1 \global\evenfootline={\hfil} \global\oddfootline={\hfil} @@ -1668,7 +2193,10 @@ where each line of input produces a line of output.} } % Subroutines used in generating headings -% Produces Day Month Year style of output. +% This produces Day Month Year style of output. +% Only define if not already defined, in case a txi-??.tex file has set +% up a different format (e.g., txi-cs.tex does this). +\ifx\today\undefined \def\today{% \number\day\space \ifcase\month @@ -1677,16 +2205,16 @@ where each line of input produces a line of output.} \or\putwordMSep\or\putwordMOct\or\putwordMNov\or\putwordMDec \fi \space\number\year} +\fi % @settitle line... specifies the title of the document, for headings. % It generates no output of its own. \def\thistitle{\putwordNoTitle} -\def\settitle{\parsearg\settitlezzz} -\def\settitlezzz #1{\gdef\thistitle{#1}} +\def\settitle{\parsearg{\gdef\thistitle}} \message{tables,} -% Tables -- @table, @ftable, @vtable, @item(x), @kitem(x), @xitem(x). +% Tables -- @table, @ftable, @vtable, @item(x). % default indentation of table text \newdimen\tableindent \tableindent=.8in @@ -1698,7 +2226,7 @@ where each line of input produces a line of output.} % used internally for \itemindent minus \itemmargin \newdimen\itemmax -% Note @table, @vtable, and @vtable define @item, @itemx, etc., with +% Note @table, @ftable, and @vtable define @item, @itemx, etc., with % these defs. % They also define \itemindex % to index the item name in whatever manner is desired (perhaps none). @@ -1710,22 +2238,10 @@ where each line of input produces a line of output.} \def\internalBitem{\smallbreak \parsearg\itemzzz} \def\internalBitemx{\itemxpar \parsearg\itemzzz} -\def\internalBxitem "#1"{\def\xitemsubtopix{#1} \smallbreak \parsearg\xitemzzz} -\def\internalBxitemx "#1"{\def\xitemsubtopix{#1} \itemxpar \parsearg\xitemzzz} - -\def\internalBkitem{\smallbreak \parsearg\kitemzzz} -\def\internalBkitemx{\itemxpar \parsearg\kitemzzz} - -\def\kitemzzz #1{\dosubind {kw}{\code{#1}}{for {\bf \lastfunction}}% - \itemzzz {#1}} - -\def\xitemzzz #1{\dosubind {kw}{\code{#1}}{for {\bf \xitemsubtopic}}% - \itemzzz {#1}} - \def\itemzzz #1{\begingroup % \advance\hsize by -\rightskip \advance\hsize by -\tableindent - \setbox0=\hbox{\itemfont{#1}}% + \setbox0=\hbox{\itemindicate{#1}}% \itemindex{#1}% \nobreak % This prevents a break before @itemx. % @@ -1749,10 +2265,18 @@ where each line of input produces a line of output.} % \parskip glue -- logically it's part of the @item we just started. \nobreak \vskip-\parskip % - % Stop a page break at the \parskip glue coming up. Unfortunately + % Stop a page break at the \parskip glue coming up. (Unfortunately % we can't prevent a possible page break at the following - % \baselineskip glue. - \nobreak + % \baselineskip glue.) However, if what follows is an environment + % such as @example, there will be no \parskip glue; then + % the negative vskip we just would cause the example and the item to + % crash together. So we use this bizarre value of 10001 as a signal + % to \aboveenvbreak to insert \parskip glue after all. + % (Possibly there are other commands that could be followed by + % @example which need the same treatment, but not section titles; or + % maybe section titles are the only special case and they should be + % penalty 10001...) + \penalty 10001 \endgroup \itemxneedsnegativevskipfalse \else @@ -1771,97 +2295,95 @@ where each line of input produces a line of output.} \fi } -\def\item{\errmessage{@item while not in a table}} -\def\itemx{\errmessage{@itemx while not in a table}} -\def\kitem{\errmessage{@kitem while not in a table}} -\def\kitemx{\errmessage{@kitemx while not in a table}} -\def\xitem{\errmessage{@xitem while not in a table}} -\def\xitemx{\errmessage{@xitemx while not in a table}} - -% Contains a kludge to get @end[description] to work. -\def\description{\tablez{\dontindex}{1}{}{}{}{}} +\def\item{\errmessage{@item while not in a list environment}} +\def\itemx{\errmessage{@itemx while not in a list environment}} % @table, @ftable, @vtable. -\def\table{\begingroup\inENV\obeylines\obeyspaces\tablex} -{\obeylines\obeyspaces% -\gdef\tablex #1^^M{% -\tabley\dontindex#1 \endtabley}} - -\def\ftable{\begingroup\inENV\obeylines\obeyspaces\ftablex} -{\obeylines\obeyspaces% -\gdef\ftablex #1^^M{% -\tabley\fnitemindex#1 \endtabley -\def\Eftable{\endgraf\afterenvbreak\endgroup}% -\let\Etable=\relax}} - -\def\vtable{\begingroup\inENV\obeylines\obeyspaces\vtablex} -{\obeylines\obeyspaces% -\gdef\vtablex #1^^M{% -\tabley\vritemindex#1 \endtabley -\def\Evtable{\endgraf\afterenvbreak\endgroup}% -\let\Etable=\relax}} - -\def\dontindex #1{} -\def\fnitemindex #1{\doind {fn}{\code{#1}}}% -\def\vritemindex #1{\doind {vr}{\code{#1}}}% - -{\obeyspaces % -\gdef\tabley#1#2 #3 #4 #5 #6 #7\endtabley{\endgroup% -\tablez{#1}{#2}{#3}{#4}{#5}{#6}}} - -\def\tablez #1#2#3#4#5#6{% -\aboveenvbreak % -\begingroup % -\def\Edescription{\Etable}% Necessary kludge. -\let\itemindex=#1% -\ifnum 0#3>0 \advance \leftskip by #3\mil \fi % -\ifnum 0#4>0 \tableindent=#4\mil \fi % -\ifnum 0#5>0 \advance \rightskip by #5\mil \fi % -\def\itemfont{#2}% -\itemmax=\tableindent % -\advance \itemmax by -\itemmargin % -\advance \leftskip by \tableindent % -\exdentamount=\tableindent -\parindent = 0pt -\parskip = \smallskipamount -\ifdim \parskip=0pt \parskip=2pt \fi% -\def\Etable{\endgraf\afterenvbreak\endgroup}% -\let\item = \internalBitem % -\let\itemx = \internalBitemx % -\let\kitem = \internalBkitem % -\let\kitemx = \internalBkitemx % -\let\xitem = \internalBxitem % -\let\xitemx = \internalBxitemx % +\envdef\table{% + \let\itemindex\gobble + \tablex } +\envdef\ftable{% + \def\itemindex ##1{\doind {fn}{\code{##1}}}% + \tablex +} +\envdef\vtable{% + \def\itemindex ##1{\doind {vr}{\code{##1}}}% + \tablex +} +\def\tablex#1{% + \def\itemindicate{#1}% + \parsearg\tabley +} +\def\tabley#1{% + {% + \makevalueexpandable + \edef\temp{\noexpand\tablez #1\space\space\space}% + \expandafter + }\temp \endtablez +} +\def\tablez #1 #2 #3 #4\endtablez{% + \aboveenvbreak + \ifnum 0#1>0 \advance \leftskip by #1\mil \fi + \ifnum 0#2>0 \tableindent=#2\mil \fi + \ifnum 0#3>0 \advance \rightskip by #3\mil \fi + \itemmax=\tableindent + \advance \itemmax by -\itemmargin + \advance \leftskip by \tableindent + \exdentamount=\tableindent + \parindent = 0pt + \parskip = \smallskipamount + \ifdim \parskip=0pt \parskip=2pt \fi + \let\item = \internalBitem + \let\itemx = \internalBitemx +} +\def\Etable{\endgraf\afterenvbreak} +\let\Eftable\Etable +\let\Evtable\Etable +\let\Eitemize\Etable +\let\Eenumerate\Etable % This is the counter used by @enumerate, which is really @itemize \newcount \itemno -\def\itemize{\parsearg\itemizezzz} +\envdef\itemize{\parsearg\doitemize} -\def\itemizezzz #1{% - \begingroup % ended by the @end itemize - \itemizey {#1}{\Eitemize} +\def\doitemize#1{% + \aboveenvbreak + \itemmax=\itemindent + \advance\itemmax by -\itemmargin + \advance\leftskip by \itemindent + \exdentamount=\itemindent + \parindent=0pt + \parskip=\smallskipamount + \ifdim\parskip=0pt \parskip=2pt \fi + \def\itemcontents{#1}% + % @itemize with no arg is equivalent to @itemize @bullet. + \ifx\itemcontents\empty\def\itemcontents{\bullet}\fi + \let\item=\itemizeitem } -\def\itemizey #1#2{% -\aboveenvbreak % -\itemmax=\itemindent % -\advance \itemmax by -\itemmargin % -\advance \leftskip by \itemindent % -\exdentamount=\itemindent -\parindent = 0pt % -\parskip = \smallskipamount % -\ifdim \parskip=0pt \parskip=2pt \fi% -\def#2{\endgraf\afterenvbreak\endgroup}% -\def\itemcontents{#1}% -\let\item=\itemizeitem} - -% Set sfcode to normal for the chars that usually have another value. -% These are `.?!:;,' -\def\frenchspacing{\sfcode46=1000 \sfcode63=1000 \sfcode33=1000 - \sfcode58=1000 \sfcode59=1000 \sfcode44=1000 } +% Definition of @item while inside @itemize and @enumerate. +% +\def\itemizeitem{% + \advance\itemno by 1 % for enumerations + {\let\par=\endgraf \smallbreak}% reasonable place to break + {% + % If the document has an @itemize directly after a section title, a + % \nobreak will be last on the list, and \sectionheading will have + % done a \vskip-\parskip. In that case, we don't want to zero + % parskip, or the item text will crash with the heading. On the + % other hand, when there is normal text preceding the item (as there + % usually is), we do want to zero parskip, or there would be too much + % space. In that case, we won't have a \nobreak before. At least + % that's the theory. + \ifnum\lastpenalty<10000 \parskip=0in \fi + \noindent + \hbox to 0pt{\hss \itemcontents \kern\itemmargin}% + \vadjust{\penalty 1200}}% not good to break after first line of item. + \flushcr +} % \splitoff TOKENS\endmark defines \first to be the first token in % TOKENS, and \rest to be the remainder. @@ -1872,11 +2394,8 @@ where each line of input produces a line of output.} % or number, to specify the first label in the enumerated list. No % argument is the same as `1'. % -\def\enumerate{\parsearg\enumeratezzz} -\def\enumeratezzz #1{\enumeratey #1 \endenumeratey} +\envparseargdef\enumerate{\enumeratey #1 \endenumeratey} \def\enumeratey #1 #2\endenumeratey{% - \begingroup % ended by the @end enumerate - % % If we were given no argument, pretend we were given `1'. \def\thearg{#1}% \ifx\thearg\empty \def\thearg{1}\fi @@ -1947,13 +2466,13 @@ where each line of input produces a line of output.} }% } -% Call itemizey, adding a period to the first argument and supplying the +% Call \doitemize, adding a period to the first argument and supplying the % common last two arguments. Also subtract one from the initial value in % \itemno, since @item increments \itemno. % \def\startenumeration#1{% \advance\itemno by -1 - \itemizey{#1.}\Eenumerate\flushcr + \doitemize{#1.}\flushcr } % @alphaenumerate and @capsenumerate are abbreviations for giving an arg @@ -1964,16 +2483,6 @@ where each line of input produces a line of output.} \def\Ealphaenumerate{\Eenumerate} \def\Ecapsenumerate{\Eenumerate} -% Definition of @item while inside @itemize. - -\def\itemizeitem{% -\advance\itemno by 1 -{\let\par=\endgraf \smallbreak}% -\ifhmode \errmessage{In hmode at itemizeitem}\fi -{\parskip=0in \hskip 0pt -\hbox to 0pt{\hss \itemcontents\hskip \itemmargin}% -\vadjust{\penalty 1200}}% -\flushcr} % @multitable macros % Amy Hendrickson, 8/18/94, 3/6/96 @@ -2000,24 +2509,14 @@ where each line of input produces a line of output.} % @multitable {Column 1 template} {Column 2 template} {Column 3 template} % @item ... % using the widest term desired in each column. -% -% For those who want to use more than one line's worth of words in -% the preamble, break the line within one argument and it -% will parse correctly, i.e., -% -% @multitable {Column 1 template} {Column 2 template} {Column 3 -% template} -% Not: -% @multitable {Column 1 template} {Column 2 template} -% {Column 3 template} % Each new table line starts with @item, each subsequent new column % starts with @tab. Empty columns may be produced by supplying @tab's % with nothing between them for as many times as empty columns are needed, % ie, @tab@tab@tab will produce two empty columns. -% @item, @tab, @multitable or @end multitable do not need to be on their -% own lines, but it will not hurt if they are. +% @item, @tab do not need to be on their own lines, but it will not hurt +% if they are. % Sample multitable: @@ -2061,13 +2560,12 @@ where each line of input produces a line of output.} \def\xcolumnfractions{\columnfractions} \newif\ifsetpercent -% #1 is the part of the @columnfraction before the decimal point, which -% is presumably either 0 or the empty string (but we don't check, we -% just throw it away). #2 is the decimal part, which we use as the -% percent of \hsize for this column. -\def\pickupwholefraction#1.#2 {% +% #1 is the @columnfraction, usually a decimal number like .5, but might +% be just 1. We just use it, whatever it is. +% +\def\pickupwholefraction#1 {% \global\advance\colcount by 1 - \expandafter\xdef\csname col\the\colcount\endcsname{.#2\hsize}% + \expandafter\xdef\csname col\the\colcount\endcsname{#1\hsize}% \setuptable } @@ -2084,8 +2582,8 @@ where each line of input produces a line of output.} \let\go\pickupwholefraction \else \global\advance\colcount by 1 - \setbox0=\hbox{#1\unskip }% Add a normal word space as a separator; - % typically that is always in the input, anyway. + \setbox0=\hbox{#1\unskip\space}% Add a normal word space as a + % separator; typically that is always in the input, anyway. \expandafter\xdef\csname col\the\colcount\endcsname{\the\wd0}% \fi \fi @@ -2100,18 +2598,30 @@ where each line of input produces a line of output.} \go } -% This used to have \hskip1sp. But then the space in a template line is -% not enough. That is bad. So let's go back to just & until we -% encounter the problem it was intended to solve again. -% --karl, nathan@acm.org, 20apr99. -\def\tab{&} +% multitable-only commands. +% +% @headitem starts a heading row, which we typeset in bold. +% Assignments have to be global since we are inside the implicit group +% of an alignment entry. Note that \everycr resets \everytab. +\def\headitem{\checkenv\multitable \crcr \global\everytab={\bf}\the\everytab}% +% +% A \tab used to include \hskip1sp. But then the space in a template +% line is not enough. That is bad. So let's go back to just `&' until +% we encounter the problem it was intended to solve again. +% --karl, nathan@acm.org, 20apr99. +\def\tab{\checkenv\multitable &\the\everytab}% % @multitable ... @end multitable definitions: % -\def\multitable{\parsearg\dotable} -\def\dotable#1{\bgroup +\newtoks\everytab % insert after every tab. +% +\envdef\multitable{% \vskip\parskip + \startsavinginserts + % + % @item within a multitable starts a normal row. \let\item\crcr + % \tolerance=9500 \hbadness=9500 \setmultitablespacing @@ -2119,81 +2629,98 @@ where each line of input produces a line of output.} \parindent=\multitableparindent \overfullrule=0pt \global\colcount=0 - \def\Emultitable{\global\setpercentfalse\cr\egroup\egroup}% % + \everycr = {% + \noalign{% + \global\everytab={}% + \global\colcount=0 % Reset the column counter. + % Check for saved footnotes, etc. + \checkinserts + % Keeps underfull box messages off when table breaks over pages. + %\filbreak + % Maybe so, but it also creates really weird page breaks when the + % table breaks over pages. Wouldn't \vfil be better? Wait until the + % problem manifests itself, so it can be fixed for real --karl. + }% + }% + % + \parsearg\domultitable +} +\def\domultitable#1{% % To parse everything between @multitable and @item: \setuptable#1 \endsetuptable % - % \everycr will reset column counter, \colcount, at the end of - % each line. Every column entry will cause \colcount to advance by one. - % The table preamble - % looks at the current \colcount to find the correct column width. - \everycr{\noalign{% - % - % \filbreak%% keeps underfull box messages off when table breaks over pages. - % Maybe so, but it also creates really weird page breaks when the table - % breaks over pages. Wouldn't \vfil be better? Wait until the problem - % manifests itself, so it can be fixed for real --karl. - \global\colcount=0\relax}}% - % % This preamble sets up a generic column definition, which will % be used as many times as user calls for columns. % \vtop will set a single line and will also let text wrap and % continue for many paragraphs if desired. - \halign\bgroup&\global\advance\colcount by 1\relax - \multistrut\vtop{\hsize=\expandafter\csname col\the\colcount\endcsname - % - % In order to keep entries from bumping into each other - % we will add a \leftskip of \multitablecolspace to all columns after - % the first one. - % - % If a template has been used, we will add \multitablecolspace - % to the width of each template entry. - % - % If the user has set preamble in terms of percent of \hsize we will - % use that dimension as the width of the column, and the \leftskip - % will keep entries from bumping into each other. Table will start at - % left margin and final column will justify at right margin. - % - % Make sure we don't inherit \rightskip from the outer environment. - \rightskip=0pt - \ifnum\colcount=1 - % The first column will be indented with the surrounding text. - \advance\hsize by\leftskip - \else - \ifsetpercent \else - % If user has not set preamble in terms of percent of \hsize - % we will advance \hsize by \multitablecolspace. - \advance\hsize by \multitablecolspace - \fi - % In either case we will make \leftskip=\multitablecolspace: - \leftskip=\multitablecolspace - \fi - % Ignoring space at the beginning and end avoids an occasional spurious - % blank line, when TeX decides to break the line at the space before the - % box from the multistrut, so the strut ends up on a line by itself. - % For example: - % @multitable @columnfractions .11 .89 - % @item @code{#} - % @tab Legal holiday which is valid in major parts of the whole country. - % Is automatically provided with highlighting sequences respectively marking - % characters. - \noindent\ignorespaces##\unskip\multistrut}\cr + \halign\bgroup &% + \global\advance\colcount by 1 + \multistrut + \vtop{% + % Use the current \colcount to find the correct column width: + \hsize=\expandafter\csname col\the\colcount\endcsname + % + % In order to keep entries from bumping into each other + % we will add a \leftskip of \multitablecolspace to all columns after + % the first one. + % + % If a template has been used, we will add \multitablecolspace + % to the width of each template entry. + % + % If the user has set preamble in terms of percent of \hsize we will + % use that dimension as the width of the column, and the \leftskip + % will keep entries from bumping into each other. Table will start at + % left margin and final column will justify at right margin. + % + % Make sure we don't inherit \rightskip from the outer environment. + \rightskip=0pt + \ifnum\colcount=1 + % The first column will be indented with the surrounding text. + \advance\hsize by\leftskip + \else + \ifsetpercent \else + % If user has not set preamble in terms of percent of \hsize + % we will advance \hsize by \multitablecolspace. + \advance\hsize by \multitablecolspace + \fi + % In either case we will make \leftskip=\multitablecolspace: + \leftskip=\multitablecolspace + \fi + % Ignoring space at the beginning and end avoids an occasional spurious + % blank line, when TeX decides to break the line at the space before the + % box from the multistrut, so the strut ends up on a line by itself. + % For example: + % @multitable @columnfractions .11 .89 + % @item @code{#} + % @tab Legal holiday which is valid in major parts of the whole country. + % Is automatically provided with highlighting sequences respectively + % marking characters. + \noindent\ignorespaces##\unskip\multistrut + }\cr +} +\def\Emultitable{% + \crcr + \egroup % end the \halign + \global\setpercentfalse } \def\setmultitablespacing{% test to see if user has set \multitablelinespace. % If so, do nothing. If not, give it an appropriate dimension based on % current baselineskip. \ifdim\multitablelinespace=0pt +\setbox0=\vbox{X}\global\multitablelinespace=\the\baselineskip +\global\advance\multitablelinespace by-\ht0 %% strut to put in table in case some entry doesn't have descenders, %% to keep lines equally spaced \let\multistrut = \strut +\else +%% FIXME: what is \box0 supposed to be? +\gdef\multistrut{\vrule height\multitablelinespace depth\dp0 +width0pt\relax} \fi %% Test to see if parskip is larger than space between lines of %% table. If not, do nothing. %% If so, set to same dimension as multitablelinespace. -\else -\gdef\multistrut{\vrule height\multitablelinespace depth\dp0 -width0pt\relax} \fi \ifdim\multitableparskip>\multitablelinespace \global\multitableparskip=\multitablelinespace \global\advance\multitableparskip-7pt %% to keep parskip somewhat smaller @@ -2207,226 +2734,108 @@ width0pt\relax} \fi \message{conditionals,} -% Prevent errors for section commands. -% Used in @ignore and in failing conditionals. -\def\ignoresections{% - \let\chapter=\relax - \let\unnumbered=\relax - \let\top=\relax - \let\unnumberedsec=\relax - \let\unnumberedsection=\relax - \let\unnumberedsubsec=\relax - \let\unnumberedsubsection=\relax - \let\unnumberedsubsubsec=\relax - \let\unnumberedsubsubsection=\relax - \let\section=\relax - \let\subsec=\relax - \let\subsubsec=\relax - \let\subsection=\relax - \let\subsubsection=\relax - \let\appendix=\relax - \let\appendixsec=\relax - \let\appendixsection=\relax - \let\appendixsubsec=\relax - \let\appendixsubsection=\relax - \let\appendixsubsubsec=\relax - \let\appendixsubsubsection=\relax - \let\contents=\relax - \let\smallbook=\relax - \let\titlepage=\relax + +% @iftex, @ifnotdocbook, @ifnothtml, @ifnotinfo, @ifnotplaintext, +% @ifnotxml always succeed. They currently do nothing; we don't +% attempt to check whether the conditionals are properly nested. But we +% have to remember that they are conditionals, so that @end doesn't +% attempt to close an environment group. +% +\def\makecond#1{% + \expandafter\let\csname #1\endcsname = \relax + \expandafter\let\csname iscond.#1\endcsname = 1 } +\makecond{iftex} +\makecond{ifnotdocbook} +\makecond{ifnothtml} +\makecond{ifnotinfo} +\makecond{ifnotplaintext} +\makecond{ifnotxml} -% Used in nested conditionals, where we have to parse the Texinfo source -% and so want to turn off most commands, in case they are used -% incorrectly. +% Ignore @ignore, @ifhtml, @ifinfo, and the like. % -\def\ignoremorecommands{% - \let\defcodeindex = \relax - \let\defcv = \relax - \let\deffn = \relax - \let\deffnx = \relax - \let\defindex = \relax - \let\defivar = \relax - \let\defmac = \relax - \let\defmethod = \relax - \let\defop = \relax - \let\defopt = \relax - \let\defspec = \relax - \let\deftp = \relax - \let\deftypefn = \relax - \let\deftypefun = \relax - \let\deftypeivar = \relax - \let\deftypeop = \relax - \let\deftypevar = \relax - \let\deftypevr = \relax - \let\defun = \relax - \let\defvar = \relax - \let\defvr = \relax - \let\ref = \relax - \let\xref = \relax - \let\printindex = \relax - \let\pxref = \relax - \let\settitle = \relax - \let\setchapternewpage = \relax - \let\setchapterstyle = \relax - \let\everyheading = \relax - \let\evenheading = \relax - \let\oddheading = \relax - \let\everyfooting = \relax - \let\evenfooting = \relax - \let\oddfooting = \relax - \let\headings = \relax - \let\include = \relax - \let\lowersections = \relax - \let\down = \relax - \let\raisesections = \relax - \let\up = \relax - \let\set = \relax - \let\clear = \relax - \let\item = \relax -} - -% Ignore @ignore ... @end ignore. -% -\def\ignore{\doignore{ignore}} - -% Ignore @ifinfo, @ifhtml, @ifnottex, @html, @menu, and @direntry text. -% -\def\ifinfo{\doignore{ifinfo}} -\def\ifhtml{\doignore{ifhtml}} -\def\ifnottex{\doignore{ifnottex}} -\def\html{\doignore{html}} -\def\menu{\doignore{menu}} \def\direntry{\doignore{direntry}} +\def\documentdescription{\doignore{documentdescription}} +\def\docbook{\doignore{docbook}} +\def\html{\doignore{html}} +\def\ifdocbook{\doignore{ifdocbook}} +\def\ifhtml{\doignore{ifhtml}} +\def\ifinfo{\doignore{ifinfo}} +\def\ifnottex{\doignore{ifnottex}} +\def\ifplaintext{\doignore{ifplaintext}} +\def\ifxml{\doignore{ifxml}} +\def\ignore{\doignore{ignore}} +\def\menu{\doignore{menu}} +\def\xml{\doignore{xml}} -% @dircategory CATEGORY -- specify a category of the dir file -% which this file should belong to. Ignore this in TeX. -\let\dircategory = \comment - -% Ignore text until a line `@end #1'. +% Ignore text until a line `@end #1', keeping track of nested conditionals. % +% A count to remember the depth of nesting. +\newcount\doignorecount + \def\doignore#1{\begingroup - % Don't complain about control sequences we have declared \outer. - \ignoresections - % - % Define a command to swallow text until we reach `@end #1'. - % This @ is a catcode 12 token (that is the normal catcode of @ in - % this texinfo.tex file). We change the catcode of @ below to match. - \long\def\doignoretext##1@end #1{\enddoignore}% + % Scan in ``verbatim'' mode: + \catcode`\@ = \other + \catcode`\{ = \other + \catcode`\} = \other % % Make sure that spaces turn into tokens that match what \doignoretext wants. - \catcode32 = 10 + \spaceisspace % - % Ignore braces, too, so mismatched braces don't cause trouble. - \catcode`\{ = 9 - \catcode`\} = 9 + % Count number of #1's that we've seen. + \doignorecount = 0 % - % We must not have @c interpreted as a control sequence. - \catcode`\@ = 12 - % - % Make the letter c a comment character so that the rest of the line - % will be ignored. This way, the document can have (for example) - % @c @end ifinfo - % and the @end ifinfo will be properly ignored. - % (We've just changed @ to catcode 12.) - \catcode`\c = 14 - % - % And now expand that command. - \doignoretext + % Swallow text until we reach the matching `@end #1'. + \dodoignore {#1}% } -% What we do to finish off ignored text. +{ \catcode`_=11 % We want to use \_STOP_ which cannot appear in texinfo source. + \obeylines % + % + \gdef\dodoignore#1{% + % #1 contains the string `ifinfo'. + % + % Define a command to find the next `@end #1', which must be on a line + % by itself. + \long\def\doignoretext##1^^M@end #1{\doignoretextyyy##1^^M@#1\_STOP_}% + % And this command to find another #1 command, at the beginning of a + % line. (Otherwise, we would consider a line `@c @ifset', for + % example, to count as an @ifset for nesting.) + \long\def\doignoretextyyy##1^^M@#1##2\_STOP_{\doignoreyyy{##2}\_STOP_}% + % + % And now expand that command. + \obeylines % + \doignoretext ^^M% + }% +} + +\def\doignoreyyy#1{% + \def\temp{#1}% + \ifx\temp\empty % Nothing found. + \let\next\doignoretextzzz + \else % Found a nested condition, ... + \advance\doignorecount by 1 + \let\next\doignoretextyyy % ..., look for another. + % If we're here, #1 ends with ^^M\ifinfo (for example). + \fi + \next #1% the token \_STOP_ is present just after this macro. +} + +% We have to swallow the remaining "\_STOP_". % -\def\enddoignore{\endgroup\ignorespaces}% - -\newif\ifwarnedobs\warnedobsfalse -\def\obstexwarn{% - \ifwarnedobs\relax\else - % We need to warn folks that they may have trouble with TeX 3.0. - % This uses \immediate\write16 rather than \message to get newlines. - \immediate\write16{} - \immediate\write16{WARNING: for users of Unix TeX 3.0!} - \immediate\write16{This manual trips a bug in TeX version 3.0 (tex hangs).} - \immediate\write16{If you are running another version of TeX, relax.} - \immediate\write16{If you are running Unix TeX 3.0, kill this TeX process.} - \immediate\write16{ Then upgrade your TeX installation if you can.} - \immediate\write16{ (See ftp://ftp.gnu.org/pub/gnu/TeX.README.)} - \immediate\write16{If you are stuck with version 3.0, run the} - \immediate\write16{ script ``tex3patch'' from the Texinfo distribution} - \immediate\write16{ to use a workaround.} - \immediate\write16{} - \global\warnedobstrue - \fi +\def\doignoretextzzz#1{% + \ifnum\doignorecount = 0 % We have just found the outermost @end. + \let\next\enddoignore + \else % Still inside a nested condition. + \advance\doignorecount by -1 + \let\next\doignoretext % Look for the next @end. + \fi + \next } -% **In TeX 3.0, setting text in \nullfont hangs tex. For a -% workaround (which requires the file ``dummy.tfm'' to be installed), -% uncomment the following line: -%%%%%\font\nullfont=dummy\let\obstexwarn=\relax +% Finish off ignored text. +\def\enddoignore{\endgroup\ignorespaces} -% Ignore text, except that we keep track of conditional commands for -% purposes of nesting, up to an `@end #1' command. -% -\def\nestedignore#1{% - \obstexwarn - % We must actually expand the ignored text to look for the @end - % command, so that nested ignore constructs work. Thus, we put the - % text into a \vbox and then do nothing with the result. To minimize - % the change of memory overflow, we follow the approach outlined on - % page 401 of the TeXbook: make the current font be a dummy font. - % - \setbox0 = \vbox\bgroup - % Don't complain about control sequences we have declared \outer. - \ignoresections - % - % Define `@end #1' to end the box, which will in turn undefine the - % @end command again. - \expandafter\def\csname E#1\endcsname{\egroup\ignorespaces}% - % - % We are going to be parsing Texinfo commands. Most cause no - % trouble when they are used incorrectly, but some commands do - % complicated argument parsing or otherwise get confused, so we - % undefine them. - % - % We can't do anything about stray @-signs, unfortunately; - % they'll produce `undefined control sequence' errors. - \ignoremorecommands - % - % Set the current font to be \nullfont, a TeX primitive, and define - % all the font commands to also use \nullfont. We don't use - % dummy.tfm, as suggested in the TeXbook, because not all sites - % might have that installed. Therefore, math mode will still - % produce output, but that should be an extremely small amount of - % stuff compared to the main input. - % - \nullfont - \let\tenrm = \nullfont \let\tenit = \nullfont \let\tensl = \nullfont - \let\tenbf = \nullfont \let\tentt = \nullfont \let\smallcaps = \nullfont - \let\tensf = \nullfont - % Similarly for index fonts (mostly for their use in - % smallexample) - \let\indrm = \nullfont \let\indit = \nullfont \let\indsl = \nullfont - \let\indbf = \nullfont \let\indtt = \nullfont \let\indsc = \nullfont - \let\indsf = \nullfont - % - % Don't complain when characters are missing from the fonts. - \tracinglostchars = 0 - % - % Don't bother to do space factor calculations. - \frenchspacing - % - % Don't report underfull hboxes. - \hbadness = 10000 - % - % Do minimal line-breaking. - \pretolerance = 10000 - % - % Do not execute instructions in @tex - \def\tex{\doignore{tex}}% - % Do not execute macro definitions. - % `c' is a comment character, so the word `macro' will get cut off. - \def\macro{\doignore{ma}}% -} % @set VAR sets the variable VAR to an empty value. % @set VAR REST-OF-LINE sets VAR to the value REST-OF-LINE. @@ -2434,56 +2843,63 @@ width0pt\relax} \fi % Since we want to separate VAR from REST-OF-LINE (which might be % empty), we can't just use \parsearg; we have to insert a space of our % own to delimit the rest of the line, and then take it out again if we -% didn't need it. Make sure the catcode of space is correct to avoid -% losing inside @example, for instance. +% didn't need it. +% We rely on the fact that \parsearg sets \catcode`\ =10. % -\def\set{\begingroup\catcode` =10 - \catcode`\-=12 \catcode`\_=12 % Allow - and _ in VAR. - \parsearg\setxxx} -\def\setxxx#1{\setyyy#1 \endsetyyy} +\parseargdef\set{\setyyy#1 \endsetyyy} \def\setyyy#1 #2\endsetyyy{% - \def\temp{#2}% - \ifx\temp\empty \global\expandafter\let\csname SET#1\endcsname = \empty - \else \setzzz{#1}#2\endsetzzz % Remove the trailing space \setxxx inserted. - \fi - \endgroup + {% + \makevalueexpandable + \def\temp{#2}% + \edef\next{\gdef\makecsname{SET#1}}% + \ifx\temp\empty + \next{}% + \else + \setzzz#2\endsetzzz + \fi + }% } -% Can't use \xdef to pre-expand #2 and save some time, since \temp or -% \next or other control sequences that we've defined might get us into -% an infinite loop. Consider `@set foo @cite{bar}'. -\def\setzzz#1#2 \endsetzzz{\expandafter\gdef\csname SET#1\endcsname{#2}} +% Remove the trailing space \setxxx inserted. +\def\setzzz#1 \endsetzzz{\next{#1}} % @clear VAR clears (i.e., unsets) the variable VAR. % -\def\clear{\parsearg\clearxxx} -\def\clearxxx#1{\global\expandafter\let\csname SET#1\endcsname=\relax} +\parseargdef\clear{% + {% + \makevalueexpandable + \global\expandafter\let\csname SET#1\endcsname=\relax + }% +} % @value{foo} gets the text saved in variable foo. -{ - \catcode`\_ = \active - % - % We might end up with active _ or - characters in the argument if - % we're called from @code, as @code{@value{foo-bar_}}. So \let any - % such active characters to their normal equivalents. - \gdef\value{\begingroup - \catcode`\-=12 \catcode`\_=12 - \indexbreaks \let_\normalunderscore - \valuexxx} -} +\def\value{\begingroup\makevalueexpandable\valuexxx} \def\valuexxx#1{\expandablevalue{#1}\endgroup} +{ + \catcode`\- = \active \catcode`\_ = \active + % + \gdef\makevalueexpandable{% + \let\value = \expandablevalue + % We don't want these characters active, ... + \catcode`\-=\other \catcode`\_=\other + % ..., but we might end up with active ones in the argument if + % we're called from @code, as @code{@value{foo-bar_}}, though. + % So \let them to their normal equivalents. + \let-\realdash \let_\normalunderscore + } +} % We have this subroutine so that we can handle at least some @value's -% properly in indexes (we \let\value to this in \indexdummies). Ones -% whose names contain - or _ still won't work, but we can't do anything -% about that. The command has to be fully expandable, since the result -% winds up in the index file. This means that if the variable's value -% contains other Texinfo commands, it's almost certain it will fail -% (although perhaps we could fix that with sufficient work to do a -% one-level expansion on the result, instead of complete). +% properly in indexes (we call \makevalueexpandable in \indexdummies). +% The command has to be fully expandable (if the variable is set), since +% the result winds up in the index file. This means that if the +% variable's value contains other Texinfo commands, it's almost certain +% it will fail (although perhaps we could fix that with sufficient work +% to do a one-level expansion on the result, instead of complete). % \def\expandablevalue#1{% \expandafter\ifx\csname SET#1\endcsname\relax {[No value for ``#1'']}% + \message{Variable `#1', used in @value, is not set.}% \else \csname SET#1\endcsname \fi @@ -2492,66 +2908,36 @@ width0pt\relax} \fi % @ifset VAR ... @end ifset reads the `...' iff VAR has been defined % with @set. % -\def\ifset{\parsearg\ifsetxxx} -\def\ifsetxxx #1{% - \expandafter\ifx\csname SET#1\endcsname\relax - \expandafter\ifsetfail - \else - \expandafter\ifsetsucceed - \fi +% To get special treatment of `@end ifset,' call \makeond and the redefine. +% +\makecond{ifset} +\def\ifset{\parsearg{\doifset{\let\next=\ifsetfail}}} +\def\doifset#1#2{% + {% + \makevalueexpandable + \let\next=\empty + \expandafter\ifx\csname SET#2\endcsname\relax + #1% If not set, redefine \next. + \fi + \expandafter + }\next } -\def\ifsetsucceed{\conditionalsucceed{ifset}} -\def\ifsetfail{\nestedignore{ifset}} -\defineunmatchedend{ifset} +\def\ifsetfail{\doignore{ifset}} % @ifclear VAR ... @end ifclear reads the `...' iff VAR has never been % defined with @set, or has been undefined with @clear. % -\def\ifclear{\parsearg\ifclearxxx} -\def\ifclearxxx #1{% - \expandafter\ifx\csname SET#1\endcsname\relax - \expandafter\ifclearsucceed - \else - \expandafter\ifclearfail - \fi -} -\def\ifclearsucceed{\conditionalsucceed{ifclear}} -\def\ifclearfail{\nestedignore{ifclear}} -\defineunmatchedend{ifclear} - -% @iftex, @ifnothtml, @ifnotinfo always succeed; we read the text -% following, through the first @end iftex (etc.). Make `@end iftex' -% (etc.) valid only after an @iftex. +% The `\else' inside the `\doifset' parameter is a trick to reuse the +% above code: if the variable is not set, do nothing, if it is set, +% then redefine \next to \ifclearfail. % -\def\iftex{\conditionalsucceed{iftex}} -\def\ifnothtml{\conditionalsucceed{ifnothtml}} -\def\ifnotinfo{\conditionalsucceed{ifnotinfo}} -\defineunmatchedend{iftex} -\defineunmatchedend{ifnothtml} -\defineunmatchedend{ifnotinfo} +\makecond{ifclear} +\def\ifclear{\parsearg{\doifset{\else \let\next=\ifclearfail}}} +\def\ifclearfail{\doignore{ifclear}} -% We can't just want to start a group at @iftex (for example) and end it -% at @end iftex, since then @set commands inside the conditional have no -% effect (they'd get reverted at the end of the group). So we must -% define \Eiftex to redefine itself to be its previous value. (We can't -% just define it to fail again with an ``unmatched end'' error, since -% the @ifset might be nested.) -% -\def\conditionalsucceed#1{% - \edef\temp{% - % Remember the current value of \E#1. - \let\nece{prevE#1} = \nece{E#1}% - % - % At the `@end #1', redefine \E#1 to be its previous value. - \def\nece{E#1}{\let\nece{E#1} = \nece{prevE#1}}% - }% - \temp -} - -% We need to expand lots of \csname's, but we don't want to expand the -% control sequences after we've constructed them. -% -\def\nece#1{\expandafter\noexpand\csname#1\endcsname} +% @dircategory CATEGORY -- specify a category of the dir file +% which this file should belong to. Ignore this in TeX. +\let\dircategory=\comment % @defininfoenclose. \let\definfoenclose=\comment @@ -2583,42 +2969,48 @@ width0pt\relax} \fi } % @defindex foo == \newindex{foo} - +% \def\defindex{\parsearg\newindex} % Define @defcodeindex, like @defindex except put all entries in @code. - +% +\def\defcodeindex{\parsearg\newcodeindex} +% \def\newcodeindex#1{% \iflinks \expandafter\newwrite \csname#1indfile\endcsname \openout \csname#1indfile\endcsname \jobname.#1 \fi \expandafter\xdef\csname#1index\endcsname{% - \noexpand\docodeindex{#1}} + \noexpand\docodeindex{#1}}% } -\def\defcodeindex{\parsearg\newcodeindex} % @synindex foo bar makes index foo feed into index bar. % Do this instead of @defindex foo if you don't want it as a separate index. -% The \closeout helps reduce unnecessary open files; the limit on the -% Acorn RISC OS is a mere 16 files. -\def\synindex#1 #2 {% - \expandafter\let\expandafter\synindexfoo\expandafter=\csname#2indfile\endcsname - \expandafter\closeout\csname#1indfile\endcsname - \expandafter\let\csname#1indfile\endcsname=\synindexfoo - \expandafter\xdef\csname#1index\endcsname{% define \xxxindex - \noexpand\doindex{#2}}% -} - +% % @syncodeindex foo bar similar, but put all entries made for index foo % inside @code. -\def\syncodeindex#1 #2 {% - \expandafter\let\expandafter\synindexfoo\expandafter=\csname#2indfile\endcsname - \expandafter\closeout\csname#1indfile\endcsname - \expandafter\let\csname#1indfile\endcsname=\synindexfoo - \expandafter\xdef\csname#1index\endcsname{% define \xxxindex - \noexpand\docodeindex{#2}}% +% +\def\synindex#1 #2 {\dosynindex\doindex{#1}{#2}} +\def\syncodeindex#1 #2 {\dosynindex\docodeindex{#1}{#2}} + +% #1 is \doindex or \docodeindex, #2 the index getting redefined (foo), +% #3 the target index (bar). +\def\dosynindex#1#2#3{% + % Only do \closeout if we haven't already done it, else we'll end up + % closing the target index. + \expandafter \ifx\csname donesynindex#2\endcsname \undefined + % The \closeout helps reduce unnecessary open files; the limit on the + % Acorn RISC OS is a mere 16 files. + \expandafter\closeout\csname#2indfile\endcsname + \expandafter\let\csname\donesynindex#2\endcsname = 1 + \fi + % redefine \fooindfile: + \expandafter\let\expandafter\temp\expandafter=\csname#3indfile\endcsname + \expandafter\let\csname#2indfile\endcsname=\temp + % redefine \fooindex: + \expandafter\xdef\csname#2index\endcsname{\noexpand#1{#3}}% } % Define \doindex, the driver for all \fooindex macros. @@ -2638,264 +3030,399 @@ width0pt\relax} \fi \def\docodeindex#1{\edef\indexname{#1}\parsearg\singlecodeindexer} \def\singlecodeindexer #1{\doind{\indexname}{\code{#1}}} +% Take care of Texinfo commands that can appear in an index entry. +% Since there are some commands we want to expand, and others we don't, +% we have to laboriously prevent expansion for those that we don't. +% \def\indexdummies{% -\def\ { }% -% Take care of the plain tex accent commands. -\def\"{\realbackslash "}% -\def\`{\realbackslash `}% -\def\'{\realbackslash '}% -\def\^{\realbackslash ^}% -\def\~{\realbackslash ~}% -\def\={\realbackslash =}% -\def\b{\realbackslash b}% -\def\c{\realbackslash c}% -\def\d{\realbackslash d}% -\def\u{\realbackslash u}% -\def\v{\realbackslash v}% -\def\H{\realbackslash H}% -% Take care of the plain tex special European modified letters. -\def\oe{\realbackslash oe}% -\def\ae{\realbackslash ae}% -\def\aa{\realbackslash aa}% -\def\OE{\realbackslash OE}% -\def\AE{\realbackslash AE}% -\def\AA{\realbackslash AA}% -\def\o{\realbackslash o}% -\def\O{\realbackslash O}% -\def\l{\realbackslash l}% -\def\L{\realbackslash L}% -\def\ss{\realbackslash ss}% -% Take care of texinfo commands likely to appear in an index entry. -% (Must be a way to avoid doing expansion at all, and thus not have to -% laboriously list every single command here.) -\def\@{@}% will be @@ when we switch to @ as escape char. -% Need these in case \tex is in effect and \{ is a \delimiter again. -% But can't use \lbracecmd and \rbracecmd because texindex assumes -% braces and backslashes are used only as delimiters. -\let\{ = \mylbrace -\let\} = \myrbrace -\def\_{{\realbackslash _}}% -\def\w{\realbackslash w }% -\def\bf{\realbackslash bf }% -%\def\rm{\realbackslash rm }% -\def\sl{\realbackslash sl }% -\def\sf{\realbackslash sf}% -\def\tt{\realbackslash tt}% -\def\gtr{\realbackslash gtr}% -\def\less{\realbackslash less}% -\def\hat{\realbackslash hat}% -\def\TeX{\realbackslash TeX}% -\def\dots{\realbackslash dots }% -\def\result{\realbackslash result}% -\def\equiv{\realbackslash equiv}% -\def\expansion{\realbackslash expansion}% -\def\print{\realbackslash print}% -\def\error{\realbackslash error}% -\def\point{\realbackslash point}% -\def\copyright{\realbackslash copyright}% -\def\tclose##1{\realbackslash tclose {##1}}% -\def\code##1{\realbackslash code {##1}}% -\def\uref##1{\realbackslash uref {##1}}% -\def\url##1{\realbackslash url {##1}}% -\def\env##1{\realbackslash env {##1}}% -\def\command##1{\realbackslash command {##1}}% -\def\option##1{\realbackslash option {##1}}% -\def\dotless##1{\realbackslash dotless {##1}}% -\def\samp##1{\realbackslash samp {##1}}% -\def\,##1{\realbackslash ,{##1}}% -\def\t##1{\realbackslash t {##1}}% -\def\r##1{\realbackslash r {##1}}% -\def\i##1{\realbackslash i {##1}}% -\def\b##1{\realbackslash b {##1}}% -\def\sc##1{\realbackslash sc {##1}}% -\def\cite##1{\realbackslash cite {##1}}% -\def\key##1{\realbackslash key {##1}}% -\def\file##1{\realbackslash file {##1}}% -\def\var##1{\realbackslash var {##1}}% -\def\kbd##1{\realbackslash kbd {##1}}% -\def\dfn##1{\realbackslash dfn {##1}}% -\def\emph##1{\realbackslash emph {##1}}% -\def\acronym##1{\realbackslash acronym {##1}}% -% -% Handle some cases of @value -- where the variable name does not -% contain - or _, and the value does not contain any -% (non-fully-expandable) commands. -\let\value = \expandablevalue -% -\unsepspaces -% Turn off macro expansion -\turnoffmacros + \def\@{@}% change to @@ when we switch to @ as escape char in index files. + \def\ {\realbackslash\space }% + % Need these in case \tex is in effect and \{ is a \delimiter again. + % But can't use \lbracecmd and \rbracecmd because texindex assumes + % braces and backslashes are used only as delimiters. + \let\{ = \mylbrace + \let\} = \myrbrace + % + % \definedummyword defines \#1 as \realbackslash #1\space, thus + % effectively preventing its expansion. This is used only for control + % words, not control letters, because the \space would be incorrect + % for control characters, but is needed to separate the control word + % from whatever follows. + % + % For control letters, we have \definedummyletter, which omits the + % space. + % + % These can be used both for control words that take an argument and + % those that do not. If it is followed by {arg} in the input, then + % that will dutifully get written to the index (or wherever). + % + \def\definedummyword##1{% + \expandafter\def\csname ##1\endcsname{\realbackslash ##1\space}% + }% + \def\definedummyletter##1{% + \expandafter\def\csname ##1\endcsname{\realbackslash ##1}% + }% + \let\definedummyaccent\definedummyletter + % + % Do the redefinitions. + \commondummies } -% If an index command is used in an @example environment, any spaces -% therein should become regular spaces in the raw index file, not the -% expansion of \tie (\\leavevmode \penalty \@M \ ). -{\obeyspaces - \gdef\unsepspaces{\obeyspaces\let =\space}} +% For the aux file, @ is the escape character. So we want to redefine +% everything using @ instead of \realbackslash. When everything uses +% @, this will be simpler. +% +\def\atdummies{% + \def\@{@@}% + \def\ {@ }% + \let\{ = \lbraceatcmd + \let\} = \rbraceatcmd + % + % (See comments in \indexdummies.) + \def\definedummyword##1{% + \expandafter\def\csname ##1\endcsname{@##1\space}% + }% + \def\definedummyletter##1{% + \expandafter\def\csname ##1\endcsname{@##1}% + }% + \let\definedummyaccent\definedummyletter + % + % Do the redefinitions. + \commondummies +} -% \indexnofonts no-ops all font-change commands. -% This is used when outputting the strings to sort the index by. -\def\indexdummyfont#1{#1} -\def\indexdummytex{TeX} -\def\indexdummydots{...} +% Called from \indexdummies and \atdummies. \definedummyword and +% \definedummyletter must be defined first. +% +\def\commondummies{% + % + \normalturnoffactive + % + \commondummiesnofonts + % + \definedummyletter{_}% + % + % Non-English letters. + \definedummyword{AA}% + \definedummyword{AE}% + \definedummyword{L}% + \definedummyword{OE}% + \definedummyword{O}% + \definedummyword{aa}% + \definedummyword{ae}% + \definedummyword{l}% + \definedummyword{oe}% + \definedummyword{o}% + \definedummyword{ss}% + \definedummyword{exclamdown}% + \definedummyword{questiondown}% + \definedummyword{ordf}% + \definedummyword{ordm}% + % + % Although these internal commands shouldn't show up, sometimes they do. + \definedummyword{bf}% + \definedummyword{gtr}% + \definedummyword{hat}% + \definedummyword{less}% + \definedummyword{sf}% + \definedummyword{sl}% + \definedummyword{tclose}% + \definedummyword{tt}% + % + \definedummyword{LaTeX}% + \definedummyword{TeX}% + % + % Assorted special characters. + \definedummyword{bullet}% + \definedummyword{copyright}% + \definedummyword{registeredsymbol}% + \definedummyword{dots}% + \definedummyword{enddots}% + \definedummyword{equiv}% + \definedummyword{error}% + \definedummyword{expansion}% + \definedummyword{minus}% + \definedummyword{pounds}% + \definedummyword{point}% + \definedummyword{print}% + \definedummyword{result}% + % + % Handle some cases of @value -- where it does not contain any + % (non-fully-expandable) commands. + \makevalueexpandable + % + % Normal spaces, not active ones. + \unsepspaces + % + % No macro expansion. + \turnoffmacros +} +% \commondummiesnofonts: common to \commondummies and \indexnofonts. +% +% Better have this without active chars. +{ + \catcode`\~=\other + \gdef\commondummiesnofonts{% + % Control letters and accents. + \definedummyletter{!}% + \definedummyaccent{"}% + \definedummyaccent{'}% + \definedummyletter{*}% + \definedummyaccent{,}% + \definedummyletter{.}% + \definedummyletter{/}% + \definedummyletter{:}% + \definedummyaccent{=}% + \definedummyletter{?}% + \definedummyaccent{^}% + \definedummyaccent{`}% + \definedummyaccent{~}% + \definedummyword{u}% + \definedummyword{v}% + \definedummyword{H}% + \definedummyword{dotaccent}% + \definedummyword{ringaccent}% + \definedummyword{tieaccent}% + \definedummyword{ubaraccent}% + \definedummyword{udotaccent}% + \definedummyword{dotless}% + % + % Texinfo font commands. + \definedummyword{b}% + \definedummyword{i}% + \definedummyword{r}% + \definedummyword{sc}% + \definedummyword{t}% + % + % Commands that take arguments. + \definedummyword{acronym}% + \definedummyword{cite}% + \definedummyword{code}% + \definedummyword{command}% + \definedummyword{dfn}% + \definedummyword{emph}% + \definedummyword{env}% + \definedummyword{file}% + \definedummyword{kbd}% + \definedummyword{key}% + \definedummyword{math}% + \definedummyword{option}% + \definedummyword{samp}% + \definedummyword{strong}% + \definedummyword{tie}% + \definedummyword{uref}% + \definedummyword{url}% + \definedummyword{var}% + \definedummyword{verb}% + \definedummyword{w}% + } +} + +% \indexnofonts is used when outputting the strings to sort the index +% by, and when constructing control sequence names. It eliminates all +% control sequences and just writes whatever the best ASCII sort string +% would be for a given command (usually its argument). +% \def\indexnofonts{% -% Just ignore accents. -\let\,=\indexdummyfont -\let\"=\indexdummyfont -\let\`=\indexdummyfont -\let\'=\indexdummyfont -\let\^=\indexdummyfont -\let\~=\indexdummyfont -\let\==\indexdummyfont -\let\b=\indexdummyfont -\let\c=\indexdummyfont -\let\d=\indexdummyfont -\let\u=\indexdummyfont -\let\v=\indexdummyfont -\let\H=\indexdummyfont -\let\dotless=\indexdummyfont -% Take care of the plain tex special European modified letters. -\def\oe{oe}% -\def\ae{ae}% -\def\aa{aa}% -\def\OE{OE}% -\def\AE{AE}% -\def\AA{AA}% -\def\o{o}% -\def\O{O}% -\def\l{l}% -\def\L{L}% -\def\ss{ss}% -\let\w=\indexdummyfont -\let\t=\indexdummyfont -\let\r=\indexdummyfont -\let\i=\indexdummyfont -\let\b=\indexdummyfont -\let\emph=\indexdummyfont -\let\strong=\indexdummyfont -\let\cite=\indexdummyfont -\let\sc=\indexdummyfont -%Don't no-op \tt, since it isn't a user-level command -% and is used in the definitions of the active chars like <, >, |... -%\let\tt=\indexdummyfont -\let\tclose=\indexdummyfont -\let\code=\indexdummyfont -\let\url=\indexdummyfont -\let\uref=\indexdummyfont -\let\env=\indexdummyfont -\let\command=\indexdummyfont -\let\option=\indexdummyfont -\let\file=\indexdummyfont -\let\samp=\indexdummyfont -\let\kbd=\indexdummyfont -\let\key=\indexdummyfont -\let\var=\indexdummyfont -\let\TeX=\indexdummytex -\let\dots=\indexdummydots -\def\@{@}% + % Accent commands should become @asis. + \def\definedummyaccent##1{% + \expandafter\let\csname ##1\endcsname\asis + }% + % We can just ignore other control letters. + \def\definedummyletter##1{% + \expandafter\def\csname ##1\endcsname{}% + }% + % Hopefully, all control words can become @asis. + \let\definedummyword\definedummyaccent + % + \commondummiesnofonts + % + % Don't no-op \tt, since it isn't a user-level command + % and is used in the definitions of the active chars like <, >, |, etc. + % Likewise with the other plain tex font commands. + %\let\tt=\asis + % + \def\ { }% + \def\@{@}% + % how to handle braces? + \def\_{\normalunderscore}% + % + % Non-English letters. + \def\AA{AA}% + \def\AE{AE}% + \def\L{L}% + \def\OE{OE}% + \def\O{O}% + \def\aa{aa}% + \def\ae{ae}% + \def\l{l}% + \def\oe{oe}% + \def\o{o}% + \def\ss{ss}% + \def\exclamdown{!}% + \def\questiondown{?}% + \def\ordf{a}% + \def\ordm{o}% + % + \def\LaTeX{LaTeX}% + \def\TeX{TeX}% + % + % Assorted special characters. + % (The following {} will end up in the sort string, but that's ok.) + \def\bullet{bullet}% + \def\copyright{copyright}% + \def\registeredsymbol{R}% + \def\dots{...}% + \def\enddots{...}% + \def\equiv{==}% + \def\error{error}% + \def\expansion{==>}% + \def\minus{-}% + \def\pounds{pounds}% + \def\point{.}% + \def\print{-|}% + \def\result{=>}% + % + % Don't write macro names. + \emptyusermacros } -% To define \realbackslash, we must make \ not be an escape. -% We must first make another character (@) an escape -% so we do not become unable to do a definition. - -{\catcode`\@=0 \catcode`\\=\other - @gdef@realbackslash{\}} - \let\indexbackslash=0 %overridden during \printindex. \let\SETmarginindex=\relax % put index entries in margin (undocumented)? -% For \ifx comparisons. -\def\emptymacro{\empty} - % Most index entries go through here, but \dosubind is the general case. -% -\def\doind#1#2{\dosubind{#1}{#2}\empty} +% #1 is the index name, #2 is the entry text. +\def\doind#1#2{\dosubind{#1}{#2}{}} % Workhorse for all \fooindexes. % #1 is name of index, #2 is stuff to put there, #3 is subentry -- -% \empty if called from \doind, as we usually are. The main exception -% is with defuns, which call us directly. +% empty if called from \doind, as we usually are (the main exception +% is with most defuns, which call us directly). % \def\dosubind#1#2#3{% + \iflinks + {% + % Store the main index entry text (including the third arg). + \toks0 = {#2}% + % If third arg is present, precede it with a space. + \def\thirdarg{#3}% + \ifx\thirdarg\empty \else + \toks0 = \expandafter{\the\toks0 \space #3}% + \fi + % + \edef\writeto{\csname#1indfile\endcsname}% + % + \ifvmode + \dosubindsanitize + \else + \dosubindwrite + \fi + }% + \fi +} + +% Write the entry in \toks0 to the index file: +% +\def\dosubindwrite{% % Put the index entry in the margin if desired. \ifx\SETmarginindex\relax\else - \insert\margin{\hbox{\vrule height8pt depth3pt width0pt #2}}% + \insert\margin{\hbox{\vrule height8pt depth3pt width0pt \the\toks0}}% \fi - {% - \count255=\lastpenalty - {% - \indexdummies % Must do this here, since \bf, etc expand at this stage - \escapechar=`\\ - {% - \let\folio = 0% We will expand all macros now EXCEPT \folio. - \def\rawbackslashxx{\indexbackslash}% \indexbackslash isn't defined now - % so it will be output as is; and it will print as backslash. - % - \def\thirdarg{#3}% - % - % If third arg is present, precede it with space in sort key. - \ifx\thirdarg\emptymacro - \let\subentry = \empty - \else - \def\subentry{ #3}% - \fi - % - % First process the index entry with all font commands turned - % off to get the string to sort by. - {\indexnofonts \xdef\indexsorttmp{#2\subentry}}% - % - % Now the real index entry with the fonts. - \toks0 = {#2}% - % - % If third (subentry) arg is present, add it to the index - % string. And include a space. - \ifx\thirdarg\emptymacro \else - \toks0 = \expandafter{\the\toks0 \space #3}% - \fi - % - % Set up the complete index entry, with both the sort key - % and the original text, including any font commands. We write - % three arguments to \entry to the .?? file, texindex reduces to - % two when writing the .??s sorted result. - \edef\temp{% - \write\csname#1indfile\endcsname{% - \realbackslash entry{\indexsorttmp}{\folio}{\the\toks0}}% - }% - % - % If a skip is the last thing on the list now, preserve it - % by backing up by \lastskip, doing the \write, then inserting - % the skip again. Otherwise, the whatsit generated by the - % \write will make \lastskip zero. The result is that sequences - % like this: - % @end defun - % @tindex whatever - % @defun ... - % will have extra space inserted, because the \medbreak in the - % start of the @defun won't see the skip inserted by the @end of - % the previous defun. - % - % But don't do any of this if we're not in vertical mode. We - % don't want to do a \vskip and prematurely end a paragraph. - % - % Avoid page breaks due to these extra skips, too. - % - \iflinks - \ifvmode - \skip0 = \lastskip - \ifdim\lastskip = 0pt \else \nobreak\vskip-\lastskip \fi - \fi - % - \temp % do the write - % - % - \ifvmode \ifdim\skip0 = 0pt \else \nobreak\vskip\skip0 \fi \fi - \fi - }% - }% - \penalty\count255 + % + % Remember, we are within a group. + \indexdummies % Must do this here, since \bf, etc expand at this stage + \escapechar=`\\ + \def\backslashcurfont{\indexbackslash}% \indexbackslash isn't defined now + % so it will be output as is; and it will print as backslash. + % + % Process the index entry with all font commands turned off, to + % get the string to sort by. + {\indexnofonts + \edef\temp{\the\toks0}% need full expansion + \xdef\indexsorttmp{\temp}% }% + % + % Set up the complete index entry, with both the sort key and + % the original text, including any font commands. We write + % three arguments to \entry to the .?? file (four in the + % subentry case), texindex reduces to two when writing the .??s + % sorted result. + \edef\temp{% + \write\writeto{% + \string\entry{\indexsorttmp}{\noexpand\folio}{\the\toks0}}% + }% + \temp +} + +% Take care of unwanted page breaks: +% +% If a skip is the last thing on the list now, preserve it +% by backing up by \lastskip, doing the \write, then inserting +% the skip again. Otherwise, the whatsit generated by the +% \write will make \lastskip zero. The result is that sequences +% like this: +% @end defun +% @tindex whatever +% @defun ... +% will have extra space inserted, because the \medbreak in the +% start of the @defun won't see the skip inserted by the @end of +% the previous defun. +% +% But don't do any of this if we're not in vertical mode. We +% don't want to do a \vskip and prematurely end a paragraph. +% +% Avoid page breaks due to these extra skips, too. +% +% But wait, there is a catch there: +% We'll have to check whether \lastskip is zero skip. \ifdim is not +% sufficient for this purpose, as it ignores stretch and shrink parts +% of the skip. The only way seems to be to check the textual +% representation of the skip. +% +% The following is almost like \def\zeroskipmacro{0.0pt} except that +% the ``p'' and ``t'' characters have catcode \other, not 11 (letter). +% +\edef\zeroskipmacro{\expandafter\the\csname z@skip\endcsname} +% +% ..., ready, GO: +% +\def\dosubindsanitize{% + % \lastskip and \lastpenalty cannot both be nonzero simultaneously. + \skip0 = \lastskip + \edef\lastskipmacro{\the\lastskip}% + \count255 = \lastpenalty + % + % If \lastskip is nonzero, that means the last item was a + % skip. And since a skip is discardable, that means this + % -\skip0 glue we're inserting is preceded by a + % non-discardable item, therefore it is not a potential + % breakpoint, therefore no \nobreak needed. + \ifx\lastskipmacro\zeroskipmacro + \else + \vskip-\skip0 + \fi + % + \dosubindwrite + % + \ifx\lastskipmacro\zeroskipmacro + % if \lastskip was zero, perhaps the last item was a + % penalty, and perhaps it was >=10000, e.g., a \nobreak. + % In that case, we want to re-insert the penalty; since we + % just inserted a non-discardable item, any following glue + % (such as a \parskip) would be a breakpoint. For example: + % @deffn deffn-whatever + % @vindex index-whatever + % Description. + % would allow a break between the index-whatever whatsit + % and the "Description." paragraph. + \ifnum\count255>9999 \nobreak \fi + \else + % On the other hand, if we had a nonzero \lastskip, + % this make-up glue would be preceded by a non-discardable item + % (the whatsit from the \write), so we must insert a \nobreak. + \nobreak\vskip\skip0 + \fi } % The index entry written in the file actually looks like @@ -2933,13 +3460,12 @@ width0pt\relax} \fi % @printindex causes a particular index (the ??s file) to get printed. % It does not print any chapter heading (usually an @unnumbered). % -\def\printindex{\parsearg\doprintindex} -\def\doprintindex#1{\begingroup +\parseargdef\printindex{\begingroup \dobreak \chapheadingskip{10000}% % - \indexfonts \rm + \smallfonts \rm \tolerance = 9500 - \indexbreaks + \everypar = {}% don't want the \kern\-parindent from indentation suppression. % % See if the index file exists and is nonempty. % Change catcode of @ here so that if the index file contains @@ -2966,7 +3492,7 @@ width0pt\relax} \fi % Index files are almost Texinfo source, but we use \ as the escape % character. It would be better to use @, but that's too big a change % to make right now. - \def\indexbackslash{\rawbackslashxx}% + \def\indexbackslash{\backslashcurfont}% \catcode`\\ = 0 \escapechar = `\\ \begindoublecolumns @@ -3004,74 +3530,95 @@ width0pt\relax} \fi \nobreak }} -% This typesets a paragraph consisting of #1, dot leaders, and then #2 -% flush to the right margin. It is used for index and table of contents -% entries. The paragraph is indented by \leftskip. +% \entry typesets a paragraph consisting of the text (#1), dot leaders, and +% then page number (#2) flushed to the right margin. It is used for index +% and table of contents entries. The paragraph is indented by \leftskip. % -\def\entry#1#2{\begingroup - % - % Start a new paragraph if necessary, so our assignments below can't - % affect previous text. - \par - % - % Do not fill out the last line with white space. - \parfillskip = 0in - % - % No extra space above this paragraph. - \parskip = 0in - % - % Do not prefer a separate line ending with a hyphen to fewer lines. - \finalhyphendemerits = 0 - % - % \hangindent is only relevant when the entry text and page number - % don't both fit on one line. In that case, bob suggests starting the - % dots pretty far over on the line. Unfortunately, a large - % indentation looks wrong when the entry text itself is broken across - % lines. So we use a small indentation and put up with long leaders. - % - % \hangafter is reset to 1 (which is the value we want) at the start - % of each paragraph, so we need not do anything with that. - \hangindent = 2em - % - % When the entry text needs to be broken, just fill out the first line - % with blank space. - \rightskip = 0pt plus1fil - % - % A bit of stretch before each entry for the benefit of balancing columns. - \vskip 0pt plus1pt - % - % Start a ``paragraph'' for the index entry so the line breaking - % parameters we've set above will have an effect. - \noindent - % - % Insert the text of the index entry. TeX will do line-breaking on it. - #1% - % The following is kludged to not output a line of dots in the index if - % there are no page numbers. The next person who breaks this will be - % cursed by a Unix daemon. - \def\tempa{{\rm }}% - \def\tempb{#2}% - \edef\tempc{\tempa}% - \edef\tempd{\tempb}% - \ifx\tempc\tempd\ \else% +% A straightforward implementation would start like this: +% \def\entry#1#2{... +% But this frozes the catcodes in the argument, and can cause problems to +% @code, which sets - active. This problem was fixed by a kludge--- +% ``-'' was active throughout whole index, but this isn't really right. +% +% The right solution is to prevent \entry from swallowing the whole text. +% --kasal, 21nov03 +\def\entry{% + \begingroup % - % If we must, put the page number on a line of its own, and fill out - % this line with blank space. (The \hfil is overwhelmed with the - % fill leaders glue in \indexdotfill if the page number does fit.) - \hfil\penalty50 - \null\nobreak\indexdotfill % Have leaders before the page number. + % Start a new paragraph if necessary, so our assignments below can't + % affect previous text. + \par % - % The `\ ' here is removed by the implicit \unskip that TeX does as - % part of (the primitive) \par. Without it, a spurious underfull - % \hbox ensues. - \ifpdf - \pdfgettoks#2.\ \the\toksA % The page number ends the paragraph. + % Do not fill out the last line with white space. + \parfillskip = 0in + % + % No extra space above this paragraph. + \parskip = 0in + % + % Do not prefer a separate line ending with a hyphen to fewer lines. + \finalhyphendemerits = 0 + % + % \hangindent is only relevant when the entry text and page number + % don't both fit on one line. In that case, bob suggests starting the + % dots pretty far over on the line. Unfortunately, a large + % indentation looks wrong when the entry text itself is broken across + % lines. So we use a small indentation and put up with long leaders. + % + % \hangafter is reset to 1 (which is the value we want) at the start + % of each paragraph, so we need not do anything with that. + \hangindent = 2em + % + % When the entry text needs to be broken, just fill out the first line + % with blank space. + \rightskip = 0pt plus1fil + % + % A bit of stretch before each entry for the benefit of balancing + % columns. + \vskip 0pt plus1pt + % + % Swallow the left brace of the text (first parameter): + \afterassignment\doentry + \let\temp = +} +\def\doentry{% + \bgroup % Instead of the swallowed brace. + \noindent + \aftergroup\finishentry + % And now comes the text of the entry. +} +\def\finishentry#1{% + % #1 is the page number. + % + % The following is kludged to not output a line of dots in the index if + % there are no page numbers. The next person who breaks this will be + % cursed by a Unix daemon. + \def\tempa{{\rm }}% + \def\tempb{#1}% + \edef\tempc{\tempa}% + \edef\tempd{\tempb}% + \ifx\tempc\tempd + \ % \else - \ #2% The page number ends the paragraph. + % + % If we must, put the page number on a line of its own, and fill out + % this line with blank space. (The \hfil is overwhelmed with the + % fill leaders glue in \indexdotfill if the page number does fit.) + \hfil\penalty50 + \null\nobreak\indexdotfill % Have leaders before the page number. + % + % The `\ ' here is removed by the implicit \unskip that TeX does as + % part of (the primitive) \par. Without it, a spurious underfull + % \hbox ensues. + \ifpdf + \pdfgettoks#1.% + \ \the\toksA + \else + \ #1% + \fi \fi - \fi% - \par -\endgroup} + \par + \endgroup +} % Like \dotfill except takes at least 1 em. \def\indexdotfill{\cleaders @@ -3080,11 +3627,18 @@ width0pt\relax} \fi \def\primary #1{\line{#1\hfil}} \newskip\secondaryindent \secondaryindent=0.5cm - -\def\secondary #1#2{ -{\parfillskip=0in \parskip=0in -\hangindent =1in \hangafter=1 -\noindent\hskip\secondaryindent\hbox{#1}\indexdotfill #2\par +\def\secondary#1#2{{% + \parfillskip=0in + \parskip=0in + \hangindent=1in + \hangafter=1 + \noindent\hskip\secondaryindent\hbox{#1}\indexdotfill + \ifpdf + \pdfgettoks#2.\ \the\toksA % The page number ends the paragraph. + \else + #2 + \fi + \par }} % Define two-column mode, which we use to typeset indexes. @@ -3144,7 +3698,6 @@ width0pt\relax} \fi % % Double the \vsize as well. (We don't need a separate register here, % since nobody clobbers \vsize.) - \advance\vsize by -\ht\partialpage \vsize = 2\vsize } @@ -3158,6 +3711,7 @@ width0pt\relax} \fi % previous page. \dimen@ = \vsize \divide\dimen@ by 2 + \advance\dimen@ by -\ht\partialpage % % box0 will be the left-hand column, box2 the right. \setbox0=\vsplit255 to\dimen@ \setbox2=\vsplit255 to\dimen@ @@ -3165,15 +3719,18 @@ width0pt\relax} \fi \unvbox255 \penalty\outputpenalty } +% +% Re-output the contents of the output page -- any previous material, +% followed by the two boxes we just split, in box0 and box2. \def\pagesofar{% - % Re-output the contents of the output page -- any previous material, - % followed by the two boxes we just split, in box0 and box2. \unvbox\partialpage % \hsize = \doublecolumnhsize \wd0=\hsize \wd2=\hsize \hbox to\pagewidth{\box0\hfil\box2}% } +% +% All done with double columns. \def\enddoublecolumns{% \output = {% % Split the last of the double-column material. Leave it on the @@ -3198,8 +3755,9 @@ width0pt\relax} \fi % \endgroup where \vsize got restored). \pagegoal = \vsize } +% +% Called at the end of the double column material. \def\balancecolumns{% - % Called at the end of the double column material. \setbox0 = \vbox{\unvbox255}% like \box255 but more efficient, see p.120. \dimen@ = \ht0 \advance\dimen@ by \topskip @@ -3229,26 +3787,68 @@ width0pt\relax} \fi \message{sectioning,} % Chapters, sections, etc. +% \unnumberedno is an oxymoron, of course. But we count the unnumbered +% sections so that we can refer to them unambiguously in the pdf +% outlines by their "section number". We avoid collisions with chapter +% numbers by starting them at 10000. (If a document ever has 10000 +% chapters, we're in trouble anyway, I'm sure.) +\newcount\unnumberedno \unnumberedno = 10000 \newcount\chapno \newcount\secno \secno=0 \newcount\subsecno \subsecno=0 \newcount\subsubsecno \subsubsecno=0 % This counter is funny since it counts through charcodes of letters A, B, ... -% The \the is necessary, despite appearances, because \appendixletter is -% expanded while writing the .toc file. \char\appendixno is not -% expandable, thus it is written literally, thus all appendixes come out -% with the same letter (or @) in the toc without it. \newcount\appendixno \appendixno = `\@ -\def\appendixletter{\char\the\appendixno} +% +% \def\appendixletter{\char\the\appendixno} +% We do the following ugly conditional instead of the above simple +% construct for the sake of pdftex, which needs the actual +% letter in the expansion, not just typeset. +% +\def\appendixletter{% + \ifnum\appendixno=`A A% + \else\ifnum\appendixno=`B B% + \else\ifnum\appendixno=`C C% + \else\ifnum\appendixno=`D D% + \else\ifnum\appendixno=`E E% + \else\ifnum\appendixno=`F F% + \else\ifnum\appendixno=`G G% + \else\ifnum\appendixno=`H H% + \else\ifnum\appendixno=`I I% + \else\ifnum\appendixno=`J J% + \else\ifnum\appendixno=`K K% + \else\ifnum\appendixno=`L L% + \else\ifnum\appendixno=`M M% + \else\ifnum\appendixno=`N N% + \else\ifnum\appendixno=`O O% + \else\ifnum\appendixno=`P P% + \else\ifnum\appendixno=`Q Q% + \else\ifnum\appendixno=`R R% + \else\ifnum\appendixno=`S S% + \else\ifnum\appendixno=`T T% + \else\ifnum\appendixno=`U U% + \else\ifnum\appendixno=`V V% + \else\ifnum\appendixno=`W W% + \else\ifnum\appendixno=`X X% + \else\ifnum\appendixno=`Y Y% + \else\ifnum\appendixno=`Z Z% + % The \the is necessary, despite appearances, because \appendixletter is + % expanded while writing the .toc file. \char\appendixno is not + % expandable, thus it is written literally, thus all appendixes come out + % with the same letter (or @) in the toc without it. + \else\char\the\appendixno + \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi + \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi} % Each @chapter defines this as the name of the chapter. % page headings and footings can use it. @section does likewise. +% However, they are not reliable, because we don't use marks. \def\thischapter{} \def\thissection{} \newcount\absseclevel % used to calculate proper heading level -\newcount\secbase\secbase=0 % @raise/lowersections modify this count +\newcount\secbase\secbase=0 % @raisesections/@lowersections modify this count % @raisesections: treat @section as chapter, @subsection as section, etc. \def\raisesections{\global\advance\secbase by -1} @@ -3258,287 +3858,246 @@ width0pt\relax} \fi \def\lowersections{\global\advance\secbase by 1} \let\down=\lowersections % original BFox name -% Choose a numbered-heading macro -% #1 is heading level if unmodified by @raisesections or @lowersections -% #2 is text for heading -\def\numhead#1#2{\absseclevel=\secbase\advance\absseclevel by #1 -\ifcase\absseclevel - \chapterzzz{#2} -\or - \seczzz{#2} -\or - \numberedsubseczzz{#2} -\or - \numberedsubsubseczzz{#2} -\else - \ifnum \absseclevel<0 - \chapterzzz{#2} +% we only have subsub. +\chardef\maxseclevel = 3 +% +% A numbered section within an unnumbered changes to unnumbered too. +% To achive this, remember the "biggest" unnum. sec. we are currently in: +\chardef\unmlevel = \maxseclevel +% +% Trace whether the current chapter is an appendix or not: +% \chapheadtype is "N" or "A", unnumbered chapters are ignored. +\def\chapheadtype{N} + +% Choose a heading macro +% #1 is heading type +% #2 is heading level +% #3 is text for heading +\def\genhead#1#2#3{% + % Compute the abs. sec. level: + \absseclevel=#2 + \advance\absseclevel by \secbase + % Make sure \absseclevel doesn't fall outside the range: + \ifnum \absseclevel < 0 + \absseclevel = 0 \else - \numberedsubsubseczzz{#2} + \ifnum \absseclevel > 3 + \absseclevel = 3 + \fi \fi -\fi -} - -% like \numhead, but chooses appendix heading levels -\def\apphead#1#2{\absseclevel=\secbase\advance\absseclevel by #1 -\ifcase\absseclevel - \appendixzzz{#2} -\or - \appendixsectionzzz{#2} -\or - \appendixsubseczzz{#2} -\or - \appendixsubsubseczzz{#2} -\else - \ifnum \absseclevel<0 - \appendixzzz{#2} + % The heading type: + \def\headtype{#1}% + \if \headtype U% + \ifnum \absseclevel < \unmlevel + \chardef\unmlevel = \absseclevel + \fi \else - \appendixsubsubseczzz{#2} + % Check for appendix sections: + \ifnum \absseclevel = 0 + \edef\chapheadtype{\headtype}% + \else + \if \headtype A\if \chapheadtype N% + \errmessage{@appendix... within a non-appendix chapter}% + \fi\fi + \fi + % Check for numbered within unnumbered: + \ifnum \absseclevel > \unmlevel + \def\headtype{U}% + \else + \chardef\unmlevel = 3 + \fi \fi -\fi -} - -% like \numhead, but chooses numberless heading levels -\def\unnmhead#1#2{\absseclevel=\secbase\advance\absseclevel by #1 -\ifcase\absseclevel - \unnumberedzzz{#2} -\or - \unnumberedseczzz{#2} -\or - \unnumberedsubseczzz{#2} -\or - \unnumberedsubsubseczzz{#2} -\else - \ifnum \absseclevel<0 - \unnumberedzzz{#2} + % Now print the heading: + \if \headtype U% + \ifcase\absseclevel + \unnumberedzzz{#3}% + \or \unnumberedseczzz{#3}% + \or \unnumberedsubseczzz{#3}% + \or \unnumberedsubsubseczzz{#3}% + \fi \else - \unnumberedsubsubseczzz{#2} + \if \headtype A% + \ifcase\absseclevel + \appendixzzz{#3}% + \or \appendixsectionzzz{#3}% + \or \appendixsubseczzz{#3}% + \or \appendixsubsubseczzz{#3}% + \fi + \else + \ifcase\absseclevel + \chapterzzz{#3}% + \or \seczzz{#3}% + \or \numberedsubseczzz{#3}% + \or \numberedsubsubseczzz{#3}% + \fi + \fi \fi -\fi + \suppressfirstparagraphindent } -% @chapter, @appendix, @unnumbered. -\def\thischaptername{No Chapter Title} -\outer\def\chapter{\parsearg\chapteryyy} -\def\chapteryyy #1{\numhead0{#1}} % normally numhead0 calls chapterzzz -\def\chapterzzz #1{% -\secno=0 \subsecno=0 \subsubsecno=0 -\global\advance \chapno by 1 \message{\putwordChapter\space \the\chapno}% -\chapmacro {#1}{\the\chapno}% -\gdef\thissection{#1}% -\gdef\thischaptername{#1}% -% We don't substitute the actual chapter name into \thischapter -% because we don't want its macros evaluated now. -\xdef\thischapter{\putwordChapter{} \the\chapno: \noexpand\thischaptername}% -\toks0 = {#1}% -\edef\temp{\noexpand\writetocentry{\realbackslash chapentry{\the\toks0}% - {\the\chapno}}}% -\temp -\donoderef -\global\let\section = \numberedsec -\global\let\subsection = \numberedsubsec -\global\let\subsubsection = \numberedsubsubsec +% an interface: +\def\numhead{\genhead N} +\def\apphead{\genhead A} +\def\unnmhead{\genhead U} + +% @chapter, @appendix, @unnumbered. Increment top-level counter, reset +% all lower-level sectioning counters to zero. +% +% Also set \chaplevelprefix, which we prepend to @float sequence numbers +% (e.g., figures), q.v. By default (before any chapter), that is empty. +\let\chaplevelprefix = \empty +% +\outer\parseargdef\chapter{\numhead0{#1}} % normally numhead0 calls chapterzzz +\def\chapterzzz#1{% + % section resetting is \global in case the chapter is in a group, such + % as an @include file. + \global\secno=0 \global\subsecno=0 \global\subsubsecno=0 + \global\advance\chapno by 1 + % + % Used for \float. + \gdef\chaplevelprefix{\the\chapno.}% + \resetallfloatnos + % + \message{\putwordChapter\space \the\chapno}% + % + % Write the actual heading. + \chapmacro{#1}{Ynumbered}{\the\chapno}% + % + % So @section and the like are numbered underneath this chapter. + \global\let\section = \numberedsec + \global\let\subsection = \numberedsubsec + \global\let\subsubsection = \numberedsubsubsec } -\outer\def\appendix{\parsearg\appendixyyy} -\def\appendixyyy #1{\apphead0{#1}} % normally apphead0 calls appendixzzz -\def\appendixzzz #1{% -\secno=0 \subsecno=0 \subsubsecno=0 -\global\advance \appendixno by 1 -\message{\putwordAppendix\space \appendixletter}% -\chapmacro {#1}{\putwordAppendix{} \appendixletter}% -\gdef\thissection{#1}% -\gdef\thischaptername{#1}% -\xdef\thischapter{\putwordAppendix{} \appendixletter: \noexpand\thischaptername}% -\toks0 = {#1}% -\edef\temp{\noexpand\writetocentry{\realbackslash chapentry{\the\toks0}% - {\putwordAppendix{} \appendixletter}}}% -\temp -\appendixnoderef -\global\let\section = \appendixsec -\global\let\subsection = \appendixsubsec -\global\let\subsubsection = \appendixsubsubsec +\outer\parseargdef\appendix{\apphead0{#1}} % normally apphead0 calls appendixzzz +\def\appendixzzz#1{% + \global\secno=0 \global\subsecno=0 \global\subsubsecno=0 + \global\advance\appendixno by 1 + \gdef\chaplevelprefix{\appendixletter.}% + \resetallfloatnos + % + \def\appendixnum{\putwordAppendix\space \appendixletter}% + \message{\appendixnum}% + % + \chapmacro{#1}{Yappendix}{\appendixletter}% + % + \global\let\section = \appendixsec + \global\let\subsection = \appendixsubsec + \global\let\subsubsection = \appendixsubsubsec +} + +\outer\parseargdef\unnumbered{\unnmhead0{#1}} % normally unnmhead0 calls unnumberedzzz +\def\unnumberedzzz#1{% + \global\secno=0 \global\subsecno=0 \global\subsubsecno=0 + \global\advance\unnumberedno by 1 + % + % Since an unnumbered has no number, no prefix for figures. + \global\let\chaplevelprefix = \empty + \resetallfloatnos + % + % This used to be simply \message{#1}, but TeX fully expands the + % argument to \message. Therefore, if #1 contained @-commands, TeX + % expanded them. For example, in `@unnumbered The @cite{Book}', TeX + % expanded @cite (which turns out to cause errors because \cite is meant + % to be executed, not expanded). + % + % Anyway, we don't want the fully-expanded definition of @cite to appear + % as a result of the \message, we just want `@cite' itself. We use + % \the to achieve this: TeX expands \the only once, + % simply yielding the contents of . (We also do this for + % the toc entries.) + \toks0 = {#1}% + \message{(\the\toks0)}% + % + \chapmacro{#1}{Ynothing}{\the\unnumberedno}% + % + \global\let\section = \unnumberedsec + \global\let\subsection = \unnumberedsubsec + \global\let\subsubsection = \unnumberedsubsubsec } % @centerchap is like @unnumbered, but the heading is centered. -\outer\def\centerchap{\parsearg\centerchapyyy} -\def\centerchapyyy #1{{\let\unnumbchapmacro=\centerchapmacro \unnumberedyyy{#1}}} +\outer\parseargdef\centerchap{% + % Well, we could do the following in a group, but that would break + % an assumption that \chapmacro is called at the outermost level. + % Thus we are safer this way: --kasal, 24feb04 + \let\centerparametersmaybe = \centerparameters + \unnmhead0{#1}% + \let\centerparametersmaybe = \relax +} % @top is like @unnumbered. -\outer\def\top{\parsearg\unnumberedyyy} - -\outer\def\unnumbered{\parsearg\unnumberedyyy} -\def\unnumberedyyy #1{\unnmhead0{#1}} % normally unnmhead0 calls unnumberedzzz -\def\unnumberedzzz #1{% -\secno=0 \subsecno=0 \subsubsecno=0 -% -% This used to be simply \message{#1}, but TeX fully expands the -% argument to \message. Therefore, if #1 contained @-commands, TeX -% expanded them. For example, in `@unnumbered The @cite{Book}', TeX -% expanded @cite (which turns out to cause errors because \cite is meant -% to be executed, not expanded). -% -% Anyway, we don't want the fully-expanded definition of @cite to appear -% as a result of the \message, we just want `@cite' itself. We use -% \the to achieve this: TeX expands \the only once, -% simply yielding the contents of . (We also do this for -% the toc entries.) -\toks0 = {#1}\message{(\the\toks0)}% -% -\unnumbchapmacro {#1}% -\gdef\thischapter{#1}\gdef\thissection{#1}% -\toks0 = {#1}% -\edef\temp{\noexpand\writetocentry{\realbackslash unnumbchapentry{\the\toks0}}}% -\temp -\unnumbnoderef -\global\let\section = \unnumberedsec -\global\let\subsection = \unnumberedsubsec -\global\let\subsubsection = \unnumberedsubsubsec -} +\let\top\unnumbered % Sections. -\outer\def\numberedsec{\parsearg\secyyy} -\def\secyyy #1{\numhead1{#1}} % normally calls seczzz -\def\seczzz #1{% -\subsecno=0 \subsubsecno=0 \global\advance \secno by 1 % -\gdef\thissection{#1}\secheading {#1}{\the\chapno}{\the\secno}% -\toks0 = {#1}% -\edef\temp{\noexpand\writetocentry{\realbackslash secentry{\the\toks0}% - {\the\chapno}{\the\secno}}}% -\temp -\donoderef -\nobreak +\outer\parseargdef\numberedsec{\numhead1{#1}} % normally calls seczzz +\def\seczzz#1{% + \global\subsecno=0 \global\subsubsecno=0 \global\advance\secno by 1 + \sectionheading{#1}{sec}{Ynumbered}{\the\chapno.\the\secno}% } -\outer\def\appendixsection{\parsearg\appendixsecyyy} -\outer\def\appendixsec{\parsearg\appendixsecyyy} -\def\appendixsecyyy #1{\apphead1{#1}} % normally calls appendixsectionzzz -\def\appendixsectionzzz #1{% -\subsecno=0 \subsubsecno=0 \global\advance \secno by 1 % -\gdef\thissection{#1}\secheading {#1}{\appendixletter}{\the\secno}% -\toks0 = {#1}% -\edef\temp{\noexpand\writetocentry{\realbackslash secentry{\the\toks0}% - {\appendixletter}{\the\secno}}}% -\temp -\appendixnoderef -\nobreak +\outer\parseargdef\appendixsection{\apphead1{#1}} % normally calls appendixsectionzzz +\def\appendixsectionzzz#1{% + \global\subsecno=0 \global\subsubsecno=0 \global\advance\secno by 1 + \sectionheading{#1}{sec}{Yappendix}{\appendixletter.\the\secno}% } +\let\appendixsec\appendixsection -\outer\def\unnumberedsec{\parsearg\unnumberedsecyyy} -\def\unnumberedsecyyy #1{\unnmhead1{#1}} % normally calls unnumberedseczzz -\def\unnumberedseczzz #1{% -\plainsecheading {#1}\gdef\thissection{#1}% -\toks0 = {#1}% -\edef\temp{\noexpand\writetocentry{\realbackslash unnumbsecentry{\the\toks0}}}% -\temp -\unnumbnoderef -\nobreak +\outer\parseargdef\unnumberedsec{\unnmhead1{#1}} % normally calls unnumberedseczzz +\def\unnumberedseczzz#1{% + \global\subsecno=0 \global\subsubsecno=0 \global\advance\secno by 1 + \sectionheading{#1}{sec}{Ynothing}{\the\unnumberedno.\the\secno}% } % Subsections. -\outer\def\numberedsubsec{\parsearg\numberedsubsecyyy} -\def\numberedsubsecyyy #1{\numhead2{#1}} % normally calls numberedsubseczzz -\def\numberedsubseczzz #1{% -\gdef\thissection{#1}\subsubsecno=0 \global\advance \subsecno by 1 % -\subsecheading {#1}{\the\chapno}{\the\secno}{\the\subsecno}% -\toks0 = {#1}% -\edef\temp{\noexpand\writetocentry{\realbackslash subsecentry{\the\toks0}% - {\the\chapno}{\the\secno}{\the\subsecno}}}% -\temp -\donoderef -\nobreak +\outer\parseargdef\numberedsubsec{\numhead2{#1}} % normally calls numberedsubseczzz +\def\numberedsubseczzz#1{% + \global\subsubsecno=0 \global\advance\subsecno by 1 + \sectionheading{#1}{subsec}{Ynumbered}{\the\chapno.\the\secno.\the\subsecno}% } -\outer\def\appendixsubsec{\parsearg\appendixsubsecyyy} -\def\appendixsubsecyyy #1{\apphead2{#1}} % normally calls appendixsubseczzz -\def\appendixsubseczzz #1{% -\gdef\thissection{#1}\subsubsecno=0 \global\advance \subsecno by 1 % -\subsecheading {#1}{\appendixletter}{\the\secno}{\the\subsecno}% -\toks0 = {#1}% -\edef\temp{\noexpand\writetocentry{\realbackslash subsecentry{\the\toks0}% - {\appendixletter}{\the\secno}{\the\subsecno}}}% -\temp -\appendixnoderef -\nobreak +\outer\parseargdef\appendixsubsec{\apphead2{#1}} % normally calls appendixsubseczzz +\def\appendixsubseczzz#1{% + \global\subsubsecno=0 \global\advance\subsecno by 1 + \sectionheading{#1}{subsec}{Yappendix}% + {\appendixletter.\the\secno.\the\subsecno}% } -\outer\def\unnumberedsubsec{\parsearg\unnumberedsubsecyyy} -\def\unnumberedsubsecyyy #1{\unnmhead2{#1}} %normally calls unnumberedsubseczzz -\def\unnumberedsubseczzz #1{% -\plainsubsecheading {#1}\gdef\thissection{#1}% -\toks0 = {#1}% -\edef\temp{\noexpand\writetocentry{\realbackslash unnumbsubsecentry% - {\the\toks0}}}% -\temp -\unnumbnoderef -\nobreak +\outer\parseargdef\unnumberedsubsec{\unnmhead2{#1}} %normally calls unnumberedsubseczzz +\def\unnumberedsubseczzz#1{% + \global\subsubsecno=0 \global\advance\subsecno by 1 + \sectionheading{#1}{subsec}{Ynothing}% + {\the\unnumberedno.\the\secno.\the\subsecno}% } % Subsubsections. -\outer\def\numberedsubsubsec{\parsearg\numberedsubsubsecyyy} -\def\numberedsubsubsecyyy #1{\numhead3{#1}} % normally numberedsubsubseczzz -\def\numberedsubsubseczzz #1{% -\gdef\thissection{#1}\global\advance \subsubsecno by 1 % -\subsubsecheading {#1} - {\the\chapno}{\the\secno}{\the\subsecno}{\the\subsubsecno}% -\toks0 = {#1}% -\edef\temp{\noexpand\writetocentry{\realbackslash subsubsecentry{\the\toks0}% - {\the\chapno}{\the\secno}{\the\subsecno}{\the\subsubsecno}}}% -\temp -\donoderef -\nobreak +\outer\parseargdef\numberedsubsubsec{\numhead3{#1}} % normally numberedsubsubseczzz +\def\numberedsubsubseczzz#1{% + \global\advance\subsubsecno by 1 + \sectionheading{#1}{subsubsec}{Ynumbered}% + {\the\chapno.\the\secno.\the\subsecno.\the\subsubsecno}% } -\outer\def\appendixsubsubsec{\parsearg\appendixsubsubsecyyy} -\def\appendixsubsubsecyyy #1{\apphead3{#1}} % normally appendixsubsubseczzz -\def\appendixsubsubseczzz #1{% -\gdef\thissection{#1}\global\advance \subsubsecno by 1 % -\subsubsecheading {#1} - {\appendixletter}{\the\secno}{\the\subsecno}{\the\subsubsecno}% -\toks0 = {#1}% -\edef\temp{\noexpand\writetocentry{\realbackslash subsubsecentry{\the\toks0}% - {\appendixletter}{\the\secno}{\the\subsecno}{\the\subsubsecno}}}% -\temp -\appendixnoderef -\nobreak +\outer\parseargdef\appendixsubsubsec{\apphead3{#1}} % normally appendixsubsubseczzz +\def\appendixsubsubseczzz#1{% + \global\advance\subsubsecno by 1 + \sectionheading{#1}{subsubsec}{Yappendix}% + {\appendixletter.\the\secno.\the\subsecno.\the\subsubsecno}% } -\outer\def\unnumberedsubsubsec{\parsearg\unnumberedsubsubsecyyy} -\def\unnumberedsubsubsecyyy #1{\unnmhead3{#1}} %normally unnumberedsubsubseczzz -\def\unnumberedsubsubseczzz #1{% -\plainsubsubsecheading {#1}\gdef\thissection{#1}% -\toks0 = {#1}% -\edef\temp{\noexpand\writetocentry{\realbackslash unnumbsubsubsecentry% - {\the\toks0}}}% -\temp -\unnumbnoderef -\nobreak +\outer\parseargdef\unnumberedsubsubsec{\unnmhead3{#1}} %normally unnumberedsubsubseczzz +\def\unnumberedsubsubseczzz#1{% + \global\advance\subsubsecno by 1 + \sectionheading{#1}{subsubsec}{Ynothing}% + {\the\unnumberedno.\the\secno.\the\subsecno.\the\subsubsecno}% } -% These are variants which are not "outer", so they can appear in @ifinfo. -% Actually, they should now be obsolete; ordinary section commands should work. -\def\infotop{\parsearg\unnumberedzzz} -\def\infounnumbered{\parsearg\unnumberedzzz} -\def\infounnumberedsec{\parsearg\unnumberedseczzz} -\def\infounnumberedsubsec{\parsearg\unnumberedsubseczzz} -\def\infounnumberedsubsubsec{\parsearg\unnumberedsubsubseczzz} - -\def\infoappendix{\parsearg\appendixzzz} -\def\infoappendixsec{\parsearg\appendixseczzz} -\def\infoappendixsubsec{\parsearg\appendixsubseczzz} -\def\infoappendixsubsubsec{\parsearg\appendixsubsubseczzz} - -\def\infochapter{\parsearg\chapterzzz} -\def\infosection{\parsearg\sectionzzz} -\def\infosubsection{\parsearg\subsectionzzz} -\def\infosubsubsection{\parsearg\subsubsectionzzz} - % These macros control what the section commands do, according % to what kind of chapter we are in (ordinary, appendix, or unnumbered). % Define them by default for a numbered chapter. -\global\let\section = \numberedsec -\global\let\subsection = \numberedsubsec -\global\let\subsubsection = \numberedsubsubsec +\let\section = \numberedsec +\let\subsection = \numberedsubsec +\let\subsubsection = \numberedsubsubsec % Define @majorheading, @heading and @subheading @@ -3551,23 +4110,27 @@ width0pt\relax} \fi % if justification is not attempted. Hence \raggedright. -\def\majorheading{\parsearg\majorheadingzzz} -\def\majorheadingzzz #1{% -{\advance\chapheadingskip by 10pt \chapbreak }% -{\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000 - \parindent=0pt\raggedright - \rm #1\hfill}}\bigskip \par\penalty 200} +\def\majorheading{% + {\advance\chapheadingskip by 10pt \chapbreak }% + \parsearg\chapheadingzzz +} -\def\chapheading{\parsearg\chapheadingzzz} -\def\chapheadingzzz #1{\chapbreak % -{\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000 - \parindent=0pt\raggedright - \rm #1\hfill}}\bigskip \par\penalty 200} +\def\chapheading{\chapbreak \parsearg\chapheadingzzz} +\def\chapheadingzzz#1{% + {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000 + \parindent=0pt\raggedright + \rm #1\hfill}}% + \bigskip \par\penalty 200\relax + \suppressfirstparagraphindent +} % @heading, @subheading, @subsubheading. -\def\heading{\parsearg\plainsecheading} -\def\subheading{\parsearg\plainsubsecheading} -\def\subsubheading{\parsearg\plainsubsubsecheading} +\parseargdef\heading{\sectionheading{#1}{sec}{Yomitfromtoc}{} + \suppressfirstparagraphindent} +\parseargdef\subheading{\sectionheading{#1}{subsec}{Yomitfromtoc}{} + \suppressfirstparagraphindent} +\parseargdef\subsubheading{\sectionheading{#1}{subsubsec}{Yomitfromtoc}{} + \suppressfirstparagraphindent} % These macros generate a chapter, section, etc. heading only % (including whitespace, linebreaking, etc. around it), @@ -3576,8 +4139,6 @@ width0pt\relax} \fi %%% Args are the skip and penalty (usually negative) \def\dobreak#1#2{\par\ifdim\lastskip<#1\removelastskip\penalty#2\vskip#1\fi} -\def\setchapterstyle #1 {\csname CHAPF#1\endcsname} - %%% Define plain chapter starts, and page on/off switching for it % Parameter controlling skip before chapter headings (if needed) @@ -3600,7 +4161,7 @@ width0pt\relax} \fi \global\let\pagealignmacro=\chappager \global\def\HEADINGSon{\HEADINGSsingle}} -\def\CHAPPAGodd{ +\def\CHAPPAGodd{% \global\let\contentsalignmacro = \chapoddpage \global\let\pchapsepmacro=\chapoddpage \global\let\pagealignmacro=\chapoddpage @@ -3608,107 +4169,193 @@ width0pt\relax} \fi \CHAPPAGon -\def\CHAPFplain{ -\global\let\chapmacro=\chfplain -\global\let\unnumbchapmacro=\unnchfplain -\global\let\centerchapmacro=\centerchfplain} - -% Plain chapter opening. -% #1 is the text, #2 the chapter number or empty if unnumbered. -\def\chfplain#1#2{% +% Chapter opening. +% +% #1 is the text, #2 is the section type (Ynumbered, Ynothing, +% Yappendix, Yomitfromtoc), #3 the chapter number. +% +% To test against our argument. +\def\Ynothingkeyword{Ynothing} +\def\Yomitfromtockeyword{Yomitfromtoc} +\def\Yappendixkeyword{Yappendix} +% +\def\chapmacro#1#2#3{% \pchapsepmacro {% \chapfonts \rm - \def\chapnum{#2}% - \setbox0 = \hbox{#2\ifx\chapnum\empty\else\enspace\fi}% + % + % Have to define \thissection before calling \donoderef, because the + % xref code eventually uses it. On the other hand, it has to be called + % after \pchapsepmacro, or the headline will change too soon. + \gdef\thissection{#1}% + \gdef\thischaptername{#1}% + % + % Only insert the separating space if we have a chapter/appendix + % number, and don't print the unnumbered ``number''. + \def\temptype{#2}% + \ifx\temptype\Ynothingkeyword + \setbox0 = \hbox{}% + \def\toctype{unnchap}% + \def\thischapter{#1}% + \else\ifx\temptype\Yomitfromtockeyword + \setbox0 = \hbox{}% contents like unnumbered, but no toc entry + \def\toctype{omit}% + \xdef\thischapter{}% + \else\ifx\temptype\Yappendixkeyword + \setbox0 = \hbox{\putwordAppendix{} #3\enspace}% + \def\toctype{app}% + % We don't substitute the actual chapter name into \thischapter + % because we don't want its macros evaluated now. And we don't + % use \thissection because that changes with each section. + % + \xdef\thischapter{\putwordAppendix{} \appendixletter: + \noexpand\thischaptername}% + \else + \setbox0 = \hbox{#3\enspace}% + \def\toctype{numchap}% + \xdef\thischapter{\putwordChapter{} \the\chapno: + \noexpand\thischaptername}% + \fi\fi\fi + % + % Write the toc entry for this chapter. Must come before the + % \donoderef, because we include the current node name in the toc + % entry, and \donoderef resets it to empty. + \writetocentry{\toctype}{#1}{#3}% + % + % For pdftex, we have to write out the node definition (aka, make + % the pdfdest) after any page break, but before the actual text has + % been typeset. If the destination for the pdf outline is after the + % text, then jumping from the outline may wind up with the text not + % being visible, for instance under high magnification. + \donoderef{#2}% + % + % Typeset the actual heading. \vbox{\hyphenpenalty=10000 \tolerance=5000 \parindent=0pt \raggedright - \hangindent = \wd0 \centerparametersmaybe + \hangindent=\wd0 \centerparametersmaybe \unhbox0 #1\par}% }% \nobreak\bigskip % no page break after a chapter title \nobreak } -% Plain opening for unnumbered. -\def\unnchfplain#1{\chfplain{#1}{}} - % @centerchap -- centered and unnumbered. \let\centerparametersmaybe = \relax -\def\centerchfplain#1{{% - \def\centerparametersmaybe{% - \advance\rightskip by 3\rightskip - \leftskip = \rightskip - \parfillskip = 0pt - }% - \chfplain{#1}{}% -}} +\def\centerparameters{% + \advance\rightskip by 3\rightskip + \leftskip = \rightskip + \parfillskip = 0pt +} -\CHAPFplain % The default +% I don't think this chapter style is supported any more, so I'm not +% updating it with the new noderef stuff. We'll see. --karl, 11aug03. +% +\def\setchapterstyle #1 {\csname CHAPF#1\endcsname} +% \def\unnchfopen #1{% \chapoddpage {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000 \parindent=0pt\raggedright \rm #1\hfill}}\bigskip \par\nobreak } - \def\chfopen #1#2{\chapoddpage {\chapfonts \vbox to 3in{\vfil \hbox to\hsize{\hfil #2} \hbox to\hsize{\hfil #1} \vfil}}% \par\penalty 5000 % } - \def\centerchfopen #1{% \chapoddpage {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000 \parindent=0pt \hfill {\rm #1}\hfill}}\bigskip \par\nobreak } - -\def\CHAPFopen{ -\global\let\chapmacro=\chfopen -\global\let\unnumbchapmacro=\unnchfopen -\global\let\centerchapmacro=\centerchfopen} +\def\CHAPFopen{% + \global\let\chapmacro=\chfopen + \global\let\centerchapmacro=\centerchfopen} -% Section titles. +% Section titles. These macros combine the section number parts and +% call the generic \sectionheading to do the printing. +% \newskip\secheadingskip -\def\secheadingbreak{\dobreak \secheadingskip {-1000}} -\def\secheading#1#2#3{\sectionheading{sec}{#2.#3}{#1}} -\def\plainsecheading#1{\sectionheading{sec}{}{#1}} +\def\secheadingbreak{\dobreak \secheadingskip{-1000}} % Subsection titles. -\newskip \subsecheadingskip -\def\subsecheadingbreak{\dobreak \subsecheadingskip {-500}} -\def\subsecheading#1#2#3#4{\sectionheading{subsec}{#2.#3.#4}{#1}} -\def\plainsubsecheading#1{\sectionheading{subsec}{}{#1}} +\newskip\subsecheadingskip +\def\subsecheadingbreak{\dobreak \subsecheadingskip{-500}} % Subsubsection titles. -\let\subsubsecheadingskip = \subsecheadingskip -\let\subsubsecheadingbreak = \subsecheadingbreak -\def\subsubsecheading#1#2#3#4#5{\sectionheading{subsubsec}{#2.#3.#4.#5}{#1}} -\def\plainsubsubsecheading#1{\sectionheading{subsubsec}{}{#1}} +\def\subsubsecheadingskip{\subsecheadingskip} +\def\subsubsecheadingbreak{\subsecheadingbreak} -% Print any size section title. +% Print any size, any type, section title. % -% #1 is the section type (sec/subsec/subsubsec), #2 is the section -% number (maybe empty), #3 the text. -\def\sectionheading#1#2#3{% - {% - \expandafter\advance\csname #1headingskip\endcsname by \parskip - \csname #1headingbreak\endcsname - }% +% #1 is the text, #2 is the section level (sec/subsec/subsubsec), #3 is +% the section type for xrefs (Ynumbered, Ynothing, Yappendix), #4 is the +% section number. +% +\def\sectionheading#1#2#3#4{% {% % Switch to the right set of fonts. - \csname #1fonts\endcsname \rm + \csname #2fonts\endcsname \rm % - % Only insert the separating space if we have a section number. - \def\secnum{#2}% - \setbox0 = \hbox{#2\ifx\secnum\empty\else\enspace\fi}% + % Insert space above the heading. + \csname #2headingbreak\endcsname % + % Only insert the space after the number if we have a section number. + \def\sectionlevel{#2}% + \def\temptype{#3}% + % + \ifx\temptype\Ynothingkeyword + \setbox0 = \hbox{}% + \def\toctype{unn}% + \gdef\thissection{#1}% + \else\ifx\temptype\Yomitfromtockeyword + % for @headings -- no section number, don't include in toc, + % and don't redefine \thissection. + \setbox0 = \hbox{}% + \def\toctype{omit}% + \let\sectionlevel=\empty + \else\ifx\temptype\Yappendixkeyword + \setbox0 = \hbox{#4\enspace}% + \def\toctype{app}% + \gdef\thissection{#1}% + \else + \setbox0 = \hbox{#4\enspace}% + \def\toctype{num}% + \gdef\thissection{#1}% + \fi\fi\fi + % + % Write the toc entry (before \donoderef). See comments in \chfplain. + \writetocentry{\toctype\sectionlevel}{#1}{#4}% + % + % Write the node reference (= pdf destination for pdftex). + % Again, see comments in \chfplain. + \donoderef{#3}% + % + % Output the actual section heading. \vbox{\hyphenpenalty=10000 \tolerance=5000 \parindent=0pt \raggedright - \hangindent = \wd0 % zero if no section number - \unhbox0 #3}% + \hangindent=\wd0 % zero if no section number + \unhbox0 #1}% }% - \ifdim\parskip<10pt \nobreak\kern10pt\nobreak\kern-\parskip\fi \nobreak + % Add extra space after the heading -- half of whatever came above it. + % Don't allow stretch, though. + \kern .5 \csname #2headingskip\endcsname + % + % Do not let the kern be a potential breakpoint, as it would be if it + % was followed by glue. + \nobreak + % + % We'll almost certainly start a paragraph next, so don't let that + % glue accumulate. (Not a breakpoint because it's preceded by a + % discardable item.) + \vskip-\parskip + % + % This \nobreak is purely so the last item on the list is a \penalty + % of 10000. This is so other code, for instance \parsebodycommon, can + % check for and avoid allowing breakpoints. Otherwise, it would + % insert a valid breakpoint between: + % @section sec-whatever + % @deffn def-whatever + \nobreak } @@ -3717,157 +4364,199 @@ width0pt\relax} \fi \newwrite\tocfile % Write an entry to the toc file, opening it if necessary. -% Called from @chapter, etc. We supply {\folio} at the end of the -% argument, which will end up as the last argument to the \...entry macro. +% Called from @chapter, etc. % -% We open the .toc file here instead of at @setfilename or any other -% given time so that @contents can be put in the document anywhere. +% Example usage: \writetocentry{sec}{Section Name}{\the\chapno.\the\secno} +% We append the current node name (if any) and page number as additional +% arguments for the \{chap,sec,...}entry macros which will eventually +% read this. The node name is used in the pdf outlines as the +% destination to jump to. +% +% We open the .toc file for writing here instead of at @setfilename (or +% any other fixed time) so that @contents can be anywhere in the document. +% But if #1 is `omit', then we don't do anything. This is used for the +% table of contents chapter openings themselves. % \newif\iftocfileopened -\def\writetocentry#1{% - \iftocfileopened\else - \immediate\openout\tocfile = \jobname.toc - \global\tocfileopenedtrue +\def\omitkeyword{omit}% +% +\def\writetocentry#1#2#3{% + \edef\writetoctype{#1}% + \ifx\writetoctype\omitkeyword \else + \iftocfileopened\else + \immediate\openout\tocfile = \jobname.toc + \global\tocfileopenedtrue + \fi + % + \iflinks + \toks0 = {#2}% + \toks2 = \expandafter{\lastnode}% + \edef\temp{\write\tocfile{\realbackslash #1entry{\the\toks0}{#3}% + {\the\toks2}{\noexpand\folio}}}% + \temp + \fi \fi - \iflinks \write\tocfile{#1{\folio}}\fi + % + % Tell \shipout to create a pdf destination on each page, if we're + % writing pdf. These are used in the table of contents. We can't + % just write one on every page because the title pages are numbered + % 1 and 2 (the page numbers aren't printed), and so are the first + % two pages of the document. Thus, we'd have two destinations named + % `1', and two named `2'. + \ifpdf \global\pdfmakepagedesttrue \fi } \newskip\contentsrightmargin \contentsrightmargin=1in \newcount\savepageno \newcount\lastnegativepageno \lastnegativepageno = -1 -% Finish up the main text and prepare to read what we've written -% to \tocfile. +% Prepare to read what we've written to \tocfile. % \def\startcontents#1{% - % If @setchapternewpage on, and @headings double, the contents should - % start on an odd page, unlike chapters. Thus, we maintain - % \contentsalignmacro in parallel with \pagealignmacro. - % From: Torbjorn Granlund - \contentsalignmacro - \immediate\closeout\tocfile - % - % Don't need to put `Contents' or `Short Contents' in the headline. - % It is abundantly clear what they are. - \unnumbchapmacro{#1}\def\thischapter{}% - \savepageno = \pageno - \begingroup % Set up to handle contents files properly. - \catcode`\\=0 \catcode`\{=1 \catcode`\}=2 \catcode`\@=11 - % We can't do this, because then an actual ^ in a section - % title fails, e.g., @chapter ^ -- exponentiation. --karl, 9jul97. - %\catcode`\^=7 % to see ^^e4 as \"a etc. juha@piuha.ydi.vtt.fi - \raggedbottom % Worry more about breakpoints than the bottom. - \advance\hsize by -\contentsrightmargin % Don't use the full line length. - % - % Roman numerals for page numbers. - \ifnum \pageno>0 \pageno = \lastnegativepageno \fi + % If @setchapternewpage on, and @headings double, the contents should + % start on an odd page, unlike chapters. Thus, we maintain + % \contentsalignmacro in parallel with \pagealignmacro. + % From: Torbjorn Granlund + \contentsalignmacro + \immediate\closeout\tocfile + % + % Don't need to put `Contents' or `Short Contents' in the headline. + % It is abundantly clear what they are. + \def\thischapter{}% + \chapmacro{#1}{Yomitfromtoc}{}% + % + \savepageno = \pageno + \begingroup % Set up to handle contents files properly. + \catcode`\\=0 \catcode`\{=1 \catcode`\}=2 \catcode`\@=11 + % We can't do this, because then an actual ^ in a section + % title fails, e.g., @chapter ^ -- exponentiation. --karl, 9jul97. + %\catcode`\^=7 % to see ^^e4 as \"a etc. juha@piuha.ydi.vtt.fi + \raggedbottom % Worry more about breakpoints than the bottom. + \advance\hsize by -\contentsrightmargin % Don't use the full line length. + % + % Roman numerals for page numbers. + \ifnum \pageno>0 \global\pageno = \lastnegativepageno \fi } % Normal (long) toc. \def\contents{% - \startcontents{\putwordTOC}% - \openin 1 \jobname.toc - \ifeof 1 \else - \closein 1 - \input \jobname.toc - \fi - \vfill \eject - \contentsalignmacro % in case @setchapternewpage odd is in effect - \pdfmakeoutlines - \endgroup - \lastnegativepageno = \pageno - \pageno = \savepageno + \startcontents{\putwordTOC}% + \openin 1 \jobname.toc + \ifeof 1 \else + \input \jobname.toc + \fi + \vfill \eject + \contentsalignmacro % in case @setchapternewpage odd is in effect + \ifeof 1 \else + \pdfmakeoutlines + \fi + \closein 1 + \endgroup + \lastnegativepageno = \pageno + \global\pageno = \savepageno } % And just the chapters. \def\summarycontents{% - \startcontents{\putwordShortTOC}% - % - \let\chapentry = \shortchapentry - \let\unnumbchapentry = \shortunnumberedentry - % We want a true roman here for the page numbers. - \secfonts - \let\rm=\shortcontrm \let\bf=\shortcontbf \let\sl=\shortcontsl - \rm - \hyphenpenalty = 10000 - \advance\baselineskip by 1pt % Open it up a little. - \def\secentry ##1##2##3##4{} - \def\unnumbsecentry ##1##2{} - \def\subsecentry ##1##2##3##4##5{} - \def\unnumbsubsecentry ##1##2{} - \def\subsubsecentry ##1##2##3##4##5##6{} - \def\unnumbsubsubsecentry ##1##2{} - \openin 1 \jobname.toc - \ifeof 1 \else - \closein 1 - \input \jobname.toc - \fi - \vfill \eject - \contentsalignmacro % in case @setchapternewpage odd is in effect - \endgroup - \lastnegativepageno = \pageno - \pageno = \savepageno + \startcontents{\putwordShortTOC}% + % + \let\numchapentry = \shortchapentry + \let\appentry = \shortchapentry + \let\unnchapentry = \shortunnchapentry + % We want a true roman here for the page numbers. + \secfonts + \let\rm=\shortcontrm \let\bf=\shortcontbf + \let\sl=\shortcontsl \let\tt=\shortconttt + \rm + \hyphenpenalty = 10000 + \advance\baselineskip by 1pt % Open it up a little. + \def\numsecentry##1##2##3##4{} + \let\appsecentry = \numsecentry + \let\unnsecentry = \numsecentry + \let\numsubsecentry = \numsecentry + \let\appsubsecentry = \numsecentry + \let\unnsubsecentry = \numsecentry + \let\numsubsubsecentry = \numsecentry + \let\appsubsubsecentry = \numsecentry + \let\unnsubsubsecentry = \numsecentry + \openin 1 \jobname.toc + \ifeof 1 \else + \input \jobname.toc + \fi + \closein 1 + \vfill \eject + \contentsalignmacro % in case @setchapternewpage odd is in effect + \endgroup + \lastnegativepageno = \pageno + \global\pageno = \savepageno } \let\shortcontents = \summarycontents -\ifpdf - \pdfcatalog{/PageMode /UseOutlines}% -\fi +% Typeset the label for a chapter or appendix for the short contents. +% The arg is, e.g., `A' for an appendix, or `3' for a chapter. +% +\def\shortchaplabel#1{% + % This space should be enough, since a single number is .5em, and the + % widest letter (M) is 1em, at least in the Computer Modern fonts. + % But use \hss just in case. + % (This space doesn't include the extra space that gets added after + % the label; that gets put in by \shortchapentry above.) + % + % We'd like to right-justify chapter numbers, but that looks strange + % with appendix letters. And right-justifying numbers and + % left-justifying letters looks strange when there is less than 10 + % chapters. Have to read the whole toc once to know how many chapters + % there are before deciding ... + \hbox to 1em{#1\hss}% +} % These macros generate individual entries in the table of contents. % The first argument is the chapter or section name. % The last argument is the page number. % The arguments in between are the chapter number, section number, ... -% Chapter-level things, for both the long and short contents. -\def\chapentry#1#2#3{\dochapentry{#2\labelspace#1}{#3}} - -% See comments in \dochapentry re vbox and related settings -\def\shortchapentry#1#2#3{% - \tocentry{\shortchaplabel{#2}\labelspace #1}{\doshortpageno\bgroup#3\egroup}% +% Chapters, in the main contents. +\def\numchapentry#1#2#3#4{\dochapentry{#2\labelspace#1}{#4}} +% +% Chapters, in the short toc. +% See comments in \dochapentry re vbox and related settings. +\def\shortchapentry#1#2#3#4{% + \tocentry{\shortchaplabel{#2}\labelspace #1}{\doshortpageno\bgroup#4\egroup}% } -% Typeset the label for a chapter or appendix for the short contents. -% The arg is, e.g. `Appendix A' for an appendix, or `3' for a chapter. -% We could simplify the code here by writing out an \appendixentry -% command in the toc file for appendices, instead of using \chapentry -% for both, but it doesn't seem worth it. -\setbox0 = \hbox{\shortcontrm \putwordAppendix } -\newdimen\shortappendixwidth \shortappendixwidth = \wd0 +% Appendices, in the main contents. +% Need the word Appendix, and a fixed-size box. +% +\def\appendixbox#1{% + % We use M since it's probably the widest letter. + \setbox0 = \hbox{\putwordAppendix{} M}% + \hbox to \wd0{\putwordAppendix{} #1\hss}} +% +\def\appentry#1#2#3#4{\dochapentry{\appendixbox{#2}\labelspace#1}{#4}} -\def\shortchaplabel#1{% - % We typeset #1 in a box of constant width, regardless of the text of - % #1, so the chapter titles will come out aligned. - \setbox0 = \hbox{#1}% - \dimen0 = \ifdim\wd0 > \shortappendixwidth \shortappendixwidth \else 0pt \fi - % - % This space should be plenty, since a single number is .5em, and the - % widest letter (M) is 1em, at least in the Computer Modern fonts. - % (This space doesn't include the extra space that gets added after - % the label; that gets put in by \shortchapentry above.) - \advance\dimen0 by 1.1em - \hbox to \dimen0{#1\hfil}% -} - -\def\unnumbchapentry#1#2{\dochapentry{#1}{#2}} -\def\shortunnumberedentry#1#2{\tocentry{#1}{\doshortpageno\bgroup#2\egroup}} +% Unnumbered chapters. +\def\unnchapentry#1#2#3#4{\dochapentry{#1}{#4}} +\def\shortunnchapentry#1#2#3#4{\tocentry{#1}{\doshortpageno\bgroup#4\egroup}} % Sections. -\def\secentry#1#2#3#4{\dosecentry{#2.#3\labelspace#1}{#4}} -\def\unnumbsecentry#1#2{\dosecentry{#1}{#2}} +\def\numsecentry#1#2#3#4{\dosecentry{#2\labelspace#1}{#4}} +\let\appsecentry=\numsecentry +\def\unnsecentry#1#2#3#4{\dosecentry{#1}{#4}} % Subsections. -\def\subsecentry#1#2#3#4#5{\dosubsecentry{#2.#3.#4\labelspace#1}{#5}} -\def\unnumbsubsecentry#1#2{\dosubsecentry{#1}{#2}} +\def\numsubsecentry#1#2#3#4{\dosubsecentry{#2\labelspace#1}{#4}} +\let\appsubsecentry=\numsubsecentry +\def\unnsubsecentry#1#2#3#4{\dosubsecentry{#1}{#4}} % And subsubsections. -\def\subsubsecentry#1#2#3#4#5#6{% - \dosubsubsecentry{#2.#3.#4.#5\labelspace#1}{#6}} -\def\unnumbsubsubsecentry#1#2{\dosubsubsecentry{#1}{#2}} +\def\numsubsubsecentry#1#2#3#4{\dosubsubsecentry{#2\labelspace#1}{#4}} +\let\appsubsubsecentry=\numsubsubsecentry +\def\unnsubsubsecentry#1#2#3#4{\dosubsubsecentry{#1}{#4}} % This parameter controls the indentation of the various levels. -\newdimen\tocindent \tocindent = 3pc +% Same as \defaultparindent. +\newdimen\tocindent \tocindent = 15pt % Now for the actual typesetting. In all these, #1 is the text and #2 is the % page number. @@ -3898,17 +4587,8 @@ width0pt\relax} \fi \tocentry{#1}{\dopageno\bgroup#2\egroup}% \endgroup} -% Final typesetting of a toc entry; we use the same \entry macro as for -% the index entries, but we want to suppress hyphenation here. (We -% can't do that in the \entry macro, since index entries might consist -% of hyphenated-identifiers-that-do-not-fit-on-a-line-and-nothing-else.) -\def\tocentry#1#2{\begingroup - \vskip 0pt plus1pt % allow a little stretch for the sake of nice page breaks - % Do not use \turnoffactive in these arguments. Since the toc is - % typeset in cmr, so characters such as _ would come out wrong; we - % have to do the usual translation tricks. - \entry{#1}{#2}% -\endgroup} +% We use the same \entry macro as for the index entries. +\let\tocentry = \entry % Space between chapter (or whatever) number and the title. \def\labelspace{\hskip1em \relax} @@ -3918,72 +4598,61 @@ width0pt\relax} \fi \def\chapentryfonts{\secfonts \rm} \def\secentryfonts{\textfonts} -\let\subsecentryfonts = \textfonts -\let\subsubsecentryfonts = \textfonts +\def\subsecentryfonts{\textfonts} +\def\subsubsecentryfonts{\textfonts} \message{environments,} % @foo ... @end foo. +% @point{}, @result{}, @expansion{}, @print{}, @equiv{}. +% % Since these characters are used in examples, it should be an even number of % \tt widths. Each \tt character is 1en, so two makes it 1em. -% Furthermore, these definitions must come after we define our fonts. -\newbox\dblarrowbox \newbox\longdblarrowbox -\newbox\pushcharbox \newbox\bullbox -\newbox\equivbox \newbox\errorbox - -%{\tentt -%\global\setbox\dblarrowbox = \hbox to 1em{\hfil$\Rightarrow$\hfil} -%\global\setbox\longdblarrowbox = \hbox to 1em{\hfil$\mapsto$\hfil} -%\global\setbox\pushcharbox = \hbox to 1em{\hfil$\dashv$\hfil} -%\global\setbox\equivbox = \hbox to 1em{\hfil$\ptexequiv$\hfil} -% Adapted from the manmac format (p.420 of TeXbook) -%\global\setbox\bullbox = \hbox to 1em{\kern.15em\vrule height .75ex width .85ex -% depth .1ex\hfil} -%} - -% @point{}, @result{}, @expansion{}, @print{}, @equiv{}. +% \def\point{$\star$} \def\result{\leavevmode\raise.15ex\hbox to 1em{\hfil$\Rightarrow$\hfil}} \def\expansion{\leavevmode\raise.1ex\hbox to 1em{\hfil$\mapsto$\hfil}} \def\print{\leavevmode\lower.1ex\hbox to 1em{\hfil$\dashv$\hfil}} \def\equiv{\leavevmode\lower.1ex\hbox to 1em{\hfil$\ptexequiv$\hfil}} +% The @error{} command. % Adapted from the TeXbook's \boxit. +% +\newbox\errorbox +% {\tentt \global\dimen0 = 3em}% Width of the box. \dimen2 = .55pt % Thickness of rules % The text. (`r' is open on the right, `e' somewhat less so on the left.) \setbox0 = \hbox{\kern-.75pt \tensf error\kern-1.5pt} - -\global\setbox\errorbox=\hbox to \dimen0{\hfil +% +\setbox\errorbox=\hbox to \dimen0{\hfil \hsize = \dimen0 \advance\hsize by -5.8pt % Space to left+right. \advance\hsize by -2\dimen2 % Rules. - \vbox{ + \vbox{% \hrule height\dimen2 \hbox{\vrule width\dimen2 \kern3pt % Space to left of text. \vtop{\kern2.4pt \box0 \kern2.4pt}% Space above/below. \kern3pt\vrule width\dimen2}% Space to right. \hrule height\dimen2} \hfil} - -% The @error{} command. +% \def\error{\leavevmode\lower.7ex\copy\errorbox} % @tex ... @end tex escapes into raw Tex temporarily. % One exception: @ is still an escape character, so that @end tex works. % But \@ or @@ will get a plain tex @ character. -\def\tex{\begingroup +\envdef\tex{% \catcode `\\=0 \catcode `\{=1 \catcode `\}=2 \catcode `\$=3 \catcode `\&=4 \catcode `\#=6 - \catcode `\^=7 \catcode `\_=8 \catcode `\~=13 \let~=\tie + \catcode `\^=7 \catcode `\_=8 \catcode `\~=\active \let~=\tie \catcode `\%=14 - \catcode 43=12 % plus - \catcode`\"=12 - \catcode`\==12 - \catcode`\|=12 - \catcode`\<=12 - \catcode`\>=12 + \catcode `\+=\other + \catcode `\"=\other + \catcode `\|=\other + \catcode `\<=\other + \catcode `\>=\other \escapechar=`\\ % \let\b=\ptexb @@ -3995,20 +4664,24 @@ width0pt\relax} \fi \let\equiv=\ptexequiv \let\!=\ptexexclam \let\i=\ptexi + \let\indent=\ptexindent + \let\noindent=\ptexnoindent \let\{=\ptexlbrace \let\+=\tabalign \let\}=\ptexrbrace + \let\/=\ptexslash \let\*=\ptexstar \let\t=\ptext % \def\endldots{\mathinner{\ldots\ldots\ldots\ldots}}% \def\enddots{\relax\ifmmode\endldots\else$\mathsurround=0pt \endldots\,$\fi}% \def\@{@}% -\let\Etex=\endgroup} +} +% There is no need to define \Etex. -% Define @lisp ... @endlisp. -% @lisp does a \begingroup so it can rebind things, -% including the definition of @endlisp (which normally is erroneous). +% Define @lisp ... @end lisp. +% @lisp environment forms a group so it can rebind things, +% including the definition of @end lisp (which normally is erroneous). % Amount to narrow the margins by for @lisp. \newskip\lispnarrowing \lispnarrowing=0.4in @@ -4018,30 +4691,28 @@ width0pt\relax} \fi % have any width. \def\lisppar{\null\endgraf} -% Make each space character in the input produce a normal interword -% space in the output. Don't allow a line break at this space, as this -% is used only in environments like @example, where each line of input -% should produce a line of output anyway. -% -{\obeyspaces % -\gdef\sepspaces{\obeyspaces\let =\tie}} - -% Define \obeyedspace to be our active space, whatever it is. This is -% for use in \parsearg. -{\sepspaces% -\global\let\obeyedspace= } - % This space is always present above and below environments. \newskip\envskipamount \envskipamount = 0pt % Make spacing and below environment symmetrical. We use \parskip here % to help in doing that, since in @example-like environments \parskip % is reset to zero; thus the \afterenvbreak inserts no space -- but the -% start of the next paragraph will insert \parskip +% start of the next paragraph will insert \parskip. % -\def\aboveenvbreak{{\advance\envskipamount by \parskip -\endgraf \ifdim\lastskip<\envskipamount -\removelastskip \penalty-50 \vskip\envskipamount \fi}} +\def\aboveenvbreak{{% + % =10000 instead of <10000 because of a special case in \itemzzz, q.v. + \ifnum \lastpenalty=10000 \else + \advance\envskipamount by \parskip + \endgraf + \ifdim\lastskip<\envskipamount + \removelastskip + % it's not a good place to break if the last penalty was \nobreak + % or better ... + \ifnum\lastpenalty<10000 \penalty-50 \fi + \vskip\envskipamount + \fi + \fi +}} \let\afterenvbreak = \aboveenvbreak @@ -4069,54 +4740,54 @@ width0pt\relax} \fi % \newskip\lskip\newskip\rskip -\long\def\cartouche{% -\begingroup - \lskip=\leftskip \rskip=\rightskip - \leftskip=0pt\rightskip=0pt %we want these *outside*. - \cartinner=\hsize \advance\cartinner by-\lskip - \advance\cartinner by-\rskip - \cartouter=\hsize - \advance\cartouter by 18.4pt % allow for 3pt kerns on either -% side, and for 6pt waste from -% each corner char, and rule thickness - \normbskip=\baselineskip \normpskip=\parskip \normlskip=\lineskip - % Flag to tell @lisp, etc., not to narrow margin. - \let\nonarrowing=\comment - \vbox\bgroup - \baselineskip=0pt\parskip=0pt\lineskip=0pt - \carttop - \hbox\bgroup - \hskip\lskip - \vrule\kern3pt - \vbox\bgroup - \hsize=\cartinner - \kern3pt - \begingroup - \baselineskip=\normbskip - \lineskip=\normlskip - \parskip=\normpskip - \vskip -\parskip +\envdef\cartouche{% + \ifhmode\par\fi % can't be in the midst of a paragraph. + \startsavinginserts + \lskip=\leftskip \rskip=\rightskip + \leftskip=0pt\rightskip=0pt % we want these *outside*. + \cartinner=\hsize \advance\cartinner by-\lskip + \advance\cartinner by-\rskip + \cartouter=\hsize + \advance\cartouter by 18.4pt % allow for 3pt kerns on either + % side, and for 6pt waste from + % each corner char, and rule thickness + \normbskip=\baselineskip \normpskip=\parskip \normlskip=\lineskip + % Flag to tell @lisp, etc., not to narrow margin. + \let\nonarrowing=\comment + \vbox\bgroup + \baselineskip=0pt\parskip=0pt\lineskip=0pt + \carttop + \hbox\bgroup + \hskip\lskip + \vrule\kern3pt + \vbox\bgroup + \kern3pt + \hsize=\cartinner + \baselineskip=\normbskip + \lineskip=\normlskip + \parskip=\normpskip + \vskip -\parskip + \comment % For explanation, see the end of \def\group. +} \def\Ecartouche{% - \endgroup - \kern3pt - \egroup - \kern3pt\vrule - \hskip\rskip - \egroup - \cartbot - \egroup -\endgroup -}} + \ifhmode\par\fi + \kern3pt + \egroup + \kern3pt\vrule + \hskip\rskip + \egroup + \cartbot + \egroup + \checkinserts +} % This macro is called at the beginning of all the @example variants, % inside a group. \def\nonfillstart{% \aboveenvbreak - \inENV % This group ends at the end of the body \hfuzz = 12pt % Don't be fussy \sepspaces % Make spaces be word-separators rather than space tokens. - \singlespace \let\par = \lisppar % don't ignore blank lines \obeylines % each line of input is a line of output \parskip = 0pt @@ -4127,114 +4798,99 @@ width0pt\relax} \fi \ifx\nonarrowing\relax \advance \leftskip by \lispnarrowing \exdentamount=\lispnarrowing - \let\exdent=\nofillexdent - \let\nonarrowing=\relax + \fi + \let\exdent=\nofillexdent +} + +% If you want all examples etc. small: @set dispenvsize small. +% If you want even small examples the full size: @set dispenvsize nosmall. +% This affects the following displayed environments: +% @example, @display, @format, @lisp +% +\def\smallword{small} +\def\nosmallword{nosmall} +\let\SETdispenvsize\relax +\def\setnormaldispenv{% + \ifx\SETdispenvsize\smallword + \smallexamplefonts \rm + \fi +} +\def\setsmalldispenv{% + \ifx\SETdispenvsize\nosmallword + \else + \smallexamplefonts \rm \fi } -% Define the \E... control sequence only if we are inside the particular -% environment, so the error checking in \end will work. -% -% To end an @example-like environment, we first end the paragraph (via -% \afterenvbreak's vertical glue), and then the group. That way we keep -% the zero \parskip that the environments set -- \parskip glue will be -% inserted at the beginning of the next paragraph in the document, after -% the environment. -% -\def\nonfillfinish{\afterenvbreak\endgroup} +% We often define two environments, @foo and @smallfoo. +% Let's do it by one command: +\def\makedispenv #1#2{ + \expandafter\envdef\csname#1\endcsname {\setnormaldispenv #2} + \expandafter\envdef\csname small#1\endcsname {\setsmalldispenv #2} + \expandafter\let\csname E#1\endcsname \afterenvbreak + \expandafter\let\csname Esmall#1\endcsname \afterenvbreak +} -% @lisp: indented, narrowed, typewriter font. -\def\lisp{\begingroup +% Define two synonyms: +\def\maketwodispenvs #1#2#3{ + \makedispenv{#1}{#3} + \makedispenv{#2}{#3} +} + +% @lisp: indented, narrowed, typewriter font; @example: same as @lisp. +% +% @smallexample and @smalllisp: use smaller fonts. +% Originally contributed by Pavel@xerox. +% +\maketwodispenvs {lisp}{example}{% \nonfillstart - \let\Elisp = \nonfillfinish \tt \let\kbdfont = \kbdexamplefont % Allow @kbd to do something special. \gobble % eat return } -% @example: Same as @lisp. -\def\example{\begingroup \def\Eexample{\nonfillfinish\endgroup}\lisp} - -% @small... is usually equivalent to the non-small (@smallbook -% redefines). We must call \example (or whatever) last in the -% definition, since it reads the return following the @example (or -% whatever) command. +% @display/@smalldisplay: same as @lisp except keep current font. % -% This actually allows (for example) @end display inside an -% @smalldisplay. Too bad, but makeinfo will catch the error anyway. -% -\def\smalldisplay{\begingroup\def\Esmalldisplay{\nonfillfinish\endgroup}\display} -\def\smallexample{\begingroup\def\Esmallexample{\nonfillfinish\endgroup}\lisp} -\def\smallformat{\begingroup\def\Esmallformat{\nonfillfinish\endgroup}\format} -\def\smalllisp{\begingroup\def\Esmalllisp{\nonfillfinish\endgroup}\lisp} - -% Real @smallexample and @smalllisp (when @smallbook): use smaller fonts. -% Originally contributed by Pavel@xerox. -\def\smalllispx{\begingroup - \def\Esmalllisp{\nonfillfinish\endgroup}% - \def\Esmallexample{\nonfillfinish\endgroup}% - \indexfonts - \lisp -} - -% @display: same as @lisp except keep current font. -% -\def\display{\begingroup +\makedispenv {display}{% \nonfillstart - \let\Edisplay = \nonfillfinish \gobble } -% @smalldisplay (when @smallbook): @display plus smaller fonts. +% @format/@smallformat: same as @display except don't narrow margins. % -\def\smalldisplayx{\begingroup - \def\Esmalldisplay{\nonfillfinish\endgroup}% - \indexfonts \rm - \display -} - -% @format: same as @display except don't narrow margins. -% -\def\format{\begingroup - \let\nonarrowing = t +\makedispenv{format}{% + \let\nonarrowing = t% \nonfillstart - \let\Eformat = \nonfillfinish \gobble } -% @smallformat (when @smallbook): @format plus smaller fonts. -% -\def\smallformatx{\begingroup - \def\Esmallformat{\nonfillfinish\endgroup}% - \indexfonts \rm - \format +% @flushleft: same as @format, but doesn't obey \SETdispenvsize. +\envdef\flushleft{% + \let\nonarrowing = t% + \nonfillstart + \gobble } - -% @flushleft (same as @format). -% -\def\flushleft{\begingroup \def\Eflushleft{\nonfillfinish\endgroup}\format} +\let\Eflushleft = \afterenvbreak % @flushright. % -\def\flushright{\begingroup - \let\nonarrowing = t +\envdef\flushright{% + \let\nonarrowing = t% \nonfillstart - \let\Eflushright = \nonfillfinish \advance\leftskip by 0pt plus 1fill \gobble } +\let\Eflushright = \afterenvbreak + % @quotation does normal linebreaking (hence we can't use \nonfillstart) -% and narrows the margins. +% and narrows the margins. We keep \parskip nonzero in general, since +% we're doing normal filling. So, when using \aboveenvbreak and +% \afterenvbreak, temporarily make \parskip 0. % -\def\quotation{% - \begingroup\inENV %This group ends at the end of the @quotation body +\envdef\quotation{% {\parskip=0pt \aboveenvbreak}% because \aboveenvbreak inserts \parskip - \singlespace \parindent=0pt - % We have retained a nonzero parskip for the environment, since we're - % doing normal filling. So to avoid extra space below the environment... - \def\Equotation{\parskip = 0pt \nonfillfinish}% % % @cartouche defines \nonarrowing to inhibit narrowing at next level down. \ifx\nonarrowing\relax @@ -4243,565 +4899,569 @@ width0pt\relax} \fi \exdentamount = \lispnarrowing \let\nonarrowing = \relax \fi + \parsearg\quotationlabel } +% We have retained a nonzero parskip for the environment, since we're +% doing normal filling. +% +\def\Equotation{% + \par + \ifx\quotationauthor\undefined\else + % indent a bit. + \leftline{\kern 2\leftskip \sl ---\quotationauthor}% + \fi + {\parskip=0pt \afterenvbreak}% +} + +% If we're given an argument, typeset it in bold with a colon after. +\def\quotationlabel#1{% + \def\temp{#1}% + \ifx\temp\empty \else + {\bf #1: }% + \fi +} + + +% LaTeX-like @verbatim...@end verbatim and @verb{...} +% If we want to allow any as delimiter, +% we need the curly braces so that makeinfo sees the @verb command, eg: +% `@verbx...x' would look like the '@verbx' command. --janneke@gnu.org +% +% [Knuth]: Donald Ervin Knuth, 1996. The TeXbook. +% +% [Knuth] p.344; only we need to do the other characters Texinfo sets +% active too. Otherwise, they get lost as the first character on a +% verbatim line. +\def\dospecials{% + \do\ \do\\\do\{\do\}\do\$\do\&% + \do\#\do\^\do\^^K\do\_\do\^^A\do\%\do\~% + \do\<\do\>\do\|\do\@\do+\do\"% +} +% +% [Knuth] p. 380 +\def\uncatcodespecials{% + \def\do##1{\catcode`##1=\other}\dospecials} +% +% [Knuth] pp. 380,381,391 +% Disable Spanish ligatures ?` and !` of \tt font +\begingroup + \catcode`\`=\active\gdef`{\relax\lq} +\endgroup +% +% Setup for the @verb command. +% +% Eight spaces for a tab +\begingroup + \catcode`\^^I=\active + \gdef\tabeightspaces{\catcode`\^^I=\active\def^^I{\ \ \ \ \ \ \ \ }} +\endgroup +% +\def\setupverb{% + \tt % easiest (and conventionally used) font for verbatim + \def\par{\leavevmode\endgraf}% + \catcode`\`=\active + \tabeightspaces + % Respect line breaks, + % print special symbols as themselves, and + % make each space count + % must do in this order: + \obeylines \uncatcodespecials \sepspaces +} + +% Setup for the @verbatim environment +% +% Real tab expansion +\newdimen\tabw \setbox0=\hbox{\tt\space} \tabw=8\wd0 % tab amount +% +\def\starttabbox{\setbox0=\hbox\bgroup} +\begingroup + \catcode`\^^I=\active + \gdef\tabexpand{% + \catcode`\^^I=\active + \def^^I{\leavevmode\egroup + \dimen0=\wd0 % the width so far, or since the previous tab + \divide\dimen0 by\tabw + \multiply\dimen0 by\tabw % compute previous multiple of \tabw + \advance\dimen0 by\tabw % advance to next multiple of \tabw + \wd0=\dimen0 \box0 \starttabbox + }% + } +\endgroup +\def\setupverbatim{% + \nonfillstart + \advance\leftskip by -\defbodyindent + % Easiest (and conventionally used) font for verbatim + \tt + \def\par{\leavevmode\egroup\box0\endgraf}% + \catcode`\`=\active + \tabexpand + % Respect line breaks, + % print special symbols as themselves, and + % make each space count + % must do in this order: + \obeylines \uncatcodespecials \sepspaces + \everypar{\starttabbox}% +} + +% Do the @verb magic: verbatim text is quoted by unique +% delimiter characters. Before first delimiter expect a +% right brace, after last delimiter expect closing brace: +% +% \def\doverb'{'#1'}'{#1} +% +% [Knuth] p. 382; only eat outer {} +\begingroup + \catcode`[=1\catcode`]=2\catcode`\{=\other\catcode`\}=\other + \gdef\doverb{#1[\def\next##1#1}[##1\endgroup]\next] +\endgroup +% +\def\verb{\begingroup\setupverb\doverb} +% +% +% Do the @verbatim magic: define the macro \doverbatim so that +% the (first) argument ends when '@end verbatim' is reached, ie: +% +% \def\doverbatim#1@end verbatim{#1} +% +% For Texinfo it's a lot easier than for LaTeX, +% because texinfo's \verbatim doesn't stop at '\end{verbatim}': +% we need not redefine '\', '{' and '}'. +% +% Inspired by LaTeX's verbatim command set [latex.ltx] +% +\begingroup + \catcode`\ =\active + \obeylines % + % ignore everything up to the first ^^M, that's the newline at the end + % of the @verbatim input line itself. Otherwise we get an extra blank + % line in the output. + \xdef\doverbatim#1^^M#2@end verbatim{#2\noexpand\end\gobble verbatim}% + % We really want {...\end verbatim} in the body of the macro, but + % without the active space; thus we have to use \xdef and \gobble. +\endgroup +% +\envdef\verbatim{% + \setupverbatim\doverbatim +} +\let\Everbatim = \afterenvbreak + + +% @verbatiminclude FILE - insert text of file in verbatim environment. +% +\def\verbatiminclude{\parseargusing\filenamecatcodes\doverbatiminclude} +% +\def\doverbatiminclude#1{% + {% + \makevalueexpandable + \setupverbatim + \input #1 + \afterenvbreak + }% +} + +% @copying ... @end copying. +% Save the text away for @insertcopying later. Many commands won't be +% allowed in this context, but that's ok. +% +% We save the uninterpreted tokens, rather than creating a box. +% Saving the text in a box would be much easier, but then all the +% typesetting commands (@smallbook, font changes, etc.) have to be done +% beforehand -- and a) we want @copying to be done first in the source +% file; b) letting users define the frontmatter in as flexible order as +% possible is very desirable. +% +\def\copying{\begingroup + % Define a command to swallow text until we reach `@end copying'. + % \ is the escape char in this texinfo.tex file, so it is the + % delimiter for the command; @ will be the escape char when we read + % it, but that doesn't matter. + \long\def\docopying##1\end copying{\gdef\copyingtext{##1}\enddocopying}% + % + % We must preserve ^^M's in the input file; see \insertcopying below. + \catcode`\^^M = \active + \docopying +} + +% What we do to finish off the copying text. +% +\def\enddocopying{\endgroup\ignorespaces} + +% @insertcopying. Here we must play games with ^^M's. On the one hand, +% we need them to delimit commands such as `@end quotation', so they +% must be active. On the other hand, we certainly don't want every +% end-of-line to be a \par, as would happen with the normal active +% definition of ^^M. On the third hand, two ^^M's in a row should still +% generate a \par. +% +% Our approach is to make ^^M insert a space and a penalty1 normally; +% then it can also check if \lastpenalty=1. If it does, then manually +% do \par. +% +% This messes up the normal definitions of @c[omment], so we redefine +% it. Similarly for @ignore. (These commands are used in the gcc +% manual for man page generation.) +% +% Seems pretty fragile, most line-oriented commands will presumably +% fail, but for the limited use of getting the copying text (which +% should be quite simple) inserted, we can hope it's ok. +% +{\catcode`\^^M=\active % +\gdef\insertcopying{\begingroup % + \parindent = 0pt % looks wrong on title page + \def^^M{% + \ifnum \lastpenalty=1 % + \par % + \else % + \space \penalty 1 % + \fi % + }% + % + % Fix @c[omment] for catcode 13 ^^M's. + \def\c##1^^M{\ignorespaces}% + \let\comment = \c % + % + % Don't bother jumping through all the hoops that \doignore does, it + % would be very hard since the catcodes are already set. + \long\def\ignore##1\end ignore{\ignorespaces}% + % + \copyingtext % +\endgroup}% +} \message{defuns,} % @defun etc. -% Allow user to change definition object font (\df) internally -\def\setdeffont #1 {\csname DEF#1\endcsname} - \newskip\defbodyindent \defbodyindent=.4in \newskip\defargsindent \defargsindent=50pt -\newskip\deftypemargin \deftypemargin=12pt \newskip\deflastargmargin \deflastargmargin=18pt -\newcount\parencount -% define \functionparens, which makes ( and ) and & do special things. -% \functionparens affects the group it is contained in. +% Start the processing of @deffn: +\def\startdefun{% + \ifnum\lastpenalty<10000 + \medbreak + \else + % If there are two @def commands in a row, we'll have a \nobreak, + % which is there to keep the function description together with its + % header. But if there's nothing but headers, we need to allow a + % break somewhere. Check for penalty 10002 (inserted by + % \defargscommonending) instead of 10000, since the sectioning + % commands insert a \penalty10000, and we don't want to allow a break + % between a section heading and a defun. + \ifnum\lastpenalty=10002 \penalty2000 \fi + % + % Similarly, after a section heading, do not allow a break. + % But do insert the glue. + \medskip % preceded by discardable penalty, so not a breakpoint + \fi + % + \parindent=0in + \advance\leftskip by \defbodyindent + \exdentamount=\defbodyindent +} + +\def\dodefunx#1{% + % First, check whether we are in the right environment: + \checkenv#1% + % + % As above, allow line break if we have multiple x headers in a row. + % It's not a great place, though. + \ifnum\lastpenalty=10002 \penalty3000 \fi + % + % And now, it's time to reuse the body of the original defun: + \expandafter\gobbledefun#1% +} +\def\gobbledefun#1\startdefun{} + +% \printdefunline \deffnheader{text} +% +\def\printdefunline#1#2{% + \begingroup + % call \deffnheader: + #1#2 \endheader + % common ending: + \interlinepenalty = 10000 + \advance\rightskip by 0pt plus 1fil + \endgraf + \nobreak\vskip -\parskip + \penalty 10002 % signal to \startdefun and \dodefunx + % Some of the @defun-type tags do not enable magic parentheses, + % rendering the following check redundant. But we don't optimize. + \checkparencounts + \endgroup +} + +\def\Edefun{\endgraf\medbreak} + +% \makedefun{deffn} creates \deffn, \deffnx and \Edeffn; +% the only thing remainnig is to define \deffnheader. +% +\def\makedefun#1{% + \expandafter\let\csname E#1\endcsname = \Edefun + \edef\temp{\noexpand\domakedefun + \makecsname{#1}\makecsname{#1x}\makecsname{#1header}}% + \temp +} + +% \domakedefun \deffn \deffnx \deffnheader +% +% Define \deffn and \deffnx, without parameters. +% \deffnheader has to be defined explicitly. +% +\def\domakedefun#1#2#3{% + \envdef#1{% + \startdefun + \parseargusing\activeparens{\printdefunline#3}% + }% + \def#2{\dodefunx#1}% + \def#3% +} + +%%% Untyped functions: + +% @deffn category name args +\makedefun{deffn}{\deffngeneral{}} + +% @deffn category class name args +\makedefun{defop}#1 {\defopon{#1\ \putwordon}} + +% \defopon {category on}class name args +\def\defopon#1#2 {\deffngeneral{\putwordon\ \code{#2}}{#1\ \code{#2}} } + +% \deffngeneral {subind}category name args +% +\def\deffngeneral#1#2 #3 #4\endheader{% + % Remember that \dosubind{fn}{foo}{} is equivalent to \doind{fn}{foo}. + \dosubind{fn}{\code{#3}}{#1}% + \defname{#2}{}{#3}\magicamp\defunargs{#4\unskip}% +} + +%%% Typed functions: + +% @deftypefn category type name args +\makedefun{deftypefn}{\deftypefngeneral{}} + +% @deftypeop category class type name args +\makedefun{deftypeop}#1 {\deftypeopon{#1\ \putwordon}} + +% \deftypeopon {category on}class type name args +\def\deftypeopon#1#2 {\deftypefngeneral{\putwordon\ \code{#2}}{#1\ \code{#2}} } + +% \deftypefngeneral {subind}category type name args +% +\def\deftypefngeneral#1#2 #3 #4 #5\endheader{% + \dosubind{fn}{\code{#4}}{#1}% + \defname{#2}{#3}{#4}\defunargs{#5\unskip}% +} + +%%% Typed variables: + +% @deftypevr category type var args +\makedefun{deftypevr}{\deftypecvgeneral{}} + +% @deftypecv category class type var args +\makedefun{deftypecv}#1 {\deftypecvof{#1\ \putwordof}} + +% \deftypecvof {category of}class type var args +\def\deftypecvof#1#2 {\deftypecvgeneral{\putwordof\ \code{#2}}{#1\ \code{#2}} } + +% \deftypecvgeneral {subind}category type var args +% +\def\deftypecvgeneral#1#2 #3 #4 #5\endheader{% + \dosubind{vr}{\code{#4}}{#1}% + \defname{#2}{#3}{#4}\defunargs{#5\unskip}% +} + +%%% Untyped variables: + +% @defvr category var args +\makedefun{defvr}#1 {\deftypevrheader{#1} {} } + +% @defcv category class var args +\makedefun{defcv}#1 {\defcvof{#1\ \putwordof}} + +% \defcvof {category of}class var args +\def\defcvof#1#2 {\deftypecvof{#1}#2 {} } + +%%% Type: +% @deftp category name args +\makedefun{deftp}#1 #2 #3\endheader{% + \doind{tp}{\code{#2}}% + \defname{#1}{}{#2}\defunargs{#3\unskip}% +} + +% Remaining @defun-like shortcuts: +\makedefun{defun}{\deffnheader{\putwordDeffunc} } +\makedefun{defmac}{\deffnheader{\putwordDefmac} } +\makedefun{defspec}{\deffnheader{\putwordDefspec} } +\makedefun{deftypefun}{\deftypefnheader{\putwordDeffunc} } +\makedefun{defvar}{\defvrheader{\putwordDefvar} } +\makedefun{defopt}{\defvrheader{\putwordDefopt} } +\makedefun{deftypevar}{\deftypevrheader{\putwordDefvar} } +\makedefun{defmethod}{\defopon\putwordMethodon} +\makedefun{deftypemethod}{\deftypeopon\putwordMethodon} +\makedefun{defivar}{\defcvof\putwordInstanceVariableof} +\makedefun{deftypeivar}{\deftypecvof\putwordInstanceVariableof} + +% \defname, which formats the name of the @def (not the args). +% #1 is the category, such as "Function". +% #2 is the return type, if any. +% #3 is the function name. +% +% We are followed by (but not passed) the arguments, if any. +% +\def\defname#1#2#3{% + % Get the values of \leftskip and \rightskip as they were outside the @def... + \advance\leftskip by -\defbodyindent + % + % How we'll format the type name. Putting it in brackets helps + % distinguish it from the body text that may end up on the next line + % just below it. + \def\temp{#1}% + \setbox0=\hbox{\kern\deflastargmargin \ifx\temp\empty\else [\rm\temp]\fi} + % + % Figure out line sizes for the paragraph shape. + % The first line needs space for \box0; but if \rightskip is nonzero, + % we need only space for the part of \box0 which exceeds it: + \dimen0=\hsize \advance\dimen0 by -\wd0 \advance\dimen0 by \rightskip + % The continuations: + \dimen2=\hsize \advance\dimen2 by -\defargsindent + % (plain.tex says that \dimen1 should be used only as global.) + \parshape 2 0in \dimen0 \defargsindent \dimen2 + % + % Put the type name to the right margin. + \noindent + \hbox to 0pt{% + \hfil\box0 \kern-\hsize + % \hsize has to be shortened this way: + \kern\leftskip + % Intentionally do not respect \rightskip, since we need the space. + }% + % + % Allow all lines to be underfull without complaint: + \tolerance=10000 \hbadness=10000 + \exdentamount=\defbodyindent + {% + % defun fonts. We use typewriter by default (used to be bold) because: + % . we're printing identifiers, they should be in tt in principle. + % . in languages with many accents, such as Czech or French, it's + % common to leave accents off identifiers. The result looks ok in + % tt, but exceedingly strange in rm. + % . we don't want -- and --- to be treated as ligatures. + % . this still does not fix the ?` and !` ligatures, but so far no + % one has made identifiers using them :). + \df \tt + \def\temp{#2}% return value type + \ifx\temp\empty\else \tclose{\temp} \fi + #3% output function name + }% + {\rm\enskip}% hskip 0.5 em of \tenrm + % + \boldbrax + % arguments will be output next, if any. +} + +% Print arguments in slanted roman (not ttsl), inconsistently with using +% tt for the name. This is because literal text is sometimes needed in +% the argument list (groff manual), and ttsl and tt are not very +% distinguishable. Prevent hyphenation at `-' chars. +% +\def\defunargs#1{% + % use sl by default (not ttsl), + % tt for the names. + \df \sl \hyphenchar\font=0 + % + % On the other hand, if an argument has two dashes (for instance), we + % want a way to get ttsl. Let's try @var for that. + \let\var=\ttslanted + #1% + \sl\hyphenchar\font=45 +} + +% We want ()&[] to print specially on the defun line. +% \def\activeparens{% -\catcode`\(=\active \catcode`\)=\active \catcode`\&=\active -\catcode`\[=\active \catcode`\]=\active} + \catcode`\(=\active \catcode`\)=\active + \catcode`\[=\active \catcode`\]=\active + \catcode`\&=\active +} % Make control sequences which act like normal parenthesis chars. \let\lparen = ( \let\rparen = ) -{\activeparens % Now, smart parens don't turn on until &foo (see \amprm) - % Be sure that we always have a definition for `(', etc. For example, % if the fn name has parens in it, \boldbrax will not be in effect yet, % so TeX would otherwise complain about undefined control sequence. -\global\let(=\lparen \global\let)=\rparen -\global\let[=\lbrack \global\let]=\rbrack - -\gdef\functionparens{\boldbrax\let&=\amprm\parencount=0 } -\gdef\boldbrax{\let(=\opnr\let)=\clnr\let[=\lbrb\let]=\rbrb} -% This is used to turn on special parens -% but make & act ordinary (given that it's active). -\gdef\boldbraxnoamp{\let(=\opnr\let)=\clnr\let[=\lbrb\let]=\rbrb\let&=\ampnr} - -% Definitions of (, ) and & used in args for functions. -% This is the definition of ( outside of all parentheses. -\gdef\oprm#1 {{\rm\char`\(}#1 \bf \let(=\opnested - \global\advance\parencount by 1 -} -% -% This is the definition of ( when already inside a level of parens. -\gdef\opnested{\char`\(\global\advance\parencount by 1 } -% -\gdef\clrm{% Print a paren in roman if it is taking us back to depth of 0. - % also in that case restore the outer-level definition of (. - \ifnum \parencount=1 {\rm \char `\)}\sl \let(=\oprm \else \char `\) \fi - \global\advance \parencount by -1 } -% If we encounter &foo, then turn on ()-hacking afterwards -\gdef\amprm#1 {{\rm\}\let(=\oprm \let)=\clrm\ } -% -\gdef\normalparens{\boldbrax\let&=\ampnr} -} % End of definition inside \activeparens -%% These parens (in \boldbrax) actually are a little bolder than the -%% contained text. This is especially needed for [ and ] -\def\opnr{{\sf\char`\(}\global\advance\parencount by 1 } -\def\clnr{{\sf\char`\)}\global\advance\parencount by -1 } -\let\ampnr = \& -\def\lbrb{{\bf\char`\[}} -\def\rbrb{{\bf\char`\]}} - -% Active &'s sneak into the index arguments, so make sure it's defined. { - \catcode`& = 13 - \global\let& = \ampnr + \activeparens + \global\let(=\lparen \global\let)=\rparen + \global\let[=\lbrack \global\let]=\rbrack + \global\let& = \& + + \gdef\boldbrax{\let(=\opnr\let)=\clnr\let[=\lbrb\let]=\rbrb} + \gdef\magicamp{\let&=\amprm} } -% First, defname, which formats the header line itself. -% #1 should be the function name. -% #2 should be the type of definition, such as "Function". +\newcount\parencount -\def\defname #1#2{% -% Get the values of \leftskip and \rightskip as they were -% outside the @def... -\dimen2=\leftskip -\advance\dimen2 by -\defbodyindent -\noindent -\setbox0=\hbox{\hskip \deflastargmargin{\rm #2}\hskip \deftypemargin}% -\dimen0=\hsize \advance \dimen0 by -\wd0 % compute size for first line -\dimen1=\hsize \advance \dimen1 by -\defargsindent %size for continuations -\parshape 2 0in \dimen0 \defargsindent \dimen1 -% Now output arg 2 ("Function" or some such) -% ending at \deftypemargin from the right margin, -% but stuck inside a box of width 0 so it does not interfere with linebreaking -{% Adjust \hsize to exclude the ambient margins, -% so that \rightline will obey them. -\advance \hsize by -\dimen2 -\rlap{\rightline{{\rm #2}\hskip -1.25pc }}}% -% Make all lines underfull and no complaints: -\tolerance=10000 \hbadness=10000 -\advance\leftskip by -\defbodyindent -\exdentamount=\defbodyindent -{\df #1}\enskip % Generate function name +% If we encounter &foo, then turn on ()-hacking afterwards +\newif\ifampseen +\def\amprm#1 {\ampseentrue{\bf\ }} + +\def\parenfont{% + \ifampseen + % At the first level, print parens in roman, + % otherwise use the default font. + \ifnum \parencount=1 \rm \fi + \else + % The \sf parens (in \boldbrax) actually are a little bolder than + % the contained text. This is especially needed for [ and ] . + \sf + \fi +} +\def\infirstlevel#1{% + \ifampseen + \ifnum\parencount=1 + #1% + \fi + \fi +} +\def\bfafterword#1 {#1 \bf} + +\def\opnr{% + \global\advance\parencount by 1 + {\parenfont(}% + \infirstlevel \bfafterword +} +\def\clnr{% + {\parenfont)}% + \infirstlevel \sl + \global\advance\parencount by -1 } -% Actually process the body of a definition -% #1 should be the terminating control sequence, such as \Edefun. -% #2 should be the "another name" control sequence, such as \defunx. -% #3 should be the control sequence that actually processes the header, -% such as \defunheader. - -\def\defparsebody #1#2#3{\begingroup\inENV% Environment for definitionbody -\medbreak % -% Define the end token that this defining construct specifies -% so that it will exit this group. -\def#1{\endgraf\endgroup\medbreak}% -\def#2{\begingroup\obeylines\activeparens\spacesplit#3}% -\parindent=0in -\advance\leftskip by \defbodyindent -\exdentamount=\defbodyindent -\begingroup % -\catcode 61=\active % 61 is `=' -\obeylines\activeparens\spacesplit#3} - -% #1 is the \E... control sequence to end the definition (which we define). -% #2 is the \...x control sequence for consecutive fns (which we define). -% #3 is the control sequence to call to resume processing. -% #4, delimited by the space, is the class name. -% -\def\defmethparsebody#1#2#3#4 {\begingroup\inENV % -\medbreak % -% Define the end token that this defining construct specifies -% so that it will exit this group. -\def#1{\endgraf\endgroup\medbreak}% -\def#2##1 {\begingroup\obeylines\activeparens\spacesplit{#3{##1}}}% -\parindent=0in -\advance\leftskip by \defbodyindent -\exdentamount=\defbodyindent -\begingroup\obeylines\activeparens\spacesplit{#3{#4}}} - -% Used for @deftypemethod and @deftypeivar. -% #1 is the \E... control sequence to end the definition (which we define). -% #2 is the \...x control sequence for consecutive fns (which we define). -% #3 is the control sequence to call to resume processing. -% #4, delimited by a space, is the class name. -% #5 is the method's return type. -% -\def\deftypemethparsebody#1#2#3#4 #5 {\begingroup\inENV - \medbreak - \def#1{\endgraf\endgroup\medbreak}% - \def#2##1 ##2 {\begingroup\obeylines\activeparens\spacesplit{#3{##1}{##2}}}% - \parindent=0in - \advance\leftskip by \defbodyindent - \exdentamount=\defbodyindent - \begingroup\obeylines\activeparens\spacesplit{#3{#4}{#5}}} - -% Used for @deftypeop. The change from \deftypemethparsebody is an -% extra argument at the beginning which is the `category', instead of it -% being the hardwired string `Method' or `Instance Variable'. We have -% to account for this both in the \...x definition and in parsing the -% input at hand. Thus also need a control sequence (passed as #5) for -% the \E... definition to assign the category name to. -% -\def\deftypeopparsebody#1#2#3#4#5 #6 {\begingroup\inENV - \medbreak - \def#1{\endgraf\endgroup\medbreak}% - \def#2##1 ##2 ##3 {% - \def#4{##1}% - \begingroup\obeylines\activeparens\spacesplit{#3{##2}{##3}}}% - \parindent=0in - \advance\leftskip by \defbodyindent - \exdentamount=\defbodyindent - \begingroup\obeylines\activeparens\spacesplit{#3{#5}{#6}}} - -\def\defopparsebody #1#2#3#4#5 {\begingroup\inENV % -\medbreak % -% Define the end token that this defining construct specifies -% so that it will exit this group. -\def#1{\endgraf\endgroup\medbreak}% -\def#2##1 ##2 {\def#4{##1}% -\begingroup\obeylines\activeparens\spacesplit{#3{##2}}}% -\parindent=0in -\advance\leftskip by \defbodyindent -\exdentamount=\defbodyindent -\begingroup\obeylines\activeparens\spacesplit{#3{#5}}} - -% These parsing functions are similar to the preceding ones -% except that they do not make parens into active characters. -% These are used for "variables" since they have no arguments. - -\def\defvarparsebody #1#2#3{\begingroup\inENV% Environment for definitionbody -\medbreak % -% Define the end token that this defining construct specifies -% so that it will exit this group. -\def#1{\endgraf\endgroup\medbreak}% -\def#2{\begingroup\obeylines\spacesplit#3}% -\parindent=0in -\advance\leftskip by \defbodyindent -\exdentamount=\defbodyindent -\begingroup % -\catcode 61=\active % -\obeylines\spacesplit#3} - -% This is used for \def{tp,vr}parsebody. It could probably be used for -% some of the others, too, with some judicious conditionals. -% -\def\parsebodycommon#1#2#3{% - \begingroup\inENV % - \medbreak % - % Define the end token that this defining construct specifies - % so that it will exit this group. - \def#1{\endgraf\endgroup\medbreak}% - \def#2##1 {\begingroup\obeylines\spacesplit{#3{##1}}}% - \parindent=0in - \advance\leftskip by \defbodyindent - \exdentamount=\defbodyindent - \begingroup\obeylines +\newcount\brackcount +\def\lbrb{% + \global\advance\brackcount by 1 + {\bf[}% +} +\def\rbrb{% + {\bf]}% + \global\advance\brackcount by -1 } -\def\defvrparsebody#1#2#3#4 {% - \parsebodycommon{#1}{#2}{#3}% - \spacesplit{#3{#4}}% +\def\checkparencounts{% + \ifnum\parencount=0 \else \badparencount \fi + \ifnum\brackcount=0 \else \badbrackcount \fi } - -% This loses on `@deftp {Data Type} {struct termios}' -- it thinks the -% type is just `struct', because we lose the braces in `{struct -% termios}' when \spacesplit reads its undelimited argument. Sigh. -% \let\deftpparsebody=\defvrparsebody -% -% So, to get around this, we put \empty in with the type name. That -% way, TeX won't find exactly `{...}' as an undelimited argument, and -% won't strip off the braces. -% -\def\deftpparsebody #1#2#3#4 {% - \parsebodycommon{#1}{#2}{#3}% - \spacesplit{\parsetpheaderline{#3{#4}}}\empty +\def\badparencount{% + \errmessage{Unbalanced parentheses in @def}% + \global\parencount=0 } - -% Fine, but then we have to eventually remove the \empty *and* the -% braces (if any). That's what this does. -% -\def\removeemptybraces\empty#1\relax{#1} - -% After \spacesplit has done its work, this is called -- #1 is the final -% thing to call, #2 the type name (which starts with \empty), and #3 -% (which might be empty) the arguments. -% -\def\parsetpheaderline#1#2#3{% - #1{\removeemptybraces#2\relax}{#3}% -}% - -\def\defopvarparsebody #1#2#3#4#5 {\begingroup\inENV % -\medbreak % -% Define the end token that this defining construct specifies -% so that it will exit this group. -\def#1{\endgraf\endgroup\medbreak}% -\def#2##1 ##2 {\def#4{##1}% -\begingroup\obeylines\spacesplit{#3{##2}}}% -\parindent=0in -\advance\leftskip by \defbodyindent -\exdentamount=\defbodyindent -\begingroup\obeylines\spacesplit{#3{#5}}} - -% Split up #2 at the first space token. -% call #1 with two arguments: -% the first is all of #2 before the space token, -% the second is all of #2 after that space token. -% If #2 contains no space token, all of it is passed as the first arg -% and the second is passed as empty. - -{\obeylines -\gdef\spacesplit#1#2^^M{\endgroup\spacesplitfoo{#1}#2 \relax\spacesplitfoo}% -\long\gdef\spacesplitfoo#1#2 #3#4\spacesplitfoo{% -\ifx\relax #3% -#1{#2}{}\else #1{#2}{#3#4}\fi}} - -% So much for the things common to all kinds of definitions. - -% Define @defun. - -% First, define the processing that is wanted for arguments of \defun -% Use this to expand the args and terminate the paragraph they make up - -\def\defunargs#1{\functionparens \sl -% Expand, preventing hyphenation at `-' chars. -% Note that groups don't affect changes in \hyphenchar. -% Set the font temporarily and use \font in case \setfont made \tensl a macro. -{\tensl\hyphenchar\font=0}% -#1% -{\tensl\hyphenchar\font=45}% -\ifnum\parencount=0 \else \errmessage{Unbalanced parentheses in @def}\fi% -\interlinepenalty=10000 -\advance\rightskip by 0pt plus 1fil -\endgraf\nobreak\vskip -\parskip\nobreak +\def\badbrackcount{% + \errmessage{Unbalanced square braces in @def}% + \global\brackcount=0 } -\def\deftypefunargs #1{% -% Expand, preventing hyphenation at `-' chars. -% Note that groups don't affect changes in \hyphenchar. -% Use \boldbraxnoamp, not \functionparens, so that & is not special. -\boldbraxnoamp -\tclose{#1}% avoid \code because of side effects on active chars -\interlinepenalty=10000 -\advance\rightskip by 0pt plus 1fil -\endgraf\nobreak\vskip -\parskip\nobreak -} - -% Do complete processing of one @defun or @defunx line already parsed. - -% @deffn Command forward-char nchars - -\def\deffn{\defmethparsebody\Edeffn\deffnx\deffnheader} - -\def\deffnheader #1#2#3{\doind {fn}{\code{#2}}% -\begingroup\defname {#2}{#1}\defunargs{#3}\endgroup % -\catcode 61=\other % Turn off change made in \defparsebody -} - -% @defun == @deffn Function - -\def\defun{\defparsebody\Edefun\defunx\defunheader} - -\def\defunheader #1#2{\doind {fn}{\code{#1}}% Make entry in function index -\begingroup\defname {#1}{\putwordDeffunc}% -\defunargs {#2}\endgroup % -\catcode 61=\other % Turn off change made in \defparsebody -} - -% @deftypefun int foobar (int @var{foo}, float @var{bar}) - -\def\deftypefun{\defparsebody\Edeftypefun\deftypefunx\deftypefunheader} - -% #1 is the data type. #2 is the name and args. -\def\deftypefunheader #1#2{\deftypefunheaderx{#1}#2 \relax} -% #1 is the data type, #2 the name, #3 the args. -\def\deftypefunheaderx #1#2 #3\relax{% -\doind {fn}{\code{#2}}% Make entry in function index -\begingroup\defname {\defheaderxcond#1\relax$$$#2}{\putwordDeftypefun}% -\deftypefunargs {#3}\endgroup % -\catcode 61=\other % Turn off change made in \defparsebody -} - -% @deftypefn {Library Function} int foobar (int @var{foo}, float @var{bar}) - -\def\deftypefn{\defmethparsebody\Edeftypefn\deftypefnx\deftypefnheader} - -% \defheaderxcond#1\relax$$$ -% puts #1 in @code, followed by a space, but does nothing if #1 is null. -\def\defheaderxcond#1#2$$${\ifx#1\relax\else\code{#1#2} \fi} - -% #1 is the classification. #2 is the data type. #3 is the name and args. -\def\deftypefnheader #1#2#3{\deftypefnheaderx{#1}{#2}#3 \relax} -% #1 is the classification, #2 the data type, #3 the name, #4 the args. -\def\deftypefnheaderx #1#2#3 #4\relax{% -\doind {fn}{\code{#3}}% Make entry in function index -\begingroup -\normalparens % notably, turn off `&' magic, which prevents -% at least some C++ text from working -\defname {\defheaderxcond#2\relax$$$#3}{#1}% -\deftypefunargs {#4}\endgroup % -\catcode 61=\other % Turn off change made in \defparsebody -} - -% @defmac == @deffn Macro - -\def\defmac{\defparsebody\Edefmac\defmacx\defmacheader} - -\def\defmacheader #1#2{\doind {fn}{\code{#1}}% Make entry in function index -\begingroup\defname {#1}{\putwordDefmac}% -\defunargs {#2}\endgroup % -\catcode 61=\other % Turn off change made in \defparsebody -} - -% @defspec == @deffn Special Form - -\def\defspec{\defparsebody\Edefspec\defspecx\defspecheader} - -\def\defspecheader #1#2{\doind {fn}{\code{#1}}% Make entry in function index -\begingroup\defname {#1}{\putwordDefspec}% -\defunargs {#2}\endgroup % -\catcode 61=\other % Turn off change made in \defparsebody -} - -% @defop CATEGORY CLASS OPERATION ARG... -% -\def\defop #1 {\def\defoptype{#1}% -\defopparsebody\Edefop\defopx\defopheader\defoptype} -% -\def\defopheader#1#2#3{% -\dosubind {fn}{\code{#2}}{\putwordon\ #1}% Make entry in function index -\begingroup\defname {#2}{\defoptype\ \putwordon\ #1}% -\defunargs {#3}\endgroup % -} - -% @deftypeop CATEGORY CLASS TYPE OPERATION ARG... -% -\def\deftypeop #1 {\def\deftypeopcategory{#1}% - \deftypeopparsebody\Edeftypeop\deftypeopx\deftypeopheader - \deftypeopcategory} -% -% #1 is the class name, #2 the data type, #3 the operation name, #4 the args. -\def\deftypeopheader#1#2#3#4{% - \dosubind{fn}{\code{#3}}{\putwordon\ \code{#1}}% entry in function index - \begingroup - \defname{\defheaderxcond#2\relax$$$#3} - {\deftypeopcategory\ \putwordon\ \code{#1}}% - \deftypefunargs{#4}% - \endgroup -} - -% @deftypemethod CLASS TYPE METHOD ARG... -% -\def\deftypemethod{% - \deftypemethparsebody\Edeftypemethod\deftypemethodx\deftypemethodheader} -% -% #1 is the class name, #2 the data type, #3 the method name, #4 the args. -\def\deftypemethodheader#1#2#3#4{% - \dosubind{fn}{\code{#3}}{\putwordon\ \code{#1}}% entry in function index - \begingroup - \defname{\defheaderxcond#2\relax$$$#3}{\putwordMethodon\ \code{#1}}% - \deftypefunargs{#4}% - \endgroup -} - -% @deftypeivar CLASS TYPE VARNAME -% -\def\deftypeivar{% - \deftypemethparsebody\Edeftypeivar\deftypeivarx\deftypeivarheader} -% -% #1 is the class name, #2 the data type, #3 the variable name. -\def\deftypeivarheader#1#2#3{% - \dosubind{vr}{\code{#3}}{\putwordof\ \code{#1}}% entry in variable index - \begingroup - \defname{#3}{\putwordInstanceVariableof\ \code{#1}}% - \defvarargs{#3}% - \endgroup -} - -% @defmethod == @defop Method -% -\def\defmethod{\defmethparsebody\Edefmethod\defmethodx\defmethodheader} -% -% #1 is the class name, #2 the method name, #3 the args. -\def\defmethodheader#1#2#3{% - \dosubind{fn}{\code{#2}}{\putwordon\ \code{#1}}% entry in function index - \begingroup - \defname{#2}{\putwordMethodon\ \code{#1}}% - \defunargs{#3}% - \endgroup -} - -% @defcv {Class Option} foo-class foo-flag - -\def\defcv #1 {\def\defcvtype{#1}% -\defopvarparsebody\Edefcv\defcvx\defcvarheader\defcvtype} - -\def\defcvarheader #1#2#3{% -\dosubind {vr}{\code{#2}}{\putwordof\ #1}% Make entry in var index -\begingroup\defname {#2}{\defcvtype\ \putwordof\ #1}% -\defvarargs {#3}\endgroup % -} - -% @defivar CLASS VARNAME == @defcv {Instance Variable} CLASS VARNAME -% -\def\defivar{\defvrparsebody\Edefivar\defivarx\defivarheader} -% -\def\defivarheader#1#2#3{% - \dosubind {vr}{\code{#2}}{\putwordof\ #1}% entry in var index - \begingroup - \defname{#2}{\putwordInstanceVariableof\ #1}% - \defvarargs{#3}% - \endgroup -} - -% @defvar -% First, define the processing that is wanted for arguments of @defvar. -% This is actually simple: just print them in roman. -% This must expand the args and terminate the paragraph they make up -\def\defvarargs #1{\normalparens #1% -\interlinepenalty=10000 -\endgraf\nobreak\vskip -\parskip\nobreak} - -% @defvr Counter foo-count - -\def\defvr{\defvrparsebody\Edefvr\defvrx\defvrheader} - -\def\defvrheader #1#2#3{\doind {vr}{\code{#2}}% -\begingroup\defname {#2}{#1}\defvarargs{#3}\endgroup} - -% @defvar == @defvr Variable - -\def\defvar{\defvarparsebody\Edefvar\defvarx\defvarheader} - -\def\defvarheader #1#2{\doind {vr}{\code{#1}}% Make entry in var index -\begingroup\defname {#1}{\putwordDefvar}% -\defvarargs {#2}\endgroup % -} - -% @defopt == @defvr {User Option} - -\def\defopt{\defvarparsebody\Edefopt\defoptx\defoptheader} - -\def\defoptheader #1#2{\doind {vr}{\code{#1}}% Make entry in var index -\begingroup\defname {#1}{\putwordDefopt}% -\defvarargs {#2}\endgroup % -} - -% @deftypevar int foobar - -\def\deftypevar{\defvarparsebody\Edeftypevar\deftypevarx\deftypevarheader} - -% #1 is the data type. #2 is the name, perhaps followed by text that -% is actually part of the data type, which should not be put into the index. -\def\deftypevarheader #1#2{% -\dovarind#2 \relax% Make entry in variables index -\begingroup\defname {\defheaderxcond#1\relax$$$#2}{\putwordDeftypevar}% -\interlinepenalty=10000 -\endgraf\nobreak\vskip -\parskip\nobreak -\endgroup} -\def\dovarind#1 #2\relax{\doind{vr}{\code{#1}}} - -% @deftypevr {Global Flag} int enable - -\def\deftypevr{\defvrparsebody\Edeftypevr\deftypevrx\deftypevrheader} - -\def\deftypevrheader #1#2#3{\dovarind#3 \relax% -\begingroup\defname {\defheaderxcond#2\relax$$$#3}{#1} -\interlinepenalty=10000 -\endgraf\nobreak\vskip -\parskip\nobreak -\endgroup} - -% Now define @deftp -% Args are printed in bold, a slight difference from @defvar. - -\def\deftpargs #1{\bf \defvarargs{#1}} - -% @deftp Class window height width ... - -\def\deftp{\deftpparsebody\Edeftp\deftpx\deftpheader} - -\def\deftpheader #1#2#3{\doind {tp}{\code{#2}}% -\begingroup\defname {#2}{#1}\deftpargs{#3}\endgroup} - -% These definitions are used if you use @defunx (etc.) -% anywhere other than immediately after a @defun or @defunx. -% -\def\defcvx#1 {\errmessage{@defcvx in invalid context}} -\def\deffnx#1 {\errmessage{@deffnx in invalid context}} -\def\defivarx#1 {\errmessage{@defivarx in invalid context}} -\def\defmacx#1 {\errmessage{@defmacx in invalid context}} -\def\defmethodx#1 {\errmessage{@defmethodx in invalid context}} -\def\defoptx #1 {\errmessage{@defoptx in invalid context}} -\def\defopx#1 {\errmessage{@defopx in invalid context}} -\def\defspecx#1 {\errmessage{@defspecx in invalid context}} -\def\deftpx#1 {\errmessage{@deftpx in invalid context}} -\def\deftypefnx#1 {\errmessage{@deftypefnx in invalid context}} -\def\deftypefunx#1 {\errmessage{@deftypefunx in invalid context}} -\def\deftypeivarx#1 {\errmessage{@deftypeivarx in invalid context}} -\def\deftypemethodx#1 {\errmessage{@deftypemethodx in invalid context}} -\def\deftypeopx#1 {\errmessage{@deftypeopx in invalid context}} -\def\deftypevarx#1 {\errmessage{@deftypevarx in invalid context}} -\def\deftypevrx#1 {\errmessage{@deftypevrx in invalid context}} -\def\defunx#1 {\errmessage{@defunx in invalid context}} -\def\defvarx#1 {\errmessage{@defvarx in invalid context}} -\def\defvrx#1 {\errmessage{@defvrx in invalid context}} - \message{macros,} % @macro. @@ -4809,28 +5469,33 @@ width0pt\relax} \fi % To do this right we need a feature of e-TeX, \scantokens, % which we arrange to emulate with a temporary file in ordinary TeX. \ifx\eTeXversion\undefined - \newwrite\macscribble - \def\scanmacro#1{% - \begingroup \newlinechar`\^^M - % Undo catcode changes of \startcontents and \doprintindex - \catcode`\@=0 \catcode`\\=12 \escapechar=`\@ - % Append \endinput to make sure that TeX does not see the ending newline. - \toks0={#1\endinput}% - \immediate\openout\macscribble=\jobname.tmp - \immediate\write\macscribble{\the\toks0}% - \immediate\closeout\macscribble - \let\xeatspaces\eatspaces - \input \jobname.tmp - \endgroup -} -\else -\def\scanmacro#1{% -\begingroup \newlinechar`\^^M -% Undo catcode changes of \startcontents and \doprintindex -\catcode`\@=0 \catcode`\\=12 \escapechar=`\@ -\let\xeatspaces\eatspaces\scantokens{#1\endinput}\endgroup} + \newwrite\macscribble + \def\scantokens#1{% + \toks0={#1\endinput}% + \immediate\openout\macscribble=\jobname.tmp + \immediate\write\macscribble{\the\toks0}% + \immediate\closeout\macscribble + \input \jobname.tmp + } \fi +\def\scanmacro#1{% + \begingroup + \newlinechar`\^^M + \let\xeatspaces\eatspaces + % Undo catcode changes of \startcontents and \doprintindex + \catcode`\@=0 \catcode`\\=\other \escapechar=`\@ + % ... and \example + \spaceisspace + % + % Append \endinput to make sure that TeX does not see the ending newline. + % + % I've verified that it is necessary both for e-TeX and for ordinary TeX + % --kasal, 29nov03 + \scantokens{#1\endinput}% + \endgroup +} + \newcount\paramno % Count of parameters \newtoks\macname % Macro name \newif\ifrecursive % Is it recursive? @@ -4838,7 +5503,7 @@ width0pt\relax} \fi % \do\macro1\do\macro2... % Utility routines. -% Thisdoes \let #1 = #2, except with \csnames. +% This does \let #1 = #2, except with \csnames. \def\cslet#1#2{% \expandafter\expandafter \expandafter\let @@ -4857,7 +5522,7 @@ width0pt\relax} \fi } % Trim a single trailing ^^M off a string. -{\catcode`\^^M=12\catcode`\Q=3% +{\catcode`\^^M=\other \catcode`\Q=3% \gdef\eatcr #1{\eatcra #1Q^^MQ}% \gdef\eatcra#1^^MQ{\eatcrb#1Q}% \gdef\eatcrb#1Q#2Q{#1}% @@ -4872,29 +5537,29 @@ width0pt\relax} \fi % body, and then making it the \newlinechar in \scanmacro. \def\macrobodyctxt{% - \catcode`\~=12 - \catcode`\^=12 - \catcode`\_=12 - \catcode`\|=12 - \catcode`\<=12 - \catcode`\>=12 - \catcode`\+=12 - \catcode`\{=12 - \catcode`\}=12 - \catcode`\@=12 - \catcode`\^^M=12 + \catcode`\~=\other + \catcode`\^=\other + \catcode`\_=\other + \catcode`\|=\other + \catcode`\<=\other + \catcode`\>=\other + \catcode`\+=\other + \catcode`\{=\other + \catcode`\}=\other + \catcode`\@=\other + \catcode`\^^M=\other \usembodybackslash} \def\macroargctxt{% - \catcode`\~=12 - \catcode`\^=12 - \catcode`\_=12 - \catcode`\|=12 - \catcode`\<=12 - \catcode`\>=12 - \catcode`\+=12 - \catcode`\@=12 - \catcode`\\=12} + \catcode`\~=\other + \catcode`\^=\other + \catcode`\_=\other + \catcode`\|=\other + \catcode`\<=\other + \catcode`\>=\other + \catcode`\+=\other + \catcode`\@=\other + \catcode`\\=\other} % \mbodybackslash is the definition of \ in @macro bodies. % It maps \foo\ => \csname macarg.foo\endcsname => #N @@ -4922,7 +5587,7 @@ width0pt\relax} \fi \message{Warning: redefining \the\macname}% \else \expandafter\ifx\csname \the\macname\endcsname \relax - \else \errmessage{The name \the\macname\space is reserved}\fi + \else \errmessage{Macro name \the\macname\space already defined}\fi \global\cslet{macsave.\the\macname}{\the\macname}% \global\expandafter\let\csname ismacro.\the\macname\endcsname=1% % Add the macroname to \macrolist @@ -4935,32 +5600,32 @@ width0pt\relax} \fi \else \expandafter\parsemacbody \fi} -\def\unmacro{\parsearg\unmacroxxx} -\def\unmacroxxx#1{% +\parseargdef\unmacro{% \if1\csname ismacro.#1\endcsname \global\cslet{#1}{macsave.#1}% \global\expandafter\let \csname ismacro.#1\endcsname=0% - % Remove the macro name from \macrolist + % Remove the macro name from \macrolist: \begingroup - \edef\tempa{\expandafter\noexpand\csname#1\endcsname}% - \def\do##1{% - \def\tempb{##1}% - \ifx\tempa\tempb - % remove this - \else - \toks0 = \expandafter{\newmacrolist\do}% - \edef\newmacrolist{\the\toks0\expandafter\noexpand\tempa}% - \fi}% - \def\newmacrolist{}% - % Execute macro list to define \newmacrolist - \macrolist - \global\let\macrolist\newmacrolist + \expandafter\let\csname#1\endcsname \relax + \let\do\unmacrodo + \xdef\macrolist{\macrolist}% \endgroup \else \errmessage{Macro #1 not defined}% \fi } +% Called by \do from \dounmacro on each macro. The idea is to omit any +% macro definitions that have been changed to \relax. +% +\def\unmacrodo#1{% + \ifx#1\relax + % remove this + \else + \noexpand\do \noexpand #1% + \fi +} + % This makes use of the obscure feature that if the last token of a % is #, then the preceding argument is delimited by % an opening brace, and that opening brace is not consumed. @@ -5076,18 +5741,41 @@ width0pt\relax} \fi \expandafter\parsearg \fi \next} -% We mant to disable all macros during \shipout so that they are not +% We want to disable all macros during \shipout so that they are not % expanded by \write. \def\turnoffmacros{\begingroup \def\do##1{\let\noexpand##1=\relax}% \edef\next{\macrolist}\expandafter\endgroup\next} +% For \indexnofonts, we need to get rid of all macros, leaving only the +% arguments (if present). Of course this is not nearly correct, but it +% is the best we can do for now. makeinfo does not expand macros in the +% argument to @deffn, which ends up writing an index entry, and texindex +% isn't prepared for an index sort entry that starts with \. +% +% Since macro invocations are followed by braces, we can just redefine them +% to take a single TeX argument. The case of a macro invocation that +% goes to end-of-line is not handled. +% +\def\emptyusermacros{\begingroup + \def\do##1{\let\noexpand##1=\noexpand\asis}% + \edef\next{\macrolist}\expandafter\endgroup\next} + % @alias. -\def\alias#1=#2{\gdef#1{#2}} +% We need some trickery to remove the optional spaces around the equal +% sign. Just make them active and then expand them all to nothing. +\def\alias{\parseargusing\obeyspaces\aliasxxx} +\def\aliasxxx #1{\aliasyyy#1\relax} +\def\aliasyyy #1=#2\relax{% + {% + \expandafter\let\obeyedspace=\empty + \xdef\next{\global\let\makecsname{#1}=\makecsname{#2}}% + }% + \next +} \message{cross references,} -% @xref etc. \newwrite\auxfile @@ -5099,66 +5787,70 @@ width0pt\relax} \fi \def\inforefzzz #1,#2,#3,#4**{\putwordSee{} \putwordInfo{} \putwordfile{} \file{\ignorespaces #3{}}, node \samp{\ignorespaces#1{}}} -% @node's job is to define \lastnode. -\def\node{\ENVcheck\parsearg\nodezzz} -\def\nodezzz#1{\nodexxx [#1,]} -\def\nodexxx[#1,#2]{\gdef\lastnode{#1}} +% @node's only job in TeX is to define \lastnode, which is used in +% cross-references. The @node line might or might not have commas, and +% might or might not have spaces before the first comma, like: +% @node foo , bar , ... +% We don't want such trailing spaces in the node name. +% +\parseargdef\node{\checkenv{}\donode #1 ,\finishnodeparse} +% +% also remove a trailing comma, in case of something like this: +% @node Help-Cross, , , Cross-refs +\def\donode#1 ,#2\finishnodeparse{\dodonode #1,\finishnodeparse} +\def\dodonode#1,#2\finishnodeparse{\gdef\lastnode{#1}} + \let\nwnode=\node -\let\lastnode=\relax +\let\lastnode=\empty -% The sectioning commands (@chapter, etc.) call these. -\def\donoderef{% - \ifx\lastnode\relax\else - \expandafter\expandafter\expandafter\setref{\lastnode}% - {Ysectionnumberandtype}% - \global\let\lastnode=\relax +% Write a cross-reference definition for the current node. #1 is the +% type (Ynumbered, Yappendix, Ynothing). +% +\def\donoderef#1{% + \ifx\lastnode\empty\else + \setref{\lastnode}{#1}% + \global\let\lastnode=\empty \fi } -\def\unnumbnoderef{% - \ifx\lastnode\relax\else - \expandafter\expandafter\expandafter\setref{\lastnode}{Ynothing}% - \global\let\lastnode=\relax - \fi -} -\def\appendixnoderef{% - \ifx\lastnode\relax\else - \expandafter\expandafter\expandafter\setref{\lastnode}% - {Yappendixletterandtype}% - \global\let\lastnode=\relax - \fi -} - % @anchor{NAME} -- define xref target at arbitrary point. % -{ \catcode`\@ = 11 -% From latex.ltx, to make @anchor truely invisible. -\newdimen\@savsk -\newcount\@savsf -\gdef\@bsphack{\relax - \ifhmode \@savsk\lastskip \@savsf\spacefactor \fi -} -\gdef\@esphack{\relax - \ifhmode \spacefactor\@savsf - \ifdim\@savsk>\z@ \ignorespaces \fi +\newcount\savesfregister +% +\def\savesf{\relax \ifhmode \savesfregister=\spacefactor \fi} +\def\restoresf{\relax \ifhmode \spacefactor=\savesfregister \fi} +\def\anchor#1{\savesf \setref{#1}{Ynothing}\restoresf \ignorespaces} + +% \setref{NAME}{SNT} defines a cross-reference point NAME (a node or an +% anchor), which consists of three parts: +% 1) NAME-title - the current sectioning name taken from \thissection, +% or the anchor name. +% 2) NAME-snt - section number and type, passed as the SNT arg, or +% empty for anchors. +% 3) NAME-pg - the page number. +% +% This is called from \donoderef, \anchor, and \dofloat. In the case of +% floats, there is an additional part, which is not written here: +% 4) NAME-lof - the text as it should appear in a @listoffloats. +% +\def\setref#1#2{% + \pdfmkdest{#1}% + \iflinks + {% + \atdummies % preserve commands, but don't expand them + \turnoffactive + \otherbackslash + \edef\writexrdef##1##2{% + \write\auxfile{@xrdef{#1-% #1 of \setref, expanded by the \edef + ##1}{##2}}% these are parameters of \writexrdef + }% + \toks0 = \expandafter{\thissection}% + \immediate \writexrdef{title}{\the\toks0 }% + \immediate \writexrdef{snt}{\csname #2\endcsname}% \Ynumbered etc. + \writexrdef{pg}{\folio}% will be written later, during \shipout + }% \fi } -\gdef\anchor#1{\@bsphack \setref{#1}{Ynothing}\@esphack} -} - -% \setref{NAME}{SNT} defines a cross-reference point NAME, namely -% NAME-title, NAME-pg, and NAME-SNT. Called from \foonoderef. We have -% to set \indexdummies so commands such as @code in a section title -% aren't expanded. It would be nicer not to expand the titles in the -% first place, but there's so many layers that that is hard to do. -% -\def\setref#1#2{{% - \indexdummies - \pdfmkdest{#1} - \dosetq{#1-title}{Ytitle}% - \dosetq{#1-pg}{Ypagenumber}% - \dosetq{#1-snt}{#2}% -}} % @xref, @pxref, and @ref generate cross-references. For \xrefX, #1 is % the node name, #2 the name of the Info cross-reference, #3 the printed @@ -5169,136 +5861,158 @@ width0pt\relax} \fi \def\xref#1{\putwordSee{} \xrefX[#1,,,,,,,]} \def\ref#1{\xrefX[#1,,,,,,,]} \def\xrefX[#1,#2,#3,#4,#5,#6]{\begingroup + \unsepspaces \def\printedmanual{\ignorespaces #5}% - \def\printednodename{\ignorespaces #3}% - \setbox1=\hbox{\printedmanual}% - \setbox0=\hbox{\printednodename}% + \def\printedrefname{\ignorespaces #3}% + \setbox1=\hbox{\printedmanual\unskip}% + \setbox0=\hbox{\printedrefname\unskip}% \ifdim \wd0 = 0pt % No printed node name was explicitly given. \expandafter\ifx\csname SETxref-automatic-section-title\endcsname\relax % Use the node name inside the square brackets. - \def\printednodename{\ignorespaces #1}% + \def\printedrefname{\ignorespaces #1}% \else % Use the actual chapter/section title appear inside % the square brackets. Use the real section title if we have it. \ifdim \wd1 > 0pt % It is in another manual, so we don't have it. - \def\printednodename{\ignorespaces #1}% + \def\printedrefname{\ignorespaces #1}% \else \ifhavexrefs % We know the real title if we have the xref values. - \def\printednodename{\refx{#1-title}{}}% + \def\printedrefname{\refx{#1-title}{}}% \else % Otherwise just copy the Info node name. - \def\printednodename{\ignorespaces #1}% + \def\printedrefname{\ignorespaces #1}% \fi% \fi \fi \fi % - % If we use \unhbox0 and \unhbox1 to print the node names, TeX does not - % insert empty discretionaries after hyphens, which means that it will - % not find a line break at a hyphen in a node names. Since some manuals - % are best written with fairly long node names, containing hyphens, this - % is a loss. Therefore, we give the text of the node name again, so it - % is as if TeX is seeing it for the first time. + % Make link in pdf output. \ifpdf \leavevmode \getfilename{#4}% - \ifnum\filenamelength>0 - \startlink attr{/Border [0 0 0]}% - goto file{\the\filename.pdf} name{#1@}% - \else - \startlink attr{/Border [0 0 0]}% - goto name{#1@}% - \fi + {\turnoffactive \otherbackslash + \ifnum\filenamelength>0 + \startlink attr{/Border [0 0 0]}% + goto file{\the\filename.pdf} name{#1}% + \else + \startlink attr{/Border [0 0 0]}% + goto name{\pdfmkpgn{#1}}% + \fi + }% \linkcolor \fi % - \ifdim \wd1 > 0pt - \putwordsection{} ``\printednodename'' \putwordin{} \cite{\printedmanual}% + % Float references are printed completely differently: "Figure 1.2" + % instead of "[somenode], p.3". We distinguish them by the + % LABEL-title being set to a magic string. + {% + % Have to otherify everything special to allow the \csname to + % include an _ in the xref name, etc. + \indexnofonts + \turnoffactive + \otherbackslash + \expandafter\global\expandafter\let\expandafter\Xthisreftitle + \csname XR#1-title\endcsname + }% + \iffloat\Xthisreftitle + % If the user specified the print name (third arg) to the ref, + % print it instead of our usual "Figure 1.2". + \ifdim\wd0 = 0pt + \refx{#1-snt}% + \else + \printedrefname + \fi + % + % if the user also gave the printed manual name (fifth arg), append + % "in MANUALNAME". + \ifdim \wd1 > 0pt + \space \putwordin{} \cite{\printedmanual}% + \fi \else - % _ (for example) has to be the character _ for the purposes of the - % control sequence corresponding to the node, but it has to expand - % into the usual \leavevmode...\vrule stuff for purposes of - % printing. So we \turnoffactive for the \refx-snt, back on for the - % printing, back off for the \refx-pg. - {\normalturnoffactive - % Only output a following space if the -snt ref is nonempty; for - % @unnumbered and @anchor, it won't be. - \setbox2 = \hbox{\ignorespaces \refx{#1-snt}{}}% - \ifdim \wd2 > 0pt \refx{#1-snt}\space\fi - }% - % [mynode], - [\printednodename],\space - % page 3 - \turnoffactive \putwordpage\tie\refx{#1-pg}{}% + % node/anchor (non-float) references. + % + % If we use \unhbox0 and \unhbox1 to print the node names, TeX does not + % insert empty discretionaries after hyphens, which means that it will + % not find a line break at a hyphen in a node names. Since some manuals + % are best written with fairly long node names, containing hyphens, this + % is a loss. Therefore, we give the text of the node name again, so it + % is as if TeX is seeing it for the first time. + \ifdim \wd1 > 0pt + \putwordsection{} ``\printedrefname'' \putwordin{} \cite{\printedmanual}% + \else + % _ (for example) has to be the character _ for the purposes of the + % control sequence corresponding to the node, but it has to expand + % into the usual \leavevmode...\vrule stuff for purposes of + % printing. So we \turnoffactive for the \refx-snt, back on for the + % printing, back off for the \refx-pg. + {\turnoffactive \otherbackslash + % Only output a following space if the -snt ref is nonempty; for + % @unnumbered and @anchor, it won't be. + \setbox2 = \hbox{\ignorespaces \refx{#1-snt}{}}% + \ifdim \wd2 > 0pt \refx{#1-snt}\space\fi + }% + % output the `[mynode]' via a macro so it can be overridden. + \xrefprintnodename\printedrefname + % + % But we always want a comma and a space: + ,\space + % + % output the `page 3'. + \turnoffactive \otherbackslash \putwordpage\tie\refx{#1-pg}{}% + \fi \fi \endlink \endgroup} -% \dosetq is the interface for calls from other macros - -% Use \normalturnoffactive so that punctuation chars such as underscore -% and backslash work in node names. (\turnoffactive doesn't do \.) -\def\dosetq#1#2{% - {\let\folio=0% - \normalturnoffactive - \edef\next{\write\auxfile{\internalsetq{#1}{#2}}}% - \iflinks - \next - \fi - }% -} - -% \internalsetq {foo}{page} expands into -% CHARACTERS 'xrdef {foo}{...expansion of \Ypage...} -% When the aux file is read, ' is the escape character - -\def\internalsetq #1#2{'xrdef {#1}{\csname #2\endcsname}} - -% Things to be expanded by \internalsetq - -\def\Ypagenumber{\folio} - -\def\Ytitle{\thissection} - -\def\Ynothing{} - -\def\Ysectionnumberandtype{% -\ifnum\secno=0 \putwordChapter\xreftie\the\chapno % -\else \ifnum \subsecno=0 \putwordSection\xreftie\the\chapno.\the\secno % -\else \ifnum \subsubsecno=0 % -\putwordSection\xreftie\the\chapno.\the\secno.\the\subsecno % -\else % -\putwordSection\xreftie\the\chapno.\the\secno.\the\subsecno.\the\subsubsecno % -\fi \fi \fi } - -\def\Yappendixletterandtype{% -\ifnum\secno=0 \putwordAppendix\xreftie'char\the\appendixno{}% -\else \ifnum \subsecno=0 \putwordSection\xreftie'char\the\appendixno.\the\secno % -\else \ifnum \subsubsecno=0 % -\putwordSection\xreftie'char\the\appendixno.\the\secno.\the\subsecno % -\else % -\putwordSection\xreftie'char\the\appendixno.\the\secno.\the\subsecno.\the\subsubsecno % -\fi \fi \fi } - -\gdef\xreftie{'tie} - -% Use TeX 3.0's \inputlineno to get the line number, for better error -% messages, but if we're using an old version of TeX, don't do anything. +% This macro is called from \xrefX for the `[nodename]' part of xref +% output. It's a separate macro only so it can be changed more easily, +% since square brackets don't work well in some documents. Particularly +% one that Bob is working on :). % -\ifx\inputlineno\thisisundefined - \let\linenumber = \empty % Non-3.0. -\else - \def\linenumber{\the\inputlineno:\space} -\fi +\def\xrefprintnodename#1{[#1]} + +% Things referred to by \setref. +% +\def\Ynothing{} +\def\Yomitfromtoc{} +\def\Ynumbered{% + \ifnum\secno=0 + \putwordChapter@tie \the\chapno + \else \ifnum\subsecno=0 + \putwordSection@tie \the\chapno.\the\secno + \else \ifnum\subsubsecno=0 + \putwordSection@tie \the\chapno.\the\secno.\the\subsecno + \else + \putwordSection@tie \the\chapno.\the\secno.\the\subsecno.\the\subsubsecno + \fi\fi\fi +} +\def\Yappendix{% + \ifnum\secno=0 + \putwordAppendix@tie @char\the\appendixno{}% + \else \ifnum\subsecno=0 + \putwordSection@tie @char\the\appendixno.\the\secno + \else \ifnum\subsubsecno=0 + \putwordSection@tie @char\the\appendixno.\the\secno.\the\subsecno + \else + \putwordSection@tie + @char\the\appendixno.\the\secno.\the\subsecno.\the\subsubsecno + \fi\fi\fi +} % Define \refx{NAME}{SUFFIX} to reference a cross-reference string named NAME. % If its value is nonempty, SUFFIX is output afterward. - +% \def\refx#1#2{% - \expandafter\ifx\csname X#1\endcsname\relax + {% + \indexnofonts + \otherbackslash + \expandafter\global\expandafter\let\expandafter\thisrefX + \csname XR#1\endcsname + }% + \ifx\thisrefX\relax % If not defined, say something at least. \angleleft un\-de\-fined\angleright \iflinks @@ -5313,21 +6027,49 @@ width0pt\relax} \fi \fi \else % It's defined, so just use it. - \csname X#1\endcsname + \thisrefX \fi #2% Output the suffix in any case. } -% This is the macro invoked by entries in the aux file. +% This is the macro invoked by entries in the aux file. Usually it's +% just a \def (we prepend XR to the control sequence name to avoid +% collisions). But if this is a float type, we have more work to do. % -\def\xrdef#1{\begingroup - % Reenable \ as an escape while reading the second argument. - \catcode`\\ = 0 - \afterassignment\endgroup - \expandafter\gdef\csname X#1\endcsname +\def\xrdef#1#2{% + \expandafter\gdef\csname XR#1\endcsname{#2}% remember this xref value. + % + % Was that xref control sequence that we just defined for a float? + \expandafter\iffloat\csname XR#1\endcsname + % it was a float, and we have the (safe) float type in \iffloattype. + \expandafter\let\expandafter\floatlist + \csname floatlist\iffloattype\endcsname + % + % Is this the first time we've seen this float type? + \expandafter\ifx\floatlist\relax + \toks0 = {\do}% yes, so just \do + \else + % had it before, so preserve previous elements in list. + \toks0 = \expandafter{\floatlist\do}% + \fi + % + % Remember this xref in the control sequence \floatlistFLOATTYPE, + % for later use in \listoffloats. + \expandafter\xdef\csname floatlist\iffloattype\endcsname{\the\toks0{#1}}% + \fi } % Read the last existing aux file, if any. No error if none exists. +% +\def\tryauxfile{% + \openin 1 \jobname.aux + \ifeof 1 \else + \readauxfile + \global\havexrefstrue + \fi + \closein 1 +} + \def\readauxfile{\begingroup \catcode`\^^@=\other \catcode`\^^A=\other @@ -5356,9 +6098,7 @@ width0pt\relax} \fi \catcode`\^^]=\other \catcode`\^^^=\other \catcode`\^^_=\other - \catcode`\@=\other - \catcode`\^=\other - % It was suggested to define this as 7, which would allow ^^e4 etc. + % It was suggested to set the catcode of ^ to 7, which would allow ^^e4 etc. % in xref tags, i.e., node names. But since ^^e4 notation isn't % supported in the main text, it doesn't seem desirable. Furthermore, % that is not enough: for node names that actually contain a ^ @@ -5371,6 +6111,9 @@ width0pt\relax} \fi % \def\auxhat{\def^{'hat }}% extra space so ok if followed by letter % and then to call \auxhat in \setq. % + \catcode`\^=\other + % + % Special characters. Should be turned off anyway, but... \catcode`\~=\other \catcode`\[=\other \catcode`\]=\other @@ -5382,8 +6125,19 @@ width0pt\relax} \fi \catcode`\$=\other \catcode`\#=\other \catcode`\&=\other + \catcode`\%=\other \catcode`+=\other % avoid \+ for paranoia even though we've turned it off - % Make the characters 128-255 be printing characters + % + % This is to support \ in node names and titles, since the \ + % characters end up in a \csname. It's easier than + % leaving it active and making its active definition an actual \ + % character. What I don't understand is why it works in the *value* + % of the xrdef. Seems like it should be a catcode12 \, and that + % should not typeset properly. But it works, so I'm moving on for + % now. --karl, 15jan04. + \catcode`\\=\other + % + % Make the characters 128-255 be printing characters. {% \count 1=128 \def\loop{% @@ -5392,31 +6146,18 @@ width0pt\relax} \fi \ifnum \count 1<256 \loop \fi }% }% - % The aux file uses ' as the escape (for now). - % Turn off \ as an escape so we do not lose on - % entries which were dumped with control sequences in their names. - % For example, 'xrdef {$\leq $-fun}{page ...} made by @defun ^^ - % Reference to such entries still does not work the way one would wish, - % but at least they do not bomb out when the aux file is read in. + % + % @ is our escape character in .aux files, and we need braces. \catcode`\{=1 \catcode`\}=2 - \catcode`\%=\other - \catcode`\'=0 - \catcode`\\=\other + \catcode`\@=0 % - \openin 1 \jobname.aux - \ifeof 1 \else - \closein 1 - \input \jobname.aux - \global\havexrefstrue - \global\warnedobstrue - \fi - % Open the new aux file. TeX will close it automatically at exit. - \openout\auxfile=\jobname.aux + \input \jobname.aux \endgroup} -% Footnotes. +\message{insertions,} +% including footnotes. \newcount \footnoteno @@ -5430,37 +6171,39 @@ width0pt\relax} \fi % @footnotestyle is meaningful for info output only. \let\footnotestyle=\comment -\let\ptexfootnote=\footnote - {\catcode `\@=11 % % Auto-number footnotes. Otherwise like plain. \gdef\footnote{% + \let\indent=\ptexindent + \let\noindent=\ptexnoindent \global\advance\footnoteno by \@ne \edef\thisfootno{$^{\the\footnoteno}$}% % % In case the footnote comes at the end of a sentence, preserve the % extra spacing after we do the footnote number. \let\@sf\empty - \ifhmode\edef\@sf{\spacefactor\the\spacefactor}\/\fi + \ifhmode\edef\@sf{\spacefactor\the\spacefactor}\ptexslash\fi % % Remove inadvertent blank space before typesetting the footnote number. \unskip \thisfootno\@sf - \footnotezzz + \dofootnote }% % Don't bother with the trickery in plain.tex to not require the % footnote text as a parameter. Our footnotes don't need to be so general. % -% Oh yes, they do; otherwise, @ifset and anything else that uses -% \parseargline fail inside footnotes because the tokens are fixed when +% Oh yes, they do; otherwise, @ifset (and anything else that uses +% \parseargline) fails inside footnotes because the tokens are fixed when % the footnote is read. --karl, 16nov96. % -\long\gdef\footnotezzz{\insert\footins\bgroup +\gdef\dofootnote{% + \insert\footins\bgroup % We want to typeset this text as a normal paragraph, even if the % footnote reference occurs in (for example) a display environment. % So reset some parameters. + \hsize=\pagewidth \interlinepenalty\interfootnotelinepenalty \splittopskip\ht\strutbox % top baseline for broken footnotes \splitmaxdepth\dp\strutbox @@ -5471,8 +6214,17 @@ width0pt\relax} \fi \xspaceskip\z@skip \parindent\defaultparindent % - % Hang the footnote text off the number. - \hang + \smallfonts \rm + % + % Because we use hanging indentation in footnotes, a @noindent appears + % to exdent this text, so make it be a no-op. makeinfo does not use + % hanging indentation so @noindent can still be needed within footnote + % text after an @example or the like (not that this is good style). + \let\noindent = \relax + % + % Hang the footnote text off the number. Use \everypar in case the + % footnote extends for more than one paragraph. + \everypar = {\hang}% \textindent{\thisfootno}% % % Don't crash into the line above the footnote text. Since this @@ -5481,66 +6233,68 @@ width0pt\relax} \fi \footstrut \futurelet\next\fo@t } -\def\fo@t{\ifcat\bgroup\noexpand\next \let\next\f@@t - \else\let\next\f@t\fi \next} -\def\f@@t{\bgroup\aftergroup\@foot\let\next} -\def\f@t#1{#1\@foot} -\def\@foot{\strut\egroup} - }%end \catcode `\@=11 -% Set the baselineskip to #1, and the lineskip and strut size -% correspondingly. There is no deep meaning behind these magic numbers -% used as factors; they just match (closely enough) what Knuth defined. +% In case a @footnote appears in a vbox, save the footnote text and create +% the real \insert just after the vbox finished. Otherwise, the insertion +% would be lost. +% Similarily, if a @footnote appears inside an alignment, save the footnote +% text to a box and make the \insert when a row of the table is finished. +% And the same can be done for other insert classes. --kasal, 16nov03. + +% Replace the \insert primitive by a cheating macro. +% Deeper inside, just make sure that the saved insertions are not spilled +% out prematurely. % -\def\lineskipfactor{.08333} -\def\strutheightpercent{.70833} -\def\strutdepthpercent {.29167} -% -\def\setleading#1{% - \normalbaselineskip = #1\relax - \normallineskip = \lineskipfactor\normalbaselineskip - \normalbaselines - \setbox\strutbox =\hbox{% - \vrule width0pt height\strutheightpercent\baselineskip - depth \strutdepthpercent \baselineskip - }% +\def\startsavinginserts{% + \ifx \insert\ptexinsert + \let\insert\saveinsert + \else + \let\checkinserts\relax + \fi } -% @| inserts a changebar to the left of the current line. It should -% surround any changed text. This approach does *not* work if the -% change spans more than two lines of output. To handle that, we would -% have adopt a much more difficult approach (putting marks into the main -% vertical list for the beginning and end of each change). +% This \insert replacement works for both \insert\footins{foo} and +% \insert\footins\bgroup foo\egroup, but it doesn't work for \insert27{foo}. % -\def\|{% - % \vadjust can only be used in horizontal mode. - \leavevmode - % - % Append this vertical mode material after the current line in the output. - \vadjust{% - % We want to insert a rule with the height and depth of the current - % leading; that is exactly what \strutbox is supposed to record. - \vskip-\baselineskip - % - % \vadjust-items are inserted at the left edge of the type. So - % the \llap here moves out into the left-hand margin. - \llap{% - % - % For a thicker or thinner bar, change the `1pt'. - \vrule height\baselineskip width1pt - % - % This is the space between the bar and the text. - \hskip 12pt - }% - }% +\def\saveinsert#1{% + \edef\next{\noexpand\savetobox \makeSAVEname#1}% + \afterassignment\next + % swallow the left brace + \let\temp = +} +\def\makeSAVEname#1{\makecsname{SAVE\expandafter\gobble\string#1}} +\def\savetobox#1{\global\setbox#1 = \vbox\bgroup \unvbox#1} + +\def\checksaveins#1{\ifvoid#1\else \placesaveins#1\fi} + +\def\placesaveins#1{% + \ptexinsert \csname\expandafter\gobblesave\string#1\endcsname + {\box#1}% } -% For a final copy, take out the rectangles -% that mark overfull boxes (in case you have decided -% that the text looks ok even though it passes the margin). -% -\def\finalout{\overfullrule=0pt} +% eat @SAVE -- beware, all of them have catcode \other: +{ + \def\dospecials{\do S\do A\do V\do E} \uncatcodespecials % ;-) + \gdef\gobblesave @SAVE{} +} + +% initialization: +\def\newsaveins #1{% + \edef\next{\noexpand\newsaveinsX \makeSAVEname#1}% + \next +} +\def\newsaveinsX #1{% + \csname newbox\endcsname #1% + \expandafter\def\expandafter\checkinserts\expandafter{\checkinserts + \checksaveins #1}% +} + +% initialize: +\let\checkinserts\empty +\newsaveins\footins +\newsaveins\margin + % @image. We use the macros from epsf.tex to support this. % If epsf.tex is not installed and @image is used, we complain. @@ -5550,12 +6304,12 @@ width0pt\relax} \fi % undone and the next image would fail. \openin 1 = epsf.tex \ifeof 1 \else - \closein 1 - % Do not bother showing banner with post-v2.7 epsf.tex (available in - % doc/epsf.tex until it shows up on ctan). + % Do not bother showing banner with epsf.tex v2.7k (available in + % doc/epsf.tex and on ctan). \def\epsfannounce{\toks0 = }% \input epsf.tex \fi +\closein 1 % % We will only complain once about lack of epsf.tex. \newif\ifwarnednoepsf @@ -5571,41 +6325,291 @@ width0pt\relax} \fi \global\warnednoepsftrue \fi \else - \imagexxx #1,,,\finish + \imagexxx #1,,,,,\finish \fi } % % Arguments to @image: % #1 is (mandatory) image filename; we tack on .eps extension. % #2 is (optional) width, #3 is (optional) height. -% #4 is just the usual extra ignored arg for parsing this stuff. -\def\imagexxx#1,#2,#3,#4\finish{% +% #4 is (ignored optional) html alt text. +% #5 is (ignored optional) extension. +% #6 is just the usual extra ignored arg for parsing this stuff. +\newif\ifimagevmode +\def\imagexxx#1,#2,#3,#4,#5,#6\finish{\begingroup + \catcode`\^^M = 5 % in case we're inside an example + \normalturnoffactive % allow _ et al. in names + % If the image is by itself, center it. + \ifvmode + \imagevmodetrue + \nobreak\bigskip + % Usually we'll have text after the image which will insert + % \parskip glue, so insert it here too to equalize the space + % above and below. + \nobreak\vskip\parskip + \nobreak + \line\bgroup\hss + \fi + % + % Output the image. \ifpdf - \centerline{\dopdfimage{#1}{#2}{#3}}% + \dopdfimage{#1}{#2}{#3}% \else % \epsfbox itself resets \epsf?size at each figure. \setbox0 = \hbox{\ignorespaces #2}\ifdim\wd0 > 0pt \epsfxsize=#2\relax \fi \setbox0 = \hbox{\ignorespaces #3}\ifdim\wd0 > 0pt \epsfysize=#3\relax \fi - \begingroup - \catcode`\^^M = 5 % in case we're inside an example - % If the image is by itself, center it. - \ifvmode - \nobreak\bigskip - % Usually we'll have text after the image which will insert - % \parskip glue, so insert it here too to equalize the space - % above and below. - \nobreak\vskip\parskip - \nobreak - \centerline{\epsfbox{#1.eps}}% - \bigbreak - \else - % In the middle of a paragraph, no extra space. - \epsfbox{#1.eps}% + \epsfbox{#1.eps}% + \fi + % + \ifimagevmode \hss \egroup \bigbreak \fi % space after the image +\endgroup} + + +% @float FLOATTYPE,LOC ... @end float for displayed figures, tables, etc. +% We don't actually implement floating yet, we just plop the float "here". +% But it seemed the best name for the future. +% +\envparseargdef\float{\dofloat #1,,,\finish} + +% #1 is the optional FLOATTYPE, the text label for this float, typically +% "Figure", "Table", "Example", etc. Can't contain commas. If omitted, +% this float will not be numbered and cannot be referred to. +% +% #2 is the optional xref label. Also must be present for the float to +% be referable. +% +% #3 is the optional positioning argument; for now, it is ignored. It +% will somehow specify the positions allowed to float to (here, top, bottom). +% +% We keep a separate counter for each FLOATTYPE, which we reset at each +% chapter-level command. +\let\resetallfloatnos=\empty +% +\def\dofloat#1,#2,#3,#4\finish{% + \let\thiscaption=\empty + \let\thisshortcaption=\empty + % + % don't lose footnotes inside @float. + \startsavinginserts + % + % We can't be used inside a paragraph. + \par + % + \vtop\bgroup + \def\floattype{#1}% + \def\floatlabel{#2}% + \def\floatloc{#3}% we do nothing with this yet. + % + \ifx\floattype\empty + \let\safefloattype=\empty + \else + {% + % the floattype might have accents or other special characters, + % but we need to use it in a control sequence name. + \indexnofonts + \turnoffactive + \xdef\safefloattype{\floattype}% + }% + \fi + % + % If label is given but no type, we handle that as the empty type. + \ifx\floatlabel\empty \else + % We want each FLOATTYPE to be numbered separately (Figure 1, + % Table 1, Figure 2, ...). (And if no label, no number.) + % + \expandafter\getfloatno\csname\safefloattype floatno\endcsname + \global\advance\floatno by 1 + % + {% + % This magic value for \thissection is output by \setref as the + % XREFLABEL-title value. \xrefX uses it to distinguish float + % labels (which have a completely different output format) from + % node and anchor labels. And \xrdef uses it to construct the + % lists of floats. + % + \edef\thissection{\floatmagic=\safefloattype}% + \setref{\floatlabel}{Yfloat}% + }% + \fi + % + % start with \parskip glue, I guess. + \vskip\parskip + % + % Don't suppress indentation if a float happens to start a section. + \restorefirstparagraphindent +} + +% we have these possibilities: +% @float Foo,lbl & @caption{Cap}: Foo 1.1: Cap +% @float Foo,lbl & no caption: Foo 1.1 +% @float Foo & @caption{Cap}: Foo: Cap +% @float Foo & no caption: Foo +% @float ,lbl & Caption{Cap}: 1.1: Cap +% @float ,lbl & no caption: 1.1 +% @float & @caption{Cap}: Cap +% @float & no caption: +% +\def\Efloat{% + \let\floatident = \empty + % + % In all cases, if we have a float type, it comes first. + \ifx\floattype\empty \else \def\floatident{\floattype}\fi + % + % If we have an xref label, the number comes next. + \ifx\floatlabel\empty \else + \ifx\floattype\empty \else % if also had float type, need tie first. + \appendtomacro\floatident{\tie}% \fi + % the number. + \appendtomacro\floatident{\chaplevelprefix\the\floatno}% + \fi + % + % Start the printed caption with what we've constructed in + % \floatident, but keep it separate; we need \floatident again. + \let\captionline = \floatident + % + \ifx\thiscaption\empty \else + \ifx\floatident\empty \else + \appendtomacro\captionline{: }% had ident, so need a colon between + \fi + % + % caption text. + \appendtomacro\captionline\thiscaption + \fi + % + % If we have anything to print, print it, with space before. + % Eventually this needs to become an \insert. + \ifx\captionline\empty \else + \vskip.5\parskip + \captionline + \fi + % + % If have an xref label, write the list of floats info. Do this + % after the caption, to avoid chance of it being a breakpoint. + \ifx\floatlabel\empty \else + % Write the text that goes in the lof to the aux file as + % \floatlabel-lof. Besides \floatident, we include the short + % caption if specified, else the full caption if specified, else nothing. + {% + \atdummies \turnoffactive \otherbackslash + \immediate\write\auxfile{@xrdef{\floatlabel-lof}{% + \floatident + \ifx\thisshortcaption\empty + \ifx\thiscaption\empty \else : \thiscaption \fi + \else + : \thisshortcaption + \fi + }}% + }% + \fi + % + % Space below caption, if we printed anything. + \ifx\printedsomething\empty \else \vskip\parskip \fi + \egroup % end of \vtop + \checkinserts +} + +% Append the tokens #2 to the definition of macro #1, not expanding either. +% +\newtoks\appendtomacroAtoks +\newtoks\appendtomacroBtoks +\def\appendtomacro#1#2{% + \appendtomacroAtoks = \expandafter{#1}% + \appendtomacroBtoks = {#2}% + \edef#1{\the\appendtomacroAtoks \the\appendtomacroBtoks}% +} + +% @caption, @shortcaption are easy. +% +\long\def\caption#1{\checkenv\float \def\thiscaption{#1}} +\def\shortcaption#1{\checkenv\float \def\thisshortcaption{#1}} + +% The parameter is the control sequence identifying the counter we are +% going to use. Create it if it doesn't exist and assign it to \floatno. +\def\getfloatno#1{% + \ifx#1\relax + % Haven't seen this figure type before. + \csname newcount\endcsname #1% + % + % Remember to reset this floatno at the next chap. + \expandafter\gdef\expandafter\resetallfloatnos + \expandafter{\resetallfloatnos #1=0 }% + \fi + \let\floatno#1% +} + +% \setref calls this to get the XREFLABEL-snt value. We want an @xref +% to the FLOATLABEL to expand to "Figure 3.1". We call \setref when we +% first read the @float command. +% +\def\Yfloat{\floattype@tie \chaplevelprefix\the\floatno}% + +% Magic string used for the XREFLABEL-title value, so \xrefX can +% distinguish floats from other xref types. +\def\floatmagic{!!float!!} + +% #1 is the control sequence we are passed; we expand into a conditional +% which is true if #1 represents a float ref. That is, the magic +% \thissection value which we \setref above. +% +\def\iffloat#1{\expandafter\doiffloat#1==\finish} +% +% #1 is (maybe) the \floatmagic string. If so, #2 will be the +% (safe) float type for this float. We set \iffloattype to #2. +% +\def\doiffloat#1=#2=#3\finish{% + \def\temp{#1}% + \def\iffloattype{#2}% + \ifx\temp\floatmagic +} + +% @listoffloats FLOATTYPE - print a list of floats like a table of contents. +% +\parseargdef\listoffloats{% + \def\floattype{#1}% floattype + {% + % the floattype might have accents or other special characters, + % but we need to use it in a control sequence name. + \indexnofonts + \turnoffactive + \xdef\safefloattype{\floattype}% + }% + % + % \xrdef saves the floats as a \do-list in \floatlistSAFEFLOATTYPE. + \expandafter\ifx\csname floatlist\safefloattype\endcsname \relax + \ifhavexrefs + % if the user said @listoffloats foo but never @float foo. + \message{\linenumber No `\safefloattype' floats to list.}% + \fi + \else + \begingroup + \leftskip=\tocindent % indent these entries like a toc + \let\do=\listoffloatsdo + \csname floatlist\safefloattype\endcsname \endgroup \fi } +% This is called on each entry in a list of floats. We're passed the +% xref label, in the form LABEL-title, which is how we save it in the +% aux file. We strip off the -title and look up \XRLABEL-lof, which +% has the text we're supposed to typeset here. +% +% Figures without xref labels will not be included in the list (since +% they won't appear in the aux file). +% +\def\listoffloatsdo#1{\listoffloatsdoentry#1\finish} +\def\listoffloatsdoentry#1-title\finish{{% + % Can't fully expand XR#1-lof because it can contain anything. Just + % pass the control sequence. On the other hand, XR#1-pg is just the + % page number, and we want to fully expand that so we can get a link + % in pdf output. + \toksA = \expandafter{\csname XR#1-lof\endcsname}% + % + % use the same \entry macro we use to generate the TOC and index. + \edef\writeentry{\noexpand\entry{\the\toksA}{\csname XR#1-pg\endcsname}}% + \writeentry +}} \message{localization,} % and i18n. @@ -5615,19 +6619,17 @@ width0pt\relax} \fi % properly. Single argument is the language abbreviation. % It would be nice if we could set up a hyphenation file here. % -\def\documentlanguage{\parsearg\dodocumentlanguage} -\def\dodocumentlanguage#1{% +\parseargdef\documentlanguage{% \tex % read txi-??.tex file in plain TeX. - % Read the file if it exists. - \openin 1 txi-#1.tex - \ifeof1 - \errhelp = \nolanghelp - \errmessage{Cannot read language file txi-#1.tex}% - \let\temp = \relax - \else - \def\temp{\input txi-#1.tex }% - \fi - \temp + % Read the file if it exists. + \openin 1 txi-#1.tex + \ifeof 1 + \errhelp = \nolanghelp + \errmessage{Cannot read language file txi-#1.tex}% + \else + \input txi-#1.tex + \fi + \closein 1 \endgroup } \newhelp\nolanghelp{The given language definition file cannot be found or @@ -5673,10 +6675,13 @@ should work if nowhere else does.} } % Parameters in order: 1) textheight; 2) textwidth; 3) voffset; -% 4) hoffset; 5) binding offset; 6) topskip. Then whoever calls us can -% set \parskip and call \setleading for \baselineskip. +% 4) hoffset; 5) binding offset; 6) topskip; 7) physical page height; 8) +% physical page width. % -\def\internalpagesizes#1#2#3#4#5#6{% +% We also call \setleading{\textleading}, so the caller should define +% \textleading. The caller should also set \parskip. +% +\def\internalpagesizes#1#2#3#4#5#6#7#8{% \voffset = #3\relax \topskip = #6\relax \splittopskip = \topskip @@ -5695,6 +6700,13 @@ should work if nowhere else does.} \normaloffset = #4\relax \bindingoffset = #5\relax % + \ifpdf + \pdfpageheight #7\relax + \pdfpagewidth #8\relax + \fi + % + \setleading{\textleading} + % \parindent = \defaultparindent \setemergencystretch } @@ -5702,76 +6714,122 @@ should work if nowhere else does.} % @letterpaper (the default). \def\letterpaper{{\globaldefs = 1 \parskip = 3pt plus 2pt minus 1pt - \setleading{13.2pt}% + \textleading = 13.2pt % % If page is nothing but text, make it come out even. - \internalpagesizes{46\baselineskip}{6in}{\voffset}{.25in}{\bindingoffset}{36pt}% + \internalpagesizes{46\baselineskip}{6in}% + {\voffset}{.25in}% + {\bindingoffset}{36pt}% + {11in}{8.5in}% }} % Use @smallbook to reset parameters for 7x9.5 (or so) format. \def\smallbook{{\globaldefs = 1 \parskip = 2pt plus 1pt - \setleading{12pt}% + \textleading = 12pt % - \internalpagesizes{7.5in}{5.in}{\voffset}{.25in}{\bindingoffset}{16pt}% + \internalpagesizes{7.5in}{5in}% + {\voffset}{.25in}% + {\bindingoffset}{16pt}% + {9.25in}{7in}% % \lispnarrowing = 0.3in \tolerance = 700 \hfuzz = 1pt \contentsrightmargin = 0pt - \deftypemargin = 0pt \defbodyindent = .5cm - % - \let\smalldisplay = \smalldisplayx - \let\smallexample = \smalllispx - \let\smallformat = \smallformatx - \let\smalllisp = \smalllispx }} % Use @afourpaper to print on European A4 paper. \def\afourpaper{{\globaldefs = 1 - \setleading{12pt}% \parskip = 3pt plus 2pt minus 1pt + \textleading = 13.2pt % - \internalpagesizes{53\baselineskip}{160mm}{\voffset}{4mm}{\bindingoffset}{44pt}% + % Double-side printing via postscript on Laserjet 4050 + % prints double-sided nicely when \bindingoffset=10mm and \hoffset=-6mm. + % To change the settings for a different printer or situation, adjust + % \normaloffset until the front-side and back-side texts align. Then + % do the same for \bindingoffset. You can set these for testing in + % your texinfo source file like this: + % @tex + % \global\normaloffset = -6mm + % \global\bindingoffset = 10mm + % @end tex + \internalpagesizes{51\baselineskip}{160mm} + {\voffset}{\hoffset}% + {\bindingoffset}{44pt}% + {297mm}{210mm}% % \tolerance = 700 \hfuzz = 1pt + \contentsrightmargin = 0pt + \defbodyindent = 5mm }} -% A specific text layout, 24x15cm overall, intended for A4 paper. Top margin -% 29mm, hence bottom margin 28mm, nominal side margin 3cm. +% Use @afivepaper to print on European A5 paper. +% From romildo@urano.iceb.ufop.br, 2 July 2000. +% He also recommends making @example and @lisp be small. +\def\afivepaper{{\globaldefs = 1 + \parskip = 2pt plus 1pt minus 0.1pt + \textleading = 12.5pt + % + \internalpagesizes{160mm}{120mm}% + {\voffset}{\hoffset}% + {\bindingoffset}{8pt}% + {210mm}{148mm}% + % + \lispnarrowing = 0.2in + \tolerance = 800 + \hfuzz = 1.2pt + \contentsrightmargin = 0pt + \defbodyindent = 2mm + \tableindent = 12mm +}} + +% A specific text layout, 24x15cm overall, intended for A4 paper. \def\afourlatex{{\globaldefs = 1 - \setleading{13.6pt}% - % \afourpaper - \internalpagesizes{237mm}{150mm}{3.6mm}{3.6mm}{3mm}{7mm}% + \internalpagesizes{237mm}{150mm}% + {\voffset}{4.6mm}% + {\bindingoffset}{7mm}% + {297mm}{210mm}% % + % Must explicitly reset to 0 because we call \afourpaper. \globaldefs = 0 }} -% Use @afourwide to print on European A4 paper in wide format. -\def\afourwide{% +% Use @afourwide to print on A4 paper in landscape format. +\def\afourwide{{\globaldefs = 1 \afourpaper - \internalpagesizes{9.5in}{6.5in}{\hoffset}{\normaloffset}{\bindingoffset}{7mm}% - % + \internalpagesizes{241mm}{165mm}% + {\voffset}{-2.95mm}% + {\bindingoffset}{7mm}% + {297mm}{210mm}% \globaldefs = 0 -} +}} % @pagesizes TEXTHEIGHT[,TEXTWIDTH] % Perhaps we should allow setting the margins, \topskip, \parskip, % and/or leading, also. Or perhaps we should compute them somehow. % -\def\pagesizes{\parsearg\pagesizesxxx} -\def\pagesizesxxx#1{\pagesizesyyy #1,,\finish} +\parseargdef\pagesizes{\pagesizesyyy #1,,\finish} \def\pagesizesyyy#1,#2,#3\finish{{% \setbox0 = \hbox{\ignorespaces #2}\ifdim\wd0 > 0pt \hsize=#2\relax \fi \globaldefs = 1 % \parskip = 3pt plus 2pt minus 1pt - \setleading{13.2pt}% + \setleading{\textleading}% % - \internalpagesizes{#1}{\hsize}{\voffset}{\normaloffset}{\bindingoffset}{44pt}% + \dimen0 = #1 + \advance\dimen0 by \voffset + % + \dimen2 = \hsize + \advance\dimen2 by \normaloffset + % + \internalpagesizes{#1}{\hsize}% + {\voffset}{\normaloffset}% + {\bindingoffset}{44pt}% + {\dimen0}{\dimen2}% }} % Set default to letter. @@ -5799,10 +6857,10 @@ should work if nowhere else does.} \def\normalless{<} \def\normalgreater{>} \def\normalplus{+} -\def\normaldollar{$} +\def\normaldollar{$}%$ font-lock fix -% This macro is used to make a character print one way in ttfont -% where it can probably just be output, and another way in other fonts, +% This macro is used to make a character print one way in \tt +% (where it can probably be output as-is), and another way in other fonts, % where something hairier probably needs to be done. % % #1 is what to print if we are indeed using \tt; #2 is what to print @@ -5835,7 +6893,7 @@ should work if nowhere else does.} \catcode`\_=\active \def_{\ifusingtt\normalunderscore\_} % Subroutine for the previous macro. -\def\_{\leavevmode \kern.06em \vbox{\hrule width.3em height.1ex}} +\def\_{\leavevmode \kern.07em \vbox{\hrule width.3em height.1ex}\kern .07em } \catcode`\|=\active \def|{{\tt\char124}} @@ -5848,16 +6906,7 @@ should work if nowhere else does.} \catcode`\+=\active \def+{{\tt \char 43}} \catcode`\$=\active -\def${\ifusingit{{\sl\$}}\normaldollar} -%\catcode 27=\active -%\def^^[{$\diamondsuit$} - -% Set up an active definition for =, but don't enable it most of the time. -{\catcode`\==\active -\global\def={{\tt \char 61}}} - -\catcode`+=\active -\catcode`\_=\active +\def${\ifusingit{{\sl\$}}\normaldollar}%$ font-lock fix % If a .fmt file is being used, characters that might appear in a file % name cannot be active until we have parsed the command line. @@ -5867,44 +6916,48 @@ should work if nowhere else does.} \catcode`\@=0 -% \rawbackslashxx output one backslash character in current font -\global\chardef\rawbackslashxx=`\\ -%{\catcode`\\=\other -%@gdef@rawbackslashxx{\}} +% \backslashcurfont outputs one backslash character in current font, +% as in \char`\\. +\global\chardef\backslashcurfont=`\\ +\global\let\rawbackslashxx=\backslashcurfont % let existing .??s files work -% \rawbackslash redefines \ as input to do \rawbackslashxx. +% \rawbackslash defines an active \ to do \backslashcurfont. +% \otherbackslash defines an active \ to be a literal `\' character with +% catcode other. {\catcode`\\=\active -@gdef@rawbackslash{@let\=@rawbackslashxx }} + @gdef@rawbackslash{@let\=@backslashcurfont} + @gdef@otherbackslash{@let\=@realbackslash} +} + +% \realbackslash is an actual character `\' with catcode other. +{\catcode`\\=\other @gdef@realbackslash{\}} % \normalbackslash outputs one backslash in fixed width font. -\def\normalbackslash{{\tt\rawbackslashxx}} +\def\normalbackslash{{\tt\backslashcurfont}} -% \catcode 17=0 % Define control-q \catcode`\\=\active % Used sometimes to turn off (effectively) the active characters % even after parsing them. -@def@turnoffactive{@let"=@normaldoublequote -@let\=@realbackslash -@let~=@normaltilde -@let^=@normalcaret -@let_=@normalunderscore -@let|=@normalverticalbar -@let<=@normalless -@let>=@normalgreater -@let+=@normalplus -@let$=@normaldollar} +@def@turnoffactive{% + @let"=@normaldoublequote + @let\=@realbackslash + @let~=@normaltilde + @let^=@normalcaret + @let_=@normalunderscore + @let|=@normalverticalbar + @let<=@normalless + @let>=@normalgreater + @let+=@normalplus + @let$=@normaldollar %$ font-lock fix + @unsepspaces +} -@def@normalturnoffactive{@let"=@normaldoublequote -@let\=@normalbackslash -@let~=@normaltilde -@let^=@normalcaret -@let_=@normalunderscore -@let|=@normalverticalbar -@let<=@normalless -@let>=@normalgreater -@let+=@normalplus -@let$=@normaldollar} +% Same as @turnoffactive except outputs \ as {\tt\char`\\} instead of +% the literal character `\'. (Thus, \ is not expandable when this is in +% effect.) +% +@def@normalturnoffactive{@turnoffactive @let\=@normalbackslash} % Make _ and + \other characters, temporarily. % This is canceled by @fixbackslash. @@ -5932,15 +6985,11 @@ should work if nowhere else does.} % Say @foo, not \foo, in error messages. @escapechar = `@@ -% These look ok in all fonts, so just make them not special. +% These look ok in all fonts, so just make them not special. @catcode`@& = @other @catcode`@# = @other @catcode`@% = @other -@c Set initial fonts. -@textfonts -@rm - @c Local variables: @c eval: (add-hook 'write-file-hooks 'time-stamp) @@ -5949,3 +6998,9 @@ should work if nowhere else does.} @c time-stamp-format: "%:y-%02m-%02d.%02H" @c time-stamp-end: "}" @c End: + +@c vim:sw=2: + +@ignore + arch-tag: e1b36e32-c96e-4135-a41a-0b2efa2ea115 +@end ignore diff --git a/src/conf.c b/src/conf.c index 3be431736..b4e60946a 100644 --- a/src/conf.c +++ b/src/conf.c @@ -4,9 +4,9 @@ #include "conf.h" -char Spice_Version[ ] = VERSION; -char Spice_Notice[ ] = "Please submit bug-reports to: ngspice-devel@lists.sourceforge.net"; -char Spice_Build_Date[ ] = NGSPICEBUILDDATE; +char Spice_Version[] = VERSION; +char Spice_Notice[] = "Please submit bug-reports to: ngspice-devel@lists.sourceforge.net"; +char Spice_Build_Date[] = NGSPICEBUILDDATE; /* char *Spice_Exec_Dir = "/spice_win/bin"; char *Spice_Lib_Dir = "/spice_win/lib"; diff --git a/src/frontend/com_history.c b/src/frontend/com_history.c index 35d94ab24..e337fa4fc 100644 --- a/src/frontend/com_history.c +++ b/src/frontend/com_history.c @@ -71,7 +71,7 @@ cp_histsubst(wordlist *wlist) return (wlist); } if (b < s) { - (void) sprintf(buf, "%.*s%s", s - b, b, + (void) sprintf(buf, "%.*s%s", (int)(s-b), b, n->wl_word); tfree(n->wl_word); n->wl_word = copy(buf); diff --git a/src/frontend/control.c b/src/frontend/control.c index 3f4c46357..cb546dd1d 100644 --- a/src/frontend/control.c +++ b/src/frontend/control.c @@ -819,8 +819,8 @@ cp_evloop(char *string) } /* This blows away the control structures... */ -void -cp_resetcontrol(void) +void cp_free_control(void); /* needed by resetcontrol */ +void cp_resetcontrol(void) { fprintf(cp_err, "Warning: clearing control structures\n"); if (cend[stackp] && cend[stackp]->co_parent) diff --git a/src/frontend/device.c b/src/frontend/device.c index 962dd2510..f9bcdbccd 100644 --- a/src/frontend/device.c +++ b/src/frontend/device.c @@ -577,7 +577,6 @@ com_alter_common(wordlist *wl, int do_model) char *param; struct dvec *dv; struct pnode *names; - char *hlp=NULL; if (!ft_curckt) { fprintf(cp_err, "Error: no circuit loaded\n"); diff --git a/src/frontend/dotcards.c b/src/frontend/dotcards.c index 620af5462..14c87c5e4 100644 --- a/src/frontend/dotcards.c +++ b/src/frontend/dotcards.c @@ -380,7 +380,7 @@ ft_cktcoms(bool terse) static void fixdotplot(wordlist *wl) { - char buf[BSIZE_SP], *s; + char *s; char numbuf[128]; /* Printnum Fix */ double *d, d1, d2; diff --git a/src/frontend/evaluate.c b/src/frontend/evaluate.c index 5c05c3177..902e88fad 100644 --- a/src/frontend/evaluate.c +++ b/src/frontend/evaluate.c @@ -92,7 +92,7 @@ static struct dvec * doop(char what, void*(*func) (void *data1, void *data2, short int datatype1, short int datatype2, - int length), + int length, ...), struct pnode *arg1, struct pnode *arg2) { @@ -707,14 +707,11 @@ apply_func(struct func *func, struct pnode *arg) } (void) signal(SIGILL, (SIGNAL_FUNCTION) sig_matherr); - /* FIXME: The call to (*func->fu_func) has too many arguments; - hence the compiler quits. How to circumvent this (without - losing function prototypes)? For now, these functions have - been disabled. */ if (eq(func->fu_name, "interpolate") || eq(func->fu_name, "deriv")) /* Ack */ { - void *(*f)()=func->fu_func; /* va, a type cast, which loses function prototypes, a warning */ + void *(*f)(void *data, short int type, int length, + int *newlength, short int *newtype, ...)=func->fu_func; data = ((*f) ((isreal(v) ? (void *) v->v_realdata : (void *) v->v_compdata), (short) (isreal(v) ? VF_REAL : VF_COMPLEX), v->v_length, &len, &type, diff --git a/src/frontend/parse.c b/src/frontend/parse.c index f2bcccf98..ce24ad9ab 100644 --- a/src/frontend/parse.c +++ b/src/frontend/parse.c @@ -27,8 +27,8 @@ static struct pnode * mkunode(int op, struct pnode *arg); static struct pnode * mkfnode(char *func, struct pnode *arg); static struct pnode * mknnode(double number); static struct pnode * mksnode(char *string); -static void print_elem(struct element *elem); /* va: for debugging */ -static char * get_token_name(int e_token); /* va, for debugging */ +/*static void print_elem(struct element *elem); / va: for debugging / +static char * get_token_name(int e_token); / va, for debugging */ static int lasttoken = END, lasttype; @@ -582,9 +582,10 @@ makepnode(struct element *elem) } } +/* static char * get_token_name(int e_token) { - /* see include/fteparse.h */ + / see include/fteparse.h / switch (e_token) { case 0: return "END "; case 1: return "PLUS "; @@ -612,6 +613,7 @@ static char * get_token_name(int e_token) default : return "UNKNOWN"; } } + static void print_elem(struct element *elem) { printf("e_token = %d(%s)", elem->e_token, get_token_name(elem->e_token)); @@ -631,7 +633,7 @@ static void print_elem(struct element *elem) } printf("\n"); } - +*/ /* Some auxiliary functions for building the parse tree. */ @@ -700,12 +702,8 @@ struct func ft_funcs[] = { { "vecmin", cx_min } , { "vecmax", cx_max } , { "vecd", cx_d } , - /* va, deactivate function prototype testing for this 2 functions, only. Gives a warning. */ -#define INTERPOL_FUNC (void *(*)()) - /* These functions have been temporarily been disabled. See - their definitions for the reason. */ - { "interpolate", INTERPOL_FUNC cx_interpolate } , - { "deriv", INTERPOL_FUNC cx_deriv } , + { "interpolate", cx_interpolate } , + { "deriv", cx_deriv } , { "v", NULL } , { NULL, NULL } } ; diff --git a/src/frontend/plotting/x11.c b/src/frontend/plotting/x11.c index af277922e..a4836fb69 100644 --- a/src/frontend/plotting/x11.c +++ b/src/frontend/plotting/x11.c @@ -896,7 +896,8 @@ X11_Input(REQUEST *request, RESPONSE *response) { XEvent ev; - int nfds, readfds; + int nfds; + fd_set rfds; switch (request->option) { case char_option: @@ -913,15 +914,19 @@ X11_Input(REQUEST *request, RESPONSE *response) XtDispatchEvent(&ev); } - readfds = 1 << fileno(request->fp) | - 1 << ConnectionNumber(display); - /* block on ConnectionNumber and request->fp */ /* PN: added fd_set * casting */ - select(nfds + 1, (fd_set *)&readfds, (fd_set *) NULL, (fd_set *) NULL, NULL); - + FD_ZERO(&rfds); + FD_SET(fileno(request->fp), &rfds); + FD_SET(ConnectionNumber(display), &rfds); + select (nfds + 1, + &rfds, + (fd_set *)NULL, + (fd_set *)NULL, + NULL); + /* handle X events first */ - if (readfds & (1 << ConnectionNumber(display))) { + if (FD_ISSET (ConnectionNumber(display), &rfds)) { /* handle ALL X events */ while (XtPending()) { XtNextEvent(&ev); @@ -929,7 +934,7 @@ X11_Input(REQUEST *request, RESPONSE *response) } } - if (readfds & (1 << fileno(request->fp))) { + if (FD_ISSET (fileno(request->fp), &rfds)) { response->reply.ch = inchar(request->fp); goto out; } diff --git a/src/frontend/rawfile.c b/src/frontend/rawfile.c index ac7a9f948..1350cab1a 100644 --- a/src/frontend/rawfile.c +++ b/src/frontend/rawfile.c @@ -282,7 +282,11 @@ raw_read(char *name) struct variable *vv; wordlist *wl, *nwl; FILE *fp, *lastin, *lastout, *lasterr; + + +#ifdef __MINGW32__ bool binary = TRUE; +#endif if (!(fp = fopen(name, "r"))) { perror(name); diff --git a/src/frontend/shyu.c b/src/frontend/shyu.c index cad279f0d..6ed78fe10 100644 --- a/src/frontend/shyu.c +++ b/src/frontend/shyu.c @@ -42,7 +42,7 @@ if_sens_run(char *t, wordlist *args, INPtables *tab) char *steptype; char *name; char *line; - struct line deck; + struct line deck[1]; int i; int j; int error; @@ -51,12 +51,12 @@ if_sens_run(char *t, wordlist *args, INPtables *tab) int which = -1; (void) sprintf(buf, ".%s", wl_flatten(args)); - deck.li_next = deck.li_actual = NULL; - deck.li_error = NULL; - deck.li_linenum = 0; - deck.li_line = buf; + deck[0].li_next = deck[0].li_actual = NULL; + deck[0].li_error = NULL; + deck[0].li_linenum = 0; + deck[0].li_line = buf; - current = (card *) &deck; + current = (card *)deck; line = current->line; INPgetTok(&line,&token,1); diff --git a/src/frontend/spiceif.c b/src/frontend/spiceif.c index 0984ec41f..e83205ac0 100644 --- a/src/frontend/spiceif.c +++ b/src/frontend/spiceif.c @@ -195,7 +195,7 @@ if_run(char *t, char *what, wordlist *args, char *tab) { void *ckt = (void *) t; int err; - struct line deck; + struct line deck[1]; char buf[BSIZE_SP]; int j; int which = -1; @@ -219,10 +219,10 @@ if_run(char *t, char *what, wordlist *args, char *tab) s = wl_flatten(args); /* va: tfree char's tmalloc'ed in wl_flatten */ (void) sprintf(buf, ".%s", s); tfree(s); - deck.li_next = deck.li_actual = NULL; - deck.li_error = NULL; - deck.li_linenum = 0; - deck.li_line = buf; + deck[0].li_next = deck[0].li_actual = NULL; + deck[0].li_error = NULL; + deck[0].li_linenum = 0; + deck[0].li_line = buf; /*CDHW Delete any previous special task CDHW*/ @@ -296,10 +296,10 @@ ci_specTask will point to it CDHW*/ /*CDHW ci_curTask and ci_specTask point to the interactive task AAA CDHW*/ - INPpas2(ckt, (card *) &deck, (INPtables *)tab, ft_curckt->ci_specTask); + INPpas2(ckt, (card *)deck, (INPtables *)tab, ft_curckt->ci_specTask); - if (deck.li_error) { - fprintf(cp_err, "Warning: %s\n", deck.li_error); + if (deck[0].li_error) { + fprintf(cp_err, "Warning: %s\n", deck[0].li_error); return 2; } } @@ -559,8 +559,8 @@ spif_getparam(void *ckt, char **name, char *param, int ind, int do_model) IFvalue *pv; IFparm *opt; int typecode, i; - GENinstance *dev=(GENinstance *)NULL; - GENmodel *mod=(GENmodel *)NULL; + GENinstance *dev[1]={ (GENinstance *)NULL }; + GENmodel *mod[1]= { (GENmodel *)NULL }; IFdevice *device; /* fprintf(cp_err, "Calling if_getparam(%s, %s)\n", *name, param); */ @@ -570,7 +570,7 @@ spif_getparam(void *ckt, char **name, char *param, int ind, int do_model) /* MW. My "special routine here" */ INPretrieve(name,(INPtables *)ft_curckt->ci_symtab); - typecode = finddev(ckt, *name,(void**) &dev,(void **) &mod); + typecode = finddev(ckt, *name,(void**)dev,(void **)mod); if (typecode == -1) { fprintf(cp_err, "Error: no such device or model name %s\n", @@ -583,7 +583,7 @@ spif_getparam(void *ckt, char **name, char *param, int ind, int do_model) if(opt->dataType & IF_REDUNDANT || !opt->description) continue; if(!(opt->dataType & IF_ASK)) continue; - pv = doask(ckt, typecode, dev, mod, opt, ind); + pv = doask(ckt, typecode, dev[0], mod[0], opt, ind); if (pv) { tv = parmtovar(pv, opt); if (vv) @@ -600,7 +600,7 @@ spif_getparam(void *ckt, char **name, char *param, int ind, int do_model) /* MW. */ INPretrieve(name,(INPtables *)ft_curckt->ci_symtab); - typecode = finddev(ckt, *name, (void**)&dev, (void **)&mod); + typecode = finddev(ckt, *name, (void**)dev, (void **)mod); if (typecode == -1) { fprintf(cp_err, "Error: no such device or model name %s\n", @@ -608,13 +608,13 @@ spif_getparam(void *ckt, char **name, char *param, int ind, int do_model) return (NULL); } device = ft_sim->devices[typecode]; - opt = parmlookup(device, &dev, param, do_model, 0); + opt = parmlookup(device, dev, param, do_model, 0); if (!opt) { fprintf(cp_err, "Error: no such parameter %s.\n", param); return (NULL); } - pv = doask(ckt, typecode, dev, mod, opt, ind); + pv = doask(ckt, typecode, dev[0], mod[0], opt, ind); if (pv) vv = parmtovar(pv, opt); return (vv); @@ -627,19 +627,19 @@ if_setparam(void *ckt, char **name, char *param, struct dvec *val, int do_model) { IFparm *opt; IFdevice *device; - GENmodel *mod=(GENmodel *)NULL; - GENinstance *dev=(GENinstance *)NULL; + GENmodel *mod[1]={(GENmodel *)NULL}; + GENinstance *dev[1]={(GENinstance *)NULL}; int typecode; /* PN */ INPretrieve(name,(INPtables *)ft_curckt->ci_symtab); - typecode = finddev(ckt, *name, (void**)&dev, (void **)&mod); + typecode = finddev(ckt, *name, (void**)dev, (void **)mod); if (typecode == -1) { fprintf(cp_err, "Error: no such device or model name %s\n", *name); return; } device = ft_sim->devices[typecode]; - opt = parmlookup(device, &dev, param, do_model, 1); + opt = parmlookup(device, dev, param, do_model, 1); if (!opt) { if (param) fprintf(cp_err, "Error: no such parameter %s.\n", param); @@ -647,11 +647,11 @@ if_setparam(void *ckt, char **name, char *param, struct dvec *val, int do_model) fprintf(cp_err, "Error: no default parameter.\n"); return; } - if (do_model && !mod) { - mod = dev->GENmodPtr; - dev = (GENinstance *)NULL; + if (do_model && !mod[0]) { + mod[0] = dev[0]->GENmodPtr; + dev[1] = (GENinstance *)NULL; } - doset(ckt, typecode, dev, mod, opt, val); + doset(ckt, typecode, dev[0], mod[0], opt, val); } static struct variable * diff --git a/src/frontend/subckt.c b/src/frontend/subckt.c index abccdef83..651e448b0 100644 --- a/src/frontend/subckt.c +++ b/src/frontend/subckt.c @@ -61,14 +61,10 @@ extern char * nupa_copy(char *s, int linenum); extern int nupa_eval(char *s, int linenum); extern int nupa_signal(int sig, char *info); static char NumParams='y'; -static char DoGarbage='n'; - #else #define nupa_copy(x,y) copy(x) #define nupa_eval(x,y) 1 #define nupa_signal(x,y) 1 -static char NumParams='n'; -static char DoGarbage='n'; #endif diff --git a/src/frontend/wdisp/windisp.c b/src/frontend/wdisp/windisp.c index 3bc23423a..24a092aa1 100644 --- a/src/frontend/wdisp/windisp.c +++ b/src/frontend/wdisp/windisp.c @@ -539,4 +539,4 @@ int WIN_DiagramReady() return 0; } -#endif /* HAS_WINDOWS */ \ No newline at end of file +#endif /* HAS_WINDOWS */ diff --git a/src/include/cktdefs.h b/src/include/cktdefs.h index d0582e9bb..d517b54de 100644 --- a/src/include/cktdefs.h +++ b/src/include/cktdefs.h @@ -337,7 +337,7 @@ extern int CKTsenUpdate( CKTcircuit *); extern int CKTsetAnalPm( void *, void *, int , IFvalue *, IFvalue *); extern int CKTsetBreak( CKTcircuit *, double ); extern int CKTsetNodPm( void *, void *, int , IFvalue *, IFvalue *); -extern int CKTsetOpt( void *, void *, int , IFvalue *); +extern int CKTsetOpt( CKTcircuit *, void *, int , IFvalue *); extern int CKTsetup( CKTcircuit *); extern int CKTunsetup(CKTcircuit *); extern int CKTtemp( CKTcircuit *); diff --git a/src/include/fteext.h b/src/include/fteext.h index 64d0864bb..d92efd305 100644 --- a/src/include/fteext.h +++ b/src/include/fteext.h @@ -78,61 +78,61 @@ extern bool clip_to_circle(); /* cmath1.c */ extern bool cx_degrees; -extern void *cx_mag(void *, short int , int , int *, short int *); -extern void *cx_ph(void *, short int , int , int *, short int *); -extern void *cx_j(void *, short int , int , int *, short int *); -extern void *cx_real(void *, short int , int , int *, short int *); -extern void *cx_imag(void *, short int , int , int *, short int *); -extern void *cx_pos(void *, short int , int , int *, short int *); -extern void *cx_db(void *, short int , int , int *, short int *); -extern void *cx_log(void *, short int , int , int *, short int *); -extern void *cx_ln(void *, short int , int , int *, short int *); -extern void *cx_exp(void *, short int , int , int *, short int *); -extern void *cx_sqrt(void *, short int , int , int *, short int *); -extern void *cx_sin(void *, short int , int , int *, short int *); -extern void *cx_cos(void *, short int , int , int *, short int *); +extern void *cx_mag(void *, short int , int , int *, short int *, ...); +extern void *cx_ph(void *, short int , int , int *, short int *, ...); +extern void *cx_j(void *, short int , int , int *, short int *, ...); +extern void *cx_real(void *, short int , int , int *, short int *, ...); +extern void *cx_imag(void *, short int , int , int *, short int *, ...); +extern void *cx_pos(void *, short int , int , int *, short int *, ...); +extern void *cx_db(void *, short int , int , int *, short int *, ...); +extern void *cx_log(void *, short int , int , int *, short int *, ...); +extern void *cx_ln(void *, short int , int , int *, short int *, ...); +extern void *cx_exp(void *, short int , int , int *, short int *, ...); +extern void *cx_sqrt(void *, short int , int , int *, short int *, ...); +extern void *cx_sin(void *, short int , int , int *, short int *, ...); +extern void *cx_cos(void *, short int , int , int *, short int *, ...); /* cmath2.c */ -extern void *cx_tan(void *, short int , int , int *, short int *); -extern void *cx_atan(void *, short int , int , int *, short int *); -extern void *cx_norm(void *, short int , int , int *, short int *); -extern void *cx_uminus(void *, short int , int , int *, short int *); -extern void *cx_rnd(void *, short int , int , int *, short int *); -extern void *cx_mean(void *, short int , int , int *, short int *); -extern void *cx_length(void *, short int , int , int *, short int *); -extern void *cx_vector(void *, short int , int , int *, short int *); -extern void *cx_unitvec(void *, short int , int , int *, short int *); +extern void *cx_tan(void *, short int , int , int *, short int *, ...); +extern void *cx_atan(void *, short int , int , int *, short int *, ...); +extern void *cx_norm(void *, short int , int , int *, short int *, ...); +extern void *cx_uminus(void *, short int , int , int *, short int *, ...); +extern void *cx_rnd(void *, short int , int , int *, short int *, ...); +extern void *cx_mean(void *, short int , int , int *, short int *, ...); +extern void *cx_length(void *, short int , int , int *, short int *, ...); +extern void *cx_vector(void *, short int , int , int *, short int *, ...); +extern void *cx_unitvec(void *, short int , int , int *, short int *, ...); /* Routoure JM : somme useful functions */ -extern void *cx_min(void *, short int , int , int *, short int *); -extern void *cx_max(void *, short int , int , int *, short int *); -extern void *cx_d(void *, short int , int , int *, short int *); +extern void *cx_min(void *, short int , int , int *, short int *, ...); +extern void *cx_max(void *, short int , int , int *, short int *, ...); +extern void *cx_d(void *, short int , int , int *, short int *, ...); -extern void *cx_plus(void *, void *, short int , short int , int ); -extern void *cx_minus(void *, void *, short int , short int , int ); -extern void *cx_times(void *, void *, short int , short int , int ); -extern void *cx_mod(void *, void *, short int , short int , int ); +extern void *cx_plus(void *, void *, short int , short int , int, ...); +extern void *cx_minus(void *, void *, short int , short int , int, ...); +extern void *cx_times(void *, void *, short int , short int , int, ...); +extern void *cx_mod(void *, void *, short int , short int , int, ...); /* cmath3.c */ -extern void *cx_divide(void *, void *, short int , short int , int ); -extern void *cx_comma(void *, void *, short int , short int , int ); -extern void *cx_power(void *, void *, short int , short int , int ); -extern void *cx_eq(void *, void *, short int , short int , int ); -extern void *cx_gt(void *, void *, short int , short int , int ); -extern void *cx_lt(void *, void *, short int , short int , int ); -extern void *cx_ge(void *, void *, short int , short int , int ); -extern void *cx_le(void *, void *, short int , short int , int ); -extern void *cx_ne(void *, void *, short int , short int , int ); +extern void *cx_divide(void *, void *, short int , short int , int, ...); +extern void *cx_comma(void *, void *, short int , short int , int, ...); +extern void *cx_power(void *, void *, short int , short int , int, ...); +extern void *cx_eq(void *, void *, short int , short int , int, ...); +extern void *cx_gt(void *, void *, short int , short int , int, ...); +extern void *cx_lt(void *, void *, short int , short int , int, ...); +extern void *cx_ge(void *, void *, short int , short int , int, ...); +extern void *cx_le(void *, void *, short int , short int , int, ...); +extern void *cx_ne(void *, void *, short int , short int , int, ...); /* cmath4.c */ -extern void *cx_and(void *, void *, short int , short int , int ); -extern void *cx_or(void *, void *, short int , short int , int ); -extern void *cx_not(void *, short int , int , int *, short int * ); -extern void *cx_interpolate(void *, short int , int , int *, short int *, struct plot *, struct plot *, int ); -extern void *cx_deriv(void *, short int , int , int *, short int *, struct plot *, struct plot *, int ); +extern void *cx_and(void *, void *, short int , short int , int, ...); +extern void *cx_or(void *, void *, short int , short int , int, ...); +extern void *cx_not(void *, short int , int , int *, short int * , ...); +extern void *cx_interpolate(void *, short int , int , int *, short int *, ...); /* struct plot *, struct plot *, int ); */ +extern void *cx_deriv(void *, short int , int , int *, short int *, ...); /*struct plot *, struct plot *, int );*/ /* cmdtab.c */ diff --git a/src/include/fteparse.h b/src/include/fteparse.h index 179da7712..29cd46bdb 100644 --- a/src/include/fteparse.h +++ b/src/include/fteparse.h @@ -39,7 +39,7 @@ struct func { /* The function. */ void *(*fu_func)(void *data, short int type, int length, - int *newlength, short int *newtype); + int *newlength, short int *newtype, ...); } ; /* User-definable functions. The idea of ud_name is that the args are diff --git a/src/include/ngspice.h b/src/include/ngspice.h index b83e5894a..5e5b63959 100644 --- a/src/include/ngspice.h +++ b/src/include/ngspice.h @@ -160,9 +160,9 @@ extern int AsciiRawFile; extern char *Spice_Host; extern char *Spiced_Log; -extern char Spice_Notice[ ]; -extern char Spice_Version[ ]; -extern char Spice_Build_Date[ ]; +extern char Spice_Version[]; +extern char Spice_Notice[]; +extern char Spice_Build_Date[]; extern char *News_File; extern char *Default_MFB_Cap; diff --git a/src/maths/cmaths/cmath2.c b/src/maths/cmaths/cmath2.c index 26c7c982d..40791bbd2 100644 --- a/src/maths/cmaths/cmath2.c +++ b/src/maths/cmaths/cmath2.c @@ -66,7 +66,7 @@ c_tan(complex *cc, int length) } void * -cx_tan(void *data, short int type, int length, int *newlength, short int *newtype) +cx_tan(void *data, short int type, int length, int *newlength, short int *newtype, ...) { *newlength = length; if (type == VF_REAL) { @@ -81,7 +81,7 @@ cx_tan(void *data, short int type, int length, int *newlength, short int *newtyp void * -cx_atan(void *data, short int type, int length, int *newlength, short int *newtype) +cx_atan(void *data, short int type, int length, int *newlength, short int *newtype, ...) { double *d; @@ -131,7 +131,7 @@ cx_max_local(void *data, short int type, int length) /* Normalize the data so that the magnitude of the greatest value is 1. */ void * -cx_norm(void *data, short int type, int length, int *newlength, short int *newtype) +cx_norm(void *data, short int type, int length, int *newlength, short int *newtype, ...) { double largest = 0.0; @@ -170,7 +170,7 @@ cx_norm(void *data, short int type, int length, int *newlength, short int *newty } void * -cx_uminus(void *data, short int type, int length, int *newlength, short int *newtype) +cx_uminus(void *data, short int type, int length, int *newlength, short int *newtype, ...) { *newlength = length; if (type == VF_COMPLEX) { @@ -199,7 +199,7 @@ cx_uminus(void *data, short int type, int length, int *newlength, short int *new } void * -cx_rnd(void *data, short int type, int length, int *newlength, short int *newtype) +cx_rnd(void *data, short int type, int length, int *newlength, short int *newtype, ...) { *newlength = length; if (type == VF_COMPLEX) { @@ -238,7 +238,7 @@ cx_rnd(void *data, short int type, int length, int *newlength, short int *newtyp /* Compute the mean of a vector. */ void * -cx_mean(void *data, short int type, int length, int *newlength, short int *newtype) +cx_mean(void *data, short int type, int length, int *newlength, short int *newtype, ...) { *newlength = 1; rcheck(length > 0, "mean"); @@ -272,7 +272,7 @@ cx_mean(void *data, short int type, int length, int *newlength, short int *newty void * -cx_length(void *data, short int type, int length, int *newlength, short int *newtype) +cx_length(void *data, short int type, int length, int *newlength, short int *newtype, ...) { double *d; @@ -289,7 +289,7 @@ cx_length(void *data, short int type, int length, int *newlength, short int *new void * -cx_vector(void *data, short int type, int length, int *newlength, short int *newtype) +cx_vector(void *data, short int type, int length, int *newlength, short int *newtype, ...) { complex *cc = (complex *) data; double *dd = (double *) data; @@ -314,7 +314,7 @@ cx_vector(void *data, short int type, int length, int *newlength, short int *new void * -cx_unitvec(void *data, short int type, int length, int *newlength, short int *newtype) +cx_unitvec(void *data, short int type, int length, int *newlength, short int *newtype, ...) { complex *cc = (complex *) data; double *dd = (double *) data; @@ -344,7 +344,7 @@ cx_unitvec(void *data, short int type, int length, int *newlength, short int *ne */ void * -cx_plus(void *data1, void *data2, short int datatype1, short int datatype2, int length) +cx_plus(void *data1, void *data2, short int datatype1, short int datatype2, int length, ...) { double *dd1 = (double *) data1; double *dd2 = (double *) data2; @@ -384,7 +384,7 @@ cx_plus(void *data1, void *data2, short int datatype1, short int datatype2, int } void * -cx_minus(void *data1, void *data2, short int datatype1, short int datatype2, int length) +cx_minus(void *data1, void *data2, short int datatype1, short int datatype2, int length, ...) { double *dd1 = (double *) data1; double *dd2 = (double *) data2; @@ -424,7 +424,7 @@ cx_minus(void *data1, void *data2, short int datatype1, short int datatype2, int } void * -cx_times(void *data1, void *data2, short int datatype1, short int datatype2, int length) +cx_times(void *data1, void *data2, short int datatype1, short int datatype2, int length, ...) { double *dd1 = (double *) data1; double *dd2 = (double *) data2; @@ -466,7 +466,7 @@ cx_times(void *data1, void *data2, short int datatype1, short int datatype2, int } void * -cx_mod(void *data1, void *data2, short int datatype1, short int datatype2, int length) +cx_mod(void *data1, void *data2, short int datatype1, short int datatype2, int length, ...) { double *dd1 = (double *) data1; double *dd2 = (double *) data2; @@ -525,7 +525,7 @@ cx_mod(void *data1, void *data2, short int datatype1, short int datatype2, int l /* Routoure JM : Compute the max of a vector. */ void * -cx_max(void *data, short int type, int length, int *newlength, short int *newtype) +cx_max(void *data, short int type, int length, int *newlength, short int *newtype, ...) { *newlength = 1; /* test if length >0 et affiche un message d'erreur */ @@ -566,7 +566,7 @@ cx_max(void *data, short int type, int length, int *newlength, short int *newtyp /* Routoure JM : Compute the min of a vector. */ void * -cx_min(void *data, short int type, int length, int *newlength, short int *newtype) +cx_min(void *data, short int type, int length, int *newlength, short int *newtype, ...) { *newlength = 1; /* test if length >0 et affiche un message d'erreur */ @@ -609,7 +609,7 @@ cx_min(void *data, short int type, int length, int *newlength, short int *newtyp /* Routoure JM : Compute the differential of a vector. */ void * -cx_d(void *data, short int type, int length, int *newlength, short int *newtype) +cx_d(void *data, short int type, int length, int *newlength, short int *newtype, ...) { *newlength = length; /* test if length >0 et affiche un message d'erreur */ diff --git a/src/maths/cmaths/cmath2.h b/src/maths/cmaths/cmath2.h index 16cdf668f..cb72d6cf3 100644 --- a/src/maths/cmaths/cmath2.h +++ b/src/maths/cmaths/cmath2.h @@ -7,22 +7,22 @@ #define CMATH2_H_INCLUDED -void * cx_tan(void *data, short int type, int length, int *newlength, short int *newtype); -void * cx_atan(void *data, short int type, int length, int *newlength, short int *newtype); -void * cx_norm(void *data, short int type, int length, int *newlength, short int *newtype); -void * cx_uminus(void *data, short int type, int length, int *newlength, short int *newtype); -void * cx_rnd(void *data, short int type, int length, int *newlength, short int *newtype); -void * cx_mean(void *data, short int type, int length, int *newlength, short int *newtype); -void * cx_length(void *data, short int type, int length, int *newlength, short int *newtype); -void * cx_vector(void *data, short int type, int length, int *newlength, short int *newtype); -void * cx_unitvec(void *data, short int type, int length, int *newlength, short int *newtype); -void * cx_plus(void *data1, void *data2, short int datatype1, short int datatype2, int length); -void * cx_minus(void *data1, void *data2, short int datatype1, short int datatype2, int length); -void * cx_times(void *data1, void *data2, short int datatype1, short int datatype2, int length); -void * cx_mod(void *data1, void *data2, short int datatype1, short int datatype2, int length); -void * cx_max(void *data, short int type, int length, int *newlength, short int *newtype); -void * cx_min(void *data, short int type, int length, int *newlength, short int *newtype); -void * cx_d(void *data, short int type, int length, int *newlength, short int *newtype); +void * cx_tan(void *data, short int type, int length, int *newlength, short int *newtype, ...); +void * cx_atan(void *data, short int type, int length, int *newlength, short int *newtype, ...); +void * cx_norm(void *data, short int type, int length, int *newlength, short int *newtype, ...); +void * cx_uminus(void *data, short int type, int length, int *newlength, short int *newtype, ...); +void * cx_rnd(void *data, short int type, int length, int *newlength, short int *newtype, ...); +void * cx_mean(void *data, short int type, int length, int *newlength, short int *newtype, ...); +void * cx_length(void *data, short int type, int length, int *newlength, short int *newtype, ...); +void * cx_vector(void *data, short int type, int length, int *newlength, short int *newtype, ...); +void * cx_unitvec(void *data, short int type, int length, int *newlength, short int *newtype, ...); +void * cx_plus(void *data1, void *data2, short int datatype1, short int datatype2, int length, ...); +void * cx_minus(void *data1, void *data2, short int datatype1, short int datatype2, int length, ...); +void * cx_times(void *data1, void *data2, short int datatype1, short int datatype2, int length, ...); +void * cx_mod(void *data1, void *data2, short int datatype1, short int datatype2, int length, ...); +void * cx_max(void *data, short int type, int length, int *newlength, short int *newtype, ...); +void * cx_min(void *data, short int type, int length, int *newlength, short int *newtype, ...); +void * cx_d(void *data, short int type, int length, int *newlength, short int *newtype, ...); #endif diff --git a/src/maths/sparse/spbuild.c b/src/maths/sparse/spbuild.c index fceff9447..72810aa2e 100644 --- a/src/maths/sparse/spbuild.c +++ b/src/maths/sparse/spbuild.c @@ -185,7 +185,6 @@ spFindElement( void *eMatrix, int Row, int Col ) { MatrixPtr Matrix = (MatrixPtr)eMatrix; RealNumber *pElement; -int index; ElementPtr spcFindElementInCol(); void Translate(); diff --git a/src/maths/sparse/sputils.c b/src/maths/sparse/sputils.c index 7aa20c329..cc1396f17 100644 --- a/src/maths/sparse/sputils.c +++ b/src/maths/sparse/sputils.c @@ -59,6 +59,7 @@ * Matrix type and macro definitions for the sparse matrix routines. */ #include +#include #define spINSIDE_SPARSE #include "spconfig.h" diff --git a/src/misc/alloc.c b/src/misc/alloc.c index 2895c2f1d..e06f7e0f0 100644 --- a/src/misc/alloc.c +++ b/src/misc/alloc.c @@ -28,7 +28,12 @@ tmalloc(size_t num) s = calloc(num,1); if (!s){ fprintf(stderr, - "malloc: Internal Error: can't allocate %d bytes. \n", num); +#if IS_SIZE_T_LONG + "malloc: Internal Error: can't allocate %ld bytes. \n", +#else + "malloc: Internal Error: can't allocate %d bytes. \n", +#endif + num); exit(EXIT_BAD); } return(s); @@ -51,8 +56,13 @@ trealloc(void *ptr, size_t num) s = realloc(ptr, num); if (!s) { - fprintf(stderr, - "realloc: Internal Error: can't allocate %d bytes.\n", num); + fprintf(stderr, +#if IS_SIZE_T_LONG + "realloc: Internal Error: can't allocate %ld bytes.\n", +#else + "realloc: Internal Error: can't allocate %d bytes.\n", +#endif + num); exit(EXIT_BAD); } return(s); diff --git a/src/misc/stringutil.h b/src/misc/stringutil.h index 089979793..55afb7757 100644 --- a/src/misc/stringutil.h +++ b/src/misc/stringutil.h @@ -3,6 +3,8 @@ * 1999 E. Rouat ************/ +#include "config.h" + #ifndef STRING_H_INCLUDED #define STRING_H_INCLUDED diff --git a/src/misc/tilde.c b/src/misc/tilde.c index d657b41e8..2ba231bf5 100644 --- a/src/misc/tilde.c +++ b/src/misc/tilde.c @@ -31,7 +31,7 @@ char * tildexpand(char *string) { char buf[BSIZE_SP]; - char *result, *k, c; + char *result = NULL, *k, c; if (!string) return NULL; diff --git a/src/nghelp.c b/src/nghelp.c index 9bac2307d..ed01281d5 100644 --- a/src/nghelp.c +++ b/src/nghelp.c @@ -34,6 +34,8 @@ bool cp_interactive = FALSE; char *hlp_filelist[] = { "ngspice", 0 }; +extern void ivars(); + int main(int ac, char **av) { diff --git a/src/ngmultidec.c b/src/ngmultidec.c index 8ab3aa62e..72b0faa77 100644 --- a/src/ngmultidec.c +++ b/src/ngmultidec.c @@ -19,6 +19,7 @@ Author: 1990 Jaijeet Roychowdury extern void usage(); extern void comments(); extern double phi(); +extern void spErrorMessage(char*, FILE*, char*); int main (argc, argv) @@ -30,7 +31,7 @@ int double l,c,ctot,r=0.0,g=0.0,k=0.0,lm=0.0,cm=0.0,len; unsigned gotl=0,gotc=0,gotr=0,gotg=0,gotk=0,gotcm=0,gotlen=0; unsigned gotname=0, gotnum=0; - char *name; + char *name = ""; double **matrix, **inverse; double *tpeigenvalues, *gammaj; char *options; diff --git a/src/ngnutmeg.c b/src/ngnutmeg.c index 9fc2ac152..625a649bc 100644 --- a/src/ngnutmeg.c +++ b/src/ngnutmeg.c @@ -1,9 +1,6 @@ /* Configuration file for nutmeg */ #include -#include "conf.h" - - /* * Devices */ diff --git a/src/ngspice.c b/src/ngspice.c index a80b5e803..57bb0b904 100644 --- a/src/ngspice.c +++ b/src/ngspice.c @@ -1,8 +1,6 @@ /* Configuration file for ng-spice */ #include -#include "conf.h" - /********** Copyright 1990 Regents of the University of California. All rights reserved. **********/ diff --git a/src/spicelib/analysis/ckt.h b/src/spicelib/analysis/ckt.h index 3a26f12bb..71ae8d765 100644 --- a/src/spicelib/analysis/ckt.h +++ b/src/spicelib/analysis/ckt.h @@ -78,7 +78,7 @@ int CKTsenUpdate( CKTcircuit *); int CKTsetAnalPm( void *, void *, int , IFvalue *, IFvalue *); int CKTsetBreak( CKTcircuit *, double ); int CKTsetNodPm( void *, void *, int , IFvalue *, IFvalue *); -int CKTsetOpt( void *, void *, int , IFvalue *); +int CKTsetOpt( CKTcircuit *, void *, int , IFvalue *); int CKTsetup( CKTcircuit *); int CKTunsetup(CKTcircuit *ckt); int CKTtemp( CKTcircuit *); diff --git a/src/spicelib/analysis/cktmcrt.c b/src/spicelib/analysis/cktmcrt.c index c126d8ef4..74f7eadd0 100644 --- a/src/spicelib/analysis/cktmcrt.c +++ b/src/spicelib/analysis/cktmcrt.c @@ -21,21 +21,21 @@ int CKTmodCrt(void *ckt, int type, void **modfast, IFuid name) { extern SPICEdev **DEVices; - GENmodel *mymodfast = NULL; + GENmodel *mymodfast[1] = { NULL }; int error; - error = CKTfndMod(ckt,&type,(void**)&mymodfast,name); + error = CKTfndMod (ckt, &type, (void**)mymodfast, name); if(error == E_NOMOD) { - mymodfast = (GENmodel *)MALLOC(*(DEVices[type]->DEVmodSize)); - if(mymodfast == (GENmodel *)NULL) return(E_NOMEM); - mymodfast->GENmodType = type; - mymodfast->GENmodName = name; - mymodfast->GENnextModel =(GENmodel *)((CKTcircuit *)ckt)->CKThead[type]; - ((CKTcircuit *)ckt)->CKThead[type]=(GENmodel *)mymodfast; - if(modfast) *modfast=(void *)mymodfast; + mymodfast[0] = (GENmodel *)MALLOC(*(DEVices[type]->DEVmodSize)); + if(mymodfast[0] == (GENmodel *)NULL) return(E_NOMEM); + mymodfast[0]->GENmodType = type; + mymodfast[0]->GENmodName = name; + mymodfast[0]->GENnextModel =(GENmodel *)((CKTcircuit *)ckt)->CKThead[type]; + ((CKTcircuit *)ckt)->CKThead[type]=(GENmodel *)mymodfast[0]; + if(modfast) *modfast=(void *)mymodfast[0]; return(OK); } else if (error==0) { - if(modfast) *modfast=(void *)mymodfast; + if(modfast) *modfast=(void *)mymodfast[0]; return(E_EXISTS); } else { return(error); diff --git a/src/spicelib/analysis/cktmkcur.c b/src/spicelib/analysis/cktmkcur.c index 91193301b..886d0d9cd 100644 --- a/src/spicelib/analysis/cktmkcur.c +++ b/src/spicelib/analysis/cktmkcur.c @@ -24,16 +24,16 @@ CKTmkCur(CKTcircuit *ckt, CKTnode **node, IFuid basename, char *suffix) IFuid uid; int error; CKTnode *mynode; - CKTnode *checknode; + CKTnode *checknode[1]; error = CKTmkNode(ckt,&mynode); if(error) return(error); - checknode = mynode; + checknode[0] = mynode; error = (*(SPfrontEnd->IFnewUid))((void *)ckt,&uid,basename, - suffix,UID_SIGNAL,(void**)&checknode); + suffix,UID_SIGNAL,(void**)checknode); if(error) { FREE(mynode); - if(node) *node = checknode; + if(node) *node = checknode[0]; return(error); } mynode->name = uid; diff --git a/src/spicelib/analysis/cktmkvol.c b/src/spicelib/analysis/cktmkvol.c index ceee5573b..8890ab1b1 100644 --- a/src/spicelib/analysis/cktmkvol.c +++ b/src/spicelib/analysis/cktmkvol.c @@ -22,16 +22,16 @@ CKTmkVolt(CKTcircuit *ckt, CKTnode **node, IFuid basename, char *suffix) IFuid uid; int error; CKTnode *mynode; - CKTnode *checknode; + CKTnode *checknode[1]; error = CKTmkNode(ckt,&mynode); if(error) return(error); - checknode = mynode; + checknode[0] = mynode; error = (*(SPfrontEnd->IFnewUid))((void *)ckt,&uid,basename, - suffix,UID_SIGNAL,(void**)&checknode); + suffix,UID_SIGNAL,(void**)checknode); if(error) { FREE(mynode); - if(node) *node = checknode; + if(node) *node = checknode[0]; return(error); } mynode->name = uid; diff --git a/src/spicelib/analysis/cktpzstr.c b/src/spicelib/analysis/cktpzstr.c index 56262d41b..e52027962 100644 --- a/src/spicelib/analysis/cktpzstr.c +++ b/src/spicelib/analysis/cktpzstr.c @@ -522,7 +522,7 @@ CKTpzRunTrial(CKTcircuit *ckt, PZtrial **new_trialp, PZtrial **set) PZtrial *p, *prev; SPcomplex def_frac, diff_frac; double reltol, abstol; - int def_mag, diff_mag, error; + int def_mag, diff_mag, error = 0; int i; int pretest, shifted, was_shifted; int repeat; diff --git a/src/spicelib/analysis/cktsens.c b/src/spicelib/analysis/cktsens.c index d4c0b853c..c83d5461b 100644 --- a/src/spicelib/analysis/cktsens.c +++ b/src/spicelib/analysis/cktsens.c @@ -72,7 +72,7 @@ int sens_sens(CKTcircuit *ckt, int restart) static int is_dc; int k, j, n; int num_vars, branch_eq=0; - char *sen_data=NULL; + char *sen_data[1] = {NULL}; char namebuf[513]; IFuid *output_names, freq_name; int bypass; @@ -187,7 +187,7 @@ int sens_sens(CKTcircuit *ckt, int restart) error = (*SPfrontEnd->OUTpBeginPlot)((void *) ckt, (void *) ckt->CKTcurJob, ckt->CKTcurJob->JOBname, freq_name, IF_REAL, num_vars, - output_names, type, (void **) &sen_data); + output_names, type, (void **)sen_data); if (error) return error; @@ -199,7 +199,7 @@ int sens_sens(CKTcircuit *ckt, int restart) output_values = NULL; output_cvalues = NEWN(IFcomplex, num_vars); if (sen_info->step_type != SENS_LINEAR) - (*(SPfrontEnd->OUTattributes))((void *)sen_data, + (*(SPfrontEnd->OUTattributes))((void *)sen_data[0], NULL, OUT_SCALE_LOG, NULL); } @@ -562,13 +562,13 @@ int sens_sens(CKTcircuit *ckt, int restart) value.rValue = freq; - (*(SPfrontEnd->OUTpData))(sen_data, &value, &nvalue); + (*(SPfrontEnd->OUTpData))(sen_data[0], &value, &nvalue); freq = inc_freq(freq, sen_info->step_type, step_size); } - (*SPfrontEnd->OUTendPlot)((void *) sen_data); + (*SPfrontEnd->OUTendPlot)((void *) sen_data[0]); if (is_dc) { FREE(output_values); /* XXX free various vectors */ diff --git a/src/spicelib/analysis/cktsopt.c b/src/spicelib/analysis/cktsopt.c index 64b6f5a4a..c7a3ea769 100644 --- a/src/spicelib/analysis/cktsopt.c +++ b/src/spicelib/analysis/cktsopt.c @@ -28,7 +28,7 @@ Modified: 2000 AlansFixes /* ARGSUSED */ int -CKTsetOpt(void *ckt, void *anal, int opt, IFvalue *val) +CKTsetOpt(CKTcircuit *ckt, void *anal, int opt, IFvalue *val) { TSKtask *task = (TSKtask *)anal; @@ -150,33 +150,33 @@ CKTsetOpt(void *ckt, void *anal, int opt, IFvalue *val) /* gtri - begin - wbk - add new options */ #ifdef XSPICE case OPT_EVT_MAX_OP_ALTER: - ((CKTcircuit *) ckt)->evt->limits.max_op_alternations = val->iValue; + ckt->evt->limits.max_op_alternations = val->iValue; break; case OPT_EVT_MAX_EVT_PASSES: - ((CKTcircuit *) ckt)->evt->limits.max_event_passes = val->iValue; + ckt->evt->limits.max_event_passes = val->iValue; break; case OPT_ENH_NOOPALTER: - ((CKTcircuit *) ckt)->evt->options.op_alternate = MIF_FALSE; + ckt->evt->options.op_alternate = MIF_FALSE; break; case OPT_ENH_RAMPTIME: - ((CKTcircuit *) ckt)->enh->ramp.ramptime = val->rValue; + ckt->enh->ramp.ramptime = val->rValue; break; case OPT_ENH_CONV_LIMIT: - ((CKTcircuit *) ckt)->enh->conv_limit.enabled = MIF_TRUE; + ckt->enh->conv_limit.enabled = MIF_TRUE; break; case OPT_ENH_CONV_STEP: - ((CKTcircuit *) ckt)->enh->conv_limit.step = val->rValue; - ((CKTcircuit *) ckt)->enh->conv_limit.enabled = MIF_TRUE; + ckt->enh->conv_limit.step = val->rValue; + ckt->enh->conv_limit.enabled = MIF_TRUE; break; case OPT_ENH_CONV_ABS_STEP: - ((CKTcircuit *) ckt)->enh->conv_limit.abs_step = val->rValue; - ((CKTcircuit *) ckt)->enh->conv_limit.enabled = MIF_TRUE; + ckt->enh->conv_limit.abs_step = val->rValue; + ckt->enh->conv_limit.enabled = MIF_TRUE; break; case OPT_MIF_AUTO_PARTIAL: @@ -185,8 +185,8 @@ CKTsetOpt(void *ckt, void *anal, int opt, IFvalue *val) case OPT_ENH_RSHUNT: if(val->rValue > 1.0e-30) { - ((CKTcircuit *) ckt)->enh->rshunt_data.enabled = MIF_TRUE; - ((CKTcircuit *) ckt)->enh->rshunt_data.gshunt = 1.0 / val->rValue; + ckt->enh->rshunt_data.enabled = MIF_TRUE; + ckt->enh->rshunt_data.gshunt = 1.0 / val->rValue; } else { printf("WARNING - Rshunt option too small. Ignored.\n"); diff --git a/src/spicelib/analysis/noisean.c b/src/spicelib/analysis/noisean.c index 7701d131b..2443189a3 100644 --- a/src/spicelib/analysis/noisean.c +++ b/src/spicelib/analysis/noisean.c @@ -17,7 +17,7 @@ Modified: 2001 AlansFixes #include "sperror.h" #include "vsrc/vsrcdefs.h" #include "isrc/isrcdefs.h" -#include "src/maths/ni/niniter.h" /* va, NInzIter */ +#include "../maths/ni/niniter.h" /* va, NInzIter */ extern int CKTnoise( CKTcircuit *, int, int, Ndata * ); @@ -37,7 +37,7 @@ NOISEan (CKTcircuit *ckt, int restart) int code; int step; IFuid freqUid; - char *inst; + char *inst[1]; double freqTol; /* tolerence parameter for finding final frequency; hack */ NOISEAN *job = (NOISEAN*) (ckt->CKTcurJob); @@ -47,12 +47,12 @@ NOISEan (CKTcircuit *ckt, int restart) negOutNode = ((CKTnode*) (job->outputRef))->number; /* see if the source specified is AC */ - inst = NULL; + inst[0] = NULL; code = CKTtypelook("Vsource"); if (code != -1) { - error = CKTfndDev((void *)ckt,&code,(void **)&inst, + error = CKTfndDev((void *)ckt, &code,(void **)inst, job->input, (void *)NULL, (IFuid)NULL); - if (!error && !((VSRCinstance *)inst)->VSRCacGiven) { + if (!error && !((VSRCinstance *)inst[0])->VSRCacGiven) { errMsg = MALLOC(strlen(noacinput)+1); strcpy(errMsg,noacinput); return (E_NOACINPUT); @@ -60,8 +60,8 @@ NOISEan (CKTcircuit *ckt, int restart) } code = CKTtypelook("Isource"); - if (code != -1 && inst==NULL) { - error = CKTfndDev((void *)ckt,&code, (void **)&inst, + if (code != -1 && inst[0]==NULL) { + error = CKTfndDev((void *)ckt,&code, (void **)inst, job->input, (void *)NULL,(IFuid)NULL); if (error) { /* XXX ??? */ @@ -70,7 +70,7 @@ NOISEan (CKTcircuit *ckt, int restart) &job->input); return (E_NOTFOUND); } - if (!((ISRCinstance *)inst)->ISRCacGiven) { + if (!((ISRCinstance *)inst[0])->ISRCacGiven) { errMsg = MALLOC(strlen(noacinput)+1); strcpy(errMsg,noacinput); return (E_NOACINPUT); diff --git a/src/spicelib/analysis/tfanal.c b/src/spicelib/analysis/tfanal.c index a75571cba..d35f3881a 100644 --- a/src/spicelib/analysis/tfanal.c +++ b/src/spicelib/analysis/tfanal.c @@ -20,7 +20,7 @@ TFanal(CKTcircuit *ckt, int restart) /* forced restart flag */ { int size; - int insrc,outsrc; + int insrc = 0, outsrc = 0; double outputs[3]; IFvalue outdata; /* structure for output data vector, will point to * outputs vector above */ diff --git a/src/spicelib/devices/bjt/bjtdset.c b/src/spicelib/devices/bjt/bjtdset.c index eccb4d7f7..f2bf9ab36 100644 --- a/src/spicelib/devices/bjt/bjtdset.c +++ b/src/spicelib/devices/bjt/bjtdset.c @@ -19,8 +19,8 @@ Author: 1988 Jaijeet S Roychowdhury /* actually load the current resistance value into the sparse matrix * previously provided */ -int -BJTdSetup(GENmodel *inModel, CKTcircuit *ckt) +void TanDeriv(Dderivs *new, Dderivs *old); +int BJTdSetup(GENmodel *inModel, CKTcircuit *ckt) { BJTmodel *model = (BJTmodel*)inModel; BJTinstance *here; diff --git a/src/spicelib/devices/bjt/bjtsacl.c b/src/spicelib/devices/bjt/bjtsacl.c index 6f5911c08..caf821afc 100644 --- a/src/spicelib/devices/bjt/bjtsacl.c +++ b/src/spicelib/devices/bjt/bjtsacl.c @@ -31,10 +31,10 @@ BJTsAcLoad(GENmodel *inModel, CKTcircuit *ckt) double vbeOp; double vbcOp; double A0; - double DELA; + double DELA = 0.0; double Apert; double DELAinv; - double vte; + double vte = 0.0; double gcpr; double gepr; double gpi; @@ -78,7 +78,7 @@ BJTsAcLoad(GENmodel *inModel, CKTcircuit *ckt) double ce0,ice0; double ceprm0,iceprm0; double cs0,ics0; - double DvDp; + double DvDp = 0.0; int iparmno,i; SENstruct *info; diff --git a/src/spicelib/devices/bjt/bjtsetup.c b/src/spicelib/devices/bjt/bjtsetup.c index f92859ab8..1fd5e9b9a 100644 --- a/src/spicelib/devices/bjt/bjtsetup.c +++ b/src/spicelib/devices/bjt/bjtsetup.c @@ -143,7 +143,7 @@ BJTsetup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *states) /* loop through all the instances of the model */ for (here = model->BJTinstances; here != NULL ; here=here->BJTnextInstance) { - CKTnode *tmpNode; + CKTnode *tmpNode[1]; IFuid tmpName; if (here->BJTowner != ARCHme) @@ -176,10 +176,10 @@ matrixpointers: if(error) return(error); here->BJTcolPrimeNode = tmp->number; if (ckt->CKTcopyNodesets) { - if (CKTinst2Node(ckt,here,1,&tmpNode,&tmpName)==OK) { - if (tmpNode->nsGiven) { - tmp->nodeset=tmpNode->nodeset; - tmp->nsGiven=tmpNode->nsGiven; + if (CKTinst2Node(ckt,here,1,(void**)tmpNode,&tmpName)==OK) { + if (tmpNode[0]->nsGiven) { + tmp->nodeset=tmpNode[0]->nodeset; + tmp->nsGiven=tmpNode[0]->nsGiven; /* fprintf(stderr, "Nodeset copied from %s\n", tmpName); fprintf(stderr, " to %s\n", tmp->name); fprintf(stderr, " value %g\n", @@ -195,10 +195,10 @@ matrixpointers: if(error) return(error); here->BJTbasePrimeNode = tmp->number; if (ckt->CKTcopyNodesets) { - if (CKTinst2Node(ckt,here,2,&tmpNode,&tmpName)==OK) { - if (tmpNode->nsGiven) { - tmp->nodeset=tmpNode->nodeset; - tmp->nsGiven=tmpNode->nsGiven; + if (CKTinst2Node(ckt,here,2,(void **)tmpNode,&tmpName)==OK) { + if (tmpNode[0]->nsGiven) { + tmp->nodeset=tmpNode[0]->nodeset; + tmp->nsGiven=tmpNode[0]->nsGiven; /* fprintf(stderr, "Nodeset copied from %s\n", tmpName); fprintf(stderr, " to %s\n", tmp->name); fprintf(stderr, " value %g\n", @@ -214,10 +214,10 @@ matrixpointers: if(error) return(error); here->BJTemitPrimeNode = tmp->number; if (ckt->CKTcopyNodesets) { - if (CKTinst2Node(ckt,here,3,&tmpNode,&tmpName)==OK) { - if (tmpNode->nsGiven) { - tmp->nodeset=tmpNode->nodeset; - tmp->nsGiven=tmpNode->nsGiven; + if (CKTinst2Node(ckt,here,3,(void **)tmpNode,&tmpName)==OK) { + if (tmpNode[0]->nsGiven) { + tmp->nodeset=tmpNode[0]->nodeset; + tmp->nsGiven=tmpNode[0]->nsGiven; /* fprintf(stderr, "Nodeset copied from %s\n", tmpName); fprintf(stderr, " to %s\n", tmp->name); fprintf(stderr, " value %g\n", diff --git a/src/spicelib/devices/bjt/bjtsload.c b/src/spicelib/devices/bjt/bjtsload.c index 5ac1d58e1..53121954c 100644 --- a/src/spicelib/devices/bjt/bjtsload.c +++ b/src/spicelib/devices/bjt/bjtsload.c @@ -60,10 +60,10 @@ BJTsLoad(GENmodel *inModel, CKTcircuit *ckt) double qcs; double qbx0; double qbx; - double DqbeDp; - double DqbcDp; - double DqcsDp; - double DqbxDp; + double DqbeDp = 0.0; + double DqbcDp = 0.0; + double DqcsDp = 0.0; + double DqbxDp = 0.0; double Osxpbe; double Osxpbc; double Osxpcs; diff --git a/src/spicelib/devices/bjt2/bjt2disto.c b/src/spicelib/devices/bjt2/bjt2disto.c index 58c6fb68f..914de149c 100644 --- a/src/spicelib/devices/bjt2/bjt2disto.c +++ b/src/spicelib/devices/bjt2/bjt2disto.c @@ -25,18 +25,18 @@ BJT2disto(int mode, GENmodel *genmodel, CKTcircuit *ckt) double r1h1x,i1h1x; double r1h1y,i1h1y; double r1h1z, i1h1z; - double r1h2x, i1h2x; - double r1h2y, i1h2y; - double r1h2z, i1h2z; - double r1hm2x,i1hm2x; - double r1hm2y,i1hm2y; - double r1hm2z, i1hm2z; - double r2h11x,i2h11x; - double r2h11y,i2h11y; - double r2h11z, i2h11z; - double r2h1m2x,i2h1m2x; - double r2h1m2y,i2h1m2y; - double r2h1m2z, i2h1m2z; + double r1h2x = 0.0, i1h2x = 0.0; + double r1h2y = 0.0, i1h2y = 0.0; + double r1h2z = 0.0, i1h2z = 0.0; + double r1hm2x = 0.0,i1hm2x = 0.0; + double r1hm2y = 0.0,i1hm2y = 0.0; + double r1hm2z = 0.0, i1hm2z = 0.0; + double r2h11x = 0.0,i2h11x = 0.0; + double r2h11y = 0.0,i2h11y = 0.0; + double r2h11z = 0.0, i2h11z = 0.0; + double r2h1m2x = 0.0,i2h1m2x = 0.0; + double r2h1m2y = 0.0,i2h1m2y = 0.0; + double r2h1m2z = 0.0, i2h1m2z = 0.0; double temp, itemp; register BJT2instance *here; #ifdef DISTODEBUG diff --git a/src/spicelib/devices/bjt2/bjt2dset.c b/src/spicelib/devices/bjt2/bjt2dset.c index 8da422668..f044c15e7 100644 --- a/src/spicelib/devices/bjt2/bjt2dset.c +++ b/src/spicelib/devices/bjt2/bjt2dset.c @@ -17,9 +17,8 @@ Modified: Alan Gillespie * This function initialises the Taylor coeffs for the * BJT2's in the circuit */ - -int -BJT2dSetup(GENmodel *inModel, CKTcircuit *ckt) +void TanDeriv(Dderivs *new, Dderivs *old); +int BJT2dSetup(GENmodel *inModel, CKTcircuit *ckt) /* actually load the current resistance value into the * sparse matrix previously provided */ @@ -31,7 +30,7 @@ BJT2dSetup(GENmodel *inModel, CKTcircuit *ckt) double c4; double lcapbe1,lcapbe2,lcapbe3; double lcapbx1,lcapbx2,lcapbx3; - double cb; + double cb = 0.0; double cbc; double cbcn; double cbe; @@ -55,7 +54,7 @@ BJT2dSetup(GENmodel *inModel, CKTcircuit *ckt) double f3; double fcpc; double fcpe; - double gbb1; + double gbb1 = 0.0; double gbc; double gbcn; double gbe; @@ -64,7 +63,7 @@ BJT2dSetup(GENmodel *inModel, CKTcircuit *ckt) double gben2,gben3; double gbcn2,gbcn3; double gben; - double gbb2, gbb3; + double gbb2 = 0.0, gbb3 = 0.0; double oik; double oikr; double ovtf; @@ -233,7 +232,7 @@ for( ; model != NULL; model = model->BJT2nextModel ) { /* * determine dc current and derivitives */ -next1: vtn=vt*model->BJT2emissionCoeffF; + vtn=vt*model->BJT2emissionCoeffF; if(vbe > -5*vtn){ evbe=exp(vbe/vtn); cbe=csat*(evbe-1)+ckt->CKTgmin*vbe; diff --git a/src/spicelib/devices/bjt2/bjt2load.c b/src/spicelib/devices/bjt2/bjt2load.c index cfa9ac8a3..a05de1036 100644 --- a/src/spicelib/devices/bjt2/bjt2load.c +++ b/src/spicelib/devices/bjt2/bjt2load.c @@ -109,13 +109,12 @@ BJT2load(GENmodel *inModel, CKTcircuit *ckt) double td; double temp; double tf; - double tol; double tr; double vbc; double vbe; - double vbx; + double vbx = 0.0; double vce; - double vsub; + double vsub = 0.0; double vt; double vtc; double vte; diff --git a/src/spicelib/devices/bjt2/bjt2noise.c b/src/spicelib/devices/bjt2/bjt2noise.c index 8585b47eb..7ebbf8ab3 100644 --- a/src/spicelib/devices/bjt2/bjt2noise.c +++ b/src/spicelib/devices/bjt2/bjt2noise.c @@ -36,7 +36,6 @@ BJT2noise (int mode, int operation, GENmodel *genmodel, CKTcircuit *ckt, double tempInoise; double noizDens[BJT2NSRCS]; double lnNdens[BJT2NSRCS]; - int error; int i; /* define the names of the noise sources */ diff --git a/src/spicelib/devices/bjt2/bjt2sacl.c b/src/spicelib/devices/bjt2/bjt2sacl.c index eb511ebed..2d0dd6fce 100644 --- a/src/spicelib/devices/bjt2/bjt2sacl.c +++ b/src/spicelib/devices/bjt2/bjt2sacl.c @@ -32,10 +32,10 @@ BJT2sAcLoad(GENmodel *inModel, CKTcircuit *ckt) double vbeOp; double vbcOp; double A0; - double DELA; + double DELA = 0.0; double Apert; double DELAinv; - double vte; + double vte = 0.0; double gcpr; double gepr; double gpi; @@ -79,7 +79,7 @@ BJT2sAcLoad(GENmodel *inModel, CKTcircuit *ckt) double ce0,ice0; double ceprm0,iceprm0; double cs0,ics0; - double DvDp; + double DvDp = 0.0; int iparmno,i; SENstruct *info; @@ -155,7 +155,7 @@ BJT2sAcLoad(GENmodel *inModel, CKTcircuit *ckt) /* store the unperturbed values of small signal parameters */ - if(error = BJT2load((GENmodel*)model,ckt)) return(error); + if ((error = BJT2load((GENmodel*)model,ckt))) return(error); *(here->BJT2senGpi)= *(ckt->CKTstate0 + here->BJT2gpi); *(here->BJT2senGmu)= *(ckt->CKTstate0 + here->BJT2gmu); @@ -271,7 +271,7 @@ BJT2sAcLoad(GENmodel *inModel, CKTcircuit *ckt) /* store the small signal parameters * corresponding to perturbed area */ - if(error = BJT2load((GENmodel*)model,ckt)) return(error); + if ((error = BJT2load((GENmodel*)model,ckt))) return(error); *(here->BJT2senGpi + 1)= *(ckt->CKTstate0 + here->BJT2gpi); *(here->BJT2senGmu + 1)= *(ckt->CKTstate0 + here->BJT2gmu); @@ -310,7 +310,7 @@ pertvbx: /* Perturbation of vbx */ /* store the small signal parameters * corresponding to perturbed vbx */ - if(error = BJT2load((GENmodel*)model,ckt)) return(error); + if((error = BJT2load((GENmodel*)model,ckt))) return(error); *(here->BJT2senGpi + 2)= *(ckt->CKTstate0 + here->BJT2gpi); *(here->BJT2senGmu + 2)= *(ckt->CKTstate0 + here->BJT2gmu); @@ -349,7 +349,7 @@ pertvbe: /* Perturbation of vbe */ /* store the small signal parameters * corresponding to perturbed vbe */ - if(error = BJT2load((GENmodel*)model,ckt)) return(error); + if((error = BJT2load((GENmodel*)model,ckt))) return(error); *(here->BJT2senGpi + 3)= *(ckt->CKTstate0 + here->BJT2gpi); *(here->BJT2senGmu + 3)= *(ckt->CKTstate0 + here->BJT2gmu); @@ -391,7 +391,7 @@ pertvbc: /* Perturbation of vbc */ /* store the small signal parameters * corresponding to perturbed vbc */ - if(error = BJT2load((GENmodel*)model,ckt)) return(error); + if((error = BJT2load((GENmodel*)model,ckt))) return(error); *(here->BJT2senGpi + 4)= *(ckt->CKTstate0 + here->BJT2gpi); *(here->BJT2senGmu + 4)= *(ckt->CKTstate0 + here->BJT2gmu); *(here->BJT2senGm + 4)= *(ckt->CKTstate0 + here->BJT2gm); @@ -430,7 +430,7 @@ pertvcs: /* Perturbation of vcs */ /* store the small signal parameters * corresponding to perturbed vcs */ - if(error = BJT2load((GENmodel*)model,ckt)) return(error); + if((error = BJT2load((GENmodel*)model,ckt))) return(error); *(here->BJT2senCsub + 5)= *(ckt->CKTstate0 + here->BJT2cqsub); } diff --git a/src/spicelib/devices/bjt2/bjt2setup.c b/src/spicelib/devices/bjt2/bjt2setup.c index 69c70166f..1d742935f 100644 --- a/src/spicelib/devices/bjt2/bjt2setup.c +++ b/src/spicelib/devices/bjt2/bjt2setup.c @@ -185,7 +185,7 @@ BJT2setup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *states) /* loop through all the instances of the model */ for (here = model->BJT2instances; here != NULL ; here=here->BJT2nextInstance) { - CKTnode *tmpNode; + CKTnode *tmpNode[1]; IFuid tmpName; if (here->BJT2owner != ARCHme) @@ -220,10 +220,10 @@ matrixpointers: if(error) return(error); here->BJT2colPrimeNode = tmp->number; if (ckt->CKTcopyNodesets) { - if (CKTinst2Node(ckt,here,1,&tmpNode,&tmpName)==OK) { - if (tmpNode->nsGiven) { - tmp->nodeset=tmpNode->nodeset; - tmp->nsGiven=tmpNode->nsGiven; + if (CKTinst2Node(ckt,here,1,(void **)tmpNode,&tmpName)==OK) { + if (tmpNode[0]->nsGiven) { + tmp->nodeset=tmpNode[0]->nodeset; + tmp->nsGiven=tmpNode[0]->nsGiven; /* fprintf(stderr, "Nodeset copied from %s\n", tmpName); fprintf(stderr, " to %s\n", tmp->name); fprintf(stderr, " value %g\n", @@ -239,10 +239,10 @@ matrixpointers: if(error) return(error); here->BJT2basePrimeNode = tmp->number; if (ckt->CKTcopyNodesets) { - if (CKTinst2Node(ckt,here,2,&tmpNode,&tmpName)==OK) { - if (tmpNode->nsGiven) { - tmp->nodeset=tmpNode->nodeset; - tmp->nsGiven=tmpNode->nsGiven; + if (CKTinst2Node(ckt,here,2,(void **)tmpNode,&tmpName)==OK) { + if (tmpNode[0]->nsGiven) { + tmp->nodeset=tmpNode[0]->nodeset; + tmp->nsGiven=tmpNode[0]->nsGiven; /* fprintf(stderr, "Nodeset copied from %s\n", tmpName); fprintf(stderr, " to %s\n", tmp->name); fprintf(stderr, " value %g\n", @@ -258,10 +258,10 @@ matrixpointers: if(error) return(error); here->BJT2emitPrimeNode = tmp->number; if (ckt->CKTcopyNodesets) { - if (CKTinst2Node(ckt,here,3,&tmpNode,&tmpName)==OK) { - if (tmpNode->nsGiven) { - tmp->nodeset=tmpNode->nodeset; - tmp->nsGiven=tmpNode->nsGiven; + if (CKTinst2Node(ckt,here,3,(void **)tmpNode,&tmpName)==OK) { + if (tmpNode[0]->nsGiven) { + tmp->nodeset=tmpNode[0]->nodeset; + tmp->nsGiven=tmpNode[0]->nsGiven; /* fprintf(stderr, "Nodeset copied from %s\n", tmpName); fprintf(stderr, " to %s\n", tmp->name); fprintf(stderr, " value %g\n", diff --git a/src/spicelib/devices/bjt2/bjt2sload.c b/src/spicelib/devices/bjt2/bjt2sload.c index ef00c53c9..f5a05f52e 100644 --- a/src/spicelib/devices/bjt2/bjt2sload.c +++ b/src/spicelib/devices/bjt2/bjt2sload.c @@ -61,10 +61,10 @@ BJT2sLoad(GENmodel *inModel, CKTcircuit *ckt) double qcs; double qbx0; double qbx; - double DqbeDp; - double DqbcDp; - double DqcsDp; - double DqbxDp; + double DqbeDp = 0.0; + double DqbcDp = 0.0; + double DqcsDp = 0.0; + double DqbxDp = 0.0; double Osxpbe; double Osxpbc; double Osxpcs; diff --git a/src/spicelib/devices/bsim1/b1eval.c b/src/spicelib/devices/bsim1/b1eval.c index 061a97e26..333a12c3e 100644 --- a/src/spicelib/devices/bsim1/b1eval.c +++ b/src/spicelib/devices/bsim1/b1eval.c @@ -27,18 +27,18 @@ B1evaluate(double vds, double vbs, double vgs, B1instance *here, B1model *model, double gm; double gds; double gmbs; - double qg; - double qb; - double qd; - double cggb; - double cgdb; - double cgsb; - double cbgb; - double cbdb; - double cbsb; - double cdgb; - double cddb; - double cdsb; + double qg = 0.0; + double qb = 0.0; + double qd = 0.0; + double cggb = 0.0; + double cgdb = 0.0; + double cgsb = 0.0; + double cbgb = 0.0; + double cbdb = 0.0; + double cbsb = 0.0; + double cdgb = 0.0; + double cddb = 0.0; + double cdsb = 0.0; double Vfb; double Phi; double K1; @@ -83,7 +83,7 @@ B1evaluate(double vds, double vbs, double vgs, B1instance *here, B1model *model, double dBetadVgs; double dBetadVds; double dBetadVbs; - double VdsSat; + double VdsSat = 0.0; double Argl1; double Argl2; double Vc; diff --git a/src/spicelib/devices/bsim1/b1set.c b/src/spicelib/devices/bsim1/b1set.c index 18ff36c7a..d9e391bbf 100644 --- a/src/spicelib/devices/bsim1/b1set.c +++ b/src/spicelib/devices/bsim1/b1set.c @@ -273,7 +273,7 @@ B1setup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, for (here = model->B1instances; here != NULL ; here=here->B1nextInstance) { - CKTnode *tmpNode; + CKTnode *tmpNode[1]; IFuid tmpName; if (here->B1owner == ARCHme) { @@ -334,10 +334,10 @@ B1setup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, if(error) return(error); here->B1dNodePrime = tmp->number; if (ckt->CKTcopyNodesets) { - if (CKTinst2Node(ckt,here,1,&tmpNode,&tmpName)==OK) { - if (tmpNode->nsGiven) { - tmp->nodeset=tmpNode->nodeset; - tmp->nsGiven=tmpNode->nsGiven; + if (CKTinst2Node(ckt,here,1,(void **)tmpNode,&tmpName)==OK) { + if (tmpNode[0]->nsGiven) { + tmp->nodeset=tmpNode[0]->nodeset; + tmp->nsGiven=tmpNode[0]->nsGiven; } } } @@ -354,10 +354,10 @@ B1setup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, if(error) return(error); here->B1sNodePrime = tmp->number; if (ckt->CKTcopyNodesets) { - if (CKTinst2Node(ckt,here,3,&tmpNode,&tmpName)==OK) { - if (tmpNode->nsGiven) { - tmp->nodeset=tmpNode->nodeset; - tmp->nsGiven=tmpNode->nsGiven; + if (CKTinst2Node(ckt,here,3,(void **)tmpNode,&tmpName)==OK) { + if (tmpNode[0]->nsGiven) { + tmp->nodeset=tmpNode[0]->nodeset; + tmp->nsGiven=tmpNode[0]->nsGiven; } } } diff --git a/src/spicelib/devices/bsim2/b2eval.c b/src/spicelib/devices/bsim2/b2eval.c index 7ad7e9e80..a360ecc43 100644 --- a/src/spicelib/devices/bsim2/b2eval.c +++ b/src/spicelib/devices/bsim2/b2eval.c @@ -21,16 +21,17 @@ B2evaluate(double Vds, double Vbs, double Vgs, B2instance *here, B2model *model, double *cdg, double *cdd, double *cds, double *Ids, double *von, double *vdsat, CKTcircuit *ckt) { - double Vth, Vdsat; + double Vth, Vdsat = 0.0; double Phisb, T1s, Eta, Gg, Aa, Inv_Aa, U1, U1s, Vc, Kk, SqrtKk; double dPhisb_dVb, dT1s_dVb, dVth_dVb, dVth_dVd, dAa_dVb, dVc_dVd; - double dVc_dVg, dVc_dVb, dKk_dVc, dVdsat_dVd, dVdsat_dVg, dVdsat_dVb; + double dVc_dVg, dVc_dVb, dKk_dVc; + double dVdsat_dVd = 0.0, dVdsat_dVg = 0.0, dVdsat_dVb = 0.0; double dUvert_dVg, dUvert_dVd, dUvert_dVb, Inv_Kk; double dUtot_dVd, dUtot_dVb, dUtot_dVg, Ai, Bi, Vghigh, Vglow, Vgeff, Vof; double Vbseff, Vgst, Vgdt, Qbulk, Utot; - double T0, T1, T2, T3, T4, T5, Arg1, Arg2, Exp0; - double tmp, tmp1, tmp2, tmp3, Uvert, Beta1, Beta2, Beta0, dGg_dVb, Exp1; - double T6, T7, T8, T9, n, ExpArg, ExpArg1; + double T0, T1, T2, T3, T4, T5, Arg1, Arg2, Exp0 = 0.0, Exp1 = 0.0; + double tmp, tmp1, tmp2, tmp3, Uvert, Beta1, Beta2, Beta0, dGg_dVb; + double T6, T7, T8, T9, n = 0.0, ExpArg, ExpArg1; double Beta, dQbulk_dVb, dVgdt_dVg, dVgdt_dVd; double dVbseff_dVb, Ua, Ub, dVgdt_dVb, dQbulk_dVd; double Con1, Con3, Con4, SqrVghigh, SqrVglow, CubVghigh, CubVglow; diff --git a/src/spicelib/devices/bsim2/b2ld.c b/src/spicelib/devices/bsim2/b2ld.c index c83ef8f6d..f41d5322b 100644 --- a/src/spicelib/devices/bsim2/b2ld.c +++ b/src/spicelib/devices/bsim2/b2ld.c @@ -32,8 +32,8 @@ B2load(GENmodel *inModel, CKTcircuit *ckt) double DrainPerimeter; double SourcePerimeter; double arg; - double capbd; - double capbs; + double capbd = 0.0; + double capbs = 0.0; double cbd; double cbhat; double cbs; diff --git a/src/spicelib/devices/bsim2/b2set.c b/src/spicelib/devices/bsim2/b2set.c index 17f0dc1f1..bc8e2b6b7 100644 --- a/src/spicelib/devices/bsim2/b2set.c +++ b/src/spicelib/devices/bsim2/b2set.c @@ -493,13 +493,13 @@ B2setup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *states) if(error) return(error); here->B2dNodePrime = tmp->number; if (ckt->CKTcopyNodesets) { - CKTnode *tmpNode; + CKTnode *tmpNode[1]; IFuid tmpName; - if (CKTinst2Node(ckt,here,1,&tmpNode,&tmpName)==OK) { - if (tmpNode->nsGiven) { - tmp->nodeset=tmpNode->nodeset; - tmp->nsGiven=tmpNode->nsGiven; + if (CKTinst2Node(ckt,here,1,(void **)tmpNode,&tmpName)==OK) { + if (tmpNode[0]->nsGiven) { + tmp->nodeset=tmpNode[0]->nodeset; + tmp->nsGiven=tmpNode[0]->nsGiven; } } } @@ -517,13 +517,13 @@ B2setup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *states) return(error); here->B2sNodePrime = tmp->number; if (ckt->CKTcopyNodesets) { - CKTnode *tmpNode; + CKTnode *tmpNode[1]; IFuid tmpName; - if (CKTinst2Node(ckt,here,3,&tmpNode,&tmpName)==OK) { - if (tmpNode->nsGiven) { - tmp->nodeset=tmpNode->nodeset; - tmp->nsGiven=tmpNode->nsGiven; + if (CKTinst2Node(ckt,here,3,(void **)tmpNode,&tmpName)==OK) { + if (tmpNode[0]->nsGiven) { + tmp->nodeset=tmpNode[0]->nodeset; + tmp->nsGiven=tmpNode[0]->nsGiven; } } } diff --git a/src/spicelib/devices/bsim3/b3acld.c b/src/spicelib/devices/bsim3/b3acld.c index 055fc2d74..6cbd9a105 100644 --- a/src/spicelib/devices/bsim3/b3acld.c +++ b/src/spicelib/devices/bsim3/b3acld.c @@ -25,7 +25,8 @@ double xcggb, xcgdb, xcgsb, xcbgb, xcbdb, xcbsb, xcddb, xcssb, xcdgb; double gdpr, gspr, gds, gbd, gbs, capbd, capbs, xcsgb, xcdsb, xcsdb; double cggb, cgdb, cgsb, cbgb, cbdb, cbsb, cddb, cdgb, cdsb, omega; double GSoverlapCap, GDoverlapCap, GBoverlapCap, FwdSum, RevSum, Gm, Gmbs; -double dxpart, sxpart, xgtg, xgtd, xgts, xgtb, xcqgb, xcqdb, xcqsb, xcqbb; +double dxpart, sxpart, xgtg, xgtd, xgts, xgtb; +double xcqgb = 0.0, xcqdb = 0.0, xcqsb = 0.0, xcqbb = 0.0; double gbspsp, gbbdp, gbbsp, gbspg, gbspb; double gbspdp, gbdpdp, gbdpg, gbdpb, gbdpsp; double ddxpart_dVd, ddxpart_dVg, ddxpart_dVb, ddxpart_dVs; diff --git a/src/spicelib/devices/bsim3/b3ld.c b/src/spicelib/devices/bsim3/b3ld.c index e2d58c4a1..3d5fa5c55 100644 --- a/src/spicelib/devices/bsim3/b3ld.c +++ b/src/spicelib/devices/bsim3/b3ld.c @@ -42,13 +42,14 @@ double ag0, qgd, qgs, qgb, von, cbhat, VgstNVt, ExpVgst; double cdrain, cdhat, cdreq, ceqbd, ceqbs, ceqqb, ceqqd, ceqqg, ceq, geq; double czbd, czbdsw, czbdswg, czbs, czbssw, czbsswg, evbd, evbs, arg, sarg; double delvbd, delvbs, delvds, delvgd, delvgs; -double Vfbeff, dVfbeff_dVg, dVfbeff_dVd, dVfbeff_dVb, V3, V4; +double Vfbeff, dVfbeff_dVg, dVfbeff_dVd = 0.0, dVfbeff_dVb, V3, V4; double gcbdb, gcbgb, gcbsb, gcddb, gcdgb, gcdsb, gcgdb, gcggb, gcgsb, gcsdb; double gcsgb, gcssb, MJ, MJSW, MJSWG; double vbd, vbs, vds, vgb, vgd, vgs, vgdo, xfact; -double qgate, qbulk, qdrn, qsrc, qinoi, cqgate, cqbulk, cqdrn; +double qgate = 0.0, qbulk = 0.0, qdrn = 0.0, qsrc; +double qinoi, cqgate, cqbulk, cqdrn; double Vds, Vgs, Vbs, Gmbs, FwdSum, RevSum; -double Vgs_eff, Vfb, dVfb_dVb, dVfb_dVd; +double Vgs_eff, Vfb, dVfb_dVb = 0.0, dVfb_dVd = 0.0; double Phis, dPhis_dVb, sqrtPhis, dsqrtPhis_dVb, Vth, dVth_dVb, dVth_dVd; double Vgst, dVgst_dVg, dVgst_dVb, dVgs_eff_dVg, Nvtm; double Vtm; @@ -107,8 +108,8 @@ double Leff, Weff, dWeff_dVg, dWeff_dVb; double AbulkCV, dAbulkCV_dVb; double qgdo, qgso, cgdo, cgso; -double qcheq, qdef, gqdef, cqdef, cqcheq, gtau_diff, gtau_drift; -double gcqdb,gcqsb,gcqgb,gcqbb; +double qcheq = 0.0, qdef, gqdef = 0.0, cqdef, cqcheq, gtau_diff, gtau_drift; +double gcqdb = 0.0,gcqsb = 0.0, gcqgb = 0.0,gcqbb = 0.0; double dxpart, sxpart, ggtg, ggtd, ggts, ggtb; double ddxpart_dVd, ddxpart_dVg, ddxpart_dVb, ddxpart_dVs; double dsxpart_dVd, dsxpart_dVg, dsxpart_dVb, dsxpart_dVs; @@ -118,7 +119,8 @@ double gbdpdp, gbdpg, gbdpb, gbdpsp; double Cgg, Cgd, Cgb, Cdg, Cdd, Cds; double Csg, Csd, Css, Csb, Cbg, Cbd, Cbb; double Cgg1, Cgb1, Cgd1, Cbg1, Cbb1, Cbd1, Qac0, Qsub0; -double dQac0_dVg, dQac0_dVd, dQac0_dVb, dQsub0_dVg, dQsub0_dVd, dQsub0_dVb; +double dQac0_dVg, dQac0_dVd = 0.0, dQac0_dVb, dQsub0_dVg; +double dQsub0_dVd, dQsub0_dVb; double m; diff --git a/src/spicelib/devices/bsim3/b3pzld.c b/src/spicelib/devices/bsim3/b3pzld.c index 8dffbd7d3..5a4e169a2 100644 --- a/src/spicelib/devices/bsim3/b3pzld.c +++ b/src/spicelib/devices/bsim3/b3pzld.c @@ -26,7 +26,8 @@ double xcdgb, xcddb, xcdsb, xcdbb, xcsgb, xcsdb, xcssb, xcsbb; double gdpr, gspr, gds, gbd, gbs, capbd, capbs, FwdSum, RevSum, Gm, Gmbs; double cggb, cgdb, cgsb, cbgb, cbdb, cbsb, cddb, cdgb, cdsb; double GSoverlapCap, GDoverlapCap, GBoverlapCap; -double dxpart, sxpart, xgtg, xgtd, xgts, xgtb, xcqgb, xcqdb, xcqsb, xcqbb; +double dxpart, sxpart, xgtg, xgtd, xgts, xgtb; +double xcqgb = 0.0, xcqdb = 0.0, xcqsb = 0.0, xcqbb = 0.0; double gbspsp, gbbdp, gbbsp, gbspg, gbspb; double gbspdp, gbdpdp, gbdpg, gbdpb, gbdpsp; double ddxpart_dVd, ddxpart_dVg, ddxpart_dVb, ddxpart_dVs; diff --git a/src/spicelib/devices/bsim3/b3set.c b/src/spicelib/devices/bsim3/b3set.c index c99456249..bf9ea062b 100644 --- a/src/spicelib/devices/bsim3/b3set.c +++ b/src/spicelib/devices/bsim3/b3set.c @@ -35,7 +35,7 @@ BSIM3instance *here; int error; CKTnode *tmp; -CKTnode *tmpNode; +CKTnode *tmpNode[1]; IFuid tmpName; /* loop through all the BSIM3 device models */ @@ -947,10 +947,10 @@ IFuid tmpName; here->BSIM3dNodePrime = tmp->number; if (ckt->CKTcopyNodesets) { - if (CKTinst2Node(ckt,here,1,&tmpNode,&tmpName)==OK) { - if (tmpNode->nsGiven) { - tmp->nodeset=tmpNode->nodeset; - tmp->nsGiven=tmpNode->nsGiven; + if (CKTinst2Node(ckt,here,1,(void **)tmpNode,&tmpName)==OK) { + if (tmpNode[0]->nsGiven) { + tmp->nodeset=tmpNode[0]->nodeset; + tmp->nsGiven=tmpNode[0]->nsGiven; } } } @@ -976,10 +976,10 @@ IFuid tmpName; here->BSIM3sNodePrime = tmp->number; if (ckt->CKTcopyNodesets) { - if (CKTinst2Node(ckt,here,3,&tmpNode,&tmpName)==OK) { - if (tmpNode->nsGiven) { - tmp->nodeset=tmpNode->nodeset; - tmp->nsGiven=tmpNode->nsGiven; + if (CKTinst2Node(ckt,here,3,(void **)tmpNode,&tmpName)==OK) { + if (tmpNode[0]->nsGiven) { + tmp->nodeset=tmpNode[0]->nodeset; + tmp->nsGiven=tmpNode[0]->nsGiven; } } } diff --git a/src/spicelib/devices/bsim3soi/b3soiacld.c b/src/spicelib/devices/bsim3soi/b3soiacld.c index 6933db5bb..418e1e8f6 100644 --- a/src/spicelib/devices/bsim3soi/b3soiacld.c +++ b/src/spicelib/devices/bsim3soi/b3soiacld.c @@ -38,7 +38,7 @@ double gbbg, gbbdp, gbbb, gbbp, gbbsp, gbbT; double gddpg, gddpdp, gddpsp, gddpb, gddpT; double gsspg, gsspdp, gsspsp, gsspb, gsspT; double gppb, gppp; -double xcTt, cTt, gcTt, gTtt, gTtg, gTtb, gTtdp, gTtsp; +double xcTt, cTt, gTtt, gTtg, gTtb, gTtdp, gTtsp; double EDextrinsicCap, ESextrinsicCap; double xcedb, xcesb; diff --git a/src/spicelib/devices/bsim3soi/b3soild.c b/src/spicelib/devices/bsim3soi/b3soild.c index cc652d339..11866866d 100644 --- a/src/spicelib/devices/bsim3soi/b3soild.c +++ b/src/spicelib/devices/bsim3soi/b3soild.c @@ -94,13 +94,13 @@ B3SOImodel *model = (B3SOImodel*)inModel; B3SOIinstance *here; int selfheat; -double SourceSatCurrent, DrainSatCurrent, Gmin; -double ag0, qgd, qgs, qgb, von, cbhat, VgstNVt, ExpVgst; +double Gmin; +double ag0, qgd, qgs, von, cbhat, VgstNVt, ExpVgst = 0.0; double cdhat, cdreq, ceqbd, ceqbs, ceqqb, ceqqd, ceqqg, ceq, geq; -double evbd, evbs, arg, sarg; +double arg; double delvbd, delvbs, delvds, delvgd, delvgs; double Vfbeff, dVfbeff_dVg, dVfbeff_dVd, dVfbeff_dVb, V3, V4; -double tol, PhiB, PhiBSWG, MJSWG; +double PhiBSWG, MJSWG; double gcgdb, gcggb, gcgsb, gcgeb, gcgT; double gcsdb, gcsgb, gcssb, gcseb, gcsT; double gcddb, gcdgb, gcdsb, gcdeb, gcdT; @@ -110,50 +110,45 @@ double gcTt, gTtg, gTtb, gTtdp, gTtt, gTtsp; double vbd, vbs, vds, vgb, vgd, vgs, vgdo, xfact; double vg, vd, vs, vp, ve, vb; double Vds, Vgs, Vbs, Gmbs, FwdSum, RevSum; -double Vgs_eff, Vfb, dVfb_dVb, dVfb_dVd, dVfb_dT; +double Vgs_eff, Vfb = 0.0, dVfb_dVb, dVfb_dVd, dVfb_dT; double Phis, dPhis_dVb, sqrtPhis, dsqrtPhis_dVb, Vth, dVth_dVb, dVth_dVd, dVth_dT; -double Vgst, dVgst_dVg, dVgst_dVb, dVgs_eff_dVg, Nvtm; -double Vgdt, Vgsaddvth, Vgsaddvth2, Vgsaddvth1o3, n, dn_dVb, Vtm; +double Vgst, dVgst_dVg, dVgst_dVb, dVgs_eff_dVg; +double n, dn_dVb, Vtm; double ExpArg, V0; double ueff, dueff_dVg, dueff_dVd, dueff_dVb, dueff_dT; -double Esat, dEsat_dVg, dEsat_dVd, dEsat_dVb, Vdsat, Vdsat0; +double Esat, Vdsat; double EsatL, dEsatL_dVg, dEsatL_dVd, dEsatL_dVb, dEsatL_dT; -double dVdsat_dVg, dVdsat_dVb, dVdsat_dVd, dVdsat_dT, Vasat, dAlphaz_dVg, dAlphaz_dVb; +double dVdsat_dVg, dVdsat_dVb, dVdsat_dVd, dVdsat_dT, Vasat; double dVasat_dVg, dVasat_dVb, dVasat_dVd, dVasat_dT; -double Va, Va2, dVa_dVd, dVa_dVg, dVa_dVb, dVa_dT; +double Va, dVa_dVd, dVa_dVg, dVa_dVb, dVa_dT; double Vbseff, dVbseff_dVb; -double Alphaz, CoxWL; -double dVgdt_dVg, dVgdt_dVd, dVgdt_dVb; -double T0, dT0_dVg, dT0_dVd, dT0_dVb, dT0_dVrg, dT0_dT; +double CoxWL; +double T0, dT0_dVg, dT0_dVd, dT0_dVb, dT0_dT; double T1, dT1_dVg, dT1_dVd, dT1_dVb, dT1_dT; double T2, dT2_dVg, dT2_dVd, dT2_dVb, dT2_dT; -double T3, dT3_dVg, dT3_dVd, dT3_dVb, dT3_dT; -double T4, dT4_dVg, dT4_dVd, dT4_dVb, dT4_dT; -double T5, dT5_dVg, dT5_dVd, dT5_dVb, dT5_dT; -double T6, dT6_dVg, dT6_dVd, dT6_dVb, dT6_dT; -double T7, dT7_dVg, dT7_dVd, dT7_dVb; -double T8, dT8_dVg, dT8_dVd, dT8_dVb, dT8_dVrg; -double T9, dT9_dVg, dT9_dVd, dT9_dVb, dT9_dVrg; -double T10, dT10_dVg, dT10_dVb, dT10_dVd; +double T3, dT3_dVg, dT3_dVd, dT3_dVb, dT3_dT = 0.0; +double T4, dT4_dVd, dT4_dVb, dT4_dT; +double T5, dT5_dVg, dT5_dVd, dT5_dVb, dT5_dT = 0.0; +double T6, dT6_dVg, dT6_dVd, dT6_dVb, dT6_dT = 0.0; +double T7; +double T8, dT8_dVd; +double T9, dT9_dVd; +double T10, dT10_dVb, dT10_dVd; double T11, T12; double tmp, Abulk, dAbulk_dVb, Abulk0, dAbulk0_dVb; -double T100, T101; double VACLM, dVACLM_dVg, dVACLM_dVd, dVACLM_dVb, dVACLM_dT; double VADIBL, dVADIBL_dVg, dVADIBL_dVd, dVADIBL_dVb, dVADIBL_dT; -double VAHCE, dVAHCE_dVg, dVAHCE_dVd, dVAHCE_dVb; double Xdep, dXdep_dVb, lt1, dlt1_dVb, ltw, dltw_dVb; double Delt_vth, dDelt_vth_dVb, dDelt_vth_dT; -double Theta0, dTheta0_dVb, Theta1, dTheta1_dVb; -double Thetarout, dThetarout_dVb, TempRatio, tmp1, tmp2, tmp3, tmp4; -double DIBL_Sft, dDIBL_Sft_dVd, DIBL_fact, Lambda, dLambda_dVg; -double Rout_Vgs_factor, dRout_Vgs_factor_dVg, dRout_Vgs_factor_dVb; -double dRout_Vgs_factor_dVd; -double tempv, a1; +double Theta0, dTheta0_dVb; +double TempRatio, tmp1, tmp2, tmp3, tmp4; +double DIBL_Sft, dDIBL_Sft_dVd, Lambda, dLambda_dVg; +double a1; double Vgsteff, dVgsteff_dVg, dVgsteff_dVd, dVgsteff_dVb, dVgsteff_dT; double Vdseff, dVdseff_dVg, dVdseff_dVd, dVdseff_dVb, dVdseff_dT; double VdseffCV, dVdseffCV_dVg, dVdseffCV_dVd, dVdseffCV_dVb; -double diffVds, diffVdsCV; +double diffVds; double dAbulk_dVg, dn_dVd ; double beta, dbeta_dVg, dbeta_dVd, dbeta_dVb, dbeta_dT; double gche, dgche_dVg, dgche_dVd, dgche_dVb, dgche_dT; @@ -163,7 +158,7 @@ double Idl, dIdl_dVg, dIdl_dVd, dIdl_dVb, dIdl_dT; double Ids, Gm, Gds, Gmb; double CoxWovL; double Rds, dRds_dVg, dRds_dVb, dRds_dT, WVCox, WVCoxRds; -double Vgst2Vtm, dVgst2Vtm_dT, VdsatCV, dVdsatCV_dVd, dVdsatCV_dVg, dVdsatCV_dVb; +double Vgst2Vtm, dVgst2Vtm_dT, VdsatCV, dVdsatCV_dVg, dVdsatCV_dVb; double Leff, Weff, dWeff_dVg, dWeff_dVb; double AbulkCV, dAbulkCV_dVb; double qgdo, qgso, cgdo, cgso; @@ -171,42 +166,39 @@ double qgdo, qgso, cgdo, cgso; double dxpart, sxpart; struct b3soiSizeDependParam *pParam; -int ByPass, Check, ChargeComputationNeeded, J, error, I; -double junk[50]; +int ByPass, Check, ChargeComputationNeeded = 0, error; double gbbsp, gbbdp, gbbg, gbbb, gbbp, gbbT; double gddpsp, gddpdp, gddpg, gddpb, gddpT; double gsspsp, gsspdp, gsspg, gsspb, gsspT; double Gbpbs, Gbpps; -double vse, vde, ves, ved, veb, vge, delves, vedo, delved; +double ves, ved, veb, vge = 0.0, delves, vedo, delved; double vps, vpd, Vps, delvps; -double Vbd, Ves, Vesfb, sqrtXdep, DeltVthtemp, dDeltVthtemp_dT; +double Vbd, Ves, Vesfb, DeltVthtemp, dDeltVthtemp_dT; double Vbp, dVbp_dVb; double DeltVthw, dDeltVthw_dVb, dDeltVthw_dT; double Gm0, Gds0, Gmb0, GmT0, Gmc, GmT; double dDIBL_Sft_dVb; -double diffVdsii ; double Idgidl, Gdgidld, Gdgidlg, Isgidl, Gsgidlg; -double Gjsd, Gjss, Gjsb, GjsT, Gjdd, Gjdb, GjdT; +double Gjsd, Gjsb, GjsT, Gjdd, Gjdb, GjdT; double Ibp, Iii, Giid, Giig, Giib, GiiT, Gcd, Gcb, GcT, ceqbody, ceqbodcon; double gppb, gppp; double delTemp, deldelTemp, Temp; double ceqth, ceqqth; -double K1, WL; -double qjs, gcjsbs, gcjsT; -double qjd, gcjdbs, gcjdds, gcjdT; +double K1; +double qjs = 0.0, gcjsbs, gcjsT; +double qjd = 0.0, gcjdbs, gcjdds, gcjdT; double qge; double ceqqe; -double ni, Eg, Cbox, Nfb, CboxWL; +double ni, Eg, Cbox, CboxWL; double cjsbs; double dVfbeff_dVrg; -double qinv, qgate, qbody, qdrn, qsrc, qsub, cqgate, cqbody, cqdrn, cqsub, cqtemp; -double Cgg, Cgd, Cgs, Cgb, Cdg, Cdd, Cds, Cdb, Qg, Qd; -double Csg, Csd, Css, Csb, Cbg, Cbd, Cbs, Cbb, Qs, Qb; +double qinv, qgate = 0.0, qbody = 0.0, qdrn = 0.0, qsrc, qsub = 0.0; +double cqgate, cqbody, cqdrn, cqsub, cqtemp; +double Cgg, Cgd, Cgb; +double Csg, Csd, Csb, Cbg = 0.0, Cbd = 0.0, Cbb = 0.0; double Cgg1, Cgb1, Cgd1, Cbg1, Cbb1, Cbd1, Csg1, Csd1, Csb1; -double Vbseff0; -double Vdsatii ,dVdsatii_dVg ,dVdsatii_dVd, dVdsatii_dVb, dVdsatii_dT; -double Ibjt ,dIbjt_dVb ,dIbjt_dVd ,dIbjt_dT; +double Vdsatii; double Ibs1 ,dIbs1_dVb ,dIbs1_dT; double Ibs2 ,dIbs2_dVb ,dIbs2_dT; double Ibs3 ,dIbs3_dVb ,dIbs3_dVd, dIbs3_dT; @@ -215,31 +207,25 @@ double Ibd1 ,dIbd1_dVb ,dIbd1_dVd ,dIbd1_dT; double Ibd2 ,dIbd2_dVb ,dIbd2_dVd ,dIbd2_dT; double Ibd3 ,dIbd3_dVb ,dIbd3_dVd ,dIbd3_dT; double Ibd4 ,dIbd4_dVb ,dIbd4_dVd ,dIbd4_dT; -double ExpVbs1, dExpVbs1_dVb, dExpVbs1_dT; -double ExpVbs2, dExpVbs2_dVb, dExpVbs2_dT; -double ExpVbs4, dExpVbs4_dVb, dExpVbs4_dT; -double ExpVbd1, dExpVbd1_dVb, dExpVbd1_dT; -double ExpVbd2, dExpVbd2_dVb, dExpVbd2_dT; -double ExpVbd4, dExpVbd4_dVb, dExpVbd4_dT; double WTsi, NVtm1, NVtm2; double Ic ,dIc_dVb ,dIc_dVd; -double Ibs ,dIbs_dVb ,dIbs_dVd ; -double Ibd ,dIbd_dVb; +double Ibs; +double Ibd; double Denomi ,dDenomi_dVg ,dDenomi_dVd ,dDenomi_dVb ,dDenomi_dT; -double Qsub0 ,dQsub0_dVg ,dQsub0_dVb ,dQsub0_dVd ; -double Qac0 ,dQac0_dVb ,dQac0_dVd; -double Qdep0 ,dQdep0_dVb; +double Qsub0 = 0.0, dQsub0_dVg, dQsub0_dVb, dQsub0_dVd ; +double Qac0 = 0.0 ,dQac0_dVb ,dQac0_dVd; double Qe1 , dQe1_dVb, dQe1_dVe, dQe1_dT; double Ce1b ,Ce1e, Ce1T; double dQac0_dVrg, dQsub0_dVrg; /* for self-heating */ -double vbi, vfbb, phi, sqrtPhi, Xdep0, jbjt, jdif, jrec, jtun, u0temp, vsattemp; +double vbi, vfbb, phi, sqrtPhi, Xdep0, jbjt, jdif, jrec, jtun; +double u0temp, vsattemp; double rds0, ua, ub, uc; double dvbi_dT, dvfbb_dT, djbjt_dT, djdif_dT, djrec_dT, djtun_dT, du0temp_dT; double dvsattemp_dT, drds0_dT, dua_dT, dub_dT, duc_dT, dni_dT, dVtm_dT; double dVfbeff_dT, dQac0_dT, dQsub0_dT; -double CbT, CsT, CgT, CeT; +double CbT, CsT, CgT; /* v2.0 release */ @@ -249,14 +235,15 @@ double T13, T14; double dT11_dVb, dT13_dVb, dT14_dVb; double dVgst_dVd; double Vdsatii0, dVdsatii0_dT; -double VgsStep, dVgsStep_dT, Ratio, dRatio_dVg, dRatio_dVb, dRatio_dVd, dRatio_dT, dTempRatio_dT; +double VgsStep, dVgsStep_dT, Ratio, dRatio_dVg, dRatio_dVb, dRatio_dVd; +double dRatio_dT, dTempRatio_dT; double Vdiff, dVdiff_dVg, dVdiff_dVb, dVdiff_dVd, dVdiff_dT; -double dNVtm1_dT, dNVtm2_dT; +double dNVtm1_dT; double NVtmf, NVtmr, dNVtmf_dT, dNVtmr_dT; double TempRatioMinus1; double Ahli, dAhli_dT; double WsTsi, WdTsi; -double dPhiBSWG_dT, dcjsbs_dT, darg_dT, ddT3_dVb_dT; +double dPhiBSWG_dT, dcjsbs_dT, darg_dT = 0.0, ddT3_dVb_dT = 0.0; double dT7_dT, dT0_dT7, dT1_dT7, dT2_dT7; double CoxWLb, CoxWLcenb; double ExpVbsNVtm, dExpVbsNVtm_dVb, dExpVbsNVtm_dT; @@ -274,14 +261,18 @@ double cjdbs, dcjdbs_dT; double wdios, wdiod, wdiosCV, wdiodCV; /* for capMod3 */ -double Cox, Tox, Tcen, dTcen_dVg, dTcen_dVb, LINK, Ccen, Coxeff, dCoxeff_dVg, dCoxeff_dVb; -double CoxWLcen, QovCox, dQac0_dVg, DeltaPhi, dDeltaPhi_dVg, dDeltaPhi_dVd, dDeltaPhi_dVb; -double dTcen_dVd, dTcen_dT, dCoxeff_dVd, dCoxeff_dT, dCoxWLcenb_dT, qinoi, qbulk; +double Cox, Tox, Tcen, dTcen_dVg, dTcen_dVb, LINK, Ccen, Coxeff; +double dCoxeff_dVg, dCoxeff_dVb; +double CoxWLcen, QovCox, dQac0_dVg, DeltaPhi, dDeltaPhi_dVg; +double dDeltaPhi_dVd, dDeltaPhi_dVb; +double dTcen_dVd, dTcen_dT, dCoxeff_dVd, dCoxeff_dT, dCoxWLcenb_dT; +double qinoi, qbulk; + double T3zb, lt1zb, ltwzb, Theta0zb; double Delt_vthzb, dDelt_vthzb_dT; double DeltVthwzb, dDeltVthwzb_dT; double DeltVthtempzb, dDeltVthtempzb_dT; -double Vthzb, dVthzb_dT, Vfbzb, dVfbzb_dT; +double Vthzb = 0.0, dVthzb_dT = 0.0, Vfbzb, dVfbzb_dT; /* v3.0 */ double Igc, dIgc_dVg, dIgc_dVd, dIgc_dVb, Igs, dIgs_dVg, dIgs_dVs, Igd, dIgd_dVg, dIgd_dVd; @@ -295,31 +286,34 @@ double gIgtotg, gIgtotd, gIgtotb, gIgtots, Igtoteq; /* v3.0 */ double Vbsitf, dVbsitf_dVg, dVbsitf_dVd, dVbsitf_dVb, dVbsitf_dVe, dVbsitf_dT; double dIgb1_dVe, gige, Giie, dT0_dVe, dRatio_dVe, dVdiff_dVe; -double dT1_dVe, dT5_dVe, dIgb_dVe, dVox_dVe, dVoxdepinv_dVe, dVaux_dVe; +double dT1_dVe, dT5_dVe, dIgb_dVe, dVox_dVe, dVoxdepinv_dVe = 0.0, dVaux_dVe; double Gme, gTte, gbbe, gddpe, gsspe; -double Vbsdio, dVbsdio_dVg, dVbsdio_dVd, dVbsdio_dVe, dVbsdio_dVb, dVbsdio_dT; -double Vbs0, dVbs0_dVg, dVbs0_dVd, dVbs0_dVb, dVbs0_dVe, dVbs0_dT; +double Vbs0, dVbs0_dVg, dVbs0_dVd, dVbs0_dVe, dVbs0_dT; double Vbs0mos, dVbs0mos_dVe, dVbs0mos_dT; double Vbsmos, dVbsmos_dVg, dVbsmos_dVd, dVbsmos_dVb, dVbsmos_dVe, dVbsmos_dT; -double PhiON, dPhiON_dVg, dPhiON_dVd, dPhiON_dVb, dPhiON_dVe, dPhiON_dT; -double PhiFD, dPhiFD_dVg, dPhiFD_dVd, dPhiFD_dVb, dPhiFD_dVe, dPhiFD_dT; -double Vbs0t, dVbs0t_dVg, dVbs0t_dVd, dVbs0t_dVb, dVbs0t_dVe, dVbs0t_dT; +double PhiON, dPhiON_dVg, dPhiON_dVd, dPhiON_dVe, dPhiON_dT; +double PhiFD, dPhiFD_dVg, dPhiFD_dVd, dPhiFD_dVe, dPhiFD_dT; +double Vbs0t, dVbs0t_dVg, dVbs0t_dVd, dVbs0t_dVe, dVbs0t_dT; double VthFD, dVthFD_dVd, dVthFD_dVb, dVthFD_dVe, dVthFD_dT; double VtgsFD, ExpVtgsFD, VgstFD, ExpVgstFD; -double VtgseffFD, dVtgseffFD_dVd, dVtgseffFD_dVg, dVtgseffFD_dVe, dVtgseffFD_dT; -double VgsteffFD, dVgsteffFD_dVd, dVgsteffFD_dVg, dVgsteffFD_dVe, dVgsteffFD_dT; +double VtgseffFD, dVtgseffFD_dVd, dVtgseffFD_dVg, dVtgseffFD_dVe; +double dVtgseffFD_dT; +double VgsteffFD, dVgsteffFD_dVd, dVgsteffFD_dVg, dVgsteffFD_dVe; +double dVgsteffFD_dT; double dT2_dVe, dVbsh_dVg, dVbsh_dVd, dVbsh_dVe, dVbsh_dT; double dVgsteff_dVe, dVbseff_dVg, dVbseff_dVd, dVbseff_dVe, dVbseff_dT; /* v2.2 release */ -double Vgb, dVgb_dVg, dVgb_dVb, Vox, dVox_dVg, dVox_dVd, dVox_dVb; +double Vgb = 0.0, dVgb_dVg = 0.0, dVgb_dVb = 0.0, Vox, dVox_dVg; +double dVox_dVd, dVox_dVb; double OxideRatio, Vaux, dVaux_dVg, dVaux_dVd, dVaux_dVb; double Igb, dIgb_dVg, dIgb_dVd, dIgb_dVb; double ceqgate; double dT0_dVox, Voxeff, dVoxeff_dVox; -double dVox_dT, dVaux_dT, dIgb_dT; -double Voxacc, dVoxacc_dVg, dVoxacc_dVd, dVoxacc_dVb, dVoxacc_dT; -double Voxdepinv, dVoxdepinv_dVg, dVoxdepinv_dVb, dVoxdepinv_dVd, dVoxdepinv_dT; +double dVox_dT, dVaux_dT = 0.0, dIgb_dT; +double Voxacc = 0.0, dVoxacc_dVg = 0.0, dVoxacc_dVd = 0.0, dVoxacc_dVb = 0.0; +double Voxdepinv = 0.0, dVoxdepinv_dVg = 0.0, dVoxdepinv_dVb = 0.0; +double dVoxdepinv_dVd = 0.0, dVoxdepinv_dT = 0.0; double Igb1, dIgb1_dVg, dIgb1_dVd, dIgb1_dVb, dIgb1_dT; double Igb2, dIgb2_dVg, dIgb2_dVd, dIgb2_dVb, dIgb2_dT; double gigs, gigd, gigb, gigg; diff --git a/src/spicelib/devices/bsim3soi/b3soinoi.c b/src/spicelib/devices/bsim3soi/b3soinoi.c index 1883e8b4a..342846ca2 100644 --- a/src/spicelib/devices/bsim3soi/b3soinoi.c +++ b/src/spicelib/devices/bsim3soi/b3soinoi.c @@ -48,9 +48,8 @@ B3SOIStrongInversionNoiseEval(double vgs, double vds, B3SOImodel *model, B3SOIinstance *here, double freq, double temp) { struct b3soiSizeDependParam *pParam; -double cd, esat, DelClm, EffFreq, N0, Nl, Vgst; -double T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, Ssi; -double req, ceq; +double cd, esat, DelClm, EffFreq, N0, Nl; +double T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, Ssi; pParam = here->pParam; cd = fabs(here->B3SOIcd) * here->B3SOIm; @@ -107,11 +106,10 @@ double noizDens[B3SOINSRCS]; double lnNdens[B3SOINSRCS]; double vgs, vds, Slimit; -double N0, Nl; -double T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13; -double n, ExpArg, Ssi, Swi; +double T1, T10, T11; +double Ssi, Swi; -int error, i; +int i; /* define the names of the noise sources */ static char *B3SOInNames[B3SOINSRCS] = diff --git a/src/spicelib/devices/bsim3soi/b3soipzld.c b/src/spicelib/devices/bsim3soi/b3soipzld.c index 34f6830d3..390edf83f 100644 --- a/src/spicelib/devices/bsim3soi/b3soipzld.c +++ b/src/spicelib/devices/bsim3soi/b3soipzld.c @@ -19,9 +19,10 @@ B3SOIpzLoad(GENmodel *inModel, CKTcircuit *ckt, SPcomplex *s) B3SOImodel *model = (B3SOImodel*)inModel; B3SOIinstance *here; double xcggb, xcgdb, xcgsb, xcbgb, xcbdb, xcbsb, xcddb, xcssb, xcdgb; -double gdpr, gspr, gds, gbd, gbs, capbd, capbs, xcsgb, xcdsb, xcsdb; +double gdpr, gspr, gds, gbd, gbs; +double capbd = 0.0, capbs = 0.0, xcsgb, xcdsb, xcsdb; double cggb, cgdb, cgsb, cbgb, cbdb, cbsb, cddb, cdgb, cdsb; -double GSoverlapCap, GDoverlapCap, GBoverlapCap; +double GSoverlapCap, GDoverlapCap, GBoverlapCap = 0.0; double FwdSum, RevSum, Gm, Gmbs; double m; diff --git a/src/spicelib/devices/bsim3soi/b3soiset.c b/src/spicelib/devices/bsim3soi/b3soiset.c index ad9b00fef..a3767b587 100644 --- a/src/spicelib/devices/bsim3soi/b3soiset.c +++ b/src/spicelib/devices/bsim3soi/b3soiset.c @@ -36,13 +36,11 @@ B3SOIinstance *here; int error; CKTnode *tmp; -double tmp1, tmp2; -double nfb0, Cboxt; -int itmp1; +double Cboxt; /* Alan's Nodeset Fix */ -CKTnode *tmpNode; +CKTnode *tmpNode[1]; IFuid tmpName; @@ -1236,10 +1234,10 @@ IFuid tmpName; here->B3SOIdNodePrime = tmp->number; if (ckt->CKTcopyNodesets) { - if (CKTinst2Node(ckt,here,1,&tmpNode,&tmpName)==OK) { - if (tmpNode->nsGiven) { - tmp->nodeset=tmpNode->nodeset; - tmp->nsGiven=tmpNode->nsGiven; + if (CKTinst2Node(ckt,here,1,(void **)tmpNode,&tmpName)==OK) { + if (tmpNode[0]->nsGiven) { + tmp->nodeset=tmpNode[0]->nodeset; + tmp->nsGiven=tmpNode[0]->nsGiven; } } } @@ -1258,10 +1256,10 @@ IFuid tmpName; here->B3SOIsNodePrime = tmp->number; if (ckt->CKTcopyNodesets) { - if (CKTinst2Node(ckt,here,3,&tmpNode,&tmpName)==OK) { - if (tmpNode->nsGiven) { - tmp->nodeset=tmpNode->nodeset; - tmp->nsGiven=tmpNode->nsGiven; + if (CKTinst2Node(ckt,here,3,(void **)tmpNode,&tmpName)==OK) { + if (tmpNode[0]->nsGiven) { + tmp->nodeset=tmpNode[0]->nodeset; + tmp->nsGiven=tmpNode[0]->nsGiven; } } } diff --git a/src/spicelib/devices/bsim3soi/b3soitemp.c b/src/spicelib/devices/bsim3soi/b3soitemp.c index 2554c2e5c..e1035fa07 100644 --- a/src/spicelib/devices/bsim3soi/b3soitemp.c +++ b/src/spicelib/devices/bsim3soi/b3soitemp.c @@ -49,14 +49,14 @@ B3SOItemp(GENmodel *inModel, CKTcircuit *ckt) { B3SOImodel *model = (B3SOImodel*) inModel; B3SOIinstance *here; -struct b3soiSizeDependParam *pSizeDependParamKnot, *pLastKnot, *pParam; -double tmp, tmp1, tmp2, Eg, Eg0, ni, T0, T1, T2, T3, T4, T5, T6, Ldrn, Wdrn; -double Temp, TempRatio, Inv_L, Inv_W, Inv_LW, Dw, Dl, Vtm0, Tnom; +struct b3soiSizeDependParam *pSizeDependParamKnot, *pLastKnot, *pParam = NULL; +double tmp, tmp1, tmp2, Eg, Eg0, ni, T0, T1, T2, T3, T4, T5, Ldrn, Wdrn; +double Temp, TempRatio, Inv_L, Inv_W, Inv_LW, Vtm0, Tnom; double SDphi, SDgamma; int Size_Not_Found; /* v2.0 release */ -double tmp3, T7, T8, T9; +double tmp3, T7; /* loop through all the B3SOI device models */ diff --git a/src/spicelib/devices/bsim3soi_dd/b3soiddacld.c b/src/spicelib/devices/bsim3soi_dd/b3soiddacld.c index b5d272390..b41be023b 100644 --- a/src/spicelib/devices/bsim3soi_dd/b3soiddacld.c +++ b/src/spicelib/devices/bsim3soi_dd/b3soiddacld.c @@ -41,10 +41,9 @@ double gbbg, gbbdp, gbbb, gbbe, gbbp, gbbsp, gbbT; double gddpg, gddpdp, gddpsp, gddpb, gddpe, gddpT; double gsspg, gsspdp, gsspsp, gsspb, gsspe, gsspT; double gppg, gppdp, gppb, gppe, gppp, gppsp, gppT; -double xcTt, cTt, gcTt, gTtt, gTtg, gTtb, gTte, gTtdp, gTtsp; +double xcTt, cTt, gTtt, gTtg, gTtb, gTte, gTtdp, gTtsp; -double Dum1, Dum2, Dum3, Dum4, Dum5; -FILE *fpdebug; +FILE *fpdebug = NULL; double m; diff --git a/src/spicelib/devices/bsim3soi_dd/b3soiddld.c b/src/spicelib/devices/bsim3soi_dd/b3soiddld.c index bfaa6fe42..db1019bdf 100644 --- a/src/spicelib/devices/bsim3soi_dd/b3soiddld.c +++ b/src/spicelib/devices/bsim3soi_dd/b3soiddld.c @@ -55,8 +55,6 @@ double B3SOIDDSmartVbs(double New, double Old, B3SOIDDinstance *here, CKTcircuit *ckt, int *check) { - double T0, T1, del; - /* only do it for floating body and DC */ if (here->B3SOIDDfloat && (ckt->CKTmode & (MODEDC | MODEDCOP))) { @@ -104,13 +102,13 @@ B3SOIDDmodel *model = (B3SOIDDmodel*)inModel; B3SOIDDinstance *here; int selfheat; -double SourceSatCurrent, DrainSatCurrent, Gmin; -double ag0, qgd, qgs, qgb, von, cbhat, VgstNVt, ExpVgst; +double Gmin; +double ag0, qgd, qgs, von, cbhat, VgstNVt, ExpVgst = 0.0; double cdhat, cdreq, ceqbd, ceqbs, ceqqb, ceqqd, ceqqg, ceq, geq; -double evbd, evbs, arg, sarg; +double arg; double delvbd, delvbs, delvds, delvgd, delvgs; -double Vfbeff, dVfbeff_dVg, dVfbeff_dVd, dVfbeff_dVb, V3, V4; -double tol, PhiB, PhiBSW, MJ, MJSW, PhiBSWG, MJSWG; +double Vfbeff, dVfbeff_dVd, dVfbeff_dVb, V3, V4; +double PhiBSWG, MJSWG; double gcgdb, gcggb, gcgsb, gcgeb, gcgT; double gcsdb, gcsgb, gcssb, gcseb, gcsT; double gcddb, gcdgb, gcdsb, gcdeb, gcdT; @@ -121,59 +119,56 @@ double vbd, vbs, vds, vgb, vgd, vgs, vgdo, xfact; double vg, vd, vs, vp, ve, vb; double Vds, Vgs, Vbs, Gmbs, FwdSum, RevSum; double Vgs_eff, Vfb, dVfb_dVb, dVfb_dVd, dVfb_dT; -double Phis, dPhis_dVb, sqrtPhis, dsqrtPhis_dVb, Vth, dVth_dVb, dVth_dVd, dVth_dT; -double Vgst, dVgst_dVg, dVgst_dVb, dVgs_eff_dVg, Nvtm; -double Vgdt, Vgsaddvth, Vgsaddvth2, Vgsaddvth1o3, n, dn_dVb, Vtm; +double Phis, dPhis_dVb, sqrtPhis, dsqrtPhis_dVb, Vth = 0.0; +double dVth_dVb, dVth_dVd, dVth_dT; +double Vgst, dVgs_eff_dVg; +double n, dn_dVb, Vtm; double ExpArg, V0; -double ueff, dueff_dVg, dueff_dVd, dueff_dVb, dueff_dT; -double Esat, dEsat_dVg, dEsat_dVd, dEsat_dVb, Vdsat, Vdsat0; +double ueff = 0.0, dueff_dVg, dueff_dVd, dueff_dVb, dueff_dT; +double Esat, Vdsat = 0.0; double EsatL, dEsatL_dVg, dEsatL_dVd, dEsatL_dVb, dEsatL_dT; -double dVdsat_dVg, dVdsat_dVb, dVdsat_dVd, dVdsat_dT, Vasat, dAlphaz_dVg, dAlphaz_dVb; +double dVdsat_dVg, dVdsat_dVb, dVdsat_dVd, dVdsat_dT, Vasat; double dVasat_dVg, dVasat_dVb, dVasat_dVd, dVasat_dT; -double Va, Va2, dVa_dVd, dVa_dVg, dVa_dVb, dVa_dT; -double Vbseff, dVbseff_dVb, VbseffCV, dVbseffCV_dVb; -double One_Third_CoxWL, Two_Third_CoxWL, Alphaz, CoxWL; -double dVgdt_dVg, dVgdt_dVd, dVgdt_dVb; -double T0, dT0_dVg, dT0_dVd, dT0_dVb, dT0_dVc, dT0_dVe, dT0_dVrg, dT0_dT; +double Va, dVa_dVd, dVa_dVg, dVa_dVb, dVa_dT; +double Vbseff, dVbseff_dVb; +double One_Third_CoxWL, Two_Third_CoxWL, CoxWL; +double T0, dT0_dVg, dT0_dVd, dT0_dVb, dT0_dVc, dT0_dVe, dT0_dT; double T1, dT1_dVg, dT1_dVd, dT1_dVb, dT1_dVc, dT1_dVe, dT1_dT; double T2, dT2_dVg, dT2_dVd, dT2_dVb, dT2_dVc, dT2_dVe, dT2_dT; double T3, dT3_dVg, dT3_dVd, dT3_dVb, dT3_dVc, dT3_dVe, dT3_dT; double T4, dT4_dVg, dT4_dVd, dT4_dVb, dT4_dVc, dT4_dVe, dT4_dT; double T5, dT5_dVg, dT5_dVd, dT5_dVb, dT5_dVc, dT5_dVe, dT5_dT; double T6, dT6_dVg, dT6_dVd, dT6_dVb, dT6_dVc, dT6_dVe, dT6_dT; -double T7, dT7_dVg, dT7_dVd, dT7_dVb; -double T8, dT8_dVg, dT8_dVd, dT8_dVb, dT8_dVc, dT8_dVe, dT8_dVrg; -double T9, dT9_dVg, dT9_dVd, dT9_dVb, dT9_dVc, dT9_dVe, dT9_dVrg; -double T10, dT10_dVg, dT10_dVb, dT10_dVd; +double T7; +double T8; +double T9; +double T10; double T11, T12; -double tmp, Abulk, dAbulk_dVb, Abulk0, dAbulk0_dVb; -double T100, T101; +double Abulk, dAbulk_dVb, Abulk0, dAbulk0_dVb; double VACLM, dVACLM_dVg, dVACLM_dVd, dVACLM_dVb, dVACLM_dT; double VADIBL, dVADIBL_dVg, dVADIBL_dVd, dVADIBL_dVb, dVADIBL_dT; -double VAHCE, dVAHCE_dVg, dVAHCE_dVd, dVAHCE_dVb; double Xdep, dXdep_dVb, lt1, dlt1_dVb, ltw, dltw_dVb; double Delt_vth, dDelt_vth_dVb, dDelt_vth_dT; -double Theta0, dTheta0_dVb, Theta1, dTheta1_dVb; -double Thetarout, dThetarout_dVb, TempRatio, tmp1, tmp2, tmp3, tmp4; -double DIBL_Sft, dDIBL_Sft_dVd, DIBL_fact, Lambda, dLambda_dVg; -double Rout_Vgs_factor, dRout_Vgs_factor_dVg, dRout_Vgs_factor_dVb; -double dRout_Vgs_factor_dVd; -double tempv, a1; +double Theta0, dTheta0_dVb; +double TempRatio, tmp1, tmp2, tmp3, tmp4; +double DIBL_Sft, dDIBL_Sft_dVd, Lambda, dLambda_dVg; +double a1; -double Vgsteff, dVgsteff_dVg, dVgsteff_dVd, dVgsteff_dVb, dVgsteff_dVe, dVgsteff_dT; -double Vdseff, dVdseff_dVg, dVdseff_dVd, dVdseff_dVb, dVdseff_dT; +double Vgsteff = 0.0, dVgsteff_dVg, dVgsteff_dVd, dVgsteff_dVb; +double dVgsteff_dVe, dVgsteff_dT; +double Vdseff = 0.0, dVdseff_dVg, dVdseff_dVd, dVdseff_dVb, dVdseff_dT; double VdseffCV, dVdseffCV_dVg, dVdseffCV_dVd, dVdseffCV_dVb; -double diffVds, diffVdsCV; +double diffVds; double dAbulk_dVg, dn_dVd ; double beta, dbeta_dVg, dbeta_dVd, dbeta_dVb, dbeta_dT; double gche, dgche_dVg, dgche_dVd, dgche_dVb, dgche_dT; double fgche1, dfgche1_dVg, dfgche1_dVd, dfgche1_dVb, dfgche1_dT; double fgche2, dfgche2_dVg, dfgche2_dVd, dfgche2_dVb, dfgche2_dT; double Idl, dIdl_dVg, dIdl_dVd, dIdl_dVb, dIdl_dT; -double Ids, Gm, Gds, Gmb; +double Ids = 0.0, Gm, Gds = 0.0, Gmb; double CoxWovL; double Rds, dRds_dVg, dRds_dVb, dRds_dT, WVCox, WVCoxRds; -double Vgst2Vtm, dVgst2Vtm_dT, VdsatCV, dVdsatCV_dVd, dVdsatCV_dVg, dVdsatCV_dVb; +double Vgst2Vtm, dVgst2Vtm_dT, VdsatCV, dVdsatCV_dVg, dVdsatCV_dVb; double Leff, Weff, dWeff_dVg, dWeff_dVb; double AbulkCV, dAbulkCV_dVb; double qgdo, qgso, cgdo, cgso; @@ -181,14 +176,13 @@ double qgdo, qgso, cgdo, cgso; double dxpart, sxpart; struct b3soiddSizeDependParam *pParam; -int ByPass, Check, ChargeComputationNeeded, J, error, I; -double junk[50]; +int ByPass, Check, ChargeComputationNeeded = 0, error; double gbbsp, gbbdp, gbbg, gbbb, gbbe, gbbp, gbbT; double gddpsp, gddpdp, gddpg, gddpb, gddpe, gddpT; double gsspsp, gsspdp, gsspg, gsspb, gsspe, gsspT; double Gbpbs, Gbpgs, Gbpds, Gbpes, Gbpps, GbpT; -double vse, vde, ves, ved, veb, vge, delves, vedo, delved; +double ves, ved, veb, vge = 0.0, delves, vedo, delved; double vps, vpd, Vps, delvps; double Vbd, Ves, Vesfb, sqrtXdep, DeltVthtemp, dDeltVthtemp_dT; double Vbp, dVbp_dVp, dVbp_dVb, dVbp_dVg, dVbp_dVd, dVbp_dVe, dVbp_dT; @@ -200,92 +194,101 @@ double dfgche1_dVc, dfgche2_dVc, dgche_dVc, dVdseff_dVc, dIdl_dVc; double Gm0, Gds0, Gmb0, GmT0, Gmc, Gme, GmT, dVbseff_dVg; double dDIBL_Sft_dVb, BjtA, dBjtA_dVd; double diffVdsii ; -double Idgidl, Gdgidld, Gdgidlg, Isgidl, Gsgidlg; -double Gjsd, Gjss, Gjsb, GjsT, Gjdd, Gjdb, GjdT; -double Ibp, Iii, Giid, Giig, Giib, Giie, GiiT, Gcd, Gcb, GcT, ceqbody, ceqbodcon; -double gppg, gppdp, gppb, gppe, gppp, gppsp, gppT; +double Idgidl = 0.0, Gdgidld, Gdgidlg, Isgidl = 0.0, Gsgidlg; +double Gjsd, Gjsb, GjsT, Gjdd, Gjdb, GjdT; +double Ibp = 0.0, Iii = 0.0, Giid, Giig, Giib, Giie, GiiT, Gcd, Gcb, GcT; +double ceqbody, ceqbodcon = 0.0; +double gppg = 0.0, gppdp = 0.0, gppb = 0.0, gppe = 0.0, gppp = 0.0; +double gppsp = 0.0, gppT; double delTemp, deldelTemp, Temp; double ceqth, ceqqth; -double K1, WL; -double qjs, gcjsbs, gcjsT; -double qjd, gcjdbs, gcjdds, gcjdT; +double K1; +double qjs = 0.0, gcjsbs, gcjsT; +double qjd = 0.0, gcjdbs, gcjdds, gcjdT; double qge; double ceqqe; double ni, Eg, Cbox, Nfb, CboxWL; double cjsbs; -double Qbf0, Qsicv, dVfbeff_dVrg, Cbe ; -double qinv, qgate, qbody, qdrn, qsrc, qsub, cqgate, cqbody, cqdrn, cqsub, cqtemp; -double Cgg, Cgd, Cgs, Cgb, Cge, Cdg, Cdd, Cds, Cdb, Qg, Qd; -double Csg, Csd, Css, Csb, Cse, Cbg, Cbd, Cbs, Cbb, Qs, Qb; -double Cgg1, Cgb1, Cgd1, Cbg1, Cbb1, Cbd1, Csg1, Csd1, Csb1; -double Vbs0t, dVbs0t_dT ; -double Vbs0 ,dVbs0_dVe, dVbs0_dT; -double Vbs0eff ,dVbs0eff_dVg ,dVbs0eff_dVd ,dVbs0eff_dVe, dVbs0eff_dT; -double Vbs0teff,dVbs0teff_dVg ,dVbs0teff_dVd, dVbs0teff_dVe, dVbs0teff_dT; -double Vbsdio, dVbsdio_dVg, dVbsdio_dVd, dVbsdio_dVe, dVbsdio_dVb, dVbsdio_dT; -double Vbseff0; -double Vthfd ,dVthfd_dVd ,dVthfd_dVe, dVthfd_dT; -double Vbs0mos ,dVbs0mos_dVe, dVbs0mos_dT; +double Qbf0, Qsicv, dVfbeff_dVrg, Cbe = 0.0; +double qinv = 0.0, qgate = 0.0, qbody = 0.0, qdrn = 0.0, qsrc, qsub = 0.0; +double cqgate, cqbody = 0.0, cqdrn = 0.0, cqsub, cqtemp; +double Cgg, Cgd, Cgb, Cge; +double Csg, Csd, Csb, Cse, Cbg = 0.0, Cbd = 0.0, Cbb = 0.0; +double Cgg1, Cgb1, Cgd1, Csg1, Csd1, Csb1; +double Vbs0t = 0.0, dVbs0t_dT ; +double Vbs0 = 0.0 ,dVbs0_dVe, dVbs0_dT; +double Vbs0eff = 0.0 ,dVbs0eff_dVg ,dVbs0eff_dVd ,dVbs0eff_dVe, dVbs0eff_dT; +double Vbs0teff = 0.0,dVbs0teff_dVg ,dVbs0teff_dVd, dVbs0teff_dVe; +double dVbs0teff_dT; +double Vbsdio = 0.0, dVbsdio_dVg, dVbsdio_dVd, dVbsdio_dVe, dVbsdio_dVb; +double dVbsdio_dT; +double Vthfd = 0.0 ,dVthfd_dVd ,dVthfd_dVe, dVthfd_dT; +double Vbs0mos = 0.0 ,dVbs0mos_dVe, dVbs0mos_dT; double Vbsmos ,dVbsmos_dVg ,dVbsmos_dVb ,dVbsmos_dVd, dVbsmos_dVe, dVbsmos_dT; double Abeff ,dAbeff_dVg ,dAbeff_dVb, dAbeff_dVc; double Vcs ,dVcs_dVg ,dVcs_dVb ,dVcs_dVd ,dVcs_dVe, dVcs_dT; -double Xcsat ,dXcsat_dVg ,dXcsat_dVb, dXcsat_dVc; +double Xcsat = 0.0, dXcsat_dVg, dXcsat_dVc; double Vdsatii ,dVdsatii_dVg ,dVdsatii_dVd, dVdsatii_dVb, dVdsatii_dT; double Vdseffii ,dVdseffii_dVg ,dVdseffii_dVd, dVdseffii_dVb, dVdseffii_dT; -double VcsCV ,dVcsCV_dVg ,dVcsCV_dVb ,dVcsCV_dVd ,dVcsCV_dVc ,dVcsCV_dVe; -double VdsCV ,dVdsCV_dVg ,dVdsCV_dVb ,dVdsCV_dVd ,dVdsCV_dVc; +double VcsCV = 0.0 ,dVcsCV_dVg = 0.0 ,dVcsCV_dVb = 0.0; +double dVcsCV_dVd = 0.0 ,dVcsCV_dVc = 0.0; +double VdsCV = 0.0 ,dVdsCV_dVg = 0.0 ,dVdsCV_dVb = 0.0; +double dVdsCV_dVd = 0.0 ,dVdsCV_dVc = 0.0; double Phisc ,dPhisc_dVg ,dPhisc_dVb ,dPhisc_dVd, dPhisc_dVc; double Phisd ,dPhisd_dVg ,dPhisd_dVb ,dPhisd_dVd, dPhisd_dVc; -double sqrtPhisc ,dsqrtPhisc_dVg ,dsqrtPhisc_dVb; -double sqrtPhisd ,dsqrtPhisd_dVg ,dsqrtPhisd_dVb; -double Xc ,dXc_dVg ,dXc_dVb ,dXc_dVd ,dXc_dVc; -double Ibjt ,dIbjt_dVb ,dIbjt_dVd ,dIbjt_dT; -double Ibs1 ,dIbs1_dVb ,dIbs1_dT; -double Ibs2 ,dIbs2_dVb ,dIbs2_dT; -double Ibs3 ,dIbs3_dVb ,dIbs3_dVd, dIbs3_dT; -double Ibs4 ,dIbs4_dVb ,dIbs4_dT; -double Ibd1 ,dIbd1_dVb ,dIbd1_dVd ,dIbd1_dT; -double Ibd2 ,dIbd2_dVb ,dIbd2_dVd ,dIbd2_dT; -double Ibd3 ,dIbd3_dVb ,dIbd3_dVd ,dIbd3_dT; -double Ibd4 ,dIbd4_dVb ,dIbd4_dVd ,dIbd4_dT; -double ExpVbs1, dExpVbs1_dVb, dExpVbs1_dT; -double ExpVbs2, dExpVbs2_dVb, dExpVbs2_dT; -double ExpVbs4, dExpVbs4_dVb, dExpVbs4_dT; -double ExpVbd1, dExpVbd1_dVb, dExpVbd1_dT; -double ExpVbd2, dExpVbd2_dVb, dExpVbd2_dT; -double ExpVbd4, dExpVbd4_dVb, dExpVbd4_dT; +double sqrtPhisc; +double sqrtPhisd; +double Xc = 0.0 ,dXc_dVg = 0.0 ,dXc_dVb = 0.0 ,dXc_dVd = 0.0 ,dXc_dVc = 0.0; +double Ibjt = 0.0 ,dIbjt_dVb ,dIbjt_dVd ,dIbjt_dT = 0.0; +double Ibs1 ,dIbs1_dVb ,dIbs1_dT = 0.0; +double Ibs2 ,dIbs2_dVb ,dIbs2_dT = 0.0; +double Ibs3 ,dIbs3_dVb ,dIbs3_dVd, dIbs3_dT = 0.0; +double Ibs4 ,dIbs4_dVb ,dIbs4_dT = 0.0; +double Ibd1 ,dIbd1_dVb ,dIbd1_dVd ,dIbd1_dT = 0.0; +double Ibd2 ,dIbd2_dVb ,dIbd2_dVd ,dIbd2_dT = 0.0; +double Ibd3 ,dIbd3_dVb ,dIbd3_dVd ,dIbd3_dT = 0.0; +double Ibd4 ,dIbd4_dVb ,dIbd4_dVd ,dIbd4_dT = 0.0; +double ExpVbs1, dExpVbs1_dVb, dExpVbs1_dT = 0.0; +double ExpVbs2, dExpVbs2_dVb, dExpVbs2_dT = 0.0; +double ExpVbs4 = 0.0, dExpVbs4_dVb = 0.0, dExpVbs4_dT = 0.0; +double ExpVbd1, dExpVbd1_dVb, dExpVbd1_dT = 0.0; +double ExpVbd2, dExpVbd2_dVb, dExpVbd2_dT = 0.0; +double ExpVbd4 = 0.0, dExpVbd4_dVb = 0.0, dExpVbd4_dT = 0.0; double WTsi, NVtm1, NVtm2; -double Ic ,dIc_dVb ,dIc_dVd; -double Ibs ,dIbs_dVb ,dIbs_dVd ,dIbs_dVe; -double Ibd ,dIbd_dVb; +double Ic = 0.0; +double Ibs = 0.0; +double Ibd = 0.0; double Nomi ,dNomi_dVg ,dNomi_dVb ,dNomi_dVd ,dNomi_dVc; double Denomi ,dDenomi_dVg ,dDenomi_dVd ,dDenomi_dVb ,dDenomi_dVc, dDenomi_dT; -double Qbf ,dQbf_dVg ,dQbf_dVb ,dQbf_dVd ,dQbf_dVc ,dQbf_dVe; -double Qsubs1 ,dQsubs1_dVg ,dQsubs1_dVb ,dQsubs1_dVd ,dQsubs1_dVc ,dQsubs1_dVe; -double Qsubs2 ,dQsubs2_dVg ,dQsubs2_dVb ,dQsubs2_dVd ,dQsubs2_dVc ,dQsubs2_dVe; -double Qsub0 ,dQsub0_dVg ,dQsub0_dVb ,dQsub0_dVd ; -double Qac0 ,dQac0_dVb ,dQac0_dVd; +double Qbf = 0.0 ,dQbf_dVg = 0.0 ,dQbf_dVb = 0.0 ,dQbf_dVd = 0.0; +double dQbf_dVc = 0.0 ,dQbf_dVe = 0.0; +double Qsubs1 = 0.0 ,dQsubs1_dVg ,dQsubs1_dVb ,dQsubs1_dVd ,dQsubs1_dVc; +double Qsubs2 = 0.0 ,dQsubs2_dVg ,dQsubs2_dVb ,dQsubs2_dVd ,dQsubs2_dVc ,dQsubs2_dVe; +double Qsub0 = 0.0 ,dQsub0_dVg ,dQsub0_dVb ,dQsub0_dVd ; +double Qac0 = 0.0 ,dQac0_dVb ,dQac0_dVd; double Qdep0 ,dQdep0_dVb; -double Qe1 , dQe1_dVg ,dQe1_dVb, dQe1_dVd, dQe1_dVe, dQe1_dT; +double Qe1 = 0.0 , dQe1_dVg ,dQe1_dVb, dQe1_dVd, dQe1_dVe, dQe1_dT; double Ce1g ,Ce1b ,Ce1d ,Ce1e, Ce1T; double Ce2g ,Ce2b ,Ce2d ,Ce2e, Ce2T; -double Qe2 , dQe2_dVg ,dQe2_dVb, dQe2_dVd, dQe2_dVe, dQe2_dT; -double dQbf_dVrg, dQac0_dVrg, dQsub0_dVrg; -double dQsubs1_dVrg, dQsubs2_dVrg, dQbf0_dVe, dQbf0_dT; +double Qe2 = 0.0 , dQe2_dVg ,dQe2_dVb, dQe2_dVd, dQe2_dVe, dQe2_dT; +double dQbf_dVrg = 0.0, dQac0_dVrg, dQsub0_dVrg; +double dQsubs2_dVrg, dQbf0_dVe, dQbf0_dT; /* for self-heating */ double vbi, vfbb, phi, sqrtPhi, Xdep0, jbjt, jdif, jrec, jtun, u0temp, vsattemp; double rds0, ua, ub, uc; double dvbi_dT, dvfbb_dT, djbjt_dT, djdif_dT, djrec_dT, djtun_dT, du0temp_dT; double dvsattemp_dT, drds0_dT, dua_dT, dub_dT, duc_dT, dni_dT, dVtm_dT; -double dVfbeff_dT, dQac0_dT, dQsub0_dT, dQbf_dT, dVdsCV_dT, dPhisd_dT; -double dNomi_dT,dXc_dT,dQsubs1_dT,dQsubs2_dT, dVcsCV_dT, dPhisc_dT, dQsicv_dT; -double CbT, CsT, CgT, CeT; +double dVfbeff_dT, dQac0_dT, dQsub0_dT; +double dQbf_dT = 0.0, dVdsCV_dT = 0.0, dPhisd_dT; +double dNomi_dT, dXc_dT = 0.0, dQsubs1_dT, dQsubs2_dT; +double dVcsCV_dT = 0.0, dPhisc_dT, dQsicv_dT; +double CbT, CsT, CgT; double Qex, dQex_dVg, dQex_dVb, dQex_dVd, dQex_dVe, dQex_dT; /* clean up last */ -FILE *fpdebug; +FILE *fpdebug = NULL; /* end clean up */ int nandetect; static int nanfound = 0; @@ -294,7 +297,7 @@ char nanmessage [12]; double m; -for (; model != NULL; model = model->B3SOIDDnextModel) + for (; model != NULL; model = model->B3SOIDDnextModel) { for (here = model->B3SOIDDinstances; here != NULL; here = here->B3SOIDDnextInstance) { @@ -4210,44 +4213,44 @@ if (here->B3SOIDDdebugMod > 2) /* Here NaN will be detected in any conductance or equivalent current. Note that nandetect is initialized within the "if" statements */ - if (nandetect = isnan (*(here->B3SOIDDGbPtr))) + if ((nandetect = isnan (*(here->B3SOIDDGbPtr)))) { strcpy (nanmessage, "GbPtr"); } - else if (nandetect = isnan (*(here->B3SOIDDEbPtr))) + else if ((nandetect = isnan (*(here->B3SOIDDEbPtr)))) { strcpy (nanmessage, "EbPtr"); } - else if (nandetect = isnan (*(here->B3SOIDDDPbPtr))) + else if ((nandetect = isnan (*(here->B3SOIDDDPbPtr)))) { strcpy (nanmessage, "DPbPtr"); } - else if (nandetect = isnan (*(here->B3SOIDDSPbPtr))) + else if ((nandetect = isnan (*(here->B3SOIDDSPbPtr)))) { strcpy (nanmessage, "SPbPtr"); } - else if (nandetect = isnan (*(here->B3SOIDDBbPtr))) + else if ((nandetect = isnan (*(here->B3SOIDDBbPtr)))) { strcpy (nanmessage, "BbPtr"); } - else if (nandetect = isnan (*(here->B3SOIDDBgPtr))) + else if ((nandetect = isnan (*(here->B3SOIDDBgPtr)))) { strcpy (nanmessage, "BgPtr"); } - else if (nandetect = isnan (*(here->B3SOIDDBePtr))) + else if ((nandetect = isnan (*(here->B3SOIDDBePtr)))) { strcpy (nanmessage, "BePtr"); } - else if (nandetect = isnan (*(here->B3SOIDDBdpPtr))) + else if ((nandetect = isnan (*(here->B3SOIDDBdpPtr)))) { strcpy (nanmessage, "BdpPtr"); } - else if (nandetect = isnan (*(here->B3SOIDDBspPtr))) + else if ((nandetect = isnan (*(here->B3SOIDDBspPtr)))) { strcpy (nanmessage, "BspPtr"); } - if (nandetect = isnan (*(here->B3SOIDDGgPtr))) + if ((nandetect = isnan (*(here->B3SOIDDGgPtr)))) { strcpy (nanmessage, "GgPtr"); } - else if (nandetect = isnan (*(here->B3SOIDDGdpPtr))) + else if ((nandetect = isnan (*(here->B3SOIDDGdpPtr)))) { strcpy (nanmessage, "GdpPtr"); } - else if (nandetect = isnan (*(here->B3SOIDDGspPtr))) + else if ((nandetect = isnan (*(here->B3SOIDDGspPtr)))) { strcpy (nanmessage, "GspPtr"); } - else if (nandetect = isnan (*(here->B3SOIDDDPgPtr))) + else if ((nandetect = isnan (*(here->B3SOIDDDPgPtr)))) { strcpy (nanmessage, "DPgPtr"); } - else if (nandetect = isnan (*(here->B3SOIDDDPdpPtr))) + else if ((nandetect = isnan (*(here->B3SOIDDDPdpPtr)))) { strcpy (nanmessage, "DPdpPtr"); } - else if (nandetect = isnan (*(here->B3SOIDDDPspPtr))) + else if ((nandetect = isnan (*(here->B3SOIDDDPspPtr)))) { strcpy (nanmessage, "DPspPtr"); } - else if (nandetect = isnan (*(here->B3SOIDDSPgPtr))) + else if ((nandetect = isnan (*(here->B3SOIDDSPgPtr)))) { strcpy (nanmessage, "SPgPtr"); } - else if (nandetect = isnan (*(here->B3SOIDDSPdpPtr))) + else if ((nandetect = isnan (*(here->B3SOIDDSPdpPtr)))) { strcpy (nanmessage, "SPdpPtr"); } - else if (nandetect = isnan (*(here->B3SOIDDSPspPtr))) + else if ((nandetect = isnan (*(here->B3SOIDDSPspPtr)))) { strcpy (nanmessage, "SPspPtr"); } - else if (nandetect = isnan (*(here->B3SOIDDEePtr))) + else if ((nandetect = isnan (*(here->B3SOIDDEePtr)))) { strcpy (nanmessage, "EePtr"); } /* At this point, nandetect = 0 if none of the @@ -4255,17 +4258,17 @@ if (here->B3SOIDDdebugMod > 2) if (nandetect == 0) { - if (nandetect = isnan (*(here->B3SOIDDEgPtr))) + if ((nandetect = isnan (*(here->B3SOIDDEgPtr)))) { strcpy (nanmessage, "EgPtr"); } - else if (nandetect = isnan (*(here->B3SOIDDEdpPtr))) + else if ((nandetect = isnan (*(here->B3SOIDDEdpPtr)))) { strcpy (nanmessage, "EdpPtr"); } - else if (nandetect = isnan (*(here->B3SOIDDEspPtr))) + else if ((nandetect = isnan (*(here->B3SOIDDEspPtr)))) { strcpy (nanmessage, "EspPtr"); } - else if (nandetect = isnan (*(here->B3SOIDDGePtr))) + else if ((nandetect = isnan (*(here->B3SOIDDGePtr)))) { strcpy (nanmessage, "GePtr"); } - else if (nandetect = isnan (*(here->B3SOIDDDPePtr))) + else if ((nandetect = isnan (*(here->B3SOIDDDPePtr)))) { strcpy (nanmessage, "DPePtr"); } - else if (nandetect = isnan (*(here->B3SOIDDSPePtr))) + else if ((nandetect = isnan (*(here->B3SOIDDSPePtr)))) { strcpy (nanmessage, "SPePtr"); } } /* Now check if self-heating caused NaN if nothing else @@ -4273,29 +4276,29 @@ if (here->B3SOIDDdebugMod > 2) if (selfheat && nandetect == 0) { - if (nandetect = isnan (*(here->B3SOIDDTemptempPtr))) + if ((nandetect = isnan (*(here->B3SOIDDTemptempPtr)))) { strcpy (nanmessage, "TemptempPtr"); } - else if (nandetect = isnan (*(here->B3SOIDDTempgPtr))) + else if ((nandetect = isnan (*(here->B3SOIDDTempgPtr)))) { strcpy (nanmessage, "TempgPtr"); } - else if (nandetect = isnan (*(here->B3SOIDDTempbPtr))) + else if ((nandetect = isnan (*(here->B3SOIDDTempbPtr)))) { strcpy (nanmessage, "TempbPtr"); } - else if (nandetect = isnan (*(here->B3SOIDDTempePtr))) + else if ((nandetect = isnan (*(here->B3SOIDDTempePtr)))) { strcpy (nanmessage, "TempePtr"); } - else if (nandetect = isnan (*(here->B3SOIDDTempdpPtr))) + else if ((nandetect = isnan (*(here->B3SOIDDTempdpPtr)))) { strcpy (nanmessage, "TempdpPtr"); } - else if (nandetect = isnan (*(here->B3SOIDDTempspPtr))) + else if ((nandetect = isnan (*(here->B3SOIDDTempspPtr)))) { strcpy (nanmessage, "TempspPtr"); } - else if (nandetect = isnan (*(here->B3SOIDDGtempPtr))) + else if ((nandetect = isnan (*(here->B3SOIDDGtempPtr)))) { strcpy (nanmessage, "GtempPtr"); } - else if (nandetect = isnan (*(here->B3SOIDDDPtempPtr))) + else if ((nandetect = isnan (*(here->B3SOIDDDPtempPtr)))) { strcpy (nanmessage, "DPtempPtr"); } - else if (nandetect = isnan (*(here->B3SOIDDSPtempPtr))) + else if ((nandetect = isnan (*(here->B3SOIDDSPtempPtr)))) { strcpy (nanmessage, "SPtempPtr"); } - else if (nandetect = isnan (*(here->B3SOIDDEtempPtr))) + else if ((nandetect = isnan (*(here->B3SOIDDEtempPtr)))) { strcpy (nanmessage, "EtempPtr"); } - else if (nandetect = isnan (*(here->B3SOIDDBtempPtr))) + else if ((nandetect = isnan (*(here->B3SOIDDBtempPtr)))) { strcpy (nanmessage, "BtempPtr"); } - else if (nandetect = isnan (*(ckt->CKTrhs + here->B3SOIDDtempNode))) + else if ((nandetect = isnan (*(ckt->CKTrhs + here->B3SOIDDtempNode)))) { strcpy (nanmessage, "tempNode"); } } @@ -4304,20 +4307,20 @@ if (here->B3SOIDDdebugMod > 2) if (nandetect == 0) { - if (nandetect = isnan (*(ckt->CKTrhs - + here->B3SOIDDgNode))) + if ((nandetect = isnan (*(ckt->CKTrhs + + here->B3SOIDDgNode)))) { strcpy (nanmessage, "gNode"); } - else if (nandetect = isnan (*(ckt->CKTrhs - + here->B3SOIDDbNode))) + else if ((nandetect = isnan (*(ckt->CKTrhs + + here->B3SOIDDbNode)))) { strcpy (nanmessage, "bNode"); } - else if (nandetect = isnan (*(ckt->CKTrhs - + here->B3SOIDDdNodePrime))) + else if ((nandetect = isnan (*(ckt->CKTrhs + + here->B3SOIDDdNodePrime)))) { strcpy (nanmessage, "dpNode"); } - else if (nandetect = isnan (*(ckt->CKTrhs - + here->B3SOIDDsNodePrime))) + else if ((nandetect = isnan (*(ckt->CKTrhs + + here->B3SOIDDsNodePrime)))) { strcpy (nanmessage, "spNode"); } - else if (nandetect = isnan (*(ckt->CKTrhs - + here->B3SOIDDeNode))) + else if ((nandetect = isnan (*(ckt->CKTrhs + + here->B3SOIDDeNode)))) { strcpy (nanmessage, "eNode"); } } diff --git a/src/spicelib/devices/bsim3soi_dd/b3soiddnoi.c b/src/spicelib/devices/bsim3soi_dd/b3soiddnoi.c index 5d4924d7b..d1905981c 100644 --- a/src/spicelib/devices/bsim3soi_dd/b3soiddnoi.c +++ b/src/spicelib/devices/bsim3soi_dd/b3soiddnoi.c @@ -55,8 +55,7 @@ B3SOIDDStrongInversionNoiseEval(double vgs, double vds, B3SOIDDmodel *model, { struct b3soiddSizeDependParam *pParam; double cd, esat, DelClm, EffFreq, N0, Nl, Vgst; -double T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, Ssi; -double req, ceq; +double T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, Ssi; pParam = here->pParam; cd = fabs(here->B3SOIDDcd) * here->B3SOIDDm; @@ -111,11 +110,10 @@ double noizDens[B3SOIDDNSRCS]; double lnNdens[B3SOIDDNSRCS]; double vgs, vds, Slimit; -double N0, Nl; -double T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13; -double n, ExpArg, Ssi, Swi; +double T1, T10, T11; +double Ssi, Swi; -int error, i; +int i; /* define the names of the noise sources */ static char *B3SOIDDnNames[B3SOIDDNSRCS] = diff --git a/src/spicelib/devices/bsim3soi_dd/b3soiddpzld.c b/src/spicelib/devices/bsim3soi_dd/b3soiddpzld.c index 49cfd40d3..bc9e26b1a 100644 --- a/src/spicelib/devices/bsim3soi_dd/b3soiddpzld.c +++ b/src/spicelib/devices/bsim3soi_dd/b3soiddpzld.c @@ -24,9 +24,10 @@ B3SOIDDpzLoad(GENmodel *inModel, CKTcircuit *ckt, SPcomplex *s) B3SOIDDmodel *model = (B3SOIDDmodel*)inModel; B3SOIDDinstance *here; double xcggb, xcgdb, xcgsb, xcbgb, xcbdb, xcbsb, xcddb, xcssb, xcdgb; -double gdpr, gspr, gds, gbd, gbs, capbd, capbs, xcsgb, xcdsb, xcsdb; +double gdpr, gspr, gds, gbd, gbs, capbd = 0.0, capbs = 0.0; +double xcsgb, xcdsb, xcsdb; double cggb, cgdb, cgsb, cbgb, cbdb, cbsb, cddb, cdgb, cdsb; -double GSoverlapCap, GDoverlapCap, GBoverlapCap; +double GSoverlapCap, GDoverlapCap, GBoverlapCap = 0.0; double FwdSum, RevSum, Gm, Gmbs; double m; diff --git a/src/spicelib/devices/bsim3soi_dd/b3soiddset.c b/src/spicelib/devices/bsim3soi_dd/b3soiddset.c index 727f603f5..fcfeb1c0b 100644 --- a/src/spicelib/devices/bsim3soi_dd/b3soiddset.c +++ b/src/spicelib/devices/bsim3soi_dd/b3soiddset.c @@ -41,9 +41,8 @@ CKTnode *tmp; double tmp1, tmp2; double nfb0, Cboxt; -int itmp1; -CKTnode *tmpNode; +CKTnode *tmpNode[1]; IFuid tmpName; @@ -938,10 +937,10 @@ IFuid tmpName; if(error) return(error); here->B3SOIDDdNodePrime = tmp->number; if (ckt->CKTcopyNodesets) { - if (CKTinst2Node(ckt,here,1,&tmpNode,&tmpName)==OK) { - if (tmpNode->nsGiven) { - tmp->nodeset=tmpNode->nodeset; - tmp->nsGiven=tmpNode->nsGiven; + if (CKTinst2Node(ckt,here,1,(void**)tmpNode,&tmpName)==OK) { + if (tmpNode[0]->nsGiven) { + tmp->nodeset=tmpNode[0]->nodeset; + tmp->nsGiven=tmpNode[0]->nsGiven; } } } @@ -960,10 +959,10 @@ IFuid tmpName; here->B3SOIDDsNodePrime = tmp->number; if (ckt->CKTcopyNodesets) { - if (CKTinst2Node(ckt,here,3,&tmpNode,&tmpName)==OK) { - if (tmpNode->nsGiven) { - tmp->nodeset=tmpNode->nodeset; - tmp->nsGiven=tmpNode->nsGiven; + if (CKTinst2Node(ckt,here,3,(void**)tmpNode,&tmpName)==OK) { + if (tmpNode[0]->nsGiven) { + tmp->nodeset=tmpNode[0]->nodeset; + tmp->nsGiven=tmpNode[0]->nsGiven; } } } diff --git a/src/spicelib/devices/bsim3soi_dd/b3soiddtemp.c b/src/spicelib/devices/bsim3soi_dd/b3soiddtemp.c index 17c465a64..d76531645 100644 --- a/src/spicelib/devices/bsim3soi_dd/b3soiddtemp.c +++ b/src/spicelib/devices/bsim3soi_dd/b3soiddtemp.c @@ -39,9 +39,9 @@ B3SOIDDtemp(GENmodel *inModel, CKTcircuit *ckt) { B3SOIDDmodel *model = (B3SOIDDmodel*) inModel; B3SOIDDinstance *here; -struct b3soiddSizeDependParam *pSizeDependParamKnot, *pLastKnot, *pParam; +struct b3soiddSizeDependParam *pSizeDependParamKnot, *pLastKnot, *pParam=NULL; double tmp, tmp1, tmp2, Eg, Eg0, ni, T0, T1, T2, T3, T4, T5, T6, Ldrn, Wdrn; -double Temp, TRatio, Inv_L, Inv_W, Inv_LW, Dw, Dl, Vtm0, Tnom; +double Temp, TRatio, Inv_L, Inv_W, Inv_LW, Vtm0, Tnom; double SDphi, SDgamma; int Size_Not_Found; diff --git a/src/spicelib/devices/bsim3soi_fd/b3soifdacld.c b/src/spicelib/devices/bsim3soi_fd/b3soifdacld.c index 173064860..7301328e1 100644 --- a/src/spicelib/devices/bsim3soi_fd/b3soifdacld.c +++ b/src/spicelib/devices/bsim3soi_fd/b3soifdacld.c @@ -42,10 +42,9 @@ double gbbg, gbbdp, gbbb, gbbe, gbbp, gbbsp, gbbT; double gddpg, gddpdp, gddpsp, gddpb, gddpe, gddpT; double gsspg, gsspdp, gsspsp, gsspb, gsspe, gsspT; double gppg, gppdp, gppb, gppe, gppp, gppsp, gppT; -double xcTt, cTt, gcTt, gTtt, gTtg, gTtb, gTte, gTtdp, gTtsp; +double xcTt, cTt, gTtt, gTtg, gTtb, gTte, gTtdp, gTtsp; -double Dum1, Dum2, Dum3, Dum4, Dum5; -FILE *fpdebug; +FILE *fpdebug = NULL; double m; diff --git a/src/spicelib/devices/bsim3soi_fd/b3soifdld.c b/src/spicelib/devices/bsim3soi_fd/b3soifdld.c index 1cf68791a..cc5bbe883 100644 --- a/src/spicelib/devices/bsim3soi_fd/b3soifdld.c +++ b/src/spicelib/devices/bsim3soi_fd/b3soifdld.c @@ -55,8 +55,6 @@ double B3SOIFDSmartVbs(double New, double Old, B3SOIFDinstance *here, CKTcircuit *ckt, int *check) { - double T0, T1, del; - /* only do it for floating body and DC */ if (here->B3SOIFDfloat && (ckt->CKTmode & (MODEDC | MODEDCOP))) { @@ -104,13 +102,10 @@ B3SOIFDmodel *model = (B3SOIFDmodel*)inModel; B3SOIFDinstance *here; int selfheat; -double SourceSatCurrent, DrainSatCurrent, Gmin; -double ag0, qgd, qgs, qgb, von, cbhat, VgstNVt, ExpVgst; +double ag0, qgd, qgs, von, cbhat, VgstNVt, ExpVgst = 0.0; double cdhat, cdreq, ceqbd, ceqbs, ceqqb, ceqqd, ceqqg, ceq, geq; -double evbd, evbs, arg, sarg; double delvbd, delvbs, delvds, delvgd, delvgs; -double Vfbeff, dVfbeff_dVg, dVfbeff_dVd, dVfbeff_dVb, V3, V4; -double tol, PhiB, PhiBSW, MJ, MJSW, PhiBSWG, MJSWG; +double Vfbeff, dVfbeff_dVd, dVfbeff_dVb, V3, V4; double gcgdb, gcggb, gcgsb, gcgeb, gcgT; double gcsdb, gcsgb, gcssb, gcseb, gcsT; double gcddb, gcdgb, gcdsb, gcdeb, gcdT; @@ -121,59 +116,56 @@ double vbd, vbs, vds, vgb, vgd, vgs, vgdo, xfact; double vg, vd, vs, vp, ve, vb; double Vds, Vgs, Vbs, Gmbs, FwdSum, RevSum; double Vgs_eff, Vfb, dVfb_dVb, dVfb_dVd, dVfb_dT; -double Phis, dPhis_dVb, sqrtPhis, dsqrtPhis_dVb, Vth, dVth_dVb, dVth_dVd, dVth_dT; -double Vgst, dVgst_dVg, dVgst_dVb, dVgs_eff_dVg, Nvtm; -double Vgdt, Vgsaddvth, Vgsaddvth2, Vgsaddvth1o3, n, dn_dVb, Vtm; +double Phis, dPhis_dVb, sqrtPhis, dsqrtPhis_dVb, Vth = 0.0, dVth_dVb; +double dVth_dVd, dVth_dT; +double Vgst, dVgs_eff_dVg; +double n, dn_dVb, Vtm; double ExpArg, V0; -double ueff, dueff_dVg, dueff_dVd, dueff_dVb, dueff_dT; -double Esat, dEsat_dVg, dEsat_dVd, dEsat_dVb, Vdsat, Vdsat0; +double ueff = 0.0, dueff_dVg, dueff_dVd, dueff_dVb, dueff_dT; +double Esat, Vdsat = 0.0; double EsatL, dEsatL_dVg, dEsatL_dVd, dEsatL_dVb, dEsatL_dT; -double dVdsat_dVg, dVdsat_dVb, dVdsat_dVd, dVdsat_dT, Vasat, dAlphaz_dVg, dAlphaz_dVb; +double dVdsat_dVg, dVdsat_dVb, dVdsat_dVd, dVdsat_dT, Vasat; double dVasat_dVg, dVasat_dVb, dVasat_dVd, dVasat_dT; -double Va, Va2, dVa_dVd, dVa_dVg, dVa_dVb, dVa_dT; -double Vbseff, dVbseff_dVb, VbseffCV, dVbseffCV_dVb; -double One_Third_CoxWL, Two_Third_CoxWL, Alphaz, CoxWL; -double dVgdt_dVg, dVgdt_dVd, dVgdt_dVb; -double T0, dT0_dVg, dT0_dVd, dT0_dVb, dT0_dVc, dT0_dVe, dT0_dVrg, dT0_dT; +double Va, dVa_dVd, dVa_dVg, dVa_dVb, dVa_dT; +double Vbseff, dVbseff_dVb; +double One_Third_CoxWL, Two_Third_CoxWL, CoxWL; +double T0, dT0_dVg, dT0_dVd, dT0_dVb, dT0_dVc, dT0_dVe, dT0_dT; double T1, dT1_dVg, dT1_dVd, dT1_dVb, dT1_dVc, dT1_dVe, dT1_dT; double T2, dT2_dVg, dT2_dVd, dT2_dVb, dT2_dVc, dT2_dVe, dT2_dT; double T3, dT3_dVg, dT3_dVd, dT3_dVb, dT3_dVc, dT3_dVe, dT3_dT; -double T4, dT4_dVg, dT4_dVd, dT4_dVb, dT4_dVc, dT4_dVe, dT4_dT; -double T5, dT5_dVg, dT5_dVd, dT5_dVb, dT5_dVc, dT5_dVe, dT5_dT; -double T6, dT6_dVg, dT6_dVd, dT6_dVb, dT6_dVc, dT6_dVe, dT6_dT; -double T7, dT7_dVg, dT7_dVd, dT7_dVb; -double T8, dT8_dVg, dT8_dVd, dT8_dVb, dT8_dVc, dT8_dVe, dT8_dVrg; -double T9, dT9_dVg, dT9_dVd, dT9_dVb, dT9_dVc, dT9_dVe, dT9_dVrg; -double T10, dT10_dVg, dT10_dVb, dT10_dVd; -double T11, T12; -double tmp, Abulk, dAbulk_dVb, Abulk0, dAbulk0_dVb; -double T100, T101; +double T4, dT4_dVg, dT4_dVd, dT4_dVb, dT4_dVe, dT4_dT; +double T5, dT5_dVe; +double T6, dT6_dVe, dT6_dT; +double T7; +double T8; +double T9; +double T10; +double T11; +double Abulk, dAbulk_dVb, Abulk0, dAbulk0_dVb; double VACLM, dVACLM_dVg, dVACLM_dVd, dVACLM_dVb, dVACLM_dT; double VADIBL, dVADIBL_dVg, dVADIBL_dVd, dVADIBL_dVb, dVADIBL_dT; -double VAHCE, dVAHCE_dVg, dVAHCE_dVd, dVAHCE_dVb; double Xdep, dXdep_dVb, lt1, dlt1_dVb, ltw, dltw_dVb; double Delt_vth, dDelt_vth_dVb, dDelt_vth_dT; -double Theta0, dTheta0_dVb, Theta1, dTheta1_dVb; -double Thetarout, dThetarout_dVb, TempRatio, tmp1, tmp2, tmp3, tmp4; -double DIBL_Sft, dDIBL_Sft_dVd, DIBL_fact, Lambda, dLambda_dVg; -double Rout_Vgs_factor, dRout_Vgs_factor_dVg, dRout_Vgs_factor_dVb; -double dRout_Vgs_factor_dVd; -double tempv, a1; +double Theta0, dTheta0_dVb; +double TempRatio, tmp1, tmp2, tmp3, tmp4; +double DIBL_Sft, dDIBL_Sft_dVd, Lambda, dLambda_dVg; +double a1; -double Vgsteff, dVgsteff_dVg, dVgsteff_dVd, dVgsteff_dVb, dVgsteff_dVe, dVgsteff_dT; -double Vdseff, dVdseff_dVg, dVdseff_dVd, dVdseff_dVb, dVdseff_dT; +double Vgsteff = 0.0, dVgsteff_dVg, dVgsteff_dVd, dVgsteff_dVb; +double dVgsteff_dVe, dVgsteff_dT; +double Vdseff = 0.0, dVdseff_dVg, dVdseff_dVd, dVdseff_dVb, dVdseff_dT; double VdseffCV, dVdseffCV_dVg, dVdseffCV_dVd, dVdseffCV_dVb; -double diffVds, diffVdsCV; +double diffVds; double dAbulk_dVg, dn_dVd ; double beta, dbeta_dVg, dbeta_dVd, dbeta_dVb, dbeta_dT; double gche, dgche_dVg, dgche_dVd, dgche_dVb, dgche_dT; double fgche1, dfgche1_dVg, dfgche1_dVd, dfgche1_dVb, dfgche1_dT; double fgche2, dfgche2_dVg, dfgche2_dVd, dfgche2_dVb, dfgche2_dT; double Idl, dIdl_dVg, dIdl_dVd, dIdl_dVb, dIdl_dT; -double Ids, Gm, Gds, Gmb; +double Ids = 0.0, Gm, Gds = 0.0, Gmb; double CoxWovL; double Rds, dRds_dVg, dRds_dVb, dRds_dT, WVCox, WVCoxRds; -double Vgst2Vtm, dVgst2Vtm_dT, VdsatCV, dVdsatCV_dVd, dVdsatCV_dVg, dVdsatCV_dVb; +double Vgst2Vtm, dVgst2Vtm_dT, VdsatCV, dVdsatCV_dVg, dVdsatCV_dVb; double Leff, Weff, dWeff_dVg, dWeff_dVb; double AbulkCV, dAbulkCV_dVb; double qgdo, qgso, cgdo, cgso; @@ -181,14 +173,13 @@ double qgdo, qgso, cgdo, cgso; double dxpart, sxpart; struct b3soifdSizeDependParam *pParam; -int ByPass, Check, ChargeComputationNeeded, J, error, I; -double junk[50]; +int ByPass, Check, ChargeComputationNeeded = 0, error; double gbbsp, gbbdp, gbbg, gbbb, gbbe, gbbp, gbbT; double gddpsp, gddpdp, gddpg, gddpb, gddpe, gddpT; double gsspsp, gsspdp, gsspg, gsspb, gsspe, gsspT; double Gbpbs, Gbpgs, Gbpds, Gbpes, Gbpps, GbpT; -double vse, vde, ves, ved, veb, vge, delves, vedo, delved; +double ves, ved, veb, vge = 0.0, delves, vedo, delved; double vps, vpd, Vps, delvps; double Vbd, Ves, Vesfb, sqrtXdep, DeltVthtemp, dDeltVthtemp_dT; double Vbp, dVbp_dVp, dVbp_dVb, dVbp_dVg, dVbp_dVd, dVbp_dVe, dVbp_dT; @@ -198,94 +189,77 @@ double dVbseff_dVd, dVbseff_dVe, dVbseff_dT; double dVdsat_dVc, dVasat_dVc, dVACLM_dVc, dVADIBL_dVc, dVa_dVc; double dfgche1_dVc, dfgche2_dVc, dgche_dVc, dVdseff_dVc, dIdl_dVc; double Gm0, Gds0, Gmb0, GmT0, Gmc, Gme, GmT, dVbseff_dVg; -double dDIBL_Sft_dVb, BjtA, dBjtA_dVd; +double dDIBL_Sft_dVb; double diffVdsii ; -double Idgidl, Gdgidld, Gdgidlg, Isgidl, Gsgidlg; -double Gjsd, Gjss, Gjsb, GjsT, Gjdd, Gjdb, GjdT; -double Ibp, Iii, Giid, Giig, Giib, Giie, GiiT, Gcd, Gcb, GcT, ceqbody, ceqbodcon; -double gppg, gppdp, gppb, gppe, gppp, gppsp, gppT; +double Idgidl = 0.0, Gdgidld, Gdgidlg, Isgidl = 0.0, Gsgidlg; +double Gjsd, Gjsb, GjsT, Gjdd, Gjdb, GjdT; +double Ibp = 0.0, Iii = 0.0, Giid, Giig, Giib, Giie, GiiT, Gcd, Gcb, GcT; +double ceqbody, ceqbodcon = 0.0; +double gppg = 0.0, gppdp = 0.0, gppb = 0.0, gppe = 0.0; +double gppp = 0.0, gppsp = 0.0, gppT; double delTemp, deldelTemp, Temp; double ceqth, ceqqth; -double K1, WL; -double qjs, gcjsbs, gcjsT; -double qjd, gcjdbs, gcjdds, gcjdT; +double K1; +double qjs = 0.0, gcjsbs, gcjsT; +double qjd = 0.0, gcjdbs, gcjdds, gcjdT; double qge; double ceqqe; double ni, Eg, Cbox, Nfb, CboxWL; -double cjsbs; -double Qbf0, Qsicv, dVfbeff_dVrg, Cbe ; -double qinv, qgate, qbody, qdrn, qsrc, qsub, cqgate, cqbody, cqdrn, cqsub, cqtemp; -double Cgg, Cgd, Cgs, Cgb, Cge, Cdg, Cdd, Cds, Cdb, Qg, Qd; -double Csg, Csd, Css, Csb, Cse, Cbg, Cbd, Cbs, Cbb, Qs, Qb; -double Cgg1, Cgb1, Cgd1, Cbg1, Cbb1, Cbd1, Csg1, Csd1, Csb1; -double Vbs0t, dVbs0t_dT ; -double Vbs0 ,dVbs0_dVe, dVbs0_dT; -double Vbs0eff ,dVbs0eff_dVg ,dVbs0eff_dVd ,dVbs0eff_dVe, dVbs0eff_dT; -double Vbs0teff,dVbs0teff_dVg ,dVbs0teff_dVd, dVbs0teff_dVe, dVbs0teff_dT; -double Vbsdio, dVbsdio_dVg, dVbsdio_dVd, dVbsdio_dVe, dVbsdio_dVb, dVbsdio_dT; -double Vbseff0; -double Vthfd ,dVthfd_dVd ,dVthfd_dVe, dVthfd_dT; -double Vbs0mos ,dVbs0mos_dVe, dVbs0mos_dT; +double dVfbeff_dVrg, Cbe = 0.0; +double qinv = 0.0, qgate = 0.0, qbody = 0.0, qdrn = 0.0, qsrc, qsub = 0.0; +double cqgate, cqbody = 0.0, cqdrn = 0.0, cqsub, cqtemp; +double Cgg, Cgd, Cgb, Cge; +double Csg, Csd, Csb, Cse, Cbg = 0.0, Cbd = 0.0, Cbb = 0.0; +double Cgg1, Cgb1, Cgd1, Csg1, Csd1, Csb1; +double Vbs0t = 0.0, dVbs0t_dT ; +double Vbs0 = 0.0,dVbs0_dVe, dVbs0_dT; +double Vbs0eff = 0.0 ,dVbs0eff_dVg ,dVbs0eff_dVd ,dVbs0eff_dVe, dVbs0eff_dT; +double Vbs0teff = 0.0, dVbs0teff_dVg, dVbs0teff_dVd; +double dVbs0teff_dVe, dVbs0teff_dT; +double dVbsdio_dVg, dVbsdio_dVd, dVbsdio_dVe; +double dVbsdio_dVb, dVbsdio_dT; +double Vthfd = 0.0,dVthfd_dVd ,dVthfd_dVe, dVthfd_dT; +double Vbs0mos = 0.0 ,dVbs0mos_dVe, dVbs0mos_dT; double Vbsmos ,dVbsmos_dVg ,dVbsmos_dVb ,dVbsmos_dVd, dVbsmos_dVe, dVbsmos_dT; double Abeff ,dAbeff_dVg ,dAbeff_dVb, dAbeff_dVc; double Vcs ,dVcs_dVg ,dVcs_dVb ,dVcs_dVd ,dVcs_dVe, dVcs_dT; -double Xcsat ,dXcsat_dVg ,dXcsat_dVb, dXcsat_dVc; +double Xcsat = 0.0 ,dXcsat_dVg , dXcsat_dVc; double Vdsatii ,dVdsatii_dVg ,dVdsatii_dVd, dVdsatii_dVb, dVdsatii_dT; double Vdseffii ,dVdseffii_dVg ,dVdseffii_dVd, dVdseffii_dVb, dVdseffii_dT; -double VcsCV ,dVcsCV_dVg ,dVcsCV_dVb ,dVcsCV_dVd ,dVcsCV_dVc ,dVcsCV_dVe; -double VdsCV ,dVdsCV_dVg ,dVdsCV_dVb ,dVdsCV_dVd ,dVdsCV_dVc; -double Phisc ,dPhisc_dVg ,dPhisc_dVb ,dPhisc_dVd, dPhisc_dVc; +double VcsCV = 0.0; +double VdsCV = 0.0, dVdsCV_dVg = 0.0, dVdsCV_dVb = 0.0; +double dVdsCV_dVd = 0.0, dVdsCV_dVc = 0.0; double Phisd ,dPhisd_dVg ,dPhisd_dVb ,dPhisd_dVd, dPhisd_dVc; -double sqrtPhisc ,dsqrtPhisc_dVg ,dsqrtPhisc_dVb; -double sqrtPhisd ,dsqrtPhisd_dVg ,dsqrtPhisd_dVb; -double Xc ,dXc_dVg ,dXc_dVb ,dXc_dVd ,dXc_dVc; -double Ibjt ,dIbjt_dVb ,dIbjt_dVd ,dIbjt_dT; -double Ibs1 ,dIbs1_dVb ,dIbs1_dT; -double Ibs2 ,dIbs2_dVb ,dIbs2_dT; -double Ibs3 ,dIbs3_dVb ,dIbs3_dVd, dIbs3_dT; -double Ibs4 ,dIbs4_dVb ,dIbs4_dT; -double Ibd1 ,dIbd1_dVb ,dIbd1_dVd ,dIbd1_dT; -double Ibd2 ,dIbd2_dVb ,dIbd2_dVd ,dIbd2_dT; -double Ibd3 ,dIbd3_dVb ,dIbd3_dVd ,dIbd3_dT; -double Ibd4 ,dIbd4_dVb ,dIbd4_dVd ,dIbd4_dT; -double ExpVbs1, dExpVbs1_dVb, dExpVbs1_dT; -double ExpVbs2, dExpVbs2_dVb, dExpVbs2_dT; -double ExpVbs4, dExpVbs4_dVb, dExpVbs4_dT; -double ExpVbd1, dExpVbd1_dVb, dExpVbd1_dT; -double ExpVbd2, dExpVbd2_dVb, dExpVbd2_dT; -double ExpVbd4, dExpVbd4_dVb, dExpVbd4_dT; -double WTsi, NVtm1, NVtm2; -double Ic ,dIc_dVb ,dIc_dVd; -double Ibs ,dIbs_dVb ,dIbs_dVd ,dIbs_dVe; -double Ibd ,dIbd_dVb; -double Nomi ,dNomi_dVg ,dNomi_dVb ,dNomi_dVd ,dNomi_dVc; -double Denomi ,dDenomi_dVg ,dDenomi_dVd ,dDenomi_dVb ,dDenomi_dVc, dDenomi_dT; -double Qbf ,dQbf_dVg ,dQbf_dVb ,dQbf_dVd ,dQbf_dVc ,dQbf_dVe; -double Qsubs1 ,dQsubs1_dVg ,dQsubs1_dVb ,dQsubs1_dVd ,dQsubs1_dVc ,dQsubs1_dVe; -double Qsubs2 ,dQsubs2_dVg ,dQsubs2_dVb ,dQsubs2_dVd ,dQsubs2_dVc ,dQsubs2_dVe; -double Qsub0 ,dQsub0_dVg ,dQsub0_dVb ,dQsub0_dVd ; -double Qac0 ,dQac0_dVb ,dQac0_dVd; +double sqrtPhisd; +double Xc = 0.0; +double Ic = 0.0; +double Ibs = 0.0; +double Ibd = 0.0; +double Denomi ,dDenomi_dVg ,dDenomi_dVd ,dDenomi_dVb , dDenomi_dT; +double Qbf = 0.0; +double Qsubs1 = 0.0; +double Qsubs2 = 0.0; +double Qsub0 = 0.0 ,dQsub0_dVg ,dQsub0_dVb ,dQsub0_dVd ; +double Qac0 = 0.0 ,dQac0_dVb ,dQac0_dVd; double Qdep0 ,dQdep0_dVb; -double Qe1 , dQe1_dVg ,dQe1_dVb, dQe1_dVd, dQe1_dVe, dQe1_dT; +double Qe1 = 0.0; double Ce1g ,Ce1b ,Ce1d ,Ce1e, Ce1T; double Ce2g ,Ce2b ,Ce2d ,Ce2e, Ce2T; -double Qe2 , dQe2_dVg ,dQe2_dVb, dQe2_dVd, dQe2_dVe, dQe2_dT; -double dQbf_dVrg, dQac0_dVrg, dQsub0_dVrg; -double dQsubs1_dVrg, dQsubs2_dVrg, dQbf0_dVe, dQbf0_dT; +double Qe2 = 0.0; +double dQac0_dVrg, Vbsdio = 0.0, dQsub0_dVrg; /* for self-heating */ double vbi, vfbb, phi, sqrtPhi, Xdep0, jbjt, jdif, jrec, jtun, u0temp, vsattemp; double rds0, ua, ub, uc; double dvbi_dT, dvfbb_dT, djbjt_dT, djdif_dT, djrec_dT, djtun_dT, du0temp_dT; double dvsattemp_dT, drds0_dT, dua_dT, dub_dT, duc_dT, dni_dT, dVtm_dT; -double dVfbeff_dT, dQac0_dT, dQsub0_dT, dQbf_dT, dVdsCV_dT, dPhisd_dT; -double dNomi_dT,dXc_dT,dQsubs1_dT,dQsubs2_dT, dVcsCV_dT, dPhisc_dT, dQsicv_dT; -double CbT, CsT, CgT, CeT; +double dVfbeff_dT, dQac0_dT, dQsub0_dT, dVdsCV_dT = 0.0, dPhisd_dT; +double CbT, CsT, CgT; double Qex, dQex_dVg, dQex_dVb, dQex_dVd, dQex_dVe, dQex_dT; /* clean up last */ -FILE *fpdebug; +FILE *fpdebug = NULL; /* end clean up */ int nandetect; static int nanfound = 0; @@ -338,7 +312,9 @@ for (; model != NULL; model = model->B3SOIFDnextModel) } if (here->B3SOIFDdebugMod > 0) { - fprintf(stderr,"DC op. point converge with %d iterations\n"); + fprintf(stderr, + "DC op. point converge with %d iterations\n", + here->B3SOIFDiterations); } } else if ((ckt->CKTmode & MODEINITTRAN)) @@ -3344,25 +3320,25 @@ if (here->B3SOIFDdebugMod > 2) /* Here NaN will be detected in any conductance or equivalent current. Note that nandetect is initialized within the "if" statements */ - if (nandetect = isnan (*(here->B3SOIFDGgPtr))) + if ((nandetect = isnan (*(here->B3SOIFDGgPtr)))) { strcpy (nanmessage, "GgPtr"); } - else if (nandetect = isnan (*(here->B3SOIFDGdpPtr))) + else if ((nandetect = isnan (*(here->B3SOIFDGdpPtr)))) { strcpy (nanmessage, "GdpPtr"); } - else if (nandetect = isnan (*(here->B3SOIFDGspPtr))) + else if ((nandetect = isnan (*(here->B3SOIFDGspPtr)))) { strcpy (nanmessage, "GspPtr"); } - else if (nandetect = isnan (*(here->B3SOIFDDPgPtr))) + else if ((nandetect = isnan (*(here->B3SOIFDDPgPtr)))) { strcpy (nanmessage, "DPgPtr"); } - else if (nandetect = isnan (*(here->B3SOIFDDPdpPtr))) + else if ((nandetect = isnan (*(here->B3SOIFDDPdpPtr)))) { strcpy (nanmessage, "DPdpPtr"); } - else if (nandetect = isnan (*(here->B3SOIFDDPspPtr))) + else if ((nandetect = isnan (*(here->B3SOIFDDPspPtr)))) { strcpy (nanmessage, "DPspPtr"); } - else if (nandetect = isnan (*(here->B3SOIFDSPgPtr))) + else if ((nandetect = isnan (*(here->B3SOIFDSPgPtr)))) { strcpy (nanmessage, "SPgPtr"); } - else if (nandetect = isnan (*(here->B3SOIFDSPdpPtr))) + else if ((nandetect = isnan (*(here->B3SOIFDSPdpPtr)))) { strcpy (nanmessage, "SPdpPtr"); } - else if (nandetect = isnan (*(here->B3SOIFDSPspPtr))) + else if ((nandetect = isnan (*(here->B3SOIFDSPspPtr)))) { strcpy (nanmessage, "SPspPtr"); } - else if (nandetect = isnan (*(here->B3SOIFDEePtr))) + else if ((nandetect = isnan (*(here->B3SOIFDEePtr)))) { strcpy (nanmessage, "EePtr"); } /* At this point, nandetect = 0 if none of the @@ -3370,17 +3346,17 @@ if (here->B3SOIFDdebugMod > 2) if (nandetect == 0) { - if (nandetect = isnan (*(here->B3SOIFDEgPtr))) + if ((nandetect = isnan (*(here->B3SOIFDEgPtr)))) { strcpy (nanmessage, "EgPtr"); } - else if (nandetect = isnan (*(here->B3SOIFDEdpPtr))) + else if ((nandetect = isnan (*(here->B3SOIFDEdpPtr)))) { strcpy (nanmessage, "EdpPtr"); } - else if (nandetect = isnan (*(here->B3SOIFDEspPtr))) + else if ((nandetect = isnan (*(here->B3SOIFDEspPtr)))) { strcpy (nanmessage, "EspPtr"); } - else if (nandetect = isnan (*(here->B3SOIFDGePtr))) + else if ((nandetect = isnan (*(here->B3SOIFDGePtr)))) { strcpy (nanmessage, "GePtr"); } - else if (nandetect = isnan (*(here->B3SOIFDDPePtr))) + else if ((nandetect = isnan (*(here->B3SOIFDDPePtr)))) { strcpy (nanmessage, "DPePtr"); } - else if (nandetect = isnan (*(here->B3SOIFDSPePtr))) + else if ((nandetect = isnan (*(here->B3SOIFDSPePtr)))) { strcpy (nanmessage, "SPePtr"); } } /* Now check if self-heating caused NaN if nothing else @@ -3388,29 +3364,29 @@ if (here->B3SOIFDdebugMod > 2) if (selfheat && nandetect == 0) { - if (nandetect = isnan (*(here->B3SOIFDTemptempPtr))) + if ((nandetect = isnan (*(here->B3SOIFDTemptempPtr)))) { strcpy (nanmessage, "TemptempPtr"); } - else if (nandetect = isnan (*(here->B3SOIFDTempgPtr))) + else if ((nandetect = isnan (*(here->B3SOIFDTempgPtr)))) { strcpy (nanmessage, "TempgPtr"); } - else if (nandetect = isnan (*(here->B3SOIFDTempbPtr))) + else if ((nandetect = isnan (*(here->B3SOIFDTempbPtr)))) { strcpy (nanmessage, "TempbPtr"); } - else if (nandetect = isnan (*(here->B3SOIFDTempePtr))) + else if ((nandetect = isnan (*(here->B3SOIFDTempePtr)))) { strcpy (nanmessage, "TempePtr"); } - else if (nandetect = isnan (*(here->B3SOIFDTempdpPtr))) + else if ((nandetect = isnan (*(here->B3SOIFDTempdpPtr)))) { strcpy (nanmessage, "TempdpPtr"); } - else if (nandetect = isnan (*(here->B3SOIFDTempspPtr))) + else if ((nandetect = isnan (*(here->B3SOIFDTempspPtr)))) { strcpy (nanmessage, "TempspPtr"); } - else if (nandetect = isnan (*(here->B3SOIFDGtempPtr))) + else if ((nandetect = isnan (*(here->B3SOIFDGtempPtr)))) { strcpy (nanmessage, "GtempPtr"); } - else if (nandetect = isnan (*(here->B3SOIFDDPtempPtr))) + else if ((nandetect = isnan (*(here->B3SOIFDDPtempPtr)))) { strcpy (nanmessage, "DPtempPtr"); } - else if (nandetect = isnan (*(here->B3SOIFDSPtempPtr))) + else if ((nandetect = isnan (*(here->B3SOIFDSPtempPtr)))) { strcpy (nanmessage, "SPtempPtr"); } - else if (nandetect = isnan (*(here->B3SOIFDEtempPtr))) + else if ((nandetect = isnan (*(here->B3SOIFDEtempPtr)))) { strcpy (nanmessage, "EtempPtr"); } - else if (nandetect = isnan (*(here->B3SOIFDBtempPtr))) + else if ((nandetect = isnan (*(here->B3SOIFDBtempPtr)))) { strcpy (nanmessage, "BtempPtr"); } - else if (nandetect = isnan (*(ckt->CKTrhs + here->B3SOIFDtempNode))) + else if ((nandetect = isnan (*(ckt->CKTrhs + here->B3SOIFDtempNode)))) { strcpy (nanmessage, "tempNode"); } } @@ -3419,20 +3395,20 @@ if (here->B3SOIFDdebugMod > 2) if (nandetect == 0) { - if (nandetect = isnan (*(ckt->CKTrhs - + here->B3SOIFDgNode))) + if ((nandetect = isnan (*(ckt->CKTrhs + + here->B3SOIFDgNode)))) { strcpy (nanmessage, "gNode"); } - else if (nandetect = isnan (*(ckt->CKTrhs - + here->B3SOIFDbNode))) + else if ((nandetect = isnan (*(ckt->CKTrhs + + here->B3SOIFDbNode)))) { strcpy (nanmessage, "bNode"); } - else if (nandetect = isnan (*(ckt->CKTrhs - + here->B3SOIFDdNodePrime))) + else if ((nandetect = isnan (*(ckt->CKTrhs + + here->B3SOIFDdNodePrime)))) { strcpy (nanmessage, "dpNode"); } - else if (nandetect = isnan (*(ckt->CKTrhs - + here->B3SOIFDsNodePrime))) + else if ((nandetect = isnan (*(ckt->CKTrhs + + here->B3SOIFDsNodePrime)))) { strcpy (nanmessage, "spNode"); } - else if (nandetect = isnan (*(ckt->CKTrhs - + here->B3SOIFDeNode))) + else if ((nandetect = isnan (*(ckt->CKTrhs + + here->B3SOIFDeNode)))) { strcpy (nanmessage, "eNode"); } } diff --git a/src/spicelib/devices/bsim3soi_fd/b3soifdnoi.c b/src/spicelib/devices/bsim3soi_fd/b3soifdnoi.c index e93873b94..4da4a928b 100644 --- a/src/spicelib/devices/bsim3soi_fd/b3soifdnoi.c +++ b/src/spicelib/devices/bsim3soi_fd/b3soifdnoi.c @@ -55,8 +55,7 @@ B3SOIFDStrongInversionNoiseEval(double vgs, double vds, B3SOIFDmodel *model, { struct b3soifdSizeDependParam *pParam; double cd, esat, DelClm, EffFreq, N0, Nl, Vgst; -double T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, Ssi; -double req, ceq; +double T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, Ssi; pParam = here->pParam; cd = fabs(here->B3SOIFDcd) * here->B3SOIFDm; @@ -111,11 +110,10 @@ double noizDens[B3SOIFDNSRCS]; double lnNdens[B3SOIFDNSRCS]; double vgs, vds, Slimit; -double N0, Nl; -double T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13; -double n, ExpArg, Ssi, Swi; +double T1, T10, T11; +double Ssi, Swi; -int error, i; +int i; /* define the names of the noise sources */ static char *B3SOIFDnNames[B3SOIFDNSRCS] = diff --git a/src/spicelib/devices/bsim3soi_fd/b3soifdpzld.c b/src/spicelib/devices/bsim3soi_fd/b3soifdpzld.c index 00896d7a9..5bd19a552 100644 --- a/src/spicelib/devices/bsim3soi_fd/b3soifdpzld.c +++ b/src/spicelib/devices/bsim3soi_fd/b3soifdpzld.c @@ -23,9 +23,10 @@ B3SOIFDpzLoad(GENmodel *inModel, CKTcircuit *ckt, SPcomplex *s) B3SOIFDmodel *model = (B3SOIFDmodel*)inModel; B3SOIFDinstance *here; double xcggb, xcgdb, xcgsb, xcbgb, xcbdb, xcbsb, xcddb, xcssb, xcdgb; -double gdpr, gspr, gds, gbd, gbs, capbd, capbs, xcsgb, xcdsb, xcsdb; +double gdpr, gspr, gds, gbd, gbs, capbd = 0.0, capbs = 0.0; +double xcsgb, xcdsb, xcsdb; double cggb, cgdb, cgsb, cbgb, cbdb, cbsb, cddb, cdgb, cdsb; -double GSoverlapCap, GDoverlapCap, GBoverlapCap; +double GSoverlapCap, GDoverlapCap, GBoverlapCap = 0.0; double FwdSum, RevSum, Gm, Gmbs; double m; diff --git a/src/spicelib/devices/bsim3soi_fd/b3soifdset.c b/src/spicelib/devices/bsim3soi_fd/b3soifdset.c index a7215b9c8..a3993f29b 100644 --- a/src/spicelib/devices/bsim3soi_fd/b3soifdset.c +++ b/src/spicelib/devices/bsim3soi_fd/b3soifdset.c @@ -41,9 +41,8 @@ CKTnode *tmp; double tmp1, tmp2; double nfb0, Cboxt; -int itmp1; -CKTnode *tmpNode; +CKTnode *tmpNode[1]; IFuid tmpName; @@ -941,10 +940,10 @@ IFuid tmpName; here->B3SOIFDdNodePrime = tmp->number; if (ckt->CKTcopyNodesets) { - if (CKTinst2Node(ckt,here,1,&tmpNode,&tmpName)==OK) { - if (tmpNode->nsGiven) { - tmp->nodeset=tmpNode->nodeset; - tmp->nsGiven=tmpNode->nsGiven; + if (CKTinst2Node(ckt,here,1,(void**)tmpNode,&tmpName)==OK) { + if (tmpNode[0]->nsGiven) { + tmp->nodeset=tmpNode[0]->nodeset; + tmp->nsGiven=tmpNode[0]->nsGiven; } } } @@ -963,10 +962,10 @@ IFuid tmpName; here->B3SOIFDsNodePrime = tmp->number; if (ckt->CKTcopyNodesets) { - if (CKTinst2Node(ckt,here,3,&tmpNode,&tmpName)==OK) { - if (tmpNode->nsGiven) { - tmp->nodeset=tmpNode->nodeset; - tmp->nsGiven=tmpNode->nsGiven; + if (CKTinst2Node(ckt,here,3,(void**)tmpNode,&tmpName)==OK) { + if (tmpNode[0]->nsGiven) { + tmp->nodeset=tmpNode[0]->nodeset; + tmp->nsGiven=tmpNode[0]->nsGiven; } } } diff --git a/src/spicelib/devices/bsim3soi_fd/b3soifdtemp.c b/src/spicelib/devices/bsim3soi_fd/b3soifdtemp.c index 642e52682..e9982c12a 100644 --- a/src/spicelib/devices/bsim3soi_fd/b3soifdtemp.c +++ b/src/spicelib/devices/bsim3soi_fd/b3soifdtemp.c @@ -38,9 +38,9 @@ B3SOIFDtemp(GENmodel *inModel, CKTcircuit *ckt) { B3SOIFDmodel *model = (B3SOIFDmodel*) inModel; B3SOIFDinstance *here; -struct b3soifdSizeDependParam *pSizeDependParamKnot, *pLastKnot, *pParam; +struct b3soifdSizeDependParam *pSizeDependParamKnot, *pLastKnot, *pParam=NULL; double tmp, tmp1, tmp2, Eg, Eg0, ni, T0, T1, T2, T3, T4, T5, T6, Ldrn, Wdrn; -double Temp, TRatio, Inv_L, Inv_W, Inv_LW, Dw, Dl, Vtm0, Tnom; +double Temp, TRatio, Inv_L, Inv_W, Inv_LW, Vtm0, Tnom; double SDphi, SDgamma; int Size_Not_Found; diff --git a/src/spicelib/devices/bsim3soi_pd/b3soipdacld.c b/src/spicelib/devices/bsim3soi_pd/b3soipdacld.c index 866ca15b8..e5381a6ce 100644 --- a/src/spicelib/devices/bsim3soi_pd/b3soipdacld.c +++ b/src/spicelib/devices/bsim3soi_pd/b3soipdacld.c @@ -42,7 +42,7 @@ double gbbg, gbbdp, gbbb, gbbp, gbbsp, gbbT; double gddpg, gddpdp, gddpsp, gddpb, gddpT; double gsspg, gsspdp, gsspsp, gsspb, gsspT; double gppdp, gppb, gppp, gppT; -double xcTt, cTt, gcTt, gTtt, gTtg, gTtb, gTtdp, gTtsp; +double xcTt, cTt, gTtt, gTtg, gTtb, gTtdp, gTtsp; double EDextrinsicCap, ESextrinsicCap; double xcedb, xcesb; diff --git a/src/spicelib/devices/bsim3soi_pd/b3soipdld.c b/src/spicelib/devices/bsim3soi_pd/b3soipdld.c index 495326c1f..cd6a62f5b 100644 --- a/src/spicelib/devices/bsim3soi_pd/b3soipdld.c +++ b/src/spicelib/devices/bsim3soi_pd/b3soipdld.c @@ -97,13 +97,13 @@ B3SOIPDmodel *model = (B3SOIPDmodel*)inModel; B3SOIPDinstance *here; int selfheat; -double SourceSatCurrent, DrainSatCurrent, Gmin; -double ag0, qgd, qgs, qgb, von, cbhat, VgstNVt, ExpVgst; +double Gmin; +double ag0, qgd, qgs, von, cbhat, VgstNVt, ExpVgst = 0.0; double cdhat, cdreq, ceqbd, ceqbs, ceqqb, ceqqd, ceqqg, ceq, geq; -double evbd, evbs, arg, sarg; +double arg; double delvbd, delvbs, delvds, delvgd, delvgs; double Vfbeff, dVfbeff_dVg, dVfbeff_dVd, dVfbeff_dVb, V3, V4; -double tol, PhiB, PhiBSWG, MJSWG; +double PhiBSWG, MJSWG; double gcgdb, gcggb, gcgsb, gcgeb, gcgT; double gcsdb, gcsgb, gcssb, gcseb, gcsT; double gcddb, gcdgb, gcdsb, gcdeb, gcdT; @@ -115,48 +115,43 @@ double vg, vd, vs, vp, ve, vb; double Vds, Vgs, Vbs, Gmbs, FwdSum, RevSum; double Vgs_eff, Vfb, dVfb_dVb, dVfb_dVd, dVfb_dT; double Phis, dPhis_dVb, sqrtPhis, dsqrtPhis_dVb, Vth, dVth_dVb, dVth_dVd, dVth_dT; -double Vgst, dVgst_dVg, dVgst_dVb, dVgs_eff_dVg, Nvtm; -double Vgdt, Vgsaddvth, Vgsaddvth2, Vgsaddvth1o3, n, dn_dVb, Vtm; +double Vgst, dVgst_dVg, dVgst_dVb, dVgs_eff_dVg; +double n, dn_dVb, Vtm; double ExpArg, V0; double ueff, dueff_dVg, dueff_dVd, dueff_dVb, dueff_dT; -double Esat, dEsat_dVg, dEsat_dVd, dEsat_dVb, Vdsat, Vdsat0; +double Esat, Vdsat; double EsatL, dEsatL_dVg, dEsatL_dVd, dEsatL_dVb, dEsatL_dT; -double dVdsat_dVg, dVdsat_dVb, dVdsat_dVd, dVdsat_dT, Vasat, dAlphaz_dVg, dAlphaz_dVb; +double dVdsat_dVg, dVdsat_dVb, dVdsat_dVd, dVdsat_dT, Vasat; double dVasat_dVg, dVasat_dVb, dVasat_dVd, dVasat_dT; -double Va, Va2, dVa_dVd, dVa_dVg, dVa_dVb, dVa_dT; +double Va, dVa_dVd, dVa_dVg, dVa_dVb, dVa_dT; double Vbseff, dVbseff_dVb; -double Alphaz, CoxWL; -double dVgdt_dVg, dVgdt_dVd, dVgdt_dVb; -double T0, dT0_dVg, dT0_dVd, dT0_dVb, dT0_dVrg, dT0_dT; +double CoxWL; +double T0, dT0_dVg, dT0_dVd, dT0_dVb, dT0_dT; double T1, dT1_dVg, dT1_dVd, dT1_dVb, dT1_dT; double T2, dT2_dVg, dT2_dVd, dT2_dVb, dT2_dT; -double T3, dT3_dVg, dT3_dVd, dT3_dVb, dT3_dT; -double T4, dT4_dVg, dT4_dVd, dT4_dVb, dT4_dT; -double T5, dT5_dVg, dT5_dVd, dT5_dVb, dT5_dT; -double T6, dT6_dVg, dT6_dVd, dT6_dVb, dT6_dT; -double T7, dT7_dVg, dT7_dVd, dT7_dVb; -double T8, dT8_dVg, dT8_dVd, dT8_dVb, dT8_dVrg; -double T9, dT9_dVg, dT9_dVd, dT9_dVb, dT9_dVrg; -double T10, dT10_dVg, dT10_dVb, dT10_dVd; +double T3, dT3_dVg, dT3_dVd, dT3_dVb, dT3_dT = 0.0; +double T4, dT4_dVd, dT4_dVb, dT4_dT; +double T5, dT5_dVg, dT5_dVd, dT5_dVb, dT5_dT = 0.0; +double T6, dT6_dT = 0.0; +double T7, Vdsatii; +double T8; +double T9; +double T10, dT10_dVb; double T11, T12; double tmp, Abulk, dAbulk_dVb, Abulk0, dAbulk0_dVb; -double T100, T101; double VACLM, dVACLM_dVg, dVACLM_dVd, dVACLM_dVb, dVACLM_dT; double VADIBL, dVADIBL_dVg, dVADIBL_dVd, dVADIBL_dVb, dVADIBL_dT; -double VAHCE, dVAHCE_dVg, dVAHCE_dVd, dVAHCE_dVb; double Xdep, dXdep_dVb, lt1, dlt1_dVb, ltw, dltw_dVb; double Delt_vth, dDelt_vth_dVb, dDelt_vth_dT; -double Theta0, dTheta0_dVb, Theta1, dTheta1_dVb; -double Thetarout, dThetarout_dVb, TempRatio, tmp1, tmp2, tmp3, tmp4; -double DIBL_Sft, dDIBL_Sft_dVd, DIBL_fact, Lambda, dLambda_dVg; -double Rout_Vgs_factor, dRout_Vgs_factor_dVg, dRout_Vgs_factor_dVb; -double dRout_Vgs_factor_dVd; -double tempv, a1; +double Theta0, dTheta0_dVb; +double TempRatio, tmp1, tmp2, tmp3, tmp4; +double DIBL_Sft, dDIBL_Sft_dVd, Lambda, dLambda_dVg; +double a1; double Vgsteff, dVgsteff_dVg, dVgsteff_dVd, dVgsteff_dVb, dVgsteff_dT; double Vdseff, dVdseff_dVg, dVdseff_dVd, dVdseff_dVb, dVdseff_dT; double VdseffCV, dVdseffCV_dVg, dVdseffCV_dVd, dVdseffCV_dVb; -double diffVds, diffVdsCV; +double diffVds; double dAbulk_dVg, dn_dVd ; double beta, dbeta_dVg, dbeta_dVd, dbeta_dVb, dbeta_dT; double gche, dgche_dVg, dgche_dVd, dgche_dVb, dgche_dT; @@ -166,7 +161,7 @@ double Idl, dIdl_dVg, dIdl_dVd, dIdl_dVb, dIdl_dT; double Ids, Gm, Gds, Gmb; double CoxWovL; double Rds, dRds_dVg, dRds_dVb, dRds_dT, WVCox, WVCoxRds; -double Vgst2Vtm, dVgst2Vtm_dT, VdsatCV, dVdsatCV_dVd, dVdsatCV_dVg, dVdsatCV_dVb; +double Vgst2Vtm, dVgst2Vtm_dT, VdsatCV, dVdsatCV_dVg, dVdsatCV_dVb; double Leff, Weff, dWeff_dVg, dWeff_dVb; double AbulkCV, dAbulkCV_dVb; double qgdo, qgso, cgdo, cgso; @@ -174,42 +169,38 @@ double qgdo, qgso, cgdo, cgso; double dxpart, sxpart; struct b3soipdSizeDependParam *pParam; -int ByPass, Check, ChargeComputationNeeded, J, error, I; -double junk[50]; +int ByPass, Check, ChargeComputationNeeded = 0, error; double gbbsp, gbbdp, gbbg, gbbb, gbbp, gbbT; double gddpsp, gddpdp, gddpg, gddpb, gddpT; double gsspsp, gsspdp, gsspg, gsspb, gsspT; double Gbpbs, Gbpps; -double vse, vde, ves, ved, veb, vge, delves, vedo, delved; +double ves, ved, veb, vge = 0.0, delves, vedo, delved; double vps, vpd, Vps, delvps; -double Vbd, Ves, Vesfb, sqrtXdep, DeltVthtemp, dDeltVthtemp_dT; +double Vbd, Ves, Vesfb, DeltVthtemp, dDeltVthtemp_dT; double Vbp, dVbp_dVb; double DeltVthw, dDeltVthw_dVb, dDeltVthw_dT; double Gm0, Gds0, Gmb0, GmT0, Gmc, GmT; double dDIBL_Sft_dVb; -double diffVdsii ; double Idgidl, Gdgidld, Gdgidlg, Isgidl, Gsgidlg; -double Gjsd, Gjss, Gjsb, GjsT, Gjdd, Gjdb, GjdT; +double Gjsd, Gjsb, GjsT, Gjdd, Gjdb, GjdT; double Ibp, Iii, Giid, Giig, Giib, GiiT, Gcd, Gcb, GcT, ceqbody, ceqbodcon; double gppb, gppp, gppT; double delTemp, deldelTemp, Temp; double ceqth, ceqqth; -double K1, WL; -double qjs, gcjsbs, gcjsT; -double qjd, gcjdbs, gcjdds, gcjdT; +double K1; +double qjs = 0.0, gcjsbs, gcjsT; +double qjd = 0.0, gcjdbs, gcjdds, gcjdT; double qge; double ceqqe; -double ni, Eg, Cbox, Nfb, CboxWL; +double ni, Eg, Cbox, CboxWL; double cjsbs; double dVfbeff_dVrg; -double qinv, qgate, qbody, qdrn, qsrc, qsub, cqgate, cqbody, cqdrn, cqsub, cqtemp; -double Cgg, Cgd, Cgs, Cgb, Cdg, Cdd, Cds, Cdb, Qg, Qd; -double Csg, Csd, Css, Csb, Cbg, Cbd, Cbs, Cbb, Qs, Qb; +double qinv, qgate = 0.0, qbody = 0.0, qdrn = 0.0, qsrc, qsub = 0.0; +double cqgate, cqbody, cqdrn, cqsub, cqtemp; +double Cgg, Cgd, Cgb; +double Csg, Csd, Csb, Cbg = 0.0, Cbd = 0.0, Cbb = 0.0; double Cgg1, Cgb1, Cgd1, Cbg1, Cbb1, Cbd1, Csg1, Csd1, Csb1; -double Vbseff0; -double Vdsatii ,dVdsatii_dVg ,dVdsatii_dVd, dVdsatii_dVb, dVdsatii_dT; -double Ibjt ,dIbjt_dVb ,dIbjt_dVd ,dIbjt_dT; double Ibs1 ,dIbs1_dVb ,dIbs1_dT; double Ibs2 ,dIbs2_dVb ,dIbs2_dT; double Ibs3 ,dIbs3_dVb ,dIbs3_dVd, dIbs3_dT; @@ -218,20 +209,13 @@ double Ibd1 ,dIbd1_dVb ,dIbd1_dVd ,dIbd1_dT; double Ibd2 ,dIbd2_dVb ,dIbd2_dVd ,dIbd2_dT; double Ibd3 ,dIbd3_dVb ,dIbd3_dVd ,dIbd3_dT; double Ibd4 ,dIbd4_dVb ,dIbd4_dVd ,dIbd4_dT; -double ExpVbs1, dExpVbs1_dVb, dExpVbs1_dT; -double ExpVbs2, dExpVbs2_dVb, dExpVbs2_dT; -double ExpVbs4, dExpVbs4_dVb, dExpVbs4_dT; -double ExpVbd1, dExpVbd1_dVb, dExpVbd1_dT; -double ExpVbd2, dExpVbd2_dVb, dExpVbd2_dT; -double ExpVbd4, dExpVbd4_dVb, dExpVbd4_dT; double WTsi, NVtm1, NVtm2; double Ic ,dIc_dVb ,dIc_dVd; -double Ibs ,dIbs_dVb ,dIbs_dVd ; -double Ibd ,dIbd_dVb; +double Ibs; +double Ibd; double Denomi ,dDenomi_dVg ,dDenomi_dVd ,dDenomi_dVb ,dDenomi_dT; -double Qsub0 ,dQsub0_dVg ,dQsub0_dVb ,dQsub0_dVd ; -double Qac0 ,dQac0_dVb ,dQac0_dVd; -double Qdep0 ,dQdep0_dVb; +double Qsub0 = 0.0, dQsub0_dVg, dQsub0_dVb, dQsub0_dVd; +double Qac0 = 0.0, dQac0_dVb, dQac0_dVd; double Qe1 , dQe1_dVb, dQe1_dVe, dQe1_dT; double Ce1b ,Ce1e, Ce1T; double dQac0_dVrg, dQsub0_dVrg; @@ -242,7 +226,7 @@ double rds0, ua, ub, uc; double dvbi_dT, dvfbb_dT, djbjt_dT, djdif_dT, djrec_dT, djtun_dT, du0temp_dT; double dvsattemp_dT, drds0_dT, dua_dT, dub_dT, duc_dT, dni_dT, dVtm_dT; double dVfbeff_dT, dQac0_dT, dQsub0_dT; -double CbT, CsT, CgT, CeT; +double CbT, CsT, CgT; /* v2.0 release */ @@ -254,12 +238,12 @@ double dVgst_dVd; double Vdsatii0, dVdsatii0_dT; double VgsStep, dVgsStep_dT, Ratio, dRatio_dVg, dRatio_dVb, dRatio_dVd, dRatio_dT, dTempRatio_dT; double Vdiff, dVdiff_dVg, dVdiff_dVb, dVdiff_dVd, dVdiff_dT; -double dNVtm1_dT, dNVtm2_dT; +double dNVtm1_dT; double NVtmf, NVtmr, dNVtmf_dT, dNVtmr_dT; double TempRatioMinus1; double Ahli, dAhli_dT; double WsTsi, WdTsi; -double dPhiBSWG_dT, dcjsbs_dT, darg_dT, ddT3_dVb_dT; +double dPhiBSWG_dT, dcjsbs_dT, darg_dT = 0.0, ddT3_dVb_dT = 0.0; double dT7_dT, dT0_dT7, dT1_dT7, dT2_dT7; double CoxWLb, CoxWLcenb; double ExpVbsNVtm, dExpVbsNVtm_dVb, dExpVbsNVtm_dT; @@ -284,7 +268,7 @@ double T3zb, lt1zb, ltwzb, Theta0zb; double Delt_vthzb, dDelt_vthzb_dT; double DeltVthwzb, dDeltVthwzb_dT; double DeltVthtempzb, dDeltVthtempzb_dT; -double Vthzb, dVthzb_dT, Vfbzb, dVfbzb_dT; +double Vthzb = 0.0, dVthzb_dT = 0.0, Vfbzb, dVfbzb_dT; /* v2.2 release */ @@ -293,9 +277,10 @@ double OxideRatio, Vaux, dVaux_dVg, dVaux_dVd, dVaux_dVb; double Igb, dIgb_dVg, dIgb_dVd, dIgb_dVb; double ceqgate; double dT0_dVox, Voxeff, dVoxeff_dVox; -double dVox_dT, dVaux_dT, dIgb_dT; -double Voxacc, dVoxacc_dVg, dVoxacc_dVd, dVoxacc_dVb, dVoxacc_dT; -double Voxdepinv, dVoxdepinv_dVg, dVoxdepinv_dVb, dVoxdepinv_dVd, dVoxdepinv_dT; +double dVox_dT = 0.0, dVaux_dT = 0.0, dIgb_dT; +double Voxacc, dVoxacc_dVg, dVoxacc_dVd, dVoxacc_dVb; +double Voxdepinv, dVoxdepinv_dVg, dVoxdepinv_dVb, dVoxdepinv_dVd; +double dVoxdepinv_dT = 0.0; double Igb1, dIgb1_dVg, dIgb1_dVd, dIgb1_dVb, dIgb1_dT; double Igb2, dIgb2_dVg, dIgb2_dVd, dIgb2_dVb, dIgb2_dT; double gigs, gigd, gigb, gigg; diff --git a/src/spicelib/devices/bsim3soi_pd/b3soipdnoi.c b/src/spicelib/devices/bsim3soi_pd/b3soipdnoi.c index 3bfd9ebe5..67636d16b 100644 --- a/src/spicelib/devices/bsim3soi_pd/b3soipdnoi.c +++ b/src/spicelib/devices/bsim3soi_pd/b3soipdnoi.c @@ -54,9 +54,8 @@ B3SOIPDStrongInversionNoiseEval(double vgs, double vds, B3SOIPDmodel *model, double temp) { struct b3soipdSizeDependParam *pParam; -double cd, esat, DelClm, EffFreq, N0, Nl, Vgst; -double T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, Ssi; -double req, ceq; +double cd, esat, DelClm, EffFreq, N0, Nl; +double T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, Ssi; pParam = here->pParam; cd = fabs(here->B3SOIPDcd) * here->B3SOIPDm; @@ -113,11 +112,10 @@ double noizDens[B3SOIPDNSRCS]; double lnNdens[B3SOIPDNSRCS]; double vgs, vds, Slimit; -double N0, Nl; -double T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13; -double n, ExpArg, Ssi, Swi; +double T1, T10, T11; +double Ssi, Swi; -int error, i; +int i; /* define the names of the noise sources */ static char *B3SOIPDnNames[B3SOIPDNSRCS] = diff --git a/src/spicelib/devices/bsim3soi_pd/b3soipdpzld.c b/src/spicelib/devices/bsim3soi_pd/b3soipdpzld.c index abf25669b..33e07270f 100644 --- a/src/spicelib/devices/bsim3soi_pd/b3soipdpzld.c +++ b/src/spicelib/devices/bsim3soi_pd/b3soipdpzld.c @@ -23,9 +23,10 @@ B3SOIPDpzLoad(GENmodel *inModel, CKTcircuit *ckt, SPcomplex *s) B3SOIPDmodel *model = (B3SOIPDmodel*)inModel; B3SOIPDinstance *here; double xcggb, xcgdb, xcgsb, xcbgb, xcbdb, xcbsb, xcddb, xcssb, xcdgb; -double gdpr, gspr, gds, gbd, gbs, capbd, capbs, xcsgb, xcdsb, xcsdb; +double gdpr, gspr, gds, gbd, gbs, capbd = 0.0, capbs = 0.0; +double xcsgb, xcdsb, xcsdb; double cggb, cgdb, cgsb, cbgb, cbdb, cbsb, cddb, cdgb, cdsb; -double GSoverlapCap, GDoverlapCap, GBoverlapCap; +double GSoverlapCap, GDoverlapCap, GBoverlapCap = 0.0; double FwdSum, RevSum, Gm, Gmbs; double m; diff --git a/src/spicelib/devices/bsim3soi_pd/b3soipdset.c b/src/spicelib/devices/bsim3soi_pd/b3soipdset.c index 7bebd47dc..784379722 100644 --- a/src/spicelib/devices/bsim3soi_pd/b3soipdset.c +++ b/src/spicelib/devices/bsim3soi_pd/b3soipdset.c @@ -40,11 +40,9 @@ B3SOIPDinstance *here; int error; CKTnode *tmp; -double tmp1, tmp2; -double nfb0, Cboxt; -int itmp1; +double Cboxt; -CKTnode *tmpNode; +CKTnode *tmpNode[1]; IFuid tmpName; @@ -1131,10 +1129,10 @@ IFuid tmpName; here->B3SOIPDdNodePrime = tmp->number; if (ckt->CKTcopyNodesets) { - if (CKTinst2Node(ckt,here,1,&tmpNode,&tmpName)==OK) { - if (tmpNode->nsGiven) { - tmp->nodeset=tmpNode->nodeset; - tmp->nsGiven=tmpNode->nsGiven; + if (CKTinst2Node(ckt,here,1,(void**)tmpNode,&tmpName)==OK) { + if (tmpNode[0]->nsGiven) { + tmp->nodeset=tmpNode[0]->nodeset; + tmp->nsGiven=tmpNode[0]->nsGiven; } } } @@ -1153,10 +1151,10 @@ IFuid tmpName; here->B3SOIPDsNodePrime = tmp->number; if (ckt->CKTcopyNodesets) { - if (CKTinst2Node(ckt,here,3,&tmpNode,&tmpName)==OK) { - if (tmpNode->nsGiven) { - tmp->nodeset=tmpNode->nodeset; - tmp->nsGiven=tmpNode->nsGiven; + if (CKTinst2Node(ckt,here,3,(void**)tmpNode,&tmpName)==OK) { + if (tmpNode[0]->nsGiven) { + tmp->nodeset=tmpNode[0]->nodeset; + tmp->nsGiven=tmpNode[0]->nsGiven; } } } diff --git a/src/spicelib/devices/bsim3soi_pd/b3soipdtemp.c b/src/spicelib/devices/bsim3soi_pd/b3soipdtemp.c index ca8fb0477..da5a045b4 100644 --- a/src/spicelib/devices/bsim3soi_pd/b3soipdtemp.c +++ b/src/spicelib/devices/bsim3soi_pd/b3soipdtemp.c @@ -53,14 +53,14 @@ B3SOIPDtemp(GENmodel *inModel, CKTcircuit *ckt) { B3SOIPDmodel *model = (B3SOIPDmodel*) inModel; B3SOIPDinstance *here; -struct b3soipdSizeDependParam *pSizeDependParamKnot, *pLastKnot, *pParam; -double tmp, tmp1, tmp2, Eg, Eg0, ni, T0, T1, T2, T3, T4, T5, T6, Ldrn, Wdrn; -double Temp, TempRatio, Inv_L, Inv_W, Inv_LW, Dw, Dl, Vtm0, Tnom; +struct b3soipdSizeDependParam *pSizeDependParamKnot, *pLastKnot, *pParam=NULL; +double tmp, tmp1, tmp2, Eg, Eg0, ni, T0, T1, T2, T3, T4, T5, Ldrn, Wdrn; +double Temp, TempRatio, Inv_L, Inv_W, Inv_LW, Vtm0, Tnom; double SDphi, SDgamma; int Size_Not_Found; /* v2.0 release */ -double tmp3, T7, T8, T9; +double tmp3, T7; /* loop through all the B3SOIPD device models */ diff --git a/src/spicelib/devices/bsim3v0/b3v0ld.c b/src/spicelib/devices/bsim3v0/b3v0ld.c index 853b01035..6ebf1c4b5 100644 --- a/src/spicelib/devices/bsim3v0/b3v0ld.c +++ b/src/spicelib/devices/bsim3v0/b3v0ld.c @@ -32,59 +32,52 @@ BSIM3v0load(GENmodel *inModel, CKTcircuit *ckt) BSIM3v0model *model = (BSIM3v0model*)inModel; BSIM3v0instance *here; double SourceSatCurrent, DrainSatCurrent; -double ag0, qgd, qgs, qgb, von, cbhat, VgstNVt, ExpVgst; -double cdrain, cdhat, cdreq, ceqbd, ceqbs, ceqqb, ceqqd, ceqqg, ceq, geq; +double ag0, qgd, qgs, qgb, von, cbhat = 0.0, VgstNVt, ExpVgst = 0.0; +double cdrain, cdhat = 0.0, cdreq, ceqbd, ceqbs, ceqqb, ceqqd, ceqqg, ceq, geq; double czbd, czbdsw, czbs, czbssw, evbd, evbs, arg, sarg; double delvbd, delvbs, delvds, delvgd, delvgs; double Vfbeff, dVfbeff_dVg, dVfbeff_dVd, dVfbeff_dVb, V3, V4; double gcbdb, gcbgb, gcbsb, gcddb, gcdgb, gcdsb, gcgdb, gcggb, gcgsb, gcsdb; double gcsgb, gcssb, tol, PhiB, PhiBSW, MJ, MJSW; double vbd, vbs, vds, vgb, vgd, vgs, vgdo, xfact; -double qgate, qbulk, qdrn, qsrc, cqgate, cqbulk, cqdrn; +double qgate = 0.0, qbulk = 0.0, qdrn = 0.0, qsrc, cqgate, cqbulk, cqdrn; double Vds, Vgs, Vbs, Gmbs, FwdSum, RevSum; -double Vgs_eff, Vfb, dVfb_dVb, dVfb_dVd, dVbs_dVb; +double Vgs_eff, Vfb, dVfb_dVb, dVfb_dVd; double Phis, dPhis_dVb, sqrtPhis, dsqrtPhis_dVb, Vth, dVth_dVb, dVth_dVd; double Vgst, dVgs_eff_dVg; -double Vgdt, Vgsaddvth, Vgsaddvth2, Vgsaddvth1o3, n, dn_dVb, Vtm; -double ExpArg, ExpArg1; +double n, dn_dVb, Vtm; +double ExpArg; double Denomi, dDenomi_dVg, dDenomi_dVd, dDenomi_dVb; double ueff, dueff_dVg, dueff_dVd, dueff_dVb; -double Esat, dEsat_dVg, dEsat_dVd, dEsat_dVb, Vdsat, Vdsat0; +double Esat, Vdsat; double EsatL, dEsatL_dVg, dEsatL_dVd, dEsatL_dVb; -double Ilimit, Iexp, dIexp_dVg, dIexp_dVd, dIexp_dVb; -double dVdsat_dVg, dVdsat_dVb, dVdsat_dVd, Vasat, dAlphaz_dVg, dAlphaz_dVb; -double dVasat_dVg, dVasat_dVb, dVasat_dVd, Va, Va2, dVa_dVd, dVa_dVg, dVa_dVb; +double dVdsat_dVg, dVdsat_dVb, dVdsat_dVd, Vasat; +double dVasat_dVg, dVasat_dVb, dVasat_dVd, Va, dVa_dVd, dVa_dVg, dVa_dVb; double Vbseff, dVbseff_dVb, VbseffCV, dVbseffCV_dVb; -double Arg1, Arg2, One_Third_CoxWL, Two_Third_CoxWL, Alphaz, CoxWL; -double dqbulk_dVb, dVgdt_dVg, dVgdt_dVd, dVgdt_dVb; +double Arg1, One_Third_CoxWL, Two_Third_CoxWL, CoxWL; double T0, dT0_dVg, dT0_dVd, dT0_dVb; double T1, dT1_dVg, dT1_dVd, dT1_dVb; double T2, dT2_dVg, dT2_dVd, dT2_dVb; double T3, dT3_dVg, dT3_dVd, dT3_dVb; double T4, dT4_dVg, dT4_dVd, dT4_dVb; -double T5, dT5_dVg, dT5_dVd, dT5_dVb; -double T6, dT6_dVg, dT6_dVd, dT6_dVb; -double T7, dT7_dVg, dT7_dVd, dT7_dVb; -double T8, dT8_dVg, dT8_dVd, dT8_dVb; -double T9, dT9_dVg, dT9_dVd, dT9_dVb; -double T10, dT10_dVg, dT10_dVb, dT10_dVd; -double tmp, Abulk, dAbulk_dVb, Abulk0, dAbulk0_dVb; -double T100, T101; +double T5; +double T6; +double T7; +double T8; +double T10; +double Abulk, dAbulk_dVb, Abulk0, dAbulk0_dVb; double VACLM, dVACLM_dVg, dVACLM_dVd, dVACLM_dVb; double VADIBL, dVADIBL_dVg, dVADIBL_dVd, dVADIBL_dVb; -double VAHCE, dVAHCE_dVg, dVAHCE_dVd, dVAHCE_dVb; double Xdep, dXdep_dVb, lt1, dlt1_dVb, ltw, dltw_dVb, Delt_vth, dDelt_vth_dVb; -double Theta0, dTheta0_dVb, Theta1, dTheta1_dVb; -double Thetarout, dThetarout_dVb, TempRatio, tmp1, tmp2, tmp3, tmp4; -double DIBL_Sft, dDIBL_Sft_dVd, DIBL_fact, Pmos_factor; -double Rout_Vgs_factor, dRout_Vgs_factor_dVg, dRout_Vgs_factor_dVb; -double dRout_Vgs_factor_dVd; +double Theta0, dTheta0_dVb; +double TempRatio, tmp1, tmp2, tmp3, tmp4; +double DIBL_Sft, dDIBL_Sft_dVd, Pmos_factor; double tempv, a1; double Vgsteff, dVgsteff_dVg, dVgsteff_dVd, dVgsteff_dVb; double Vdseff, dVdseff_dVg, dVdseff_dVd, dVdseff_dVb; double VdseffCV, dVdseffCV_dVg, dVdseffCV_dVd, dVdseffCV_dVb; -double diffVds, diffVdsCV; +double diffVds; double dAbulk_dVg, dn_dVd ; double beta, dbeta_dVg, dbeta_dVd, dbeta_dVb; double gche, dgche_dVg, dgche_dVd, dgche_dVb; @@ -93,31 +86,29 @@ double fgche2, dfgche2_dVg, dfgche2_dVd, dfgche2_dVb; double Idl, dIdl_dVg, dIdl_dVd, dIdl_dVb; double Idsa, dIdsa_dVg, dIdsa_dVd, dIdsa_dVb; double Ids, Gm, Gds, Gmb; -double Isub, Isubd, Isubs, Gbd, Gbg, Gbb; +double Isub, Gbd, Gbg, Gbb; double VASCBE, dVASCBE_dVg, dVASCBE_dVd, dVASCBE_dVb; double CoxWovL; double Rds, dRds_dVg, dRds_dVb, WVCox, WVCoxRds; -double Vgst2Vtm, VdsatCV, dVdsatCV_dVd, dVdsatCV_dVg, dVdsatCV_dVb; -double Leff, Weff, dWeff_dVg, dWeff_dVb; +double Vgst2Vtm, VdsatCV, dVdsatCV_dVg, dVdsatCV_dVb; +double Leff = 0.0, Weff, dWeff_dVg, dWeff_dVb; double AbulkCV, dAbulkCV_dVb; double qgdo, qgso, cgdo, cgso; -double qcheq, qdef, gqdef, cqdef, cqcheq, gtau_diff, gtau_drift, csreq; -double gcqdb,gcqsb,gcqgb,gcqbb,vss; +double qcheq, qdef, gqdef, cqdef, cqcheq, gtau_diff, gtau_drift; +double gcqdb,gcqsb,gcqgb,gcqbb; double dxpart, sxpart; double gbspsp, gbbdp, gbbsp, gbspg, gbspb, gbspdp; double gbdpdp, gbdpg, gbdpb, gbdpsp; -double Cgg, Cgd, Cgs, Cgb, Cdg, Cdd, Cds, Cdb, Qg, Qd; -double Csg, Csd, Css, Csb, Cbg, Cbd, Cbs, Cbb, Qs, Qb; -double Cgg1, Cgb1, Cgd1, Cbg1, Cbb1, Cbd1, Csg1, Csd1, Csb1, Qac0, Qsub0; +double Cgg, Cgd, Cgb; +double Csg, Csd, Csb, Cbg, Cbd, Cbb; +double Cgg1, Cgb1, Cgd1, Cbg1, Cbb1, Cbd1, Qac0, Qsub0; double dQac0_dVg, dQac0_dVd, dQac0_dVb, dQsub0_dVg, dQsub0_dVd, dQsub0_dVb; struct bsim3v0SizeDependParam *pParam; -int ByPass, Check, ChargeComputationNeeded, J, error, I; -double junk[50]; - -double m; +int ByPass, Check, ChargeComputationNeeded = 0, error; +double m = 0.0; for (; model != NULL; model = model->BSIM3v0nextModel) { for (here = model->BSIM3v0instances; here != NULL; diff --git a/src/spicelib/devices/bsim3v0/b3v0noi.c b/src/spicelib/devices/bsim3v0/b3v0noi.c index f1904496e..956b37e18 100644 --- a/src/spicelib/devices/bsim3v0/b3v0noi.c +++ b/src/spicelib/devices/bsim3v0/b3v0noi.c @@ -31,7 +31,7 @@ StrongInversionNoiseEval(double vgs, double vds, BSIM3v0model *model, { struct bsim3v0SizeDependParam *pParam; double cd, esat, DelClm, EffFreq, N0, Nl, Vgst; -double T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, Ssi; +double T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, Ssi; pParam = here->pParam; cd = fabs(here->BSIM3v0cd) * here->BSIM3v0m; @@ -85,11 +85,10 @@ double noizDens[BSIM3v0NSRCS]; double lnNdens[BSIM3v0NSRCS]; double vgs, vds, Slimit; -double N0, Nl; -double T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13; -double n, ExpArg, Ssi, Swi; +double T1, T10, T11; +double Ssi, Swi; -int error, i; +int i; /* define the names of the noise sources */ static char *BSIM3v0nNames[BSIM3v0NSRCS] = diff --git a/src/spicelib/devices/bsim3v0/b3v0set.c b/src/spicelib/devices/bsim3v0/b3v0set.c index 4c1ea0601..90122d782 100644 --- a/src/spicelib/devices/bsim3v0/b3v0set.c +++ b/src/spicelib/devices/bsim3v0/b3v0set.c @@ -31,9 +31,7 @@ BSIM3v0instance *here; int error; CKTnode *tmp; -double tmp1, tmp2; - -CKTnode *tmpNode; +CKTnode *tmpNode[1]; IFuid tmpName; /* loop through all the BSIM3v0 device models */ @@ -801,10 +799,10 @@ IFuid tmpName; here->BSIM3v0dNodePrime = tmp->number; if (ckt->CKTcopyNodesets) { - if (CKTinst2Node(ckt,here,1,&tmpNode,&tmpName)==OK) { - if (tmpNode->nsGiven) { - tmp->nodeset=tmpNode->nodeset; - tmp->nsGiven=tmpNode->nsGiven; + if (CKTinst2Node(ckt,here,1,(void **)tmpNode,&tmpName)==OK) { + if (tmpNode[0]->nsGiven) { + tmp->nodeset=tmpNode[0]->nodeset; + tmp->nsGiven=tmpNode[0]->nsGiven; } } } @@ -822,10 +820,10 @@ IFuid tmpName; here->BSIM3v0sNodePrime = tmp->number; if (ckt->CKTcopyNodesets) { - if (CKTinst2Node(ckt,here,3,&tmpNode,&tmpName)==OK) { - if (tmpNode->nsGiven) { - tmp->nodeset=tmpNode->nodeset; - tmp->nsGiven=tmpNode->nsGiven; + if (CKTinst2Node(ckt,here,3,(void **)tmpNode,&tmpName)==OK) { + if (tmpNode[0]->nsGiven) { + tmp->nodeset=tmpNode[0]->nodeset; + tmp->nsGiven=tmpNode[0]->nsGiven; } } } diff --git a/src/spicelib/devices/bsim3v0/b3v0temp.c b/src/spicelib/devices/bsim3v0/b3v0temp.c index f003a7088..a6cbc2610 100644 --- a/src/spicelib/devices/bsim3v0/b3v0temp.c +++ b/src/spicelib/devices/bsim3v0/b3v0temp.c @@ -30,9 +30,9 @@ BSIM3v0temp(GENmodel *inModel, CKTcircuit *ckt) { register BSIM3v0model *model = (BSIM3v0model*) inModel; register BSIM3v0instance *here; -struct bsim3v0SizeDependParam *pSizeDependParamKnot, *pLastKnot, *pParam; -double tmp, tmp1, tmp2, Eg, ni, T0, T1, T2, T3, T4, T5, Ldrn, Wdrn; -double Temp, TRatio, Inv_L, Inv_W, Inv_LW, Dw, Dl, Vtm0, Tnom; +struct bsim3v0SizeDependParam *pSizeDependParamKnot, *pLastKnot, *pParam = NULL; +double tmp1, tmp2, Eg, ni, T0, T1, T2, T3, Ldrn, Wdrn; +double Temp, TRatio, Inv_L, Inv_W, Inv_LW, Vtm0, Tnom; int Size_Not_Found; /* loop through all the BSIM3v0 device models */ diff --git a/src/spicelib/devices/bsim3v0/bsim3v0itf.h b/src/spicelib/devices/bsim3v0/bsim3v0itf.h index ecf993ea1..0d2908003 100644 --- a/src/spicelib/devices/bsim3v0/bsim3v0itf.h +++ b/src/spicelib/devices/bsim3v0/bsim3v0itf.h @@ -4,7 +4,8 @@ Author: 1991 JianHui Huang and Min-Chie Jeng. File: bsim3v0itf.h **********/ -#ifdef DEV_bsim3v0 +#ifndef DEV_bsim3v0 +#define DEV_bsim3v0 SPICEdev *get_bsim3v0_info(void); diff --git a/src/spicelib/devices/bsim3v1/b3v1ld.c b/src/spicelib/devices/bsim3v1/b3v1ld.c index ecf578a57..7a25e86b5 100644 --- a/src/spicelib/devices/bsim3v1/b3v1ld.c +++ b/src/spicelib/devices/bsim3v1/b3v1ld.c @@ -38,60 +38,54 @@ BSIM3v1load(GENmodel *inModel, CKTcircuit *ckt) BSIM3v1model *model = (BSIM3v1model*)inModel; BSIM3v1instance *here; double SourceSatCurrent, DrainSatCurrent; -double ag0, qgd, qgs, qgb, von, cbhat, VgstNVt, ExpVgst; +double ag0, qgd, qgs, qgb, von, cbhat, VgstNVt, ExpVgst = 0.0; double cdrain, cdhat, cdreq, ceqbd, ceqbs, ceqqb, ceqqd, ceqqg, ceq, geq; double czbd, czbdsw, czbdswg, czbs, czbssw, czbsswg, evbd, evbs, arg, sarg; double delvbd, delvbs, delvds, delvgd, delvgs; double Vfbeff, dVfbeff_dVg, dVfbeff_dVd, dVfbeff_dVb, V3, V4; double gcbdb, gcbgb, gcbsb, gcddb, gcdgb, gcdsb, gcgdb, gcggb, gcgsb, gcsdb; -double gcsgb, gcssb, tol, PhiB, PhiBSW, MJ, MJSW, PhiBSWG, MJSWG; +double gcsgb, gcssb, PhiB, PhiBSW, MJ, MJSW, PhiBSWG, MJSWG; double vbd, vbs, vds, vgb, vgd, vgs, vgdo, xfact; -double qgate, qbulk, qdrn, qsrc, cqgate, cqbulk, cqdrn; +double qgate = 0.0, qbulk = 0.0, qdrn = 0.0, qsrc, cqgate, cqbulk, cqdrn; double Vds, Vgs, Vbs, Gmbs, FwdSum, RevSum; -double Vgs_eff, Vfb, dVfb_dVb, dVfb_dVd, dVbs_dVb; +double Vgs_eff, Vfb, dVfb_dVb, dVfb_dVd; double Phis, dPhis_dVb, sqrtPhis, dsqrtPhis_dVb, Vth, dVth_dVb, dVth_dVd; double Vgst, dVgst_dVg, dVgst_dVb, dVgs_eff_dVg, Nvtm; -double Vgdt, Vgsaddvth, Vgsaddvth2, Vgsaddvth1o3, n, dn_dVb, Vtm; -double ExpArg, ExpArg1, V0; +double n, dn_dVb, Vtm; +double ExpArg, V0; double Denomi, dDenomi_dVg, dDenomi_dVd, dDenomi_dVb; double ueff, dueff_dVg, dueff_dVd, dueff_dVb; -double Esat, dEsat_dVg, dEsat_dVd, dEsat_dVb, Vdsat, Vdsat0; +double Esat, Vdsat; double EsatL, dEsatL_dVg, dEsatL_dVd, dEsatL_dVb; -double Ilimit, Iexp, dIexp_dVg, dIexp_dVd, dIexp_dVb; double dVdsat_dVg, dVdsat_dVb, dVdsat_dVd, Vasat, dAlphaz_dVg, dAlphaz_dVb; -double dVasat_dVg, dVasat_dVb, dVasat_dVd, Va, Va2, dVa_dVd, dVa_dVg, dVa_dVb; +double dVasat_dVg, dVasat_dVb, dVasat_dVd, Va, dVa_dVd, dVa_dVg, dVa_dVb; double Vbseff, dVbseff_dVb, VbseffCV, dVbseffCV_dVb; -double Arg1, Arg2, One_Third_CoxWL, Two_Third_CoxWL, Alphaz, CoxWL; -double dqbulk_dVb, dVgdt_dVg, dVgdt_dVd, dVgdt_dVb; +double Arg1, One_Third_CoxWL, Two_Third_CoxWL, Alphaz, CoxWL; double T0, dT0_dVg, dT0_dVd, dT0_dVb; double T1, dT1_dVg, dT1_dVd, dT1_dVb; double T2, dT2_dVg, dT2_dVd, dT2_dVb; double T3, dT3_dVg, dT3_dVd, dT3_dVb; -double T4, dT4_dVg, dT4_dVd, dT4_dVb; -double T5, dT5_dVg, dT5_dVd, dT5_dVb; -double T6, dT6_dVg, dT6_dVd, dT6_dVb; -double T7, dT7_dVg, dT7_dVd, dT7_dVb; -double T8, dT8_dVg, dT8_dVd, dT8_dVb; -double T9, dT9_dVg, dT9_dVd, dT9_dVb; -double T10, dT10_dVg, dT10_dVb, dT10_dVd; +double T4; +double T5; +double T6; +double T7; +double T8; +double T9; +double T10; double T11, T12; double tmp, Abulk, dAbulk_dVb, Abulk0, dAbulk0_dVb; -double T100, T101; double VACLM, dVACLM_dVg, dVACLM_dVd, dVACLM_dVb; double VADIBL, dVADIBL_dVg, dVADIBL_dVd, dVADIBL_dVb; -double VAHCE, dVAHCE_dVg, dVAHCE_dVd, dVAHCE_dVb; double Xdep, dXdep_dVb, lt1, dlt1_dVb, ltw, dltw_dVb, Delt_vth, dDelt_vth_dVb; -double Theta0, dTheta0_dVb, Theta1, dTheta1_dVb; -double Thetarout, dThetarout_dVb, TempRatio, tmp1, tmp2, tmp3, tmp4; -double DIBL_Sft, dDIBL_Sft_dVd, DIBL_fact, Lambda, dLambda_dVg; -double Rout_Vgs_factor, dRout_Vgs_factor_dVg, dRout_Vgs_factor_dVb; -double dRout_Vgs_factor_dVd; +double Theta0, dTheta0_dVb; +double TempRatio, tmp1, tmp2, tmp3, tmp4; +double DIBL_Sft, dDIBL_Sft_dVd, Lambda, dLambda_dVg; double tempv, a1; double Vgsteff, dVgsteff_dVg, dVgsteff_dVd, dVgsteff_dVb; double Vdseff, dVdseff_dVg, dVdseff_dVd, dVdseff_dVb; double VdseffCV, dVdseffCV_dVg, dVdseffCV_dVd, dVdseffCV_dVb; -double diffVds, diffVdsCV; +double diffVds; double dAbulk_dVg, dn_dVd ; double beta, dbeta_dVg, dbeta_dVd, dbeta_dVb; double gche, dgche_dVg, dgche_dVd, dgche_dVb; @@ -100,31 +94,30 @@ double fgche2, dfgche2_dVg, dfgche2_dVd, dfgche2_dVb; double Idl, dIdl_dVg, dIdl_dVd, dIdl_dVb; double Idsa, dIdsa_dVg, dIdsa_dVd, dIdsa_dVb; double Ids, Gm, Gds, Gmb; -double Isub, Isubd, Isubs, Gbd, Gbg, Gbb; +double Isub, Gbd, Gbg, Gbb; double VASCBE, dVASCBE_dVg, dVASCBE_dVd, dVASCBE_dVb; double CoxWovL; double Rds, dRds_dVg, dRds_dVb, WVCox, WVCoxRds; -double Vgst2Vtm, VdsatCV, dVdsatCV_dVd, dVdsatCV_dVg, dVdsatCV_dVb; -double Leff, Weff, dWeff_dVg, dWeff_dVb; +double Vgst2Vtm, VdsatCV, dVdsatCV_dVg, dVdsatCV_dVb; +double Leff = 0.0, Weff, dWeff_dVg, dWeff_dVb; double AbulkCV, dAbulkCV_dVb; double qgdo, qgso, cgdo, cgso; -double qcheq, qdef, gqdef, cqdef, cqcheq, gtau_diff, gtau_drift, csreq; -double gcqdb,gcqsb,gcqgb,gcqbb,vss; +double qcheq, qdef, gqdef, cqdef, cqcheq, gtau_diff, gtau_drift; +double gcqdb,gcqsb,gcqgb,gcqbb; double dxpart, sxpart; double gbspsp, gbbdp, gbbsp, gbspg, gbspb, gbspdp; double gbdpdp, gbdpg, gbdpb, gbdpsp; -double Cgg, Cgd, Cgs, Cgb, Cdg, Cdd, Cds, Cdb, Qg, Qd; -double Csg, Csd, Css, Csb, Cbg, Cbd, Cbs, Cbb, Qs, Qb; -double Cgg1, Cgb1, Cgd1, Cbg1, Cbb1, Cbd1, Csg1, Csd1, Csb1, Qac0, Qsub0; +double Cgg, Cgd, Cgb; +double Csg, Csd, Csb, Cbg, Cbd, Cbb; +double Cgg1, Cgb1, Cgd1, Cbg1, Cbb1, Cbd1, Qac0, Qsub0; double dQac0_dVg, dQac0_dVd, dQac0_dVb, dQsub0_dVg, dQsub0_dVd, dQsub0_dVb; -double m; +double m = 0.0; struct bsim3v1SizeDependParam *pParam; -int ByPass, Check, ChargeComputationNeeded, J, error, I; -double junk[50]; +int ByPass, Check, ChargeComputationNeeded = 0, error; for (; model != NULL; model = model->BSIM3v1nextModel) { for (here = model->BSIM3v1instances; here != NULL; diff --git a/src/spicelib/devices/bsim3v1/b3v1noi.c b/src/spicelib/devices/bsim3v1/b3v1noi.c index 1ad8886c7..3b476b84f 100644 --- a/src/spicelib/devices/bsim3v1/b3v1noi.c +++ b/src/spicelib/devices/bsim3v1/b3v1noi.c @@ -53,7 +53,7 @@ StrongInversionNoiseEval_b3v1(double vgs, double vds, BSIM3v1model *model, { struct bsim3v1SizeDependParam *pParam; double cd, esat, DelClm, EffFreq, N0, Nl, Vgst; -double T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, Ssi; +double T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, Ssi; pParam = here->pParam; cd = fabs(here->BSIM3v1cd) * here->BSIM3v1m; @@ -107,11 +107,10 @@ double noizDens[BSIM3v1NSRCS]; double lnNdens[BSIM3v1NSRCS]; double vgs, vds, Slimit; -double N0, Nl; -double T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13; -double n, ExpArg, Ssi, Swi; +double T1, T10, T11; +double Ssi, Swi; -int error, i; +int i; /* define the names of the noise sources */ static char *BSIM3v1nNames[BSIM3v1NSRCS] = diff --git a/src/spicelib/devices/bsim3v1/b3v1set.c b/src/spicelib/devices/bsim3v1/b3v1set.c index 51ed67635..cefe2447a 100644 --- a/src/spicelib/devices/bsim3v1/b3v1set.c +++ b/src/spicelib/devices/bsim3v1/b3v1set.c @@ -37,9 +37,7 @@ BSIM3v1instance *here; int error; CKTnode *tmp; -double tmp1, tmp2; - -CKTnode *tmpNode; +CKTnode *tmpNode[1]; IFuid tmpName; /* loop through all the BSIM3v1 device models */ @@ -826,10 +824,10 @@ IFuid tmpName; here->BSIM3v1dNodePrime = tmp->number; if (ckt->CKTcopyNodesets) { - if (CKTinst2Node(ckt,here,1,&tmpNode,&tmpName)==OK) { - if (tmpNode->nsGiven) { - tmp->nodeset=tmpNode->nodeset; - tmp->nsGiven=tmpNode->nsGiven; + if (CKTinst2Node(ckt,here,1,(void **)tmpNode,&tmpName)==OK) { + if (tmpNode[0]->nsGiven) { + tmp->nodeset=tmpNode[0]->nodeset; + tmp->nsGiven=tmpNode[0]->nsGiven; } } } @@ -848,10 +846,10 @@ IFuid tmpName; here->BSIM3v1sNodePrime = tmp->number; if (ckt->CKTcopyNodesets) { - if (CKTinst2Node(ckt,here,3,&tmpNode,&tmpName)==OK) { - if (tmpNode->nsGiven) { - tmp->nodeset=tmpNode->nodeset; - tmp->nsGiven=tmpNode->nsGiven; + if (CKTinst2Node(ckt,here,3,(void **)tmpNode,&tmpName)==OK) { + if (tmpNode[0]->nsGiven) { + tmp->nodeset=tmpNode[0]->nodeset; + tmp->nsGiven=tmpNode[0]->nsGiven; } } } diff --git a/src/spicelib/devices/bsim3v1/b3v1temp.c b/src/spicelib/devices/bsim3v1/b3v1temp.c index 819e6d323..20544905f 100644 --- a/src/spicelib/devices/bsim3v1/b3v1temp.c +++ b/src/spicelib/devices/bsim3v1/b3v1temp.c @@ -37,9 +37,9 @@ BSIM3v1temp(GENmodel *inModel, CKTcircuit *ckt) { BSIM3v1model *model = (BSIM3v1model*) inModel; BSIM3v1instance *here; -struct bsim3v1SizeDependParam *pSizeDependParamKnot, *pLastKnot, *pParam; -double tmp, tmp1, tmp2, Eg, Eg0, ni, T0, T1, T2, T3, T4, T5, Ldrn, Wdrn; -double Temp, TRatio, Inv_L, Inv_W, Inv_LW, Dw, Dl, Vtm0, Tnom; +struct bsim3v1SizeDependParam *pSizeDependParamKnot, *pLastKnot, *pParam = NULL; +double tmp1, tmp2, Eg, Eg0, ni, T0, T1, T2, T3, Ldrn, Wdrn; +double Temp, TRatio, Inv_L, Inv_W, Inv_LW, Vtm0, Tnom; int Size_Not_Found; /* loop through all the BSIM3v1 device models */ diff --git a/src/spicelib/devices/bsim3v1a/b3v1ald.c b/src/spicelib/devices/bsim3v1a/b3v1ald.c index 491b7e423..01825f5fd 100644 --- a/src/spicelib/devices/bsim3v1a/b3v1ald.c +++ b/src/spicelib/devices/bsim3v1a/b3v1ald.c @@ -33,59 +33,52 @@ BSIM3v1Aload(GENmodel *inModel, CKTcircuit *ckt) BSIM3v1Amodel *model = (BSIM3v1Amodel*)inModel; BSIM3v1Ainstance *here; double SourceSatCurrent, DrainSatCurrent; -double ag0, qgd, qgs, qgb, von, cbhat, VgstNVt, ExpVgst; +double ag0, qgd, qgs, qgb, von, cbhat, VgstNVt, ExpVgst = 0.0; double cdrain, cdhat, cdreq, ceqbd, ceqbs, ceqqb, ceqqd, ceqqg, ceq, geq; double czbd, czbdsw, czbs, czbssw, evbd, evbs, arg, sarg; double delvbd, delvbs, delvds, delvgd, delvgs; double Vfbeff, dVfbeff_dVg, dVfbeff_dVd, dVfbeff_dVb, V3, V4; double gcbdb, gcbgb, gcbsb, gcddb, gcdgb, gcdsb, gcgdb, gcggb, gcgsb, gcsdb; -double gcsgb, gcssb, tol, PhiB, PhiBSW, MJ, MJSW; +double gcsgb, gcssb, PhiB, PhiBSW, MJ, MJSW; double vbd, vbs, vds, vgb, vgd, vgs, vgdo, xfact; -double qgate, qbulk, qdrn, qsrc, cqgate, cqbulk, cqdrn; +double qgate = 0.0, qbulk = 0.0, qdrn = 0.0, qsrc, cqgate, cqbulk, cqdrn; double Vds, Vgs, Vbs, Gmbs, FwdSum, RevSum; -double Vgs_eff, Vfb, dVfb_dVb, dVfb_dVd, dVbs_dVb; +double Vgs_eff, Vfb, dVfb_dVb, dVfb_dVd; double Phis, dPhis_dVb, sqrtPhis, dsqrtPhis_dVb, Vth, dVth_dVb, dVth_dVd; double Vgst, dVgs_eff_dVg; -double Vgdt, Vgsaddvth, Vgsaddvth2, Vgsaddvth1o3, n, dn_dVb, Vtm; -double ExpArg, ExpArg1; +double n, dn_dVb, Vtm; +double ExpArg; double Denomi, dDenomi_dVg, dDenomi_dVd, dDenomi_dVb; double ueff, dueff_dVg, dueff_dVd, dueff_dVb; -double Esat, dEsat_dVg, dEsat_dVd, dEsat_dVb, Vdsat, Vdsat0; +double Esat, Vdsat; double EsatL, dEsatL_dVg, dEsatL_dVd, dEsatL_dVb; -double Ilimit, Iexp, dIexp_dVg, dIexp_dVd, dIexp_dVb; -double dVdsat_dVg, dVdsat_dVb, dVdsat_dVd, Vasat, dAlphaz_dVg, dAlphaz_dVb; -double dVasat_dVg, dVasat_dVb, dVasat_dVd, Va, Va2, dVa_dVd, dVa_dVg, dVa_dVb; +double dVdsat_dVg, dVdsat_dVb, dVdsat_dVd, Vasat; +double dVasat_dVg, dVasat_dVb, dVasat_dVd, Va, dVa_dVd, dVa_dVg, dVa_dVb; double Vbseff, dVbseff_dVb, VbseffCV, dVbseffCV_dVb; -double Arg1, Arg2, One_Third_CoxWL, Two_Third_CoxWL, Alphaz, CoxWL; -double dqbulk_dVb, dVgdt_dVg, dVgdt_dVd, dVgdt_dVb; +double Arg1, One_Third_CoxWL, Two_Third_CoxWL, CoxWL; double T0, dT0_dVg, dT0_dVd, dT0_dVb; double T1, dT1_dVg, dT1_dVd, dT1_dVb; double T2, dT2_dVg, dT2_dVd, dT2_dVb; double T3, dT3_dVg, dT3_dVd, dT3_dVb; double T4, dT4_dVg, dT4_dVd, dT4_dVb; -double T5, dT5_dVg, dT5_dVd, dT5_dVb; -double T6, dT6_dVg, dT6_dVd, dT6_dVb; -double T7, dT7_dVg, dT7_dVd, dT7_dVb; -double T8, dT8_dVg, dT8_dVd, dT8_dVb; -double T9, dT9_dVg, dT9_dVd, dT9_dVb; -double T10, dT10_dVg, dT10_dVb, dT10_dVd; -double tmp, Abulk, dAbulk_dVb, Abulk0, dAbulk0_dVb; -double T100, T101; +double T5; +double T6; +double T7; +double T8; +double T10; +double Abulk, dAbulk_dVb, Abulk0, dAbulk0_dVb; double VACLM, dVACLM_dVg, dVACLM_dVd, dVACLM_dVb; double VADIBL, dVADIBL_dVg, dVADIBL_dVd, dVADIBL_dVb; -double VAHCE, dVAHCE_dVg, dVAHCE_dVd, dVAHCE_dVb; double Xdep, dXdep_dVb, lt1, dlt1_dVb, ltw, dltw_dVb, Delt_vth, dDelt_vth_dVb; -double Theta0, dTheta0_dVb, Theta1, dTheta1_dVb; -double Thetarout, dThetarout_dVb, TempRatio, tmp1, tmp2, tmp3, tmp4; -double DIBL_Sft, dDIBL_Sft_dVd, DIBL_fact, Pmos_factor; -double Rout_Vgs_factor, dRout_Vgs_factor_dVg, dRout_Vgs_factor_dVb; -double dRout_Vgs_factor_dVd; +double Theta0, dTheta0_dVb; +double TempRatio, tmp1, tmp2, tmp3, tmp4; +double DIBL_Sft, dDIBL_Sft_dVd, Pmos_factor; double tempv, a1; double Vgsteff, dVgsteff_dVg, dVgsteff_dVd, dVgsteff_dVb; double Vdseff, dVdseff_dVg, dVdseff_dVd, dVdseff_dVb; double VdseffCV, dVdseffCV_dVg, dVdseffCV_dVd, dVdseffCV_dVb; -double diffVds, diffVdsCV; +double diffVds; double dAbulk_dVg, dn_dVd ; double beta, dbeta_dVg, dbeta_dVd, dbeta_dVb; double gche, dgche_dVg, dgche_dVd, dgche_dVb; @@ -94,31 +87,30 @@ double fgche2, dfgche2_dVg, dfgche2_dVd, dfgche2_dVb; double Idl, dIdl_dVg, dIdl_dVd, dIdl_dVb; double Idsa, dIdsa_dVg, dIdsa_dVd, dIdsa_dVb; double Ids, Gm, Gds, Gmb; -double Isub, Isubd, Isubs, Gbd, Gbg, Gbb; +double Isub, Gbd, Gbg, Gbb; double VASCBE, dVASCBE_dVg, dVASCBE_dVd, dVASCBE_dVb; double CoxWovL; double Rds, dRds_dVg, dRds_dVb, WVCox, WVCoxRds; -double Vgst2Vtm, VdsatCV, dVdsatCV_dVd, dVdsatCV_dVg, dVdsatCV_dVb; -double Leff, Weff, dWeff_dVg, dWeff_dVb; +double Vgst2Vtm, VdsatCV, dVdsatCV_dVg, dVdsatCV_dVb; +double Leff = 0.0, Weff, dWeff_dVg, dWeff_dVb; double AbulkCV, dAbulkCV_dVb; double qgdo, qgso, cgdo, cgso; -double qcheq, qdef, gqdef, cqdef, cqcheq, gtau_diff, gtau_drift, csreq; -double gcqdb,gcqsb,gcqgb,gcqbb,vss; +double qcheq, qdef, gqdef, cqdef, cqcheq, gtau_diff, gtau_drift; +double gcqdb,gcqsb,gcqgb,gcqbb; double dxpart, sxpart; double gbspsp, gbbdp, gbbsp, gbspg, gbspb, gbspdp; double gbdpdp, gbdpg, gbdpb, gbdpsp; -double Cgg, Cgd, Cgs, Cgb, Cdg, Cdd, Cds, Cdb, Qg, Qd; -double Csg, Csd, Css, Csb, Cbg, Cbd, Cbs, Cbb, Qs, Qb; -double Cgg1, Cgb1, Cgd1, Cbg1, Cbb1, Cbd1, Csg1, Csd1, Csb1, Qac0, Qsub0; +double Cgg, Cgd, Cgb; +double Csg, Csd, Csb, Cbg, Cbd, Cbb; +double Cgg1, Cgb1, Cgd1, Cbg1, Cbb1, Cbd1, Qac0, Qsub0; double dQac0_dVg, dQac0_dVd, dQac0_dVb, dQsub0_dVg, dQsub0_dVd, dQsub0_dVb; -double m; +double m = 0.0; struct bsim3v1aSizeDependParam *pParam; -int ByPass, Check, ChargeComputationNeeded, J, error, I; -double junk[50]; +int ByPass, Check, ChargeComputationNeeded = 0, error; for (; model != NULL; model = model->BSIM3v1AnextModel) { for (here = model->BSIM3v1Ainstances; here != NULL; diff --git a/src/spicelib/devices/bsim3v1a/b3v1anoi.c b/src/spicelib/devices/bsim3v1a/b3v1anoi.c index 221212f9b..f6419ab79 100644 --- a/src/spicelib/devices/bsim3v1a/b3v1anoi.c +++ b/src/spicelib/devices/bsim3v1a/b3v1anoi.c @@ -32,7 +32,7 @@ StrongInversionNoiseEval_b3v1a(double vgs, double vds, BSIM3v1Amodel *model, { struct bsim3v1aSizeDependParam *pParam; double cd, esat, DelClm, EffFreq, N0, Nl, Vgst; -double T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, Ssi; +double T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, Ssi; pParam = here->pParam; cd = fabs(here->BSIM3v1Acd) * here->BSIM3v1Am; @@ -86,11 +86,10 @@ double noizDens[BSIM3v1ANSRCS]; double lnNdens[BSIM3v1ANSRCS]; double vgs, vds, Slimit; -double N0, Nl; -double T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13; -double n, ExpArg, Ssi, Swi; +double T1, T10, T11; +double Ssi, Swi; -int error, i; +int i; /* define the names of the noise sources */ static char *BSIM3v1AnNames[BSIM3v1ANSRCS] = diff --git a/src/spicelib/devices/bsim3v1a/b3v1aset.c b/src/spicelib/devices/bsim3v1a/b3v1aset.c index 51eba2e9e..c850cb05f 100644 --- a/src/spicelib/devices/bsim3v1a/b3v1aset.c +++ b/src/spicelib/devices/bsim3v1a/b3v1aset.c @@ -32,9 +32,7 @@ BSIM3v1Ainstance *here; int error; CKTnode *tmp; -double tmp1, tmp2; - -CKTnode *tmpNode; +CKTnode *tmpNode[1]; IFuid tmpName; /* loop through all the BSIM3v1A device models */ @@ -802,10 +800,10 @@ IFuid tmpName; here->BSIM3v1AdNodePrime = tmp->number; if (ckt->CKTcopyNodesets) { - if (CKTinst2Node(ckt,here,1,&tmpNode,&tmpName)==OK) { - if (tmpNode->nsGiven) { - tmp->nodeset=tmpNode->nodeset; - tmp->nsGiven=tmpNode->nsGiven; + if (CKTinst2Node(ckt,here,1,(void **)tmpNode,&tmpName)==OK) { + if (tmpNode[0]->nsGiven) { + tmp->nodeset=tmpNode[0]->nodeset; + tmp->nsGiven=tmpNode[0]->nsGiven; } } } @@ -824,10 +822,10 @@ IFuid tmpName; here->BSIM3v1AsNodePrime = tmp->number; if (ckt->CKTcopyNodesets) { - if (CKTinst2Node(ckt,here,3,&tmpNode,&tmpName)==OK) { - if (tmpNode->nsGiven) { - tmp->nodeset=tmpNode->nodeset; - tmp->nsGiven=tmpNode->nsGiven; + if (CKTinst2Node(ckt,here,3,(void **)tmpNode,&tmpName)==OK) { + if (tmpNode[0]->nsGiven) { + tmp->nodeset=tmpNode[0]->nodeset; + tmp->nsGiven=tmpNode[0]->nsGiven; } } } diff --git a/src/spicelib/devices/bsim3v1a/b3v1atemp.c b/src/spicelib/devices/bsim3v1a/b3v1atemp.c index b630dd4f7..cf088ca06 100644 --- a/src/spicelib/devices/bsim3v1a/b3v1atemp.c +++ b/src/spicelib/devices/bsim3v1a/b3v1atemp.c @@ -31,9 +31,9 @@ BSIM3v1Atemp(GENmodel *inModel, CKTcircuit *ckt) { BSIM3v1Amodel *model = (BSIM3v1Amodel*) inModel; BSIM3v1Ainstance *here; -struct bsim3v1aSizeDependParam *pSizeDependParamKnot, *pLastKnot, *pParam; -double tmp, tmp1, tmp2, Eg, ni, T0, T1, T2, T3, T4, T5, Ldrn, Wdrn; -double Temp, TRatio, Inv_L, Inv_W, Inv_LW, Dw, Dl, Vtm0, Tnom; +struct bsim3v1aSizeDependParam *pSizeDependParamKnot, *pLastKnot, *pParam = NULL; +double tmp1, tmp2, Eg, ni, T0, T1, T2, T3, Ldrn, Wdrn; +double Temp, TRatio, Inv_L, Inv_W, Inv_LW, Vtm0, Tnom; int Size_Not_Found; /* loop through all the BSIM3v1A device models */ diff --git a/src/spicelib/devices/bsim3v1s/b3v1sld.c b/src/spicelib/devices/bsim3v1s/b3v1sld.c index 1e0139414..dedd16585 100644 --- a/src/spicelib/devices/bsim3v1s/b3v1sld.c +++ b/src/spicelib/devices/bsim3v1s/b3v1sld.c @@ -33,7 +33,7 @@ BSIM3v1Sload(GENmodel *inModel, CKTcircuit *ckt) BSIM3v1Smodel *model = (BSIM3v1Smodel*)inModel; BSIM3v1Sinstance *here; double SourceSatCurrent, DrainSatCurrent; -double ag0, qgd, qgs, qgb, von, cbhat, VgstNVt, ExpVgst; +double ag0, qgd, qgs, qgb, von, cbhat, VgstNVt, ExpVgst = 0.0; double cdrain, cdhat, cdreq, ceqbd, ceqbs, ceqqb, ceqqd, ceqqg, ceq, geq; double czbd, czbdsw, czbdswg, czbs, czbssw, czbsswg, evbd, evbs, arg, sarg; double delvbd, delvbs, delvds, delvgd, delvgs; @@ -63,7 +63,7 @@ double T3, dT3_dVg, dT3_dVd, dT3_dVb; double T4; double T5; double T6; -double T7, dT7_dVg, dT7_dVd, dT7_dVb; +double T7; double T8; double T9; double T10; @@ -94,7 +94,7 @@ double VASCBE, dVASCBE_dVg, dVASCBE_dVd, dVASCBE_dVb; double CoxWovL; double Rds, dRds_dVg, dRds_dVb, WVCox, WVCoxRds; double Vgst2Vtm, VdsatCV, dVdsatCV_dVg, dVdsatCV_dVb; -double Leff, Weff, dWeff_dVg, dWeff_dVb; +double Leff = 0.0, Weff, dWeff_dVg, dWeff_dVb; double AbulkCV, dAbulkCV_dVb; double qgdo, qgso, cgdo, cgso; @@ -110,7 +110,7 @@ double Cgg1, Cgb1, Cgd1, Cbg1, Cbb1, Cbd1, Qac0, Qsub0; double dQac0_dVg, dQac0_dVd, dQac0_dVb, dQsub0_dVg, dQsub0_dVd, dQsub0_dVb; struct bsim3v1sSizeDependParam *pParam; -int ByPass, Check, ChargeComputationNeeded, error; +int ByPass, Check, ChargeComputationNeeded = 0, error; for (; model != NULL; model = model->BSIM3v1SnextModel) { for (here = model->BSIM3v1Sinstances; here != NULL; diff --git a/src/spicelib/devices/bsim3v1s/b3v1sset.c b/src/spicelib/devices/bsim3v1s/b3v1sset.c index 2fcb89113..6194033f9 100644 --- a/src/spicelib/devices/bsim3v1s/b3v1sset.c +++ b/src/spicelib/devices/bsim3v1s/b3v1sset.c @@ -32,7 +32,7 @@ BSIM3v1Sinstance *here; int error; CKTnode *tmp; -CKTnode *tmpNode; +CKTnode *tmpNode[1]; IFuid tmpName; @@ -854,10 +854,10 @@ IFuid tmpName; here->BSIM3v1SdNodePrime = tmp->number; if (ckt->CKTcopyNodesets) { - if (CKTinst2Node(ckt,here,1,&tmpNode,&tmpName)==OK) { - if (tmpNode->nsGiven) { - tmp->nodeset=tmpNode->nodeset; - tmp->nsGiven=tmpNode->nsGiven; + if (CKTinst2Node(ckt,here,1,(void **)tmpNode,&tmpName)==OK) { + if (tmpNode[0]->nsGiven) { + tmp->nodeset=tmpNode[0]->nodeset; + tmp->nsGiven=tmpNode[0]->nsGiven; } } } @@ -876,10 +876,10 @@ IFuid tmpName; here->BSIM3v1SsNodePrime = tmp->number; if (ckt->CKTcopyNodesets) { - if (CKTinst2Node(ckt,here,3,&tmpNode,&tmpName)==OK) { - if (tmpNode->nsGiven) { - tmp->nodeset=tmpNode->nodeset; - tmp->nsGiven=tmpNode->nsGiven; + if (CKTinst2Node(ckt,here,3,(void **)tmpNode,&tmpName)==OK) { + if (tmpNode[0]->nsGiven) { + tmp->nodeset=tmpNode[0]->nodeset; + tmp->nsGiven=tmpNode[0]->nsGiven; } } } diff --git a/src/spicelib/devices/bsim3v1s/b3v1stemp.c b/src/spicelib/devices/bsim3v1s/b3v1stemp.c index fd66038db..0c1f26c26 100644 --- a/src/spicelib/devices/bsim3v1s/b3v1stemp.c +++ b/src/spicelib/devices/bsim3v1s/b3v1stemp.c @@ -31,7 +31,7 @@ BSIM3v1Stemp(GENmodel *inModel, CKTcircuit *ckt) { BSIM3v1Smodel *model = (BSIM3v1Smodel*) inModel; BSIM3v1Sinstance *here; -struct bsim3v1sSizeDependParam *pSizeDependParamKnot, *pLastKnot, *pParam; +struct bsim3v1sSizeDependParam *pSizeDependParamKnot, *pLastKnot, *pParam = NULL; double tmp1, tmp2, Eg, Eg0, ni, T0, T1, T2, T3, Ldrn, Wdrn; double Temp, TRatio, Inv_L, Inv_W, Inv_LW, Vtm0, Tnom; int Size_Not_Found; diff --git a/src/spicelib/devices/bsim3v1s/bsim3v1sinit.c b/src/spicelib/devices/bsim3v1s/bsim3v1sinit.c index a13379688..6125bed65 100644 --- a/src/spicelib/devices/bsim3v1s/bsim3v1sinit.c +++ b/src/spicelib/devices/bsim3v1s/bsim3v1sinit.c @@ -21,8 +21,28 @@ SPICEdev BSIM3v1Sinfo = { &BSIM3v1SmPTSize, BSIM3v1SmPTable, - DEV_DEFAULT, +#ifdef XSPICE + /* + * OH what a hack this is!!! I have no idea what the proper values + * should be so I am just going to zero it out! This is a heck of a + * lot better than what existed perviously which was to convert + * DEV_DEFAULT to a function pointer. Would have started executing + * data at that point. Gotta love it!!! + */ + NULL, + + 0, + NULL, + + 0, + NULL, + + 0, + NULL, +#endif + + DEV_DEFAULT, }, DEVparam : BSIM3v1Sparam, diff --git a/src/spicelib/devices/bsim4/b4acld.c b/src/spicelib/devices/bsim4/b4acld.c index 28dc21b8a..201577a22 100644 --- a/src/spicelib/devices/bsim4/b4acld.c +++ b/src/spicelib/devices/bsim4/b4acld.c @@ -32,8 +32,8 @@ double xcggbr, xcgdbr, xcgsbr, xcgbbr, xcggbi, xcgdbi, xcgsbi, xcgbbi; double Cggr, Cgdr, Cgsr, Cgbr, Cggi, Cgdi, Cgsi, Cgbi; double xcddbr, xcdgbr, xcdsbr, xcdbbr, xcsdbr, xcsgbr, xcssbr, xcsbbr; double xcddbi, xcdgbi, xcdsbi, xcdbbi, xcsdbi, xcsgbi, xcssbi, xcsbbi; -double xcdbdb, xcsbsb, xcgmgmb, xcgmdb, xcgmsb, xcdgmb, xcsgmb; -double xcgmbb, xcbgmb; +double xcdbdb, xcsbsb = 0.0, xcgmgmb = 0.0, xcgmdb = 0.0, xcgmsb = 0.0, xcdgmb, xcsgmb; +double xcgmbb = 0.0, xcbgmb; double capbd, capbs, omega; double gstot, gstotd, gstotg, gstots, gstotb, gspr; double gdtot, gdtotd, gdtotg, gdtots, gdtotb, gdpr; @@ -44,15 +44,15 @@ double gIgtotg, gIgtotd, gIgtots, gIgtotb; double cgso, cgdo, cgbo; double gbspsp, gbbdp, gbbsp, gbspg, gbspb; double gbspdp, gbdpdp, gbdpg, gbdpb, gbdpsp; -double T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11; -double Csg, Csd, Css, Csb; +double T0 = 0.0, T1, T2, T3; +double Csg, Csd, Css; double Cdgr, Cddr, Cdsr, Cdbr, Csgr, Csdr, Cssr, Csbr; double Cdgi, Cddi, Cdsi, Cdbi, Csgi, Csdi, Cssi, Csbi; double gmr, gmi, gmbsr, gmbsi, gdsr, gdsi; -double FwdSumr, RevSumr, Gmr, Gmbsr, Gdsr; -double FwdSumi, RevSumi, Gmi, Gmbsi, Gdsi; +double FwdSumr, RevSumr, Gmr, Gmbsr; +double FwdSumi, RevSumi, Gmi, Gmbsi; struct bsim4SizeDependParam *pParam; -double ggidld, ggidlg, ggidlb,ggisld, ggislg, ggislb, ggisls; +double ggidld, ggidlg, ggidlb, ggislg, ggislb, ggisls; omega = ckt->CKTomega; for (; model != NULL; model = model->BSIM4nextModel) diff --git a/src/spicelib/devices/bsim4/b4geo.c b/src/spicelib/devices/bsim4/b4geo.c index 616d478db..181a97e51 100644 --- a/src/spicelib/devices/bsim4/b4geo.c +++ b/src/spicelib/devices/bsim4/b4geo.c @@ -12,6 +12,13 @@ #include #include +int BSIM4RdsEndIso(double Weffcj, double Rsh, double DMCG, double DMCI, + double DMDG, double nuEnd, int rgeo, int Type, + double *Rend); +int BSIM4RdsEndSha(double Weffcj, double Rsh, double DMCG, double DMCI, + double DMDG, double nuEnd, int rgeo, int Type, + double *Rend); + /* * WDLiu: * This subrutine is a special module to process the geometry dependent @@ -154,7 +161,7 @@ int geo, rgeo, minSD, Type; double nf, Weffcj, Rsh, DMCG, DMCI, DMDG; double *Rtot; { -double Rint, Rend = 0.0; +double Rint = 0.0, Rend = 0.0; double nuIntD = 0.0, nuEndD = 0.0, nuIntS = 0.0, nuEndS = 0.0; if (geo < 9) /* since geo = 9 and 10 only happen when nf = even */ diff --git a/src/spicelib/devices/bsim4/b4ld.c b/src/spicelib/devices/bsim4/b4ld.c index e89ad662e..256144009 100644 --- a/src/spicelib/devices/bsim4/b4ld.c +++ b/src/spicelib/devices/bsim4/b4ld.c @@ -49,13 +49,12 @@ double dRs_dvg, dRd_dvg, dRs_dvb, dRd_dvb; double dT0_dvg, dT1_dvb, dT3_dvg, dT3_dvb; double vses, vdes, vdedo, delvses, delvded, delvdes; double Isestot, cseshat, Idedtot, cdedhat; -double tol0, tol1, tol2, tol3, tol4, tol5, tol6; double geltd, gcrg, gcrgg, gcrgd, gcrgs, gcrgb, ceqgcrg; double vges, vgms, vgedo, vgmdo, vged, vgmd, delvged, delvgmd; double delvges, delvgms, vgmb; -double gcgmgmb, gcgmdb, gcgmsb, gcdgmb, gcsgmb; -double gcgmbb, gcbgmb, qgmb, qgmid, ceqqgmid; +double gcgmgmb = 0.0, gcgmdb = 0.0, gcgmsb = 0.0, gcdgmb, gcsgmb; +double gcgmbb = 0.0, gcbgmb, qgmb, qgmid = 0.0, ceqqgmid; double vbd, vbs, vds, vgb, vgd, vgs, vgdo, xfact; double vdbs, vdbd, vsbs, vsbdo, vsbd; @@ -63,59 +62,58 @@ double delvdbs, delvdbd, delvsbs; double delvbd_jct, delvbs_jct, vbs_jct, vbd_jct; double SourceSatCurrent, DrainSatCurrent; -double ag0, qgd, qgs, qgb, von, cbhat, VgstNVt, ExpVgst; -double ceqqb, ceqqd, ceqqg, ceqqjd, ceqqjs, ceq, geq; +double ag0, qgb, von, cbhat, VgstNVt, ExpVgst; +double ceqqb, ceqqd, ceqqg, ceqqjd = 0.0, ceqqjs = 0.0, ceq, geq; double cdrain, cdhat, ceqdrn, ceqbd, ceqbs, ceqjd, ceqjs, gjbd, gjbs; double czbd, czbdsw, czbdswg, czbs, czbssw, czbsswg, evbd, evbs, arg, sarg; double delvbd, delvbs, delvds, delvgd, delvgs; double Vfbeff, dVfbeff_dVg, dVfbeff_dVb, V3, V4; double gcbdb, gcbgb, gcbsb, gcddb, gcdgb, gcdsb, gcgdb, gcggb, gcgsb, gcsdb; double gcgbb, gcdbb, gcsbb, gcbbb; -double gcdbdb, gcsbsb; +double gcdbdb, gcsbsb = 0.0; double gcsgb, gcssb, MJD, MJSWD, MJSWGD, MJS, MJSWS, MJSWGS; -double qgate, qbulk, qdrn, qsrc, cqgate, cqbody, cqdrn; +double qgate = 0.0, qbulk = 0.0, qdrn = 0.0, qsrc, cqgate, cqbody, cqdrn; double Vdb, Vds, Vgs, Vbs, Gmbs, FwdSum, RevSum; double Igidl, Ggidld, Ggidlg, Ggidlb; -double Voxacc, dVoxacc_dVg, dVoxacc_dVb; -double Voxdepinv, dVoxdepinv_dVg, dVoxdepinv_dVd, dVoxdepinv_dVb; +double Voxacc = 0.0, dVoxacc_dVg = 0.0, dVoxacc_dVb = 0.0; +double Voxdepinv = 0.0, dVoxdepinv_dVg = 0.0; +double dVoxdepinv_dVd = 0.0, dVoxdepinv_dVb = 0.0; double VxNVt, ExpVxNVt, Vaux, dVaux_dVg, dVaux_dVd, dVaux_dVb; double Igc, dIgc_dVg, dIgc_dVd, dIgc_dVb; double Igcs, dIgcs_dVg, dIgcs_dVd, dIgcs_dVb; double Igcd, dIgcd_dVg, dIgcd_dVd, dIgcd_dVb; double Igs, dIgs_dVg, dIgs_dVs, Igd, dIgd_dVg, dIgd_dVd; -double Igbacc, dIgbacc_dVg, dIgbacc_dVd, dIgbacc_dVb; +double Igbacc, dIgbacc_dVg, dIgbacc_dVb; double Igbinv, dIgbinv_dVg, dIgbinv_dVd, dIgbinv_dVb; -double Igb, dIgb_dVg, dIgb_dVd, dIgb_dVb; double Pigcd, dPigcd_dVg, dPigcd_dVd, dPigcd_dVb; double Istoteq, gIstotg, gIstotd, gIstots, gIstotb; double Idtoteq, gIdtotg, gIdtotd, gIdtots, gIdtotb; double Ibtoteq, gIbtotg, gIbtotd, gIbtots, gIbtotb; double Igtoteq, gIgtotg, gIgtotd, gIgtots, gIgtotb; double Igstot, cgshat, Igdtot, cgdhat, Igbtot, cgbhat; -double Vgs_eff, Vfb, dVbs_dVb, Vth_NarrowW; +double Vgs_eff, Vfb = 0.0, Vth_NarrowW; double Phis, dPhis_dVb, sqrtPhis, dsqrtPhis_dVb, Vth, dVth_dVb, dVth_dVd; double Vgst, dVgst_dVg, dVgst_dVb, dVgs_eff_dVg, Nvtms, Nvtmd; -double Vgdt, Vgsaddvth, Vgsaddvth2, Vgsaddvth1o3, Vtm; +double Vtm; double n, dn_dVb, dn_dVd, voffcv, noff, dnoff_dVd, dnoff_dVb; -double ExpArg, ExpArg1, V0, CoxWLcen, QovCox, LINK; +double V0, CoxWLcen, QovCox, LINK; double DeltaPhi, dDeltaPhi_dVg; double Cox, Tox, Tcen, dTcen_dVg, dTcen_dVd, dTcen_dVb; double Ccen, Coxeff, dCoxeff_dVd, dCoxeff_dVg, dCoxeff_dVb; double Denomi, dDenomi_dVg, dDenomi_dVd, dDenomi_dVb; double ueff, dueff_dVg, dueff_dVd, dueff_dVb; -double Esat, dEsat_dVg, dEsat_dVd, dEsat_dVb, Vdsat, Vdsat0; +double Esat, Vdsat; double EsatL, dEsatL_dVg, dEsatL_dVd, dEsatL_dVb; -double Ilimit, Iexp, dIexp_dVg, dIexp_dVd, dIexp_dVb; double dVdsat_dVg, dVdsat_dVb, dVdsat_dVd, Vasat, dAlphaz_dVg, dAlphaz_dVb; -double dVasat_dVg, dVasat_dVb, dVasat_dVd, Va, Va2, dVa_dVd, dVa_dVg, dVa_dVb; +double dVasat_dVg, dVasat_dVb, dVasat_dVd, Va, dVa_dVd, dVa_dVg, dVa_dVb; double Vbseff, dVbseff_dVb, VbseffCV, dVbseffCV_dVb; -double Arg1, Arg2, One_Third_CoxWL, Two_Third_CoxWL, Alphaz, CoxWL; -double T0, dT0_dVg, dT0_dVd, dT0_dVb; +double Arg1, One_Third_CoxWL, Two_Third_CoxWL, Alphaz, CoxWL; +double T0 = 0.0, dT0_dVg, dT0_dVd, dT0_dVb; double T1, dT1_dVg, dT1_dVd, dT1_dVb; double T2, dT2_dVg, dT2_dVd, dT2_dVb; double T3, dT3_dVg, dT3_dVd, dT3_dVb; -double T4, dT4_dVg, dT4_dVd, dT4_dVb; -double T5, dT5_dVg, dT5_dVd, dT5_dVb; +double T4, dT4_dVd; +double T5, dT5_dVb; double T6, dT6_dVg, dT6_dVd, dT6_dVb; double T7, dT7_dVg, dT7_dVd, dT7_dVb; double T8, dT8_dVg, dT8_dVd, dT8_dVb; @@ -126,19 +124,19 @@ double tmp, Abulk, dAbulk_dVb, Abulk0, dAbulk0_dVb; double Cclm, dCclm_dVg, dCclm_dVd, dCclm_dVb; double FP, dFP_dVg, PvagTerm, dPvagTerm_dVg, dPvagTerm_dVd, dPvagTerm_dVb; double VADITS, dVADITS_dVg, dVADITS_dVd; -double Lpe_Vb, DITS_Sft, dDITS_Sft_dVb, dDITS_Sft_dVd; +double Lpe_Vb, dDITS_Sft_dVb, dDITS_Sft_dVd; double VACLM, dVACLM_dVg, dVACLM_dVd, dVACLM_dVb; double VADIBL, dVADIBL_dVg, dVADIBL_dVd, dVADIBL_dVb; double Xdep, dXdep_dVb, lt1, dlt1_dVb, ltw, dltw_dVb, Delt_vth, dDelt_vth_dVb; -double Theta0, dTheta0_dVb, Theta1, dTheta1_dVb; -double Thetarout, dThetarout_dVb, TempRatio, tmp1, tmp2, tmp3, tmp4; -double DIBL_Sft, dDIBL_Sft_dVd, DIBL_fact, Lambda, dLambda_dVg; +double Theta0, dTheta0_dVb; +double TempRatio, tmp1, tmp2, tmp3, tmp4; +double DIBL_Sft, dDIBL_Sft_dVd, Lambda, dLambda_dVg; double Idtot, Ibtot, a1, ScalingFactor; double Vgsteff, dVgsteff_dVg, dVgsteff_dVd, dVgsteff_dVb; double Vdseff, dVdseff_dVg, dVdseff_dVd, dVdseff_dVb; double VdseffCV, dVdseffCV_dVg, dVdseffCV_dVd, dVdseffCV_dVb; -double diffVds, diffVdsCV, dAbulk_dVg; +double diffVds, dAbulk_dVg; double beta, dbeta_dVg, dbeta_dVd, dbeta_dVb; double gche, dgche_dVg, dgche_dVd, dgche_dVb; double fgche1, dfgche1_dVg, dfgche1_dVd, dfgche1_dVb; @@ -150,23 +148,23 @@ double Isub, Gbd, Gbg, Gbb; double VASCBE, dVASCBE_dVg, dVASCBE_dVd, dVASCBE_dVb; double CoxeffWovL; double Rds, dRds_dVg, dRds_dVb, WVCox, WVCoxRds; -double Vgst2Vtm, VdsatCV, dVdsatCV_dVd, dVdsatCV_dVg, dVdsatCV_dVb; +double Vgst2Vtm, VdsatCV; double Leff, Weff, dWeff_dVg, dWeff_dVb; double AbulkCV, dAbulkCV_dVb; -double qcheq, qdef, gqdef, cqdef, cqcheq; -double gcqdb, gcqsb, gcqgb, gcqbb; +double qcheq, qdef, gqdef = 0.0, cqdef = 0.0, cqcheq = 0.0; +double gcqdb = 0.0, gcqsb = 0.0, gcqgb = 0.0, gcqbb = 0.0; double dxpart, sxpart, ggtg, ggtd, ggts, ggtb; double ddxpart_dVd, ddxpart_dVg, ddxpart_dVb, ddxpart_dVs; double dsxpart_dVd, dsxpart_dVg, dsxpart_dVb, dsxpart_dVs; double gbspsp, gbbdp, gbbsp, gbspg, gbspb, gbspdp; double gbdpdp, gbdpg, gbdpb, gbdpsp; -double qgdo, qgso, cgdo, cgso, cqbs, cqbd; -double Cgg, Cgd, Cgs, Cgb, Cdg, Cdd, Cds, Cdb, Qg, Qd; -double Csg, Csd, Css, Csb, Cbg, Cbd, Cbs, Cbb, Qs, Qb; -double Cgg1, Cgb1, Cgd1, Cbg1, Cbb1, Cbd1, Csg1, Csd1, Csb1, Qac0, Qsub0; +double qgdo, qgso, cgdo, cgso; +double Cgg, Cgd, Cgb, Cdg, Cdd, Cds; +double Csg, Csd, Css, Csb, Cbg, Cbd, Cbb; +double Cgg1, Cgb1, Cgd1, Cbg1, Cbb1, Cbd1, Qac0, Qsub0; double dQac0_dVg, dQac0_dVb, dQsub0_dVg, dQsub0_dVd, dQsub0_dVb; -double ggidld, ggidlg, ggidlb,ggisld, ggislg, ggislb, ggisls; -double Igisl, Ggisld, Ggislg, Ggislb, Ggisls; +double ggidld, ggidlg, ggidlb, ggislg, ggislb, ggisls; +double Igisl, Ggislg, Ggislb, Ggisls; diff --git a/src/spicelib/devices/bsim4/b4noi.c b/src/spicelib/devices/bsim4/b4noi.c index 434d01713..4a0893d43 100644 --- a/src/spicelib/devices/bsim4/b4noi.c +++ b/src/spicelib/devices/bsim4/b4noi.c @@ -37,7 +37,7 @@ BSIM4instance *here; { struct bsim4SizeDependParam *pParam; double cd, esat, DelClm, EffFreq, N0, Nl; -double T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, Ssi; +double T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, Ssi; pParam = here->pParam; cd = fabs(here->BSIM4cd); @@ -89,12 +89,11 @@ double tempInoise; double noizDens[BSIM4NSRCS]; double lnNdens[BSIM4NSRCS]; -double N0, Nl; -double T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13; -double Vds, n, ExpArg, Ssi, Swi; -double tmp, gdpr, gspr, npart_theta, npart_beta, igsquare; +double T0, T1, T2, T5, T10, T11; +double Vds, Ssi, Swi; +double tmp = 0.0, gdpr, gspr, npart_theta = 0.0, npart_beta = 0.0, igsquare; -int error, i; +int i; /* define the names of the noise sources */ static char *BSIM4nNames[BSIM4NSRCS] = diff --git a/src/spicelib/devices/bsim4/b4pzld.c b/src/spicelib/devices/bsim4/b4pzld.c index 7d07f2da1..37514753a 100644 --- a/src/spicelib/devices/bsim4/b4pzld.c +++ b/src/spicelib/devices/bsim4/b4pzld.c @@ -29,7 +29,7 @@ BSIM4instance *here; double gjbd, gjbs, geltd, gcrg, gcrgg, gcrgd, gcrgs, gcrgb; double xcggb, xcgdb, xcgsb, xcgbb, xcbgb, xcbdb, xcbsb, xcbbb; double xcdgb, xcddb, xcdsb, xcdbb, xcsgb, xcsdb, xcssb, xcsbb; -double gds, gbd, gbs, capbd, capbs, FwdSum, RevSum, Gm, Gmbs; +double gds, capbd, capbs, FwdSum, RevSum, Gm, Gmbs; double gstot, gstotd, gstotg, gstots, gstotb, gspr; double gdtot, gdtotd, gdtotg, gdtots, gdtotb, gdpr; double gIstotg, gIstotd, gIstots, gIstotb; @@ -37,17 +37,19 @@ double gIdtotg, gIdtotd, gIdtots, gIdtotb; double gIbtotg, gIbtotd, gIbtots, gIbtotb; double gIgtotg, gIgtotd, gIgtots, gIgtotb; double cgso, cgdo, cgbo; -double xcdbdb, xcsbsb, xcgmgmb, xcgmdb, xcgmsb, xcdgmb, xcsgmb; -double xcgmbb, xcbgmb; -double dxpart, sxpart, xgtg, xgtd, xgts, xgtb, xcqgb, xcqdb, xcqsb, xcqbb; +double xcdbdb = 0.0, xcsbsb = 0.0, xcgmgmb = 0.0, xcgmdb = 0.0; +double xcgmsb = 0.0, xcdgmb = 0.0, xcsgmb = 0.0; +double xcgmbb = 0.0, xcbgmb = 0.0; +double dxpart, sxpart, xgtg, xgtd, xgts, xgtb; +double xcqgb = 0.0, xcqdb = 0.0, xcqsb = 0.0, xcqbb = 0.0; double gbspsp, gbbdp, gbbsp, gbspg, gbspb; double gbspdp, gbdpdp, gbdpg, gbdpb, gbdpsp; double ddxpart_dVd, ddxpart_dVg, ddxpart_dVb, ddxpart_dVs; double dsxpart_dVd, dsxpart_dVg, dsxpart_dVb, dsxpart_dVs; -double T0, T1, CoxWL, qcheq, Cdg, Cdd, Cds, Cdb, Csg, Csd, Css, Csb; +double T0 = 0.0, T1, CoxWL, qcheq, Cdg, Cdd, Cds, Csg, Csd, Css; double ScalingFactor = 1.0e-9; struct bsim4SizeDependParam *pParam; -double ggidld, ggidlg, ggidlb,ggisld, ggislg, ggislb, ggisls; +double ggidld, ggidlg, ggidlb, ggislg, ggislb, ggisls; for (; model != NULL; model = model->BSIM4nextModel) diff --git a/src/spicelib/devices/bsim4/b4set.c b/src/spicelib/devices/bsim4/b4set.c index e15e88214..b4f19079d 100644 --- a/src/spicelib/devices/bsim4/b4set.c +++ b/src/spicelib/devices/bsim4/b4set.c @@ -30,8 +30,11 @@ #define PI 3.141592654 #define Charge_q 1.60219e-19 -int -BSIM4setup(matrix,inModel,ckt,states) +int BSIM4RdseffGeo(double nf, int geo, int rgeo, int minSD, + double Weffcj, double Rsh, double DMCG, double DMCI, + double DMDG, int Type, double *Rtot); + +int BSIM4setup(matrix,inModel,ckt,states) SMPmatrix *matrix; GENmodel *inModel; CKTcircuit *ckt; @@ -41,7 +44,6 @@ BSIM4model *model = (BSIM4model*)inModel; BSIM4instance *here; int error; CKTnode *tmp; -double tmp1, tmp2; int noiseAnalGiven = 0, createNode; /* Criteria for new node creation */ double Rtot, DMCGeff, DMCIeff, DMDGeff; JOB *job; diff --git a/src/spicelib/devices/bsim4/b4temp.c b/src/spicelib/devices/bsim4/b4temp.c index c84334d3f..d112da2c3 100644 --- a/src/spicelib/devices/bsim4/b4temp.c +++ b/src/spicelib/devices/bsim4/b4temp.c @@ -29,6 +29,13 @@ #define EXP_THRESHOLD 34.0 #define Charge_q 1.60219e-19 +int BSIM4PAeffGeo(double nf, int geo, int minSD, double Weffcj, double DMCG, + double DMCI, double DMDG, double *Ps, double *Pd, + double *As, double *Ad); +int BSIM4RdseffGeo(double nf, int geo, int rgeo, int minSD, + double Weffcj, double Rsh, double DMCG, double DMCI, + double DMDG, int Type, double *Rtot); + int BSIM4DioIjthVjmEval(Nvtm, Ijth, Isb, XExpBV, Vjm) double Nvtm, Ijth, Isb, XExpBV; @@ -52,10 +59,10 @@ CKTcircuit *ckt; { BSIM4model *model = (BSIM4model*) inModel; BSIM4instance *here; -struct bsim4SizeDependParam *pSizeDependParamKnot, *pLastKnot, *pParam; +struct bsim4SizeDependParam *pSizeDependParamKnot, *pLastKnot, *pParam = NULL; double tmp, tmp1, tmp2, tmp3, Eg, Eg0, ni; -double T0, T1, T2, T3, T4, T5, T8, T9, Lnew, Wnew; -double delTemp, Temp, TRatio, Inv_L, Inv_W, Inv_LW, Dw, Dl, Vtm0, Tnom; +double T0, T1, T2, T3, T4, T5, T8, T9, Lnew = 0.0, Wnew; +double delTemp, Temp, TRatio, Inv_L, Inv_W, Inv_LW, Vtm0, Tnom; double dumPs, dumPd, dumAs, dumAd, PowWeffWr; double DMCGeff, DMCIeff, DMDGeff; double Nvtms, Nvtmd, SourceSatCurrent, DrainSatCurrent; diff --git a/src/spicelib/devices/cktcrte.c b/src/spicelib/devices/cktcrte.c index 9ce11a073..54047df63 100644 --- a/src/spicelib/devices/cktcrte.c +++ b/src/spicelib/devices/cktcrte.c @@ -13,11 +13,12 @@ Author: 1985 Thomas L. Quarles #include #include "dev.h" +#include "memory.h" int CKTcrtElt(void *ckt, void *inModPtr, void **inInstPtr, IFuid name) { - GENinstance *instPtr = NULL; /* instPtr points to the data struct for per-instance data */ + GENinstance *instPtr[1] = {NULL}; /* instPtr points to the data struct for per-instance data */ GENmodel *modPtr = (GENmodel*)inModPtr; /* modPtr points to the data struct for per-model data */ SPICEdev **DEVices; @@ -31,11 +32,11 @@ CKTcrtElt(void *ckt, void *inModPtr, void **inInstPtr, IFuid name) type = ((GENmodel*)modPtr)->GENmodType; - error = CKTfndDev(ckt, &type, (void**)&instPtr, name, inModPtr, + error = CKTfndDev(ckt, &type, (void**)instPtr, name, inModPtr, (char *)NULL ); if (error == OK) { if (inInstPtr) - *inInstPtr=(void *)instPtr; + *inInstPtr=(void *)instPtr[0]; return E_EXISTS; } else if (error != E_NODEV) return error; @@ -45,20 +46,20 @@ CKTcrtElt(void *ckt, void *inModPtr, void **inInstPtr, IFuid name) printf("In CKTcrtElt, about to tmalloc new model, type = %d. . . \n", type); #endif - instPtr = (GENinstance *) tmalloc(*DEVices[type]->DEVinstSize); - if (instPtr == (GENinstance *)NULL) + instPtr[0] = (GENinstance *) tmalloc(*DEVices[type]->DEVinstSize); + if (instPtr[0] == (GENinstance *)NULL) return E_NOMEM; - instPtr->GENname = name; + instPtr[0]->GENname = name; - instPtr->GENmodPtr = modPtr; + instPtr[0]->GENmodPtr = modPtr; - instPtr->GENnextInstance = modPtr->GENinstances; + instPtr[0]->GENnextInstance = modPtr->GENinstances; - modPtr->GENinstances = instPtr; + modPtr->GENinstances = instPtr[0]; if(inInstPtr != NULL) - *inInstPtr = (void *)instPtr; + *inInstPtr = (void *)instPtr[0]; return OK; } diff --git a/src/spicelib/devices/csw/cswload.c b/src/spicelib/devices/csw/cswload.c index 12e1f8425..76f05d375 100644 --- a/src/spicelib/devices/csw/cswload.c +++ b/src/spicelib/devices/csw/cswload.c @@ -7,6 +7,7 @@ Modified: 2001 Jon Engelbert #include "ngspice.h" #include "cktdefs.h" #include "cswdefs.h" +#include "fteext.h" #include "trandefs.h" #include "sperror.h" #include "suffix.h" diff --git a/src/spicelib/devices/dio/diosetup.c b/src/spicelib/devices/dio/diosetup.c index bbe34b94f..f1f0b0cb3 100644 --- a/src/spicelib/devices/dio/diosetup.c +++ b/src/spicelib/devices/dio/diosetup.c @@ -129,17 +129,17 @@ matrixpointers: here->DIOposPrimeNode = here->DIOposNode; } else if(here->DIOposPrimeNode == 0) { - CKTnode *tmpNode; + CKTnode *tmpNode[1]; IFuid tmpName; error = CKTmkVolt(ckt,&tmp,here->DIOname,"internal"); if(error) return(error); here->DIOposPrimeNode = tmp->number; if (ckt->CKTcopyNodesets) { - if (CKTinst2Node(ckt,here,1,&tmpNode,&tmpName)==OK) { - if (tmpNode->nsGiven) { - tmp->nodeset=tmpNode->nodeset; - tmp->nsGiven=tmpNode->nsGiven; + if (CKTinst2Node(ckt,here,1,(void**)tmpNode,&tmpName)==OK) { + if (tmpNode[0]->nsGiven) { + tmp->nodeset=tmpNode[0]->nodeset; + tmp->nsGiven=tmpNode[0]->nsGiven; } } } diff --git a/src/spicelib/devices/dio/diosload.c b/src/spicelib/devices/dio/diosload.c index 8412894f5..8484f69d2 100644 --- a/src/spicelib/devices/dio/diosload.c +++ b/src/spicelib/devices/dio/diosload.c @@ -39,7 +39,7 @@ DIOsLoad(GENmodel *inModel, CKTcircuit *ckt) double qd; double DcsprDp; double DcdDp; - double DqdDp; + double DqdDp = 0.0; double tag0; double tag1; double Osxp; diff --git a/src/spicelib/devices/hfet1/hfetload.c b/src/spicelib/devices/hfet1/hfetload.c index 692eacc5a..baab30f2c 100644 --- a/src/spicelib/devices/hfet1/hfetload.c +++ b/src/spicelib/devices/hfet1/hfetload.c @@ -37,7 +37,7 @@ int HFETAload(GENmodel *inModel, CKTcircuit *ckt) double capgd; double capgs; double cd; - double cdhat; + double cdhat = 0.0; double cdrain; double cdreq; double ceq; @@ -46,7 +46,7 @@ int HFETAload(GENmodel *inModel, CKTcircuit *ckt) double cg; double cgd=0; double cgs=0; - double cghat; + double cghat = 0.0; double delvds; double delvgd; double delvgs; @@ -554,14 +554,14 @@ static void hfeta(HFETAmodel *model, HFETAinstance *here, CKTcircuit *ckt, double s; double t; double u; - double nsc; - double nsn; + double nsc = 0.0; + double nsn = 0.0; double temp; double etavth; double gch; double gchi; double gchim; - double vsate; + double vsate = 0.0; double vdse; double cg1; double cgc; @@ -572,7 +572,7 @@ static void hfeta(HFETAmodel *model, HFETAinstance *here, CKTcircuit *ckt, double delgchins; double delnsnsm; double delnsmvgt; - double delvgtevgt; + double delvgtevgt = 0.0; double delidvsate; double delvsateisat; double delisatisatm; @@ -580,8 +580,8 @@ static void hfeta(HFETAmodel *model, HFETAinstance *here, CKTcircuit *ckt, double delisatmgchim; double delvsategch; double delidvds; - double delvgtvgs; - double delvsatevgt; + double delvgtvgs = 0.0; + double delvsatevgt = 0.0; vt = CONSTKoverQ*TEMP; etavth = ETA*vt; diff --git a/src/spicelib/devices/hfet1/hfetsetup.c b/src/spicelib/devices/hfet1/hfetsetup.c index d5530fa3a..a79369f54 100644 --- a/src/spicelib/devices/hfet1/hfetsetup.c +++ b/src/spicelib/devices/hfet1/hfetsetup.c @@ -254,13 +254,13 @@ matrixpointers: /* XXX: Applied AlansFixes */ if (ckt->CKTcopyNodesets) { - CKTnode *tmpNode; + CKTnode *tmpNode[1]; IFuid tmpName; - if (CKTinst2Node(ckt,here,3,&tmpNode,&tmpName)==OK) { - if (tmpNode->nsGiven) { - tmp->nodeset=tmpNode->nodeset; - tmp->nsGiven=tmpNode->nsGiven; + if (CKTinst2Node(ckt,here,3,(void**)tmpNode,&tmpName)==OK) { + if (tmpNode[0]->nsGiven) { + tmp->nodeset=tmpNode[0]->nodeset; + tmp->nsGiven=tmpNode[0]->nsGiven; } } } @@ -275,13 +275,13 @@ matrixpointers: here->HFETAdrainPrimeNode = tmp->number; if (ckt->CKTcopyNodesets) { - CKTnode *tmpNode; + CKTnode *tmpNode[1]; IFuid tmpName; - if (CKTinst2Node(ckt,here,1,&tmpNode,&tmpName)==OK) { - if (tmpNode->nsGiven) { - tmp->nodeset=tmpNode->nodeset; - tmp->nsGiven=tmpNode->nsGiven; + if (CKTinst2Node(ckt,here,1,(void**)tmpNode,&tmpName)==OK) { + if (tmpNode[0]->nsGiven) { + tmp->nodeset=tmpNode[0]->nodeset; + tmp->nsGiven=tmpNode[0]->nsGiven; } } } @@ -296,13 +296,13 @@ matrixpointers: here->HFETAgatePrimeNode = tmp->number; if (ckt->CKTcopyNodesets) { - CKTnode *tmpNode; + CKTnode *tmpNode[1]; IFuid tmpName; - if (CKTinst2Node(ckt,here,2,&tmpNode,&tmpName)==OK) { - if (tmpNode->nsGiven) { - tmp->nodeset=tmpNode->nodeset; - tmp->nsGiven=tmpNode->nsGiven; + if (CKTinst2Node(ckt,here,2,(void**)tmpNode,&tmpName)==OK) { + if (tmpNode[0]->nsGiven) { + tmp->nodeset=tmpNode[0]->nodeset; + tmp->nsGiven=tmpNode[0]->nsGiven; } } } @@ -316,13 +316,13 @@ matrixpointers: here->HFETAdrainPrmPrmNode = tmp->number; if (ckt->CKTcopyNodesets) { - CKTnode *tmpNode; + CKTnode *tmpNode[1]; IFuid tmpName; - if (CKTinst2Node(ckt,here,1,&tmpNode,&tmpName)==OK) { - if (tmpNode->nsGiven) { - tmp->nodeset=tmpNode->nodeset; - tmp->nsGiven=tmpNode->nsGiven; + if (CKTinst2Node(ckt,here,1,(void**)tmpNode,&tmpName)==OK) { + if (tmpNode[0]->nsGiven) { + tmp->nodeset=tmpNode[0]->nodeset; + tmp->nsGiven=tmpNode[0]->nsGiven; } } } @@ -337,13 +337,13 @@ matrixpointers: here->HFETAsourcePrmPrmNode = tmp->number; if (ckt->CKTcopyNodesets) { - CKTnode *tmpNode; + CKTnode *tmpNode[1]; IFuid tmpName; - if (CKTinst2Node(ckt,here,3,&tmpNode,&tmpName)==OK) { - if (tmpNode->nsGiven) { - tmp->nodeset=tmpNode->nodeset; - tmp->nsGiven=tmpNode->nsGiven; + if (CKTinst2Node(ckt,here,3,(void**)tmpNode,&tmpName)==OK) { + if (tmpNode[0]->nsGiven) { + tmp->nodeset=tmpNode[0]->nodeset; + tmp->nsGiven=tmpNode[0]->nsGiven; } } } diff --git a/src/spicelib/devices/hfet2/hfet2load.c b/src/spicelib/devices/hfet2/hfet2load.c index c2c9ee709..75eacf451 100644 --- a/src/spicelib/devices/hfet2/hfet2load.c +++ b/src/spicelib/devices/hfet2/hfet2load.c @@ -27,7 +27,7 @@ int HFET2load(GENmodel *inModel, CKTcircuit *ckt) double capgd; double capgs; double cd; - double cdhat; + double cdhat = 0.0; double cdrain; double cdreq; double ceq; @@ -35,7 +35,7 @@ int HFET2load(GENmodel *inModel, CKTcircuit *ckt) double ceqgs; double cg; double cgd; - double cghat; + double cghat = 0.0; double delvds; double delvgd; double delvgs; @@ -353,8 +353,8 @@ static void hfeta2(HFET2model *model, HFET2instance *here, CKTcircuit *ckt, double s; double t; double u; - double nsc; - double nsn; + double nsc = 0.0; + double nsn = 0.0; double temp; double etavth; double gch; diff --git a/src/spicelib/devices/hfet2/hfet2setup.c b/src/spicelib/devices/hfet2/hfet2setup.c index 8a0c0127c..c3df3f71a 100644 --- a/src/spicelib/devices/hfet2/hfet2setup.c +++ b/src/spicelib/devices/hfet2/hfet2setup.c @@ -40,10 +40,12 @@ int HFET2setup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *state if(!model->HFET2epsiGiven) EPSI = 12.244*8.85418e-12; if(!model->HFET2etaGiven) - if(TYPE == NHFET) - ETA = 1.28; - else - ETA = 1.4; + { + if(TYPE == NHFET) + ETA = 1.28; + else + ETA = 1.4; + } if(!model->HFET2eta1Given) ETA1 = 2; if(!model->HFET2eta2Given) @@ -69,10 +71,12 @@ int HFET2setup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *state if(!model->HFET2mcGiven) MC = 3.0; if(!model->HFET2muGiven) - if(TYPE == NHFET) - MU = 0.4; - else - MU = 0.03; + { + if(TYPE == NHFET) + MU = 0.4; + else + MU = 0.03; + } if(!model->HFET2nGiven) N = 5.0; if(!model->HFET2nmaxGiven) @@ -90,10 +94,12 @@ int HFET2setup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *state if(!model->HFET2sigma0Given) SIGMA0 = 0.057; if(!model->HFET2vsGiven) - if(TYPE == NHFET) - VS = 1.5e5; - else - VS = 0.8e5; + { + if(TYPE == NHFET) + VS = 1.5e5; + else + VS = 0.8e5; + } if(!model->HFET2vsigmaGiven) VSIGMA = 0.1; if(!model->HFET2vsigmatGiven) @@ -117,7 +123,7 @@ int HFET2setup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *state for (here = model->HFET2instances; here != NULL; here=here->HFET2nextInstance) { - CKTnode *tmpNode; + CKTnode *tmpNode[1]; IFuid tmpName; if (here->HFET2owner != ARCHme) goto matrixpointers; @@ -139,10 +145,10 @@ matrixpointers: here->HFET2sourcePrimeNode = tmp->number; if (ckt->CKTcopyNodesets) { - if (CKTinst2Node(ckt,here,3,&tmpNode,&tmpName)==OK) { - if (tmpNode->nsGiven) { - tmp->nodeset=tmpNode->nodeset; - tmp->nsGiven=tmpNode->nsGiven; + if (CKTinst2Node(ckt,here,3,(void**)tmpNode,&tmpName)==OK) { + if (tmpNode[0]->nsGiven) { + tmp->nodeset=tmpNode[0]->nodeset; + tmp->nsGiven=tmpNode[0]->nsGiven; } } } @@ -156,10 +162,10 @@ matrixpointers: here->HFET2drainPrimeNode = tmp->number; if (ckt->CKTcopyNodesets) { - if (CKTinst2Node(ckt,here,1,&tmpNode,&tmpName)==OK) { - if (tmpNode->nsGiven) { - tmp->nodeset=tmpNode->nodeset; - tmp->nsGiven=tmpNode->nsGiven; + if (CKTinst2Node(ckt,here,1,(void**)tmpNode,&tmpName)==OK) { + if (tmpNode[0]->nsGiven) { + tmp->nodeset=tmpNode[0]->nodeset; + tmp->nsGiven=tmpNode[0]->nsGiven; } } } diff --git a/src/spicelib/devices/hisim/hsm1eval102.c b/src/spicelib/devices/hisim/hsm1eval102.c index 4a0b4a079..09d0e7ae9 100644 --- a/src/spicelib/devices/hisim/hsm1eval102.c +++ b/src/spicelib/devices/hisim/hsm1eval102.c @@ -123,10 +123,6 @@ double cn_nc55 = 6.36964918866352e-5 ; /* (1509-1040*sqrt(2))/600000 */ double cn_im53 = 2.9693154855770998e-1 ; double cn_im54 = -7.0536542840097616e-2 ; double cn_im55 = 6.1152888951331797e-3 ; -/* 3-degree polynomial approx for ( exp[Chi]-Chi-1 )^{1/2} */ -double cn_ik53 = 2.6864599830664019e-1 ; -double cn_ik54 = -6.1399531828413338e-2 ; -double cn_ik55 = 5.3528499428744690e-3 ; /** initial guess **/ double c_ps0ini_2 = 8.0e-4 ; double c_pslini_1 = 0.3e0 ; @@ -140,7 +136,6 @@ double Vbd_max = 20.0e0 ; double Vbd_min = -10.0e0 ; double epsm10 = 10.0e0 * C_EPS_M ; double small = 1.0e-50 ; -double Vz_dlt = 5.0e-3 ; double Gdsmin = 0.0e0 ; double Gjmin = sIN.gmin ; /* modified by K.M. for SPICE3f5 */ double cclmmdf = 1.0e-1 ; @@ -155,7 +150,7 @@ int flg_ncnv = 0 ; /* Flag for negative conductance */ int flg_rsrd ; /* Flag for bias loop accounting Rs and Rd */ int flg_iprv ; /* Flag for initial guess of Ids */ int flg_pprv ; /* Flag for initial guesses of Ps0 and Pds */ -int flg_noqi ; /* Flag for the cases regarding Qi=Qd=0 */ +int flg_noqi = 0 ; /* Flag for the cases regarding Qi=Qd=0 */ int flg_vbsc = 0 ; /* Flag for Vbs confining */ int flg_vdsc = 0 ; /* Flag for Vds confining */ int flg_vgsc = 0 ; /* Flag for Vgs confining */ @@ -174,21 +169,21 @@ double Vbs , Vds , Vgs ; double Vbs_dVbse = 1.0 , Vbs_dVdse = 0.0 , Vbs_dVgse = 0.0 ; double Vds_dVbse = 0.0 , Vds_dVdse = 1.0 , Vds_dVgse = 0.0 ; double Vgs_dVbse = 0.0 , Vgs_dVdse = 0.0 , Vgs_dVgse = 1.0 ; -double Vgp ; -double Vgp_dVbs , Vgp_dVds , Vgp_dVgs ; +double Vgp = 0.0 ; +double Vgp_dVbs = 0.0 , Vgp_dVds = 0.0 , Vgp_dVgs = 0.0 ; double Vgs_fb ; /* Ps0 : surface potential at the source side */ -double Ps0 ; -double Ps0_dVbs , Ps0_dVds , Ps0_dVgs ; -double Ps0_ini , Ps0_iniA , Ps0_iniB ; +double Ps0 = 0.0; +double Ps0_dVbs = 0.0, Ps0_dVds = 0.0, Ps0_dVgs = 0.0 ; +double Ps0_ini = 0.0 , Ps0_iniA , Ps0_iniB ; /* Psl : surface potential at the drain side */ -double Psl ; -double Psl_dVbs , Psl_dVds , Psl_dVgs ; +double Psl = 0.0 ; +double Psl_dVbs = 0.0 , Psl_dVds = 0.0 , Psl_dVgs = 0.0 ; double Psl_lim ; /* Pds := Psl - Ps0 */ -double Pds ; -double Pds_dVbs , Pds_dVds , Pds_dVgs ; -double Pds_ini ; +double Pds = 0.0 ; +double Pds_dVbs = 0.0 , Pds_dVds = 0.0 , Pds_dVgs = 0.0 ; +double Pds_ini = 0.0; double Pds_max ; /* iteration numbers of Ps0 and Psl equations. */ int lp_s0 , lp_sl ; @@ -204,14 +199,13 @@ double Xilp12 ; double Xilp32 ; double Xil ; /* modified bias and potential for sym.*/ -double Vbsz , Vdsz , Vgsz ; +double Vbsz , Vdsz = 0.0, Vgsz = 0.0; double Vbsz_dVbs , Vbsz_dVds ; -double Vdsz_dVds ; -double Vgsz_dVgs , Vgsz_dVds ; +double Vdsz_dVds = 0.0 ; +double Vgsz_dVgs , Vgsz_dVds = 0.0 ; double Vbs1 , Vbs2 , Vbsd ; double Vbsd_dVbs , Vbsd_dVds ; -double Vzadd , Vzadd_dVds , Vzadd_dA ; -double VzaddA , VzaddA_dVds ; +double Vzadd = 0.0 , Vzadd_dVds = 0.0; double Ps0z , Ps0z_dVbs , Ps0z_dVds , Ps0z_dVgs ; double Pzadd , Pzadd_dVbs , Pzadd_dVds , Pzadd_dVgs ; double Ps0Vbsz , Ps0Vbsz_dVbs , Ps0Vbsz_dVds , Ps0Vbsz_dVgs ; @@ -226,12 +220,12 @@ double Chi_dVbs , Chi_dVds , Chi_dVgs ; /* Rho := beta * ( Psl - Vds ) */ double Rho ; /* threshold voltage */ -double Vth ; +double Vth = 0.0; double Vth0 ; double Vth0_dVbs , Vth0_dVds , Vth0_dVgs ; /* variation of threshold voltage */ -double dVth ; -double dVth_dVbs , dVth_dVds , dVth_dVgs ; +double dVth = 0.0; +double dVth_dVbs = 0.0 , dVth_dVds = 0.0 , dVth_dVgs = 0.0 ; double dVth0 ; double dVth0_dVbs , dVth0_dVds , dVth0_dVgs ; double dVthSC ; @@ -241,28 +235,26 @@ double dVthW_dVbs , dVthW_dVds , dVthW_dVgs ; /* Alpha and related parameters */ double Alpha ; double Alpha_dVbs , Alpha_dVds , Alpha_dVgs ; -double Achi ; +double Achi = 0.0 ; double Achi_dVbs , Achi_dVds , Achi_dVgs ; double VgVt = 0.0 ; double VgVt_dVbs , VgVt_dVds , VgVt_dVgs ; double Delta , Vdsat ; /* Q_B and capacitances */ -double Qb , Qb_dVbs , Qb_dVds , Qb_dVgs ; +double Qb = 0.0 , Qb_dVbs = 0.0 , Qb_dVds = 0.0 , Qb_dVgs = 0.0 ; double Qb_dVbse , Qb_dVdse , Qb_dVgse ; /* Q_I and capacitances */ -double Qi , Qi_dVbs , Qi_dVds , Qi_dVgs ; +double Qi = 0.0 , Qi_dVbs = 0.0 , Qi_dVds = 0.0 , Qi_dVgs = 0.0 ; double Qi_dVbse , Qi_dVdse , Qi_dVgse ; /* Q_D and capacitances */ -double Qd , Qd_dVbs , Qd_dVds , Qd_dVgs ; +double Qd = 0.0 , Qd_dVbs = 0.0 , Qd_dVds = 0.0 , Qd_dVgs = 0.0 ; double Qd_dVbse , Qd_dVdse , Qd_dVgse ; /* channel current */ double Ids ; -double Ids_dVbs , Ids_dVds , Ids_dVgs ; +double Ids_dVbs = 0.0 , Ids_dVds = 0.0 , Ids_dVgs = 0.0 ; double Ids_dVbse , Ids_dVdse , Ids_dVgse ; double Ids0 ; double Ids0_dVbs , Ids0_dVds , Ids0_dVgs ; -/* (for debug) */ -double user1 , user2 , user3 , user4 ; /* constants */ double beta ; double beta2 ; @@ -304,24 +296,16 @@ double exp_Chi , exp_Rho , exp_bVbs , exp_bVbsVds ; double Fs0, Fsl ; double Fs0_dPs0 , Fsl_dPsl ; double dPs0 , dPsl ; -double Qn0 ; +double Qn0 = 0.0 ; double Qn0_dVbs , Qn0_dVds , Qn0_dVgs ; double Qb0 ; -double Qb0_dVbs , Qb0_dVds , Qb0_dVgs ; -double Qn00 ; -double Qn00_dVbs , Qn00_dVds , Qn00_dVgs ; +double Qb0_dVbs , Qb0_dVds , Qb0_dVgs = 0.0 ; +double Qn00 = 0.0 ; +double Qn00_dVbs = 0.0 , Qn00_dVds = 0.0 , Qn00_dVgs = 0.0 ; double Qbnm ; double Qbnm_dVbs , Qbnm_dVds , Qbnm_dVgs ; double DtPds ; double DtPds_dVbs , DtPds_dVds , DtPds_dVgs ; -double Fid2 ; -double Fid2_dVbs , Fid2_dVds , Fid2_dVgs ; -double Fid3 ; -double Fid3_dVbs , Fid3_dVds , Fid3_dVgs ; -double Fid4 ; -double Fid4_dVbs , Fid4_dVds , Fid4_dVgs ; -double Fid5 ; -double Fid5_dVbs , Fid5_dVds , Fid5_dVgs ; double Qbm ; double Qbm_dVbs , Qbm_dVds , Qbm_dVgs ; double Qinm ; @@ -344,7 +328,7 @@ double Fdd_dVbs , Fdd_dVds , Fdd_dVgs ; double Eeff ; double Eeff_dVbs , Eeff_dVds , Eeff_dVgs ; double Rns ; -double Mu ; +double Mu = 0.0; double Mu_dVbs , Mu_dVds , Mu_dVgs ; double Muun , Muun_dVbs , Muun_dVds , Muun_dVgs ; double Ey ; @@ -384,13 +368,10 @@ double Epkf_dVbs , Epkf_dVds , Epkf_dVgs ; /* PART-3 (overlap) */ double yn , yn2 , yn3 ; double yn_dVbs , yn_dVds , yn_dVgs ; -double yned , yned2 ; -double yned_dVbs , yned_dVds , yned_dVgs ; -double Lov , Lov2 , Lov23 ; -double Ndsat , Gjnp ; -double Qgos , Qgos_dVbs , Qgos_dVds , Qgos_dVgs ; +double Lov , Lov2; +double Qgos = 0.0 , Qgos_dVbs = 0.0 , Qgos_dVds = 0.0 , Qgos_dVgs = 0.0 ; double Qgos_dVbse , Qgos_dVdse , Qgos_dVgse ; -double Qgod , Qgod_dVbs , Qgod_dVds , Qgod_dVgs ; +double Qgod = 0.0 , Qgod_dVbs = 0.0 , Qgod_dVds = 0.0 , Qgod_dVgs = 0.0 ; double Qgod_dVbse , Qgod_dVdse , Qgod_dVgse ; double Cggo , Cgdo , Cgso , Cgbo ; /* fringing capacitance */ @@ -408,18 +389,18 @@ double Qbs , Qbd , Capbs , Capbd , Capbse , Capbde ; double czbd , czbdsw , czbdswg , czbs , czbssw , czbsswg ; double arg , sarg ; /* PART-5 (noise) */ -double NFalp , NFtrp , Freq , Cit , Nflic ; +double NFalp , NFtrp , Cit , Nflic ; /* Bias iteration accounting Rs/Rd */ int lp_bs ; double Ids_last ; double vtol_iprv = 2.0e-1 ; double vtol_pprv = 5.0e-2 ; -double Vbsc_dif , Vdsc_dif , Vgsc_dif , sum_vdif ; +double Vbsc_dif = 0.0 , Vdsc_dif = 0.0 , Vgsc_dif = 0.0 , sum_vdif ; double Rs , Rd ; double Fbs , Fds , Fgs ; -double DJ , DJI ; +double DJ , DJI = 0.0 ; double JI11 , JI12 , JI13 , JI21 , JI22 , JI23 , JI31 , JI32 , JI33 ; -double dVbs , dVds , dVgs ; +double dVbs = 0.0 , dVds = 0.0 , dVgs = 0.0 ; double dV_sum ; /* Junction Bias */ double Vbsj , Vbdj ; @@ -427,26 +408,26 @@ double Vbsj , Vbdj ; double Psa ; double Psa_dVbs , Psa_dVds , Psa_dVgs ; /* CLM */ -double Psdl , Psdl_dVbs , Psdl_dVds , Psdl_dVgs ; +double Psdl = 0.0 , Psdl_dVbs = 0.0 , Psdl_dVds = 0.0 , Psdl_dVgs = 0.0 ; double Ed , Ed_dVbs , Ed_dVds , Ed_dVgs ; double Ec , Ec_dVbs , Ec_dVds , Ec_dVgs ; -double Lred , Lred_dVbs , Lred_dVds , Lred_dVgs ; +double Lred = 0.0 , Lred_dVbs , Lred_dVds , Lred_dVgs ; double Wd , Wd_dVbs , Wd_dVds , Wd_dVgs ; double Aclm ; /* Pocket Implant */ double Vthp, Vthp_dVbs, Vthp_dVds, Vthp_dVgs ; double dVthLP,dVthLP_dVbs,dVthLP_dVds,dVthLP_dVgs ; /* Poly-Depletion Effect */ -double dPpg , dPpg_dVds , dPpg_dVgs ; +double dPpg = 0.0 , dPpg_dVds = 0.0 , dPpg_dVgs = 0.0 ; /* Quantum Effect */ -double Tox , Tox_dVbs , Tox_dVds , Tox_dVgs ; +double Tox = 0.0 , Tox_dVbs = 0.0 , Tox_dVds = 0.0 , Tox_dVgs = 0.0 ; double dTox , dTox_dVbs , dTox_dVds , dTox_dVgs ; -double Cox , Cox_dVbs , Cox_dVds , Cox_dVgs ; +double Cox = 0.0 , Cox_dVbs , Cox_dVds , Cox_dVgs ; double Cox_inv , Cox_inv_dVbs , Cox_inv_dVds , Cox_inv_dVgs ; double Vthq, Vthq_dVbs , Vthq_dVds ; /* Igate , Igidl */ double Egp12 , Egp32 ; -double E0 ; +double E0 = 0.0 ; double E1 , E1_dVbs , E1_dVds , E1_dVgs ; double E2 , E2_dVbs , E2_dVds , E2_dVgs ; double Etun , Etun_dVbs , Etun_dVds , Etun_dVgs ; @@ -459,8 +440,8 @@ double Cox0 ; double Lgate ; double rp1 , rp1_dVds ; /* connecting function */ -double FD2 , FD2_dVbs , FD2_dVds , FD2_dVgs ; -double FMD , FMD_dVds ; +double FD2 = 0.0 , FD2_dVbs = 0.0 , FD2_dVds = 0.0 , FD2_dVgs = 0.0 ; +double FMD , FMD_dVds = 0.0 ; /* Phonon scattering */ double Wgate ; double mueph ; @@ -471,12 +452,9 @@ double TY , TY_dVbs , TY_dVds , TY_dVgs ; double T1_dVbs , T1_dVds , T1_dVgs ; double T2_dVbs , T2_dVds , T2_dVgs ; double T3_dVbs , T3_dVds , T3_dVgs ; -double T4_dVbs , T4_dVds , T4_dVgs ; -double T5_dVbs , T5_dVds , T5_dVgs ; -double T6_dVbs , T6_dVds , T6_dVgs ; +double T4_dVbs , T4_dVds; double T7_dVbs , T7_dVds , T7_dVgs ; double T8_dVbs , T8_dVds , T8_dVgs ; -double T9_dVbs , T9_dVds , T9_dVgs ; double T10 , T20 , T21 , T30 , T31 ; /* intrinsic fringing capacitance */ @@ -529,10 +507,10 @@ double Cgdf, Cgdfring ; /*-----------------------------------------------------------* -* Start of the routine. (label) +* Start of the routine. (label) not being used so commenting out *-----------------*/ -start_of_routine: +/*start_of_routine:*/ /*-----------------------------------------------------------* @@ -1958,8 +1936,9 @@ start_of_routine: /*-----------------------------------------------------------* * Start point of Psl (= Ps0 + Pds) calculation. (label) +* not really being used so commenting out *-----------------*/ -start_of_Psl: ; +/*start_of_Psl: ; */ exp_bVbsVds = exp( beta * ( Vbs - Vds ) ) ; @@ -3029,7 +3008,7 @@ end_of_CLM: ; Mu_dVds = Muun_dVds * T5 - Muun / Vmax * T6 * T3 * Em_dVds ; Mu_dVgs = Muun_dVgs * T5 - Muun / Vmax * T6 * T3 * Em_dVgs ; -end_of_mobility : ; + /*end_of_mobility : ;*/ /*-----------------------------------------------------------* @@ -3149,9 +3128,9 @@ end_of_mobility : ; /*-----------------------------------------------------------* -* Bottom of bias loop. (label) +* Bottom of bias loop. (label) not used so commenting out *-----------------*/ -bottom_of_bias_loop : ; +/*bottom_of_bias_loop : ;*/ /*-----------------------------------------------------------* @@ -3367,9 +3346,9 @@ end_of_Isub: ; /*-----------------------------------------------------------* -* End of PART-2. (label) +* End of PART-2. (label) not used so commenting out *-----------------*/ -end_of_part_2: ; +/* end_of_part_2: ; */ /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ @@ -3514,9 +3493,9 @@ end_of_part_2: ; /*-----------------------------------------------------------* -* End of PART-3. (label) +* End of PART-3. (label) not used so commenting out *-----------------*/ -end_of_part_3: ; +/* end_of_part_3: ; */ /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ @@ -3794,9 +3773,9 @@ end_of_part_3: ; /*-----------------------------------------------------------* -* End of PART-4. (label) +* End of PART-4. (label) not used so commenting out *-----------------*/ -end_of_part_4: ; +/* end_of_part_4: ; */ /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ @@ -3819,10 +3798,10 @@ end_of_part_4: ; /*-----------------------------------------------------------* -* End of PART-5. (label) +* End of PART-5. (label) not used so commenting out *-----------------*/ -end_of_part_5: ; +/* end_of_part_5: ; */ /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ @@ -4505,10 +4484,10 @@ end_of_part_5: ; /*-----------------------------------------------------------* -* End of PART-6. (label) +* End of PART-6. (label) not used so commenting out *-----------------*/ -end_of_part_6: ; +/* end_of_part_6: ; */ /*-----------------------------------------------------------* diff --git a/src/spicelib/devices/hisim/hsm1eval112.c b/src/spicelib/devices/hisim/hsm1eval112.c index 49a5da99f..7c011d120 100644 --- a/src/spicelib/devices/hisim/hsm1eval112.c +++ b/src/spicelib/devices/hisim/hsm1eval112.c @@ -123,10 +123,6 @@ double cn_nc55 = 6.36964918866352e-5 ; /* (1509-1040*sqrt(2))/600000 */ double cn_im53 = 2.9693154855770998e-1 ; double cn_im54 = -7.0536542840097616e-2 ; double cn_im55 = 6.1152888951331797e-3 ; -/* 3-degree polynomial approx for ( exp[Chi]-Chi-1 )^{1/2} */ -double cn_ik53 = 2.6864599830664019e-1 ; -double cn_ik54 = -6.1399531828413338e-2 ; -double cn_ik55 = 5.3528499428744690e-3 ; /** initial guess **/ double c_ps0ini_2 = 8.0e-4 ; double c_pslini_1 = 0.3e0 ; @@ -140,7 +136,6 @@ double Vbd_max = 20.0e0 ; double Vbd_min = -10.0e0 ; double epsm10 = 10.0e0 * C_EPS_M ; double small = 1.0e-50 ; -double Vz_dlt = 5.0e-3 ; double Gdsmin = 0.0e0 ; double Gjmin = sIN.gmin ; double cclmmdf = 1.0e-1 ; @@ -156,7 +151,7 @@ int flg_ncnv = 0 ; /* Flag for negative conductance */ int flg_rsrd ; /* Flag for bias loop accounting Rs and Rd */ int flg_iprv ; /* Flag for initial guess of Ids */ int flg_pprv ; /* Flag for initial guesses of Ps0 and Pds */ -int flg_noqi ; /* Flag for the cases regarding Qi=Qd=0 */ +int flg_noqi = 0 ; /* Flag for the cases regarding Qi=Qd=0 */ int flg_vbsc = 0 ; /* Flag for Vbs confining */ int flg_vdsc = 0 ; /* Flag for Vds confining */ int flg_vgsc = 0 ; /* Flag for Vgs confining */ @@ -175,21 +170,21 @@ double Vbs , Vds , Vgs ; double Vbs_dVbse = 1.0 , Vbs_dVdse = 0.0 , Vbs_dVgse = 0.0 ; double Vds_dVbse = 0.0 , Vds_dVdse = 1.0 , Vds_dVgse = 0.0 ; double Vgs_dVbse = 0.0 , Vgs_dVdse = 0.0 , Vgs_dVgse = 1.0 ; -double Vgp ; -double Vgp_dVbs , Vgp_dVds , Vgp_dVgs ; +double Vgp = 0.0 ; +double Vgp_dVbs = 0.0 , Vgp_dVds = 0.0 , Vgp_dVgs = 0.0 ; double Vgs_fb ; /* Ps0 : surface potential at the source side */ -double Ps0 ; -double Ps0_dVbs , Ps0_dVds , Ps0_dVgs ; -double Ps0_ini , Ps0_iniA , Ps0_iniB ; +double Ps0 = 0.0 ; +double Ps0_dVbs = 0.0 , Ps0_dVds = 0.0 , Ps0_dVgs = 0.0 ; +double Ps0_ini = 0.0 , Ps0_iniA , Ps0_iniB ; /* Psl : surface potential at the drain side */ -double Psl ; -double Psl_dVbs , Psl_dVds , Psl_dVgs ; +double Psl = 0.0 ; +double Psl_dVbs = 0.0 , Psl_dVds = 0.0 , Psl_dVgs = 0.0 ; double Psl_lim ; /* Pds := Psl - Ps0 */ -double Pds ; -double Pds_dVbs , Pds_dVds , Pds_dVgs ; -double Pds_ini ; +double Pds = 0.0 ; +double Pds_dVbs = 0.0 , Pds_dVds = 0.0 , Pds_dVgs = 0.0 ; +double Pds_ini = 0.0 ; double Pds_max ; /* iteration numbers of Ps0 and Psl equations. */ int lp_s0 , lp_sl ; @@ -205,14 +200,13 @@ double Xilp12 ; double Xilp32 ; double Xil ; /* modified bias and potential for sym.*/ -double Vbsz , Vdsz , Vgsz ; +double Vbsz , Vdsz = 0.0 , Vgsz = 0.0 ; double Vbsz_dVbs , Vbsz_dVds ; -double Vdsz_dVds ; -double Vgsz_dVgs , Vgsz_dVds ; +double Vdsz_dVds = 0.0 ; +double Vgsz_dVgs , Vgsz_dVds = 0.0 ; double Vbs1 , Vbs2 , Vbsd ; double Vbsd_dVbs , Vbsd_dVds ; -double Vzadd , Vzadd_dVds , Vzadd_dA ; -double VzaddA , VzaddA_dVds ; +double Vzadd = 0.0 , Vzadd_dVds = 0.0; double Ps0z , Ps0z_dVbs , Ps0z_dVds , Ps0z_dVgs ; double Pzadd , Pzadd_dVbs , Pzadd_dVds , Pzadd_dVgs ; double Ps0Vbsz , Ps0Vbsz_dVbs , Ps0Vbsz_dVds , Ps0Vbsz_dVgs ; @@ -227,13 +221,13 @@ double Chi_dVbs , Chi_dVds , Chi_dVgs ; /* Rho := beta * ( Psl - Vds ) */ double Rho ; /* threshold voltage */ -double Vth ; +double Vth = 0.0 ; double Vth_dVbs , Vth_dVds , Vth_dVgs ; double Vth0 ; double Vth0_dVbs , Vth0_dVds , Vth0_dVgs ; /* variation of threshold voltage */ -double dVth ; -double dVth_dVbs , dVth_dVds , dVth_dVgs ; +double dVth = 0.0 ; +double dVth_dVbs = 0.0 , dVth_dVds = 0.0 , dVth_dVgs = 0.0 ; double dVth0 ; double dVth0_dVbs , dVth0_dVds , dVth0_dVgs ; double dVthSC ; @@ -243,30 +237,30 @@ double dVthW_dVbs , dVthW_dVds , dVthW_dVgs ; /* Alpha and related parameters */ double Alpha ; double Alpha_dVbs , Alpha_dVds , Alpha_dVgs ; -double Achi ; +double Achi = 0.0 ; double Achi_dVbs , Achi_dVds , Achi_dVgs ; double VgVt = 0.0 ; double VgVt_dVbs , VgVt_dVds , VgVt_dVgs ; double Delta , Vdsat ; /* Q_B and capacitances */ -double Qb , Qb_dVbs , Qb_dVds , Qb_dVgs ; +double Qb = 0.0 , Qb_dVbs = 0.0 , Qb_dVds = 0.0 , Qb_dVgs = 0.0 ; double Qb_dVbse , Qb_dVdse , Qb_dVgse ; /* Q_I and capacitances */ -double Qi , Qi_dVbs , Qi_dVds , Qi_dVgs ; +double Qi = 0.0 , Qi_dVbs = 0.0 , Qi_dVds = 0.0 , Qi_dVgs = 0.0 ; double Qi_dVbse , Qi_dVdse , Qi_dVgse ; /* Q_D and capacitances */ -double Qd , Qd_dVbs , Qd_dVds , Qd_dVgs ; +double Qd = 0.0 , Qd_dVbs = 0.0 , Qd_dVds = 0.0 , Qd_dVgs = 0.0 ; double Qd_dVbse , Qd_dVdse , Qd_dVgse ; /* channel current */ double Ids ; -double Ids_dVbs , Ids_dVds , Ids_dVgs ; +double Ids_dVbs = 0.0 , Ids_dVds = 0.0 , Ids_dVgs = 0.0 ; double Ids_dVbse , Ids_dVdse , Ids_dVgse ; double Ids0 ; double Ids0_dVbs , Ids0_dVds , Ids0_dVgs ; /* STI */ double Vgssti ; double Vgssti_dVbs , Vgssti_dVds , Vgssti_dVgs ; -double costi0 , costi1 , costi2 , costi3 ; +double costi0 , costi1 , costi3 ; double costi4 , costi5 , costi6 , costi7 ; double Psasti ; double Psasti_dVbs , Psasti_dVds , Psasti_dVgs ; @@ -286,8 +280,6 @@ double Qn0sti ; double Qn0sti_dVbs , Qn0sti_dVds , Qn0sti_dVgs ; double Idssti ; double Idssti_dVbs , Idssti_dVds , Idssti_dVgs ; -/* (for debug) */ -double user1 , user2 , user3 , user4 ; /* constants */ double beta ; double beta2 ; @@ -329,24 +321,16 @@ double exp_Chi , exp_Rho , exp_bVbs , exp_bVbsVds ; double Fs0, Fsl ; double Fs0_dPs0 , Fsl_dPsl ; double dPs0 , dPsl ; -double Qn0 ; +double Qn0 = 0.0 ; double Qn0_dVbs , Qn0_dVds , Qn0_dVgs ; double Qb0 ; -double Qb0_dVbs , Qb0_dVds , Qb0_dVgs ; -double Qn00 ; -double Qn00_dVbs , Qn00_dVds , Qn00_dVgs ; +double Qb0_dVbs , Qb0_dVds , Qb0_dVgs = 0.0 ; +double Qn00 = 0.0 ; +double Qn00_dVbs = 0.0 , Qn00_dVds = 0.0 , Qn00_dVgs = 0.0 ; double Qbnm ; double Qbnm_dVbs , Qbnm_dVds , Qbnm_dVgs ; double DtPds ; double DtPds_dVbs , DtPds_dVds , DtPds_dVgs ; -double Fid2 ; -double Fid2_dVbs , Fid2_dVds , Fid2_dVgs ; -double Fid3 ; -double Fid3_dVbs , Fid3_dVds , Fid3_dVgs ; -double Fid4 ; -double Fid4_dVbs , Fid4_dVds , Fid4_dVgs ; -double Fid5 ; -double Fid5_dVbs , Fid5_dVds , Fid5_dVgs ; double Qbm ; double Qbm_dVbs , Qbm_dVds , Qbm_dVgs ; double Qinm ; @@ -369,7 +353,7 @@ double Fdd_dVbs , Fdd_dVds , Fdd_dVgs ; double Eeff ; double Eeff_dVbs , Eeff_dVds , Eeff_dVgs ; double Rns ; -double Mu ; +double Mu = 0.0 ; double Mu_dVbs , Mu_dVds , Mu_dVgs ; double Muun , Muun_dVbs , Muun_dVds , Muun_dVgs ; double Ey ; @@ -409,13 +393,10 @@ double Epkf_dVbs , Epkf_dVds , Epkf_dVgs ; /* PART-3 (overlap) */ double yn , yn2 , yn3 ; double yn_dVbs , yn_dVds , yn_dVgs ; -double yned , yned2 ; -double yned_dVbs , yned_dVds , yned_dVgs ; -double Lov , Lov2 , Lov23 ; -double Ndsat , Gjnp ; -double Qgos , Qgos_dVbs , Qgos_dVds , Qgos_dVgs ; +double Lov , Lov2 ; +double Qgos = 0.0 , Qgos_dVbs = 0.0 , Qgos_dVds = 0.0 , Qgos_dVgs = 0.0 ; double Qgos_dVbse , Qgos_dVdse , Qgos_dVgse ; -double Qgod , Qgod_dVbs , Qgod_dVds , Qgod_dVgs ; +double Qgod = 0.0 , Qgod_dVbs = 0.0 , Qgod_dVds = 0.0 , Qgod_dVgs = 0.0 ; double Qgod_dVbse , Qgod_dVdse , Qgod_dVgse ; double Cggo , Cgdo , Cgso , Cgbo ; /* fringing capacitance */ @@ -425,7 +406,6 @@ double Qfd , Qfs ; double Pslk , Pslk_dVbs , Pslk_dVds , Pslk_dVgs ; double Qy ; double Cqyd, Cqyg, Cqys, Cqyb ; -double qy_dlt ; /* PART-4 (junction diode) */ double Ibs , Ibd , Gbs , Gbd , Gbse , Gbde ; double js ; @@ -438,18 +418,18 @@ double Qbs , Qbd , Capbs , Capbd , Capbse , Capbde ; double czbd , czbdsw , czbdswg , czbs , czbssw , czbsswg ; double arg , sarg ; /* PART-5 (noise) */ -double NFalp , NFtrp , Freq , Cit , Nflic ; +double NFalp , NFtrp , Cit , Nflic ; /* Bias iteration accounting Rs/Rd */ int lp_bs ; double Ids_last ; double vtol_iprv = 2.0e-1 ; double vtol_pprv = 5.0e-2 ; -double Vbsc_dif , Vdsc_dif , Vgsc_dif , sum_vdif ; +double Vbsc_dif = 0.0 , Vdsc_dif = 0.0 , Vgsc_dif = 0.0 , sum_vdif ; double Rs , Rd ; double Fbs , Fds , Fgs ; -double DJ , DJI ; +double DJ , DJI = 0.0 ; double JI11 , JI12 , JI13 , JI21 , JI22 , JI23 , JI31 , JI32 , JI33 ; -double dVbs , dVds , dVgs ; +double dVbs = 0.0 , dVds = 0.0 , dVgs = 0.0 ; double dV_sum ; /* Junction Bias */ double Vbsj , Vbdj ; @@ -457,26 +437,26 @@ double Vbsj , Vbdj ; double Psa ; double Psa_dVbs , Psa_dVds , Psa_dVgs ; /* CLM */ -double Psdl , Psdl_dVbs , Psdl_dVds , Psdl_dVgs ; +double Psdl = 0.0 , Psdl_dVbs = 0.0 , Psdl_dVds = 0.0 , Psdl_dVgs = 0.0 ; double Ed , Ed_dVbs , Ed_dVds , Ed_dVgs ; -double Ec , Ec_dVbs , Ec_dVds , Ec_dVgs ; -double Lred , Lred_dVbs , Lred_dVds , Lred_dVgs ; +double Ec = 0.0 , Ec_dVbs = 0.0 , Ec_dVds = 0.0 , Ec_dVgs = 0.0 ; +double Lred = 0.0 , Lred_dVbs , Lred_dVds , Lred_dVgs ; double Wd , Wd_dVbs , Wd_dVds , Wd_dVgs ; -double Aclm ; +double Aclm = 0.0; /* Pocket Implant */ double Vthp, Vthp_dVbs, Vthp_dVds, Vthp_dVgs ; double dVthLP,dVthLP_dVbs,dVthLP_dVds,dVthLP_dVgs ; /* Poly-Depletion Effect */ -double dPpg , dPpg_dVds , dPpg_dVgs ; +double dPpg = 0.0 , dPpg_dVds = 0.0 , dPpg_dVgs = 0.0 ; /* Quantum Effect */ -double Tox , Tox_dVbs , Tox_dVds , Tox_dVgs ; +double Tox = 0.0 , Tox_dVbs = 0.0 , Tox_dVds = 0.0 , Tox_dVgs = 0.0 ; double dTox , dTox_dVbs , dTox_dVds , dTox_dVgs ; -double Cox , Cox_dVbs , Cox_dVds , Cox_dVgs ; +double Cox = 0.0 , Cox_dVbs , Cox_dVds , Cox_dVgs ; double Cox_inv , Cox_inv_dVbs , Cox_inv_dVds , Cox_inv_dVgs ; double Vthq, Vthq_dVbs , Vthq_dVds ; /* Igate , Igidl */ double Egp12 , Egp32 ; -double E0 ; +double E0 = 0.0 ; double E1 , E1_dVbs , E1_dVds , E1_dVgs ; double E2 , E2_dVbs , E2_dVds , E2_dVgs ; double Etun , Etun_dVbs , Etun_dVds , Etun_dVgs ; @@ -489,8 +469,8 @@ double Cox0 ; double Lgate ; double rp1 , rp1_dVds ; /* connecting function */ -double FD2 , FD2_dVbs , FD2_dVds , FD2_dVgs ; -double FMD , FMD_dVds ; +double FD2 = 0.0 , FD2_dVbs = 0.0 , FD2_dVds = 0.0 , FD2_dVgs = 0.0 ; +double FMD , FMD_dVds = 0.0 ; /* Phonon scattering */ double Wgate ; double mueph ; @@ -501,12 +481,9 @@ double TY , TY_dVbs , TY_dVds , TY_dVgs ; double T1_dVbs , T1_dVds , T1_dVgs ; double T2_dVbs , T2_dVds , T2_dVgs ; double T3_dVbs , T3_dVds , T3_dVgs ; -double T4_dVbs , T4_dVds , T4_dVgs ; -double T5_dVbs , T5_dVds , T5_dVgs ; -double T6_dVbs , T6_dVds , T6_dVgs ; +double T4_dVbs , T4_dVds ; double T7_dVbs , T7_dVds , T7_dVgs ; double T8_dVbs , T8_dVds , T8_dVgs ; -double T9_dVbs , T9_dVds , T9_dVgs ; double T10 , T20 , T21 , T30 , T31 ; @@ -561,7 +538,7 @@ double T10 , T20 , T21 , T30 , T31 ; * Start of the routine. (label) *-----------------*/ -start_of_routine: +/* start_of_routine: */ /*-----------------------------------------------------------* @@ -2011,7 +1988,7 @@ start_of_routine: * Start point of Psl (= Ps0 + Pds) calculation. (label) *-----------------*/ -start_of_Psl: ; +/* start_of_Psl: ; */ exp_bVbsVds = exp( beta * ( Vbs - Vds ) ) ; @@ -3089,7 +3066,7 @@ end_of_CLM: ; Mu_dVgs = Muun_dVgs * T5 - Muun / Vmax * T6 * T3 * Em_dVgs ; -end_of_mobility : ; +/* end_of_mobility : ; */ /*-----------------------------------------------------------* @@ -3323,7 +3300,7 @@ end_of_mobility : ; * Bottom of bias loop. (label) *-----------------*/ -bottom_of_bias_loop : ; +/* bottom_of_bias_loop : ; */ /*-----------------------------------------------------------* @@ -3545,7 +3522,7 @@ end_of_Isub: ; * End of PART-2. (label) *-----------------*/ -end_of_part_2: ; +/* end_of_part_2: ; */ /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ @@ -3713,7 +3690,7 @@ end_of_part_2: ; * End of PART-3. (label) *-----------------*/ -end_of_part_3: ; +/* end_of_part_3: ; */ /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ @@ -3995,7 +3972,7 @@ end_of_part_3: ; * End of PART-4. (label) *-----------------*/ -end_of_part_4: ; +/* end_of_part_4: ; */ /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ @@ -4022,7 +3999,7 @@ end_of_part_4: ; * End of PART-5. (label) *-----------------*/ -end_of_part_5: ; +/* end_of_part_5: ; */ /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ @@ -4738,7 +4715,7 @@ end_of_part_5: ; * End of PART-6. (label) *-----------------*/ -end_of_part_6: ; +/* end_of_part_6: ; */ /*-----------------------------------------------------------* diff --git a/src/spicelib/devices/hisim/hsm1eval120.c b/src/spicelib/devices/hisim/hsm1eval120.c index fb7387f77..a2caa6014 100644 --- a/src/spicelib/devices/hisim/hsm1eval120.c +++ b/src/spicelib/devices/hisim/hsm1eval120.c @@ -155,10 +155,6 @@ double cn_nc55 = 6.36964918866352e-5 ; /* (1509-1040*sqrt(2))/600000 */ double cn_im53 = 2.9693154855770998e-1 ; double cn_im54 = -7.0536542840097616e-2 ; double cn_im55 = 6.1152888951331797e-3 ; -/* 3-degree polynomial approx for ( exp[Chi]-Chi-1 )^{1/2} */ -double cn_ik53 = 2.6864599830664019e-1 ; -double cn_ik54 = -6.1399531828413338e-2 ; -double cn_ik55 = 5.3528499428744690e-3 ; /** initial guess **/ double c_ps0ini_2 = 8.0e-4 ; double c_pslini_1 = 0.3e0 ; @@ -170,11 +166,9 @@ double Vds_max = 10.5e0 ; double Vgs_max = 10.5e0 ; double Vbd_max = 0.8e0 ; double Vbd_min = -10.5e0 ; -double Vsd_max = 10.5e0 ; double Vgd_max = 10.5e0 ; double epsm10 = 10.0e0 * C_EPS_M ; double small = 1.0e-50 ; -double Vz_dlt = 5.0e-3 ; double Gdsmin = 0.0 ; double Gjmin = sIN.gmin ; double cclmmdf = 1.0e-1 ; @@ -182,7 +176,6 @@ double qme_dlt = 1.0e-9 ; double eef_dlt = 1.0e-2 ; double sti1_dlt = -3.0e-3 ; double sti2_dlt = 2.0e-3 ; -double pol_dlt = 2.0e-1 ; double pol2_dlt = 1.0e-5 ; double pol_tmp = 1.0 ; @@ -192,7 +185,7 @@ int flg_ncnv = 0 ; /* Flag for negative conductance */ int flg_rsrd ; /* Flag for bias loop accounting Rs and Rd */ int flg_iprv ; /* Flag for initial guess of Ids */ int flg_pprv ; /* Flag for initial guesses of Ps0 and Pds */ -int flg_noqi ; /* Flag for the cases regarding Qi=Qd=0 */ +int flg_noqi = 0; /* Flag for the cases regarding Qi=Qd=0 */ int flg_vbsc = 0 ; /* Flag for Vbs confining */ int flg_vdsc = 0 ; /* Flag for Vds confining */ int flg_vgsc = 0 ; /* Flag for Vgs confining */ @@ -216,10 +209,10 @@ int flg_gidsl_d = 0 ; /* Important Variables in HiSIM -------*/ /* external bias */ double Vbse , Vdse , Vgse ; -double Vbde , Vsde , Vgde ; +double Vbde , Vsde = 0.0 , Vgde = 0.0 ; /* confine bias */ -double Vbsc , Vdsc , Vgsc ; -double Vbdc , Vsdc , Vgdc ; +double Vbsc = 0.0 , Vdsc , Vgsc ; +double Vbdc = 0.0 , Vsdc = 0.0 , Vgdc = 0.0; double Vbsc_dVbse = 1.0 ; double Vbdc_dVbde = 1.0 ; /* internal bias */ @@ -227,25 +220,25 @@ double Vbs , Vds , Vgs ; double Vbs_dVbse = 1.0 , Vbs_dVdse = 0.0 , Vbs_dVgse = 0.0 ; double Vds_dVbse = 0.0 , Vds_dVdse = 1.0 , Vds_dVgse = 0.0 ; double Vgs_dVbse = 0.0 , Vgs_dVdse = 0.0 , Vgs_dVgse = 1.0 ; -double Vgp ; -double Vgp_dVbs , Vgp_dVds , Vgp_dVgs ; +double Vgp = 0.0 ; +double Vgp_dVbs = 0.0 , Vgp_dVds = 0.0 , Vgp_dVgs = 0.0 ; double Vgs_fb ; double Vbd , Vsd , Vgd ; double Vbd_dVbde = 1.0 , Vbd_dVsde = 0.0 , Vbd_dVgde = 0.0 ; double Vsd_dVbde = 0.0 , Vsd_dVsde = 1.0 , Vsd_dVgde = 0.0 ; double Vgd_dVbde = 0.0 , Vgd_dVsde = 0.0 , Vgd_dVgde = 1.0 ; /* Ps0 : surface potential at the source side */ -double Ps0 ; -double Ps0_dVbs , Ps0_dVds , Ps0_dVgs ; -double Ps0_ini , Ps0_iniA , Ps0_iniB ; +double Ps0 = 0.0 ; +double Ps0_dVbs = 0.0 , Ps0_dVds = 0.0 , Ps0_dVgs = 0.0 ; +double Ps0_ini = 0.0 , Ps0_iniA , Ps0_iniB ; /* Psl : surface potential at the drain side */ -double Psl ; -double Psl_dVbs , Psl_dVds , Psl_dVgs ; +double Psl = 0.0 ; +double Psl_dVbs = 0.0 , Psl_dVds = 0.0 , Psl_dVgs = 0.0 ; double Psl_lim ; /* Pds := Psl - Ps0 */ double Pds = 0.0 ; double Pds_dVbs = 0.0 , Pds_dVds = 0.0 , Pds_dVgs = 0.0 ; -double Pds_ini ; +double Pds_ini = 0.0 ; double Pds_max ; /* iteration numbers of Ps0 and Psl equations. */ int lp_s0 , lp_sl ; @@ -261,17 +254,14 @@ double Xilp12 ; double Xilp32 ; double Xil ; /* modified bias and potential for sym.*/ -double Vbsz , Vdsz , Vgsz ; +double Vbsz , Vdsz = 0.0 , Vgsz = 0.0 ; double Vbsz_dVbs , Vbsz_dVds ; -double Vdsz_dVds ; -double Vdsz_dVgs = 0.0 ; -double Vdsz_dVbs = 0.0 ; -double Vgsz_dVgs , Vgsz_dVds ; -double Vgsz_dVbs = 0.0 ; +double Vdsz_dVds = 0.0 ; +double Vgsz_dVgs = 0.0 ; double Vbs1 , Vbs2 , Vbsd ; double Vbsd_dVbs , Vbsd_dVds ; -double Vzadd , Vzadd_dVds , Vzadd_dVsd , Vzadd_dA ; -double VzaddA , VzaddA_dVds ; +double Vgsz_dVds = 0.0; +double Vzadd = 0.0 , Vzadd_dVds = 0.0 , Vzadd_dVsd ; double Ps0z , Ps0z_dVbs , Ps0z_dVds , Ps0z_dVgs ; double Pzadd , Pzadd_dVbs , Pzadd_dVds , Pzadd_dVgs ; double Ps0Vbsz , Ps0Vbsz_dVbs , Ps0Vbsz_dVds , Ps0Vbsz_dVgs ; @@ -297,19 +287,19 @@ double Chi_dVbs , Chi_dVds , Chi_dVgs ; /* Rho := beta * ( Psl - Vds ) */ double Rho ; /* threshold voltage */ -double Vth ; -double Vth_dVb , Vth_dVd , Vth_dVs , Vth_dVg ; +double Vth = 0.0 ; +double Vth_dVb , Vth_dVd , Vth_dVg ; double Vth0 ; double Vth0_dVb , Vth0_dVd , Vth0_dVs , Vth0_dVg ; /* variation of threshold voltage */ -double dVth ; -double dVth_dVb , dVth_dVd , dVth_dVg ; +double dVth = 0.0 ; +double dVth_dVb = 0.0 , dVth_dVd = 0.0 , dVth_dVg = 0.0 ; double dVth0 ; double dVth0_dVb , dVth0_dVd , dVth0_dVs , dVth0_dVg ; double dVthSC ; double dVthSC_dVb , dVthSC_dVd , dVthSC_dVs , dVthSC_dVg ; double delta0 = 1.0e-5 ; -double Vgpa , Psi_a , Pb20a , Pb20b , cnst3 ; +double Vgpa , Psi_a , Pb20a , Pb20b , cnst3 = 0.0 ; double Psi_a_dVg, Pb20a_dVg, Pb20b_dVg ; double dVthW ; double dVthW_dVb , dVthW_dVd , dVthW_dVs , dVthW_dVg ; @@ -318,23 +308,23 @@ double dVthP_dVb , dVthP_dVs , dVthP_dVg ; /* Alpha and related parameters */ double Alpha ; double Alpha_dVbs , Alpha_dVds , Alpha_dVgs ; -double Achi ; +double Achi = 0.0 ; double Achi_dVbs , Achi_dVds , Achi_dVgs ; double VgVt = 0.0 ; double VgVt_dVbs , VgVt_dVds , VgVt_dVgs ; double Delta , Vdsat ; /* Q_B and capacitances */ -double Qb , Qb_dVbs , Qb_dVds , Qb_dVgs ; +double Qb = 0.0 , Qb_dVbs = 0.0 , Qb_dVds = 0.0 , Qb_dVgs = 0.0 ; double Qb_dVbse , Qb_dVdse , Qb_dVgse ; /* Q_I and capacitances */ -double Qi , Qi_dVbs , Qi_dVds , Qi_dVgs ; +double Qi = 0.0 , Qi_dVbs = 0.0 , Qi_dVds = 0.0 , Qi_dVgs = 0.0 ; double Qi_dVbse , Qi_dVdse , Qi_dVgse ; /* Q_D and capacitances */ -double Qd , Qd_dVbs , Qd_dVds , Qd_dVgs ; +double Qd = 0.0 , Qd_dVbs = 0.0 , Qd_dVds = 0.0 , Qd_dVgs = 0.0 ; double Qd_dVbse , Qd_dVdse , Qd_dVgse ; /* channel current */ double Ids ; -double Ids_dVbs , Ids_dVds , Ids_dVgs ; +double Ids_dVbs = 0.0 , Ids_dVds = 0.0 , Ids_dVgs = 0.0 ; double Ids_dVbse , Ids_dVdse , Ids_dVgse ; double Ids0 ; double Ids0_dVbs , Ids0_dVds , Ids0_dVgs ; @@ -342,7 +332,7 @@ double Isd_dVbde , Isd_dVsde , Isd_dVgde ; /* STI */ double Vgssti ; double Vgssti_dVbs , Vgssti_dVds , Vgssti_dVgs ; -double costi0 , costi1 , costi2 , costi3 ; +double costi0 , costi1 , costi3 ; double costi4 , costi5 , costi6 , costi7 ; double Psasti ; double Psasti_dVbs , Psasti_dVds , Psasti_dVgs ; @@ -362,8 +352,6 @@ double Qn0sti ; double Qn0sti_dVbs , Qn0sti_dVds , Qn0sti_dVgs ; double Idssti ; double Idssti_dVbs , Idssti_dVds , Idssti_dVgs ; -/* (for debug) */ -double user1 , user2 , user3 , user4 ; /* constants */ double beta ; double beta2 ; @@ -409,21 +397,13 @@ double dPs0 , dPsl ; double Qn0 = 0.0e0 ; double Qn0_dVbs , Qn0_dVds , Qn0_dVgs ; double Qb0 ; -double Qb0_dVb , Qb0_dVd , Qb0_dVs ,Qb0_dVg ; -double Qn00 ; -double Qn00_dVbs , Qn00_dVds , Qn00_dVgs ; +double Qb0_dVb , Qb0_dVd , Qb0_dVs ,Qb0_dVg = 0.0 ; +double Qn00 = 0.0 ; +double Qn00_dVbs = 0.0 , Qn00_dVds = 0.0 , Qn00_dVgs = 0.0 ; double Qbnm ; double Qbnm_dVbs , Qbnm_dVds , Qbnm_dVgs ; double DtPds ; double DtPds_dVbs , DtPds_dVds , DtPds_dVgs ; -double Fid2 ; -double Fid2_dVbs , Fid2_dVds , Fid2_dVgs ; -double Fid3 ; -double Fid3_dVbs , Fid3_dVds , Fid3_dVgs ; -double Fid4 ; -double Fid4_dVbs , Fid4_dVds , Fid4_dVgs ; -double Fid5 ; -double Fid5_dVbs , Fid5_dVds , Fid5_dVgs ; double Qbm ; double Qbm_dVbs , Qbm_dVds , Qbm_dVgs ; double Qinm ; @@ -446,10 +426,10 @@ double Fdd_dVbs , Fdd_dVds , Fdd_dVgs ; double Eeff ; double Eeff_dVbs , Eeff_dVds , Eeff_dVgs ; double Rns ; -double Mu ; +double Mu = 0.0 ; double Mu_dVbs , Mu_dVds , Mu_dVgs ; double Muun , Muun_dVbs , Muun_dVds , Muun_dVgs ; -double Ey ; +double Ey = 0.0 ; double Ey_dVbs , Ey_dVds , Ey_dVgs ; double Em ; double Em_dVbs , Em_dVds , Em_dVgs ; @@ -486,13 +466,10 @@ double Epkf_dVbs , Epkf_dVds , Epkf_dVgs ; /* PART-3 (overlap) */ double yn , yn2 , yn3 ; double yn_dVbs , yn_dVds , yn_dVgs ; -double yned , yned2 ; -double yned_dVbs , yned_dVds , yned_dVgs ; -double Lov , Lov2 , Lov23 ; -double Ndsat , Gjnp ; -double Qgos , Qgos_dVbs , Qgos_dVds , Qgos_dVgs ; +double Lov , Lov2 ; +double Qgos = 0.0 , Qgos_dVbs = 0.0 , Qgos_dVds = 0.0 , Qgos_dVgs = 0.0 ; double Qgos_dVbse , Qgos_dVdse , Qgos_dVgse ; -double Qgod , Qgod_dVbs , Qgod_dVds , Qgod_dVgs ; +double Qgod = 0.0 , Qgod_dVbs = 0.0 , Qgod_dVds = 0.0 , Qgod_dVgs = 0.0 ; double Qgod_dVbse , Qgod_dVdse , Qgod_dVgse ; double Cggo , Cgdo , Cgso , Cgbo ; /* fringing capacitance */ @@ -502,7 +479,6 @@ double Qfd , Qfs ; double Pslk , Pslk_dVbs , Pslk_dVds , Pslk_dVgs ; double Qy ; double Cqyd, Cqyg, Cqys, Cqyb ; -double qy_dlt ; /* PART-4 (junction diode) */ double Ibs , Ibd , Gbs , Gbd , Gbse , Gbde ; double js ; @@ -515,18 +491,18 @@ double Qbs , Qbd , Capbs , Capbd , Capbse , Capbde ; double czbd , czbdsw , czbdswg , czbs , czbssw , czbsswg ; double arg , sarg ; /* PART-5 (noise) */ -double NFalp , NFtrp , Freq , Cit , Nflic ; +double NFalp , NFtrp , Cit , Nflic ; /* Bias iteration accounting Rs/Rd */ int lp_bs ; double Ids_last ; double vtol_iprv = 2.0e-1 ; double vtol_pprv = 5.0e-2 ; -double Vbsc_dif , Vdsc_dif , Vgsc_dif , sum_vdif ; +double Vbsc_dif = 0.0 , Vdsc_dif = 0.0 , Vgsc_dif = 0.0 , sum_vdif ; double Rs , Rd ; double Fbs , Fds , Fgs ; -double DJ , DJI , DJIP ; +double DJ , DJI = 0.0 , DJIP ; double JI11 , JI12 , JI13 , JI21 , JI22 , JI23 , JI31 , JI32 , JI33 ; -double dVbs , dVds , dVgs ; +double dVbs = 0.0 , dVds = 0.0 , dVgs = 0.0 ; double dV_sum ; /* Junction Bias */ double Vbsj , Vbdj ; @@ -534,24 +510,24 @@ double Vbsj , Vbdj ; double Psa ; double Psa_dVbs , Psa_dVds , Psa_dVgs ; /* CLM */ -double Psdl , Psdl_dVbs , Psdl_dVds , Psdl_dVgs ; +double Psdl = 0.0 , Psdl_dVbs = 0.0 , Psdl_dVds = 0.0 , Psdl_dVgs = 0.0 ; double Ed , Ed_dVbs , Ed_dVds , Ed_dVgs ; -double Ec , Ec_dVbs , Ec_dVds , Ec_dVgs ; -double Lred , Lred_dVbs , Lred_dVds , Lred_dVgs ; +double Ec = 0.0 , Ec_dVbs = 0.0 , Ec_dVds = 0.0 , Ec_dVgs = 0.0 ; +double Lred = 0.0 , Lred_dVbs , Lred_dVds , Lred_dVgs ; double Wd , Wd_dVbs , Wd_dVds , Wd_dVgs ; -double Aclm ; +double Aclm = 0.0 ; /* Pocket Implant */ double Vthp, Vthp_dVb, Vthp_dVd, Vthp_dVs, Vthp_dVg ; double dVthLP, dVthLP_dVb, dVthLP_dVd, dVthLP_dVs, dVthLP_dVg ; /* Poly-Depletion Effect */ -double dPpg , dPpg_dVd , dPpg_dVg , dPpg_dVb ; +double dPpg = 0.0 , dPpg_dVd = 0.0 , dPpg_dVg = 0.0 , dPpg_dVb = 0.0 ; double dPpgP , dPpgP_dVs , dPpgP_dVg , dPpgP_dVb ; /* Quantum Effect */ -double Tox , Tox_dVb , Tox_dVd , Tox_dVg ; +double Tox = 0.0 , Tox_dVb = 0.0 , Tox_dVd = 0.0 , Tox_dVg = 0.0 ; double dTox , dTox_dVb , dTox_dVd , dTox_dVs , dTox_dVg ; -double Cox , Cox_dVb , Cox_dVd , Cox_dVg ; +double Cox = 0.0 , Cox_dVb , Cox_dVd , Cox_dVg ; double Cox_inv , Cox_inv_dVb , Cox_inv_dVd , Cox_inv_dVg ; -double Vthq, Vthq_dVb , Vthq_dVd , Vthq_dVs , Vthq_dVg ; +double Vthq, Vthq_dVb , Vthq_dVd , Vthq_dVs ; double ToxP , ToxP_dVb , ToxP_dVs , ToxP_dVg ; double CoxP , CoxP_dVb , CoxP_dVs , CoxP_dVg ; double CoxP_inv , CoxP_inv_dVb , CoxP_inv_dVs , CoxP_inv_dVg ; @@ -573,28 +549,26 @@ double Cox0 ; double Lgate ; double rp1 , rp1_dVds ; /* connecting function */ -double FD2 , FD2_dVbs , FD2_dVds , FD2_dVgs ; +double FD2 = 0.0 , FD2_dVbs = 0.0 , FD2_dVds = 0.0 , FD2_dVgs = 0.0 ; double FMD , FMD_dVds ; /* Phonon scattering */ double Wgate ; double mueph ; /* temporary vars. */ -double T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13 ; +double T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T13 ; double TX , TX_dVbs , TX_dVds , TX_dVgs ; double TY , TY_dVbs , TY_dVds , TY_dVgs ; -double T1_dVb , T1_dVd , T1_dVs ,T1_dVg ; -double T2_dVb , T2_dVd , T2_dVs , T2_dVg ; -double T3_dVb , T3_dVd , T3_dVs , T3_dVg ; -double T4_dVb , T4_dVd , T4_dVs , T4_dVg ; -double T5_dVb , T5_dVd , T5_dVs , T5_dVg ; -double T6_dVb , T6_dVd , T6_dVs , T6_dVg ; +double T1_dVb , T1_dVd , T1_dVg ; +double T2_dVb , T2_dVd , T2_dVg ; +double T3_dVb , T3_dVd , T3_dVg ; +double T4_dVb , T4_dVd , T4_dVs ; +double T5_dVd , T5_dVs , T5_dVg ; double T7_dVb , T7_dVd , T7_dVs , T7_dVg ; double T8_dVb , T8_dVd , T8_dVs , T8_dVg ; -double T9_dVb , T9_dVd , T9_dVs , T9_dVg ; -double T10_dVb , T10_dVd , T10_dVs , T10_dVg ; -double T11_dVb , T11_dVd , T11_dVs , T11_dVg ; -double T12_dVb , T12_dVd , T12_dVs , T12_dVg ; -double T13_dVb , T13_dVd , T13_dVs , T13_dVg ; +double T9_dVd , T9_dVs , T9_dVg ; +double T10_dVd , T10_dVs , T10_dVg ; +double T11_dVd , T11_dVs , T11_dVg ; +double T13_dVd , T13_dVs , T13_dVg ; double T20 , T21 , T30 , T31 ; double c_eox ; @@ -654,7 +628,7 @@ double c_eox ; /*-----------------------------------------------------------* * Start of the routine. (label) *-----------------*/ -start_of_routine: +/* start_of_routine: */ @@ -2251,7 +2225,7 @@ start_of_routine: * Start point of Psl (= Ps0 + Pds) calculation. (label) *-----------------*/ -start_of_Psl: ; +/* start_of_Psl: ; */ exp_bVbsVds = exp( beta * ( Vbs - Vds ) ) ; @@ -3356,7 +3330,7 @@ end_of_CLM: ; Mu_dVds = Muun_dVds * T5 - Muun / Vmax * T6 * T3 * Em_dVds ; Mu_dVgs = Muun_dVgs * T5 - Muun / Vmax * T6 * T3 * Em_dVgs ; -end_of_mobility : ; +/* end_of_mobility : ; */ /*-----------------------------------------------------------* @@ -3594,7 +3568,7 @@ end_of_mobility : ; * Bottom of bias loop. (label) *-----------------*/ -bottom_of_bias_loop : ; +/* bottom_of_bias_loop : ; */ /*-----------------------------------------------------------* @@ -4244,7 +4218,7 @@ end_of_Isub: ; * End of PART-2. (label) *-----------------*/ -end_of_part_2: ; +/* end_of_part_2: ; */ /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ @@ -4412,7 +4386,7 @@ end_of_part_2: ; * End of PART-3. (label) *-----------------*/ -end_of_part_3: ; +/* end_of_part_3: ; */ /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ @@ -4694,7 +4668,7 @@ end_of_part_3: ; * End of PART-4. (label) *-----------------*/ -end_of_part_4: ; +/* end_of_part_4: ; */ /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ @@ -4723,7 +4697,7 @@ end_of_part_4: ; * End of PART-5. (label) *-----------------*/ -end_of_part_5: ; +/* end_of_part_5: ; */ /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ @@ -5539,7 +5513,7 @@ end_of_part_5: ; * End of PART-6. (label) *-----------------*/ -end_of_part_6: ; +/* end_of_part_6: ; */ /*-----------------------------------------------------------* diff --git a/src/spicelib/devices/hisim/hsm1ld.c b/src/spicelib/devices/hisim/hsm1ld.c index 145d36672..61d470d13 100644 --- a/src/spicelib/devices/hisim/hsm1ld.c +++ b/src/spicelib/devices/hisim/hsm1ld.c @@ -143,8 +143,9 @@ int HSM1load(GENmodel *inModel, register CKTcircuit *ckt) HiSIM_input sIN; HiSIM_output sOT; HiSIM_messenger sMS; - double cbhat, cdrain, cdhat, cdreq, cgbhat, cgshat, cgdhat; - double Ibtot, Idtot, Igbtot, Igstot, Igdtot; + double cbhat = 0.0, cdrain, cdhat = 0.0, cdreq; + double cgbhat = 0.0, cgshat = 0.0, cgdhat = 0.0; + double Ibtot = 0.0, Idtot, Igbtot = 0.0, Igstot = 0.0, Igdtot = 0.0; double ceq, ceqbd, ceqbs, ceqqb, ceqqd, ceqqg; double delvbd, delvbs, delvds, delvgd, delvgs; double gcbdb, gcbgb, gcbsb, gcddb, gcdgb, gcdsb; @@ -177,7 +178,7 @@ int HSM1load(GENmodel *inModel, register CKTcircuit *ckt) ? 1 : 0; int showPhysVal; int isConv; - double vds_pre; + double vds_pre = 0.0; double m; /* Parallel multiplier */ diff --git a/src/spicelib/devices/hisim/hsm1noi.c b/src/spicelib/devices/hisim/hsm1noi.c index c1316b20d..8d282e7d2 100644 --- a/src/spicelib/devices/hisim/hsm1noi.c +++ b/src/spicelib/devices/hisim/hsm1noi.c @@ -59,7 +59,7 @@ HSM1noise (int mode, int operation, GENmodel *inModel, CKTcircuit *ckt, double tempInoise; double noizDens[HSM1NSRCS]; double lnNdens[HSM1NSRCS]; - register int error, i; + register int i; /* define the names of the noise sources */ static char * HSM1nNames[HSM1NSRCS] = { diff --git a/src/spicelib/devices/hisim/hsm1set.c b/src/spicelib/devices/hisim/hsm1set.c index 278d853a7..0be2dbcba 100644 --- a/src/spicelib/devices/hisim/hsm1set.c +++ b/src/spicelib/devices/hisim/hsm1set.c @@ -28,7 +28,7 @@ HSM1setup(register SMPmatrix *matrix, register GENmodel *inModel, int error; CKTnode *tmp; - CKTnode *tmpNode; + CKTnode *tmpNode[1]; IFuid tmpName; /* loop through all the HSM1 device models */ @@ -344,10 +344,10 @@ HSM1setup(register SMPmatrix *matrix, register GENmodel *inModel, here->HSM1dNodePrime = tmp->number; if (ckt->CKTcopyNodesets) { - if (CKTinst2Node(ckt,here,1,&tmpNode,&tmpName)==OK) { - if (tmpNode->nsGiven) { - tmp->nodeset=tmpNode->nodeset; - tmp->nsGiven=tmpNode->nsGiven; + if (CKTinst2Node(ckt,here,1,(void**)tmpNode,&tmpName)==OK) { + if (tmpNode[0]->nsGiven) { + tmp->nodeset=tmpNode[0]->nodeset; + tmp->nsGiven=tmpNode[0]->nsGiven; } } } @@ -365,10 +365,10 @@ HSM1setup(register SMPmatrix *matrix, register GENmodel *inModel, here->HSM1sNodePrime = tmp->number; if (ckt->CKTcopyNodesets) { - if (CKTinst2Node(ckt,here,3,&tmpNode,&tmpName)==OK) { - if (tmpNode->nsGiven) { - tmp->nodeset=tmpNode->nodeset; - tmp->nsGiven=tmpNode->nsGiven; + if (CKTinst2Node(ckt,here,3,(void**)tmpNode,&tmpName)==OK) { + if (tmpNode[0]->nsGiven) { + tmp->nodeset=tmpNode[0]->nodeset; + tmp->nsGiven=tmpNode[0]->nsGiven; } } } diff --git a/src/spicelib/devices/jfet/jfetdist.c b/src/spicelib/devices/jfet/jfetdist.c index 204b8fdd5..bb97fc263 100644 --- a/src/spicelib/devices/jfet/jfetdist.c +++ b/src/spicelib/devices/jfet/jfetdist.c @@ -33,7 +33,7 @@ JFETdisto(int mode, GENmodel *genmodel, CKTcircuit *ckt) JFETinstance *here; if (mode == D_SETUP) - return(JFETdSetup(model,ckt)); + return(JFETdSetup(genmodel,ckt)); /* another hack from similar structures */ if ((mode == D_TWOF1) || (mode == D_THRF1) || (mode == D_F1PF2) || (mode == D_F1MF2) || diff --git a/src/spicelib/devices/jfet/jfetload.c b/src/spicelib/devices/jfet/jfetload.c index 641f5822e..baa07dd29 100644 --- a/src/spicelib/devices/jfet/jfetload.c +++ b/src/spicelib/devices/jfet/jfetload.c @@ -29,7 +29,7 @@ JFETload(GENmodel *inModel, CKTcircuit *ckt) double capgd; double capgs; double cd; - double cdhat; + double cdhat = 0.0; double cdrain; double cdreq; double ceq; @@ -37,7 +37,7 @@ JFETload(GENmodel *inModel, CKTcircuit *ckt) double ceqgs; double cg; double cgd; - double cghat; + double cghat = 0.0; double csat; double czgd; double czgdf2; diff --git a/src/spicelib/devices/jfet/jfetset.c b/src/spicelib/devices/jfet/jfetset.c index f9375c32f..00c951b09 100644 --- a/src/spicelib/devices/jfet/jfetset.c +++ b/src/spicelib/devices/jfet/jfetset.c @@ -107,13 +107,13 @@ matrixpointers: here->JFETsourcePrimeNode = tmp->number; if (ckt->CKTcopyNodesets) { - CKTnode *tmpNode; + CKTnode *tmpNode[1]; IFuid tmpName; - if (CKTinst2Node(ckt,here,3,&tmpNode,&tmpName)==OK) { - if (tmpNode->nsGiven) { - tmp->nodeset=tmpNode->nodeset; - tmp->nsGiven=tmpNode->nsGiven; + if (CKTinst2Node(ckt,here,3,(void**)tmpNode,&tmpName)==OK) { + if (tmpNode[0]->nsGiven) { + tmp->nodeset=tmpNode[0]->nodeset; + tmp->nsGiven=tmpNode[0]->nsGiven; } } } @@ -127,13 +127,13 @@ matrixpointers: here->JFETdrainPrimeNode = tmp->number; if (ckt->CKTcopyNodesets) { - CKTnode *tmpNode; + CKTnode *tmpNode[1]; IFuid tmpName; - if (CKTinst2Node(ckt,here,1,&tmpNode,&tmpName)==OK) { - if (tmpNode->nsGiven) { - tmp->nodeset=tmpNode->nodeset; - tmp->nsGiven=tmpNode->nsGiven; + if (CKTinst2Node(ckt,here,1,(void**)tmpNode,&tmpName)==OK) { + if (tmpNode[0]->nsGiven) { + tmp->nodeset=tmpNode[0]->nodeset; + tmp->nsGiven=tmpNode[0]->nsGiven; } } } diff --git a/src/spicelib/devices/jfet2/jfet2load.c b/src/spicelib/devices/jfet2/jfet2load.c index cffbd4629..090e16d7b 100644 --- a/src/spicelib/devices/jfet2/jfet2load.c +++ b/src/spicelib/devices/jfet2/jfet2load.c @@ -29,14 +29,14 @@ JFET2load(GENmodel *inModel, CKTcircuit *ckt) double capgd; double capgs; double cd; - double cdhat; + double cdhat = 0.0; double cdreq; double ceq; double ceqgd; double ceqgs; double cg; double cgd; - double cghat; + double cghat = 0.0; double delvds; double delvgd; double delvgs; diff --git a/src/spicelib/devices/jfet2/jfet2set.c b/src/spicelib/devices/jfet2/jfet2set.c index ba096efb2..171bea909 100644 --- a/src/spicelib/devices/jfet2/jfet2set.c +++ b/src/spicelib/devices/jfet2/jfet2set.c @@ -60,13 +60,13 @@ matrixpointers2: here->JFET2sourcePrimeNode = tmp->number; if (ckt->CKTcopyNodesets) { - CKTnode *tmpNode; + CKTnode *tmpNode[1]; IFuid tmpName; - if (CKTinst2Node(ckt,here,3,&tmpNode,&tmpName)==OK) { - if (tmpNode->nsGiven) { - tmp->nodeset=tmpNode->nodeset; - tmp->nsGiven=tmpNode->nsGiven; + if (CKTinst2Node(ckt,here,3,(void**)tmpNode,&tmpName)==OK) { + if (tmpNode[0]->nsGiven) { + tmp->nodeset=tmpNode[0]->nodeset; + tmp->nsGiven=tmpNode[0]->nsGiven; } } } @@ -80,13 +80,13 @@ matrixpointers2: here->JFET2drainPrimeNode = tmp->number; if (ckt->CKTcopyNodesets) { - CKTnode *tmpNode; + CKTnode *tmpNode[1]; IFuid tmpName; - if (CKTinst2Node(ckt,here,1,&tmpNode,&tmpName)==OK) { - if (tmpNode->nsGiven) { - tmp->nodeset=tmpNode->nodeset; - tmp->nsGiven=tmpNode->nsGiven; + if (CKTinst2Node(ckt,here,1,(void**)tmpNode,&tmpName)==OK) { + if (tmpNode[0]->nsGiven) { + tmp->nodeset=tmpNode[0]->nodeset; + tmp->nsGiven=tmpNode[0]->nsGiven; } } } diff --git a/src/spicelib/devices/ltra/ltraload.c b/src/spicelib/devices/ltra/ltraload.c index 3a8ad7540..3643490ff 100644 --- a/src/spicelib/devices/ltra/ltraload.c +++ b/src/spicelib/devices/ltra/ltraload.c @@ -22,12 +22,12 @@ LTRAload(GENmodel *inModel, CKTcircuit *ckt) double t1, t2, t3; double qf1, qf2, qf3; double lf2, lf3; - double v1d, v2d, i1d, i2d; + double v1d = 0.0, v2d = 0.0, i1d = 0.0, i2d = 0.0; double dummy1, dummy2; - int isaved; - unsigned tdover; + int isaved = 0; + unsigned tdover = 0; int i; - double max, min; + double max = 0.0, min = 0.0; /* loop through all the transmission line models */ for (; model != NULL; model = model->LTRAnextModel) { diff --git a/src/spicelib/devices/ltra/ltramisc.c b/src/spicelib/devices/ltra/ltramisc.c index c63aa4535..262ae7e78 100644 --- a/src/spicelib/devices/ltra/ltramisc.c +++ b/src/spicelib/devices/ltra/ltramisc.c @@ -600,21 +600,21 @@ LTRArlcCoeffsSetup(h1dashfirstcoeff, h2firstcoeff, h3dashfirstcoeff, h1dashcoeff int listsize, timeindex, *auxindexptr; { unsigned exact; - double lolimit1, lolimit2, hilimit1, hilimit2; + double lolimit1, lolimit2 = 0.0, hilimit1, hilimit2 = 0.0; double delta1, delta2; double h1dummy1, h1dummy2; double h1lovalue1, h1lovalue2, h1hivalue1, h1hivalue2; - double h2dummy1, h2dummy2; - double h2lovalue1, h2lovalue2, h2hivalue1, h2hivalue2; + double h2dummy1 = 0.0, h2dummy2; + double h2lovalue1 = 0.0, h2lovalue2, h2hivalue1 = 0.0, h2hivalue2; - double h3dummy1, h3dummy2; - double h3lovalue1, h3lovalue2, h3hivalue1, h3hivalue2; + double h3dummy1 = 0.0, h3dummy2; + double h3lovalue1 = 0.0, h3lovalue2, h3hivalue1 = 0.0, h3hivalue2; - double exparg, besselarg, expterm, bessi1overxterm, bessi0term; - double expbetaTterm, alphasqTterm; - double h1relval, h2relval, h3relval; + double exparg, besselarg = 0.0, expterm, bessi1overxterm, bessi0term; + double expbetaTterm = 0.0, alphasqTterm = 0.0; + double h1relval, h2relval = 0.0, h3relval = 0.0; int doh1 = 1, doh2 = 1, doh3 = 1; int i, auxindex; @@ -863,13 +863,13 @@ LTRAlteCalculate(ckt, genmodel, geninstance, curtime) LTRAmodel *model = (LTRAmodel *) genmodel; LTRAinstance *instance = (LTRAinstance *) geninstance; double h1dashTfirstCoeff; - double h2TfirstCoeff; - double h3dashTfirstCoeff; + double h2TfirstCoeff = 0.0; + double h3dashTfirstCoeff = 0.0; double dashdash; double oof; double hilimit1, lolimit1, hivalue1, lovalue1, f1i, g1i; double eq1LTE = 0.0, eq2LTE = 0.0; - int auxindex, tdover, i, exact; + int auxindex = 0, tdover, i, exact; switch (model->LTRAspecialCase) { diff --git a/src/spicelib/devices/mes/mesdisto.c b/src/spicelib/devices/mes/mesdisto.c index 10862ac4a..ddaff5597 100644 --- a/src/spicelib/devices/mes/mesdisto.c +++ b/src/spicelib/devices/mes/mesdisto.c @@ -33,7 +33,7 @@ MESdisto(int mode,GENmodel *genmodel, CKTcircuit *ckt) MESinstance *here; if (mode == D_SETUP) - return(MESdSetup(model,ckt)); + return(MESdSetup(genmodel,ckt)); /* AFN: Oh what a wonderful thing!!! */ if ((mode == D_TWOF1) || (mode == D_THRF1) || (mode == D_F1PF2) || (mode == D_F1MF2) || diff --git a/src/spicelib/devices/mes/mesload.c b/src/spicelib/devices/mes/mesload.c index 5ee3b0172..d35f2a395 100644 --- a/src/spicelib/devices/mes/mesload.c +++ b/src/spicelib/devices/mes/mesload.c @@ -32,7 +32,7 @@ MESload(GENmodel *inModel, CKTcircuit *ckt) double capgd; double capgs; double cd; - double cdhat; + double cdhat = 0.0; double cdrain; double cdreq; double ceq; @@ -41,7 +41,7 @@ MESload(GENmodel *inModel, CKTcircuit *ckt) double cg; double cgd; double cgdna,cgdnb,cgdnc,cgdnd; - double cghat; + double cghat = 0.0; double cgsna,cgsnb,cgsnc,cgsnd; double csat; double czgd; diff --git a/src/spicelib/devices/mes/messetup.c b/src/spicelib/devices/mes/messetup.c index ed63af719..e755e8680 100644 --- a/src/spicelib/devices/mes/messetup.c +++ b/src/spicelib/devices/mes/messetup.c @@ -93,13 +93,13 @@ matrixpointers: here->MESsourcePrimeNode = tmp->number; if (ckt->CKTcopyNodesets) { - CKTnode *tmpNode; + CKTnode *tmpNode[1]; IFuid tmpName; - if (CKTinst2Node(ckt,here,3,&tmpNode,&tmpName)==OK) { - if (tmpNode->nsGiven) { - tmp->nodeset=tmpNode->nodeset; - tmp->nsGiven=tmpNode->nsGiven; + if (CKTinst2Node(ckt,here,3,(void**)tmpNode,&tmpName)==OK) { + if (tmpNode[0]->nsGiven) { + tmp->nodeset=tmpNode[0]->nodeset; + tmp->nsGiven=tmpNode[0]->nsGiven; } } } @@ -113,13 +113,13 @@ matrixpointers: here->MESdrainPrimeNode = tmp->number; if (ckt->CKTcopyNodesets) { - CKTnode *tmpNode; + CKTnode *tmpNode[1]; IFuid tmpName; - if (CKTinst2Node(ckt,here,1,&tmpNode,&tmpName)==OK) { - if (tmpNode->nsGiven) { - tmp->nodeset=tmpNode->nodeset; - tmp->nsGiven=tmpNode->nsGiven; + if (CKTinst2Node(ckt,here,1,(void**)tmpNode,&tmpName)==OK) { + if (tmpNode[0]->nsGiven) { + tmp->nodeset=tmpNode[0]->nodeset; + tmp->nsGiven=tmpNode[0]->nsGiven; } } } diff --git a/src/spicelib/devices/mesa/mesaload.c b/src/spicelib/devices/mesa/mesaload.c index 72f5a749f..c9b23478c 100644 --- a/src/spicelib/devices/mesa/mesaload.c +++ b/src/spicelib/devices/mesa/mesaload.c @@ -41,7 +41,7 @@ MESAload(GENmodel *inModel, CKTcircuit *ckt) double capgd; double capgs; double cd; - double cdhat; + double cdhat = 0.0; double cdrain; double cdreq; double ceq; @@ -50,7 +50,7 @@ MESAload(GENmodel *inModel, CKTcircuit *ckt) double cg; double cgd; double cgs; - double cghat; + double cghat = 0.0; double arg; double earg; double delvds; diff --git a/src/spicelib/devices/mesa/mesasetup.c b/src/spicelib/devices/mesa/mesasetup.c index dfc0e628e..a46d58e7c 100644 --- a/src/spicelib/devices/mesa/mesasetup.c +++ b/src/spicelib/devices/mesa/mesasetup.c @@ -244,13 +244,13 @@ matrixpointers: here->MESAsourcePrimeNode = tmp->number; if (ckt->CKTcopyNodesets) { - CKTnode *tmpNode; + CKTnode *tmpNode[1]; IFuid tmpName; - if (CKTinst2Node(ckt,here,3,&tmpNode,&tmpName)==OK) { - if (tmpNode->nsGiven) { - tmp->nodeset=tmpNode->nodeset; - tmp->nsGiven=tmpNode->nsGiven; + if (CKTinst2Node(ckt,here,3,(void**)tmpNode,&tmpName)==OK) { + if (tmpNode[0]->nsGiven) { + tmp->nodeset=tmpNode[0]->nodeset; + tmp->nsGiven=tmpNode[0]->nsGiven; } } } @@ -265,13 +265,13 @@ matrixpointers: here->MESAdrainPrimeNode = tmp->number; if (ckt->CKTcopyNodesets) { - CKTnode *tmpNode; + CKTnode *tmpNode[1]; IFuid tmpName; - if (CKTinst2Node(ckt,here,1,&tmpNode,&tmpName)==OK) { - if (tmpNode->nsGiven) { - tmp->nodeset=tmpNode->nodeset; - tmp->nsGiven=tmpNode->nsGiven; + if (CKTinst2Node(ckt,here,1,(void**)tmpNode,&tmpName)==OK) { + if (tmpNode[0]->nsGiven) { + tmp->nodeset=tmpNode[0]->nodeset; + tmp->nsGiven=tmpNode[0]->nsGiven; } } } @@ -285,13 +285,13 @@ matrixpointers: here->MESAgatePrimeNode = tmp->number; if (ckt->CKTcopyNodesets) { - CKTnode *tmpNode; + CKTnode *tmpNode[1]; IFuid tmpName; - if (CKTinst2Node(ckt,here,2,&tmpNode,&tmpName)==OK) { - if (tmpNode->nsGiven) { - tmp->nodeset=tmpNode->nodeset; - tmp->nsGiven=tmpNode->nsGiven; + if (CKTinst2Node(ckt,here,2,(void**)tmpNode,&tmpName)==OK) { + if (tmpNode[0]->nsGiven) { + tmp->nodeset=tmpNode[0]->nodeset; + tmp->nsGiven=tmpNode[0]->nsGiven; } } } @@ -308,13 +308,13 @@ matrixpointers: here->MESAsourcePrmPrmNode = tmp->number; if (ckt->CKTcopyNodesets) { - CKTnode *tmpNode; + CKTnode *tmpNode[1]; IFuid tmpName; - if (CKTinst2Node(ckt,here,3,&tmpNode,&tmpName)==OK) { - if (tmpNode->nsGiven) { - tmp->nodeset=tmpNode->nodeset; - tmp->nsGiven=tmpNode->nsGiven; + if (CKTinst2Node(ckt,here,3,(void**)tmpNode,&tmpName)==OK) { + if (tmpNode[0]->nsGiven) { + tmp->nodeset=tmpNode[0]->nodeset; + tmp->nsGiven=tmpNode[0]->nsGiven; } } } @@ -328,13 +328,13 @@ matrixpointers: here->MESAdrainPrmPrmNode = tmp->number; if (ckt->CKTcopyNodesets) { - CKTnode *tmpNode; + CKTnode *tmpNode[1]; IFuid tmpName; - if (CKTinst2Node(ckt,here,1,&tmpNode,&tmpName)==OK) { - if (tmpNode->nsGiven) { - tmp->nodeset=tmpNode->nodeset; - tmp->nsGiven=tmpNode->nsGiven; + if (CKTinst2Node(ckt,here,1,(void**)tmpNode,&tmpName)==OK) { + if (tmpNode[0]->nsGiven) { + tmp->nodeset=tmpNode[0]->nodeset; + tmp->nsGiven=tmpNode[0]->nsGiven; } } } diff --git a/src/spicelib/devices/mos1/mos1dist.c b/src/spicelib/devices/mos1/mos1dist.c index a2f6d3267..e717d45eb 100644 --- a/src/spicelib/devices/mos1/mos1dist.c +++ b/src/spicelib/devices/mos1/mos1dist.c @@ -39,7 +39,7 @@ MOS1disto(int mode, GENmodel *genmodel, CKTcircuit *ckt) MOS1instance *here; if (mode == D_SETUP) - return(MOS1dSetup(model,ckt)); + return(MOS1dSetup(genmodel,ckt)); if ((mode == D_TWOF1) || (mode == D_THRF1) || (mode == D_F1PF2) || (mode == D_F1MF2) || diff --git a/src/spicelib/devices/mos1/mos1dset.c b/src/spicelib/devices/mos1/mos1dset.c index a3b76f25e..1aa139e4d 100644 --- a/src/spicelib/devices/mos1/mos1dset.c +++ b/src/spicelib/devices/mos1/mos1dset.c @@ -76,7 +76,7 @@ MOS1dSetup(GENmodel *inModel, CKTcircuit *ckt) double lcapbs3; double lcapbd2; double lcapbd3; - double gmbds; + double gmbds = 0.0; /* loop through all the MOS1 device models */ diff --git a/src/spicelib/devices/mos1/mos1load.c b/src/spicelib/devices/mos1/mos1load.c index 1799fe75d..b1e6fb121 100644 --- a/src/spicelib/devices/mos1/mos1load.c +++ b/src/spicelib/devices/mos1/mos1load.c @@ -66,12 +66,12 @@ MOS1load(GENmodel *inModel, CKTcircuit *ckt) double vgs; double von; double vt; - double xfact; + double xfact = 0.0; int xnrm; int xrev; - double capgs; /* total gate-source capacitance */ - double capgd; /* total gate-drain capacitance */ - double capgb; /* total gate-bulk capacitance */ + double capgs = 0.0; /* total gate-source capacitance */ + double capgd = 0.0; /* total gate-drain capacitance */ + double capgb = 0.0; /* total gate-bulk capacitance */ int Check; #ifndef NOBYPASS double tempv; diff --git a/src/spicelib/devices/mos1/mos1sacl.c b/src/spicelib/devices/mos1/mos1sacl.c index 43dc25c64..fb987c006 100644 --- a/src/spicelib/devices/mos1/mos1sacl.c +++ b/src/spicelib/devices/mos1/mos1sacl.c @@ -25,7 +25,7 @@ MOS1sAcLoad(GENmodel *inModel, CKTcircuit *ckt) int xnrm; int xrev; double A0; - double Apert; + double Apert = 0.0; double DELA; double DELAinv; double gdpr0; @@ -110,7 +110,7 @@ MOS1sAcLoad(GENmodel *inModel, CKTcircuit *ckt) double icdprm; double icg; double icb; - double DvDp; + double DvDp = 0.0; int i; int flag; int error; diff --git a/src/spicelib/devices/mos1/mos1set.c b/src/spicelib/devices/mos1/mos1set.c index 01bfd3cbc..7d8d1f2df 100644 --- a/src/spicelib/devices/mos1/mos1set.c +++ b/src/spicelib/devices/mos1/mos1set.c @@ -138,13 +138,13 @@ MOS1setup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, here->MOS1dNodePrime = tmp->number; if (ckt->CKTcopyNodesets) { - CKTnode *tmpNode; + CKTnode *tmpNode[1]; IFuid tmpName; - if (CKTinst2Node(ckt,here,1,&tmpNode,&tmpName)==OK) { - if (tmpNode->nsGiven) { - tmp->nodeset=tmpNode->nodeset; - tmp->nsGiven=tmpNode->nsGiven; + if (CKTinst2Node(ckt,here,1,(void**)tmpNode,&tmpName)==OK) { + if (tmpNode[0]->nsGiven) { + tmp->nodeset=tmpNode[0]->nodeset; + tmp->nsGiven=tmpNode[0]->nsGiven; } } } @@ -162,13 +162,13 @@ MOS1setup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, here->MOS1sNodePrime = tmp->number; if (ckt->CKTcopyNodesets) { - CKTnode *tmpNode; + CKTnode *tmpNode[1]; IFuid tmpName; - if (CKTinst2Node(ckt,here,3,&tmpNode,&tmpName)==OK) { - if (tmpNode->nsGiven) { - tmp->nodeset=tmpNode->nodeset; - tmp->nsGiven=tmpNode->nsGiven; + if (CKTinst2Node(ckt,here,3,(void**)tmpNode,&tmpName)==OK) { + if (tmpNode[0]->nsGiven) { + tmp->nodeset=tmpNode[0]->nodeset; + tmp->nsGiven=tmpNode[0]->nsGiven; } } } diff --git a/src/spicelib/devices/mos2/mos2dist.c b/src/spicelib/devices/mos2/mos2dist.c index 3a9318d2d..fa9fc5ba9 100644 --- a/src/spicelib/devices/mos2/mos2dist.c +++ b/src/spicelib/devices/mos2/mos2dist.c @@ -38,7 +38,7 @@ MOS2disto(int mode,GENmodel *genmodel, CKTcircuit *ckt) MOS2instance *here; if (mode == D_SETUP) - return(MOS2dSetup(model,ckt)); + return(MOS2dSetup(genmodel,ckt)); if ((mode == D_TWOF1) || (mode == D_THRF1) || (mode == D_F1PF2) || (mode == D_F1MF2) || diff --git a/src/spicelib/devices/mos2/mos2dset.c b/src/spicelib/devices/mos2/mos2dset.c index 50ed72ea5..a3034779e 100644 --- a/src/spicelib/devices/mos2/mos2dset.c +++ b/src/spicelib/devices/mos2/mos2dset.c @@ -177,14 +177,14 @@ double gmbds; double sarg; double a4[4],b4[4],x4[8],poly4[8]; double beta1; - double sphi; /* square root of phi */ - double sphi3; /* square root of phi cubed */ + double sphi = 0.0; /* square root of phi */ + double sphi3 = 0.0; /* square root of phi cubed */ double barg; double factor; double eta; double vbin; - double argd; - double args; + double argd = 0.0; + double args = 0.0; double argss; double argsd; double argxs; @@ -196,7 +196,7 @@ double gmbds; double cfs; double cdonco; double xn; - double argg; + double argg = 0.0; double sarg3; double sbiarg; double body; @@ -231,7 +231,7 @@ double gmbds; double xv; double y3; double delta4; - double xvalid; + double xvalid = 0.0; double bsarg; double bodys; double sargv; @@ -282,7 +282,7 @@ double gmbds; Dderivs d_von, d_dummy, d_vgsx, d_arg, d_dumarg; Dderivs d_ueff, d_beta1, d_clfact, d_xlamda,d_mos2gds; Dderivs d_vdson, d_cdson, d_expg; - double dsrgdb, dbrgdb, dbxwd, dbxws, dbargs, dbargd; + double dsrgdb, dbrgdb, dbxwd, dbxws, dbargs = 0.0, dbargd = 0.0; double dgddvb; diff --git a/src/spicelib/devices/mos2/mos2load.c b/src/spicelib/devices/mos2/mos2load.c index fe72cd762..67c1d3f4a 100644 --- a/src/spicelib/devices/mos2/mos2load.c +++ b/src/spicelib/devices/mos2/mos2load.c @@ -39,7 +39,7 @@ MOS2load(GENmodel *inModel, CKTcircuit *ckt) double arg; double cbhat; double cdhat; - double cdrain; + double cdrain = 0.0; double cdreq; double ceq; double ceqbd; @@ -73,10 +73,10 @@ MOS2load(GENmodel *inModel, CKTcircuit *ckt) double vgs; double von; double vt; /* K * T / Q */ - double xfact; - double capgs; /* total gate-source capacitance */ - double capgd; /* total gate-drain capacitance */ - double capgb; /* total gate-bulk capacitance */ + double xfact = 0.0; + double capgs = 0.0; /* total gate-source capacitance */ + double capgd = 0.0; /* total gate-drain capacitance */ + double capgb = 0.0; /* total gate-bulk capacitance */ int xnrm; int xrev; int Check; @@ -436,20 +436,20 @@ next1: if(vbs <= -3*vt) { double beta1; double dsrgdb; double d2sdb2; - double sphi; /* square root of phi */ - double sphi3; /* square root of phi cubed */ + double sphi = 0.0; /* square root of phi */ + double sphi3 = 0.0; /* square root of phi cubed */ double barg; double d2bdb2; double factor; double dbrgdb; double eta; double vbin; - double argd; - double args; + double argd = 0.0; + double args = 0.0; double argss; double argsd; - double argxs; - double argxd; + double argxs = 0.0; + double argxd = 0.0; double daddb2; double dasdb2; double dbargd; @@ -467,8 +467,8 @@ next1: if(vbs <= -3*vt) { double vth; double cfs; double cdonco; - double xn; - double argg; + double xn = 0.0; + double argg = 0.0; double vgst; double sarg3; double sbiarg; @@ -476,9 +476,9 @@ next1: if(vbs <= -3*vt) { double body; double gdbdv; double dodvbs; - double dodvds; - double dxndvd; - double dxndvb; + double dodvds = 0.0; + double dxndvd = 0.0; + double dxndvb = 0.0; double udenom; double dudvgs; double dudvds; @@ -515,11 +515,11 @@ next1: if(vbs <= -3*vt) { double xv; double y3; double delta4; - double xvalid; - double bsarg; + double xvalid = 0.0; + double bsarg = 0.0; double dbsrdb; - double bodys; - double gdbdvs; + double bodys = 0.0; + double gdbdvs = 0.0; double sargv; double xlfact; double dldsat; diff --git a/src/spicelib/devices/mos2/mos2sacl.c b/src/spicelib/devices/mos2/mos2sacl.c index fc619d32f..f020b5ace 100644 --- a/src/spicelib/devices/mos2/mos2sacl.c +++ b/src/spicelib/devices/mos2/mos2sacl.c @@ -25,7 +25,7 @@ MOS2sAcLoad(GENmodel *inModel, CKTcircuit *ckt) int xnrm; int xrev; double A0; - double Apert; + double Apert = 0.0; double DELA; double DELAinv; double gdpr0; @@ -110,7 +110,7 @@ MOS2sAcLoad(GENmodel *inModel, CKTcircuit *ckt) double icdprm; double icg; double icb; - double DvDp; + double DvDp = 0.0; int i; int flag; int error; diff --git a/src/spicelib/devices/mos2/mos2set.c b/src/spicelib/devices/mos2/mos2set.c index a72786e6e..370a93e9e 100644 --- a/src/spicelib/devices/mos2/mos2set.c +++ b/src/spicelib/devices/mos2/mos2set.c @@ -121,7 +121,7 @@ MOS2setup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *states) for (here = model->MOS2instances; here != NULL ; here=here->MOS2nextInstance) { - CKTnode *tmpNode; + CKTnode *tmpNode[1]; IFuid tmpName; if (here->MOS2owner == ARCHme) { @@ -166,10 +166,10 @@ MOS2setup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *states) here->MOS2dNodePrime = tmp->number; if (ckt->CKTcopyNodesets) { - if (CKTinst2Node(ckt,here,1,&tmpNode,&tmpName)==OK) { - if (tmpNode->nsGiven) { - tmp->nodeset=tmpNode->nodeset; - tmp->nsGiven=tmpNode->nsGiven; + if (CKTinst2Node(ckt,here,1,(void**)tmpNode,&tmpName)==OK) { + if (tmpNode[0]->nsGiven) { + tmp->nodeset=tmpNode[0]->nodeset; + tmp->nsGiven=tmpNode[0]->nsGiven; } } } @@ -187,10 +187,10 @@ MOS2setup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *states) here->MOS2sNodePrime = tmp->number; if (ckt->CKTcopyNodesets) { - if (CKTinst2Node(ckt,here,3,&tmpNode,&tmpName)==OK) { - if (tmpNode->nsGiven) { - tmp->nodeset=tmpNode->nodeset; - tmp->nsGiven=tmpNode->nsGiven; + if (CKTinst2Node(ckt,here,3,(void**)tmpNode,&tmpName)==OK) { + if (tmpNode[0]->nsGiven) { + tmp->nodeset=tmpNode[0]->nodeset; + tmp->nsGiven=tmpNode[0]->nsGiven; } } } diff --git a/src/spicelib/devices/mos3/mos3dist.c b/src/spicelib/devices/mos3/mos3dist.c index 25f1a8347..7d4af5835 100644 --- a/src/spicelib/devices/mos3/mos3dist.c +++ b/src/spicelib/devices/mos3/mos3dist.c @@ -38,7 +38,7 @@ MOS3disto(int mode, GENmodel *genmodel, CKTcircuit *ckt) MOS3instance *here; if (mode == D_SETUP) - return(MOS3dSetup(model,ckt)); + return(MOS3dSetup(genmodel,ckt)); if ((mode == D_TWOF1) || (mode == D_THRF1) || (mode == D_F1PF2) || (mode == D_F1MF2) || diff --git a/src/spicelib/devices/mos3/mos3dset.c b/src/spicelib/devices/mos3/mos3dset.c index 1da1b1fe3..013bbe272 100644 --- a/src/spicelib/devices/mos3/mos3dset.c +++ b/src/spicelib/devices/mos3/mos3dset.c @@ -231,13 +231,13 @@ MOS3dSetup(GENmodel *inModel, CKTcircuit *ckt) double onfg; double fgate; double us; - double xn; + double xn = 0.0; double vdsc; - double onvdsc; + double onvdsc = 0.0; double vdsx; double cdnorm; double cdo; - double fdrain; + double fdrain = 0.0; double gdsat; double cdsat; double emax; diff --git a/src/spicelib/devices/mos3/mos3load.c b/src/spicelib/devices/mos3/mos3load.c index 00a3d5dec..78c5a6313 100644 --- a/src/spicelib/devices/mos3/mos3load.c +++ b/src/spicelib/devices/mos3/mos3load.c @@ -65,12 +65,12 @@ MOS3load(GENmodel *inModel, CKTcircuit *ckt) double vgs1; double vgs; double von; - double xfact; + double xfact = 0.0; int xnrm; int xrev; - double capgs; /* total gate-source capacitance */ - double capgd; /* total gate-drain capacitance */ - double capgb; /* total gate-bulk capacitance */ + double capgs = 0.0; /* total gate-source capacitance */ + double capgd = 0.0; /* total gate-drain capacitance */ + double capgb = 0.0; /* total gate-bulk capacitance */ int Check; #ifndef NOBYPASS double tempv; @@ -488,9 +488,9 @@ next1: if(vbs <= -3*vt) { double dvtdvb; double csonco; double cdonco; - double dxndvb; - double dvodvb; - double dvodvd; + double dxndvb = 0.0; + double dvodvb = 0.0; + double dvodvd = 0.0; double vgsx; double dvtdvd; double onfg; @@ -502,20 +502,20 @@ next1: if(vbs <= -3*vt) { double dvsdvg; double dvsdvb; double dvsdvd; - double xn; + double xn = 0.0; double vdsc; - double onvdsc; + double onvdsc = 0.0; double dvsdga; double vdsx; double dcodvb; double cdnorm; double cdo; double cd1; - double fdrain; + double fdrain = 0.0; double fd2; - double dfddvg; - double dfddvb; - double dfddvd; + double dfddvg = 0.0; + double dfddvb = 0.0; + double dfddvd = 0.0; double gdsat; double cdsat; double gdoncd; @@ -538,7 +538,7 @@ next1: if(vbs <= -3*vt) { double dlonxl; double xlfact; double diddl; - double gds0; + double gds0 = 0.0; double emoncd; double ondvt; double onxn; diff --git a/src/spicelib/devices/mos3/mos3sacl.c b/src/spicelib/devices/mos3/mos3sacl.c index a4117cedc..36d30897f 100644 --- a/src/spicelib/devices/mos3/mos3sacl.c +++ b/src/spicelib/devices/mos3/mos3sacl.c @@ -25,7 +25,7 @@ MOS3sAcLoad(GENmodel *inModel, CKTcircuit *ckt) int xnrm; int xrev; double A0; - double Apert; + double Apert = 0.0; double DELA; double DELAinv; double gdpr0; @@ -110,7 +110,7 @@ MOS3sAcLoad(GENmodel *inModel, CKTcircuit *ckt) double icdprm; double icg; double icb; - double DvDp; + double DvDp = 0.0; int i; int flag; int error; diff --git a/src/spicelib/devices/mos3/mos3set.c b/src/spicelib/devices/mos3/mos3set.c index 8fc9d4e4d..c98fa0006 100644 --- a/src/spicelib/devices/mos3/mos3set.c +++ b/src/spicelib/devices/mos3/mos3set.c @@ -144,7 +144,7 @@ MOS3setup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *states) for (here = model->MOS3instances; here != NULL ; here=here->MOS3nextInstance) { - CKTnode *tmpNode; + CKTnode *tmpNode[1]; IFuid tmpName; if (here->MOS3owner == ARCHme) { @@ -195,10 +195,10 @@ MOS3setup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *states) if(error) return(error); here->MOS3dNodePrime = tmp->number; if (ckt->CKTcopyNodesets) { - if (CKTinst2Node(ckt,here,1,&tmpNode,&tmpName)==OK) { - if (tmpNode->nsGiven) { - tmp->nodeset=tmpNode->nodeset; - tmp->nsGiven=tmpNode->nsGiven; + if (CKTinst2Node(ckt,here,1,(void**)tmpNode,&tmpName)==OK) { + if (tmpNode[0]->nsGiven) { + tmp->nodeset=tmpNode[0]->nodeset; + tmp->nsGiven=tmpNode[0]->nsGiven; } } } @@ -214,10 +214,10 @@ MOS3setup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *states) if(error) return(error); here->MOS3sNodePrime = tmp->number; if (ckt->CKTcopyNodesets) { - if (CKTinst2Node(ckt,here,3,&tmpNode,&tmpName)==OK) { - if (tmpNode->nsGiven) { - tmp->nodeset=tmpNode->nodeset; - tmp->nsGiven=tmpNode->nsGiven; + if (CKTinst2Node(ckt,here,3,(void**)tmpNode,&tmpName)==OK) { + if (tmpNode[0]->nsGiven) { + tmp->nodeset=tmpNode[0]->nodeset; + tmp->nsGiven=tmpNode[0]->nsGiven; } } } diff --git a/src/spicelib/devices/mos6/mos6load.c b/src/spicelib/devices/mos6/mos6load.c index 8e738e416..8c8a18774 100644 --- a/src/spicelib/devices/mos6/mos6load.c +++ b/src/spicelib/devices/mos6/mos6load.c @@ -66,12 +66,12 @@ MOS6load(GENmodel *inModel, CKTcircuit *ckt) double vgs; double von; double vt; - double xfact; + double xfact = 0.0; int xnrm; int xrev; - double capgs; /* total gate-source capacitance */ - double capgd; /* total gate-drain capacitance */ - double capgb; /* total gate-bulk capacitance */ + double capgs = 0.0; /* total gate-source capacitance */ + double capgd = 0.0; /* total gate-drain capacitance */ + double capgb = 0.0; /* total gate-bulk capacitance */ int Check; #ifndef NOBYPASS double tempv; @@ -301,7 +301,7 @@ MOS6load(GENmodel *inModel, CKTcircuit *ckt) ckt->CKTreltol * MAX(fabs(cdhat),fabs( here->MOS6cd)) + ckt->CKTabstol) ) { /* bypass code * - /* nothing interesting has changed since last + * nothing interesting has changed since last * iteration on this device, so we just * copy all the values computed last iteration out * and keep going @@ -467,7 +467,7 @@ next1: if(vbs <= -3*vt) { double sarg; double vgon; double vdshere, vbsvbd; - double idsat, lambda, vonbm; + double idsat, lambda, vonbm = 0.0; double vdst, vdst2, ivdst1, vdstg; vbsvbd = (here->MOS6mode==1?vbs:vbd); diff --git a/src/spicelib/devices/mos6/mos6set.c b/src/spicelib/devices/mos6/mos6set.c index 377c0e5cd..4df67d581 100644 --- a/src/spicelib/devices/mos6/mos6set.c +++ b/src/spicelib/devices/mos6/mos6set.c @@ -112,7 +112,7 @@ MOS6setup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, /* loop through all the instances of the model */ for (here = model->MOS6instances; here != NULL ; here=here->MOS6nextInstance) { - CKTnode *tmpNode; + CKTnode *tmpNode[1]; IFuid tmpName; if (here->MOS6owner != ARCHme) goto matrixpointers; @@ -159,10 +159,10 @@ matrixpointers: if(error) return(error); here->MOS6dNodePrime = tmp->number; if (ckt->CKTcopyNodesets) { - if (CKTinst2Node(ckt,here,1,&tmpNode,&tmpName)==OK) { - if (tmpNode->nsGiven) { - tmp->nodeset=tmpNode->nodeset; - tmp->nsGiven=tmpNode->nsGiven; + if (CKTinst2Node(ckt,here,1,(void**)tmpNode,&tmpName)==OK) { + if (tmpNode[0]->nsGiven) { + tmp->nodeset=tmpNode[0]->nodeset; + tmp->nsGiven=tmpNode[0]->nsGiven; } } } @@ -178,10 +178,10 @@ matrixpointers: if(error) return(error); here->MOS6sNodePrime = tmp->number; if (ckt->CKTcopyNodesets) { - if (CKTinst2Node(ckt,here,3,&tmpNode,&tmpName)==OK) { - if (tmpNode->nsGiven) { - tmp->nodeset=tmpNode->nodeset; - tmp->nsGiven=tmpNode->nsGiven; + if (CKTinst2Node(ckt,here,3,(void**)tmpNode,&tmpName)==OK) { + if (tmpNode[0]->nsGiven) { + tmp->nodeset=tmpNode[0]->nodeset; + tmp->nsGiven=tmpNode[0]->nsGiven; } } } diff --git a/src/spicelib/devices/mos9/mos9dist.c b/src/spicelib/devices/mos9/mos9dist.c index 1be754247..ffaf4b5ef 100644 --- a/src/spicelib/devices/mos9/mos9dist.c +++ b/src/spicelib/devices/mos9/mos9dist.c @@ -43,7 +43,7 @@ MOS9disto(mode,genmodel,ckt) register MOS9instance *here; if (mode == D_SETUP) - return(MOS9dSetup(model,ckt)); + return(MOS9dSetup(genmodel,ckt)); if ((mode == D_TWOF1) || (mode == D_THRF1) || (mode == D_F1PF2) || (mode == D_F1MF2) || diff --git a/src/spicelib/devices/mos9/mos9dset.c b/src/spicelib/devices/mos9/mos9dset.c index 0f69c8523..b2fcf2050 100644 --- a/src/spicelib/devices/mos9/mos9dset.c +++ b/src/spicelib/devices/mos9/mos9dset.c @@ -61,7 +61,7 @@ MOS9dSetup(GENmodel *inModel, CKTcircuit *ckt) /* loop through all the MOS9 device models */ -next: for( ; model != NULL; model = model->MOS9nextModel ) { + for( ; model != NULL; model = model->MOS9nextModel ) { /* loop through all the instances of the model */ for (here = model->MOS9instances; here != NULL ; @@ -143,7 +143,7 @@ next: for( ; model != NULL; model = model->MOS9nextModel ) { * here we just evaluate the ideal diode current and the * correspoinding derivative (conductance). */ -next1: if(vbs <= 0) { +/*next1:*/ if(vbs <= 0) { lgbs = SourceSatCur/vt; lgbs += ckt->CKTgmin; lgbs2 = lgbs3 = 0; @@ -233,13 +233,13 @@ next1: if(vbs <= 0) { double onfg; double fgate; double us; - double xn; + double xn = 0.0; double vdsc; - double onvdsc; + double onvdsc = 0.0; double vdsx; double cdnorm; double cdo; - double fdrain; + double fdrain = 0.0; double gdsat; double cdsat; double emax; diff --git a/src/spicelib/devices/mos9/mos9load.c b/src/spicelib/devices/mos9/mos9load.c index 48f3f7bb8..8a362a40f 100644 --- a/src/spicelib/devices/mos9/mos9load.c +++ b/src/spicelib/devices/mos9/mos9load.c @@ -54,7 +54,6 @@ MOS9load(GENmodel *inModel, CKTcircuit *ckt) double geq; double sarg; double sargsw; - double tol; double vbd; double vbs; double vds; @@ -67,12 +66,12 @@ MOS9load(GENmodel *inModel, CKTcircuit *ckt) double vgs1; double vgs; double von; - double xfact; + double xfact = 0.0; int xnrm; int xrev; - double capgs; /* total gate-source capacitance */ - double capgd; /* total gate-drain capacitance */ - double capgb; /* total gate-bulk capacitance */ + double capgs = 0.0; /* total gate-source capacitance */ + double capgd = 0.0; /* total gate-drain capacitance */ + double capgb = 0.0; /* total gate-bulk capacitance */ int Check; #ifndef NOBYPASS double tempv; @@ -507,9 +506,9 @@ next1: if(vbs <= -3*vt) { double dvtdvb; double csonco; double cdonco; - double dxndvb; - double dvodvb; - double dvodvd; + double dxndvb = 0.0; + double dvodvb = 0.0; + double dvodvd = 0.0; double vgsx; double dvtdvd; double onfg; @@ -521,20 +520,20 @@ next1: if(vbs <= -3*vt) { double dvsdvg; double dvsdvb; double dvsdvd; - double xn; + double xn = 0.0; double vdsc; - double onvdsc; + double onvdsc = 0.0; double dvsdga; double vdsx; double dcodvb; double cdnorm; double cdo; double cd1; - double fdrain; + double fdrain = 0.0; double fd2; - double dfddvg; - double dfddvb; - double dfddvd; + double dfddvg = 0.0; + double dfddvb = 0.0; + double dfddvd = 0.0; double gdsat; double cdsat; double gdoncd; @@ -557,7 +556,7 @@ next1: if(vbs <= -3*vt) { double dlonxl; double xlfact; double diddl; - double gds0; + double gds0 = 0.0; double emoncd; double ondvt; double onxn; diff --git a/src/spicelib/devices/mos9/mos9noi.c b/src/spicelib/devices/mos9/mos9noi.c index 1353359e6..0c9f98596 100644 --- a/src/spicelib/devices/mos9/mos9noi.c +++ b/src/spicelib/devices/mos9/mos9noi.c @@ -35,7 +35,6 @@ MOS9noise (int mode, int operation, GENmodel *genmodel, CKTcircuit *ckt, double tempInoise; double noizDens[MOS9NSRCS]; double lnNdens[MOS9NSRCS]; - int error; int i; /* define the names of the noise sources */ diff --git a/src/spicelib/devices/mos9/mos9sacl.c b/src/spicelib/devices/mos9/mos9sacl.c index a88b4f50c..cefee6102 100644 --- a/src/spicelib/devices/mos9/mos9sacl.c +++ b/src/spicelib/devices/mos9/mos9sacl.c @@ -26,7 +26,7 @@ MOS9sAcLoad(GENmodel *inModel, CKTcircuit *ckt) int xnrm; int xrev; double A0; - double Apert; + double Apert = 0.0; double DELA; double DELAinv; double gdpr0; @@ -111,7 +111,7 @@ MOS9sAcLoad(GENmodel *inModel, CKTcircuit *ckt) double icdprm; double icg; double icb; - double DvDp; + double DvDp = 0.0; int i; int flag; int error; @@ -233,7 +233,7 @@ MOS9sAcLoad(GENmodel *inModel, CKTcircuit *ckt) here->MOS9senPertFlag = ON ; if(info->SENacpertflag == 1){ /* store the unperturbed values of small signal parameters */ - if(error = MOS9load((GENmodel*)model,ckt)) return(error); + if((error = MOS9load((GENmodel*)model,ckt))) return(error); *(here->MOS9senCgs) = here->MOS9cgs; *(here->MOS9senCgd) = here->MOS9cgd; *(here->MOS9senCgb) = here->MOS9cgb; @@ -322,7 +322,7 @@ MOS9sAcLoad(GENmodel *inModel, CKTcircuit *ckt) *(ckt->CKTstate0 + here->MOS9vbs) = Apert; *(ckt->CKTstate0 + here->MOS9vbd) = vbdOp; - if(error = MOS9load((GENmodel*)model,ckt)) return(error); + if((error = MOS9load((GENmodel*)model,ckt))) return(error); *(here->MOS9senCgs + 1) = here->MOS9cgs; *(here->MOS9senCgd + 1) = here->MOS9cgd; @@ -360,7 +360,7 @@ pertvbd: /* Perturbation of vbd */ *(ckt->CKTstate0 + here->MOS9vbs) = vbsOp; *(ckt->CKTstate0 + here->MOS9vbd) = Apert; - if(error = MOS9load((GENmodel*)model,ckt)) return(error); + if((error = MOS9load((GENmodel*)model,ckt))) return(error); *(here->MOS9senCgs + 2) = here->MOS9cgs; *(here->MOS9senCgd + 2) = here->MOS9cgd; @@ -399,7 +399,7 @@ pertvgb: /* Perturbation of vgb */ *(ckt->CKTstate0 + here->MOS9vbd) = vbdOp; *(ckt->CKTrhsOp + here->MOS9bNode) -= DELA; - if(error = MOS9load((GENmodel*)model,ckt)) return(error); + if((error = MOS9load((GENmodel*)model,ckt))) return(error); *(here->MOS9senCgs + 3) = here->MOS9cgs; *(here->MOS9senCgd + 3) = here->MOS9cgd; @@ -439,7 +439,7 @@ pertl: /* Perturbation of length */ *(ckt->CKTstate0 + here->MOS9vbs) = vbsOp; *(ckt->CKTstate0 + here->MOS9vbd) = vbdOp; - if(error = MOS9load((GENmodel*)model,ckt)) return(error); + if((error = MOS9load((GENmodel*)model,ckt))) return(error); *(here->MOS9senCgs + 4) = here->MOS9cgs; *(here->MOS9senCgd + 4) = here->MOS9cgd; @@ -541,7 +541,7 @@ pertw: /* Perturbation of width */ *(ckt->CKTstate0 + here->MOS9vbs) = vbsOp; *(ckt->CKTstate0 + here->MOS9vbd) = vbdOp; - if(error = MOS9load((GENmodel*)model,ckt)) return(error); + if((error = MOS9load((GENmodel*)model,ckt))) return(error); *(here->MOS9senCgs + 5) = here->MOS9cgs; *(here->MOS9senCgd + 5) = here->MOS9cgd; diff --git a/src/spicelib/devices/mos9/mos9set.c b/src/spicelib/devices/mos9/mos9set.c index b23969bf0..117a2ee54 100644 --- a/src/spicelib/devices/mos9/mos9set.c +++ b/src/spicelib/devices/mos9/mos9set.c @@ -144,7 +144,7 @@ MOS9setup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *states) for (here = model->MOS9instances; here != NULL ; here=here->MOS9nextInstance) { - CKTnode *tmpNode; + CKTnode *tmpNode[1]; IFuid tmpName; if (here->MOS9owner == ARCHme) { @@ -194,10 +194,10 @@ MOS9setup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *states) if(error) return(error); here->MOS9dNodePrime = tmp->number; if (ckt->CKTcopyNodesets) { - if (CKTinst2Node(ckt,here,1,&tmpNode,&tmpName)==OK) { - if (tmpNode->nsGiven) { - tmp->nodeset=tmpNode->nodeset; - tmp->nsGiven=tmpNode->nsGiven; + if (CKTinst2Node(ckt,here,1,(void**)tmpNode,&tmpName)==OK) { + if (tmpNode[0]->nsGiven) { + tmp->nodeset=tmpNode[0]->nodeset; + tmp->nsGiven=tmpNode[0]->nsGiven; } } } @@ -213,10 +213,10 @@ MOS9setup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *states) if(error) return(error); here->MOS9sNodePrime = tmp->number; if (ckt->CKTcopyNodesets) { - if (CKTinst2Node(ckt,here,3,&tmpNode,&tmpName)==OK) { - if (tmpNode->nsGiven) { - tmp->nodeset=tmpNode->nodeset; - tmp->nsGiven=tmpNode->nsGiven; + if (CKTinst2Node(ckt,here,3,(void**)tmpNode,&tmpName)==OK) { + if (tmpNode[0]->nsGiven) { + tmp->nodeset=tmpNode[0]->nodeset; + tmp->nsGiven=tmpNode[0]->nsGiven; } } } diff --git a/src/spicelib/devices/soi3/soi3ask.c b/src/spicelib/devices/soi3/soi3ask.c index 5e060a3c4..2e54b3287 100644 --- a/src/spicelib/devices/soi3/soi3ask.c +++ b/src/spicelib/devices/soi3/soi3ask.c @@ -36,12 +36,16 @@ SOI3ask(CKTcircuit *ckt, GENinstance *inst, int which, IFvalue *value, IFvalue *select) { SOI3instance *here = (SOI3instance*)inst; - double vr; - double vi; - double sr; - double si; - double vm; - static char *msg = "Current and power not available for ac analysis"; + + /* The line below belong to the parts of the case statement that are also + * commented out */ +/* double vr; */ +/* double vi; */ +/* double sr; */ +/* double si; */ +/* double vm; */ +/* static char *msg = "Current and power not available for ac analysis"; */ + switch(which) { case SOI3_L: value->rValue = here->SOI3l; diff --git a/src/spicelib/devices/soi3/soi3cap.c b/src/spicelib/devices/soi3/soi3cap.c index 4e92b0e5f..d5a021489 100644 --- a/src/spicelib/devices/soi3/soi3cap.c +++ b/src/spicelib/devices/soi3/soi3cap.c @@ -68,10 +68,6 @@ double DVqs_Dvgfb,DVqs_Dvdb,DVqs_Dvsb,DVqs_DdeltaT; double DF_Dvgfb,DF_Dvdb,DF_Dvsb,DF_DdeltaT; double ccgf,ccd,ccs,ccdeltaT,ccgb; -double A0B,EA0B,tmpsb; -double Vgmax0B,VgBx0,EBmax0,tmpmax0,tmpmaxsb; -double VgBy0,EBy0,tmpmin0; -double SgB0; double vg,vgacc,Egacc,tmpacc,Qacc; double csf; diff --git a/src/spicelib/devices/soi3/soi3conv.c b/src/spicelib/devices/soi3/soi3conv.c index ea4d2d646..545e4d6bc 100644 --- a/src/spicelib/devices/soi3/soi3conv.c +++ b/src/spicelib/devices/soi3/soi3conv.c @@ -54,7 +54,8 @@ SOI3convTest(GENmodel *inModel, CKTcircuit *ckt) double vgfdo; double vgbdo; double tol; - FILE *fp,*fopen(); + /* debug stuff */ + /* FILE *fp,*fopen(); */ for( ; model != NULL; model = model->SOI3nextModel) { for(here = model->SOI3instances; here!= NULL; diff --git a/src/spicelib/devices/soi3/soi3load.c b/src/spicelib/devices/soi3/soi3load.c index 61d9788f4..a180d00cb 100644 --- a/src/spicelib/devices/soi3/soi3load.c +++ b/src/spicelib/devices/soi3/soi3load.c @@ -87,8 +87,6 @@ SOI3load(GENmodel *inModel, CKTcircuit *ckt) int tnodeindex; double geq; double sarg; - double sargsw; - double tol; double vbd; double vbs; double vds; @@ -98,7 +96,9 @@ SOI3load(GENmodel *inModel, CKTcircuit *ckt) double vgbb; /* now back to our regular programming */ /* vgfb exists already for gate cap calc */ - double deltaT,deltaT1,deltaT2,deltaT3,deltaT4,deltaT5; + double deltaT,deltaT1 = 0.0,deltaT2 = 0.0,deltaT3 = 0.0; + double deltaT4 = 0.0,deltaT5 = 0.0; + double vdsat_ext; double vgfb; double vgfd; @@ -152,14 +152,6 @@ SOI3load(GENmodel *inModel, CKTcircuit *ckt) #ifdef CAPBYPASS int senflag; #endif /* CAPBYPASS */ - int SenCond; - - /* JimB - 4/1/99. New variables for junction */ - /* depletion capacitance model. */ - double Esj, Vsj, Xs; - double Edj, Vdj, Xd; - double DXs_Dvgfb, DXs_Dvdb, DXs_Dvsb, DXs_DdeltaT; - double DXd_Dvgfb, DXd_Dvdb, DXd_Dvsb, DXd_DdeltaT; double m; @@ -914,16 +906,16 @@ SOI3load(GENmodel *inModel, CKTcircuit *ckt) double vg; double eta_s; /* 1+Citf/Cof */ double gamma,sigma; - double Egy,vgy,Sgy; + double Egy = 0.0,vgy,Sgy; double psi_ss; double AL,A0,LL,L0; - double ALx,A0x,EAL,EA0; + double ALx,A0x,EAL = 0.0,EA0 = 0.0; double logterm0,logtermL; double Vgconst0,VgconstL; - double Egx0,EgxL; + double Egx0 = 0.0,EgxL = 0.0; double vgx0,vgxL; double psi_si0,psi_siL,psi_st0; - double Esi0,EsiL,Ess0; + double Esi0 = 0.0,EsiL = 0.0,Ess0 = 0.0; double theta2; double TVF; /* thermal velocity-saturation factor */ double Mmob; @@ -933,7 +925,7 @@ SOI3load(GENmodel *inModel, CKTcircuit *ckt) double PSI; double S; double psi_sLsat; - double Esd0,EsdL; + double Esd0 = 0.0,EsdL = 0.0; double psi_s0,psi_sL; double fL,f0; @@ -973,7 +965,7 @@ SOI3load(GENmodel *inModel, CKTcircuit *ckt) double DVmx_Dvgfb,DVmx_Dvdb,DVmx_Dvsb,DVmx_DdeltaT; double Vm1,Em1,Vm1x; double DVm1x_Dvgfb,DVm1x_Dvdb,DVm1x_Dvsb,DVm1x_DdeltaT; - double vgeff,lm,lmeff,lmeff2,Elm,Dlm_Dvgfb,Dlm_Dvdb,Dlm_Dvsb,Dlm_DdeltaT; + double vgeff,lm,lmeff,Elm,Dlm_Dvgfb,Dlm_Dvdb,Dlm_Dvsb,Dlm_DdeltaT; double Mminus1=0; double EM,betaM; @@ -983,7 +975,7 @@ SOI3load(GENmodel *inModel, CKTcircuit *ckt) double tmp,tmp1; /* temporary var to aid pre-calculation */ double TMF; /* thermal mobility factor */ int vgx0trans,vgxLtrans; /* flags to indicate if vg transform performed */ - int psi_s0_trans,psi_sL_trans; + int psi_s0_trans,psi_sL_trans=0; int Ess0_trans,Esd0_trans,EsdL_trans; int A0trans,ALtrans; @@ -1993,9 +1985,6 @@ SOI3load(GENmodel *inModel, CKTcircuit *ckt) } -/* if(SenCond) goto next2; */ - - /* * check convergence */ diff --git a/src/spicelib/devices/soi3/soi3nois.c b/src/spicelib/devices/soi3/soi3nois.c index d1ac30251..63d7e8614 100644 --- a/src/spicelib/devices/soi3/soi3nois.c +++ b/src/spicelib/devices/soi3/soi3nois.c @@ -57,7 +57,6 @@ SOI3noise (int mode, int operation, GENmodel *genmodel, CKTcircuit *ckt, double lnNdens[SOI3NSRCS]; double gain; double EffectiveLength; - int error; int i; /* define the names of the noise sources */ diff --git a/src/spicelib/devices/soi3/soi3set.c b/src/spicelib/devices/soi3/soi3set.c index c9223049e..a1ac23450 100644 --- a/src/spicelib/devices/soi3/soi3set.c +++ b/src/spicelib/devices/soi3/soi3set.c @@ -44,7 +44,7 @@ SOI3setup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *states) double * rtptr; int node_count; - CKTnode *tmpNode; + CKTnode *tmpNode[1]; IFuid tmpName; @@ -356,10 +356,10 @@ SOI3setup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *states) here->SOI3dNodePrime = tmp->number; if (ckt->CKTcopyNodesets) { - if (CKTinst2Node(ckt,here,1,&tmpNode,&tmpName)==OK) { - if (tmpNode->nsGiven) { - tmp->nodeset=tmpNode->nodeset; - tmp->nsGiven=tmpNode->nsGiven; + if (CKTinst2Node(ckt,here,1,(void**)tmpNode,&tmpName)==OK) { + if (tmpNode[0]->nsGiven) { + tmp->nodeset=tmpNode[0]->nodeset; + tmp->nsGiven=tmpNode[0]->nsGiven; } } } @@ -385,10 +385,10 @@ SOI3setup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *states) here->SOI3sNodePrime = tmp->number; if (ckt->CKTcopyNodesets) { - if (CKTinst2Node(ckt,here,3,&tmpNode,&tmpName)==OK) { - if (tmpNode->nsGiven) { - tmp->nodeset=tmpNode->nodeset; - tmp->nsGiven=tmpNode->nsGiven; + if (CKTinst2Node(ckt,here,3,(void**)tmpNode,&tmpName)==OK) { + if (tmpNode[0]->nsGiven) { + tmp->nodeset=tmpNode[0]->nodeset; + tmp->nsGiven=tmpNode[0]->nsGiven; } } } diff --git a/src/spicelib/devices/sw/swinit.c b/src/spicelib/devices/sw/swinit.c index 11958d07d..bccf2866d 100644 --- a/src/spicelib/devices/sw/swinit.c +++ b/src/spicelib/devices/sw/swinit.c @@ -71,7 +71,7 @@ SPICEdev SWinfo = { #ifdef CIDER DEVdump : NULL, DEVacct : NULL, -#endif CIDER +#endif /* CIDER */ DEVinstSize : &SWiSize, DEVmodSize : &SWmSize diff --git a/src/spicelib/devices/sw/swload.c b/src/spicelib/devices/sw/swload.c index a06e6f642..e71914777 100644 --- a/src/spicelib/devices/sw/swload.c +++ b/src/spicelib/devices/sw/swload.c @@ -6,6 +6,7 @@ Modified: 2001 Jon Engelbert #include "ngspice.h" #include "cktdefs.h" +#include "fteext.h" #include "swdefs.h" #include "trandefs.h" #include "sperror.h" @@ -24,7 +25,6 @@ SWload(GENmodel *inModel, CKTcircuit *ckt) double previous_state = -1; double current_state = -1; double old_current_state = -1; - double UNKNOWN = -1; double REALLY_OFF = 0, REALLY_ON = 1; // switch is on or off, not in hysteresis region. double HYST_OFF = 2, HYST_ON = 3; // switch is on or off while control value is in hysteresis region. // double previous_region = -1; diff --git a/src/spicelib/devices/urc/urcsetup.c b/src/spicelib/devices/urc/urcsetup.c index d0f37289a..57487a0d1 100644 --- a/src/spicelib/devices/urc/urcsetup.c +++ b/src/spicelib/devices/urc/urcsetup.c @@ -45,9 +45,9 @@ URCsetup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *state) double wnorm; double prop; int i; - GENinstance *fast; - GENmodel *modfast; /* capacitor or diode model */ - GENmodel *rmodfast; /* resistor model */ + GENinstance *fast[1]; + GENmodel *modfast[1]; /* capacitor or diode model */ + GENmodel *rmodfast[1]; /* resistor model */ int error; IFuid dioUid; IFuid resUid; @@ -95,25 +95,25 @@ URCsetup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *state) error = (*(SPfrontEnd->IFnewUid))(ckt,&dioUid,here->URCname, "diodemod",UID_MODEL,(void **)NULL); if(error) return(error); - modfast = (GENmodel *)NULL; - error = CKTmodCrt((void *)ckt,dtype,(void **)&modfast, + modfast[0] = (GENmodel *)NULL; + error = CKTmodCrt((void *)ckt,dtype,(void **)modfast, dioUid); if(error) return(error); ptemp.rValue = c1; - error= CKTpModName("cjo",&ptemp,ckt,dtype,dioUid,&modfast); + error= CKTpModName("cjo",&ptemp,ckt,dtype,dioUid,modfast); if(error) return(error); ptemp.rValue = rd; - error = CKTpModName("rs",&ptemp,ckt,dtype,dioUid,&modfast); + error = CKTpModName("rs",&ptemp,ckt,dtype,dioUid,modfast); if(error) return(error); ptemp.rValue = i1; - error = CKTpModName("is",&ptemp,ckt,dtype,dioUid,&modfast); + error = CKTpModName("is",&ptemp,ckt,dtype,dioUid,modfast); if(error) return(error); } else { error = (*(SPfrontEnd->IFnewUid))((void *)ckt,&capUid, here->URCname, "capmod",UID_MODEL,(void **)NULL); if(error) return(error); - modfast = (GENmodel *)NULL; - error = CKTmodCrt((void *)ckt,ctype,(void **)&modfast, + modfast[0] = (GENmodel *)NULL; + error = CKTmodCrt((void *)ckt,ctype,(void **)modfast, capUid); if(error) return(error); } @@ -121,8 +121,8 @@ URCsetup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *state) error = (*(SPfrontEnd->IFnewUid))(ckt,&resUid,here->URCname, "resmod",UID_MODEL,(void **)NULL); if(error) return(error); - rmodfast = (GENmodel *)NULL; - error = CKTmodCrt((void *)ckt,rtype,(void **)&rmodfast,resUid); + rmodfast[0] = (GENmodel *)NULL; + error = CKTmodCrt((void *)ckt,rtype,(void **)rmodfast,resUid); if(error) return(error); lowl = CKTnum2nod(ckt,here->URCposNode); hir = CKTnum2nod(ckt,here->URCnegNode); @@ -150,34 +150,34 @@ URCsetup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *state) error = (*(SPfrontEnd->IFnewUid))(ckt,&eltUid,here->URCname, nameelt,UID_INSTANCE, (void **)NULL); if(error) return(error); - error = CKTcrtElt((void *)ckt,(void *)rmodfast, - (void **)&fast,eltUid); + error = CKTcrtElt((void *)ckt,(void *)rmodfast[0], + (void **)fast,eltUid); if(error) return(error); error = CKTbindNode((void *)ckt,(void *)fast,1,lowl); if(error) return(error); error = CKTbindNode((void *)ckt,(void *)fast,2,lowr); if(error) return(error); ptemp.rValue = r; - error = CKTpName("resistance",&ptemp,ckt,rtype,nameelt,&fast); + error = CKTpName("resistance",&ptemp,ckt,rtype,nameelt,fast); if(error) return(error); - fast->GENowner = here->URCowner; + fast[0]->GENowner = here->URCowner; nameelt = (char *)MALLOC(10*sizeof(char)); (void)sprintf(nameelt,"rhi%d",i); error = (*(SPfrontEnd->IFnewUid))(ckt,&eltUid,here->URCname, nameelt,UID_INSTANCE, (void **)NULL); if(error) return(error); - error = CKTcrtElt((void *)ckt,(void *)rmodfast, - (void **)&fast,eltUid); + error = CKTcrtElt((void *)ckt,(void *)rmodfast[0], + (void **)fast,eltUid); if(error) return(error); error = CKTbindNode((void *)ckt,(void *)fast,1,hil); if(error) return(error); error = CKTbindNode((void *)ckt,(void *)fast,2,hir); if(error) return(error); ptemp.rValue = r; - error = CKTpName("resistance",&ptemp,ckt,rtype,nameelt,&fast); + error = CKTpName("resistance",&ptemp,ckt,rtype,nameelt,fast); if(error) return(error); - fast->GENowner = here->URCowner; + fast[0]->GENowner = here->URCowner; if(model->URCisPerLGiven) { /* use diode */ @@ -187,8 +187,8 @@ URCsetup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *state) here->URCname,nameelt,UID_INSTANCE, (void **)NULL); if(error) return(error); - error = CKTcrtElt((void *)ckt,(void *)modfast, - (void **)&fast, eltUid); + error = CKTcrtElt((void *)ckt,(void *)modfast[0], + (void **)fast, eltUid); if(error) return(error); error = CKTbindNode((void *)ckt,(void *)fast,1,lowr); if(error) return(error); @@ -196,9 +196,9 @@ URCsetup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *state) (void *)CKTnum2nod(ckt, here->URCgndNode)); if(error) return(error); ptemp.rValue = prop; - error = CKTpName("area",&ptemp,ckt,dtype,nameelt,&fast); + error = CKTpName("area",&ptemp,ckt,dtype,nameelt,fast); if(error) return(error); - fast->GENowner = here->URCowner; + fast[0]->GENowner = here->URCowner; } else { /* use simple capacitor */ nameelt = (char *)MALLOC(10*sizeof(char)); @@ -206,8 +206,8 @@ URCsetup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *state) error = (*(SPfrontEnd->IFnewUid))(ckt,&eltUid,here->URCname ,nameelt,UID_INSTANCE, (void **)NULL); if(error) return(error); - error = CKTcrtElt((void *)ckt,(void *)modfast, - (void **)&fast, eltUid); + error = CKTcrtElt((void *)ckt,(void *)modfast[0], + (void **)fast, eltUid); if(error) return(error); error = CKTbindNode((void *)ckt,(void *)fast,1,lowr); if(error) return(error); @@ -216,9 +216,9 @@ URCsetup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *state) if(error) return(error); ptemp.rValue = c; error = CKTpName("capacitance",&ptemp,ckt,ctype,nameelt, - &fast); + fast); if(error) return(error); - fast->GENowner = here->URCowner; + fast[0]->GENowner = here->URCowner; } if(i!=here->URClumps){ @@ -230,8 +230,8 @@ URCsetup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *state) here->URCname,nameelt,UID_INSTANCE, (void **)NULL); if(error) return(error); - error = CKTcrtElt((void *)ckt,(void *)modfast, - (void **) &fast,eltUid); + error = CKTcrtElt((void *)ckt,(void *)modfast[0], + (void **)fast,eltUid); if(error) return(error); error = CKTbindNode((void *)ckt,(void *)fast,1,hil); if(error) return(error); @@ -239,9 +239,9 @@ URCsetup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *state) (void *)CKTnum2nod(ckt, here->URCgndNode)); if(error) return(error); ptemp.rValue = prop; - error=CKTpName("area",&ptemp,ckt,dtype,nameelt,&fast); + error=CKTpName("area",&ptemp,ckt,dtype,nameelt,fast); if(error) return(error); - fast->GENowner = here->URCowner; + fast[0]->GENowner = here->URCowner; } else { /* use simple capacitor */ nameelt = (char *)MALLOC(10*sizeof(char)); @@ -250,8 +250,8 @@ URCsetup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *state) here->URCname,nameelt,UID_INSTANCE, (void **)NULL); if(error) return(error); - error = CKTcrtElt((void *)ckt,(void *)modfast, - (void **)&fast,eltUid); + error = CKTcrtElt((void *)ckt,(void *)modfast[0], + (void **)fast,eltUid); if(error) return(error); error = CKTbindNode((void *)ckt,(void *)fast,1,hil); if(error) return(error); @@ -260,9 +260,9 @@ URCsetup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *state) if(error) return(error); ptemp.rValue = c; error =CKTpName("capacitance",&ptemp,ckt,ctype,nameelt, - &fast); + fast); if(error) return(error); - fast->GENowner = here->URCowner; + fast[0]->GENowner = here->URCowner; } } prop *= p; @@ -282,7 +282,7 @@ URCunsetup(GENmodel *inModel, CKTcircuit *ckt) URCinstance *here; URCmodel *model = (URCmodel *) inModel; GENinstance *in; - GENmodel *modfast; + GENmodel *modfast[1]; int type; /* Delete models, devices, and intermediate nodes; */ @@ -309,16 +309,16 @@ URCunsetup(GENmodel *inModel, CKTcircuit *ckt) if (error && error != E_EXISTS) return error; - modfast = NULL; + modfast[0] = NULL; type = -1; - error = CKTfndMod(ckt, &type, (void **) &modfast, varUid); + error = CKTfndMod(ckt, &type, (void **)modfast, varUid); if (error) return error; - for (in = modfast->GENinstances; in; in = in->GENnextInstance) + for (in = modfast[0]->GENinstances; in; in = in->GENnextInstance) CKTdltNNum(ckt, in->GENnode1); - CKTdltMod(ckt, modfast); /* Does the elements too */ + CKTdltMod(ckt, modfast[0]); /* Does the elements too */ /* Resistors */ error = (*(SPfrontEnd->IFnewUid))(ckt,&varUid,here->URCname, @@ -326,13 +326,13 @@ URCunsetup(GENmodel *inModel, CKTcircuit *ckt) if (error && error != E_EXISTS) return error; - modfast = NULL; + modfast[0] = NULL; type = -1; - error = CKTfndMod(ckt, &type, (void **) &modfast, varUid); + error = CKTfndMod(ckt, &type, (void **)modfast, varUid); if (error) return error; - CKTdltMod(ckt, modfast); + CKTdltMod(ckt, modfast[0]); } } return OK; diff --git a/src/spicelib/devices/vbic/vbicask.c b/src/spicelib/devices/vbic/vbicask.c index b1bae198a..36d1bf4ae 100644 --- a/src/spicelib/devices/vbic/vbicask.c +++ b/src/spicelib/devices/vbic/vbicask.c @@ -29,7 +29,7 @@ VBICask(CKTcircuit *ckt, GENinstance *instPtr, int which, IFvalue *value, IFvalu double sr; double si; double vm; - static char *msg = "Current and power not available for ac analysis"; + switch(which) { case VBIC_AREA: value->rValue = here->VBICarea; diff --git a/src/spicelib/devices/vbic/vbicsetup.c b/src/spicelib/devices/vbic/vbicsetup.c index 27aeae2dc..5a27f4ef1 100644 --- a/src/spicelib/devices/vbic/vbicsetup.c +++ b/src/spicelib/devices/vbic/vbicsetup.c @@ -366,7 +366,7 @@ VBICsetup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *states) /* loop through all the instances of the model */ for (here = model->VBICinstances; here != NULL ; here=here->VBICnextInstance) { - CKTnode *tmpNode; + CKTnode *tmpNode[1]; IFuid tmpName; if (here->VBICowner != ARCHme) @@ -396,10 +396,10 @@ matrixpointers: if(error) return(error); here->VBICcollCXNode = tmp->number; if (ckt->CKTcopyNodesets) { - if (CKTinst2Node(ckt,here,1,&tmpNode,&tmpName)==OK) { - if (tmpNode->nsGiven) { - tmp->nodeset=tmpNode->nodeset; - tmp->nsGiven=tmpNode->nsGiven; + if (CKTinst2Node(ckt,here,1,(void**)tmpNode,&tmpName)==OK) { + if (tmpNode[0]->nsGiven) { + tmp->nodeset=tmpNode[0]->nodeset; + tmp->nsGiven=tmpNode[0]->nsGiven; } } } @@ -411,10 +411,10 @@ matrixpointers: if(error) return(error); here->VBICbaseBXNode = tmp->number; if (ckt->CKTcopyNodesets) { - if (CKTinst2Node(ckt,here,2,&tmpNode,&tmpName)==OK) { - if (tmpNode->nsGiven) { - tmp->nodeset=tmpNode->nodeset; - tmp->nsGiven=tmpNode->nsGiven; + if (CKTinst2Node(ckt,here,2,(void**)tmpNode,&tmpName)==OK) { + if (tmpNode[0]->nsGiven) { + tmp->nodeset=tmpNode[0]->nodeset; + tmp->nsGiven=tmpNode[0]->nsGiven; } } } @@ -426,10 +426,10 @@ matrixpointers: if(error) return(error); here->VBICemitEINode = tmp->number; if (ckt->CKTcopyNodesets) { - if (CKTinst2Node(ckt,here,3,&tmpNode,&tmpName)==OK) { - if (tmpNode->nsGiven) { - tmp->nodeset=tmpNode->nodeset; - tmp->nsGiven=tmpNode->nsGiven; + if (CKTinst2Node(ckt,here,3,(void**)tmpNode,&tmpName)==OK) { + if (tmpNode[0]->nsGiven) { + tmp->nodeset=tmpNode[0]->nodeset; + tmp->nsGiven=tmpNode[0]->nsGiven; } } } @@ -441,10 +441,10 @@ matrixpointers: if(error) return(error); here->VBICsubsSINode = tmp->number; if (ckt->CKTcopyNodesets) { - if (CKTinst2Node(ckt,here,4,&tmpNode,&tmpName)==OK) { - if (tmpNode->nsGiven) { - tmp->nodeset=tmpNode->nodeset; - tmp->nsGiven=tmpNode->nsGiven; + if (CKTinst2Node(ckt,here,4,(void**)tmpNode,&tmpName)==OK) { + if (tmpNode[0]->nsGiven) { + tmp->nodeset=tmpNode[0]->nodeset; + tmp->nsGiven=tmpNode[0]->nsGiven; } } } diff --git a/src/xspice/cmpp/ifs_lex.l b/src/xspice/cmpp/ifs_lex.l index 6ac1a11e8..a3bab9451 100755 --- a/src/xspice/cmpp/ifs_lex.l +++ b/src/xspice/cmpp/ifs_lex.l @@ -49,6 +49,7 @@ int yyival; double yydval; extern int atoi(); extern double atof(); +extern void ifs_yyerror (char*); /* * IFS specs are case insensitive: diff --git a/src/xspice/cmpp/ifs_yacc.y b/src/xspice/cmpp/ifs_yacc.y index ce1ad34fa..3902b53d8 100755 --- a/src/xspice/cmpp/ifs_yacc.y +++ b/src/xspice/cmpp/ifs_yacc.y @@ -43,6 +43,8 @@ NON-STANDARD FEATURES ============================================================================*/ #include +#include +#include #include "ifs_yacc_y.h" #define yymaxdepth ifs_yymaxdepth @@ -90,7 +92,8 @@ extern int yylineno; extern int yyival; extern double yydval; extern char *ifs_yytext; -extern char *strdup(); +extern void yyerror (char*); + extern int ifs_yylex(); Boolean_t parser_just_names; static Boolean_t saw_model_name; @@ -186,6 +189,8 @@ static int find_conn_ref (name) } sprintf (str, "Port `%s' not found", name); yyerror (str); + + return 0; } typedef enum {C_DOUBLE, C_BOOLEAN, C_POINTER, C_UNDEF} Ctype_Class_t; diff --git a/src/xspice/cmpp/main.c b/src/xspice/cmpp/main.c index 20d796fb2..c81749ef1 100755 --- a/src/xspice/cmpp/main.c +++ b/src/xspice/cmpp/main.c @@ -38,7 +38,9 @@ NON-STANDARD FEATURES ============================================================================*/ -#include +#include +#include +#include #include "cmpp.h" @@ -52,6 +54,8 @@ NON-STANDARD FEATURES /* *********************************************************************** */ +extern void init_error (char *program_name); + /* main @@ -66,9 +70,9 @@ major functions as appropriate: depending on the argument. */ -main( - int argc, /* Number of command line arguments */ - char *argv[]) /* Command line argument text */ +int main( + int argc, /* Number of command line arguments */ + char *argv[]) /* Command line argument text */ { init_error (argv[0]); diff --git a/src/xspice/cmpp/mod_lex.l b/src/xspice/cmpp/mod_lex.l index bc891b203..fc947952c 100755 --- a/src/xspice/cmpp/mod_lex.l +++ b/src/xspice/cmpp/mod_lex.l @@ -43,6 +43,7 @@ NON-STANDARD FEATURES #include "mod_yacc_y.h" #include "mod_yacc.h" +extern void mod_yyerror(char*); %} diff --git a/src/xspice/cmpp/mod_yacc.y b/src/xspice/cmpp/mod_yacc.y index f85a1e8f7..79e5496a1 100755 --- a/src/xspice/cmpp/mod_yacc.y +++ b/src/xspice/cmpp/mod_yacc.y @@ -48,6 +48,7 @@ NON-STANDARD FEATURES #include #include +#include #include "mod_yacc_y.h" #define yymaxdepth mod_yymaxdepth @@ -95,6 +96,7 @@ Ifs_Table_t *mod_ifs_table; extern char *mod_yytext; extern FILE* mod_yyout; + extern void mod_yyerror(char*); #include #include @@ -139,7 +141,7 @@ int strcmpi(s, t) /*---------------------------------------------------------------------------*/ static void put_type (FILE *fp, Data_Type_t type) { - char ch; + char ch = ' '; switch (type) { case INTEGER: @@ -302,14 +304,14 @@ static int valid_subid (Sub_Id_t sub_id, Id_Kind_t kind) } /*---------------------------------------------------------------------------*/ -static init_buffer () +static void init_buffer () { buf_len = 0; buffer[0] = '\0'; } /*---------------------------------------------------------------------------*/ -static append (char *str) +static void append (char *str) { int len = strlen (str); if (len + buf_len > BUFFER_SIZE) { diff --git a/src/xspice/cmpp/pp_ifs.c b/src/xspice/cmpp/pp_ifs.c index c92d5adb7..00ba1dc9a 100755 --- a/src/xspice/cmpp/pp_ifs.c +++ b/src/xspice/cmpp/pp_ifs.c @@ -37,6 +37,7 @@ NON-STANDARD FEATURES ============================================================================*/ +#include #include "cmpp.h" diff --git a/src/xspice/cmpp/pp_lst.c b/src/xspice/cmpp/pp_lst.c index 69a9b091c..233abc6ec 100755 --- a/src/xspice/cmpp/pp_lst.c +++ b/src/xspice/cmpp/pp_lst.c @@ -49,11 +49,16 @@ NON-STANDARD FEATURES #include "cmpp.h" #include +#include #include +extern int str_to_lower(char *s); + +/* void *malloc(unsigned size); void *realloc(void *ptr, unsigned size); +*/ /* *********************************************************************** */ @@ -220,7 +225,7 @@ static Status_t read_modpath( FILE *fp; /* Model pathname file pointer */ char msg[MAX_PATH_LEN+257]; /* space for an error message */ char path[MAX_PATH_LEN+2]; /* space to read pathnames into */ - Model_Info_t *model; /* temporary pointer to model info */ + Model_Info_t *model = NULL; /* temporary pointer to model info */ int n; int i; @@ -340,7 +345,7 @@ static Status_t read_udnpath( FILE *fp; /* Udn pathname file pointer */ char msg[MAX_PATH_LEN+257]; /* space for an error message */ char path[MAX_PATH_LEN+2]; /* space to read pathnames into */ - Node_Info_t *node; /* temporary pointer to node info */ + Node_Info_t *node = NULL; /* temporary pointer to node info */ int n; int i; @@ -992,7 +997,7 @@ static Status_t read_udn_type_name( ) { FILE *fp; /* file pointer for opened file */ - char msg[MAX_PATH_LEN+257]; /* space for an error message */ + /*char msg[MAX_PATH_LEN+257];*/ /* space for an error message */ Boolean_t found; /* true if name found successfully */ Boolean_t in_struct; /* true if found struct with name */ char name[MAX_NAME_LEN + 1]; /* temporary storage for name read */ diff --git a/src/xspice/cmpp/pp_mod.c b/src/xspice/cmpp/pp_mod.c index 722529b7f..77a4e093a 100755 --- a/src/xspice/cmpp/pp_mod.c +++ b/src/xspice/cmpp/pp_mod.c @@ -54,8 +54,15 @@ NON-STANDARD FEATURES ============================================================================*/ +#include +#include +#include +#include #include "cmpp.h" +extern int mod_yyparse(); +extern void mod_yyrestart (FILE*); + /*---------------------------------------------------------------------------*/ static void change_extension (char *filename, char *ext, char *new_filename) { @@ -177,5 +184,7 @@ int mod_yyerror (str) fprintf (stderr, "%s: Error: \"%s\": line %d (near \'%s\'):\n\t%s.\n", prog_name, current_filename, mod_yylineno, mod_yytext, str); + + return 0; } diff --git a/src/xspice/cmpp/read_ifs.c b/src/xspice/cmpp/read_ifs.c index abcb6c5b6..c10bbeb07 100755 --- a/src/xspice/cmpp/read_ifs.c +++ b/src/xspice/cmpp/read_ifs.c @@ -47,9 +47,12 @@ NON-STANDARD FEATURES ============================================================================*/ #include +#include #include "cmpp.h" extern char *prog_name; +extern int ifs_yyparse (); +extern void ifs_yyrestart (FILE*); void *malloc(unsigned size); @@ -171,5 +174,7 @@ int ifs_yyerror (str) fprintf (stderr, "%s: Error: \"%s\": line %d (near \'%s\'):\n\t%s.\n", prog_name, current_filename, ifs_yylineno, ifs_yytext, str); + + return 0; } diff --git a/src/xspice/cmpp/util.c b/src/xspice/cmpp/util.c index 9ff8b6dd1..079ecb1d0 100755 --- a/src/xspice/cmpp/util.c +++ b/src/xspice/cmpp/util.c @@ -71,9 +71,7 @@ void print_error( /* Convert a string to all lower case */ -str_to_lower(s) - -char *s; /* The string to convert */ +void str_to_lower(char *s) { int i; char c; diff --git a/src/xspice/cmpp/writ_ifs.c b/src/xspice/cmpp/writ_ifs.c index 83f260202..356986ff0 100755 --- a/src/xspice/cmpp/writ_ifs.c +++ b/src/xspice/cmpp/writ_ifs.c @@ -40,15 +40,10 @@ NON-STANDARD FEATURES #include +#include +#include #include "cmpp.h" -/* Explicitly prototype malloc and free. BSD has no header file for this */ - -void *malloc(unsigned size); -void *realloc(void *ptr, unsigned size); -void free(void *ptr); - - /* Local function prototypes */ static void write_comment(FILE *fp, Ifs_Table_t *ifs_table); @@ -463,9 +458,6 @@ static void write_conn_info( int i; int j; char *str; - Boolean_t is_array; - Data_Type_t type; - /* Only write the connTable if there is something to put in it. */ /* Otherwise, we will put NULL in the SPICEdev structure in its slot */ @@ -628,8 +620,6 @@ static void write_param_info( int i; char *str; - Boolean_t is_array; - Data_Type_t type; /* Only write the paramTable if there is something to put in it. */ @@ -797,9 +787,6 @@ static void write_inst_var_info( int i; char *str; - Boolean_t is_array; - Data_Type_t type; - /* Only write the inst_varTable if there is something to put in it. */ /* Otherwise, we will put NULL in the SPICEdev structure in its slot */ diff --git a/src/xspice/evt/evtinit.c b/src/xspice/evt/evtinit.c index 1c59e01b1..62efa854d 100755 --- a/src/xspice/evt/evtinit.c +++ b/src/xspice/evt/evtinit.c @@ -267,12 +267,12 @@ static int EVTinit_info( Evt_Port_Info_t *port; Evt_Output_Info_t *output; - Evt_Inst_Info_t **inst_table; - Evt_Node_Info_t **node_table; - Evt_Port_Info_t **port_table; - Evt_Output_Info_t **output_table; + Evt_Inst_Info_t **inst_table = NULL; + Evt_Node_Info_t **node_table = NULL; + Evt_Port_Info_t **port_table = NULL; + Evt_Output_Info_t **output_table = NULL; - int *hybrid_index; + int *hybrid_index = NULL; int num_hybrids; diff --git a/src/xspice/evt/evtprint.c b/src/xspice/evt/evtprint.c index 2c82c2ddb..dd611bd3d 100755 --- a/src/xspice/evt/evtprint.c +++ b/src/xspice/evt/evtprint.c @@ -117,7 +117,7 @@ void EVTprint( Mif_Boolean_t more; Mif_Boolean_t dcop; - double step; + double step = 0.0; double next_step; double this_step; diff --git a/src/xspice/icm/analog/ilimit/cfunc.mod b/src/xspice/icm/analog/ilimit/cfunc.mod index 5d7e54313..6d5d1be12 100644 --- a/src/xspice/icm/analog/ilimit/cfunc.mod +++ b/src/xspice/icm/analog/ilimit/cfunc.mod @@ -117,7 +117,7 @@ void cm_ilimit(ARGS) /* structure holding parms, { double in_offset,gain,r_out_source,r_out_sink,i_limit_source, i_limit_sink,v_pwr_range,i_source_range,i_sink_range, - r_out_domain,out_lower_limit,out_upper_limit,veq,pveq_pvin, + r_out_domain,/*out_lower_limit,out_upper_limit,*/veq,pveq_pvin, pveq_pvpos,pveq_pvneg,r_out,pr_out_px,i_out,i_threshold_lower, i_threshold_upper,i_pos_pwr,pi_out_pvin,pi_pos_pvneg, pi_pos_pvpos,pi_pos_pvout,i_neg_pwr,pi_neg_pvin,pi_neg_pvneg, diff --git a/src/xspice/icm/analog/oneshot/cfunc.mod b/src/xspice/icm/analog/oneshot/cfunc.mod index ca988b805..b19e1b685 100644 --- a/src/xspice/icm/analog/oneshot/cfunc.mod +++ b/src/xspice/icm/analog/oneshot/cfunc.mod @@ -141,6 +141,8 @@ NON-STANDARD FEATURES * ****************************************************************************************/ +#include + void cm_oneshot(ARGS) /* structure holding parms, inputs, outputs, etc. */ { @@ -161,11 +163,11 @@ void cm_oneshot(ARGS) /* structure holding parms, double *x; /* pointer used to store the control array */ double *y; /* pointer used to store the pulse-width array */ double cntl_input; /* the actual value of the control input */ - double out; /* value of the output */ + /*double out;*/ /* value of the output */ double dout_din; /* slope of the pw wrt the control voltage */ double output_low; /* output low value */ double output_hi; /* output high value */ - double pw; /* actual value of the pulse-width */ + double pw=0.0; /* actual value of the pulse-width */ /* double del_out; value of the delay time between triggering and a change in the output */ double del_rise; /* value of the delay time between triggering diff --git a/src/xspice/icm/analog/pwl/cfunc.mod b/src/xspice/icm/analog/pwl/cfunc.mod index ce1624cde..1d0b53e42 100644 --- a/src/xspice/icm/analog/pwl/cfunc.mod +++ b/src/xspice/icm/analog/pwl/cfunc.mod @@ -122,6 +122,8 @@ NON-STANDARD FEATURES ==============================================================================*/ +#include + /*=== Static LIMIT_X_VALUE ROUTINE ================*/ /** limit_x_value ******************************************/ diff --git a/src/xspice/icm/analog/s_xfer/cfunc.mod b/src/xspice/icm/analog/s_xfer/cfunc.mod index d3f2323fd..05e3856de 100644 --- a/src/xspice/icm/analog/s_xfer/cfunc.mod +++ b/src/xspice/icm/analog/s_xfer/cfunc.mod @@ -117,6 +117,7 @@ NON-STANDARD FEATURES NONE ==============================================================================*/ +#include /*=== Static CM_COMPLEX_DIV ROUTINE ===*/ @@ -214,7 +215,7 @@ void cm_s_xfer(ARGS) /* structure holding parms, inputs, outputs, etc. */ denonminator coefficients */ double **num_coefficient; /* dynamic array that holds the numerator coefficients */ - double **old_num_coefficient;/* dynamic array that holds the old numerator + /*double **old_num_coefficient;?* dynamic array that holds the old numerator coefficients */ double factor; /* gain factor in case the highest denominator coefficient is not 1 */ @@ -223,7 +224,7 @@ void cm_s_xfer(ARGS) /* structure holding parms, inputs, outputs, etc. */ double null; /* dummy pointer for use with the integrate function */ double pout_pin; /* partial out wrt in */ - double total_gain; /* not used, currently-used with ITP stuff */ + /*double total_gain;*/ /* not used, currently-used with ITP stuff */ double temp; /* temporary variable used with the correct type of AC value */ double frac; /* holds fractional part of a divide */ @@ -410,7 +411,7 @@ void cm_s_xfer(ARGS) /* structure holding parms, inputs, outputs, etc. */ /* Test denominator highest order coefficient...if that value */ /* is other than 1.0, then divide all denominator coefficients */ /* and the gain by that value... */ - if ( factor = PARAM(den_coeff[den_size-1]) != 1.0 ) { + if ( (factor = PARAM(den_coeff[den_size-1])) != 1.0 ) { for (i=0; i /*=== CM_SINE ROUTINE ===*/ @@ -130,13 +131,13 @@ void cm_sine(ARGS) /* structure holding parms, double *x; /* pointer to the control array values */ double *y; /* pointer to the frequency array values */ double cntl_input; /* control input */ - double out; /* output value */ + /*double out;*/ /* output value */ double dout_din; /* partial derivative of output wrt control in */ double output_low; /* output low value */ double output_hi; /* output high value */ double *phase; /* pointer to the instantaneous phase value */ double *phase1; /* pointer to the previous value for the phase */ - double freq; /* frequency of the sine wave */ + double freq=0.0; /* frequency of the sine wave */ double center; /* dc offset for the sine wave */ double peak; /* peak voltage value for the wave */ double radian; /* phase value in radians */ diff --git a/src/xspice/icm/analog/square/cfunc.mod b/src/xspice/icm/analog/square/cfunc.mod index bdff79c2d..0d9f5353d 100644 --- a/src/xspice/icm/analog/square/cfunc.mod +++ b/src/xspice/icm/analog/square/cfunc.mod @@ -118,6 +118,7 @@ NON-STANDARD FEATURES NONE ==============================================================================*/ +#include /*=== CM_SQUARE ROUTINE ===*/ @@ -155,7 +156,7 @@ void cm_square(ARGS) /* structure holding parms, double *x; /* pointer to the control array values */ double *y; /* pointer to the frequecy array values */ double cntl_input; /* control input */ - double out; /* output */ + /*double out;*/ /* output */ double dout_din; /* slope of the frequency array wrt the control array. Used to extrapolate a frequency above and below the control input high and low level */ @@ -164,7 +165,7 @@ void cm_square(ARGS) /* structure holding parms, double dphase; /* fractional part into cycle */ double *phase; /* pointer to the phase value */ double *phase1; /* pointer to the old phase value */ - double freq; /* frequency of the wave */ + double freq=0.0; /* frequency of the wave */ double d_cycle; /* duty cycle */ double *t1; /* pointer containing the value of time1 */ double *t2; /* pointer containing the value of time2 */ diff --git a/src/xspice/icm/analog/triangle/cfunc.mod b/src/xspice/icm/analog/triangle/cfunc.mod index 4b1c01e1e..dfb826be8 100644 --- a/src/xspice/icm/analog/triangle/cfunc.mod +++ b/src/xspice/icm/analog/triangle/cfunc.mod @@ -119,6 +119,8 @@ NON-STANDARD FEATURES ==============================================================================*/ +#include + /*=== CM_TRIANGLE ROUTINE ===*/ /***************************************************** @@ -155,14 +157,14 @@ void cm_triangle(ARGS) /* structure holding parms, double *x; /* pointer holds the values of the control array */ double *y; /* pointer holds the values of the freq array */ double cntl_input; /* control input */ - double out; /* output */ + /*double out;*/ /* output */ double dout_din; /* partial out wrt to control input */ double output_low; /* lowest point of the wave */ double output_hi; /* highest point of the wave */ double dphase; /* percent into the current phase of the cycle */ double *phase; /* instantaneous phase value */ double *phase1; /* pointer to the previous phase value */ - double freq; /* actual frequency of the wave */ + double freq=0.0; /* actual frequency of the wave */ double d_cycle; /* duty cycle */ double *t1; /* pointer which stores time1 */ double *t2; /* pointer which stores time2 */ diff --git a/src/xspice/icm/digital/adc_bridge/cfunc.mod b/src/xspice/icm/digital/adc_bridge/cfunc.mod index a46cb1267..15797339a 100644 --- a/src/xspice/icm/digital/adc_bridge/cfunc.mod +++ b/src/xspice/icm/digital/adc_bridge/cfunc.mod @@ -318,6 +318,8 @@ void cm_adc_bridge(ARGS) case ZERO: OUTPUT_DELAY(out[i]) = PARAM(rise_delay); break; + case UNKNOWN: /* should never get here! */ + break; } } else { diff --git a/src/xspice/icm/digital/d_buffer/cfunc.mod b/src/xspice/icm/digital/d_buffer/cfunc.mod index bbc071d55..e4d629e37 100644 --- a/src/xspice/icm/digital/d_buffer/cfunc.mod +++ b/src/xspice/icm/digital/d_buffer/cfunc.mod @@ -124,7 +124,7 @@ NON-STANDARD FEATURES void cm_d_buffer(ARGS) { - int i; /* generic loop counter index */ + /*int i;*/ /* generic loop counter index */ diff --git a/src/xspice/icm/digital/d_dff/cfunc.mod b/src/xspice/icm/digital/d_dff/cfunc.mod index 509674155..19093de21 100644 --- a/src/xspice/icm/digital/d_dff/cfunc.mod +++ b/src/xspice/icm/digital/d_dff/cfunc.mod @@ -120,7 +120,7 @@ NON-STANDARD FEATURES NONE -/*=============================================================================*/ +=============================================================================*/ /*=== CM_TOGGLE_BIT ROUTINE ===*/ @@ -198,7 +198,7 @@ NON-STANDARD FEATURES void cm_d_dff(ARGS) { - int i; /* generic loop counter index */ + /*int i;*/ /* generic loop counter index */ Digital_State_t *clk, /* current clk value */ diff --git a/src/xspice/icm/digital/d_dlatch/cfunc.mod b/src/xspice/icm/digital/d_dlatch/cfunc.mod index d6a5bacf1..7afe21694 100644 --- a/src/xspice/icm/digital/d_dlatch/cfunc.mod +++ b/src/xspice/icm/digital/d_dlatch/cfunc.mod @@ -200,7 +200,7 @@ NON-STANDARD FEATURES void cm_d_dlatch(ARGS) { - int i; /* generic loop counter index */ + /*int i;*/ /* generic loop counter index */ Digital_State_t *data, /* current data value */ diff --git a/src/xspice/icm/digital/d_inverter/cfunc.mod b/src/xspice/icm/digital/d_inverter/cfunc.mod index 4e808ee83..a07b8b981 100644 --- a/src/xspice/icm/digital/d_inverter/cfunc.mod +++ b/src/xspice/icm/digital/d_inverter/cfunc.mod @@ -127,7 +127,7 @@ NON-STANDARD FEATURES void cm_d_inverter(ARGS) { - int i; /* generic loop counter index */ + /*int i;*/ /* generic loop counter index */ diff --git a/src/xspice/icm/digital/d_jkff/cfunc.mod b/src/xspice/icm/digital/d_jkff/cfunc.mod index 5e05948ef..3d7cb6031 100644 --- a/src/xspice/icm/digital/d_jkff/cfunc.mod +++ b/src/xspice/icm/digital/d_jkff/cfunc.mod @@ -288,7 +288,7 @@ NON-STANDARD FEATURES void cm_d_jkff(ARGS) { - int i; /* generic loop counter index */ + /*int i;*/ /* generic loop counter index */ Digital_State_t *clk, /* current clk value */ diff --git a/src/xspice/icm/digital/d_open_c/cfunc.mod b/src/xspice/icm/digital/d_open_c/cfunc.mod index 97b69704b..653d77571 100644 --- a/src/xspice/icm/digital/d_open_c/cfunc.mod +++ b/src/xspice/icm/digital/d_open_c/cfunc.mod @@ -124,7 +124,7 @@ NON-STANDARD FEATURES void cm_d_open_c(ARGS) { - int i; /* generic loop counter index */ + /*int i;*/ /* generic loop counter index */ diff --git a/src/xspice/icm/digital/d_open_e/cfunc.mod b/src/xspice/icm/digital/d_open_e/cfunc.mod index 647ecf188..c01172426 100644 --- a/src/xspice/icm/digital/d_open_e/cfunc.mod +++ b/src/xspice/icm/digital/d_open_e/cfunc.mod @@ -124,7 +124,7 @@ NON-STANDARD FEATURES void cm_d_open_e(ARGS) { - int i; /* generic loop counter index */ + /*int i;*/ /* generic loop counter index */ diff --git a/src/xspice/icm/digital/d_osc/cfunc.mod b/src/xspice/icm/digital/d_osc/cfunc.mod index 3e0ade2aa..80fcc6ba0 100644 --- a/src/xspice/icm/digital/d_osc/cfunc.mod +++ b/src/xspice/icm/digital/d_osc/cfunc.mod @@ -157,6 +157,8 @@ NON-STANDARD FEATURES * * *************************************************************/ +#include + void cm_d_osc(ARGS) { @@ -167,9 +169,9 @@ void cm_d_osc(ARGS) *phase_old, /* previous phase of the model */ *t1, /* pointer to t1 value */ *t3, /* pointer to t3 value */ - time1, /* variable for calculating new time1 value */ - time3, /* variable for calculating new time3 value */ - freq, /* instantaneous frequency value */ + /*time1,*/ /* variable for calculating new time1 value */ + /*time3,*/ /* variable for calculating new time3 value */ + freq = 0.0, /* instantaneous frequency value */ dphase, /* fractional part into cycle */ duty_cycle, /* duty_cycle value */ test_double, /* testing variable */ diff --git a/src/xspice/icm/digital/d_ram/cfunc.mod b/src/xspice/icm/digital/d_ram/cfunc.mod index 8be72e966..808beedd5 100644 --- a/src/xspice/icm/digital/d_ram/cfunc.mod +++ b/src/xspice/icm/digital/d_ram/cfunc.mod @@ -342,6 +342,8 @@ static int cm_mask_and_store(short *base,int ram_offset,Digital_State_t out) break; } + +return 0; } @@ -517,6 +519,7 @@ static int cm_mask_and_retrieve(short base,int ram_offset,Digital_State_t *out) } break; } +return 0; } @@ -575,9 +578,9 @@ NON-STANDARD FEATURES static void cm_initialize_ram(Digital_State_t out,int word_width,int bit_number, int word_number,short *ram) { - int err, /* error index value */ + int /*err,*/ /* error index value */ int1, /* temp storage variable */ - int2, /* temp storage variable */ + /*int2,*/ /* temp storage variable */ ram_index, /* ram base address at which word bits will be found */ ram_offset; /* offset from ram base address at which bit[0] diff --git a/src/xspice/icm/digital/d_source/cfunc.mod b/src/xspice/icm/digital/d_source/cfunc.mod index 9fcfa495e..635febd59 100644 --- a/src/xspice/icm/digital/d_source/cfunc.mod +++ b/src/xspice/icm/digital/d_source/cfunc.mod @@ -140,12 +140,14 @@ string is copied to malloced storage and a pointer to that storage is returned. The original input string is undisturbed. */ +#include + static char *CNVgettok(char **s) { char *buf; /* temporary storage to copy token into */ - char *temp; /* temporary storage to copy token into */ + /*char *temp;*/ /* temporary storage to copy token into */ char *ret_str; /* storage for returned string */ int i; @@ -345,8 +347,8 @@ float *p_value; /* OUT - The numerical value */ line_t val_str; - char *suffix; - char c; + /*char *suffix;*/ + char c = ' '; char c1; float scale_factor; @@ -668,6 +670,7 @@ static int cm_source_mask_and_store(short *base,int bit_offset,int bit_value) } *base = *base | bit_value; +return 0; } @@ -727,7 +730,7 @@ static void cm_get_source_value(int word_width,int bit_number,int index, short *bits, Digital_t *out) { - int err, /* error index value */ + int /*err,*/ /* error index value */ int1, /* temp storage variable */ bit_index, /* bits base address at which word bits will be found */ diff --git a/src/xspice/icm/digital/d_srff/cfunc.mod b/src/xspice/icm/digital/d_srff/cfunc.mod index 2f3964fb9..bb8833079 100644 --- a/src/xspice/icm/digital/d_srff/cfunc.mod +++ b/src/xspice/icm/digital/d_srff/cfunc.mod @@ -120,7 +120,7 @@ NON-STANDARD FEATURES NONE -/*=============================================================================*/ +=============================================================================*/ /*=== CM_TOGGLE_BIT ROUTINE ===*/ @@ -188,7 +188,7 @@ static Digital_State_t cm_eval_sr_result(Digital_State_t s_input, Digital_State_t r_input, Digital_State_t old_output) { - Digital_State_t output; + Digital_State_t output = ZERO; switch (s_input) { @@ -287,7 +287,7 @@ NON-STANDARD FEATURES void cm_d_srff(ARGS) { - int i; /* generic loop counter index */ + /*int i;*/ /* generic loop counter index */ Digital_State_t *clk, /* current clk value */ diff --git a/src/xspice/icm/digital/d_srlatch/cfunc.mod b/src/xspice/icm/digital/d_srlatch/cfunc.mod index 78afe381b..40e654aab 100644 --- a/src/xspice/icm/digital/d_srlatch/cfunc.mod +++ b/src/xspice/icm/digital/d_srlatch/cfunc.mod @@ -188,7 +188,7 @@ static Digital_State_t cm_eval_sr_result(Digital_State_t s_input, Digital_State_t r_input, Digital_State_t old_output) { - Digital_State_t output; + Digital_State_t output = ZERO; switch (s_input) { @@ -288,7 +288,7 @@ NON-STANDARD FEATURES void cm_d_srlatch(ARGS) { - int i; /* generic loop counter index */ + /*int i;*/ /* generic loop counter index */ Digital_State_t *s, /* current s-input value */ diff --git a/src/xspice/icm/digital/d_state/cfunc.mod b/src/xspice/icm/digital/d_state/cfunc.mod index b31718c45..1e3d71395 100644 --- a/src/xspice/icm/digital/d_state/cfunc.mod +++ b/src/xspice/icm/digital/d_state/cfunc.mod @@ -192,7 +192,7 @@ NON-STANDARD FEATURES NONE ==============================================================================*/ - +#include /*=== Static CNVgettok ROUTINE ================*/ /* @@ -207,7 +207,7 @@ static char *CNVgettok(char **s) { char *buf; /* temporary storage to copy token into */ - char *temp; /* temporary storage to copy token into */ + /*char *temp;*/ /* temporary storage to copy token into */ char *ret_str; /* storage for returned string */ int i; @@ -407,8 +407,8 @@ float *p_value; /* OUT - The numerical value */ line_t val_str; - char *suffix; - char c; + /*char *suffix;*/ + char c = ' '; char c1; float scale_factor; @@ -925,6 +925,7 @@ static int cm_inputs_mask_and_store(short *base,int bit_offset,int bit_value) } *base = *base | bit_value; +return 0; } @@ -989,7 +990,7 @@ static void cm_store_inputs_value(State_Table_t *states,int index, int bit_numbe int in_val) { - int err, /* error index value */ + int /*err,*/ /* error index value */ int1, /* temp storage variable */ bit_index, /* bits base address at which word bits will be found */ @@ -1105,6 +1106,7 @@ static int cm_bits_mask_and_store(short *base,int bit_offset,int bit_value) } *base = *base | bit_value; +return 0; } @@ -1309,7 +1311,7 @@ static void cm_get_bits_value(State_Table_t *states,int index, int bit_number, Digital_t *out) { - int err, /* error index value */ + int /*err,*/ /* error index value */ int1, /* temp storage variable */ bit_index, /* bits base address at which word bits will be found */ @@ -1402,7 +1404,7 @@ static void cm_store_bits_value(State_Table_t *states,int index, int bit_number, int in_val) { - int err, /* error index value */ + int /*err,*/ /* error index value */ int1, /* temp storage variable */ bit_index, /* bits base address at which word bits will be found */ @@ -1498,17 +1500,17 @@ static int cm_read_state_file(FILE *state_file,State_Table_t *states) int i, /* indexing variable */ j, /* indexing variable */ num_tokens, /* number of tokens in a given string */ - bit_index, /* index to which bits[] integer we are accessing */ - bit_offset, /* index to which bit within the current bits[] + /*bit_index,*/ /* index to which bits[] integer we are accessing */ + /*bit_offset,*/ /* index to which bit within the current bits[] integer we are accessing */ - string_type, /* integer holding value corresponding to the + string_type; /* integer holding value corresponding to the type of input string obtained: 1 = HEADER => State Header string 2 = CONTINUATION => a continuation line... values of state and bits must be retreived from the previous string. */ - int1; /* temporary holding variable */ + /*int1;*/ /* temporary holding variable */ Cnv_Token_Type_t type; /* variable for testing token type returned. */ @@ -1524,12 +1526,9 @@ static int cm_read_state_file(FILE *state_file,State_Table_t *states) float number; /* holding variable for timepoint values */ - double double1, /* temporary holding variable */ - double2; /* temporary holding variable */ - - short bit_value, /* holding variable for value read from + short bit_value=0; /* holding variable for value read from state.in file which needs to be stored */ - base; /* holding variable for existing + /*base;*/ /* holding variable for existing non-masked bits[] integer */ @@ -1686,7 +1685,8 @@ static int cm_read_state_file(FILE *state_file,State_Table_t *states) /* set bits values to previous bits values */ for (j=0; jnum_outputs; j++) { - /*** Retrieve the previous bit value ***? + /*** Retrieve the previous bit value ***/ +/* cm_get_bits_value(*states,i,j,&out); switch (out.state) { @@ -1755,7 +1755,7 @@ static int cm_read_state_file(FILE *state_file,State_Table_t *states) break; } - + */ /*** Store this bit value ***/ cm_store_bits_value(states,i,j,bit_value); @@ -1871,7 +1871,7 @@ void cm_d_state(ARGS) { int i, /* generic loop counter index */ j, /* generic loop counter index */ - err, /* integer for storage of error status */ + err=0, /* integer for storage of error status */ test; /* testing integer */ State_Table_t *states; /* pointer to base address structure diff --git a/src/xspice/icm/digital/d_tff/cfunc.mod b/src/xspice/icm/digital/d_tff/cfunc.mod index b6069e8b7..5d1e17ad4 100644 --- a/src/xspice/icm/digital/d_tff/cfunc.mod +++ b/src/xspice/icm/digital/d_tff/cfunc.mod @@ -127,7 +127,7 @@ NON-STANDARD FEATURES NONE -/*=============================================================================*/ +=============================================================================*/ /*=== CM_TOGGLE_BIT ROUTINE ===*/ @@ -196,7 +196,7 @@ NON-STANDARD FEATURES NONE -/*=============================================================================*/ +=============================================================================*/ /*=== CM_D_TFF ROUTINE ===*/ @@ -212,7 +212,7 @@ NON-STANDARD FEATURES void cm_d_tff(ARGS) { - int i; /* generic loop counter index */ + /*int i;*/ /* generic loop counter index */ Digital_State_t *clk, /* current clk value */ diff --git a/src/xspice/icm/digital/d_xnor/cfunc.mod b/src/xspice/icm/digital/d_xnor/cfunc.mod index 65beb0a15..0d01a42ea 100644 --- a/src/xspice/icm/digital/d_xnor/cfunc.mod +++ b/src/xspice/icm/digital/d_xnor/cfunc.mod @@ -120,7 +120,7 @@ NON-STANDARD FEATURES NONE -/*=============================================================================*/ +=============================================================================*/ /*=== CM_TOGGLE_BIT ROUTINE ===*/ @@ -188,7 +188,7 @@ NON-STANDARD FEATURES NONE -/*=============================================================================*/ +=============================================================================*/ /*=== CM_D_XNOR ROUTINE ===*/ diff --git a/src/xspice/icm/digital/d_xor/cfunc.mod b/src/xspice/icm/digital/d_xor/cfunc.mod index 2cdd30001..926705275 100644 --- a/src/xspice/icm/digital/d_xor/cfunc.mod +++ b/src/xspice/icm/digital/d_xor/cfunc.mod @@ -49,7 +49,7 @@ NON-STANDARD FEATURES NONE -/*============================================================================== +============================================================================== FUNCTION cm_toggle_bit() @@ -93,7 +93,7 @@ NON-STANDARD FEATURES NONE -/*=============================================================================*/ +=============================================================================*/ /*=== CM_TOGGLE_BIT ROUTINE ===*/ @@ -162,7 +162,7 @@ NON-STANDARD FEATURES NONE -/*=============================================================================*/ +=============================================================================*/ /*=== CM_D_XOR ROUTINE ===*/ diff --git a/src/xspice/icm/makedefs.in b/src/xspice/icm/makedefs.in index 5c56f042f..638bf52d4 100644 --- a/src/xspice/icm/makedefs.in +++ b/src/xspice/icm/makedefs.in @@ -7,6 +7,7 @@ srcdir = @srcdir@ top_builddir = ../../.. top_srcdir = @top_srcdir@ subdir = src/xspice/icm +mkdir_p = @mkdir_p@ # C compiler to use CC = @CC@ @@ -29,7 +30,8 @@ CMDIRS = spice2poly digital analog xtradev xtraevt # Install instructions # or use mkdir -p -mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +#mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +mkinstalldirs = $(mkdir_p) INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ diff --git a/src/xspice/icm/spice2poly/icm_spice2poly/cfunc.mod b/src/xspice/icm/spice2poly/icm_spice2poly/cfunc.mod index 4bf354e20..d9738dbb8 100644 --- a/src/xspice/icm/spice2poly/icm_spice2poly/cfunc.mod +++ b/src/xspice/icm/spice2poly/icm_spice2poly/cfunc.mod @@ -281,7 +281,7 @@ stmt20: if(k == pdim) goto stmt30; stmt30: km1 = k - 1; for(i = 1; i <= km1; i++) if(PWRSEQ(i) != 0) goto stmt50; -stmt40: PWRSEQ(1) = PWRSEQ(pdim) + 1; +/*stmt40:*/ PWRSEQ(1) = PWRSEQ(pdim) + 1; PWRSEQ(pdim) = 0; goto stmt100; stmt50: psum = 1; diff --git a/src/xspice/icm/xtradev/core/cfunc.mod b/src/xspice/icm/xtradev/core/cfunc.mod index 9829fb494..973ddcca8 100644 --- a/src/xspice/icm/xtradev/core/cfunc.mod +++ b/src/xspice/icm/xtradev/core/cfunc.mod @@ -115,6 +115,8 @@ NON-STANDARD FEATURES ==============================================================================*/ +#include + /*=== CM_CORE ROUTINE ===*/ /*******************************************************************/ diff --git a/src/xspice/icm/xtradev/lcouple/cfunc.mod b/src/xspice/icm/xtradev/lcouple/cfunc.mod index 0d91dfece..edae159cd 100644 --- a/src/xspice/icm/xtradev/lcouple/cfunc.mod +++ b/src/xspice/icm/xtradev/lcouple/cfunc.mod @@ -131,7 +131,7 @@ void cm_lcouple(ARGS) /* structure holding parms, output_voltage, /* output voltage reflected to electricaL-side */ *output_voltage_fake, /* fake output voltage for use with truncation error checking. */ - input_flux, /* input flux value from core side (represented + /*input_flux,*/ /* input flux value from core side (represented as a current. */ output_mmf, /* output driving amp-turns to core side. */ diff --git a/src/xspice/icm/xtradev/zener/cfunc.mod b/src/xspice/icm/xtradev/zener/cfunc.mod index c414efee9..cadaec4be 100644 --- a/src/xspice/icm/xtradev/zener/cfunc.mod +++ b/src/xspice/icm/xtradev/zener/cfunc.mod @@ -111,6 +111,8 @@ NON-STANDARD FEATURES ==============================================================================*/ +#include + /*=== CM_ZENER ROUTINE ===*/ diff --git a/src/xspice/icm/xtraevt/int/udnfunc.c b/src/xspice/icm/xtraevt/int/udnfunc.c index bf7868b02..1cbdc0ef7 100644 --- a/src/xspice/icm/xtraevt/int/udnfunc.c +++ b/src/xspice/icm/xtraevt/int/udnfunc.c @@ -104,7 +104,7 @@ void udn_int_copy(COPY_ARGS) void udn_int_resolve(RESOLVE_ARGS) { - int **array = INPUT_STRUCT_PTR_ARRAY; + int **array = (int**)INPUT_STRUCT_PTR_ARRAY; int *out = OUTPUT_STRUCT_PTR; int num_struct = INPUT_STRUCT_PTR_ARRAY_SIZE; diff --git a/src/xspice/icm/xtraevt/real/udnfunc.c b/src/xspice/icm/xtraevt/real/udnfunc.c index 57fad9e46..641e28dae 100644 --- a/src/xspice/icm/xtraevt/real/udnfunc.c +++ b/src/xspice/icm/xtraevt/real/udnfunc.c @@ -93,7 +93,7 @@ void udn_real_invert(INVERT_ARGS) void udn_real_resolve(RESOLVE_ARGS) { - double **array = INPUT_STRUCT_PTR_ARRAY; + double **array = (double**)INPUT_STRUCT_PTR_ARRAY; double *out = OUTPUT_STRUCT_PTR; int num_struct = INPUT_STRUCT_PTR_ARRAY_SIZE; diff --git a/src/xspice/icm/xtraevt/real_to_v/cfunc.mod b/src/xspice/icm/xtraevt/real_to_v/cfunc.mod index 3b5e08126..020fc93d0 100644 --- a/src/xspice/icm/xtraevt/real_to_v/cfunc.mod +++ b/src/xspice/icm/xtraevt/real_to_v/cfunc.mod @@ -11,7 +11,7 @@ void ucm_real_to_v (ARGS) double *t, *v; double *in; - double out; + /*double out;*/ in = INPUT(in); diff --git a/src/xspice/ipc/ipcsockets.c b/src/xspice/ipc/ipcsockets.c index 8c4efeba9..bff42e5bd 100755 --- a/src/xspice/ipc/ipcsockets.c +++ b/src/xspice/ipc/ipcsockets.c @@ -488,7 +488,7 @@ Ipc_Status_t ipc_transport_get_line (str, len, wait) int *len; /* length of str passed IN and passed OUT */ Ipc_Wait_t wait; /* IN - wait or dont wait on incoming msg */ { - int count; /* number of bytes read */ + int count = 0; /* number of bytes read */ int message_length; /* extracted from message header */ if (sock_state == IPC_SOCK_UNINITIALIZED) { diff --git a/src/xspice/ipc/ipctiein.c b/src/xspice/ipc/ipctiein.c index 2980241ab..b269052c7 100755 --- a/src/xspice/ipc/ipctiein.c +++ b/src/xspice/ipc/ipctiein.c @@ -50,6 +50,7 @@ NON-STANDARD FEATURES ============================================================================*/ +#define CONFIG #include "ngspice.h" #include diff --git a/src/xspice/mif/mif_inp2.c b/src/xspice/mif/mif_inp2.c index 518ca5e25..06feec4e5 100755 --- a/src/xspice/mif/mif_inp2.c +++ b/src/xspice/mif/mif_inp2.c @@ -174,7 +174,7 @@ card *current; /* the card we are to parse */ int error; /* for the IFC macro */ MIFmodel *mdfast; /* pointer to model struct */ - MIFinstance *fast; /* pointer to instance struct */ + MIFinstance *fast[1]; /* pointer to instance struct */ INPmodel *thismodel; /* pointer to model struct */ @@ -226,11 +226,11 @@ card *current; /* the card we are to parse */ /* create a new structure for this instance in ckt */ mdfast = thismodel->INPmodfast; - IFC(newInstance, (ckt, mdfast,(void **)&fast, name)) + IFC(newInstance, (ckt, mdfast,(void **)fast, name)) /* initialize the code model specific elements of the inst struct */ - MIFinit_inst(mdfast, fast); + MIFinit_inst(mdfast, fast[0]); /* *********************** */ @@ -306,11 +306,11 @@ card *current; /* the card we are to parse */ /* set analog and event_driven flags on instance and model */ if((def_port_type == MIF_DIGITAL) || (def_port_type == MIF_USER_DEFINED)) { - fast->event_driven = MIF_TRUE; + fast[0]->event_driven = MIF_TRUE; mdfast->event_driven = MIF_TRUE; } else { - fast->analog = MIF_TRUE; + fast[0]->analog = MIF_TRUE; mdfast->analog = MIF_TRUE; } @@ -324,8 +324,8 @@ card *current; /* the card we are to parse */ } /* set the null flag to true */ - fast->conn[i]->is_null = MIF_TRUE; - fast->conn[i]->size = 0; + fast[0]->conn[i]->is_null = MIF_TRUE; + fast[0]->conn[i]->size = 0; /* eat the null token and continue to next connection */ next_token = MIFget_token(&line,&next_token_type); @@ -333,7 +333,7 @@ card *current; /* the card we are to parse */ } else { /* set the null flag to false */ - fast->conn[i]->is_null = MIF_FALSE; + fast[0]->conn[i]->is_null = MIF_FALSE; } @@ -358,7 +358,7 @@ card *current; /* the card we are to parse */ MIFget_port(ckt, tab, current, - fast, + fast[0], &line, &next_token, &next_token_type, @@ -372,7 +372,7 @@ card *current; /* the card we are to parse */ if(status == MIF_ERROR) return; - fast->conn[i]->size = 1; + fast[0]->conn[i]->size = 1; /* when we leave here, next_token should hold the next, unprocessed netname */ @@ -408,7 +408,7 @@ card *current; /* the card we are to parse */ MIFget_port(ckt, tab, current, - fast, + fast[0], &line, &next_token, &next_token_type, @@ -439,7 +439,7 @@ card *current; /* the card we are to parse */ LITERR("Array connection must have at least one port"); return; } - fast->conn[i]->size = j; + fast[0]->conn[i]->size = j; /* At this point, the next time we get_token, we should get a % or a net name. We'll do that now, since when we enter the loop, we expect next_token @@ -478,21 +478,21 @@ card *current; /* the card we are to parse */ conn_info = &(DEVices[type]->DEVpublic.conn[i]); - if( (fast->conn[i]->is_null) && + if( (fast[0]->conn[i]->is_null) && (! conn_info->null_allowed) ) { LITERR("Null found for connection where not allowed"); return; } if(conn_info->has_lower_bound) { - if(fast->conn[i]->size < conn_info->lower_bound) { + if(fast[0]->conn[i]->size < conn_info->lower_bound) { LITERR("Too few ports in connection"); return; } } if(conn_info->has_upper_bound) { - if(fast->conn[i]->size > conn_info->upper_bound) { + if(fast[0]->conn[i]->size > conn_info->upper_bound) { LITERR("Too many ports in connection"); return; } @@ -519,7 +519,7 @@ card *current; /* the card we are to parse */ } if((! mdfast->param[i]->is_null) && (param_info->is_array)) { if(param_info->has_conn_ref) { - if(fast->conn[param_info->conn_ref]->size != fast->param[i]->size) { + if(fast[0]->conn[param_info->conn_ref]->size != fast[0]->param[i]->size) { LITERR("Array parameter size on model does not match connection size"); return; } @@ -764,8 +764,8 @@ MIFget_port( { - CKTnode *pos_node; /* positive connection node */ - CKTnode *neg_node; /* negative connection node */ + CKTnode *pos_node[1]; /* positive connection node */ + CKTnode *neg_node[1]; /* negative connection node */ char *node; @@ -856,12 +856,12 @@ MIFget_port( case MIF_DIFF_RESISTANCE: /* Call the spice3c1 function to put this node in the node list in ckt */ - INPtermInsert(ckt, next_token, tab,(void **)&pos_node); + INPtermInsert(ckt, next_token, tab,(void **)pos_node); /* store the equation number and node identifier */ /* This is the equivalent of what CKTbindNode() does in 3C1 */ fast->conn[conn_num]->port[port_num]->pos_node_str = *next_token; - fast->conn[conn_num]->port[port_num]->smp_data.pos_node = pos_node->number; + fast->conn[conn_num]->port[port_num]->smp_data.pos_node = pos_node[0]->number; break; @@ -923,10 +923,10 @@ MIFget_port( // node = "0"; // deleted by K.A. March 5th 2000, this is incorrect, it creates a new pointer // that cause a crash in INPtermInsert() - INPtermInsert(ckt, &node, tab,(void **)&neg_node); + INPtermInsert(ckt, &node, tab,(void **)neg_node); fast->conn[conn_num]->port[port_num]->neg_node_str = node; - fast->conn[conn_num]->port[port_num]->smp_data.neg_node = neg_node->number; + fast->conn[conn_num]->port[port_num]->smp_data.neg_node = neg_node[0]->number; break; case MIF_DIFF_VOLTAGE: @@ -939,9 +939,9 @@ MIFget_port( *status = MIF_ERROR; return; } - INPtermInsert(ckt, next_token, tab,(void **)&neg_node); + INPtermInsert(ckt, next_token, tab,(void **)neg_node); fast->conn[conn_num]->port[port_num]->neg_node_str = *next_token; - fast->conn[conn_num]->port[port_num]->smp_data.neg_node = neg_node->number; + fast->conn[conn_num]->port[port_num]->smp_data.neg_node = neg_node[0]->number; *next_token = MIFget_token(line, next_token_type); break; diff --git a/tests/Makefile.am b/tests/Makefile.am index 50a4de442..b9a22a97e 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -25,7 +25,6 @@ SUBDIRS = TransImpedanceAmp \ DIST_SUBDIRS = bsim1 \ - bsim1 \ bsim2 \ bsim3 \ bsim3soidd \ diff --git a/xgraph/Makefile.am b/xgraph/Makefile.am index 364ddd7ad..931f59d51 100644 --- a/xgraph/Makefile.am +++ b/xgraph/Makefile.am @@ -55,3 +55,9 @@ CFLAGS=$(ADDITIONAL_INCLUDES) $(C_WARNINGS) -g $(X_CFLAGS) xgraph_LDADD= $(ADDITIONAL_LIBS) $(X_LIBS) $(X_PRE_LIBS) $(X_EXTRA_LIBS) -lX11 -lm MAINTAINERCLEANFILES= Makefile.in + +mrproper: maintainer-clean + rm -f `find . -type f -name "*~" -print` + rm -f `find . -type f -name "*.orig" -print` + rm -f `find . -type f -name "*.rej" -print` + diff --git a/xgraph/aclocal.m4 b/xgraph/aclocal.m4 index fd58a3053..1cf8dcfa0 100644 --- a/xgraph/aclocal.m4 +++ b/xgraph/aclocal.m4 @@ -1,70 +1,931 @@ -dnl aclocal.m4 generated automatically by aclocal 1.4 +# generated automatically by aclocal 1.8.5 -*- Autoconf -*- -dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. -dnl This file is free software; the Free Software Foundation -dnl gives unlimited permission to copy and/or distribute it, -dnl with or without modifications, as long as this notice is preserved. +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 +# Free Software Foundation, Inc. +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. -dnl This program is distributed in the hope that it will be useful, -dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without -dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A -dnl PARTICULAR PURPOSE. +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. -# Do all the work for Automake. This macro actually does too much -- -# some checks are only needed if your package does certain things. -# But this isn't really a big deal. +# -*- Autoconf -*- +# Copyright (C) 2002, 2003 Free Software Foundation, Inc. +# Generated from amversion.in; do not edit by hand. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + +# AM_AUTOMAKE_VERSION(VERSION) +# ---------------------------- +# Automake X.Y traces this macro to ensure aclocal.m4 has been +# generated from the m4 files accompanying Automake X.Y. +AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version="1.8"]) + +# AM_SET_CURRENT_AUTOMAKE_VERSION +# ------------------------------- +# Call AM_AUTOMAKE_VERSION so it can be traced. +# This function is AC_REQUIREd by AC_INIT_AUTOMAKE. +AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], + [AM_AUTOMAKE_VERSION([1.8.5])]) + +# AM_AUX_DIR_EXPAND + +# Copyright (C) 2001, 2003 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets +# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to +# `$srcdir', `$srcdir/..', or `$srcdir/../..'. +# +# Of course, Automake must honor this variable whenever it calls a +# tool from the auxiliary directory. The problem is that $srcdir (and +# therefore $ac_aux_dir as well) can be either absolute or relative, +# depending on how configure is run. This is pretty annoying, since +# it makes $ac_aux_dir quite unusable in subdirectories: in the top +# source directory, any form will work fine, but in subdirectories a +# relative path needs to be adjusted first. +# +# $ac_aux_dir/missing +# fails when called from a subdirectory if $ac_aux_dir is relative +# $top_srcdir/$ac_aux_dir/missing +# fails if $ac_aux_dir is absolute, +# fails when called from a subdirectory in a VPATH build with +# a relative $ac_aux_dir +# +# The reason of the latter failure is that $top_srcdir and $ac_aux_dir +# are both prefixed by $srcdir. In an in-source build this is usually +# harmless because $srcdir is `.', but things will broke when you +# start a VPATH build or use an absolute $srcdir. +# +# So we could use something similar to $top_srcdir/$ac_aux_dir/missing, +# iff we strip the leading $srcdir from $ac_aux_dir. That would be: +# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` +# and then we would define $MISSING as +# MISSING="\${SHELL} $am_aux_dir/missing" +# This will work as long as MISSING is not called from configure, because +# unfortunately $(top_srcdir) has no meaning in configure. +# However there are other variables, like CC, which are often used in +# configure, and could therefore not use this "fixed" $ac_aux_dir. +# +# Another solution, used here, is to always expand $ac_aux_dir to an +# absolute PATH. The drawback is that using absolute paths prevent a +# configured tree to be moved without reconfiguration. + +AC_DEFUN([AM_AUX_DIR_EXPAND], +[dnl Rely on autoconf to set up CDPATH properly. +AC_PREREQ([2.50])dnl +# expand $ac_aux_dir to an absolute path +am_aux_dir=`cd $ac_aux_dir && pwd` +]) + +# AM_CONDITIONAL -*- Autoconf -*- + +# Copyright (C) 1997, 2000, 2001, 2003 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +# serial 6 + +# AM_CONDITIONAL(NAME, SHELL-CONDITION) +# ------------------------------------- +# Define a conditional. +AC_DEFUN([AM_CONDITIONAL], +[AC_PREREQ(2.52)dnl + ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], + [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl +AC_SUBST([$1_TRUE]) +AC_SUBST([$1_FALSE]) +if $2; then + $1_TRUE= + $1_FALSE='#' +else + $1_TRUE='#' + $1_FALSE= +fi +AC_CONFIG_COMMANDS_PRE( +[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then + AC_MSG_ERROR([conditional "$1" was never defined. +Usually this means the macro was only invoked conditionally.]) +fi])]) + +# serial 7 -*- Autoconf -*- + +# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004 +# Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + + +# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be +# written in clear, in which case automake, when reading aclocal.m4, +# will think it sees a *use*, and therefore will trigger all it's +# C support machinery. Also note that it means that autoscan, seeing +# CC etc. in the Makefile, will ask for an AC_PROG_CC use... + + + +# _AM_DEPENDENCIES(NAME) +# ---------------------- +# See how the compiler implements dependency checking. +# NAME is "CC", "CXX", "GCJ", or "OBJC". +# We try a few techniques and use that to set a single cache variable. +# +# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was +# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular +# dependency, and given that the user is not expected to run this macro, +# just rely on AC_PROG_CC. +AC_DEFUN([_AM_DEPENDENCIES], +[AC_REQUIRE([AM_SET_DEPDIR])dnl +AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl +AC_REQUIRE([AM_MAKE_INCLUDE])dnl +AC_REQUIRE([AM_DEP_TRACK])dnl + +ifelse([$1], CC, [depcc="$CC" am_compiler_list=], + [$1], CXX, [depcc="$CXX" am_compiler_list=], + [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], + [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], + [depcc="$$1" am_compiler_list=]) + +AC_CACHE_CHECK([dependency style of $depcc], + [am_cv_$1_dependencies_compiler_type], +[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named `D' -- because `-MD' means `put the output + # in D'. + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_$1_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` + fi + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with + # Solaris 8's {/usr,}/bin/sh. + touch sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + case $depmode in + nosideeffect) + # after this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + none) break ;; + esac + # We check with `-c' and `-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle `-M -o', and we need to detect this. + if depmode=$depmode \ + source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_$1_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_$1_dependencies_compiler_type=none +fi +]) +AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) +AM_CONDITIONAL([am__fastdep$1], [ + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) +]) + + +# AM_SET_DEPDIR +# ------------- +# Choose a directory name for dependency files. +# This macro is AC_REQUIREd in _AM_DEPENDENCIES +AC_DEFUN([AM_SET_DEPDIR], +[AC_REQUIRE([AM_SET_LEADING_DOT])dnl +AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl +]) + + +# AM_DEP_TRACK +# ------------ +AC_DEFUN([AM_DEP_TRACK], +[AC_ARG_ENABLE(dependency-tracking, +[ --disable-dependency-tracking speeds up one-time build + --enable-dependency-tracking do not reject slow dependency extractors]) +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' +fi +AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) +AC_SUBST([AMDEPBACKSLASH]) +]) + +# Generate code to set up dependency tracking. -*- Autoconf -*- + +# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +#serial 2 + +# _AM_OUTPUT_DEPENDENCY_COMMANDS +# ------------------------------ +AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], +[for mf in $CONFIG_FILES; do + # Strip MF so we end up with the name of the file. + mf=`echo "$mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile or not. + # We used to match only the files named `Makefile.in', but + # some people rename them; so instead we look at the file content. + # Grep'ing the first line is not enough: some people post-process + # each Makefile.in and add a new line on top of each file to say so. + # So let's grep whole file. + if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then + dirpart=`AS_DIRNAME("$mf")` + else + continue + fi + grep '^DEP_FILES *= *[[^ @%:@]]' < "$mf" > /dev/null || continue + # Extract the definition of DEP_FILES from the Makefile without + # running `make'. + DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` + test -z "$DEPDIR" && continue + # When using ansi2knr, U may be empty or an underscore; expand it + U=`sed -n 's/^U = //p' < "$mf"` + test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR" + # We invoke sed twice because it is the simplest approach to + # changing $(DEPDIR) to its actual value in the expansion. + for file in `sed -n ' + /^DEP_FILES = .*\\\\$/ { + s/^DEP_FILES = // + :loop + s/\\\\$// + p + n + /\\\\$/ b loop + p + } + /^DEP_FILES = / s/^DEP_FILES = //p' < "$mf" | \ + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do + # Make sure the directory exists. + test -f "$dirpart/$file" && continue + fdir=`AS_DIRNAME(["$file"])` + AS_MKDIR_P([$dirpart/$fdir]) + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done +done +])# _AM_OUTPUT_DEPENDENCY_COMMANDS + + +# AM_OUTPUT_DEPENDENCY_COMMANDS +# ----------------------------- +# This macro should only be invoked once -- use via AC_REQUIRE. +# +# This code is only required when automatic dependency tracking +# is enabled. FIXME. This creates each `.P' file that we will +# need in order to bootstrap the dependency handling code. +AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], +[AC_CONFIG_COMMANDS([depfiles], + [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], + [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) +]) + + +# Copyright (C) 1996, 1998, 1999, 2000, 2001, 2002, 2003 +# Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +# serial 2 + +AC_DEFUN([AM_WITH_DMALLOC], +[AC_MSG_CHECKING([if malloc debugging is wanted]) +AC_ARG_WITH(dmalloc, +[ --with-dmalloc use dmalloc, as in + http://www.dmalloc.com/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)]) +]) + +AU_DEFUN([fp_WITH_DMALLOC], [AM_WITH_DMALLOC]) + +# Do all the work for Automake. -*- Autoconf -*- + +# This macro actually does too much some checks are only needed if +# your package does certain things. But this isn't really a big deal. + +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 +# Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +# serial 11 + +# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) +# AM_INIT_AUTOMAKE([OPTIONS]) +# ----------------------------------------------- +# The call with PACKAGE and VERSION arguments is the old style +# call (pre autoconf-2.50), which is being phased out. PACKAGE +# and VERSION should now be passed to AC_INIT and removed from +# the call to AM_INIT_AUTOMAKE. +# We support both call styles for the transition. After +# the next Automake release, Autoconf can make the AC_INIT +# arguments mandatory, and then we can depend on a new Autoconf +# release and drop the old call support. +AC_DEFUN([AM_INIT_AUTOMAKE], +[AC_PREREQ([2.58])dnl +dnl Autoconf wants to disallow AM_ names. We explicitly allow +dnl the ones we care about. +m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl +AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl +AC_REQUIRE([AC_PROG_INSTALL])dnl +# test to see if srcdir already configured +if test "`cd $srcdir && pwd`" != "`pwd`" && + test -f $srcdir/config.status; then + AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) +fi + +# test whether we have cygpath +if test -z "$CYGPATH_W"; then + if (cygpath --version) >/dev/null 2>/dev/null; then + CYGPATH_W='cygpath -w' + else + CYGPATH_W=echo + fi +fi +AC_SUBST([CYGPATH_W]) + +# Define the identity of the package. +dnl Distinguish between old-style and new-style calls. +m4_ifval([$2], +[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl + AC_SUBST([PACKAGE], [$1])dnl + AC_SUBST([VERSION], [$2])], +[_AM_SET_OPTIONS([$1])dnl + AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl + AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl + +_AM_IF_OPTION([no-define],, +[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) + AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl + +# Some tools Automake needs. +AC_REQUIRE([AM_SANITY_CHECK])dnl +AC_REQUIRE([AC_ARG_PROGRAM])dnl +AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) +AM_MISSING_PROG(AUTOCONF, autoconf) +AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) +AM_MISSING_PROG(AUTOHEADER, autoheader) +AM_MISSING_PROG(MAKEINFO, makeinfo) +AM_MISSING_PROG(AMTAR, tar) +AM_PROG_INSTALL_SH +AM_PROG_INSTALL_STRIP +AC_REQUIRE([AM_PROG_MKDIR_P])dnl +# We need awk for the "check" target. The system "awk" is bad on +# some platforms. +AC_REQUIRE([AC_PROG_AWK])dnl +AC_REQUIRE([AC_PROG_MAKE_SET])dnl +AC_REQUIRE([AM_SET_LEADING_DOT])dnl + +_AM_IF_OPTION([no-dependencies],, +[AC_PROVIDE_IFELSE([AC_PROG_CC], + [_AM_DEPENDENCIES(CC)], + [define([AC_PROG_CC], + defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl +AC_PROVIDE_IFELSE([AC_PROG_CXX], + [_AM_DEPENDENCIES(CXX)], + [define([AC_PROG_CXX], + defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl +]) +]) + + +# When config.status generates a header, we must update the stamp-h file. +# This file resides in the same directory as the config header +# that is generated. The stamp files are numbered to have different names. + +# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the +# loop where config.status creates the headers, so we can generate +# our stamp files there. +AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], +[# Compute $1's index in $config_headers. +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $1 | $1:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count]) + +# AM_PROG_INSTALL_SH +# ------------------ +# Define $install_sh. + +# Copyright (C) 2001, 2003 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +AC_DEFUN([AM_PROG_INSTALL_SH], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +install_sh=${install_sh-"$am_aux_dir/install-sh"} +AC_SUBST(install_sh)]) + +# -*- Autoconf -*- +# Copyright (C) 2003 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. # serial 1 -dnl Usage: -dnl AM_INIT_AUTOMAKE(package,version, [no-define]) - -AC_DEFUN(AM_INIT_AUTOMAKE, -[AC_REQUIRE([AC_PROG_INSTALL]) -PACKAGE=[$1] -AC_SUBST(PACKAGE) -VERSION=[$2] -AC_SUBST(VERSION) -dnl test to see if srcdir already configured -if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then - AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) +# Check whether the underlying file-system supports filenames +# with a leading dot. For instance MS-DOS doesn't. +AC_DEFUN([AM_SET_LEADING_DOT], +[rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ fi -ifelse([$3],, -AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) -AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])) -AC_REQUIRE([AM_SANITY_CHECK]) -AC_REQUIRE([AC_ARG_PROGRAM]) -dnl FIXME This is truly gross. -missing_dir=`cd $ac_aux_dir && pwd` -AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir) -AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir) -AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir) -AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir) -AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir) -AC_REQUIRE([AC_PROG_MAKE_SET])]) +rmdir .tst 2>/dev/null +AC_SUBST([am__leading_dot])]) + +# Add --enable-maintainer-mode option to configure. +# From Jim Meyering + +# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004 +# Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +# serial 3 + +AC_DEFUN([AM_MAINTAINER_MODE], +[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) + dnl maintainer-mode is disabled by default + AC_ARG_ENABLE(maintainer-mode, +[ --enable-maintainer-mode enable make rules and dependencies not useful + (and sometimes confusing) to the casual installer], + USE_MAINTAINER_MODE=$enableval, + USE_MAINTAINER_MODE=no) + AC_MSG_RESULT([$USE_MAINTAINER_MODE]) + AM_CONDITIONAL(MAINTAINER_MODE, [test $USE_MAINTAINER_MODE = yes]) + MAINT=$MAINTAINER_MODE_TRUE + AC_SUBST(MAINT)dnl +] +) + +AU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE]) + +# Check to see how 'make' treats includes. -*- Autoconf -*- + +# Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +# serial 2 + +# AM_MAKE_INCLUDE() +# ----------------- +# Check to see how make treats includes. +AC_DEFUN([AM_MAKE_INCLUDE], +[am_make=${MAKE-make} +cat > confinc << 'END' +am__doit: + @echo done +.PHONY: am__doit +END +# If we don't find an include directive, just comment out the code. +AC_MSG_CHECKING([for style of include used by $am_make]) +am__include="#" +am__quote= +_am_result=none +# First try GNU make style include. +echo "include confinc" > confmf +# We grep out `Entering directory' and `Leaving directory' +# messages which can occur if `w' ends up in MAKEFLAGS. +# In particular we don't look at `^make:' because GNU make might +# be invoked under some other name (usually "gmake"), in which +# case it prints its new name instead of `make'. +if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then + am__include=include + am__quote= + _am_result=GNU +fi +# Now try BSD make style include. +if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then + am__include=.include + am__quote="\"" + _am_result=BSD + fi +fi +AC_SUBST([am__include]) +AC_SUBST([am__quote]) +AC_MSG_RESULT([$_am_result]) +rm -f confinc confmf +]) + +# -*- Autoconf -*- + + +# Copyright (C) 1997, 1999, 2000, 2001, 2003 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +# serial 3 + +# AM_MISSING_PROG(NAME, PROGRAM) +# ------------------------------ +AC_DEFUN([AM_MISSING_PROG], +[AC_REQUIRE([AM_MISSING_HAS_RUN]) +$1=${$1-"${am_missing_run}$2"} +AC_SUBST($1)]) + + +# AM_MISSING_HAS_RUN +# ------------------ +# Define MISSING if not defined so far and test if it supports --run. +# If it does, set am_missing_run to use it, otherwise, to nothing. +AC_DEFUN([AM_MISSING_HAS_RUN], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" +# Use eval to expand $SHELL +if eval "$MISSING --run true"; then + am_missing_run="$MISSING --run " +else + am_missing_run= + AC_MSG_WARN([`missing' script is too old or missing]) +fi +]) + +# AM_PROG_MKDIR_P +# --------------- +# Check whether `mkdir -p' is supported, fallback to mkinstalldirs otherwise. + +# Copyright (C) 2003, 2004 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +# Automake 1.8 used `mkdir -m 0755 -p --' to ensure that directories +# created by `make install' are always world readable, even if the +# installer happens to have an overly restrictive umask (e.g. 077). +# This was a mistake. There are at least two reasons why we must not +# use `-m 0755': +# - it causes special bits like SGID to be ignored, +# - it may be too restrictive (some setups expect 775 directories). +# +# Do not use -m 0755 and let people choose whatever they expect by +# setting umask. +# +# We cannot accept any implementation of `mkdir' that recognizes `-p'. +# Some implementations (such as Solaris 8's) are not thread-safe: if a +# parallel make tries to run `mkdir -p a/b' and `mkdir -p a/c' +# concurrently, both version can detect that a/ is missing, but only +# one can create it and the other will error out. Consequently we +# restrict ourselves to GNU make (using the --version option ensures +# this.) +AC_DEFUN([AM_PROG_MKDIR_P], +[if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then + # Keeping the `.' argument allows $(mkdir_p) to be used without + # argument. Indeed, we sometimes output rules like + # $(mkdir_p) $(somedir) + # where $(somedir) is conditionally defined. + # (`test -n '$(somedir)' && $(mkdir_p) $(somedir)' is a more + # expensive solution, as it forces Make to start a sub-shell.) + mkdir_p='mkdir -p -- .' +else + # On NextStep and OpenStep, the `mkdir' command does not + # recognize any option. It will interpret all options as + # directories to create, and then abort because `.' already + # exists. + for d in ./-p ./--version; + do + test -d $d && rmdir $d + done + # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists. + if test -f "$ac_aux_dir/mkinstalldirs"; then + mkdir_p='$(mkinstalldirs)' + else + mkdir_p='$(install_sh) -d' + fi +fi +AC_SUBST([mkdir_p])]) + +# Helper functions for option handling. -*- Autoconf -*- + +# Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +# serial 2 + +# _AM_MANGLE_OPTION(NAME) +# ----------------------- +AC_DEFUN([_AM_MANGLE_OPTION], +[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) + +# _AM_SET_OPTION(NAME) +# ------------------------------ +# Set option NAME. Presently that only means defining a flag for this option. +AC_DEFUN([_AM_SET_OPTION], +[m4_define(_AM_MANGLE_OPTION([$1]), 1)]) + +# _AM_SET_OPTIONS(OPTIONS) +# ---------------------------------- +# OPTIONS is a space-separated list of Automake options. +AC_DEFUN([_AM_SET_OPTIONS], +[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) + +# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) +# ------------------------------------------- +# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. +AC_DEFUN([_AM_IF_OPTION], +[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) # # Check to make sure that the build environment is sane. # -AC_DEFUN(AM_SANITY_CHECK, +# Copyright (C) 1996, 1997, 2000, 2001, 2003 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +# serial 3 + +# AM_SANITY_CHECK +# --------------- +AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) # Just in case sleep 1 -echo timestamp > conftestfile +echo timestamp > conftest.file # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( - set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` - if test "[$]*" = "X"; then + set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` + if test "$[*]" = "X"; then # -L didn't work. - set X `ls -t $srcdir/configure conftestfile` + set X `ls -t $srcdir/configure conftest.file` fi - if test "[$]*" != "X $srcdir/configure conftestfile" \ - && test "[$]*" != "X conftestfile $srcdir/configure"; then + rm -f conftest.file + if test "$[*]" != "X $srcdir/configure conftest.file" \ + && test "$[*]" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a @@ -74,7 +935,7 @@ if ( alias in your environment]) fi - test "[$]2" = conftestfile + test "$[2]" = conftest.file ) then # Ok. @@ -83,64 +944,44 @@ else AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi -rm -f conftest* AC_MSG_RESULT(yes)]) -dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY) -dnl The program must properly implement --version. -AC_DEFUN(AM_MISSING_PROG, -[AC_MSG_CHECKING(for working $2) -# Run test in a subshell; some versions of sh will print an error if -# an executable is not found, even if stderr is redirected. -# Redirect stdin to placate older versions of autoconf. Sigh. -if ($2 --version) < /dev/null > /dev/null 2>&1; then - $1=$2 - AC_MSG_RESULT(found) -else - $1="$3/missing $2" - AC_MSG_RESULT(missing) +# AM_PROG_INSTALL_STRIP + +# Copyright (C) 2001, 2003 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +# One issue with vendor `install' (even GNU) is that you can't +# specify the program used to strip binaries. This is especially +# annoying in cross-compiling environments, where the build's strip +# is unlikely to handle the host's binaries. +# Fortunately install-sh will honor a STRIPPROG variable, so we +# always use install-sh in `make install-strip', and initialize +# STRIPPROG with the value of the STRIP variable (set by the user). +AC_DEFUN([AM_PROG_INSTALL_STRIP], +[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl +# Installed binaries are usually stripped using `strip' when the user +# run `make install-strip'. However `strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the `STRIP' environment variable to overrule this program. +dnl Don't test for $cross_compiling = yes, because it might be `maybe'. +if test "$cross_compiling" != no; then + AC_CHECK_TOOL([STRIP], [strip], :) fi -AC_SUBST($1)]) - -# Like AC_CONFIG_HEADER, but automatically create stamp file. - -AC_DEFUN(AM_CONFIG_HEADER, -[AC_PREREQ([2.12]) -AC_CONFIG_HEADER([$1]) -dnl When config.status generates a header, we must update the stamp-h file. -dnl This file resides in the same directory as the config header -dnl that is generated. We must strip everything past the first ":", -dnl and everything past the last "/". -AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl -ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>, -<>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>, -<>; do - case " <<$>>CONFIG_HEADERS " in - *" <<$>>am_file "*<<)>> - echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx - ;; - esac - am_indx=`expr "<<$>>am_indx" + 1` -done<<>>dnl>>) -changequote([,]))]) - - -# 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)]) -]) +INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s" +AC_SUBST([INSTALL_STRIP_PROGRAM])]) diff --git a/xgraph/autoconf.h.in b/xgraph/autoconf.h.in index 870854f7d..c4ce87952 100644 --- a/xgraph/autoconf.h.in +++ b/xgraph/autoconf.h.in @@ -1,35 +1,67 @@ -/* autoconf.h.in. Generated automatically from configure.in by autoheader. */ +/* autoconf.h.in. Generated from configure.in by autoheader. */ -/* Define if the X Window System is missing or not being used. */ -#undef X_DISPLAY_MISSING - -/* Define if you have the strcasecmp function. */ -#undef HAVE_STRCASECMP - -/* Define if you have the header file. */ +/* Define to 1 if you have the header file. */ #undef HAVE_FLOAT_H -/* Define if you have the header file. */ +/* Define to 1 if you have the header file. */ +#undef HAVE_INTTYPES_H + +/* Define to 1 if you have the header file. */ #undef HAVE_LIMITS_H -/* Define if you have the header file. */ +/* Define to 1 if you have the header file. */ +#undef HAVE_MEMORY_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDINT_H + +/* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H -/* Define if you have the header file. */ -#undef HAVE_STRING_H +/* Define to 1 if you have the `strcasecmp' function. */ +#undef HAVE_STRCASECMP -/* Define if you have the header file. */ +/* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H -/* Define if you have the header file. */ +/* Define to 1 if you have the header file. */ +#undef HAVE_STRING_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_STAT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_TYPES_H + +/* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* Name of package */ #undef PACKAGE +/* Define to the address where bug reports for this package should be sent. */ +#undef PACKAGE_BUGREPORT + +/* Define to the full name of this package. */ +#undef PACKAGE_NAME + +/* Define to the full name and version of this package. */ +#undef PACKAGE_STRING + +/* Define to the one symbol short name of this package. */ +#undef PACKAGE_TARNAME + +/* Define to the version of this package. */ +#undef PACKAGE_VERSION + +/* Define to 1 if you have the ANSI C header files. */ +#undef STDC_HEADERS + /* Version number of package */ #undef VERSION /* Define if using the dmalloc debugging malloc package */ #undef WITH_DMALLOC +/* Define to 1 if the X Window System is missing or not being used. */ +#undef X_DISPLAY_MISSING diff --git a/xgraph/configure b/xgraph/configure index 4f909ca87..0579e9b49 100755 --- a/xgraph/configure +++ b/xgraph/configure @@ -1,35 +1,325 @@ #! /bin/sh - # Guess values for system-dependent variables and create Makefiles. -# Generated automatically using autoconf version 2.13 -# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. +# Generated by GNU Autoconf 2.59. # +# Copyright (C) 2003 Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. +## --------------------- ## +## M4sh Initialization. ## +## --------------------- ## -# Defaults: -ac_help= +# Be Bourne compatible +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' +elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then + set -o posix +fi +DUALCASE=1; export DUALCASE # for MKS sh + +# Support unset when possible. +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + as_unset=unset +else + as_unset=false +fi + + +# Work around bugs in pre-3.0 UWIN ksh. +$as_unset ENV MAIL MAILPATH +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +for as_var in \ + LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ + LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ + LC_TELEPHONE LC_TIME +do + if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then + eval $as_var=C; export $as_var + else + $as_unset $as_var + fi +done + +# Required to use basename. +if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr +else + as_expr=false +fi + +if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + + +# Name of the executable. +as_me=`$as_basename "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)$' \| \ + . : '\(.\)' 2>/dev/null || +echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } + /^X\/\(\/\/\)$/{ s//\1/; q; } + /^X\/\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + + +# PATH needs CR, and LINENO needs CR and PATH. +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh +fi + + + as_lineno_1=$LINENO + as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x$as_lineno_3" = "x$as_lineno_2" || { + # Find who we are. Look in the path if we contain no path at all + # relative or not. + case $0 in + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break +done + + ;; + esac + # We did not find ourselves, most probably we were run as `sh COMMAND' + # in which case we are not to be found in the path. + if test "x$as_myself" = x; then + as_myself=$0 + fi + if test ! -f "$as_myself"; then + { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2 + { (exit 1); exit 1; }; } + fi + case $CONFIG_SHELL in + '') + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for as_base in sh bash ksh sh5; do + case $as_dir in + /*) + if ("$as_dir/$as_base" -c ' + as_lineno_1=$LINENO + as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then + $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } + $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } + CONFIG_SHELL=$as_dir/$as_base + export CONFIG_SHELL + exec "$CONFIG_SHELL" "$0" ${1+"$@"} + fi;; + esac + done +done +;; + esac + + # Create $as_me.lineno as a copy of $as_myself, but with $LINENO + # uniformly replaced by the line number. The first 'sed' inserts a + # line-number line before each line; the second 'sed' does the real + # work. The second script uses 'N' to pair each line-number line + # with the numbered line, and appends trailing '-' during + # substitution so that $LINENO is not a special case at line end. + # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the + # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) + sed '=' <$as_myself | + sed ' + N + s,$,-, + : loop + s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, + t loop + s,-$,, + s,^['$as_cr_digits']*\n,, + ' >$as_me.lineno && + chmod +x $as_me.lineno || + { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 + { (exit 1); exit 1; }; } + + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensible to this). + . ./$as_me.lineno + # Exit status is that of the last command. + exit +} + + +case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in + *c*,-n*) ECHO_N= ECHO_C=' +' ECHO_T=' ' ;; + *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; + *) ECHO_N= ECHO_C='\c' ECHO_T= ;; +esac + +if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr +else + as_expr=false +fi + +rm -f conf$$ conf$$.exe conf$$.file +echo >conf$$.file +if ln -s conf$$.file conf$$ 2>/dev/null; then + # We could just check for DJGPP; but this test a) works b) is more generic + # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). + if test -f conf$$.exe; then + # Don't use ln at all; we don't have any links + as_ln_s='cp -p' + else + as_ln_s='ln -s' + fi +elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.file + +if mkdir -p . 2>/dev/null; then + as_mkdir_p=: +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +as_executable_p="test -f" + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +# IFS +# We need space, tab and new line, in precisely that order. +as_nl=' +' +IFS=" $as_nl" + +# CDPATH. +$as_unset CDPATH + + +# Name of the host. +# hostname on some systems (SVR3.2, Linux) returns a bogus exit status, +# so uname gets run too. +ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` + +exec 6>&1 + +# +# Initializations. +# ac_default_prefix=/usr/local -# Any additions from configure.in: -ac_help="$ac_help - --with-dmalloc use dmalloc, as in - ftp://ftp.letters.com/src/dmalloc/dmalloc.tar.gz" -ac_help="$ac_help - --with-x use the X Window System" -ac_help="$ac_help ---with-additional-includes=path" -ac_help="$ac_help ---with-additional-libs=path" +ac_config_libobj_dir=. +cross_compiling=no +subdirs= +MFLAGS= +MAKEFLAGS= +SHELL=${CONFIG_SHELL-/bin/sh} + +# Maximum number of lines to put in a shell here document. +# This variable seems obsolete. It should probably be removed, and +# only ac_max_sed_lines should be used. +: ${ac_max_here_lines=38} + +# Identity of this package. +PACKAGE_NAME= +PACKAGE_TARNAME= +PACKAGE_VERSION= +PACKAGE_STRING= +PACKAGE_BUGREPORT= + +ac_unique_file="xgraph.c" +# Factoring default headers for most tests. +ac_includes_default="\ +#include +#if HAVE_SYS_TYPES_H +# include +#endif +#if HAVE_SYS_STAT_H +# include +#endif +#if STDC_HEADERS +# include +# include +#else +# if HAVE_STDLIB_H +# include +# endif +#endif +#if HAVE_STRING_H +# if !STDC_HEADERS && HAVE_MEMORY_H +# include +# endif +# include +#endif +#if HAVE_STRINGS_H +# include +#endif +#if HAVE_INTTYPES_H +# include +#else +# if HAVE_STDINT_H +# include +# endif +#endif +#if HAVE_UNISTD_H +# include +#endif" + +ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO AMTAR install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE CPP X_CFLAGS X_PRE_LIBS X_LIBS X_EXTRA_LIBS EGREP ADDITIONAL_INCLUDES ADDITIONAL_LIBS LIBOBJS LTLIBOBJS' +ac_subst_files='' # Initialize some variables set by options. +ac_init_help= +ac_init_version=false # The variables have the same names as the options, with # dashes changed to underlines. -build=NONE -cache_file=./config.cache +cache_file=/dev/null exec_prefix=NONE -host=NONE no_create= -nonopt=NONE no_recursion= prefix=NONE program_prefix=NONE @@ -38,10 +328,15 @@ program_transform_name=s,x,x, silent= site= srcdir= -target=NONE verbose= x_includes=NONE x_libraries=NONE + +# Installation directory options. +# These are left unexpanded so users can "make install exec_prefix=/foo" +# and all the variables that are supposed to be based on exec_prefix +# by default will actually change. +# Use braces instead of parens because sh, perl, etc. also accept them. bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' @@ -55,17 +350,9 @@ oldincludedir='/usr/include' infodir='${prefix}/info' mandir='${prefix}/man' -# Initialize some other variables. -subdirs= -MFLAGS= MAKEFLAGS= -SHELL=${CONFIG_SHELL-/bin/sh} -# Maximum number of lines to put in a shell here document. -ac_max_here_lines=12 - ac_prev= for ac_option do - # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval "$ac_prev=\$ac_option" @@ -73,59 +360,59 @@ do continue fi - case "$ac_option" in - -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;; - *) ac_optarg= ;; - esac + ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'` # Accept the important Cygnus configure options, so we can diagnose typos. - case "$ac_option" in + case $ac_option in -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) - bindir="$ac_optarg" ;; + bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) - ac_prev=build ;; + ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) - build="$ac_optarg" ;; + build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) - cache_file="$ac_optarg" ;; + cache_file=$ac_optarg ;; + + --config-cache | -C) + cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad | --data | --dat | --da) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ | --da=*) - datadir="$ac_optarg" ;; + datadir=$ac_optarg ;; -disable-* | --disable-*) - ac_feature=`echo $ac_option|sed -e 's/-*disable-//'` + ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. - if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then - { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } - fi - ac_feature=`echo $ac_feature| sed 's/-/_/g'` - eval "enable_${ac_feature}=no" ;; + expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid feature name: $ac_feature" >&2 + { (exit 1); exit 1; }; } + ac_feature=`echo $ac_feature | sed 's/-/_/g'` + eval "enable_$ac_feature=no" ;; -enable-* | --enable-*) - ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'` + ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. - if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then - { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } - fi - ac_feature=`echo $ac_feature| sed 's/-/_/g'` - case "$ac_option" in - *=*) ;; + expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid feature name: $ac_feature" >&2 + { (exit 1); exit 1; }; } + ac_feature=`echo $ac_feature | sed 's/-/_/g'` + case $ac_option in + *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; *) ac_optarg=yes ;; esac - eval "enable_${ac_feature}='$ac_optarg'" ;; + eval "enable_$ac_feature='$ac_optarg'" ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ @@ -134,95 +421,47 @@ do -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) - exec_prefix="$ac_optarg" ;; + exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; - -help | --help | --hel | --he) - # Omit some internal or obsolete options to make the list less imposing. - # This message is too long to be a string in the A/UX 3.1 sh. - cat << EOF -Usage: configure [options] [host] -Options: [defaults in brackets after descriptions] -Configuration: - --cache-file=FILE cache test results in FILE - --help print this message - --no-create do not create output files - --quiet, --silent do not print \`checking...' messages - --version print the version of autoconf that created configure -Directory and file names: - --prefix=PREFIX install architecture-independent files in PREFIX - [$ac_default_prefix] - --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX - [same as prefix] - --bindir=DIR user executables in DIR [EPREFIX/bin] - --sbindir=DIR system admin executables in DIR [EPREFIX/sbin] - --libexecdir=DIR program executables in DIR [EPREFIX/libexec] - --datadir=DIR read-only architecture-independent data in DIR - [PREFIX/share] - --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc] - --sharedstatedir=DIR modifiable architecture-independent data in DIR - [PREFIX/com] - --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var] - --libdir=DIR object code libraries in DIR [EPREFIX/lib] - --includedir=DIR C header files in DIR [PREFIX/include] - --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include] - --infodir=DIR info documentation in DIR [PREFIX/info] - --mandir=DIR man documentation in DIR [PREFIX/man] - --srcdir=DIR find the sources in DIR [configure dir or ..] - --program-prefix=PREFIX prepend PREFIX to installed program names - --program-suffix=SUFFIX append SUFFIX to installed program names - --program-transform-name=PROGRAM - run sed PROGRAM on installed program names -EOF - cat << EOF -Host type: - --build=BUILD configure for building on BUILD [BUILD=HOST] - --host=HOST configure for HOST [guessed] - --target=TARGET configure for TARGET [TARGET=HOST] -Features and packages: - --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) - --enable-FEATURE[=ARG] include FEATURE [ARG=yes] - --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] - --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) - --x-includes=DIR X include files are in DIR - --x-libraries=DIR X library files are in DIR -EOF - if test -n "$ac_help"; then - echo "--enable and --with options recognized:$ac_help" - fi - exit 0 ;; + -help | --help | --hel | --he | -h) + ac_init_help=long ;; + -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) + ac_init_help=recursive ;; + -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) + ac_init_help=short ;; -host | --host | --hos | --ho) - ac_prev=host ;; + ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) - host="$ac_optarg" ;; + host_alias=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) - includedir="$ac_optarg" ;; + includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) - infodir="$ac_optarg" ;; + infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) - libdir="$ac_optarg" ;; + libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) - libexecdir="$ac_optarg" ;; + libexecdir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst \ @@ -231,19 +470,19 @@ EOF -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* \ | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) - localstatedir="$ac_optarg" ;; + localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) - mandir="$ac_optarg" ;; + mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ - | --no-cr | --no-c) + | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ @@ -257,26 +496,26 @@ EOF -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) - oldincludedir="$ac_optarg" ;; + oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) - prefix="$ac_optarg" ;; + prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) - program_prefix="$ac_optarg" ;; + program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) - program_suffix="$ac_optarg" ;; + program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ @@ -293,7 +532,7 @@ EOF | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) - program_transform_name="$ac_optarg" ;; + program_transform_name=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) @@ -303,7 +542,7 @@ EOF ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) - sbindir="$ac_optarg" ;; + sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ @@ -314,58 +553,57 @@ EOF | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) - sharedstatedir="$ac_optarg" ;; + sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) - site="$ac_optarg" ;; + site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) - srcdir="$ac_optarg" ;; + srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) - sysconfdir="$ac_optarg" ;; + sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) - ac_prev=target ;; + ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) - target="$ac_optarg" ;; + target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; - -version | --version | --versio | --versi | --vers) - echo "configure generated by autoconf version 2.13" - exit 0 ;; + -version | --version | --versio | --versi | --vers | -V) + ac_init_version=: ;; -with-* | --with-*) - ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'` + ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. - if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then - { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } - fi + expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid package name: $ac_package" >&2 + { (exit 1); exit 1; }; } ac_package=`echo $ac_package| sed 's/-/_/g'` - case "$ac_option" in - *=*) ;; + case $ac_option in + *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; *) ac_optarg=yes ;; esac - eval "with_${ac_package}='$ac_optarg'" ;; + eval "with_$ac_package='$ac_optarg'" ;; -without-* | --without-*) - ac_package=`echo $ac_option|sed -e 's/-*without-//'` + ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. - if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then - { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } - fi - ac_package=`echo $ac_package| sed 's/-/_/g'` - eval "with_${ac_package}=no" ;; + expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid package name: $ac_package" >&2 + { (exit 1); exit 1; }; } + ac_package=`echo $ac_package | sed 's/-/_/g'` + eval "with_$ac_package=no" ;; --x) # Obsolete; use --with-x. @@ -376,99 +614,110 @@ EOF ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) - x_includes="$ac_optarg" ;; + x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) - x_libraries="$ac_optarg" ;; + x_libraries=$ac_optarg ;; - -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; } + -*) { echo "$as_me: error: unrecognized option: $ac_option +Try \`$0 --help' for more information." >&2 + { (exit 1); exit 1; }; } ;; + *=*) + ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` + # Reject names that are not valid shell variable names. + expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 + { (exit 1); exit 1; }; } + ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` + eval "$ac_envvar='$ac_optarg'" + export $ac_envvar ;; + *) - if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then - echo "configure: warning: $ac_option: invalid host type" 1>&2 - fi - if test "x$nonopt" != xNONE; then - { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } - fi - nonopt="$ac_option" + # FIXME: should be removed in autoconf 3.0. + echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && + echo "$as_me: WARNING: invalid host type: $ac_option" >&2 + : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} ;; esac done if test -n "$ac_prev"; then - { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; } + ac_option=--`echo $ac_prev | sed 's/_/-/g'` + { echo "$as_me: error: missing argument to $ac_option" >&2 + { (exit 1); exit 1; }; } fi -trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 - -# File descriptor usage: -# 0 standard input -# 1 file creation -# 2 errors and warnings -# 3 some systems may open it to /dev/tty -# 4 used on the Kubota Titan -# 6 checking for... messages and results -# 5 compiler messages saved in config.log -if test "$silent" = yes; then - exec 6>/dev/null -else - exec 6>&1 -fi -exec 5>./config.log - -echo "\ -This file contains any messages produced by compilers while -running configure, to aid debugging if configure makes a mistake. -" 1>&5 - -# Strip out --no-create and --no-recursion so they do not pile up. -# Also quote any args containing shell metacharacters. -ac_configure_args= -for ac_arg +# Be sure to have absolute paths. +for ac_var in exec_prefix prefix do - case "$ac_arg" in - -no-create | --no-create | --no-creat | --no-crea | --no-cre \ - | --no-cr | --no-c) ;; - -no-recursion | --no-recursion | --no-recursio | --no-recursi \ - | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;; - *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*) - ac_configure_args="$ac_configure_args '$ac_arg'" ;; - *) ac_configure_args="$ac_configure_args $ac_arg" ;; + eval ac_val=$`echo $ac_var` + case $ac_val in + [\\/$]* | ?:[\\/]* | NONE | '' ) ;; + *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 + { (exit 1); exit 1; }; };; esac done -# NLS nuisances. -# Only set these to C if already set. These must not be set unconditionally -# because not all systems understand e.g. LANG=C (notably SCO). -# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'! -# Non-C LC_CTYPE values break the ctype check. -if test "${LANG+set}" = set; then LANG=C; export LANG; fi -if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi -if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi -if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi +# Be sure to have absolute paths. +for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \ + localstatedir libdir includedir oldincludedir infodir mandir +do + eval ac_val=$`echo $ac_var` + case $ac_val in + [\\/$]* | ?:[\\/]* ) ;; + *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 + { (exit 1); exit 1; }; };; + esac +done -# confdefs.h avoids OS command line length limits that DEFS can exceed. -rm -rf conftest* confdefs.h -# AIX cpp loses on an empty file, so make sure it contains at least a newline. -echo > confdefs.h +# There might be people who depend on the old broken behavior: `$host' +# used to hold the argument of --host etc. +# FIXME: To remove some day. +build=$build_alias +host=$host_alias +target=$target_alias + +# FIXME: To remove some day. +if test "x$host_alias" != x; then + if test "x$build_alias" = x; then + cross_compiling=maybe + echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. + If a cross compiler is detected then cross compile mode will be used." >&2 + elif test "x$build_alias" != "x$host_alias"; then + cross_compiling=yes + fi +fi + +ac_tool_prefix= +test -n "$host_alias" && ac_tool_prefix=$host_alias- + +test "$silent" = yes && exec 6>/dev/null -# A filename unique to this package, relative to the directory that -# configure is in, which we can look for to find out if srcdir is correct. -ac_unique_file=xgraph.c # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then its parent. - ac_prog=$0 - ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'` - test "x$ac_confdir" = "x$ac_prog" && ac_confdir=. + ac_confdir=`(dirname "$0") 2>/dev/null || +$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$0" : 'X\(//\)[^/]' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$0" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` srcdir=$ac_confdir if test ! -r $srcdir/$ac_unique_file; then srcdir=.. @@ -478,13 +727,480 @@ else fi if test ! -r $srcdir/$ac_unique_file; then if test "$ac_srcdir_defaulted" = yes; then - { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; } + { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2 + { (exit 1); exit 1; }; } else - { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; } + { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 + { (exit 1); exit 1; }; } fi fi -srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'` +(cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null || + { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2 + { (exit 1); exit 1; }; } +srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'` +ac_env_build_alias_set=${build_alias+set} +ac_env_build_alias_value=$build_alias +ac_cv_env_build_alias_set=${build_alias+set} +ac_cv_env_build_alias_value=$build_alias +ac_env_host_alias_set=${host_alias+set} +ac_env_host_alias_value=$host_alias +ac_cv_env_host_alias_set=${host_alias+set} +ac_cv_env_host_alias_value=$host_alias +ac_env_target_alias_set=${target_alias+set} +ac_env_target_alias_value=$target_alias +ac_cv_env_target_alias_set=${target_alias+set} +ac_cv_env_target_alias_value=$target_alias +ac_env_CC_set=${CC+set} +ac_env_CC_value=$CC +ac_cv_env_CC_set=${CC+set} +ac_cv_env_CC_value=$CC +ac_env_CFLAGS_set=${CFLAGS+set} +ac_env_CFLAGS_value=$CFLAGS +ac_cv_env_CFLAGS_set=${CFLAGS+set} +ac_cv_env_CFLAGS_value=$CFLAGS +ac_env_LDFLAGS_set=${LDFLAGS+set} +ac_env_LDFLAGS_value=$LDFLAGS +ac_cv_env_LDFLAGS_set=${LDFLAGS+set} +ac_cv_env_LDFLAGS_value=$LDFLAGS +ac_env_CPPFLAGS_set=${CPPFLAGS+set} +ac_env_CPPFLAGS_value=$CPPFLAGS +ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set} +ac_cv_env_CPPFLAGS_value=$CPPFLAGS +ac_env_CPP_set=${CPP+set} +ac_env_CPP_value=$CPP +ac_cv_env_CPP_set=${CPP+set} +ac_cv_env_CPP_value=$CPP +# +# Report the --help message. +# +if test "$ac_init_help" = "long"; then + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat <<_ACEOF +\`configure' configures this package to adapt to many kinds of systems. + +Usage: $0 [OPTION]... [VAR=VALUE]... + +To assign environment variables (e.g., CC, CFLAGS...), specify them as +VAR=VALUE. See below for descriptions of some of the useful variables. + +Defaults for the options are specified in brackets. + +Configuration: + -h, --help display this help and exit + --help=short display options specific to this package + --help=recursive display the short help of all the included packages + -V, --version display version information and exit + -q, --quiet, --silent do not print \`checking...' messages + --cache-file=FILE cache test results in FILE [disabled] + -C, --config-cache alias for \`--cache-file=config.cache' + -n, --no-create do not create output files + --srcdir=DIR find the sources in DIR [configure dir or \`..'] + +_ACEOF + + cat <<_ACEOF +Installation directories: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [PREFIX] + +By default, \`make install' will install all the files in +\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify +an installation prefix other than \`$ac_default_prefix' using \`--prefix', +for instance \`--prefix=\$HOME'. + +For better control, use the options below. + +Fine tuning of the installation directories: + --bindir=DIR user executables [EPREFIX/bin] + --sbindir=DIR system admin executables [EPREFIX/sbin] + --libexecdir=DIR program executables [EPREFIX/libexec] + --datadir=DIR read-only architecture-independent data [PREFIX/share] + --sysconfdir=DIR read-only single-machine data [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] + --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --libdir=DIR object code libraries [EPREFIX/lib] + --includedir=DIR C header files [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc [/usr/include] + --infodir=DIR info documentation [PREFIX/info] + --mandir=DIR man documentation [PREFIX/man] +_ACEOF + + cat <<\_ACEOF + +Program names: + --program-prefix=PREFIX prepend PREFIX to installed program names + --program-suffix=SUFFIX append SUFFIX to installed program names + --program-transform-name=PROGRAM run sed PROGRAM on installed program names + +X features: + --x-includes=DIR X include files are in DIR + --x-libraries=DIR X library files are in DIR +_ACEOF +fi + +if test -n "$ac_init_help"; then + + cat <<\_ACEOF + +Optional Features: + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --enable-maintainer-mode enable make rules and dependencies not useful + (and sometimes confusing) to the casual installer + --disable-dependency-tracking speeds up one-time build + --enable-dependency-tracking do not reject slow dependency extractors + +Optional Packages: + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --with-dmalloc use dmalloc, as in + http://www.dmalloc.com/dmalloc.tar.gz + --with-x use the X Window System +--with-additional-includes=path +--with-additional-libs=path + +Some influential environment variables: + CC C compiler command + CFLAGS C compiler flags + LDFLAGS linker flags, e.g. -L if you have libraries in a + nonstandard directory + CPPFLAGS C/C++ preprocessor flags, e.g. -I if you have + headers in a nonstandard directory + CPP C preprocessor + +Use these variables to override the choices made by `configure' or to help +it to find libraries and programs with nonstandard names/locations. + +_ACEOF +fi + +if test "$ac_init_help" = "recursive"; then + # If there are subdirs, report their specific --help. + ac_popdir=`pwd` + for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue + test -d $ac_dir || continue + ac_builddir=. + +if test "$ac_dir" != .; then + ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` + # A "../" for each directory in $ac_dir_suffix. + ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` +else + ac_dir_suffix= ac_top_builddir= +fi + +case $srcdir in + .) # No --srcdir option. We are building in place. + ac_srcdir=. + if test -z "$ac_top_builddir"; then + ac_top_srcdir=. + else + ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` + fi ;; + [\\/]* | ?:[\\/]* ) # Absolute path. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir ;; + *) # Relative path. + ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_builddir$srcdir ;; +esac + +# Do not use `cd foo && pwd` to compute absolute paths, because +# the directories may not exist. +case `pwd` in +.) ac_abs_builddir="$ac_dir";; +*) + case "$ac_dir" in + .) ac_abs_builddir=`pwd`;; + [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; + *) ac_abs_builddir=`pwd`/"$ac_dir";; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_builddir=${ac_top_builddir}.;; +*) + case ${ac_top_builddir}. in + .) ac_abs_top_builddir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; + *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_srcdir=$ac_srcdir;; +*) + case $ac_srcdir in + .) ac_abs_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; + *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_srcdir=$ac_top_srcdir;; +*) + case $ac_top_srcdir in + .) ac_abs_top_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; + *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; + esac;; +esac + + cd $ac_dir + # Check for guested configure; otherwise get Cygnus style configure. + if test -f $ac_srcdir/configure.gnu; then + echo + $SHELL $ac_srcdir/configure.gnu --help=recursive + elif test -f $ac_srcdir/configure; then + echo + $SHELL $ac_srcdir/configure --help=recursive + elif test -f $ac_srcdir/configure.ac || + test -f $ac_srcdir/configure.in; then + echo + $ac_configure --help + else + echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + fi + cd "$ac_popdir" + done +fi + +test -n "$ac_init_help" && exit 0 +if $ac_init_version; then + cat <<\_ACEOF + +Copyright (C) 2003 Free Software Foundation, Inc. +This configure script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it. +_ACEOF + exit 0 +fi +exec 5>config.log +cat >&5 <<_ACEOF +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. + +It was created by $as_me, which was +generated by GNU Autoconf 2.59. Invocation command line was + + $ $0 $@ + +_ACEOF +{ +cat <<_ASUNAME +## --------- ## +## Platform. ## +## --------- ## + +hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` + +/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` +hostinfo = `(hostinfo) 2>/dev/null || echo unknown` +/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` +/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` + +_ASUNAME + +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + echo "PATH: $as_dir" +done + +} >&5 + +cat >&5 <<_ACEOF + + +## ----------- ## +## Core tests. ## +## ----------- ## + +_ACEOF + + +# Keep a trace of the command line. +# Strip out --no-create and --no-recursion so they do not pile up. +# Strip out --silent because we don't want to record it for future runs. +# Also quote any args containing shell meta-characters. +# Make two passes to allow for proper duplicate-argument suppression. +ac_configure_args= +ac_configure_args0= +ac_configure_args1= +ac_sep= +ac_must_keep_next=false +for ac_pass in 1 2 +do + for ac_arg + do + case $ac_arg in + -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + continue ;; + *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) + ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + case $ac_pass in + 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; + 2) + ac_configure_args1="$ac_configure_args1 '$ac_arg'" + if test $ac_must_keep_next = true; then + ac_must_keep_next=false # Got value, back to normal. + else + case $ac_arg in + *=* | --config-cache | -C | -disable-* | --disable-* \ + | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ + | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ + | -with-* | --with-* | -without-* | --without-* | --x) + case "$ac_configure_args0 " in + "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; + esac + ;; + -* ) ac_must_keep_next=true ;; + esac + fi + ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" + # Get rid of the leading space. + ac_sep=" " + ;; + esac + done +done +$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } +$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; } + +# When interrupted or exit'd, cleanup temporary files, and complete +# config.log. We remove comments because anyway the quotes in there +# would cause problems or look ugly. +# WARNING: Be sure not to use single quotes in there, as some shells, +# such as our DU 5.0 friend, will then `close' the trap. +trap 'exit_status=$? + # Save into config.log some information that might help in debugging. + { + echo + + cat <<\_ASBOX +## ---------------- ## +## Cache variables. ## +## ---------------- ## +_ASBOX + echo + # The following way of writing the cache mishandles newlines in values, +{ + (set) 2>&1 | + case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in + *ac_space=\ *) + sed -n \ + "s/'"'"'/'"'"'\\\\'"'"''"'"'/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p" + ;; + *) + sed -n \ + "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" + ;; + esac; +} + echo + + cat <<\_ASBOX +## ----------------- ## +## Output variables. ## +## ----------------- ## +_ASBOX + echo + for ac_var in $ac_subst_vars + do + eval ac_val=$`echo $ac_var` + echo "$ac_var='"'"'$ac_val'"'"'" + done | sort + echo + + if test -n "$ac_subst_files"; then + cat <<\_ASBOX +## ------------- ## +## Output files. ## +## ------------- ## +_ASBOX + echo + for ac_var in $ac_subst_files + do + eval ac_val=$`echo $ac_var` + echo "$ac_var='"'"'$ac_val'"'"'" + done | sort + echo + fi + + if test -s confdefs.h; then + cat <<\_ASBOX +## ----------- ## +## confdefs.h. ## +## ----------- ## +_ASBOX + echo + sed "/^$/d" confdefs.h | sort + echo + fi + test "$ac_signal" != 0 && + echo "$as_me: caught signal $ac_signal" + echo "$as_me: exit $exit_status" + } >&5 + rm -f core *.core && + rm -rf conftest* confdefs* conf$$* $ac_clean_files && + exit $exit_status + ' 0 +for ac_signal in 1 2 13 15; do + trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal +done +ac_signal=0 + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -rf conftest* confdefs.h +# AIX cpp loses on an empty file, so make sure it contains at least a newline. +echo >confdefs.h + +# Predefined preprocessor variables. + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_NAME "$PACKAGE_NAME" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_TARNAME "$PACKAGE_TARNAME" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_VERSION "$PACKAGE_VERSION" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_STRING "$PACKAGE_STRING" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" +_ACEOF + + +# Let the site file select an alternate cache file if it wants to. # Prefer explicitly selected file to automatically selected ones. if test -z "$CONFIG_SITE"; then if test "x$prefix" != xNONE; then @@ -495,41 +1211,107 @@ if test -z "$CONFIG_SITE"; then fi for ac_site_file in $CONFIG_SITE; do if test -r "$ac_site_file"; then - echo "loading site script $ac_site_file" + { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 +echo "$as_me: loading site script $ac_site_file" >&6;} + sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" fi done if test -r "$cache_file"; then - echo "loading cache $cache_file" - . $cache_file + # Some versions of bash will fail to source /dev/null (special + # files actually), so we avoid doing that. + if test -f "$cache_file"; then + { echo "$as_me:$LINENO: loading cache $cache_file" >&5 +echo "$as_me: loading cache $cache_file" >&6;} + case $cache_file in + [\\/]* | ?:[\\/]* ) . $cache_file;; + *) . ./$cache_file;; + esac + fi else - echo "creating cache $cache_file" - > $cache_file + { echo "$as_me:$LINENO: creating cache $cache_file" >&5 +echo "$as_me: creating cache $cache_file" >&6;} + >$cache_file +fi + +# Check that the precious variables saved in the cache have kept the same +# value. +ac_cache_corrupted=false +for ac_var in `(set) 2>&1 | + sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do + eval ac_old_set=\$ac_cv_env_${ac_var}_set + eval ac_new_set=\$ac_env_${ac_var}_set + eval ac_old_val="\$ac_cv_env_${ac_var}_value" + eval ac_new_val="\$ac_env_${ac_var}_value" + case $ac_old_set,$ac_new_set in + set,) + { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,set) + { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 +echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,);; + *) + if test "x$ac_old_val" != "x$ac_new_val"; then + { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 +echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 +echo "$as_me: former value: $ac_old_val" >&2;} + { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 +echo "$as_me: current value: $ac_new_val" >&2;} + ac_cache_corrupted=: + fi;; + esac + # Pass precious variables to config.status. + if test "$ac_new_set" = set; then + case $ac_new_val in + *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) + ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *) ac_arg=$ac_var=$ac_new_val ;; + esac + case " $ac_configure_args " in + *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. + *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; + esac + fi +done +if $ac_cache_corrupted; then + { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 +echo "$as_me: error: changes in the environment can compromise the build" >&2;} + { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 +echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} + { (exit 1); exit 1; }; } fi ac_ext=c -# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ac_cpp='$CPP $CPPFLAGS' -ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' -ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' -cross_compiling=$ac_cv_prog_cc_cross - -ac_exeext= -ac_objext=o -if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then - # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. - if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then - ac_n= ac_c=' -' ac_t=' ' - else - ac_n=-n ac_c= ac_t= - fi -else - ac_n= ac_c='\c' ac_t= -fi +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + + + + + + + + + + + + + + + + +am__api_version="1.8" ac_aux_dir= for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do if test -f $ac_dir/install-sh; then @@ -540,14 +1322,20 @@ for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break + elif test -f $ac_dir/shtool; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/shtool install -c" + break fi done if test -z "$ac_aux_dir"; then - { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; } + { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5 +echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;} + { (exit 1); exit 1; }; } fi -ac_config_guess=$ac_aux_dir/config.guess -ac_config_sub=$ac_aux_dir/config.sub -ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. +ac_config_guess="$SHELL $ac_aux_dir/config.guess" +ac_config_sub="$SHELL $ac_aux_dir/config.sub" +ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure. # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or @@ -556,467 +1344,1104 @@ ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install +# AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. -echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 -echo "configure:565: checking for a BSD compatible install" >&5 +echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 +echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6 if test -z "$INSTALL"; then -if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +if test "${ac_cv_path_install+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" - for ac_dir in $PATH; do - # Account for people who put trailing slashes in PATH elements. - case "$ac_dir/" in - /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; - *) - # OSF1 and SCO ODT 3.0 have their own names for install. - # Don't use installbsd from OSF since it installs stuff as root - # by default. - for ac_prog in ginstall scoinst install; do - if test -f $ac_dir/$ac_prog; then + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + # Account for people who put trailing slashes in PATH elements. +case $as_dir/ in + ./ | .// | /cC/* | \ + /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ + ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ + /usr/ucb/* ) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then if test $ac_prog = install && - grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then + grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : + elif test $ac_prog = install && + grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # program-specific install script used by HP pwplus--don't use. + : else - ac_cv_path_install="$ac_dir/$ac_prog -c" - break 2 + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + break 3 fi fi done - ;; - esac - done - IFS="$ac_save_IFS" + done + ;; +esac +done + fi if test "${ac_cv_path_install+set}" = set; then - INSTALL="$ac_cv_path_install" + INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. We don't cache a # path for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the path is relative. - INSTALL="$ac_install_sh" + INSTALL=$ac_install_sh fi fi -echo "$ac_t""$INSTALL" 1>&6 +echo "$as_me:$LINENO: result: $INSTALL" >&5 +echo "${ECHO_T}$INSTALL" >&6 # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' -test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' -echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6 -echo "configure:618: checking whether build environment is sane" >&5 +echo "$as_me:$LINENO: checking whether build environment is sane" >&5 +echo $ECHO_N "checking whether build environment is sane... $ECHO_C" >&6 # Just in case sleep 1 -echo timestamp > conftestfile +echo timestamp > conftest.file # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( - set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` + set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` if test "$*" = "X"; then # -L didn't work. - set X `ls -t $srcdir/configure conftestfile` + set X `ls -t $srcdir/configure conftest.file` fi - if test "$*" != "X $srcdir/configure conftestfile" \ - && test "$*" != "X conftestfile $srcdir/configure"; then + rm -f conftest.file + if test "$*" != "X $srcdir/configure conftest.file" \ + && test "$*" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". - { echo "configure: error: ls -t appears to fail. Make sure there is not a broken -alias in your environment" 1>&2; exit 1; } + { { echo "$as_me:$LINENO: error: ls -t appears to fail. Make sure there is not a broken +alias in your environment" >&5 +echo "$as_me: error: ls -t appears to fail. Make sure there is not a broken +alias in your environment" >&2;} + { (exit 1); exit 1; }; } fi - test "$2" = conftestfile + test "$2" = conftest.file ) then # Ok. : else - { echo "configure: error: newly created file is older than distributed files! -Check your system clock" 1>&2; exit 1; } -fi -rm -f conftest* -echo "$ac_t""yes" 1>&6 -if test "$program_transform_name" = s,x,x,; then - program_transform_name= -else - # Double any \ or $. echo might interpret backslashes. - cat <<\EOF_SED > conftestsed -s,\\,\\\\,g; s,\$,$$,g -EOF_SED - program_transform_name="`echo $program_transform_name|sed -f conftestsed`" - rm -f conftestsed + { { echo "$as_me:$LINENO: error: newly created file is older than distributed files! +Check your system clock" >&5 +echo "$as_me: error: newly created file is older than distributed files! +Check your system clock" >&2;} + { (exit 1); exit 1; }; } fi +echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 test "$program_prefix" != NONE && - program_transform_name="s,^,${program_prefix},; $program_transform_name" + program_transform_name="s,^,$program_prefix,;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && - program_transform_name="s,\$\$,${program_suffix},; $program_transform_name" + program_transform_name="s,\$,$program_suffix,;$program_transform_name" +# Double any \ or $. echo might interpret backslashes. +# By default was `s,x,x', remove it if useless. +cat <<\_ACEOF >conftest.sed +s/[\\$]/&&/g;s/;s,x,x,$// +_ACEOF +program_transform_name=`echo $program_transform_name | sed -f conftest.sed` +rm conftest.sed -# sed with no file args requires a program. -test "$program_transform_name" = "" && program_transform_name="s,x,x," +# expand $ac_aux_dir to an absolute path +am_aux_dir=`cd $ac_aux_dir && pwd` -echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 -echo "configure:675: checking whether ${MAKE-make} sets \${MAKE}" >&5 -set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" +# Use eval to expand $SHELL +if eval "$MISSING --run true"; then + am_missing_run="$MISSING --run " else - cat > conftestmake <<\EOF + am_missing_run= + { echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5 +echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} +fi + +if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then + # Keeping the `.' argument allows $(mkdir_p) to be used without + # argument. Indeed, we sometimes output rules like + # $(mkdir_p) $(somedir) + # where $(somedir) is conditionally defined. + # (`test -n '$(somedir)' && $(mkdir_p) $(somedir)' is a more + # expensive solution, as it forces Make to start a sub-shell.) + mkdir_p='mkdir -p -- .' +else + # On NextStep and OpenStep, the `mkdir' command does not + # recognize any option. It will interpret all options as + # directories to create, and then abort because `.' already + # exists. + for d in ./-p ./--version; + do + test -d $d && rmdir $d + done + # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists. + if test -f "$ac_aux_dir/mkinstalldirs"; then + mkdir_p='$(mkinstalldirs)' + else + mkdir_p='$(install_sh) -d' + fi +fi + +for ac_prog in gawk mawk nawk awk +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_AWK+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$AWK"; then + ac_cv_prog_AWK="$AWK" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_AWK="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +AWK=$ac_cv_prog_AWK +if test -n "$AWK"; then + echo "$as_me:$LINENO: result: $AWK" >&5 +echo "${ECHO_T}$AWK" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$AWK" && break +done + +echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6 +set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,:./+-,___p_,'` +if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.make <<\_ACEOF all: - @echo 'ac_maketemp="${MAKE}"' -EOF + @echo 'ac_maketemp="$(MAKE)"' +_ACEOF # GNU make sometimes prints "make[1]: Entering...", which would confuse us. -eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=` +eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=` if test -n "$ac_maketemp"; then eval ac_cv_prog_make_${ac_make}_set=yes else eval ac_cv_prog_make_${ac_make}_set=no fi -rm -f conftestmake +rm -f conftest.make fi if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then - echo "$ac_t""yes" 1>&6 + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 SET_MAKE= else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 SET_MAKE="MAKE=${MAKE-make}" fi - -PACKAGE=xgraph - -VERSION=12.1 - -if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then - { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; } +rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ fi -cat >> confdefs.h </dev/null + +# test to see if srcdir already configured +if test "`cd $srcdir && pwd`" != "`pwd`" && + test -f $srcdir/config.status; then + { { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5 +echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;} + { (exit 1); exit 1; }; } +fi + +# test whether we have cygpath +if test -z "$CYGPATH_W"; then + if (cygpath --version) >/dev/null 2>/dev/null; then + CYGPATH_W='cygpath -w' + else + CYGPATH_W=echo + fi +fi + + +# Define the identity of the package. + PACKAGE=xgraph + VERSION=12.1 + + +cat >>confdefs.h <<_ACEOF #define PACKAGE "$PACKAGE" -EOF +_ACEOF -cat >> confdefs.h <>confdefs.h <<_ACEOF #define VERSION "$VERSION" -EOF +_ACEOF + +# Some tools Automake needs. + +ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} +AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} -missing_dir=`cd $ac_aux_dir && pwd` -echo $ac_n "checking for working aclocal""... $ac_c" 1>&6 -echo "configure:721: checking for working aclocal" >&5 -# Run test in a subshell; some versions of sh will print an error if -# an executable is not found, even if stderr is redirected. -# Redirect stdin to placate older versions of autoconf. Sigh. -if (aclocal --version) < /dev/null > /dev/null 2>&1; then - ACLOCAL=aclocal - echo "$ac_t""found" 1>&6 + +AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} + + +AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} + + +MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} + + +AMTAR=${AMTAR-"${am_missing_run}tar"} + +install_sh=${install_sh-"$am_aux_dir/install-sh"} + +# Installed binaries are usually stripped using `strip' when the user +# run `make install-strip'. However `strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the `STRIP' environment variable to overrule this program. +if test "$cross_compiling" != no; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. +set dummy ${ac_tool_prefix}strip; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_STRIP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - ACLOCAL="$missing_dir/missing aclocal" - echo "$ac_t""missing" 1>&6 + if test -n "$STRIP"; then + ac_cv_prog_STRIP="$STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_STRIP="${ac_tool_prefix}strip" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + echo "$as_me:$LINENO: result: $STRIP" >&5 +echo "${ECHO_T}$STRIP" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi -echo $ac_n "checking for working autoconf""... $ac_c" 1>&6 -echo "configure:734: checking for working autoconf" >&5 -# Run test in a subshell; some versions of sh will print an error if -# an executable is not found, even if stderr is redirected. -# Redirect stdin to placate older versions of autoconf. Sigh. -if (autoconf --version) < /dev/null > /dev/null 2>&1; then - AUTOCONF=autoconf - echo "$ac_t""found" 1>&6 +fi +if test -z "$ac_cv_prog_STRIP"; then + ac_ct_STRIP=$STRIP + # Extract the first word of "strip", so it can be a program name with args. +set dummy strip; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - AUTOCONF="$missing_dir/missing autoconf" - echo "$ac_t""missing" 1>&6 + if test -n "$ac_ct_STRIP"; then + ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_STRIP="strip" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + test -z "$ac_cv_prog_ac_ct_STRIP" && ac_cv_prog_ac_ct_STRIP=":" +fi +fi +ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP +if test -n "$ac_ct_STRIP"; then + echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 +echo "${ECHO_T}$ac_ct_STRIP" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi -echo $ac_n "checking for working automake""... $ac_c" 1>&6 -echo "configure:747: checking for working automake" >&5 -# Run test in a subshell; some versions of sh will print an error if -# an executable is not found, even if stderr is redirected. -# Redirect stdin to placate older versions of autoconf. Sigh. -if (automake --version) < /dev/null > /dev/null 2>&1; then - AUTOMAKE=automake - echo "$ac_t""found" 1>&6 + STRIP=$ac_ct_STRIP else - AUTOMAKE="$missing_dir/missing automake" - echo "$ac_t""missing" 1>&6 + STRIP="$ac_cv_prog_STRIP" fi -echo $ac_n "checking for working autoheader""... $ac_c" 1>&6 -echo "configure:760: checking for working autoheader" >&5 -# Run test in a subshell; some versions of sh will print an error if -# an executable is not found, even if stderr is redirected. -# Redirect stdin to placate older versions of autoconf. Sigh. -if (autoheader --version) < /dev/null > /dev/null 2>&1; then - AUTOHEADER=autoheader - echo "$ac_t""found" 1>&6 -else - AUTOHEADER="$missing_dir/missing autoheader" - echo "$ac_t""missing" 1>&6 fi +INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s" -echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6 -echo "configure:773: checking for working makeinfo" >&5 -# Run test in a subshell; some versions of sh will print an error if -# an executable is not found, even if stderr is redirected. -# Redirect stdin to placate older versions of autoconf. Sigh. -if (makeinfo --version) < /dev/null > /dev/null 2>&1; then - MAKEINFO=makeinfo - echo "$ac_t""found" 1>&6 -else - MAKEINFO="$missing_dir/missing makeinfo" - echo "$ac_t""missing" 1>&6 -fi +# We need awk for the "check" target. The system "awk" is bad on +# some platforms. + ac_config_headers="$ac_config_headers autoconf.h" +echo "$as_me:$LINENO: checking if malloc debugging is wanted" >&5 +echo $ECHO_N "checking if malloc debugging is wanted... $ECHO_C" >&6 -echo $ac_n "checking if malloc debugging is wanted""... $ac_c" 1>&6 -echo "configure:792: checking if malloc debugging is wanted" >&5 # 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 "$ac_t""yes" 1>&6 - cat >> confdefs.h <<\EOF + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + +cat >>confdefs.h <<\_ACEOF #define WITH_DMALLOC 1 -EOF +_ACEOF LIBS="$LIBS -ldmalloc" LDFLAGS="$LDFLAGS -g" else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi; + + +echo "$as_me:$LINENO: checking whether to enable maintainer-specific portions of Makefiles" >&5 +echo $ECHO_N "checking whether to enable maintainer-specific portions of Makefiles... $ECHO_C" >&6 + # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given. +if test "${enable_maintainer_mode+set}" = set; then + enableval="$enable_maintainer_mode" + USE_MAINTAINER_MODE=$enableval +else + USE_MAINTAINER_MODE=no +fi; + echo "$as_me:$LINENO: result: $USE_MAINTAINER_MODE" >&5 +echo "${ECHO_T}$USE_MAINTAINER_MODE" >&6 + + +if test $USE_MAINTAINER_MODE = yes; then + MAINTAINER_MODE_TRUE= + MAINTAINER_MODE_FALSE='#' +else + MAINTAINER_MODE_TRUE='#' + MAINTAINER_MODE_FALSE= fi + MAINT=$MAINTAINER_MODE_TRUE -# Extract the first word of "gcc", so it can be a program name with args. -set dummy gcc; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:816: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. +set dummy ${ac_tool_prefix}gcc; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_CC="gcc" - break - fi - done - IFS="$ac_save_ifs" +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}gcc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + fi fi -CC="$ac_cv_prog_CC" +CC=$ac_cv_prog_CC if test -n "$CC"; then - echo "$ac_t""$CC" 1>&6 + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="gcc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + CC=$ac_ct_CC +else + CC="$ac_cv_prog_CC" fi if test -z "$CC"; then - # Extract the first word of "cc", so it can be a program name with args. -set dummy cc; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:846: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. +set dummy ${ac_tool_prefix}cc; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}cc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="cc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + CC=$ac_ct_CC +else + CC="$ac_cv_prog_CC" +fi + +fi +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ac_prog_rejected=no - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then - ac_prog_rejected=yes - continue - fi - ac_cv_prog_CC="cc" - break - fi - done - IFS="$ac_save_ifs" +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift - if test $# -gt 0; then + if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift - set dummy "$ac_dir/$ac_word" "$@" - shift - ac_cv_prog_CC="$@" + ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi -CC="$ac_cv_prog_CC" +CC=$ac_cv_prog_CC if test -n "$CC"; then - echo "$ac_t""$CC" 1>&6 + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - if test -z "$CC"; then - case "`uname -s`" in - *win32* | *WIN32*) - # Extract the first word of "cl", so it can be a program name with args. -set dummy cl; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:897: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_CC="cl" - break - fi - done - IFS="$ac_save_ifs" +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="$ac_tool_prefix$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + fi fi -CC="$ac_cv_prog_CC" +CC=$ac_cv_prog_CC if test -n "$CC"; then - echo "$ac_t""$CC" 1>&6 + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - ;; - esac + + test -n "$CC" && break + done +fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 fi - test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; } +done +done + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi -echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:929: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 + test -n "$ac_ct_CC" && break +done -ac_ext=c -# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. -ac_cpp='$CPP $CPPFLAGS' -ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' -ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' -cross_compiling=$ac_cv_prog_cc_cross + CC=$ac_ct_CC +fi -cat > conftest.$ac_ext << EOF +fi -#line 940 "configure" -#include "confdefs.h" -main(){return(0);} -EOF -if { (eval echo configure:945: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - ac_cv_prog_cc_works=yes - # If we can't run a trivial program, we are probably using a cross compiler. - if (./conftest; exit) 2>/dev/null; then - ac_cv_prog_cc_cross=no +test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH +See \`config.log' for more details." >&5 +echo "$as_me: error: no acceptable C compiler found in \$PATH +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } + +# Provide some information about the compiler. +echo "$as_me:$LINENO:" \ + "checking for C compiler version" >&5 +ac_compiler=`set X $ac_compile; echo $2` +{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 + (eval $ac_compiler --version &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 + (eval $ac_compiler -v &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 + (eval $ac_compiler -V &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files a.out a.exe b.out" +# Try to create an executable without -o first, disregard a.out. +# It will help us diagnose broken compilers, and finding out an intuition +# of exeext. +echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 +echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6 +ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` +if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5 + (eval $ac_link_default) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + # Find the output, starting from the most likely. This scheme is +# not robust to junk in `.', hence go to wildcards (a.*) only as a last +# resort. + +# Be careful to initialize this variable, since it used to be cached. +# Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile. +ac_cv_exeext= +# b.out is created by i960 compilers. +for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out +do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) + ;; + conftest.$ac_ext ) + # This is the source file. + ;; + [ab].out ) + # We found the default executable, but exeext='' is most + # certainly right. + break;; + *.* ) + ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + # FIXME: I believe we export ac_cv_exeext for Libtool, + # but it would be cool to find out if it's true. Does anybody + # maintain Libtool? --akim. + export ac_cv_exeext + break;; + * ) + break;; + esac +done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { echo "$as_me:$LINENO: error: C compiler cannot create executables +See \`config.log' for more details." >&5 +echo "$as_me: error: C compiler cannot create executables +See \`config.log' for more details." >&2;} + { (exit 77); exit 77; }; } +fi + +ac_exeext=$ac_cv_exeext +echo "$as_me:$LINENO: result: $ac_file" >&5 +echo "${ECHO_T}$ac_file" >&6 + +# Check the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +echo "$as_me:$LINENO: checking whether the C compiler works" >&5 +echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6 +# FIXME: These cross compiler hacks should be removed for Autoconf 3.0 +# If not cross compiling, check that we can run a simple program. +if test "$cross_compiling" != yes; then + if { ac_try='./$ac_file' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + cross_compiling=no else - ac_cv_prog_cc_cross=yes + if test "$cross_compiling" = maybe; then + cross_compiling=yes + else + { { echo "$as_me:$LINENO: error: cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } + fi fi -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - ac_cv_prog_cc_works=no fi -rm -fr conftest* -ac_ext=c -# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. -ac_cpp='$CPP $CPPFLAGS' -ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' -ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' -cross_compiling=$ac_cv_prog_cc_cross +echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 -echo "$ac_t""$ac_cv_prog_cc_works" 1>&6 -if test $ac_cv_prog_cc_works = no; then - { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } -fi -echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:971: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 -echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 -cross_compiling=$ac_cv_prog_cc_cross +rm -f a.out a.exe conftest$ac_cv_exeext b.out +ac_clean_files=$ac_clean_files_save +# Check the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 +echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6 +echo "$as_me:$LINENO: result: $cross_compiling" >&5 +echo "${ECHO_T}$cross_compiling" >&6 -echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 -echo "configure:976: checking whether we are using GNU C" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking for suffix of executables" >&5 +echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6 +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + # If both `conftest.exe' and `conftest' are `present' (well, observable) +# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will +# work properly (i.e., refer to `conftest.exe'), while it won't with +# `rm'. +for ac_file in conftest.exe conftest conftest.*; do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;; + *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + export ac_cv_exeext + break;; + * ) break;; + esac +done else - cat > conftest.c <&5 +echo "$as_me: error: cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi + +rm -f conftest$ac_cv_exeext +echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 +echo "${ECHO_T}$ac_cv_exeext" >&6 + +rm -f conftest.$ac_ext +EXEEXT=$ac_cv_exeext +ac_exeext=$EXEEXT +echo "$as_me:$LINENO: checking for suffix of object files" >&5 +echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6 +if test "${ac_cv_objext+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.o conftest.obj +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;; + *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` + break;; + esac +done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute suffix of object files: cannot compile +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi + +rm -f conftest.$ac_cv_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 +echo "${ECHO_T}$ac_cv_objext" >&6 +OBJEXT=$ac_cv_objext +ac_objext=$OBJEXT +echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 +echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6 +if test "${ac_cv_c_compiler_gnu+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + choke me #endif -EOF -if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:985: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then - ac_cv_prog_gcc=yes -else - ac_cv_prog_gcc=no -fi -fi -echo "$ac_t""$ac_cv_prog_gcc" 1>&6 - -if test $ac_cv_prog_gcc = yes; then - GCC=yes + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_compiler_gnu=yes else - GCC= + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_compiler_gnu=no fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu -ac_test_CFLAGS="${CFLAGS+set}" -ac_save_CFLAGS="$CFLAGS" -CFLAGS= -echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -echo "configure:1004: checking whether ${CC-cc} accepts -g" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +fi +echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 +echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6 +GCC=`test $ac_compiler_gnu = yes && echo yes` +ac_test_CFLAGS=${CFLAGS+set} +ac_save_CFLAGS=$CFLAGS +CFLAGS="-g" +echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 +echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6 +if test "${ac_cv_prog_cc_g+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - echo 'void f(){}' > conftest.c -if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_prog_cc_g=yes else - ac_cv_prog_cc_g=no -fi -rm -f conftest* + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 +ac_cv_prog_cc_g=no fi - -echo "$ac_t""$ac_cv_prog_cc_g" 1>&6 +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_g" >&6 if test "$ac_test_CFLAGS" = set; then - CFLAGS="$ac_save_CFLAGS" + CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" @@ -1030,101 +2455,689 @@ else CFLAGS= fi fi +echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5 +echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6 +if test "${ac_cv_prog_cc_stdc+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_prog_cc_stdc=no +ac_save_CC=$CC +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include +#include +#include +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +struct buf { int x; }; +FILE * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} + +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not '\xHH' hex character constants. + These don't provoke an error unfortunately, instead are silently treated + as 'x'. The following induces an error, until -std1 is added to get + proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an + array size at least. It's necessary to write '\x00'==0 to get something + that's true only with -std1. */ +int osf4_cc_array ['\x00' == 0 ? 1 : -1]; + +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); +int argc; +char **argv; +int +main () +{ +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; + ; + return 0; +} +_ACEOF +# Don't try gcc -ansi; that turns off useful extensions and +# breaks some systems' header files. +# AIX -qlanglvl=ansi +# Ultrix and OSF/1 -std1 +# HP-UX 10.20 and later -Ae +# HP-UX older versions -Aa -D_HPUX_SOURCE +# SVR4 -Xc -D__EXTENSIONS__ +for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_prog_cc_stdc=$ac_arg +break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext +done +rm -f conftest.$ac_ext conftest.$ac_objext +CC=$ac_save_CC + +fi + +case "x$ac_cv_prog_cc_stdc" in + x|xno) + echo "$as_me:$LINENO: result: none needed" >&5 +echo "${ECHO_T}none needed" >&6 ;; + *) + echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6 + CC="$CC $ac_cv_prog_cc_stdc" ;; +esac + +# Some people use a C++ compiler to compile C. Since we use `exit', +# in C++ we need to declare it. In case someone uses the same compiler +# for both compiling C and C++ we need to have the C++ compiler decide +# the declaration of exit, since it's the most demanding environment. +cat >conftest.$ac_ext <<_ACEOF +#ifndef __cplusplus + choke me +#endif +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + for ac_declaration in \ + '' \ + 'extern "C" void std::exit (int) throw (); using std::exit;' \ + 'extern "C" void std::exit (int); using std::exit;' \ + 'extern "C" void exit (int) throw ();' \ + 'extern "C" void exit (int);' \ + 'void exit (int);' +do + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_declaration +#include +int +main () +{ +exit (42); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +continue +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_declaration +int +main () +{ +exit (42); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +done +rm -f conftest* +if test -n "$ac_declaration"; then + echo '#ifdef __cplusplus' >>confdefs.h + echo $ac_declaration >>confdefs.h + echo '#endif' >>confdefs.h +fi + +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +DEPDIR="${am__leading_dot}deps" + + ac_config_commands="$ac_config_commands depfiles" -echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 -echo "configure:1037: checking how to run the C preprocessor" >&5 +am_make=${MAKE-make} +cat > confinc << 'END' +am__doit: + @echo done +.PHONY: am__doit +END +# If we don't find an include directive, just comment out the code. +echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5 +echo $ECHO_N "checking for style of include used by $am_make... $ECHO_C" >&6 +am__include="#" +am__quote= +_am_result=none +# First try GNU make style include. +echo "include confinc" > confmf +# We grep out `Entering directory' and `Leaving directory' +# messages which can occur if `w' ends up in MAKEFLAGS. +# In particular we don't look at `^make:' because GNU make might +# be invoked under some other name (usually "gmake"), in which +# case it prints its new name instead of `make'. +if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then + am__include=include + am__quote= + _am_result=GNU +fi +# Now try BSD make style include. +if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then + am__include=.include + am__quote="\"" + _am_result=BSD + fi +fi + + +echo "$as_me:$LINENO: result: $_am_result" >&5 +echo "${ECHO_T}$_am_result" >&6 +rm -f confinc confmf + +# Check whether --enable-dependency-tracking or --disable-dependency-tracking was given. +if test "${enable_dependency_tracking+set}" = set; then + enableval="$enable_dependency_tracking" + +fi; +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' +fi + + +if test "x$enable_dependency_tracking" != xno; then + AMDEP_TRUE= + AMDEP_FALSE='#' +else + AMDEP_TRUE='#' + AMDEP_FALSE= +fi + + + + +depcc="$CC" am_compiler_list= + +echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 +echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6 +if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named `D' -- because `-MD' means `put the output + # in D'. + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_CC_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` + fi + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with + # Solaris 8's {/usr,}/bin/sh. + touch sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + case $depmode in + nosideeffect) + # after this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + none) break ;; + esac + # We check with `-c' and `-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle `-M -o', and we need to detect this. + if depmode=$depmode \ + source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_CC_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_CC_dependencies_compiler_type=none +fi + +fi +echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5 +echo "${ECHO_T}$am_cv_CC_dependencies_compiler_type" >&6 +CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type + + + +if + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then + am__fastdepCC_TRUE= + am__fastdepCC_FALSE='#' +else + am__fastdepCC_TRUE='#' + am__fastdepCC_FALSE= +fi + + + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 +echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then -if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 + if test "${ac_cv_prog_CPP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - # This must be in double quotes, not single quotes, because CPP may get - # substituted into the Makefile and "${CC-cc}" will confuse make. - CPP="${CC-cc} -E" + # Double quotes because CPP needs to be expanded + for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" + do + ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. - cat > conftest.$ac_ext < -Syntax Error -EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1058: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` -if test -z "$ac_err"; then + # not just through cpp. "Syntax error" is here to catch this case. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then : else - echo "$ac_err" >&5 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - CPP="${CC-cc} -E -traditional-cpp" - cat > conftest.$ac_ext < -Syntax Error -EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1075: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` -if test -z "$ac_err"; then - : -else - echo "$ac_err" >&5 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - CPP="${CC-cc} -nologo -E" - cat > conftest.$ac_ext < -Syntax Error -EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1092: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` -if test -z "$ac_err"; then - : -else - echo "$ac_err" >&5 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - CPP=/lib/cpp -fi -rm -f conftest* -fi -rm -f conftest* -fi -rm -f conftest* - ac_cv_prog_CPP="$CPP" -fi - CPP="$ac_cv_prog_CPP" -else - ac_cv_prog_CPP="$CPP" -fi -echo "$ac_t""$CPP" 1>&6 + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 -# If we find X, set shell vars x_includes and x_libraries to the -# paths, otherwise set no_x=yes. -# Uses ac_ vars as temps to allow command line to override cache and checks. -# --without-x overrides everything else, but does not touch the cache. -echo $ac_n "checking for X""... $ac_c" 1>&6 -echo "configure:1121: checking for X" >&5 + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.$ac_ext + + # OK, works on sane cases. Now check whether non-existent headers + # can be detected and how. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + # Broken: success on invalid input. +continue +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.err conftest.$ac_ext +if $ac_preproc_ok; then + break +fi + + done + ac_cv_prog_CPP=$CPP + +fi + CPP=$ac_cv_prog_CPP +else + ac_cv_prog_CPP=$CPP +fi +echo "$as_me:$LINENO: result: $CPP" >&5 +echo "${ECHO_T}$CPP" >&6 +ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.$ac_ext + + # OK, works on sane cases. Now check whether non-existent headers + # can be detected and how. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + # Broken: success on invalid input. +continue +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.err conftest.$ac_ext +if $ac_preproc_ok; then + : +else + { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details." >&5 +echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + +if test "x$ac_path_x_has_been_run" != xyes; then + echo "$as_me:$LINENO: checking for X" >&5 +echo $ECHO_N "checking for X... $ECHO_C" >&6 + +ac_path_x_has_been_run=yes # Check whether --with-x or --without-x was given. if test "${with_x+set}" = set; then withval="$with_x" - : -fi +fi; # $have_x is `yes', `no', `disabled', or empty when we do not yet know. if test "x$with_x" = xno; then # The user explicitly disabled X. @@ -1134,207 +3147,209 @@ else # Both variables are already set. have_x=yes else -if eval "test \"`echo '$''{'ac_cv_have_x'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 + if test "${ac_cv_have_x+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else # One or both of the vars are not set, and there is no cached value. -ac_x_includes=NO ac_x_libraries=NO -rm -fr conftestdir -if mkdir conftestdir; then - cd conftestdir +ac_x_includes=no ac_x_libraries=no +rm -fr conftest.dir +if mkdir conftest.dir; then + cd conftest.dir # Make sure to not put "make" in the Imakefile rules, since we grep it out. - cat > Imakefile <<'EOF' + cat >Imakefile <<'_ACEOF' acfindx: @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"' -EOF +_ACEOF if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then # GNU make sometimes prints "make[1]: Entering...", which would confuse us. eval `${MAKE-make} acfindx 2>/dev/null | grep -v make` # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR. for ac_extension in a so sl; do if test ! -f $ac_im_usrlibdir/libX11.$ac_extension && - test -f $ac_im_libdir/libX11.$ac_extension; then - ac_im_usrlibdir=$ac_im_libdir; break + test -f $ac_im_libdir/libX11.$ac_extension; then + ac_im_usrlibdir=$ac_im_libdir; break fi done # Screen out bogus values from the imake configuration. They are # bogus both because they are the default anyway, and because # using them would break gcc on systems where it needs fixed includes. - case "$ac_im_incroot" in + case $ac_im_incroot in /usr/include) ;; - *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes="$ac_im_incroot" ;; + *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;; esac - case "$ac_im_usrlibdir" in + case $ac_im_usrlibdir in /usr/lib | /lib) ;; - *) test -d "$ac_im_usrlibdir" && ac_x_libraries="$ac_im_usrlibdir" ;; + *) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;; esac fi cd .. - rm -fr conftestdir + rm -fr conftest.dir fi -if test "$ac_x_includes" = NO; then - # Guess where to find include files, by looking for this one X11 .h file. - test -z "$x_direct_test_include" && x_direct_test_include=X11/Intrinsic.h +# Standard set of common directories for X headers. +# Check X11 before X11Rn because it is often a symlink to the current release. +ac_x_header_dirs=' +/usr/X11/include +/usr/X11R6/include +/usr/X11R5/include +/usr/X11R4/include +/usr/include/X11 +/usr/include/X11R6 +/usr/include/X11R5 +/usr/include/X11R4 + +/usr/local/X11/include +/usr/local/X11R6/include +/usr/local/X11R5/include +/usr/local/X11R4/include + +/usr/local/include/X11 +/usr/local/include/X11R6 +/usr/local/include/X11R5 +/usr/local/include/X11R4 + +/usr/X386/include +/usr/x386/include +/usr/XFree86/include/X11 + +/usr/include +/usr/local/include +/usr/unsupported/include +/usr/athena/include +/usr/local/x11r5/include +/usr/lpp/Xamples/include + +/usr/openwin/include +/usr/openwin/share/include' + +if test "$ac_x_includes" = no; then + # Guess where to find include files, by looking for a specified header file. # First, try using that file with no special directory specified. -cat > conftest.$ac_ext < -EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1188: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` -if test -z "$ac_err"; then - rm -rf conftest* + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then # We can compile using X headers with no special include directory. ac_x_includes= else - echo "$ac_err" >&5 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - # Look for the header file in a standard set of common directories. -# Check X11 before X11Rn because it is often a symlink to the current release. - for ac_dir in \ - /usr/X11/include \ - /usr/X11R6/include \ - /usr/X11R5/include \ - /usr/X11R4/include \ - \ - /usr/include/X11 \ - /usr/include/X11R6 \ - /usr/include/X11R5 \ - /usr/include/X11R4 \ - \ - /usr/local/X11/include \ - /usr/local/X11R6/include \ - /usr/local/X11R5/include \ - /usr/local/X11R4/include \ - \ - /usr/local/include/X11 \ - /usr/local/include/X11R6 \ - /usr/local/include/X11R5 \ - /usr/local/include/X11R4 \ - \ - /usr/X386/include \ - /usr/x386/include \ - /usr/XFree86/include/X11 \ - \ - /usr/include \ - /usr/local/include \ - /usr/unsupported/include \ - /usr/athena/include \ - /usr/local/x11r5/include \ - /usr/lpp/Xamples/include \ - \ - /usr/openwin/include \ - /usr/openwin/share/include \ - ; \ - do - if test -r "$ac_dir/$x_direct_test_include"; then - ac_x_includes=$ac_dir - break - fi - done + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + for ac_dir in $ac_x_header_dirs; do + if test -r "$ac_dir/X11/Intrinsic.h"; then + ac_x_includes=$ac_dir + break + fi +done fi -rm -f conftest* -fi # $ac_x_includes = NO +rm -f conftest.err conftest.$ac_ext +fi # $ac_x_includes = no -if test "$ac_x_libraries" = NO; then +if test "$ac_x_libraries" = no; then # Check for the libraries. - - test -z "$x_direct_test_library" && x_direct_test_library=Xt - test -z "$x_direct_test_function" && x_direct_test_function=XtMalloc - # See if we find them without any special options. # Don't add to $LIBS permanently. - ac_save_LIBS="$LIBS" - LIBS="-l$x_direct_test_library $LIBS" -cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - LIBS="$ac_save_LIBS" + ac_save_LIBS=$LIBS + LIBS="-lXt $LIBS" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +int +main () +{ +XtMalloc (0) + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + LIBS=$ac_save_LIBS # We can link X programs with no special library path. ac_x_libraries= else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - LIBS="$ac_save_LIBS" -# First see if replacing the include by lib works. -# Check X11 before X11Rn because it is often a symlink to the current release. -for ac_dir in `echo "$ac_x_includes" | sed s/include/lib/` \ - /usr/X11/lib \ - /usr/X11R6/lib \ - /usr/X11R5/lib \ - /usr/X11R4/lib \ - \ - /usr/lib/X11 \ - /usr/lib/X11R6 \ - /usr/lib/X11R5 \ - /usr/lib/X11R4 \ - \ - /usr/local/X11/lib \ - /usr/local/X11R6/lib \ - /usr/local/X11R5/lib \ - /usr/local/X11R4/lib \ - \ - /usr/local/lib/X11 \ - /usr/local/lib/X11R6 \ - /usr/local/lib/X11R5 \ - /usr/local/lib/X11R4 \ - \ - /usr/X386/lib \ - /usr/x386/lib \ - /usr/XFree86/lib/X11 \ - \ - /usr/lib \ - /usr/local/lib \ - /usr/unsupported/lib \ - /usr/athena/lib \ - /usr/local/x11r5/lib \ - /usr/lpp/Xamples/lib \ - /lib/usr/lib/X11 \ - \ - /usr/openwin/lib \ - /usr/openwin/share/lib \ - ; \ + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +LIBS=$ac_save_LIBS +for ac_dir in `echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g` do + # Don't even attempt the hair of trying to link an X program! for ac_extension in a so sl; do - if test -r $ac_dir/lib${x_direct_test_library}.$ac_extension; then + if test -r $ac_dir/libXt.$ac_extension; then ac_x_libraries=$ac_dir break 2 fi done done fi -rm -f conftest* -fi # $ac_x_libraries = NO +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi # $ac_x_libraries = no -if test "$ac_x_includes" = NO || test "$ac_x_libraries" = NO; then +if test "$ac_x_includes" = no || test "$ac_x_libraries" = no; then # Didn't find X anywhere. Cache the known absence of X. ac_cv_have_x="have_x=no" else # Record where we found X for the cache. ac_cv_have_x="have_x=yes \ - ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries" + ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries" fi fi + fi eval "$ac_cv_have_x" fi # $with_x != no if test "$have_x" != yes; then - echo "$ac_t""$have_x" 1>&6 + echo "$as_me:$LINENO: result: $have_x" >&5 +echo "${ECHO_T}$have_x" >&6 no_x=yes else # If each of the values was on the command line, it overrides each guess. @@ -1343,14 +3358,21 @@ else # Update the cache value to reflect the command line values. ac_cv_have_x="have_x=yes \ ac_x_includes=$x_includes ac_x_libraries=$x_libraries" - echo "$ac_t""libraries $x_libraries, headers $x_includes" 1>&6 + # It might be that x_includes is empty (headers are found in the + # standard search path. Then output the corresponding message + ac_out_x_includes=$x_includes + test "x$x_includes" = x && ac_out_x_includes="in standard search path" + echo "$as_me:$LINENO: result: libraries $x_libraries, headers $ac_out_x_includes" >&5 +echo "${ECHO_T}libraries $x_libraries, headers $ac_out_x_includes" >&6 fi +fi if test "$no_x" = yes; then # Not all programs may use this symbol, but it does not hurt to define it. - cat >> confdefs.h <<\EOF + +cat >>confdefs.h <<\_ACEOF #define X_DISPLAY_MISSING 1 -EOF +_ACEOF X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS= else @@ -1363,60 +3385,117 @@ else X_LIBS="$X_LIBS -L$x_libraries" # For Solaris; some versions of Sun CC require a space after -R and # others require no space. Words are not sufficient . . . . - case "`(uname -sr) 2>/dev/null`" in + case `(uname -sr) 2>/dev/null` in "SunOS 5"*) - echo $ac_n "checking whether -R must be followed by a space""... $ac_c" 1>&6 -echo "configure:1370: checking whether -R must be followed by a space" >&5 - ac_xsave_LIBS="$LIBS"; LIBS="$LIBS -R$x_libraries" - cat > conftest.$ac_ext <&5 +echo $ECHO_N "checking whether -R must be followed by a space... $ECHO_C" >&6 + ac_xsave_LIBS=$LIBS; LIBS="$LIBS -R$x_libraries" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ -int main() { +int +main () +{ -; return 0; } -EOF -if { (eval echo configure:1380: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_R_nospace=yes else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - ac_R_nospace=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_R_nospace=no fi -rm -f conftest* +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext if test $ac_R_nospace = yes; then - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 X_LIBS="$X_LIBS -R$x_libraries" else LIBS="$ac_xsave_LIBS -R $x_libraries" - cat > conftest.$ac_ext <conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ -int main() { +int +main () +{ -; return 0; } -EOF -if { (eval echo configure:1403: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_R_space=yes else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - ac_R_space=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_R_space=no fi -rm -f conftest* +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext if test $ac_R_space = yes; then - echo "$ac_t""yes" 1>&6 + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 X_LIBS="$X_LIBS -R $x_libraries" else - echo "$ac_t""neither works" 1>&6 + echo "$as_me:$LINENO: result: neither works" >&5 +echo "${ECHO_T}neither works" >&6 fi fi - LIBS="$ac_xsave_LIBS" + LIBS=$ac_xsave_LIBS esac fi @@ -1427,632 +3506,1525 @@ rm -f conftest* if test "$ISC" = yes; then X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet" else - # Martyn.Johnson@cl.cam.ac.uk says this is needed for Ultrix, if the X - # libraries were built with DECnet support. And karl@cs.umb.edu says + # Martyn Johnson says this is needed for Ultrix, if the X + # libraries were built with DECnet support. And Karl Berry says # the Alpha needs dnet_stub (dnet does not exist). - echo $ac_n "checking for dnet_ntoa in -ldnet""... $ac_c" 1>&6 -echo "configure:1435: checking for dnet_ntoa in -ldnet" >&5 -ac_lib_var=`echo dnet'_'dnet_ntoa | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - ac_save_LIBS="$LIBS" -LIBS="-ldnet $LIBS" -cat > conftest.$ac_ext <conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + /* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif /* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char dnet_ntoa(); - -int main() { -dnet_ntoa() -; return 0; } -EOF -if { (eval echo configure:1454: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" + builtin and then its argument prototype would still apply. */ +char XOpenDisplay (); +int +main () +{ +XOpenDisplay (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + : else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=no" -fi -rm -f conftest* -LIBS="$ac_save_LIBS" + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 +echo "$as_me:$LINENO: checking for dnet_ntoa in -ldnet" >&5 +echo $ECHO_N "checking for dnet_ntoa in -ldnet... $ECHO_C" >&6 +if test "${ac_cv_lib_dnet_dnet_ntoa+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldnet $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char dnet_ntoa (); +int +main () +{ +dnet_ntoa (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_dnet_dnet_ntoa=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_dnet_dnet_ntoa=no fi -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then - echo "$ac_t""yes" 1>&6 +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_dnet_dnet_ntoa" >&5 +echo "${ECHO_T}$ac_cv_lib_dnet_dnet_ntoa" >&6 +if test $ac_cv_lib_dnet_dnet_ntoa = yes; then X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet" -else - echo "$ac_t""no" 1>&6 fi if test $ac_cv_lib_dnet_dnet_ntoa = no; then - echo $ac_n "checking for dnet_ntoa in -ldnet_stub""... $ac_c" 1>&6 -echo "configure:1476: checking for dnet_ntoa in -ldnet_stub" >&5 -ac_lib_var=`echo dnet_stub'_'dnet_ntoa | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 + echo "$as_me:$LINENO: checking for dnet_ntoa in -ldnet_stub" >&5 +echo $ECHO_N "checking for dnet_ntoa in -ldnet_stub... $ECHO_C" >&6 +if test "${ac_cv_lib_dnet_stub_dnet_ntoa+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_save_LIBS="$LIBS" + ac_check_lib_save_LIBS=$LIBS LIBS="-ldnet_stub $LIBS" -cat > conftest.$ac_ext <conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + /* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif /* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char dnet_ntoa(); - -int main() { -dnet_ntoa() -; return 0; } -EOF -if { (eval echo configure:1495: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" + builtin and then its argument prototype would still apply. */ +char dnet_ntoa (); +int +main () +{ +dnet_ntoa (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_dnet_stub_dnet_ntoa=yes else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=no" -fi -rm -f conftest* -LIBS="$ac_save_LIBS" + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 +ac_cv_lib_dnet_stub_dnet_ntoa=no fi -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then - echo "$ac_t""yes" 1>&6 +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5 +echo "${ECHO_T}$ac_cv_lib_dnet_stub_dnet_ntoa" >&6 +if test $ac_cv_lib_dnet_stub_dnet_ntoa = yes; then X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub" -else - echo "$ac_t""no" 1>&6 fi fi +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="$ac_xsave_LIBS" # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT, # to get the SysV transport functions. - # chad@anasazi.com says the Pyramis MIS-ES running DC/OSx (SVR4) + # Chad R. Larson says the Pyramis MIS-ES running DC/OSx (SVR4) # needs -lnsl. # The nsl library prevents programs from opening the X display - # on Irix 5.2, according to dickey@clark.net. - echo $ac_n "checking for gethostbyname""... $ac_c" 1>&6 -echo "configure:1524: checking for gethostbyname" >&5 -if eval "test \"`echo '$''{'ac_cv_func_gethostbyname'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 + # on Irix 5.2, according to T.E. Dickey. + # The functions gethostbyname, getservbyname, and inet_addr are + # in -lbsd on LynxOS 3.0.1/i386, according to Lars Hecking. + echo "$as_me:$LINENO: checking for gethostbyname" >&5 +echo $ECHO_N "checking for gethostbyname... $ECHO_C" >&6 +if test "${ac_cv_func_gethostbyname+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat > conftest.$ac_ext <conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define gethostbyname to an innocuous variant, in case declares gethostbyname. + For example, HP-UX 11i declares gettimeofday. */ +#define gethostbyname innocuous_gethostbyname + /* System header to define __stub macros and hopefully few prototypes, - which can conflict with char gethostbyname(); below. */ -#include + which can conflict with char gethostbyname (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef gethostbyname + /* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +{ +#endif /* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char gethostbyname(); - -int main() { - + builtin and then its argument prototype would still apply. */ +char gethostbyname (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_gethostbyname) || defined (__stub___gethostbyname) choke me #else -gethostbyname(); +char (*f) () = gethostbyname; +#endif +#ifdef __cplusplus +} #endif -; return 0; } -EOF -if { (eval echo configure:1552: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_func_gethostbyname=yes" +int +main () +{ +return f != gethostbyname; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_gethostbyname=yes else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_func_gethostbyname=no" -fi -rm -f conftest* -fi + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 -if eval "test \"`echo '$ac_cv_func_'gethostbyname`\" = yes"; then - echo "$ac_t""yes" 1>&6 - : -else - echo "$ac_t""no" 1>&6 +ac_cv_func_gethostbyname=no fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_func_gethostbyname" >&5 +echo "${ECHO_T}$ac_cv_func_gethostbyname" >&6 if test $ac_cv_func_gethostbyname = no; then - echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6 -echo "configure:1573: checking for gethostbyname in -lnsl" >&5 -ac_lib_var=`echo nsl'_'gethostbyname | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 + echo "$as_me:$LINENO: checking for gethostbyname in -lnsl" >&5 +echo $ECHO_N "checking for gethostbyname in -lnsl... $ECHO_C" >&6 +if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_save_LIBS="$LIBS" + ac_check_lib_save_LIBS=$LIBS LIBS="-lnsl $LIBS" -cat > conftest.$ac_ext <conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + /* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif /* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char gethostbyname(); - -int main() { -gethostbyname() -; return 0; } -EOF -if { (eval echo configure:1592: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" + builtin and then its argument prototype would still apply. */ +char gethostbyname (); +int +main () +{ +gethostbyname (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_nsl_gethostbyname=yes else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=no" -fi -rm -f conftest* -LIBS="$ac_save_LIBS" + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 +ac_cv_lib_nsl_gethostbyname=no fi -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then - echo "$ac_t""yes" 1>&6 +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_nsl_gethostbyname" >&5 +echo "${ECHO_T}$ac_cv_lib_nsl_gethostbyname" >&6 +if test $ac_cv_lib_nsl_gethostbyname = yes; then X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl" -else - echo "$ac_t""no" 1>&6 fi + if test $ac_cv_lib_nsl_gethostbyname = no; then + echo "$as_me:$LINENO: checking for gethostbyname in -lbsd" >&5 +echo $ECHO_N "checking for gethostbyname in -lbsd... $ECHO_C" >&6 +if test "${ac_cv_lib_bsd_gethostbyname+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lbsd $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char gethostbyname (); +int +main () +{ +gethostbyname (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_bsd_gethostbyname=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_bsd_gethostbyname=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_bsd_gethostbyname" >&5 +echo "${ECHO_T}$ac_cv_lib_bsd_gethostbyname" >&6 +if test $ac_cv_lib_bsd_gethostbyname = yes; then + X_EXTRA_LIBS="$X_EXTRA_LIBS -lbsd" +fi + + fi fi # lieder@skyler.mavd.honeywell.com says without -lsocket, # socket/setsockopt and other routines are undefined under SCO ODT # 2.0. But -lsocket is broken on IRIX 5.2 (and is not necessary - # on later versions), says simon@lia.di.epfl.ch: it contains - # gethostby* variants that don't use the nameserver (or something). - # -lsocket must be given before -lnsl if both are needed. - # We assume that if connect needs -lnsl, so does gethostbyname. - echo $ac_n "checking for connect""... $ac_c" 1>&6 -echo "configure:1622: checking for connect" >&5 -if eval "test \"`echo '$''{'ac_cv_func_connect'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 + # on later versions), says Simon Leinen: it contains gethostby* + # variants that don't use the name server (or something). -lsocket + # must be given before -lnsl if both are needed. We assume that + # if connect needs -lnsl, so does gethostbyname. + echo "$as_me:$LINENO: checking for connect" >&5 +echo $ECHO_N "checking for connect... $ECHO_C" >&6 +if test "${ac_cv_func_connect+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat > conftest.$ac_ext <conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define connect to an innocuous variant, in case declares connect. + For example, HP-UX 11i declares gettimeofday. */ +#define connect innocuous_connect + /* System header to define __stub macros and hopefully few prototypes, - which can conflict with char connect(); below. */ -#include + which can conflict with char connect (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef connect + /* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +{ +#endif /* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char connect(); - -int main() { - + builtin and then its argument prototype would still apply. */ +char connect (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_connect) || defined (__stub___connect) choke me #else -connect(); +char (*f) () = connect; +#endif +#ifdef __cplusplus +} #endif -; return 0; } -EOF -if { (eval echo configure:1650: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_func_connect=yes" +int +main () +{ +return f != connect; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_connect=yes else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_func_connect=no" -fi -rm -f conftest* -fi + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 -if eval "test \"`echo '$ac_cv_func_'connect`\" = yes"; then - echo "$ac_t""yes" 1>&6 - : -else - echo "$ac_t""no" 1>&6 +ac_cv_func_connect=no fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_func_connect" >&5 +echo "${ECHO_T}$ac_cv_func_connect" >&6 if test $ac_cv_func_connect = no; then - echo $ac_n "checking for connect in -lsocket""... $ac_c" 1>&6 -echo "configure:1671: checking for connect in -lsocket" >&5 -ac_lib_var=`echo socket'_'connect | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 + echo "$as_me:$LINENO: checking for connect in -lsocket" >&5 +echo $ECHO_N "checking for connect in -lsocket... $ECHO_C" >&6 +if test "${ac_cv_lib_socket_connect+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_save_LIBS="$LIBS" + ac_check_lib_save_LIBS=$LIBS LIBS="-lsocket $X_EXTRA_LIBS $LIBS" -cat > conftest.$ac_ext <conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + /* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif /* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char connect(); - -int main() { -connect() -; return 0; } -EOF -if { (eval echo configure:1690: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" + builtin and then its argument prototype would still apply. */ +char connect (); +int +main () +{ +connect (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_socket_connect=yes else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=no" -fi -rm -f conftest* -LIBS="$ac_save_LIBS" + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 +ac_cv_lib_socket_connect=no fi -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then - echo "$ac_t""yes" 1>&6 +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_socket_connect" >&5 +echo "${ECHO_T}$ac_cv_lib_socket_connect" >&6 +if test $ac_cv_lib_socket_connect = yes; then X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS" -else - echo "$ac_t""no" 1>&6 fi fi - # gomez@mi.uni-erlangen.de says -lposix is necessary on A/UX. - echo $ac_n "checking for remove""... $ac_c" 1>&6 -echo "configure:1714: checking for remove" >&5 -if eval "test \"`echo '$''{'ac_cv_func_remove'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 + # Guillermo Gomez says -lposix is necessary on A/UX. + echo "$as_me:$LINENO: checking for remove" >&5 +echo $ECHO_N "checking for remove... $ECHO_C" >&6 +if test "${ac_cv_func_remove+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat > conftest.$ac_ext <conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define remove to an innocuous variant, in case declares remove. + For example, HP-UX 11i declares gettimeofday. */ +#define remove innocuous_remove + /* System header to define __stub macros and hopefully few prototypes, - which can conflict with char remove(); below. */ -#include + which can conflict with char remove (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef remove + /* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +{ +#endif /* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char remove(); - -int main() { - + builtin and then its argument prototype would still apply. */ +char remove (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_remove) || defined (__stub___remove) choke me #else -remove(); +char (*f) () = remove; +#endif +#ifdef __cplusplus +} #endif -; return 0; } -EOF -if { (eval echo configure:1742: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_func_remove=yes" +int +main () +{ +return f != remove; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_remove=yes else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_func_remove=no" -fi -rm -f conftest* -fi + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 -if eval "test \"`echo '$ac_cv_func_'remove`\" = yes"; then - echo "$ac_t""yes" 1>&6 - : -else - echo "$ac_t""no" 1>&6 +ac_cv_func_remove=no fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_func_remove" >&5 +echo "${ECHO_T}$ac_cv_func_remove" >&6 if test $ac_cv_func_remove = no; then - echo $ac_n "checking for remove in -lposix""... $ac_c" 1>&6 -echo "configure:1763: checking for remove in -lposix" >&5 -ac_lib_var=`echo posix'_'remove | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 + echo "$as_me:$LINENO: checking for remove in -lposix" >&5 +echo $ECHO_N "checking for remove in -lposix... $ECHO_C" >&6 +if test "${ac_cv_lib_posix_remove+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_save_LIBS="$LIBS" + ac_check_lib_save_LIBS=$LIBS LIBS="-lposix $LIBS" -cat > conftest.$ac_ext <conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + /* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif /* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char remove(); - -int main() { -remove() -; return 0; } -EOF -if { (eval echo configure:1782: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" + builtin and then its argument prototype would still apply. */ +char remove (); +int +main () +{ +remove (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_posix_remove=yes else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=no" -fi -rm -f conftest* -LIBS="$ac_save_LIBS" + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 +ac_cv_lib_posix_remove=no fi -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then - echo "$ac_t""yes" 1>&6 +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_posix_remove" >&5 +echo "${ECHO_T}$ac_cv_lib_posix_remove" >&6 +if test $ac_cv_lib_posix_remove = yes; then X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix" -else - echo "$ac_t""no" 1>&6 fi fi # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay. - echo $ac_n "checking for shmat""... $ac_c" 1>&6 -echo "configure:1806: checking for shmat" >&5 -if eval "test \"`echo '$''{'ac_cv_func_shmat'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 + echo "$as_me:$LINENO: checking for shmat" >&5 +echo $ECHO_N "checking for shmat... $ECHO_C" >&6 +if test "${ac_cv_func_shmat+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat > conftest.$ac_ext <conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define shmat to an innocuous variant, in case declares shmat. + For example, HP-UX 11i declares gettimeofday. */ +#define shmat innocuous_shmat + /* System header to define __stub macros and hopefully few prototypes, - which can conflict with char shmat(); below. */ -#include + which can conflict with char shmat (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef shmat + /* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +{ +#endif /* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char shmat(); - -int main() { - + builtin and then its argument prototype would still apply. */ +char shmat (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_shmat) || defined (__stub___shmat) choke me #else -shmat(); +char (*f) () = shmat; +#endif +#ifdef __cplusplus +} #endif -; return 0; } -EOF -if { (eval echo configure:1834: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_func_shmat=yes" +int +main () +{ +return f != shmat; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_shmat=yes else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_func_shmat=no" -fi -rm -f conftest* -fi + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 -if eval "test \"`echo '$ac_cv_func_'shmat`\" = yes"; then - echo "$ac_t""yes" 1>&6 - : -else - echo "$ac_t""no" 1>&6 +ac_cv_func_shmat=no fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_func_shmat" >&5 +echo "${ECHO_T}$ac_cv_func_shmat" >&6 if test $ac_cv_func_shmat = no; then - echo $ac_n "checking for shmat in -lipc""... $ac_c" 1>&6 -echo "configure:1855: checking for shmat in -lipc" >&5 -ac_lib_var=`echo ipc'_'shmat | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 + echo "$as_me:$LINENO: checking for shmat in -lipc" >&5 +echo $ECHO_N "checking for shmat in -lipc... $ECHO_C" >&6 +if test "${ac_cv_lib_ipc_shmat+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_save_LIBS="$LIBS" + ac_check_lib_save_LIBS=$LIBS LIBS="-lipc $LIBS" -cat > conftest.$ac_ext <conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + /* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif /* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char shmat(); - -int main() { -shmat() -; return 0; } -EOF -if { (eval echo configure:1874: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" + builtin and then its argument prototype would still apply. */ +char shmat (); +int +main () +{ +shmat (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_ipc_shmat=yes else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=no" -fi -rm -f conftest* -LIBS="$ac_save_LIBS" + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 +ac_cv_lib_ipc_shmat=no fi -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then - echo "$ac_t""yes" 1>&6 +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_ipc_shmat" >&5 +echo "${ECHO_T}$ac_cv_lib_ipc_shmat" >&6 +if test $ac_cv_lib_ipc_shmat = yes; then X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc" -else - echo "$ac_t""no" 1>&6 fi fi fi # Check for libraries that X11R6 Xt/Xaw programs need. - ac_save_LDFLAGS="$LDFLAGS" + ac_save_LDFLAGS=$LDFLAGS test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries" # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to # check for ICE first), but we must link in the order -lSM -lICE or # we get undefined symbols. So assume we have SM if we have ICE. # These have to be linked with before -lX11, unlike the other # libraries we check for below, so use a different variable. - # --interran@uluru.Stanford.EDU, kb@cs.umb.edu. - echo $ac_n "checking for IceConnectionNumber in -lICE""... $ac_c" 1>&6 -echo "configure:1907: checking for IceConnectionNumber in -lICE" >&5 -ac_lib_var=`echo ICE'_'IceConnectionNumber | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 + # John Interrante, Karl Berry + echo "$as_me:$LINENO: checking for IceConnectionNumber in -lICE" >&5 +echo $ECHO_N "checking for IceConnectionNumber in -lICE... $ECHO_C" >&6 +if test "${ac_cv_lib_ICE_IceConnectionNumber+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_save_LIBS="$LIBS" + ac_check_lib_save_LIBS=$LIBS LIBS="-lICE $X_EXTRA_LIBS $LIBS" -cat > conftest.$ac_ext <conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + /* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif /* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char IceConnectionNumber(); - -int main() { -IceConnectionNumber() -; return 0; } -EOF -if { (eval echo configure:1926: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" + builtin and then its argument prototype would still apply. */ +char IceConnectionNumber (); +int +main () +{ +IceConnectionNumber (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_ICE_IceConnectionNumber=yes else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=no" -fi -rm -f conftest* -LIBS="$ac_save_LIBS" + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 +ac_cv_lib_ICE_IceConnectionNumber=no fi -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then - echo "$ac_t""yes" 1>&6 +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5 +echo "${ECHO_T}$ac_cv_lib_ICE_IceConnectionNumber" >&6 +if test $ac_cv_lib_ICE_IceConnectionNumber = yes; then X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE" -else - echo "$ac_t""no" 1>&6 fi - LDFLAGS="$ac_save_LDFLAGS" + LDFLAGS=$ac_save_LDFLAGS fi -for ac_hdr in float.h limits.h stdlib.h string.h strings.h unistd.h -do -ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` -echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:1955: checking for $ac_hdr" >&5 -if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking for egrep" >&5 +echo $ECHO_N "checking for egrep... $ECHO_C" >&6 +if test "${ac_cv_prog_egrep+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat > conftest.$ac_ext < -EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1965: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` -if test -z "$ac_err"; then - rm -rf conftest* - eval "ac_cv_header_$ac_safe=yes" + if echo a | (grep -E '(a|b)') >/dev/null 2>&1 + then ac_cv_prog_egrep='grep -E' + else ac_cv_prog_egrep='egrep' + fi +fi +echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5 +echo "${ECHO_T}$ac_cv_prog_egrep" >&6 + EGREP=$ac_cv_prog_egrep + + +echo "$as_me:$LINENO: checking for ANSI C header files" >&5 +echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 +if test "${ac_cv_header_stdc+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - echo "$ac_err" >&5 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_header_$ac_safe=no" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include +#include +#include + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_header_stdc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_header_stdc=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "memchr" >/dev/null 2>&1; then + : +else + ac_cv_header_stdc=no fi rm -f conftest* + fi -if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` - cat >> confdefs.h <conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "free" >/dev/null 2>&1; then + : else - echo "$ac_t""no" 1>&6 + ac_cv_header_stdc=no fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. + if test "$cross_compiling" = yes; then + : +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#if ((' ' & 0x0FF) == 0x020) +# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +#else +# define ISLOWER(c) \ + (('a' <= (c) && (c) <= 'i') \ + || ('j' <= (c) && (c) <= 'r') \ + || ('s' <= (c) && (c) <= 'z')) +# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) +#endif + +#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) +int +main () +{ + int i; + for (i = 0; i < 256; i++) + if (XOR (islower (i), ISLOWER (i)) + || toupper (i) != TOUPPER (i)) + exit(2); + exit (0); +} +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + : +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +ac_cv_header_stdc=no +fi +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi +fi +fi +echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 +echo "${ECHO_T}$ac_cv_header_stdc" >&6 +if test $ac_cv_header_stdc = yes; then + +cat >>confdefs.h <<\_ACEOF +#define STDC_HEADERS 1 +_ACEOF + +fi + +# On IRIX 5.3, sys/types and inttypes.h are conflicting. + + + + + + + + + +for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ + inttypes.h stdint.h unistd.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default + +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_Header=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +eval "$as_ac_Header=no" +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + done + + + + + +for ac_header in float.h limits.h stdlib.h string.h strings.h unistd.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_header_compiler=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$ac_header> +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX +## ------------------------------------------ ## +## Report this to the AC_PACKAGE_NAME lists. ## +## ------------------------------------------ ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + + + for ac_func in strcasecmp do -echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:1996: checking for $ac_func" >&5 -if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 +if eval "test \"\${$as_ac_var+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat > conftest.$ac_ext <conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define $ac_func to an innocuous variant, in case declares $ac_func. + For example, HP-UX 11i declares gettimeofday. */ +#define $ac_func innocuous_$ac_func + /* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func(); below. */ -#include + which can conflict with char $ac_func (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $ac_func + /* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +{ +#endif /* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char $ac_func(); - -int main() { - + builtin and then its argument prototype would still apply. */ +char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) choke me #else -$ac_func(); +char (*f) () = $ac_func; +#endif +#ifdef __cplusplus +} #endif -; return 0; } -EOF -if { (eval echo configure:2024: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_func_$ac_func=yes" +int +main () +{ +return f != $ac_func; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_var=yes" else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_func_$ac_func=no" -fi -rm -f conftest* -fi + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +eval "$as_ac_var=no" +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF -if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` - cat >> confdefs.h <&6 fi done + # Check whether --with-additional-includes or --without-additional-includes was given. if test "${with_additional_includes+set}" = set; then withval="$with_additional_includes" ADDITIONAL_INCLUDES=$withval else ADDITIONAL_INCLUDES="" -fi +fi; # Check whether --with-additional-libs or --without-additional-libs was given. if test "${with_additional_libs+set}" = set; then @@ -2060,383 +5032,1426 @@ if test "${with_additional_libs+set}" = set; then ADDITIONAL_LIBS=$withval else ADDITIONAL_LIBS="" -fi +fi; + ac_config_files="$ac_config_files Makefile" -trap '' 1 2 15 -cat > confcache <<\EOF +cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure -# scripts and configure runs. It is not useful on other systems. -# If it contains results you don't want to keep, you may remove or edit it. +# scripts and configure runs, see configure's option --config-cache. +# It is not useful on other systems. If it contains results you don't +# want to keep, you may remove or edit it. # -# By default, configure uses ./config.cache as the cache file, -# creating it if it does not exist already. You can give configure -# the --cache-file=FILE option to use a different cache file; that is -# what configure does when it calls configure scripts in -# subdirectories, so they share the cache. -# Giving --cache-file=/dev/null disables caching, for debugging configure. -# config.status only pays attention to the cache file if you give it the -# --recheck option to rerun configure. +# config.status only pays attention to the cache file if you give it +# the --recheck option to rerun configure. # -EOF +# `ac_cv_env_foo' variables (set or unset) will be overridden when +# loading this file, other *unset* `ac_cv_foo' will be assigned the +# following values. + +_ACEOF + # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, don't put newlines in cache variables' values. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. -(set) 2>&1 | - case `(ac_space=' '; set | grep ac_space) 2>&1` in - *ac_space=\ *) - # `set' does not quote correctly, so add quotes (double-quote substitution - # turns \\\\ into \\, and sed turns \\ into \). - sed -n \ - -e "s/'/'\\\\''/g" \ - -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p" - ;; - *) - # `set' quotes correctly as required by POSIX, so do not add quotes. - sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p' - ;; - esac >> confcache -if cmp -s $cache_file confcache; then - : -else +{ + (set) 2>&1 | + case `(ac_space=' '; set | grep ac_space) 2>&1` in + *ac_space=\ *) + # `set' does not quote correctly, so add quotes (double-quote + # substitution turns \\\\ into \\, and sed turns \\ into \). + sed -n \ + "s/'/'\\\\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" + ;; + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n \ + "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" + ;; + esac; +} | + sed ' + t clear + : clear + s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ + t end + /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + : end' >>confcache +if diff $cache_file confcache >/dev/null 2>&1; then :; else if test -w $cache_file; then - echo "updating cache $cache_file" - cat confcache > $cache_file + test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file" + cat confcache >$cache_file else echo "not updating unwritable cache $cache_file" fi fi rm -f confcache -trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 - test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' -# Any assignment to VPATH causes Sun make to only execute -# the first set of double-colon rules, so remove it if not needed. -# If there is a colon in the path, we need to keep it. +# VPATH may cause trouble with some makes, so we remove $(srcdir), +# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and +# trailing colons and then remove the whole line if VPATH becomes empty +# (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then - ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d' + ac_vpsub='/^[ ]*VPATH[ ]*=/{ +s/:*\$(srcdir):*/:/; +s/:*\${srcdir}:*/:/; +s/:*@srcdir@:*/:/; +s/^\([^=]*=[ ]*\):*/\1/; +s/:*$//; +s/^[^=]*=[ ]*$//; +}' fi -trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15 - DEFS=-DHAVE_CONFIG_H -# Without the "./", some shells look in PATH for config.status. -: ${CONFIG_STATUS=./config.status} - -echo creating $CONFIG_STATUS -rm -f $CONFIG_STATUS -cat > $CONFIG_STATUS </dev/null | sed 1q`: -# -# $0 $ac_configure_args -# -# Compiler output produced by configure, useful for debugging -# configure, is in ./config.log if it exists. - -ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]" -for ac_option -do - case "\$ac_option" in - -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) - echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion" - exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;; - -version | --version | --versio | --versi | --vers | --ver | --ve | --v) - echo "$CONFIG_STATUS generated by autoconf version 2.13" - exit 0 ;; - -help | --help | --hel | --he | --h) - echo "\$ac_cs_usage"; exit 0 ;; - *) echo "\$ac_cs_usage"; exit 1 ;; - esac +ac_libobjs= +ac_ltlibobjs= +for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue + # 1. Remove the extension, and $U if already installed. + ac_i=`echo "$ac_i" | + sed 's/\$U\././;s/\.o$//;s/\.obj$//'` + # 2. Add them. + ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext" + ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo' done +LIBOBJS=$ac_libobjs -ac_given_srcdir=$srcdir -ac_given_INSTALL="$INSTALL" +LTLIBOBJS=$ac_ltlibobjs -trap 'rm -fr `echo "Makefile autoconf.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 -EOF -cat >> $CONFIG_STATUS < conftest.subs <<\\CEOF -$ac_vpsub -$extrasub -s%@SHELL@%$SHELL%g -s%@CFLAGS@%$CFLAGS%g -s%@CPPFLAGS@%$CPPFLAGS%g -s%@CXXFLAGS@%$CXXFLAGS%g -s%@FFLAGS@%$FFLAGS%g -s%@DEFS@%$DEFS%g -s%@LDFLAGS@%$LDFLAGS%g -s%@LIBS@%$LIBS%g -s%@exec_prefix@%$exec_prefix%g -s%@prefix@%$prefix%g -s%@program_transform_name@%$program_transform_name%g -s%@bindir@%$bindir%g -s%@sbindir@%$sbindir%g -s%@libexecdir@%$libexecdir%g -s%@datadir@%$datadir%g -s%@sysconfdir@%$sysconfdir%g -s%@sharedstatedir@%$sharedstatedir%g -s%@localstatedir@%$localstatedir%g -s%@libdir@%$libdir%g -s%@includedir@%$includedir%g -s%@oldincludedir@%$oldincludedir%g -s%@infodir@%$infodir%g -s%@mandir@%$mandir%g -s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g -s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g -s%@INSTALL_DATA@%$INSTALL_DATA%g -s%@PACKAGE@%$PACKAGE%g -s%@VERSION@%$VERSION%g -s%@ACLOCAL@%$ACLOCAL%g -s%@AUTOCONF@%$AUTOCONF%g -s%@AUTOMAKE@%$AUTOMAKE%g -s%@AUTOHEADER@%$AUTOHEADER%g -s%@MAKEINFO@%$MAKEINFO%g -s%@SET_MAKE@%$SET_MAKE%g -s%@CC@%$CC%g -s%@CPP@%$CPP%g -s%@X_CFLAGS@%$X_CFLAGS%g -s%@X_PRE_LIBS@%$X_PRE_LIBS%g -s%@X_LIBS@%$X_LIBS%g -s%@X_EXTRA_LIBS@%$X_EXTRA_LIBS%g -s%@ADDITIONAL_INCLUDES@%$ADDITIONAL_INCLUDES%g -s%@ADDITIONAL_LIBS@%$ADDITIONAL_LIBS%g - -CEOF -EOF - -cat >> $CONFIG_STATUS <<\EOF - -# Split the substitutions into bite-sized pieces for seds with -# small command number limits, like on Digital OSF/1 and HP-UX. -ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script. -ac_file=1 # Number of current file. -ac_beg=1 # First line for current file. -ac_end=$ac_max_sed_cmds # Line after last line for current file. -ac_more_lines=: -ac_sed_cmds="" -while $ac_more_lines; do - if test $ac_beg -gt 1; then - sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file - else - sed "${ac_end}q" conftest.subs > conftest.s$ac_file - fi - if test ! -s conftest.s$ac_file; then - ac_more_lines=false - rm -f conftest.s$ac_file - else - if test -z "$ac_sed_cmds"; then - ac_sed_cmds="sed -f conftest.s$ac_file" - else - ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file" - fi - ac_file=`expr $ac_file + 1` - ac_beg=$ac_end - ac_end=`expr $ac_end + $ac_max_sed_cmds` - fi -done -if test -z "$ac_sed_cmds"; then - ac_sed_cmds=cat +if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"MAINTAINER_MODE\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"MAINTAINER_MODE\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"AMDEP\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"am__fastdepCC\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } fi -EOF -cat >> $CONFIG_STATUS <&5 +echo "$as_me: creating $CONFIG_STATUS" >&6;} +cat >$CONFIG_STATUS <<_ACEOF +#! $SHELL +# Generated by $as_me. +# Run this file to recreate the current configuration. +# Compiler output produced by configure, useful for debugging +# configure, is in config.log if it exists. -CONFIG_FILES=\${CONFIG_FILES-"Makefile"} -EOF -cat >> $CONFIG_STATUS <<\EOF -for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then - # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". - case "$ac_file" in - *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` - ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; - *) ac_file_in="${ac_file}.in" ;; +debug=false +ac_cs_recheck=false +ac_cs_silent=false +SHELL=\${CONFIG_SHELL-$SHELL} +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF +## --------------------- ## +## M4sh Initialization. ## +## --------------------- ## + +# Be Bourne compatible +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' +elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then + set -o posix +fi +DUALCASE=1; export DUALCASE # for MKS sh + +# Support unset when possible. +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + as_unset=unset +else + as_unset=false +fi + + +# Work around bugs in pre-3.0 UWIN ksh. +$as_unset ENV MAIL MAILPATH +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +for as_var in \ + LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ + LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ + LC_TELEPHONE LC_TIME +do + if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then + eval $as_var=C; export $as_var + else + $as_unset $as_var + fi +done + +# Required to use basename. +if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr +else + as_expr=false +fi + +if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + + +# Name of the executable. +as_me=`$as_basename "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)$' \| \ + . : '\(.\)' 2>/dev/null || +echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } + /^X\/\(\/\/\)$/{ s//\1/; q; } + /^X\/\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + + +# PATH needs CR, and LINENO needs CR and PATH. +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh +fi + + + as_lineno_1=$LINENO + as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x$as_lineno_3" = "x$as_lineno_2" || { + # Find who we are. Look in the path if we contain no path at all + # relative or not. + case $0 in + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break +done + + ;; + esac + # We did not find ourselves, most probably we were run as `sh COMMAND' + # in which case we are not to be found in the path. + if test "x$as_myself" = x; then + as_myself=$0 + fi + if test ! -f "$as_myself"; then + { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5 +echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;} + { (exit 1); exit 1; }; } + fi + case $CONFIG_SHELL in + '') + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for as_base in sh bash ksh sh5; do + case $as_dir in + /*) + if ("$as_dir/$as_base" -c ' + as_lineno_1=$LINENO + as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then + $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } + $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } + CONFIG_SHELL=$as_dir/$as_base + export CONFIG_SHELL + exec "$CONFIG_SHELL" "$0" ${1+"$@"} + fi;; + esac + done +done +;; esac - # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories. + # Create $as_me.lineno as a copy of $as_myself, but with $LINENO + # uniformly replaced by the line number. The first 'sed' inserts a + # line-number line before each line; the second 'sed' does the real + # work. The second script uses 'N' to pair each line-number line + # with the numbered line, and appends trailing '-' during + # substitution so that $LINENO is not a special case at line end. + # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the + # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) + sed '=' <$as_myself | + sed ' + N + s,$,-, + : loop + s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, + t loop + s,-$,, + s,^['$as_cr_digits']*\n,, + ' >$as_me.lineno && + chmod +x $as_me.lineno || + { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5 +echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;} + { (exit 1); exit 1; }; } - # Remove last slash and all that follows it. Not all systems have dirname. - ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` - if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then - # The file is in a subdirectory. - test ! -d "$ac_dir" && mkdir "$ac_dir" - ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`" - # A "../" for each directory in $ac_dir_suffix. - ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'` + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensible to this). + . ./$as_me.lineno + # Exit status is that of the last command. + exit +} + + +case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in + *c*,-n*) ECHO_N= ECHO_C=' +' ECHO_T=' ' ;; + *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; + *) ECHO_N= ECHO_C='\c' ECHO_T= ;; +esac + +if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr +else + as_expr=false +fi + +rm -f conf$$ conf$$.exe conf$$.file +echo >conf$$.file +if ln -s conf$$.file conf$$ 2>/dev/null; then + # We could just check for DJGPP; but this test a) works b) is more generic + # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). + if test -f conf$$.exe; then + # Don't use ln at all; we don't have any links + as_ln_s='cp -p' else - ac_dir_suffix= ac_dots= + as_ln_s='ln -s' + fi +elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.file + +if mkdir -p . 2>/dev/null; then + as_mkdir_p=: +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +as_executable_p="test -f" + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +# IFS +# We need space, tab and new line, in precisely that order. +as_nl=' +' +IFS=" $as_nl" + +# CDPATH. +$as_unset CDPATH + +exec 6>&1 + +# Open the log real soon, to keep \$[0] and so on meaningful, and to +# report actual input values of CONFIG_FILES etc. instead of their +# values after options handling. Logging --version etc. is OK. +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX +## Running $as_me. ## +_ASBOX +} >&5 +cat >&5 <<_CSEOF + +This file was extended by $as_me, which was +generated by GNU Autoconf 2.59. Invocation command line was + + CONFIG_FILES = $CONFIG_FILES + CONFIG_HEADERS = $CONFIG_HEADERS + CONFIG_LINKS = $CONFIG_LINKS + CONFIG_COMMANDS = $CONFIG_COMMANDS + $ $0 $@ + +_CSEOF +echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5 +echo >&5 +_ACEOF + +# Files that config.status was made for. +if test -n "$ac_config_files"; then + echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS +fi + +if test -n "$ac_config_headers"; then + echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS +fi + +if test -n "$ac_config_links"; then + echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS +fi + +if test -n "$ac_config_commands"; then + echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS +fi + +cat >>$CONFIG_STATUS <<\_ACEOF + +ac_cs_usage="\ +\`$as_me' instantiates files from templates according to the +current configuration. + +Usage: $0 [OPTIONS] [FILE]... + + -h, --help print this help, then exit + -V, --version print version number, then exit + -q, --quiet do not print progress messages + -d, --debug don't remove temporary files + --recheck update $as_me by reconfiguring in the same conditions + --file=FILE[:TEMPLATE] + instantiate the configuration file FILE + --header=FILE[:TEMPLATE] + instantiate the configuration header FILE + +Configuration files: +$config_files + +Configuration headers: +$config_headers + +Configuration commands: +$config_commands + +Report bugs to ." +_ACEOF + +cat >>$CONFIG_STATUS <<_ACEOF +ac_cs_version="\\ +config.status +configured by $0, generated by GNU Autoconf 2.59, + with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" + +Copyright (C) 2003 Free Software Foundation, Inc. +This config.status script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it." +srcdir=$srcdir +INSTALL="$INSTALL" +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF +# If no file are specified by the user, then we need to provide default +# value. By we need to know if files were specified by the user. +ac_need_defaults=: +while test $# != 0 +do + case $1 in + --*=*) + ac_option=`expr "x$1" : 'x\([^=]*\)='` + ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'` + ac_shift=: + ;; + -*) + ac_option=$1 + ac_optarg=$2 + ac_shift=shift + ;; + *) # This is not an option, so the user has probably given explicit + # arguments. + ac_option=$1 + ac_need_defaults=false;; + esac + + case $ac_option in + # Handling of the options. +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + ac_cs_recheck=: ;; + --version | --vers* | -V ) + echo "$ac_cs_version"; exit 0 ;; + --he | --h) + # Conflict between --help and --header + { { echo "$as_me:$LINENO: error: ambiguous option: $1 +Try \`$0 --help' for more information." >&5 +echo "$as_me: error: ambiguous option: $1 +Try \`$0 --help' for more information." >&2;} + { (exit 1); exit 1; }; };; + --help | --hel | -h ) + echo "$ac_cs_usage"; exit 0 ;; + --debug | --d* | -d ) + debug=: ;; + --file | --fil | --fi | --f ) + $ac_shift + CONFIG_FILES="$CONFIG_FILES $ac_optarg" + ac_need_defaults=false;; + --header | --heade | --head | --hea ) + $ac_shift + CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" + ac_need_defaults=false;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil | --si | --s) + ac_cs_silent=: ;; + + # This is an error. + -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1 +Try \`$0 --help' for more information." >&5 +echo "$as_me: error: unrecognized option: $1 +Try \`$0 --help' for more information." >&2;} + { (exit 1); exit 1; }; } ;; + + *) ac_config_targets="$ac_config_targets $1" ;; + + esac + shift +done + +ac_configure_extra_args= + +if $ac_cs_silent; then + exec 6>/dev/null + ac_configure_extra_args="$ac_configure_extra_args --silent" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF +if \$ac_cs_recheck; then + echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 + exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion +fi + +_ACEOF + +cat >>$CONFIG_STATUS <<_ACEOF +# +# INIT-COMMANDS section. +# + +AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" + +_ACEOF + + + +cat >>$CONFIG_STATUS <<\_ACEOF +for ac_config_target in $ac_config_targets +do + case "$ac_config_target" in + # Handling of arguments. + "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; + "depfiles" ) CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; + "autoconf.h" ) CONFIG_HEADERS="$CONFIG_HEADERS autoconf.h" ;; + *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 +echo "$as_me: error: invalid argument: $ac_config_target" >&2;} + { (exit 1); exit 1; }; };; + esac +done + +# If the user did not use the arguments to specify the items to instantiate, +# then the envvar interface is used. Set only those that are not. +# We use the long form for the default assignment because of an extremely +# bizarre bug on SunOS 4.1.3. +if $ac_need_defaults; then + test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files + test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers + test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands +fi + +# Have a temporary directory for convenience. Make it in the build tree +# simply because there is no reason to put it here, and in addition, +# creating and moving files from /tmp can sometimes cause problems. +# Create a temporary directory, and hook for its removal unless debugging. +$debug || +{ + trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0 + trap '{ (exit 1); exit 1; }' 1 2 13 15 +} + +# Create a (secure) tmp directory for tmp files. + +{ + tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` && + test -n "$tmp" && test -d "$tmp" +} || +{ + tmp=./confstat$$-$RANDOM + (umask 077 && mkdir $tmp) +} || +{ + echo "$me: cannot create a temporary directory in ." >&2 + { (exit 1); exit 1; } +} + +_ACEOF + +cat >>$CONFIG_STATUS <<_ACEOF + +# +# CONFIG_FILES section. +# + +# No need to generate the scripts if there are no CONFIG_FILES. +# This happens for instance when ./config.status config.h +if test -n "\$CONFIG_FILES"; then + # Protect against being on the right side of a sed subst in config.status. + sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g; + s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF +s,@SHELL@,$SHELL,;t t +s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t +s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t +s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t +s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t +s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t +s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t +s,@exec_prefix@,$exec_prefix,;t t +s,@prefix@,$prefix,;t t +s,@program_transform_name@,$program_transform_name,;t t +s,@bindir@,$bindir,;t t +s,@sbindir@,$sbindir,;t t +s,@libexecdir@,$libexecdir,;t t +s,@datadir@,$datadir,;t t +s,@sysconfdir@,$sysconfdir,;t t +s,@sharedstatedir@,$sharedstatedir,;t t +s,@localstatedir@,$localstatedir,;t t +s,@libdir@,$libdir,;t t +s,@includedir@,$includedir,;t t +s,@oldincludedir@,$oldincludedir,;t t +s,@infodir@,$infodir,;t t +s,@mandir@,$mandir,;t t +s,@build_alias@,$build_alias,;t t +s,@host_alias@,$host_alias,;t t +s,@target_alias@,$target_alias,;t t +s,@DEFS@,$DEFS,;t t +s,@ECHO_C@,$ECHO_C,;t t +s,@ECHO_N@,$ECHO_N,;t t +s,@ECHO_T@,$ECHO_T,;t t +s,@LIBS@,$LIBS,;t t +s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t +s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t +s,@INSTALL_DATA@,$INSTALL_DATA,;t t +s,@CYGPATH_W@,$CYGPATH_W,;t t +s,@PACKAGE@,$PACKAGE,;t t +s,@VERSION@,$VERSION,;t t +s,@ACLOCAL@,$ACLOCAL,;t t +s,@AUTOCONF@,$AUTOCONF,;t t +s,@AUTOMAKE@,$AUTOMAKE,;t t +s,@AUTOHEADER@,$AUTOHEADER,;t t +s,@MAKEINFO@,$MAKEINFO,;t t +s,@AMTAR@,$AMTAR,;t t +s,@install_sh@,$install_sh,;t t +s,@STRIP@,$STRIP,;t t +s,@ac_ct_STRIP@,$ac_ct_STRIP,;t t +s,@INSTALL_STRIP_PROGRAM@,$INSTALL_STRIP_PROGRAM,;t t +s,@mkdir_p@,$mkdir_p,;t t +s,@AWK@,$AWK,;t t +s,@SET_MAKE@,$SET_MAKE,;t t +s,@am__leading_dot@,$am__leading_dot,;t t +s,@MAINTAINER_MODE_TRUE@,$MAINTAINER_MODE_TRUE,;t t +s,@MAINTAINER_MODE_FALSE@,$MAINTAINER_MODE_FALSE,;t t +s,@MAINT@,$MAINT,;t t +s,@CC@,$CC,;t t +s,@CFLAGS@,$CFLAGS,;t t +s,@LDFLAGS@,$LDFLAGS,;t t +s,@CPPFLAGS@,$CPPFLAGS,;t t +s,@ac_ct_CC@,$ac_ct_CC,;t t +s,@EXEEXT@,$EXEEXT,;t t +s,@OBJEXT@,$OBJEXT,;t t +s,@DEPDIR@,$DEPDIR,;t t +s,@am__include@,$am__include,;t t +s,@am__quote@,$am__quote,;t t +s,@AMDEP_TRUE@,$AMDEP_TRUE,;t t +s,@AMDEP_FALSE@,$AMDEP_FALSE,;t t +s,@AMDEPBACKSLASH@,$AMDEPBACKSLASH,;t t +s,@CCDEPMODE@,$CCDEPMODE,;t t +s,@am__fastdepCC_TRUE@,$am__fastdepCC_TRUE,;t t +s,@am__fastdepCC_FALSE@,$am__fastdepCC_FALSE,;t t +s,@CPP@,$CPP,;t t +s,@X_CFLAGS@,$X_CFLAGS,;t t +s,@X_PRE_LIBS@,$X_PRE_LIBS,;t t +s,@X_LIBS@,$X_LIBS,;t t +s,@X_EXTRA_LIBS@,$X_EXTRA_LIBS,;t t +s,@EGREP@,$EGREP,;t t +s,@ADDITIONAL_INCLUDES@,$ADDITIONAL_INCLUDES,;t t +s,@ADDITIONAL_LIBS@,$ADDITIONAL_LIBS,;t t +s,@LIBOBJS@,$LIBOBJS,;t t +s,@LTLIBOBJS@,$LTLIBOBJS,;t t +CEOF + +_ACEOF + + cat >>$CONFIG_STATUS <<\_ACEOF + # Split the substitutions into bite-sized pieces for seds with + # small command number limits, like on Digital OSF/1 and HP-UX. + ac_max_sed_lines=48 + ac_sed_frag=1 # Number of current file. + ac_beg=1 # First line for current file. + ac_end=$ac_max_sed_lines # Line after last line for current file. + ac_more_lines=: + ac_sed_cmds= + while $ac_more_lines; do + if test $ac_beg -gt 1; then + sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag + else + sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag + fi + if test ! -s $tmp/subs.frag; then + ac_more_lines=false + else + # The purpose of the label and of the branching condition is to + # speed up the sed processing (if there are no `@' at all, there + # is no need to browse any of the substitutions). + # These are the two extra sed commands mentioned above. + (echo ':t + /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed + if test -z "$ac_sed_cmds"; then + ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" + else + ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" + fi + ac_sed_frag=`expr $ac_sed_frag + 1` + ac_beg=$ac_end + ac_end=`expr $ac_end + $ac_max_sed_lines` + fi + done + if test -z "$ac_sed_cmds"; then + ac_sed_cmds=cat + fi +fi # test -n "$CONFIG_FILES" + +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF +for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + case $ac_file in + - | *:- | *:-:* ) # input from stdin + cat >$tmp/stdin + ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + * ) ac_file_in=$ac_file.in ;; + esac + + # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories. + ac_dir=`(dirname "$ac_file") 2>/dev/null || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + { if $as_mkdir_p; then + mkdir -p "$ac_dir" + else + as_dir="$ac_dir" + as_dirs= + while test ! -d "$as_dir"; do + as_dirs="$as_dir $as_dirs" + as_dir=`(dirname "$as_dir") 2>/dev/null || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + done + test ! -n "$as_dirs" || mkdir $as_dirs + fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 +echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} + { (exit 1); exit 1; }; }; } + + ac_builddir=. + +if test "$ac_dir" != .; then + ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` + # A "../" for each directory in $ac_dir_suffix. + ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` +else + ac_dir_suffix= ac_top_builddir= +fi + +case $srcdir in + .) # No --srcdir option. We are building in place. + ac_srcdir=. + if test -z "$ac_top_builddir"; then + ac_top_srcdir=. + else + ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` + fi ;; + [\\/]* | ?:[\\/]* ) # Absolute path. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir ;; + *) # Relative path. + ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_builddir$srcdir ;; +esac + +# Do not use `cd foo && pwd` to compute absolute paths, because +# the directories may not exist. +case `pwd` in +.) ac_abs_builddir="$ac_dir";; +*) + case "$ac_dir" in + .) ac_abs_builddir=`pwd`;; + [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; + *) ac_abs_builddir=`pwd`/"$ac_dir";; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_builddir=${ac_top_builddir}.;; +*) + case ${ac_top_builddir}. in + .) ac_abs_top_builddir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; + *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_srcdir=$ac_srcdir;; +*) + case $ac_srcdir in + .) ac_abs_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; + *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_srcdir=$ac_top_srcdir;; +*) + case $ac_top_srcdir in + .) ac_abs_top_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; + *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; + esac;; +esac + + + case $INSTALL in + [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; + *) ac_INSTALL=$ac_top_builddir$INSTALL ;; + esac + + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + if test x"$ac_file" = x-; then + configure_input= + else + configure_input="$ac_file. " + fi + configure_input=$configure_input"Generated from `echo $ac_file_in | + sed 's,.*/,,'` by configure." + + # First look for the input files in the build tree, otherwise in the + # src tree. + ac_file_inputs=`IFS=: + for f in $ac_file_in; do + case $f in + -) echo $tmp/stdin ;; + [\\/$]*) + # Absolute (can't be DOS-style, as IFS=:) + test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + echo "$f";; + *) # Relative + if test -f "$f"; then + # Build tree + echo "$f" + elif test -f "$srcdir/$f"; then + # Source tree + echo "$srcdir/$f" + else + # /dev/null tree + { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + fi;; + esac + done` || { (exit 1); exit 1; } + + if test x"$ac_file" != x-; then + { echo "$as_me:$LINENO: creating $ac_file" >&5 +echo "$as_me: creating $ac_file" >&6;} + rm -f "$ac_file" + fi +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF + sed "$ac_vpsub +$extrasub +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF +:t +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +s,@configure_input@,$configure_input,;t t +s,@srcdir@,$ac_srcdir,;t t +s,@abs_srcdir@,$ac_abs_srcdir,;t t +s,@top_srcdir@,$ac_top_srcdir,;t t +s,@abs_top_srcdir@,$ac_abs_top_srcdir,;t t +s,@builddir@,$ac_builddir,;t t +s,@abs_builddir@,$ac_abs_builddir,;t t +s,@top_builddir@,$ac_top_builddir,;t t +s,@abs_top_builddir@,$ac_abs_top_builddir,;t t +s,@INSTALL@,$ac_INSTALL,;t t +" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out + rm -f $tmp/stdin + if test x"$ac_file" != x-; then + mv $tmp/out $ac_file + else + cat $tmp/out + rm -f $tmp/out fi - case "$ac_given_srcdir" in - .) srcdir=. - if test -z "$ac_dots"; then top_srcdir=. - else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;; - /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;; - *) # Relative path. - srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix" - top_srcdir="$ac_dots$ac_given_srcdir" ;; - esac +done +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF - case "$ac_given_INSTALL" in - [/$]*) INSTALL="$ac_given_INSTALL" ;; - *) INSTALL="$ac_dots$ac_given_INSTALL" ;; - esac - - echo creating "$ac_file" - rm -f "$ac_file" - configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure." - case "$ac_file" in - *Makefile*) ac_comsub="1i\\ -# $configure_input" ;; - *) ac_comsub= ;; - esac - - ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` - sed -e "$ac_comsub -s%@configure_input@%$configure_input%g -s%@srcdir@%$srcdir%g -s%@top_srcdir@%$top_srcdir%g -s%@INSTALL@%$INSTALL%g -" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file -fi; done -rm -f conftest.s* +# +# CONFIG_HEADER section. +# # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where # NAME is the cpp macro being defined and VALUE is the value it is being given. # # ac_d sets the value in "#define NAME VALUE" lines. -ac_dA='s%^\([ ]*\)#\([ ]*define[ ][ ]*\)' -ac_dB='\([ ][ ]*\)[^ ]*%\1#\2' -ac_dC='\3' -ac_dD='%g' -# ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE". -ac_uA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' -ac_uB='\([ ]\)%\1#\2define\3' +ac_dA='s,^\([ ]*\)#\([ ]*define[ ][ ]*\)' +ac_dB='[ ].*$,\1#\2' +ac_dC=' ' +ac_dD=',;t' +# ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE". +ac_uA='s,^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' +ac_uB='$,\1#\2define\3' ac_uC=' ' -ac_uD='\4%g' -# ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE". -ac_eA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' -ac_eB='$%\1#\2define\3' -ac_eC=' ' -ac_eD='%g' +ac_uD=',;t' -if test "${CONFIG_HEADERS+set}" != set; then -EOF -cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF -fi -for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then +for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". - case "$ac_file" in - *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` - ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; - *) ac_file_in="${ac_file}.in" ;; + case $ac_file in + - | *:- | *:-:* ) # input from stdin + cat >$tmp/stdin + ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + * ) ac_file_in=$ac_file.in ;; esac - echo creating $ac_file + test x"$ac_file" != x- && { echo "$as_me:$LINENO: creating $ac_file" >&5 +echo "$as_me: creating $ac_file" >&6;} - rm -f conftest.frag conftest.in conftest.out - ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` - cat $ac_file_inputs > conftest.in + # First look for the input files in the build tree, otherwise in the + # src tree. + ac_file_inputs=`IFS=: + for f in $ac_file_in; do + case $f in + -) echo $tmp/stdin ;; + [\\/$]*) + # Absolute (can't be DOS-style, as IFS=:) + test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + # Do quote $f, to prevent DOS paths from being IFS'd. + echo "$f";; + *) # Relative + if test -f "$f"; then + # Build tree + echo "$f" + elif test -f "$srcdir/$f"; then + # Source tree + echo "$srcdir/$f" + else + # /dev/null tree + { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + fi;; + esac + done` || { (exit 1); exit 1; } + # Remove the trailing spaces. + sed 's/[ ]*$//' $ac_file_inputs >$tmp/in -EOF +_ACEOF -# Transform confdefs.h into a sed script conftest.vals that substitutes -# the proper values into config.h.in to produce config.h. And first: -# Protect against being on the right side of a sed subst in config.status. -# Protect against being in an unquoted here document in config.status. -rm -f conftest.vals -cat > conftest.hdr <<\EOF -s/[\\&%]/\\&/g -s%[\\$`]%\\&%g -s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp -s%ac_d%ac_u%gp -s%ac_u%ac_e%gp -EOF -sed -n -f conftest.hdr confdefs.h > conftest.vals -rm -f conftest.hdr +# Transform confdefs.h into two sed scripts, `conftest.defines' and +# `conftest.undefs', that substitutes the proper values into +# config.h.in to produce config.h. The first handles `#define' +# templates, and the second `#undef' templates. +# And first: Protect against being on the right side of a sed subst in +# config.status. Protect against being in an unquoted here document +# in config.status. +rm -f conftest.defines conftest.undefs +# Using a here document instead of a string reduces the quoting nightmare. +# Putting comments in sed scripts is not portable. +# +# `end' is used to avoid that the second main sed command (meant for +# 0-ary CPP macros) applies to n-ary macro definitions. +# See the Autoconf documentation for `clear'. +cat >confdef2sed.sed <<\_ACEOF +s/[\\&,]/\\&/g +s,[\\$`],\\&,g +t clear +: clear +s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*\)\(([^)]*)\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1\2${ac_dC}\3${ac_dD},gp +t end +s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp +: end +_ACEOF +# If some macros were called several times there might be several times +# the same #defines, which is useless. Nevertheless, we may not want to +# sort them, since we want the *last* AC-DEFINE to be honored. +uniq confdefs.h | sed -n -f confdef2sed.sed >conftest.defines +sed 's/ac_d/ac_u/g' conftest.defines >conftest.undefs +rm -f confdef2sed.sed # This sed command replaces #undef with comments. This is necessary, for # example, in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. -cat >> conftest.vals <<\EOF -s%^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */% -EOF - -# Break up conftest.vals because some shells have a limit on -# the size of here documents, and old seds have small limits too. +cat >>conftest.undefs <<\_ACEOF +s,^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */, +_ACEOF +# Break up conftest.defines because some shells have a limit on the size +# of here documents, and old seds have small limits too (100 cmds). +echo ' # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS +echo ' if grep "^[ ]*#[ ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS +echo ' # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS +echo ' :' >>$CONFIG_STATUS rm -f conftest.tail -while : +while grep . conftest.defines >/dev/null do - ac_lines=`grep -c . conftest.vals` - # grep -c gives empty output for an empty file on some AIX systems. - if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi - # Write a limited-size here document to conftest.frag. - echo ' cat > conftest.frag <> $CONFIG_STATUS - sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS + # Write a limited-size here document to $tmp/defines.sed. + echo ' cat >$tmp/defines.sed <>$CONFIG_STATUS + # Speed up: don't consider the non `#define' lines. + echo '/^[ ]*#[ ]*define/!b' >>$CONFIG_STATUS + # Work around the forget-to-reset-the-flag bug. + echo 't clr' >>$CONFIG_STATUS + echo ': clr' >>$CONFIG_STATUS + sed ${ac_max_here_lines}q conftest.defines >>$CONFIG_STATUS echo 'CEOF - sed -f conftest.frag conftest.in > conftest.out - rm -f conftest.in - mv conftest.out conftest.in -' >> $CONFIG_STATUS - sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail - rm -f conftest.vals - mv conftest.tail conftest.vals + sed -f $tmp/defines.sed $tmp/in >$tmp/out + rm -f $tmp/in + mv $tmp/out $tmp/in +' >>$CONFIG_STATUS + sed 1,${ac_max_here_lines}d conftest.defines >conftest.tail + rm -f conftest.defines + mv conftest.tail conftest.defines done -rm -f conftest.vals +rm -f conftest.defines +echo ' fi # grep' >>$CONFIG_STATUS +echo >>$CONFIG_STATUS -cat >> $CONFIG_STATUS <<\EOF - rm -f conftest.frag conftest.h - echo "/* $ac_file. Generated automatically by configure. */" > conftest.h - cat conftest.in >> conftest.h - rm -f conftest.in - if cmp -s $ac_file conftest.h 2>/dev/null; then - echo "$ac_file is unchanged" - rm -f conftest.h +# Break up conftest.undefs because some shells have a limit on the size +# of here documents, and old seds have small limits too (100 cmds). +echo ' # Handle all the #undef templates' >>$CONFIG_STATUS +rm -f conftest.tail +while grep . conftest.undefs >/dev/null +do + # Write a limited-size here document to $tmp/undefs.sed. + echo ' cat >$tmp/undefs.sed <>$CONFIG_STATUS + # Speed up: don't consider the non `#undef' + echo '/^[ ]*#[ ]*undef/!b' >>$CONFIG_STATUS + # Work around the forget-to-reset-the-flag bug. + echo 't clr' >>$CONFIG_STATUS + echo ': clr' >>$CONFIG_STATUS + sed ${ac_max_here_lines}q conftest.undefs >>$CONFIG_STATUS + echo 'CEOF + sed -f $tmp/undefs.sed $tmp/in >$tmp/out + rm -f $tmp/in + mv $tmp/out $tmp/in +' >>$CONFIG_STATUS + sed 1,${ac_max_here_lines}d conftest.undefs >conftest.tail + rm -f conftest.undefs + mv conftest.tail conftest.undefs +done +rm -f conftest.undefs + +cat >>$CONFIG_STATUS <<\_ACEOF + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + if test x"$ac_file" = x-; then + echo "/* Generated by configure. */" >$tmp/config.h else - # Remove last slash and all that follows it. Not all systems have dirname. - ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` - if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then - # The file is in a subdirectory. - test ! -d "$ac_dir" && mkdir "$ac_dir" - fi - rm -f $ac_file - mv conftest.h $ac_file + echo "/* $ac_file. Generated by configure. */" >$tmp/config.h fi -fi; done + cat $tmp/in >>$tmp/config.h + rm -f $tmp/in + if test x"$ac_file" != x-; then + if diff $ac_file $tmp/config.h >/dev/null 2>&1; then + { echo "$as_me:$LINENO: $ac_file is unchanged" >&5 +echo "$as_me: $ac_file is unchanged" >&6;} + else + ac_dir=`(dirname "$ac_file") 2>/dev/null || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + { if $as_mkdir_p; then + mkdir -p "$ac_dir" + else + as_dir="$ac_dir" + as_dirs= + while test ! -d "$as_dir"; do + as_dirs="$as_dir $as_dirs" + as_dir=`(dirname "$as_dir") 2>/dev/null || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + done + test ! -n "$as_dirs" || mkdir $as_dirs + fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 +echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} + { (exit 1); exit 1; }; }; } -EOF -cat >> $CONFIG_STATUS <`(dirname $ac_file) 2>/dev/null || +$as_expr X$ac_file : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X$ac_file : 'X\(//\)[^/]' \| \ + X$ac_file : 'X\(//\)$' \| \ + X$ac_file : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X$ac_file | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'`/stamp-h$_am_stamp_count +done +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF + +# +# CONFIG_COMMANDS section. +# +for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue + ac_dest=`echo "$ac_file" | sed 's,:.*,,'` + ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_dir=`(dirname "$ac_dest") 2>/dev/null || +$as_expr X"$ac_dest" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_dest" : 'X\(//\)[^/]' \| \ + X"$ac_dest" : 'X\(//\)$' \| \ + X"$ac_dest" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$ac_dest" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + { if $as_mkdir_p; then + mkdir -p "$ac_dir" + else + as_dir="$ac_dir" + as_dirs= + while test ! -d "$as_dir"; do + as_dirs="$as_dir $as_dirs" + as_dir=`(dirname "$as_dir") 2>/dev/null || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + done + test ! -n "$as_dirs" || mkdir $as_dirs + fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 +echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} + { (exit 1); exit 1; }; }; } + + ac_builddir=. + +if test "$ac_dir" != .; then + ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` + # A "../" for each directory in $ac_dir_suffix. + ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` +else + ac_dir_suffix= ac_top_builddir= +fi + +case $srcdir in + .) # No --srcdir option. We are building in place. + ac_srcdir=. + if test -z "$ac_top_builddir"; then + ac_top_srcdir=. + else + ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` + fi ;; + [\\/]* | ?:[\\/]* ) # Absolute path. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir ;; + *) # Relative path. + ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_builddir$srcdir ;; +esac + +# Do not use `cd foo && pwd` to compute absolute paths, because +# the directories may not exist. +case `pwd` in +.) ac_abs_builddir="$ac_dir";; +*) + case "$ac_dir" in + .) ac_abs_builddir=`pwd`;; + [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; + *) ac_abs_builddir=`pwd`/"$ac_dir";; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_builddir=${ac_top_builddir}.;; +*) + case ${ac_top_builddir}. in + .) ac_abs_top_builddir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; + *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_srcdir=$ac_srcdir;; +*) + case $ac_srcdir in + .) ac_abs_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; + *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_srcdir=$ac_top_srcdir;; +*) + case $ac_top_srcdir in + .) ac_abs_top_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; + *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; + esac;; +esac -EOF -cat >> $CONFIG_STATUS <<\EOF -test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h + { echo "$as_me:$LINENO: executing $ac_dest commands" >&5 +echo "$as_me: executing $ac_dest commands" >&6;} + case $ac_dest in + depfiles ) test x"$AMDEP_TRUE" != x"" || for mf in $CONFIG_FILES; do + # Strip MF so we end up with the name of the file. + mf=`echo "$mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile or not. + # We used to match only the files named `Makefile.in', but + # some people rename them; so instead we look at the file content. + # Grep'ing the first line is not enough: some people post-process + # each Makefile.in and add a new line on top of each file to say so. + # So let's grep whole file. + if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then + dirpart=`(dirname "$mf") 2>/dev/null || +$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$mf" : 'X\(//\)[^/]' \| \ + X"$mf" : 'X\(//\)$' \| \ + X"$mf" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$mf" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + else + continue + fi + grep '^DEP_FILES *= *[^ #]' < "$mf" > /dev/null || continue + # Extract the definition of DEP_FILES from the Makefile without + # running `make'. + DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` + test -z "$DEPDIR" && continue + # When using ansi2knr, U may be empty or an underscore; expand it + U=`sed -n 's/^U = //p' < "$mf"` + test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR" + # We invoke sed twice because it is the simplest approach to + # changing $(DEPDIR) to its actual value in the expansion. + for file in `sed -n ' + /^DEP_FILES = .*\\\\$/ { + s/^DEP_FILES = // + :loop + s/\\\\$// + p + n + /\\\\$/ b loop + p + } + /^DEP_FILES = / s/^DEP_FILES = //p' < "$mf" | \ + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do + # Make sure the directory exists. + test -f "$dirpart/$file" && continue + fdir=`(dirname "$file") 2>/dev/null || +$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$file" : 'X\(//\)[^/]' \| \ + X"$file" : 'X\(//\)$' \| \ + X"$file" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + { if $as_mkdir_p; then + mkdir -p $dirpart/$fdir + else + as_dir=$dirpart/$fdir + as_dirs= + while test ! -d "$as_dir"; do + as_dirs="$as_dir $as_dirs" + as_dir=`(dirname "$as_dir") 2>/dev/null || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + done + test ! -n "$as_dirs" || mkdir $as_dirs + fi || { { echo "$as_me:$LINENO: error: cannot create directory $dirpart/$fdir" >&5 +echo "$as_me: error: cannot create directory $dirpart/$fdir" >&2;} + { (exit 1); exit 1; }; }; } -exit 0 -EOF + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done +done + ;; + esac +done +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF + +{ (exit 0); exit 0; } +_ACEOF chmod +x $CONFIG_STATUS -rm -fr confdefs* $ac_clean_files -test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1 +ac_clean_files=$ac_clean_files_save + + +# configure is writing to config.log, and then calls config.status. +# config.status does its own redirection, appending to config.log. +# Unfortunately, on DOS this fails, as config.log is still kept open +# by configure, so config.status won't be able to write to it; its +# output is simply discarded. So we exec the FD to /dev/null, +# effectively closing config.log, so it can be properly (re)opened and +# appended to by config.status. When coming back to configure, we +# need to make the FD available again. +if test "$no_create" != yes; then + ac_cs_success=: + ac_config_status_args= + test "$silent" = yes && + ac_config_status_args="$ac_config_status_args --quiet" + exec 5>/dev/null + $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false + exec 5>>config.log + # Use ||, not &&, to avoid exiting from the if with $? = 1, which + # would make configure fail if this is the last instruction. + $ac_cs_success || { (exit 1); exit 1; } +fi diff --git a/xgraph/configure.in b/xgraph/configure.in index 6f2fb5bbe..476e7299c 100644 --- a/xgraph/configure.in +++ b/xgraph/configure.in @@ -1,11 +1,18 @@ dnl Process this file with autoconf to produce a configure script. -AC_INIT(xgraph.c) +dnl configure.in script for xgraph package +dnl + +AC_INIT +AC_CONFIG_SRCDIR([xgraph.c]) AM_INIT_AUTOMAKE(xgraph,12.1) -AM_CONFIG_HEADER(autoconf.h) +AC_CONFIG_HEADERS([autoconf.h]) AM_WITH_DMALLOC +dnl Enable maintainer commands only if requested +AM_MAINTAINER_MODE + dnl Checks for programs. AC_PROG_CC @@ -30,5 +37,6 @@ AC_SUBST(ADDITIONAL_INCLUDES) AC_SUBST(ADDITIONAL_LIBS) -AC_OUTPUT([Makefile]) +AC_CONFIG_FILES([Makefile]) +AC_OUTPUT