diff --git a/BUGS b/BUGS index ab87c88..5ce4923 100644 --- a/BUGS +++ b/BUGS @@ -108,6 +108,25 @@ Problems with known work-a-rounds: int remsign; BOOL up, onebit; ZVALUE sqrt; +*** zmath.c 2000/06/07 14:02:13 29.2 +--- zmath.c 2001/03/13 19:47:03 +*************** +*** 1608,1614 **** + void + zbitvalue(long n, ZVALUE *res) + { +! ZVALUE z; + + if (n < 0) n = 0; + z.sign = 0; +--- 1608,1614 ---- + void + zbitvalue(long n, ZVALUE *res) + { +! volatile ZVALUE z; + + if (n < 0) n = 0; + z.sign = 0; * Solaris cc somtimes barfs while compiling zrand.c. In particular, calc barfs on on the SVAL macro. The work-a-round is to use the Solaric cc @@ -205,8 +224,8 @@ Problems with known work-a-rounds: ## received a copy with calc; if not, write to Free Software Foundation, Inc. ## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. ## -## @(#) $Revision: 29.7 $ -## @(#) $Id: BUGS,v 29.7 2001/02/25 21:01:52 chongo Exp $ +## @(#) $Revision: 29.9 $ +## @(#) $Id: BUGS,v 29.9 2001/03/18 03:34:41 chongo Exp $ ## @(#) $Source: /usr/local/src/cmd/calc/RCS/BUGS,v $ ## ## Under source code control: 1994/03/18 14:06:13 diff --git a/CHANGES b/CHANGES index 0905ed3..fb48f3f 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,6 @@ The following are the changes from calc version 2.11.5t0 to date: - Fixed a compile problem with Linux 2.4 / Debian. Thanks goes + Fixed a compile problem with Linux 2.4 / Debian. Thanks goes to Martin Buck for help with this issue. Fixed a bug in how L64_FORMAT (it determined if "%ld" or "%lld" @@ -10,11 +10,44 @@ The following are the changes from calc version 2.11.5t0 to date: An effort was made to make calc easier to build under Windoz using the Cygwin project (http://sources.redhat.com/cygwin/). - Thanks to the work of Thomas Jones-Low (tjoneslo and softstart + Thanks to the work of Thomas Jones-Low (tjoneslo and softstart dot com), a number of #if defined(_WIN32)'s have been added to calc source. These changes should not effect Windoz free system such as GNU/Linux, Solaris, POSIX-like, etc ... + Added windll.h to deal with Windoz related DLL issues. + Using the convention of 'extern DLL' instead of 'DLL extern' + to deal with symbols that export to or import from a DLL. + + Added HAVE_MALLOC_H, HAVE_STDLIB_H, HAVE_STRING_H, HAVE_TIMES_H, + HAVE_SYS_TIMES_H, HAVE_TIME_H, HAVE_SYS_TIME_H, HAVE_UNISTD_H + and HAVE_URANDOM to the Makefile. If these symcols are empty, + then the Makefile looks for the appropriate system include file. + If they are YES, then the Makefile will assume they exist. + If they are NO, then the Makefile will assume they do not exist. + + Changed HAVE_URANDOM to match the empty, YES, NO values. + If HAVE_URANDOM is empty, then the Makefile will look for /dev/urandom. + If HAVE_URANDOM is YES, then the Makefile will assume /dev/urandom exists. + If HAVE_URANDOM is NO, then the Makefile will assume /dev/urandom does + not exist. + + If TERMCONTROL is -DUSE_WIN32, then the Windoz terminal control + (no TERMIOS, no TERMIO, no SGTTY) will be assumed. + + Added a win32_hsrc Makefile rule to create hsrc files appropriate + for a Windoz system using Cygwin gcc environment. Added win32.mkdef + which is used by the win32_hsrc rule to set the Windoz specific + Makefile values to build hsrc files. The hsrc files are built + under the win32 directory. + + Added FPOS_POS_BITS, OFF_T_BITS, DEV_BITS and INODE_BITS Makefile + symbiols to allow one to force the size of a file position, file + offset, dev and inode value. Leaving these values blank will + Makefile to determine their size. + + Fixed a bug in the way file offsets, device and inode values are copied. + The following are the changes from calc version 2.11.4t1 to date: @@ -5059,8 +5092,8 @@ Following is a list of visible changes to calc from version 1.24.7 to 1.26.1: ## received a copy with calc; if not, write to Free Software Foundation, Inc. ## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. ## -## @(#) $Revision: 29.20 $ -## @(#) $Id: CHANGES,v 29.20 2001/02/25 22:07:36 chongo Exp $ +## @(#) $Revision: 29.22 $ +## @(#) $Id: CHANGES,v 29.22 2001/03/18 03:27:28 chongo Exp $ ## @(#) $Source: /usr/local/src/cmd/calc/RCS/CHANGES,v $ ## ## Under source code control: 1993/06/02 18:12:57 diff --git a/Makefile b/Makefile index 36c29c8..6196924 100644 --- a/Makefile +++ b/Makefile @@ -20,8 +20,8 @@ # received a copy with calc; if not, write to Free Software Foundation, Inc. # 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. # -MAKEFILE_REV= $$Revision: 29.14 $$ -# @(#) $Id: Makefile.ship,v 29.14 2001/02/25 22:07:36 chongo Exp $ +MAKEFILE_REV= $$Revision: 29.18 $$ +# @(#) $Id: Makefile.ship,v 29.18 2001/03/18 03:26:52 chongo Exp $ # @(#) $Source: /usr/local/src/cmd/calc/RCS/Makefile.ship,v $ # # Under source code control: 1990/02/15 01:48:41 @@ -46,6 +46,7 @@ MAKEFILE_REV= $$Revision: 29.14 $$ # -DUSE_TERMIOS use struct termios from # -DUSE_TERMIO use struct termios from # -DUSE_SGTTY use struct sgttyb from +# -DUSE_NOTHING windoz system, don't use any of them # # If in doubt, leave TERMCONTROL empty. # @@ -53,6 +54,7 @@ TERMCONTROL= #TERMCONTROL= -DUSE_TERMIOS #TERMCONTROL= -DUSE_TERMIO #TERMCONTROL= -DUSE_SGTTY +#TERMCONTROL= -DUSE_WIN32 # If your system does not have a vsprintf() function, you could be in trouble. # @@ -81,14 +83,14 @@ HAVE_VSPRINTF= # If in doubt, leave BYTE_ORDER empty. This Makefile will attempt to # use BYTE_ORDER in or it will attempt to run # the endian program. If you get syntax errors when you compile, -# try forcing the value to be BIG_ENDIAN and run the calc regression +# try forcing the value to be -DBIG_ENDIAN and run the calc regression # tests. (see the README file) If the calc regression tests fail, do -# a make clobber and try LITTLE_ENDIAN. If that fails, ask a wizard +# a make clobber and try -DLITTLE_ENDIAN. If that fails, ask a wizard # for help. # BYTE_ORDER= -#BYTE_ORDER= BIG_ENDIAN -#BYTE_ORDER= LITTLE_ENDIAN +#BYTE_ORDER= -DBIG_ENDIAN +#BYTE_ORDER= -DLITTLE_ENDIAN # Determine the number of bits in a long # @@ -143,7 +145,67 @@ HAVE_FPOS= # If in doubt, leave HAVE_FPOS_POS empty and this Makefile will figure it out. # HAVE_FPOS_POS= -#HAVE_FPOS= -DHAVE_NO_FPOS_POS +#HAVE_FPOS_POS= -DHAVE_NO_FPOS_POS + +# Determine the size of the __pos element in fpos_t, if it exists. +# +# If FPOS_POS_BITS is empty, then the Makefile will determine the size of +# the file position value of the __pos element. +# +# If in doubt, leave FPOS_POS_BITS empty and this Makefile will figure it out. +# +# If there is no __pos element in fpos_t (say because fpos_t is a scalar), +# leave FPOS_POS_BITS blank. +# +FPOS_POS_BITS= +#FPOS_POS_BITS= 32 +#FPOS_POS_BITS= 64 + +# Determine the size of a file position value. +# +# If FPOS_BITS is empty, then the Makefile will determine the size of +# the file position value. +# +# If in doubt, leave FPOS_BITS empty and this Makefile will figure it out. +# +FPOS_BITS= +#FPOS_BITS= 32 +#FPOS_BITS= 64 + +# Determine the size of the off_t file offset element +# +# If OFF_T_BITS is empty, then the Makefile will determine the size of +# the file offset value. +# +# If in doubt, leave OFF_T_BITS empty and this Makefile will figure it out. +# +OFF_T_BITS= +#OFF_T_BITS= 32 +#OFF_T_BITS= 64 + +# Determine the size of the dev_t device value +# +# If DEV_BITS is empty, then the Makefile will determine the size of +# the dev_t device value +# +# If in doubt, leave DEV_BITS empty and this Makefile will figure it out. +# +DEV_BITS= +#DEV_BITS= 16 +#DEV_BITS= 32 +#DEV_BITS= 64 + +# Determine the size of the ino_t device value +# +# If INODE_BITS is empty, then the Makefile will determine the size of +# the ino_t inode value +# +# If in doubt, leave INODE_BITS empty and this Makefile will figure it out. +# +INODE_BITS= +#INODE_BITS= 16 +#INODE_BITS= 32 +#INODE_BITS= 64 # Determine if we have an off_t which one can perform arithmetic operations, # assignments and comparisons. On some systems off_t is some sort of union @@ -283,17 +345,17 @@ HAVE_GETTIME= HAVE_GETPRID= #HAVE_GETPRID= -DHAVE_NO_GETPRID -# Determine if we have /dev/urandom +# Determine if we have the /dev/urandom # -# If HAVE_URANDOM is empty, this Makefile will run the have_memmv program -# to determine if /dev/urandom is supported. If HAVE_URANDOM is set to -# -DHAVE_NO_URANDOM, then calc will use internal functions to simulate -# the memory move function that does correct overlapping memory modes. +# HAVE_URANDOM_H= let the Makefile look /dev/urandom +# HAVE_URANDOM_H= YES assume that /dev/urandom exists +# HAVE_URANDOM_H= NO assume that /dev/urandom does not exist # -# If in doubt, leave HAVE_URANDOM empty and this Makefile will figure it out. +# When in doubt, leave HAVE_URANDOM_H empty. # -HAVE_URANDOM= -#HAVE_URANDOM= -DHAVE_NO_URANDOM +HAVE_URANDOM_H= +#HAVE_URANDOM_H= YES +#HAVE_URANDOM_H= NO # Determine if we have getrusage() # @@ -336,6 +398,102 @@ HAVE_STRDUP= ALIGN32= -DMUST_ALIGN32 #ALIGN32= -UMUST_ALIGN32 +# Determine if we have the include file. +# +# HAVE_MALLOC_H= let the Makefile look for the include file +# HAVE_MALLOC_H= YES assume that the include file exists +# HAVE_MALLOC_H= NO assume that the include file does not exist +# +# When in doubt, leave HAVE_MALLOC_H empty. +# +HAVE_MALLOC_H= +#HAVE_MALLOC_H= YES +#HAVE_MALLOC_H= NO + +# Determine if we have the include file. +# +# HAVE_STDLIB_H= let the Makefile look for the include file +# HAVE_STDLIB_H= YES assume that the include file exists +# HAVE_STDLIB_H= NO assume that the include file does not exist +# +# When in doubt, leave HAVE_STDLIB_H empty. +# +HAVE_STDLIB_H= +#HAVE_STDLIB_H= YES +#HAVE_STDLIB_H= NO + +# Determine if we have the include file. +# +# HAVE_STRING_H= let the Makefile look for the include file +# HAVE_STRING_H= YES assume that the include file exists +# HAVE_STRING_H= NO assume that the include file does not exist +# +# When in doubt, leave HAVE_STRING_H empty. +# +HAVE_STRING_H= +#HAVE_STRING_H= YES +#HAVE_STRING_H= NO + +# Determine if we have the include file. +# +# HAVE_TIMES_H= let the Makefile look for the include file +# HAVE_TIMES_H= YES assume that the include file exists +# HAVE_TIMES_H= NO assume that the include file does not exist +# +# When in doubt, leave HAVE_TIMES_H empty. +# +HAVE_TIMES_H= +#HAVE_TIMES_H= YES +#HAVE_TIMES_H= NO + +# Determine if we have the include file. +# +# HAVE_SYS_TIMES_H= let the Makefile look for the include file +# HAVE_SYS_TIMES_H= YES assume that the include file exists +# HAVE_SYS_TIMES_H= NO assume that the include file does not exist +# +# When in doubt, leave HAVE_SYS_TIMES_H empty. +# +HAVE_SYS_TIMES_H= +#HAVE_SYS_TIMES_H= YES +#HAVE_SYS_TIMES_H= NO + +# Determine if we have the include file. +# +# HAVE_TIME_H= let the Makefile look for the include file +# HAVE_TIME_H= YES assume that the include file exists +# HAVE_TIME_H= NO assume that the include file does not exist +# +# When in doubt, leave HAVE_TIME_H empty. +# +HAVE_TIME_H= +#HAVE_TIME_H= YES +#HAVE_TIME_H= NO + +# Determine if we have the include file. +# +# HAVE_SYS_TIME_H= let the Makefile look for the include file +# HAVE_SYS_TIME_H= YES assume that the include file exists +# HAVE_SYS_TIME_H= NO assume that the include file does not exist +# +# When in doubt, leave HAVE_SYS_TIME_H empty. +# +HAVE_SYS_TIME_H= +#HAVE_SYS_TIME_H= YES +#HAVE_SYS_TIME_H= NO + +# Determine if we have the include file. +# +# HAVE_UNISTD_H= let the Makefile look for the include file +# HAVE_UNISTD_H= YES assume that the include file exists +# HAVE_UNISTD_H= NO assume that the include file does not exist +# +# When in doubt, leave HAVE_UNISTD_H empty. +# +HAVE_UNISTD_H= +#HAVE_UNISTD_H= YES +#HAVE_UNISTD_H= NO + # where to install the *.cal, *.h and *.a files # # ${BINDIR} where to install binary files @@ -891,7 +1049,7 @@ LIB_H_SRC= alloc.h blkcpy.h block.h byteswap.h calc.h cmath.h \ config.h custom.h file.h func.h hash.h hist.h jump.h \ label.h lib_util.h math_error.h md5.h nametype.h \ opcodes.h prime.h qmath.h shs.h shs1.h string.h \ - symbol.h token.h value.h zmath.h zrand.h zrandom.h + symbol.h token.h value.h win32dll.h zmath.h zrand.h zrandom.h # we build these .h files during the make # @@ -1225,7 +1383,7 @@ endian_calc.h: endian ${MAKE_FILE} ./endian >> endian_calc.h; \ fi; \ else \ - echo "#define CALC_BYTE_ORDER ${BYTE_ORDER}" >> endian_calc.h; \ + ./endian >> endian_calc.h; \ fi ${Q}echo '' >> endian_calc.h ${Q}echo '' >> endian_calc.h @@ -1281,7 +1439,11 @@ have_malloc.h: ${MAKE_FILE} ${Q}echo '' >> have_malloc.h ${Q}echo '' >> have_malloc.h ${Q}echo '/* do we have /usr/include/malloc.h? */' >> have_malloc.h - -${Q}if [ -f /usr/include/malloc.h ]; then \ + -${Q}if [ X"${HAVE_MALLOC_H}" = X"YES" ]; then \ + echo '#define HAVE_MALLOC_H /* yes */' >> have_malloc.h; \ + elif [ X"${HAVE_MALLOC_H}" = X"NO" ]; then \ + echo '#undef HAVE_MALLOC_H /* no */' >> have_malloc.h; \ + elif [ -f /usr/include/malloc.h ]; then \ echo '#define HAVE_MALLOC_H /* yes */' >> have_malloc.h; \ else \ echo '#undef HAVE_MALLOC_H /* no */' >> have_malloc.h; \ @@ -1313,22 +1475,38 @@ have_times.h: ${MAKE_FILE} ${Q}echo '' >> have_times.h ${Q}echo '' >> have_times.h ${Q}echo '/* do we have /usr/include/times.h? */' >> have_times.h - -${Q}if [ -f /usr/include/times.h ]; then \ + -${Q}if [ X"${HAVE_TIMES_H}" = X"YES" ]; then \ + echo '#define HAVE_TIMES_H /* yes */' >> have_times.h; \ + elif [ X"${HAVE_TIMES_H}" = X"NO" ]; then \ + echo '#undef HAVE_TIMES_H /* no */' >> have_times.h; \ + elif [ -f /usr/include/times.h ]; then \ echo '#define HAVE_TIMES_H /* yes */' >> have_times.h; \ else \ echo '#undef HAVE_TIMES_H /* no */' >> have_times.h; \ fi - -${Q}if [ -f /usr/include/sys/times.h ]; then \ + -${Q}if [ X"${HAVE_SYS_TIMES_H}" = X"YES" ]; then \ + echo '#define HAVE_SYS_TIMES_H /* yes */' >> have_times.h; \ + elif [ X"${HAVE_SYS_TIMES_H}" = X"NO" ]; then \ + echo '#undef HAVE_SYS_TIMES_H /* no */' >> have_times.h; \ + elif [ -f /usr/include/sys/times.h ]; then \ echo '#define HAVE_SYS_TIMES_H /* yes */' >> have_times.h; \ else \ echo '#undef HAVE_SYS_TIMES_H /* no */' >> have_times.h; \ fi - -${Q}if [ -f /usr/include/time.h ]; then \ + -${Q}if [ X"${HAVE_TIME_H}" = X"YES" ]; then \ + echo '#define HAVE_TIME_H /* yes */' >> have_times.h; \ + elif [ X"${HAVE_TIME_H}" = X"NO" ]; then \ + echo '#undef HAVE_TIME_H /* no */' >> have_times.h; \ + elif [ -f /usr/include/time.h ]; then \ echo '#define HAVE_TIME_H /* yes */' >> have_times.h; \ else \ echo '#undef HAVE_TIME_H /* no */' >> have_times.h; \ fi - -${Q}if [ -f /usr/include/sys/time.h ]; then \ + -${Q}if [ X"${HAVE_SYS_TIME_H}" = X"YES" ]; then \ + echo '#define HAVE_SYS_TIME_H /* yes */' >> have_times.h; \ + elif [ X"${HAVE_SYS_TIME_H}" = X"NO" ]; then \ + echo '#undef HAVE_SYS_TIME_H /* no */' >> have_times.h; \ + elif [ -f /usr/include/sys/time.h ]; then \ echo '#define HAVE_SYS_TIME_H /* yes */' >> have_times.h; \ else \ echo '#undef HAVE_SYS_TIME_H /* no */' >> have_times.h; \ @@ -1360,7 +1538,11 @@ have_stdlib.h: ${MAKE_FILE} ${Q}echo '' >> have_stdlib.h ${Q}echo '' >> have_stdlib.h ${Q}echo '/* do we have /usr/include/stdlib.h? */' >> have_stdlib.h - -${Q}if [ -f /usr/include/stdlib.h ]; then \ + -${Q}if [ X"${HAVE_STDLIB_H}" = X"YES" ]; then \ + echo '#define HAVE_STDLIB_H /* yes */' >> have_stdlib.h; \ + elif [ X"${HAVE_STDLIB_H}" = X"NO" ]; then \ + echo '#undef HAVE_STDLIB_H /* no */' >> have_stdlib.h; \ + elif [ -f /usr/include/stdlib.h ]; then \ echo '#define HAVE_STDLIB_H /* yes */' >> have_stdlib.h; \ else \ echo '#undef HAVE_STDLIB_H /* no */' >> have_stdlib.h; \ @@ -1392,7 +1574,11 @@ have_unistd.h: ${MAKE_FILE} ${Q}echo '' >> have_unistd.h ${Q}echo '' >> have_unistd.h ${Q}echo '/* do we have /usr/include/unistd.h? */' >> have_unistd.h - -${Q}if [ -f /usr/include/unistd.h ]; then \ + -${Q}if [ X"${HAVE_UNISTD_H}" = X"YES" ]; then \ + echo '#define HAVE_UNISTD_H /* yes */' >> have_unistd.h; \ + elif [ X"${HAVE_UNISTD_H}" = X"NO" ]; then \ + echo '#undef HAVE_UNISTD_H /* no */' >> have_unistd.h; \ + elif [ -f /usr/include/unistd.h ]; then \ echo '#define HAVE_UNISTD_H /* yes */' >> have_unistd.h; \ else \ echo '#undef HAVE_UNISTD_H /* no */' >> have_unistd.h; \ @@ -1424,7 +1610,11 @@ have_string.h: ${MAKE_FILE} ${Q}echo '' >> have_string.h ${Q}echo '' >> have_string.h ${Q}echo '/* do we have /usr/include/string.h? */' >> have_string.h - -${Q}if [ -f /usr/include/string.h ]; then \ + -${Q}if [ X"${HAVE_STRING_H}" = X"YES" ]; then \ + echo '#define HAVE_STRING_H /* yes */' >> have_string.h; \ + elif [ X"${HAVE_STRING_H}" = X"NO" ]; then \ + echo '#undef HAVE_STRING_H /* no */' >> have_string.h; \ + elif [ -f /usr/include/string.h ]; then \ echo '#define HAVE_STRING_H /* yes */' >> have_string.h; \ else \ echo '#undef HAVE_STRING_H /* no */' >> have_string.h; \ @@ -1459,15 +1649,23 @@ terminal.h: ${MAKE_FILE} ${Q}echo '#if !defined(USE_TERMIOS)' >> terminal.h ${Q}echo '#if !defined(USE_TERMIO)' >> terminal.h ${Q}echo '#if !defined(USE_SGTTY)' >> terminal.h - -${Q}if [ -f /usr/include/termios.h ]; then \ + -${Q}if [ X"${TERMCONTROL}" = X"-DUSE_WIN32" ]; then \ + echo '/* windoz, use none of these modes */' >> terminal.h; \ + echo '#undef USE_TERMIOS /* */' >> terminal.h; \ + echo '#undef USE_TERMIO /* */' >> terminal.h; \ + echo '#undef USE_SGTTY /* */' >> terminal.h; \ + elif [ -f /usr/include/termios.h ]; then \ + echo '/* use termios */' >> terminal.h; \ echo '#define USE_TERMIOS /* */' >> terminal.h; \ echo '#undef USE_TERMIO /* */' >> terminal.h; \ echo '#undef USE_SGTTY /* */' >> terminal.h; \ elif [ -f /usr/include/termio.h ]; then \ + echo '/* use termio */' >> terminal.h; \ echo '#undef USE_TERMIOS /* */' >> terminal.h; \ echo '#define USE_TERMIO /* */' >> terminal.h; \ echo '#undef USE_SGTTY /* */' >> terminal.h; \ else \ + echo '/* use sgtty */' >> terminal.h; \ echo '#undef USE_TERMIOS /* */' >> terminal.h; \ echo '#undef USE_TERMIO /* */' >> terminal.h; \ echo '#define USE_SGTTY /* */' >> terminal.h; \ @@ -1586,8 +1784,8 @@ have_fpos_pos.h: have_fpos_pos.c have_fpos.h have_posscl.h ${MAKE_FILE} ${Q}echo '/* do we have fgetpos & fsetpos functions? */' \ >> have_fpos_pos.h -${Q}rm -f have_fpos_pos.o have_fpos_pos - -${Q}${LCC} ${HAVE_FPOS_POS} ${ICFLAGS} have_fpos_pos.c -c \ - 2>/dev/null; true + -${Q}${LCC} ${HAVE_FPOS} ${HAVE_FPOS_POS} \ + ${ICFLAGS} have_fpos_pos.c -c 2>/dev/null; true -${Q}${LCC} ${ILDFLAGS} have_fpos_pos.o -o have_fpos_pos \ 2>/dev/null; true -${Q}${SHELL} -c "./have_fpos_pos > fpos_tmp 2>/dev/null" \ @@ -1629,7 +1827,8 @@ fposval.h: fposval.c have_fpos.h have_fpos_pos.h have_offscl.h have_posscl.h \ ${Q}echo '' >> fposval.h ${Q}echo '/* what are our file position & size types? */' >> fposval.h -${Q}rm -f fposval.o fposval - -${Q}${LCC} ${ICFLAGS} fposval.c -c 2>/dev/null; true + -${Q}${LCC} ${ICFLAGS} ${FPOS_BITS} ${OFF_T_BITS} \ + ${DEV_BITS} ${INODE_BITS} fposval.c -c 2>/dev/null; true -${Q}${LCC} ${ILDFLAGS} fposval.o -o fposval 2>/dev/null; true ${Q}${SHELL} -c "./fposval fposv_tmp >> fposval.h 2>/dev/null" \ >/dev/null 2>&1; true @@ -2139,7 +2338,11 @@ have_urandom.h: ${MAKE_FILE} ${Q}echo '' >> have_urandom.h ${Q}echo '' >> have_urandom.h ${Q}echo '/* do we have /dev/urandom? */' >> have_urandom.h - -${Q}if [ -e /dev/urandom ] 2>/dev/null; then \ + -${Q}if [ X"${HAVE_URANDOM_H}" = X"YES" ]; then \ + echo '#define HAVE_URANDOM_H /* yes */' >> have_urandom.h; \ + elif [ X"${HAVE_URANDOM_H}" = X"NO" ]; then \ + echo '#undef HAVE_URANDOM_H /* no */' >> have_urandom.h; \ + elif [ -e /dev/urandom ] 2>/dev/null; then \ echo '#define HAVE_URANDOM_H /* yes */' >> have_urandom.h; \ else \ echo '#undef HAVE_URANDOM_H /* no */' >> have_urandom.h; \ @@ -2347,6 +2550,31 @@ calcerr.c: calcerr.tbl calcerr_c.sed calcerr_c.awk ${MAKE_FILE} true; \ fi +## +# +# Build .h files for windoz based systems +# +# This is really a internal utility rule that is used to create the +# win32 sub-directory for distribution. +# +## + +win32_hsrc: ${MAKE_FILE} win32.mkdef + ${Q}echo 'forming win32 directory' + ${Q}rm -rf win32 + ${Q}mkdir win32 + ${Q}cp ${UTIL_C_SRC} win32 + ${Q}cp ${UTIL_MISC_SRC} win32.mkdef Makefile win32 + ${Q}(cd win32; \ + echo "cd win32"; \ + echo "$(MAKE) hsrc `cat win32.mkdef`"; \ + $(MAKE) hsrc `cat win32.mkdef`; \ + rm -f ${UTIL_C_SRC}; \ + rm -f ${UTIL_MISC_SRC}; \ + rm -f Makefile endian longbits endian.o longbits.o) + ${Q}echo 'win32 directory formed' + + ## # # These rules are used in the process of building the BUILD_H_SRC. @@ -2354,7 +2582,7 @@ calcerr.c: calcerr.tbl calcerr_c.sed calcerr_c.awk ${MAKE_FILE} ## endian.o: endian.c have_unistd.h - ${LCC} ${ICFLAGS} endian.c -c + ${LCC} ${ICFLAGS} ${BYTE_ORDER} endian.c -c endian: endian.o ${LCC} ${ICFLAGS} endian.o -o endian @@ -2892,6 +3120,7 @@ clobber: -rm -rf lib -rm -f endian.h stdarg.h libcalcerr.a cal/obj help/obj -rm -f have_vs.c std_arg.h try_stdarg.c fnvhash.c + -rm -rf win32 ${V} echo '=-=-=-=-= end of $@ rule =-=-=-=-=' install: calc libcalc.a ${LIB_H_SRC} ${BUILD_H_SRC} calc.1 @@ -3023,12 +3252,13 @@ install: calc libcalc.a ${LIB_H_SRC} ${BUILD_H_SRC} calc.1 # DO NOT DELETE THIS LINE -- make depend depends on it. + addop.o: addop.c addop.o: alloc.h addop.o: block.h addop.o: byteswap.h -addop.o: calc.h addop.o: calcerr.h +addop.o: calc.h addop.o: cmath.h addop.o: config.h addop.o: endian_calc.h @@ -3046,12 +3276,13 @@ addop.o: md5.h addop.o: nametype.h addop.o: opcodes.h addop.o: qmath.h -addop.o: shs.h addop.o: shs1.h +addop.o: shs.h addop.o: string.h addop.o: symbol.h addop.o: token.h addop.o: value.h +addop.o: win32dll.h addop.o: zmath.h align32.o: align32.c align32.o: have_unistd.h @@ -3074,18 +3305,19 @@ assocfunc.o: longbits.h assocfunc.o: md5.h assocfunc.o: nametype.h assocfunc.o: qmath.h -assocfunc.o: shs.h assocfunc.o: shs1.h +assocfunc.o: shs.h assocfunc.o: string.h assocfunc.o: value.h +assocfunc.o: win32dll.h assocfunc.o: zmath.h blkcpy.o: alloc.h blkcpy.o: blkcpy.c blkcpy.o: blkcpy.h blkcpy.o: block.h blkcpy.o: byteswap.h -blkcpy.o: calc.h blkcpy.o: calcerr.h +blkcpy.o: calc.h blkcpy.o: cmath.h blkcpy.o: config.h blkcpy.o: endian_calc.h @@ -3102,10 +3334,11 @@ blkcpy.o: longbits.h blkcpy.o: md5.h blkcpy.o: nametype.h blkcpy.o: qmath.h -blkcpy.o: shs.h blkcpy.o: shs1.h +blkcpy.o: shs.h blkcpy.o: string.h blkcpy.o: value.h +blkcpy.o: win32dll.h blkcpy.o: zmath.h block.o: alloc.h block.o: block.c @@ -3125,10 +3358,11 @@ block.o: longbits.h block.o: md5.h block.o: nametype.h block.o: qmath.h -block.o: shs.h block.o: shs1.h +block.o: shs.h block.o: string.h block.o: value.h +block.o: win32dll.h block.o: zmath.h byteswap.o: alloc.h byteswap.o: byteswap.c @@ -3142,14 +3376,18 @@ byteswap.o: have_stdlib.h byteswap.o: have_string.h byteswap.o: longbits.h byteswap.o: qmath.h +byteswap.o: win32dll.h byteswap.o: zmath.h +calcerr.o: calcerr.c +calcerr.o: calcerr.h +calcerr.o: have_const.h calc.o: alloc.h calc.o: args.h calc.o: block.h calc.o: byteswap.h calc.o: calc.c -calc.o: calc.h calc.o: calcerr.h +calc.o: calc.h calc.o: cmath.h calc.o: conf.h calc.o: config.h @@ -3174,21 +3412,19 @@ calc.o: md5.h calc.o: nametype.h calc.o: opcodes.h calc.o: qmath.h -calc.o: shs.h calc.o: shs1.h +calc.o: shs.h calc.o: string.h calc.o: symbol.h calc.o: token.h calc.o: value.h +calc.o: win32dll.h calc.o: zmath.h -calcerr.o: calcerr.c -calcerr.o: calcerr.h -calcerr.o: have_const.h codegen.o: alloc.h codegen.o: block.h codegen.o: byteswap.h -codegen.o: calc.h codegen.o: calcerr.h +codegen.o: calc.h codegen.o: cmath.h codegen.o: codegen.c codegen.o: conf.h @@ -3209,12 +3445,13 @@ codegen.o: md5.h codegen.o: nametype.h codegen.o: opcodes.h codegen.o: qmath.h -codegen.o: shs.h codegen.o: shs1.h +codegen.o: shs.h codegen.o: string.h codegen.o: symbol.h codegen.o: token.h codegen.o: value.h +codegen.o: win32dll.h codegen.o: zmath.h comfunc.o: alloc.h comfunc.o: byteswap.h @@ -3230,6 +3467,7 @@ comfunc.o: have_string.h comfunc.o: longbits.h comfunc.o: nametype.h comfunc.o: qmath.h +comfunc.o: win32dll.h comfunc.o: zmath.h commath.o: alloc.h commath.o: byteswap.h @@ -3243,12 +3481,13 @@ commath.o: have_stdlib.h commath.o: have_string.h commath.o: longbits.h commath.o: qmath.h +commath.o: win32dll.h commath.o: zmath.h config.o: alloc.h config.o: block.h config.o: byteswap.h -config.o: calc.h config.o: calcerr.h +config.o: calc.h config.o: cmath.h config.o: config.c config.o: config.h @@ -3265,18 +3504,19 @@ config.o: longbits.h config.o: md5.h config.o: nametype.h config.o: qmath.h -config.o: shs.h config.o: shs1.h +config.o: shs.h config.o: string.h config.o: token.h config.o: value.h +config.o: win32dll.h config.o: zmath.h config.o: zrand.h const.o: alloc.h const.o: block.h const.o: byteswap.h -const.o: calc.h const.o: calcerr.h +const.o: calc.h const.o: cmath.h const.o: config.h const.o: const.c @@ -3292,16 +3532,17 @@ const.o: longbits.h const.o: md5.h const.o: nametype.h const.o: qmath.h -const.o: shs.h const.o: shs1.h +const.o: shs.h const.o: string.h const.o: value.h +const.o: win32dll.h const.o: zmath.h custom.o: alloc.h custom.o: block.h custom.o: byteswap.h -custom.o: calc.h custom.o: calcerr.h +custom.o: calc.h custom.o: cmath.h custom.o: config.h custom.o: custom.c @@ -3318,18 +3559,19 @@ custom.o: longbits.h custom.o: md5.h custom.o: nametype.h custom.o: qmath.h -custom.o: shs.h custom.o: shs1.h +custom.o: shs.h custom.o: string.h custom.o: value.h +custom.o: win32dll.h custom.o: zmath.h endian.o: endian.c endian.o: have_unistd.h file.o: alloc.h file.o: block.h file.o: byteswap.h -file.o: calc.h file.o: calcerr.h +file.o: calc.h file.o: cmath.h file.o: config.h file.o: endian_calc.h @@ -3345,14 +3587,16 @@ file.o: have_memmv.h file.o: have_newstr.h file.o: have_stdlib.h file.o: have_string.h +file.o: have_unistd.h file.o: longbits.h file.o: md5.h file.o: nametype.h file.o: qmath.h -file.o: shs.h file.o: shs1.h +file.o: shs.h file.o: string.h file.o: value.h +file.o: win32dll.h file.o: zmath.h fposval.o: endian_calc.h fposval.o: fposval.c @@ -3363,8 +3607,8 @@ fposval.o: have_posscl.h func.o: alloc.h func.o: block.h func.o: byteswap.h -func.o: calc.h func.o: calcerr.h +func.o: calc.h func.o: cmath.h func.o: config.h func.o: custom.h @@ -3390,20 +3634,21 @@ func.o: nametype.h func.o: opcodes.h func.o: prime.h func.o: qmath.h -func.o: shs.h func.o: shs1.h +func.o: shs.h func.o: string.h func.o: symbol.h func.o: token.h func.o: value.h +func.o: win32dll.h func.o: zmath.h func.o: zrand.h func.o: zrandom.h hash.o: alloc.h hash.o: block.h hash.o: byteswap.h -hash.o: calc.h hash.o: calcerr.h +hash.o: calc.h hash.o: cmath.h hash.o: config.h hash.o: endian_calc.h @@ -3419,10 +3664,11 @@ hash.o: longbits.h hash.o: md5.h hash.o: nametype.h hash.o: qmath.h -hash.o: shs.h hash.o: shs1.h +hash.o: shs.h hash.o: string.h hash.o: value.h +hash.o: win32dll.h hash.o: zmath.h hash.o: zrand.h hash.o: zrandom.h @@ -3454,8 +3700,8 @@ have_varvs.o: have_varvs.c help.o: alloc.h help.o: block.h help.o: byteswap.h -help.o: calc.h help.o: calcerr.h +help.o: calc.h help.o: cmath.h help.o: conf.h help.o: config.h @@ -3473,16 +3719,17 @@ help.o: longbits.h help.o: md5.h help.o: nametype.h help.o: qmath.h -help.o: shs.h help.o: shs1.h +help.o: shs.h help.o: string.h help.o: value.h +help.o: win32dll.h help.o: zmath.h hist.o: alloc.h hist.o: block.h hist.o: byteswap.h -hist.o: calc.h hist.o: calcerr.h +hist.o: calc.h hist.o: cmath.h hist.o: config.h hist.o: endian_calc.h @@ -3501,16 +3748,17 @@ hist.o: longbits.h hist.o: md5.h hist.o: nametype.h hist.o: qmath.h -hist.o: shs.h hist.o: shs1.h +hist.o: shs.h hist.o: string.h hist.o: value.h +hist.o: win32dll.h hist.o: zmath.h input.o: alloc.h input.o: block.h input.o: byteswap.h -input.o: calc.h input.o: calcerr.h +input.o: calc.h input.o: cmath.h input.o: conf.h input.o: config.h @@ -3529,10 +3777,11 @@ input.o: longbits.h input.o: md5.h input.o: nametype.h input.o: qmath.h -input.o: shs.h input.o: shs1.h +input.o: shs.h input.o: string.h input.o: value.h +input.o: win32dll.h input.o: zmath.h jump.o: have_const.h jump.o: jump.c @@ -3540,8 +3789,8 @@ jump.o: jump.h label.o: alloc.h label.o: block.h label.o: byteswap.h -label.o: calc.h label.o: calcerr.h +label.o: calc.h label.o: cmath.h label.o: config.h label.o: endian_calc.h @@ -3560,17 +3809,18 @@ label.o: md5.h label.o: nametype.h label.o: opcodes.h label.o: qmath.h -label.o: shs.h label.o: shs1.h +label.o: shs.h label.o: string.h label.o: token.h label.o: value.h +label.o: win32dll.h label.o: zmath.h lib_calc.o: alloc.h lib_calc.o: block.h lib_calc.o: byteswap.h -lib_calc.o: calc.h lib_calc.o: calcerr.h +lib_calc.o: calc.h lib_calc.o: cmath.h lib_calc.o: conf.h lib_calc.o: config.h @@ -3591,13 +3841,14 @@ lib_calc.o: longbits.h lib_calc.o: md5.h lib_calc.o: nametype.h lib_calc.o: qmath.h -lib_calc.o: shs.h lib_calc.o: shs1.h +lib_calc.o: shs.h lib_calc.o: string.h lib_calc.o: symbol.h lib_calc.o: terminal.h lib_calc.o: token.h lib_calc.o: value.h +lib_calc.o: win32dll.h lib_calc.o: zmath.h lib_calc.o: zrandom.h lib_util.o: alloc.h @@ -3611,6 +3862,7 @@ lib_util.o: have_string.h lib_util.o: lib_util.c lib_util.o: lib_util.h lib_util.o: longbits.h +lib_util.o: win32dll.h lib_util.o: zmath.h listfunc.o: alloc.h listfunc.o: block.h @@ -3631,10 +3883,11 @@ listfunc.o: longbits.h listfunc.o: md5.h listfunc.o: nametype.h listfunc.o: qmath.h -listfunc.o: shs.h listfunc.o: shs1.h +listfunc.o: shs.h listfunc.o: string.h listfunc.o: value.h +listfunc.o: win32dll.h listfunc.o: zmath.h listfunc.o: zrand.h longbits.o: have_stdlib.h @@ -3663,18 +3916,19 @@ matfunc.o: matfunc.c matfunc.o: md5.h matfunc.o: nametype.h matfunc.o: qmath.h -matfunc.o: shs.h matfunc.o: shs1.h +matfunc.o: shs.h matfunc.o: string.h matfunc.o: value.h +matfunc.o: win32dll.h matfunc.o: zmath.h matfunc.o: zrand.h math_error.o: alloc.h math_error.o: args.h math_error.o: block.h math_error.o: byteswap.h -math_error.o: calc.h math_error.o: calcerr.h +math_error.o: calc.h math_error.o: cmath.h math_error.o: config.h math_error.o: endian_calc.h @@ -3691,10 +3945,11 @@ math_error.o: math_error.h math_error.o: md5.h math_error.o: nametype.h math_error.o: qmath.h -math_error.o: shs.h math_error.o: shs1.h +math_error.o: shs.h math_error.o: string.h math_error.o: value.h +math_error.o: win32dll.h math_error.o: zmath.h md5.o: align32.h md5.o: alloc.h @@ -3715,16 +3970,17 @@ md5.o: md5.c md5.o: md5.h md5.o: nametype.h md5.o: qmath.h -md5.o: shs.h md5.o: shs1.h +md5.o: shs.h md5.o: string.h md5.o: value.h +md5.o: win32dll.h md5.o: zmath.h obj.o: alloc.h obj.o: block.h obj.o: byteswap.h -obj.o: calc.h obj.o: calcerr.h +obj.o: calc.h obj.o: cmath.h obj.o: config.h obj.o: endian_calc.h @@ -3743,17 +3999,18 @@ obj.o: nametype.h obj.o: obj.c obj.o: opcodes.h obj.o: qmath.h -obj.o: shs.h obj.o: shs1.h +obj.o: shs.h obj.o: string.h obj.o: symbol.h obj.o: value.h +obj.o: win32dll.h obj.o: zmath.h opcodes.o: alloc.h opcodes.o: block.h opcodes.o: byteswap.h -opcodes.o: calc.h opcodes.o: calcerr.h +opcodes.o: calc.h opcodes.o: cmath.h opcodes.o: config.h opcodes.o: custom.h @@ -3777,11 +4034,12 @@ opcodes.o: nametype.h opcodes.o: opcodes.c opcodes.o: opcodes.h opcodes.o: qmath.h -opcodes.o: shs.h opcodes.o: shs1.h +opcodes.o: shs.h opcodes.o: string.h opcodes.o: symbol.h opcodes.o: value.h +opcodes.o: win32dll.h opcodes.o: zmath.h opcodes.o: zrand.h opcodes.o: zrandom.h @@ -3798,6 +4056,7 @@ pix.o: longbits.h pix.o: pix.c pix.o: prime.h pix.o: qmath.h +pix.o: win32dll.h pix.o: zmath.h poly.o: alloc.h poly.o: block.h @@ -3817,10 +4076,11 @@ poly.o: md5.h poly.o: nametype.h poly.o: poly.c poly.o: qmath.h -poly.o: shs.h poly.o: shs1.h +poly.o: shs.h poly.o: string.h poly.o: value.h +poly.o: win32dll.h poly.o: zmath.h prime.o: alloc.h prime.o: byteswap.h @@ -3836,6 +4096,7 @@ prime.o: longbits.h prime.o: prime.c prime.o: prime.h prime.o: qmath.h +prime.o: win32dll.h prime.o: zmath.h qfunc.o: alloc.h qfunc.o: byteswap.h @@ -3852,6 +4113,7 @@ qfunc.o: nametype.h qfunc.o: prime.h qfunc.o: qfunc.c qfunc.o: qmath.h +qfunc.o: win32dll.h qfunc.o: zmath.h qio.o: alloc.h qio.o: args.h @@ -3867,6 +4129,7 @@ qio.o: longbits.h qio.o: nametype.h qio.o: qio.c qio.o: qmath.h +qio.o: win32dll.h qio.o: zmath.h qmath.o: alloc.h qmath.o: byteswap.h @@ -3881,6 +4144,7 @@ qmath.o: longbits.h qmath.o: nametype.h qmath.o: qmath.c qmath.o: qmath.h +qmath.o: win32dll.h qmath.o: zmath.h qmod.o: alloc.h qmod.o: byteswap.h @@ -3895,6 +4159,7 @@ qmod.o: longbits.h qmod.o: nametype.h qmod.o: qmath.h qmod.o: qmod.c +qmod.o: win32dll.h qmod.o: zmath.h qtrans.o: alloc.h qtrans.o: byteswap.h @@ -3907,6 +4172,7 @@ qtrans.o: have_string.h qtrans.o: longbits.h qtrans.o: qmath.h qtrans.o: qtrans.c +qtrans.o: win32dll.h qtrans.o: zmath.h quickhash.o: alloc.h quickhash.o: block.h @@ -3927,10 +4193,11 @@ quickhash.o: md5.h quickhash.o: nametype.h quickhash.o: qmath.h quickhash.o: quickhash.c -quickhash.o: shs.h quickhash.o: shs1.h +quickhash.o: shs.h quickhash.o: string.h quickhash.o: value.h +quickhash.o: win32dll.h quickhash.o: zmath.h quickhash.o: zrand.h quickhash.o: zrandom.h @@ -3947,36 +4214,16 @@ seed.o: have_newstr.h seed.o: have_rusage.h seed.o: have_stdlib.h seed.o: have_string.h +seed.o: have_times.h +seed.o: have_uid_t.h +seed.o: have_unistd.h seed.o: have_urandom.h seed.o: have_ustat.h seed.o: longbits.h seed.o: qmath.h seed.o: seed.c +seed.o: win32dll.h seed.o: zmath.h -shs.o: align32.h -shs.o: alloc.h -shs.o: block.h -shs.o: byteswap.h -shs.o: calcerr.h -shs.o: cmath.h -shs.o: config.h -shs.o: endian_calc.h -shs.o: hash.h -shs.o: have_malloc.h -shs.o: have_memmv.h -shs.o: have_newstr.h -shs.o: have_stdlib.h -shs.o: have_string.h -shs.o: longbits.h -shs.o: md5.h -shs.o: nametype.h -shs.o: qmath.h -shs.o: shs.c -shs.o: shs.h -shs.o: shs1.h -shs.o: string.h -shs.o: value.h -shs.o: zmath.h shs1.o: align32.h shs1.o: alloc.h shs1.o: block.h @@ -3995,12 +4242,38 @@ shs1.o: longbits.h shs1.o: md5.h shs1.o: nametype.h shs1.o: qmath.h -shs1.o: shs.h shs1.o: shs1.c shs1.o: shs1.h +shs1.o: shs.h shs1.o: string.h shs1.o: value.h +shs1.o: win32dll.h shs1.o: zmath.h +shs.o: align32.h +shs.o: alloc.h +shs.o: block.h +shs.o: byteswap.h +shs.o: calcerr.h +shs.o: cmath.h +shs.o: config.h +shs.o: endian_calc.h +shs.o: hash.h +shs.o: have_malloc.h +shs.o: have_memmv.h +shs.o: have_newstr.h +shs.o: have_stdlib.h +shs.o: have_string.h +shs.o: longbits.h +shs.o: md5.h +shs.o: nametype.h +shs.o: qmath.h +shs.o: shs1.h +shs.o: shs.c +shs.o: shs.h +shs.o: string.h +shs.o: value.h +shs.o: win32dll.h +shs.o: zmath.h size.o: alloc.h size.o: block.h size.o: byteswap.h @@ -4019,19 +4292,20 @@ size.o: longbits.h size.o: md5.h size.o: nametype.h size.o: qmath.h -size.o: shs.h size.o: shs1.h +size.o: shs.h size.o: size.c size.o: string.h size.o: value.h +size.o: win32dll.h size.o: zmath.h size.o: zrand.h size.o: zrandom.h string.o: alloc.h string.o: block.h string.o: byteswap.h -string.o: calc.h string.o: calcerr.h +string.o: calc.h string.o: cmath.h string.o: config.h string.o: endian_calc.h @@ -4046,17 +4320,18 @@ string.o: longbits.h string.o: md5.h string.o: nametype.h string.o: qmath.h -string.o: shs.h string.o: shs1.h +string.o: shs.h string.o: string.c string.o: string.h string.o: value.h +string.o: win32dll.h string.o: zmath.h symbol.o: alloc.h symbol.o: block.h symbol.o: byteswap.h -symbol.o: calc.h symbol.o: calcerr.h +symbol.o: calc.h symbol.o: cmath.h symbol.o: config.h symbol.o: endian_calc.h @@ -4074,20 +4349,21 @@ symbol.o: md5.h symbol.o: nametype.h symbol.o: opcodes.h symbol.o: qmath.h -symbol.o: shs.h symbol.o: shs1.h +symbol.o: shs.h symbol.o: string.h symbol.o: symbol.c symbol.o: symbol.h symbol.o: token.h symbol.o: value.h +symbol.o: win32dll.h symbol.o: zmath.h token.o: alloc.h token.o: args.h token.o: block.h token.o: byteswap.h -token.o: calc.h token.o: calcerr.h +token.o: calc.h token.o: cmath.h token.o: config.h token.o: endian_calc.h @@ -4103,18 +4379,19 @@ token.o: math_error.h token.o: md5.h token.o: nametype.h token.o: qmath.h -token.o: shs.h token.o: shs1.h +token.o: shs.h token.o: string.h token.o: token.c token.o: token.h token.o: value.h +token.o: win32dll.h token.o: zmath.h value.o: alloc.h value.o: block.h value.o: byteswap.h -value.o: calc.h value.o: calcerr.h +value.o: calc.h value.o: cmath.h value.o: config.h value.o: endian_calc.h @@ -4134,20 +4411,21 @@ value.o: md5.h value.o: nametype.h value.o: opcodes.h value.o: qmath.h -value.o: shs.h value.o: shs1.h +value.o: shs.h value.o: string.h value.o: symbol.h value.o: value.c value.o: value.h +value.o: win32dll.h value.o: zmath.h value.o: zrand.h value.o: zrandom.h version.o: alloc.h version.o: block.h version.o: byteswap.h -version.o: calc.h version.o: calcerr.h +version.o: calc.h version.o: cmath.h version.o: config.h version.o: endian_calc.h @@ -4162,11 +4440,12 @@ version.o: longbits.h version.o: md5.h version.o: nametype.h version.o: qmath.h -version.o: shs.h version.o: shs1.h +version.o: shs.h version.o: string.h version.o: value.h version.o: version.c +version.o: win32dll.h version.o: zmath.h zfunc.o: alloc.h zfunc.o: byteswap.h @@ -4177,6 +4456,7 @@ zfunc.o: have_newstr.h zfunc.o: have_stdlib.h zfunc.o: have_string.h zfunc.o: longbits.h +zfunc.o: win32dll.h zfunc.o: zfunc.c zfunc.o: zmath.h zio.o: alloc.h @@ -4192,6 +4472,7 @@ zio.o: have_string.h zio.o: longbits.h zio.o: nametype.h zio.o: qmath.h +zio.o: win32dll.h zio.o: zio.c zio.o: zmath.h zmath.o: alloc.h @@ -4203,6 +4484,7 @@ zmath.o: have_newstr.h zmath.o: have_stdlib.h zmath.o: have_string.h zmath.o: longbits.h +zmath.o: win32dll.h zmath.o: zmath.c zmath.o: zmath.h zmod.o: alloc.h @@ -4217,6 +4499,7 @@ zmod.o: have_string.h zmod.o: longbits.h zmod.o: nametype.h zmod.o: qmath.h +zmod.o: win32dll.h zmod.o: zmath.h zmod.o: zmod.c zmul.o: alloc.h @@ -4231,6 +4514,7 @@ zmul.o: have_string.h zmul.o: longbits.h zmul.o: nametype.h zmul.o: qmath.h +zmul.o: win32dll.h zmul.o: zmath.h zmul.o: zmul.c zprime.o: alloc.h @@ -4253,10 +4537,11 @@ zprime.o: md5.h zprime.o: nametype.h zprime.o: prime.h zprime.o: qmath.h -zprime.o: shs.h zprime.o: shs1.h +zprime.o: shs.h zprime.o: string.h zprime.o: value.h +zprime.o: win32dll.h zprime.o: zmath.h zprime.o: zprime.c zprime.o: zrand.h @@ -4276,15 +4561,6 @@ zrand.o: have_stdlib.h zrand.o: have_string.h zrand.o: longbits.h zrand.o: md5.h -zrand.o: nametype.h -zrand.o: qmath.h -zrand.o: shs.h -zrand.o: shs1.h -zrand.o: string.h -zrand.o: value.h -zrand.o: zmath.h -zrand.o: zrand.c -zrand.o: zrand.h zrandom.o: alloc.h zrandom.o: block.h zrandom.o: byteswap.h @@ -4303,10 +4579,21 @@ zrandom.o: longbits.h zrandom.o: md5.h zrandom.o: nametype.h zrandom.o: qmath.h -zrandom.o: shs.h zrandom.o: shs1.h +zrandom.o: shs.h zrandom.o: string.h zrandom.o: value.h +zrandom.o: win32dll.h zrandom.o: zmath.h zrandom.o: zrandom.c zrandom.o: zrandom.h +zrand.o: nametype.h +zrand.o: qmath.h +zrand.o: shs1.h +zrand.o: shs.h +zrand.o: string.h +zrand.o: value.h +zrand.o: win32dll.h +zrand.o: zmath.h +zrand.o: zrand.c +zrand.o: zrand.h diff --git a/README.WINDOWS b/README.WINDOWS index 888f590..7033e7a 100644 --- a/README.WINDOWS +++ b/README.WINDOWS @@ -64,7 +64,7 @@ People who maintain calc need to keep in mind the following: The following was added to opcodes.h, config.h, zmath.h and value.h: - #if defined (_WIN32) + #if defined(_WIN32) #ifdef _EXPORTING #define DLL __declspec(dllexport) #else @@ -102,8 +102,8 @@ was changed to: ## received a copy with calc; if not, write to Free Software Foundation, Inc. ## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. ## -## @(#) $Revision: 29.2 $ -## @(#) $Id: README.WINDOWS,v 29.2 2001/02/25 22:20:38 chongo Exp $ +## @(#) $Revision: 29.3 $ +## @(#) $Id: README.WINDOWS,v 29.3 2001/03/17 21:31:47 chongo Exp $ ## @(#) $Source: /usr/local/src/cmd/calc/RCS/README.WINDOWS,v $ ## ## Under source code control: 2001/02/25 14:00:05 diff --git a/calc.c b/calc.c index 71e78ba..a6a8b1e 100644 --- a/calc.c +++ b/calc.c @@ -19,8 +19,8 @@ * received a copy with calc; if not, write to Free Software Foundation, Inc. * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. * - * @(#) $Revision: 29.6 $ - * @(#) $Id: calc.c,v 29.6 2001/02/25 22:07:36 chongo Exp $ + * @(#) $Revision: 29.7 $ + * @(#) $Id: calc.c,v 29.7 2001/03/17 21:31:47 chongo Exp $ * @(#) $Source: /usr/local/src/cmd/calc/RCS/calc.c,v $ * * Under source code control: 1990/02/15 01:48:11 @@ -32,20 +32,25 @@ #include #include -#include + +#if !defined (_WIN32) +# include +#endif + #include #include -#if defined (_WIN32) -#include -/* - * getopt.h file is from the Cygwin GNU library +#if defined(_WIN32) +# include +/* + * getopt.h file is from the Cygwin GNU library * * See: * http://sources.redhat.com/cygwin/ */ -#include "../getopt/getopt.h" -#define strdup _strdup +# include "../getopt/getopt.h" +# define strdup _strdup +# define isatty _isatty #endif /* Windoz */ #define CALC_C @@ -61,6 +66,7 @@ #include "custom.h" #include "math_error.h" #include "args.h" +#include "zmath.h" #include "have_unistd.h" #if defined(HAVE_UNISTD_H) diff --git a/calc.h b/calc.h index 39533aa..5d1af3a 100644 --- a/calc.h +++ b/calc.h @@ -17,8 +17,8 @@ * received a copy with calc; if not, write to Free Software Foundation, Inc. * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. * - * @(#) $Revision: 29.5 $ - * @(#) $Id: calc.h,v 29.5 2000/12/04 19:32:33 chongo Exp $ + * @(#) $Revision: 29.6 $ + * @(#) $Id: calc.h,v 29.6 2001/03/17 21:31:47 chongo Exp $ * @(#) $Source: /usr/local/src/cmd/calc/RCS/calc.h,v $ * * Under source code control: 1990/02/15 01:48:31 @@ -32,9 +32,8 @@ #define __CALC_H__ #include - +#include "win32dll.h" #include "value.h" - #include "have_const.h" @@ -94,134 +93,140 @@ /* * File I/O routines. */ -extern FILEID openid(char *name, char *mode); -extern FILEID indexid(long index); -extern BOOL validid(FILEID id); -extern BOOL errorid(FILEID id); -extern BOOL eofid(FILEID id); -extern int closeid(FILEID id); -extern int getcharid(FILEID id); -extern int idprintf(FILEID id, char *fmt, int count, VALUE **vals); -extern int idfputc(FILEID id, int ch); -extern int idfputs(FILEID id, char *str); -extern int printid(FILEID id, int flags); -extern int flushid(FILEID id); -extern int readid(FILEID id, int flags, char **retptr); -extern int getloc(FILEID id, ZVALUE *loc); -extern int setloc(FILEID id, ZVALUE zpos); -extern int getsize(FILEID id, ZVALUE *size); -extern int get_device(FILEID id, ZVALUE *dev); -extern int get_inode(FILEID id, ZVALUE *ino); -extern FILEID reopenid(FILEID id, char *mode, char *name); -extern int closeall(void); -extern int flushall(void); -extern int idfputstr(FILEID id, char *str); -extern int rewindid(FILEID id); -extern void rewindall(void); -extern ZVALUE zfilesize(FILEID id); -extern void showfiles(void); -extern int fscanfid(FILEID id, char *fmt, int count, VALUE **vals); -extern int scanfstr(char *str, char *fmt, int count, VALUE **vals); -extern int ftellid(FILEID id, ZVALUE *res); -extern int fseekid(FILEID id, ZVALUE offset, int whence); -extern int isattyid(FILEID id); -extern int fsearch(FILEID id, char *str, ZVALUE start, ZVALUE end, ZVALUE *res); -extern int frsearch(FILEID id, char *str, ZVALUE first, ZVALUE last, ZVALUE *res); -extern void showconstants(void); -extern void freeconstant(unsigned long); -extern void freestringconstant(long); -extern void trimconstants(void); +extern DLL FILEID openid(char *name, char *mode); +extern DLL FILEID indexid(long index); +extern DLL BOOL validid(FILEID id); +extern DLL BOOL errorid(FILEID id); +extern DLL BOOL eofid(FILEID id); +extern DLL int closeid(FILEID id); +extern DLL int getcharid(FILEID id); +extern DLL int idprintf(FILEID id, char *fmt, int count, VALUE **vals); +extern DLL int idfputc(FILEID id, int ch); +extern DLL int idfputs(FILEID id, char *str); +extern DLL int printid(FILEID id, int flags); +extern DLL int flushid(FILEID id); +extern DLL int readid(FILEID id, int flags, char **retptr); +extern DLL int getloc(FILEID id, ZVALUE *loc); +extern DLL int setloc(FILEID id, ZVALUE zpos); +extern DLL int getsize(FILEID id, ZVALUE *size); +extern DLL int get_device(FILEID id, ZVALUE *dev); +extern DLL int get_inode(FILEID id, ZVALUE *ino); +extern DLL FILEID reopenid(FILEID id, char *mode, char *name); +extern DLL int closeall(void); + +#if !defined(_WIN32) +extern DLL int flushall(void); +#endif + +extern DLL int idfputstr(FILEID id, char *str); +extern DLL int rewindid(FILEID id); +extern DLL void rewindall(void); +extern DLL ZVALUE zfilesize(FILEID id); +extern DLL void showfiles(void); +extern DLL int fscanfid(FILEID id, char *fmt, int count, VALUE **vals); +extern DLL int scanfstr(char *str, char *fmt, int count, VALUE **vals); +extern DLL int ftellid(FILEID id, ZVALUE *res); +extern DLL int fseekid(FILEID id, ZVALUE offset, int whence); +extern DLL int isattyid(FILEID id); +extern DLL int fsearch(FILEID id, char *str, ZVALUE start, ZVALUE end, ZVALUE *res); +extern DLL int frsearch(FILEID id, char *str, ZVALUE first, ZVALUE last, ZVALUE *res); +extern DLL void showconstants(void); +extern DLL void freeconstant(unsigned long); +extern DLL void freestringconstant(long); +extern DLL void trimconstants(void); /* * Input routines. */ -extern int openstring(char *str, long num); -extern int openterminal(void); -extern int opensearchfile(char *name, char *pathlist, char *exten, int reopen_ok); -extern char *nextline(void); -extern int nextchar(void); -extern void reread(void); -extern void resetinput(void); -extern void setprompt(char *); -extern BOOL inputisterminal(void); -extern int inputlevel(void); -extern long calclevel(void); -extern char *inputname(void); -extern long linenumber(void); -extern void runrcfiles(void); -extern void closeinput(void); +extern DLL int openstring(char *str, long num); +extern DLL int openterminal(void); +extern DLL int opensearchfile(char *name, char *pathlist, char *exten, int reopen_ok); +extern DLL char *nextline(void); +extern DLL int nextchar(void); +extern DLL void reread(void); +extern DLL void resetinput(void); +extern DLL void setprompt(char *); +extern DLL BOOL inputisterminal(void); +extern DLL int inputlevel(void); +extern DLL long calclevel(void); +extern DLL char *inputname(void); +extern DLL long linenumber(void); +extern DLL void runrcfiles(void); +extern DLL void closeinput(void); /* * Other routines. */ -extern NUMBER *constvalue(unsigned long index); -extern long addnumber(char *str); -extern long addqconstant(NUMBER *q); -extern void initstack(void); -extern void getcommands(BOOL toplevel); -extern void givehelp(char *type); -extern void libcalc_call_me_first(void); -extern void libcalc_call_me_last(void); -extern BOOL calc_tty(int fd); -extern BOOL orig_tty(int fd); -extern void showerrors(void); -extern char *calc_strdup(CONST char *); +extern DLL NUMBER *constvalue(unsigned long index); +extern DLL long addnumber(char *str); +extern DLL long addqconstant(NUMBER *q); +extern DLL void initstack(void); +extern DLL void getcommands(BOOL toplevel); +extern DLL void givehelp(char *type); +extern DLL void libcalc_call_me_first(void); +extern DLL void libcalc_call_me_last(void); +extern DLL BOOL calc_tty(int fd); +extern DLL BOOL orig_tty(int fd); +extern DLL void showerrors(void); +extern DLL char *calc_strdup(CONST char *); /* * Initialization */ -extern void initialize(void); -extern void reinitialize(void); -extern int isatty(int tty); /* TRUE if fd is a tty */ -extern char *version(void); /* return version string */ -extern int post_init; /* TRUE => setjmp for math_error is ready */ +extern DLL void initialize(void); +extern DLL void reinitialize(void); +#if !defined (_WIN32) +extern DLL int isatty(int tty); /* TRUE if fd is a tty */ +#endif +extern DLL char *version(void); /* return version string */ +extern DLL int post_init; /* TRUE => math_error setjmp is ready */ /* * global flags and definitions */ -extern int abortlevel; /* current level of aborts */ -extern BOOL inputwait; /* TRUE if in a terminal input wait */ -extern jmp_buf jmpbuf; /* for errors */ +extern DLL int abortlevel; /* current level of aborts */ +extern DLL BOOL inputwait; /* TRUE if in a terminal input wait */ +extern DLL jmp_buf jmpbuf; /* for errors */ -extern int p_flag; /* TRUE => pipe mode */ -extern int q_flag; /* TRUE => don't execute rc files */ -extern int u_flag; /* TRUE => unbuffer stdin and stdout */ -extern int d_flag; /* TRUE => disable heading, resource_debug */ -extern int c_flag; /* TRUE => continue after error if permitted */ -extern int i_flag; /* TRUE => try to go interactive after error */ -extern int s_flag; /* TRUE => keep args as strings for argv() */ -extern int stoponerror; /* >0 => stop, <0 => continue, ==0 => use -c */ -extern BOOL abort_now; /* TRUE => try to go interactive */ +extern DLL int p_flag; /* TRUE => pipe mode */ +extern DLL int q_flag; /* TRUE => don't execute rc files */ +extern DLL int u_flag; /* TRUE => unbuffer stdin and stdout */ +extern DLL int d_flag; /* TRUE => disable heading, resource_debug */ +extern DLL int c_flag; /* TRUE => continue after error if permitted */ +extern DLL int i_flag; /* TRUE => try to go interactive after error */ +extern DLL int s_flag; /* TRUE => keep args as strings for argv() */ +extern DLL int stoponerror; /* >0 => stop, <0 => continue, ==0 => use -c */ +extern DLL BOOL abort_now; /* TRUE => try to go interactive */ -extern int argc_value; /* count of argv[] strings for argv() builtin */ -extern char **argv_value; /* argv[] strings for argv() builtin */ +extern DLL int argc_value; /* count of argv[] strings for argv() builtin */ +extern DLL char **argv_value; /* argv[] strings for argv() builtin */ -extern char *pager; /* $PAGER or default */ -extern int stdin_tty; /* TRUE if stdin is a tty */ -extern int havecommands; /* TRUE if have cmd args) */ -extern char *program; /* our name */ -extern char *base_name; /* basename of our name */ -extern char cmdbuf[]; /* command line expression */ +extern DLL char *pager; /* $PAGER or default */ +extern DLL int stdin_tty; /* TRUE if stdin is a tty */ +extern DLL int havecommands; /* TRUE if have cmd args) */ +extern DLL char *program; /* our name */ +extern DLL char *base_name; /* basename of our name */ +extern DLL char cmdbuf[]; /* command line expression */ -extern int abortlevel; /* current level of aborts */ -extern BOOL inputwait; /* TRUE if in a terminal input wait */ -extern VALUE *stack; /* execution stack */ -extern int dumpnames; /* TRUE => dump names rather than indices */ +extern DLL int abortlevel; /* current level of aborts */ +extern DLL BOOL inputwait; /* TRUE if in a terminal input wait */ +extern DLL VALUE *stack; /* execution stack */ +extern DLL int dumpnames; /* TRUE => dump names rather than indices */ -extern char *calcpath; /* $CALCPATH or default */ -extern char *calcrc; /* $CALCRC or default */ -extern char *calcbindings; /* $CALCBINDINGS or default */ -extern char *home; /* $HOME or default */ -extern char *shell; /* $SHELL or default */ -extern char *program; /* our name (argv[0]) */ +extern DLL char *calcpath; /* $CALCPATH or default */ +extern DLL char *calcrc; /* $CALCRC or default */ +extern DLL char *calcbindings; /* $CALCBINDINGS or default */ +extern DLL char *home; /* $HOME or default */ +extern DLL char *shell; /* $SHELL or default */ +extern DLL char *program; /* our name (argv[0]) */ -extern int no_env; /* TRUE (-e) => ignore env vars on startup */ -extern int errmax; /* if >= 0, error when errcount exceeds errmax */ -extern int new_std; /* TRUE (-n) => use newstd configuration */ +extern DLL int no_env; /* TRUE (-e) => ignore env vars on startup */ +extern DLL int errmax; /* if >= 0, error when errcount exceeds errmax */ +extern DLL int new_std; /* TRUE (-n) => use newstd configuration */ -extern int allow_read; /* FALSE => may not open any files for reading */ -extern int allow_write; /* FALSE => may not open any files for writing */ -extern int allow_exec; /* FALSE => may not execute any commands */ +extern DLL int allow_read; /* FALSE => dont open any files for reading */ +extern DLL int allow_write; /* FALSE => dont open any files for writing */ +extern DLL int allow_exec; /* FALSE => may not execute any commands */ /* * calc startup and run state @@ -237,8 +242,8 @@ typedef enum { RUN_EXIT, /* normal exit from calc */ RUN_EXIT_WITH_ERROR /* exit with error */ } run; -extern run run_state; -extern char *run_state_name(run state); +extern DLL run run_state; +extern DLL char *run_state_name(run state); /* * calc version information @@ -249,7 +254,7 @@ extern int calc_minor_ver; extern int calc_major_patch; extern char *calc_minor_patch; extern char *Copyright; -extern char *version(void); +extern DLL char *version(void); #endif /* !__CALC_H__ */ diff --git a/codegen.c b/codegen.c index 5745267..d5b9e9e 100644 --- a/codegen.c +++ b/codegen.c @@ -19,8 +19,8 @@ * received a copy with calc; if not, write to Free Software Foundation, Inc. * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. * - * @(#) $Revision: 29.3 $ - * @(#) $Id: codegen.c,v 29.3 2000/07/17 15:35:49 chongo Exp $ + * @(#) $Revision: 29.4 $ + * @(#) $Id: codegen.c,v 29.4 2001/03/17 21:31:47 chongo Exp $ * @(#) $Source: /usr/local/src/cmd/calc/RCS/codegen.c,v $ * * Under source code control: 1990/02/15 01:48:13 @@ -45,6 +45,10 @@ #include "func.h" #include "conf.h" +#if defined(_WIN32) +# include +#endif + static BOOL rdonce; /* TRUE => do not reread this file */ FUNC *curfunc; diff --git a/config.h b/config.h index 276dffa..6fe46a2 100644 --- a/config.h +++ b/config.h @@ -19,8 +19,8 @@ * received a copy with calc; if not, write to Free Software Foundation, Inc. * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. * - * @(#) $Revision: 29.5 $ - * @(#) $Id: config.h,v 29.5 2001/02/25 22:07:36 chongo Exp $ + * @(#) $Revision: 29.6 $ + * @(#) $Id: config.h,v 29.6 2001/03/17 21:31:47 chongo Exp $ * @(#) $Source: /usr/local/src/cmd/calc/RCS/config.h,v $ * * Under source code control: 1995/11/01 22:20:17 @@ -35,20 +35,7 @@ #define __CONFIG_H__ -#if defined (_WIN32) -#ifdef _EXPORTING - #define DLL __declspec(dllexport) -#else - #define DLL __declspec(dllimport) -#endif - -#else /* Windoz free systems */ - - #define DLL - -#endif /* Windoz free systems */ - - +#include "win32dll.h" #include "nametype.h" #include "qmath.h" @@ -196,23 +183,23 @@ typedef struct config CONFIG; /* * global configuration states and aliases */ -extern CONFIG *conf; /* current configuration */ -extern CONFIG oldstd; /* backward compatible standard configuration */ -extern CONFIG newstd; /* new non-backward compatible configuration */ -extern char *calc_debug; /* !=NULL => value of config("calc_debug") */ -extern char *resource_debug; /* !=NULL => config("resource_debug") value */ -extern char *user_debug; /* !=NULL => value of config("user_debug") */ +extern DLL CONFIG *conf; /* current configuration */ +extern DLL CONFIG oldstd; /* backward compatible standard configuration */ +extern DLL CONFIG newstd; /* new non-backward compatible configuration */ +extern DLL char *calc_debug; /* !=NULL => value of config("calc_debug") */ +extern DLL char *resource_debug; /* !=NULL => config("resource_debug") value */ +extern DLL char *user_debug; /* !=NULL => value of config("user_debug") */ /* * configuration externals */ -DLL extern CONFIG *config_copy(CONFIG *src); -DLL extern void config_free(CONFIG *cfg); -DLL extern void config_print(CONFIG *cfg); -DLL extern int configtype(char*); -DLL extern void config_print(CONFIG*); -DLL extern BOOL config_cmp(CONFIG*, CONFIG*); +extern DLL CONFIG *config_copy(CONFIG *src); +extern DLL void config_free(CONFIG *cfg); +extern DLL void config_print(CONFIG *cfg); +extern DLL int configtype(char*); +extern DLL void config_print(CONFIG*); +extern DLL BOOL config_cmp(CONFIG*, CONFIG*); #endif /* !__CONFIG_H__ */ diff --git a/custom.c b/custom.c index 37593da..c1d8deb 100644 --- a/custom.c +++ b/custom.c @@ -17,8 +17,8 @@ * received a copy with calc; if not, write to Free Software Foundation, Inc. * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. * - * @(#) $Revision: 29.2 $ - * @(#) $Id: custom.c,v 29.2 2000/06/07 14:02:13 chongo Exp $ + * @(#) $Revision: 29.3 $ + * @(#) $Id: custom.c,v 29.3 2001/03/17 21:31:47 chongo Exp $ * @(#) $Source: /usr/local/src/cmd/calc/RCS/custom.c,v $ * * Under source code control: 1997/03/03 04:53:08 @@ -34,11 +34,10 @@ #include "value.h" #include "custom.h" +#include #if defined(CUSTOM) -#include - #include "calc.h" #include "have_string.h" diff --git a/custom/Makefile b/custom/Makefile index c35f109..22f29e0 100644 --- a/custom/Makefile +++ b/custom/Makefile @@ -18,8 +18,8 @@ # received a copy with calc; if not, write to Free Software Foundation, Inc. # 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. # -# @(#) $Revision: 29.3 $ -# @(#) $Id: Makefile,v 29.3 2000/12/17 12:28:15 chongo Exp $ +# @(#) $Revision: 29.5 $ +# @(#) $Id: Makefile,v 29.5 2001/03/17 21:39:24 chongo Exp $ # @(#) $Source: /usr/local/src/cmd/calc/custom/RCS/Makefile,v $ # # Under source code control: 1997/03/09 02:28:54 @@ -460,7 +460,7 @@ clean: clobber: -rm -f ${TARGETS} - rm -f .all Makefile.tmp + rm -f .all Makefile.tmp Makefile.bak install: all -${Q}if [ ! -d ${TOPDIR} ]; then \ @@ -537,11 +537,13 @@ install: all # DO NOT DELETE THIS LINE + c_argv.o: ../alloc.h c_argv.o: ../block.h c_argv.o: ../byteswap.h -c_argv.o: ../calc.h c_argv.o: ../calcerr.h +c_argv.o: ../calc.h +c_argv.o: c_argv.c c_argv.o: ../cmath.h c_argv.o: ../config.h c_argv.o: ../custom.h @@ -557,16 +559,17 @@ c_argv.o: ../longbits.h c_argv.o: ../md5.h c_argv.o: ../nametype.h c_argv.o: ../qmath.h -c_argv.o: ../shs.h c_argv.o: ../shs1.h +c_argv.o: ../shs.h c_argv.o: ../string.h c_argv.o: ../value.h +c_argv.o: ../win32dll.h c_argv.o: ../zmath.h -c_argv.o: c_argv.c c_devnull.o: ../alloc.h c_devnull.o: ../block.h c_devnull.o: ../byteswap.h c_devnull.o: ../calcerr.h +c_devnull.o: c_devnull.c c_devnull.o: ../cmath.h c_devnull.o: ../config.h c_devnull.o: ../custom.h @@ -582,16 +585,17 @@ c_devnull.o: ../longbits.h c_devnull.o: ../md5.h c_devnull.o: ../nametype.h c_devnull.o: ../qmath.h -c_devnull.o: ../shs.h c_devnull.o: ../shs1.h +c_devnull.o: ../shs.h c_devnull.o: ../string.h c_devnull.o: ../value.h +c_devnull.o: ../win32dll.h c_devnull.o: ../zmath.h -c_devnull.o: c_devnull.c c_help.o: ../alloc.h c_help.o: ../block.h c_help.o: ../byteswap.h c_help.o: ../calcerr.h +c_help.o: c_help.c c_help.o: ../cmath.h c_help.o: ../config.h c_help.o: ../custom.h @@ -607,18 +611,19 @@ c_help.o: ../longbits.h c_help.o: ../md5.h c_help.o: ../nametype.h c_help.o: ../qmath.h -c_help.o: ../shs.h c_help.o: ../shs1.h +c_help.o: ../shs.h c_help.o: ../string.h c_help.o: ../value.h +c_help.o: ../win32dll.h c_help.o: ../zmath.h -c_help.o: c_help.c c_pzasusb8.o: ../alloc.h c_pzasusb8.o: ../block.h c_pzasusb8.o: ../byteswap.h c_pzasusb8.o: ../calcerr.h c_pzasusb8.o: ../cmath.h c_pzasusb8.o: ../config.h +c_pzasusb8.o: c_pzasusb8.c c_pzasusb8.o: ../custom.h c_pzasusb8.o: ../endian_calc.h c_pzasusb8.o: ../hash.h @@ -632,20 +637,21 @@ c_pzasusb8.o: ../longbits.h c_pzasusb8.o: ../md5.h c_pzasusb8.o: ../nametype.h c_pzasusb8.o: ../qmath.h -c_pzasusb8.o: ../shs.h c_pzasusb8.o: ../shs1.h +c_pzasusb8.o: ../shs.h c_pzasusb8.o: ../string.h c_pzasusb8.o: ../value.h +c_pzasusb8.o: ../win32dll.h c_pzasusb8.o: ../zmath.h -c_pzasusb8.o: c_pzasusb8.c c_sysinfo.o: ../alloc.h c_sysinfo.o: ../block.h c_sysinfo.o: ../byteswap.h -c_sysinfo.o: ../calc.h c_sysinfo.o: ../calcerr.h +c_sysinfo.o: ../calc.h c_sysinfo.o: ../cmath.h c_sysinfo.o: ../conf.h c_sysinfo.o: ../config.h +c_sysinfo.o: c_sysinfo.c c_sysinfo.o: ../custom.h c_sysinfo.o: ../endian_calc.h c_sysinfo.o: ../fposval.h @@ -663,14 +669,14 @@ c_sysinfo.o: ../md5.h c_sysinfo.o: ../nametype.h c_sysinfo.o: ../prime.h c_sysinfo.o: ../qmath.h -c_sysinfo.o: ../shs.h c_sysinfo.o: ../shs1.h +c_sysinfo.o: ../shs.h c_sysinfo.o: ../string.h c_sysinfo.o: ../value.h +c_sysinfo.o: ../win32dll.h c_sysinfo.o: ../zmath.h c_sysinfo.o: ../zrand.h c_sysinfo.o: ../zrandom.h -c_sysinfo.o: c_sysinfo.c custtbl.o: ../alloc.h custtbl.o: ../block.h custtbl.o: ../byteswap.h @@ -678,6 +684,7 @@ custtbl.o: ../calcerr.h custtbl.o: ../cmath.h custtbl.o: ../config.h custtbl.o: ../custom.h +custtbl.o: custtbl.c custtbl.o: ../endian_calc.h custtbl.o: ../hash.h custtbl.o: ../have_const.h @@ -690,9 +697,9 @@ custtbl.o: ../longbits.h custtbl.o: ../md5.h custtbl.o: ../nametype.h custtbl.o: ../qmath.h -custtbl.o: ../shs.h custtbl.o: ../shs1.h +custtbl.o: ../shs.h custtbl.o: ../string.h custtbl.o: ../value.h +custtbl.o: ../win32dll.h custtbl.o: ../zmath.h -custtbl.o: custtbl.c diff --git a/endian.c b/endian.c index c3d81af..751d50c 100644 --- a/endian.c +++ b/endian.c @@ -17,8 +17,8 @@ * received a copy with calc; if not, write to Free Software Foundation, Inc. * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. * - * @(#) $Revision: 29.2 $ - * @(#) $Id: endian.c,v 29.2 2000/06/07 14:02:13 chongo Exp $ + * @(#) $Revision: 29.3 $ + * @(#) $Id: endian.c,v 29.3 2001/03/18 02:59:42 chongo Exp $ * @(#) $Source: /usr/local/src/cmd/calc/RCS/endian.c,v $ * * Under source code control: 1993/11/15 04:32:58 @@ -48,8 +48,10 @@ char byte[8] = { (char)0x12, (char)0x36, (char)0x48, (char)0x59, int main(void) { +#if !defined(LITTLE_ENDIAN) && !defined(BIG_ENDIAN) /* pointers into the byte order array */ int *intp = (int *)byte; +#endif #if defined(DEBUG) short *shortp = (short *)byte; long *longp = (long *)byte; @@ -69,6 +71,11 @@ main(void) printf("#define BIG_ENDIAN\t4321\n"); printf("#define LITTLE_ENDIAN\t1234\n"); +#if defined(LITTLE_ENDIAN) + printf("#define CALC_BYTE_ORDER\tLITTLE_ENDIAN\n"); +#elif defined(BIG_ENDIAN) + printf("#define CALC_BYTE_ORDER\tBIG_ENDIAN\n"); +#else /* Determine byte order */ if (intp[0] == 0x12364859) { /* Most Significant Byte first */ @@ -81,6 +88,7 @@ main(void) "Unknown int Byte Order, set CALC_BYTE_ORDER in Makefile\n"); exit(1); } +#endif /* exit(0); */ return 0; } diff --git a/file.c b/file.c index d801a68..513a3a6 100644 --- a/file.c +++ b/file.c @@ -19,8 +19,8 @@ * received a copy with calc; if not, write to Free Software Foundation, Inc. * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. * - * @(#) $Revision: 29.5 $ - * @(#) $Id: file.c,v 29.5 2001/02/25 22:07:36 chongo Exp $ + * @(#) $Revision: 29.6 $ + * @(#) $Id: file.c,v 29.6 2001/03/17 21:31:47 chongo Exp $ * @(#) $Source: /usr/local/src/cmd/calc/RCS/file.c,v $ * * Under source code control: 1991/07/20 00:21:56 @@ -37,7 +37,7 @@ #include #include "have_unistd.h" #if defined(HAVE_UNISTD_H) -#include +# include #endif /* HAVE_UNISTD_H */ #include #include "calc.h" @@ -48,6 +48,10 @@ #include "file.h" #include "calcerr.h" +#if defined(_WIN32) +# include +#endif + #define READSIZE 1024 /* buffer size for reading */ /* @@ -540,6 +544,7 @@ flushid(FILEID id) } +#if !defined(_WIN32) int flushall(void) { @@ -555,6 +560,7 @@ flushall(void) } return err; } +#endif /* Windoz free systems */ /* diff --git a/fposval.c b/fposval.c index 837ac2b..1c2fc87 100644 --- a/fposval.c +++ b/fposval.c @@ -17,8 +17,8 @@ * received a copy with calc; if not, write to Free Software Foundation, Inc. * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. * - * @(#) $Revision: 29.5 $ - * @(#) $Id: fposval.c,v 29.5 2001/02/25 21:01:34 chongo Exp $ + * @(#) $Revision: 29.6 $ + * @(#) $Id: fposval.c,v 29.6 2001/03/18 03:01:41 chongo Exp $ * @(#) $Source: /usr/local/src/cmd/calc/RCS/fposval.c,v $ * * Under source code control: 1994/11/05 03:19:52 @@ -87,7 +87,11 @@ main(int argc, char **argv) #if defined(HAVE_FPOS_POS) fileposlen = FPOS_POS_BITS; #else /* ! HAVE_FPOS_POS */ +# if defined(FPOS_BITS) + fileposlen = FPOS_BITS; +# else fileposlen = sizeof(FILEPOS)*8; +# endif #endif /* ! HAVE_FPOS_POS */ printf("#undef FILEPOS_BITS\n"); printf("#define FILEPOS_BITS %d\n", fileposlen); @@ -127,7 +131,11 @@ main(int argc, char **argv) /* * print the stat file size information */ +#if defined(OFF_T_BITS) + stsizelen = OFF_T_BITS; +#else stsizelen = sizeof(buf.st_size)*8; +#endif printf("#undef OFF_T_BITS\n"); printf("#define OFF_T_BITS %d\n", stsizelen); #if CALC_BYTE_ORDER == BIG_ENDIAN @@ -161,7 +169,7 @@ main(int argc, char **argv) * systems, a off_t is not a scalar hince we must memcpy. */ printf("#define SWAP_HALF_IN_OFF_T(dest, src)\t%s%d%s\n", - "memcpy((void *)(dest), (void *)(src), sizeof(",stsizelen,"))"); + "memcpy((void *)(dest), (void *)(src), ", stsizelen/8, ")"); #endif /* HAVE_OFF_T_SCALAR */ #endif /* CALC_BYTE_ORDER == BIG_ENDIAN */ putchar('\n'); @@ -169,7 +177,11 @@ main(int argc, char **argv) /* * print the dev_t size */ +#if defined(DEV_BITS) + devlen = DEV_BITS; +#else devlen = sizeof(buf.st_dev)*8; +#endif printf("#undef DEV_BITS\n"); printf("#define DEV_BITS %d\n", devlen); #if CALC_BYTE_ORDER == BIG_ENDIAN @@ -198,14 +210,18 @@ main(int argc, char **argv) * systems, a DEV is not a scalar hince we must memcpy. */ printf("#define SWAP_HALF_IN_DEV(dest, src)\t%s%d%s\n", - "memcpy((void *)(dest), (void *)(src), sizeof(",devlen,"))"); + "memcpy((void *)(dest), (void *)(src), ", devlen/8, ")"); #endif /* CALC_BYTE_ORDER == BIG_ENDIAN */ putchar('\n'); /* * print the ino_t size */ +#if defined(INODE_BITS) + inodelen = INODE_BITS; +#else inodelen = sizeof(buf.st_ino)*8; +#endif printf("#undef INODE_BITS\n"); printf("#define INODE_BITS %d\n", inodelen); #if CALC_BYTE_ORDER == BIG_ENDIAN @@ -234,7 +250,7 @@ main(int argc, char **argv) * systems, a INODE is not a scalar hince we must memcpy. */ printf("#define SWAP_HALF_IN_INODE(dest, src)\t%s%d%s\n", - "memcpy((void *)(dest), (void *)(src), sizeof(",inodelen,"))"); + "memcpy((void *)(dest), (void *)(src), ", inodelen/8, ")"); #endif /* CALC_BYTE_ORDER == BIG_ENDIAN */ /* exit(0); */ return 0; diff --git a/func.c b/func.c index cad9b41..2f0736a 100644 --- a/func.c +++ b/func.c @@ -19,8 +19,8 @@ * received a copy with calc; if not, write to Free Software Foundation, Inc. * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. * - * @(#) $Revision: 29.6 $ - * @(#) $Id: func.c,v 29.6 2001/02/25 22:07:36 chongo Exp $ + * @(#) $Revision: 29.7 $ + * @(#) $Id: func.c,v 29.7 2001/03/17 21:31:47 chongo Exp $ * @(#) $Source: /usr/local/src/cmd/calc/RCS/func.c,v $ * * Under source code control: 1990/02/15 01:48:15 @@ -36,9 +36,9 @@ #include #if defined(_WIN32) -#include -#define _access access -#endif /* Windoz */ +# include +# define _access access +#endif #if defined(FUNCLIST) @@ -6894,7 +6894,16 @@ f_system(VALUE *vp) if (conf->calc_debug & CALCDBG_SYSTEM) { printf("%s\n", vp->v_str->s_str); } - result.v_num = itoq((long) system(vp->v_str->s_str)); +#if defined(_WIN32) + /* if the execute length is 0 then use NULL in system call */ + if (strlen(vp->v_str->s_str) == 0) { + result.v_num = itoq((long)system(NULL)); + } else { + result.v_num = itoq((long)system(vp->v_str->s_str)); + } +#else /* Windoz free systems */ + result.v_num = itoq((long)system(vp->v_str->s_str)); +#endif /* Windoz free systems */ return result; } @@ -6907,6 +6916,7 @@ f_sleep(int count, VALUE **vals) NUMBER *q1, *q2; res.v_type = V_NULL; +#if !defined(_WIN32) if (count > 0) { if (vals[0]->v_type != V_NUM || qisneg(vals[0]->v_num)) return error_value(E_SLEEP); @@ -6937,6 +6947,7 @@ f_sleep(int count, VALUE **vals) res.v_type = V_NUM; res.v_num = itoq(time); } +#endif /* Windoz free systems */ return res; } diff --git a/have_fpos_pos.c b/have_fpos_pos.c index 9d8269b..ac85553 100644 --- a/have_fpos_pos.c +++ b/have_fpos_pos.c @@ -17,8 +17,8 @@ * received a copy with calc; if not, write to Free Software Foundation, Inc. * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. * - * @(#) $Revision: 29.1 $ - * @(#) $Id: have_fpos_pos.c,v 29.1 2000/12/17 11:25:22 chongo Exp $ + * @(#) $Revision: 29.2 $ + * @(#) $Id: have_fpos_pos.c,v 29.2 2001/03/18 03:00:11 chongo Exp $ * @(#) $Source: /usr/local/src/cmd/calc/RCS/have_fpos_pos.c,v $ * * Under source code control: 2000/12/17 01:23 @@ -51,8 +51,17 @@ main(void) printf("#define HAVE_FPOS_POS 1 /* yes */\n\n"); /* determine __pos element size */ - printf("#undef FPOS_POS_BITS\n"); + printf("#undef FPOS_POS_BITS\t/* no */\n"); +# if defined(FPOS_POS_BITS) + printf("#define FPOS_POS_BITS %d\n\n", FPOS_POS_BITS); +# else printf("#define FPOS_POS_BITS %d\n\n", sizeof(pos.__pos)*8); +# endif + +#else + /* we have no __pos element */ + printf("#undef HAVE_FPOS_POS\t/* no */\n"); + printf("#undef FPOS_POS_BITS\n"); #endif /* exit(0); */ return 0; diff --git a/help.c b/help.c index 9a690ab..5711fc1 100644 --- a/help.c +++ b/help.c @@ -17,8 +17,8 @@ * received a copy with calc; if not, write to Free Software Foundation, Inc. * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. * - * @(#) $Revision: 29.5 $ - * @(#) $Id: help.c,v 29.5 2001/02/25 22:07:36 chongo Exp $ + * @(#) $Revision: 29.6 $ + * @(#) $Id: help.c,v 29.6 2001/03/17 21:31:47 chongo Exp $ * @(#) $Source: /usr/local/src/cmd/calc/RCS/help.c,v $ * * Under source code control: 1997/09/14 10:58:30 @@ -42,6 +42,11 @@ #include #endif +#if defined(_WIN32) +# define popen _popen +# define pclose _pclose +#endif + /* * some help topics are symbols, so we alias them to nice filenames diff --git a/hist.c b/hist.c index b6ae454..dfb5ca5 100644 --- a/hist.c +++ b/hist.c @@ -17,8 +17,8 @@ * received a copy with calc; if not, write to Free Software Foundation, Inc. * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. * - * @(#) $Revision: 29.2 $ - * @(#) $Id: hist.c,v 29.2 2000/06/07 14:02:13 chongo Exp $ + * @(#) $Revision: 29.3 $ + * @(#) $Id: hist.c,v 29.3 2001/03/17 21:31:47 chongo Exp $ * @(#) $Source: /usr/local/src/cmd/calc/RCS/hist.c,v $ * * Under source code control: 1993/05/02 20:09:19 @@ -40,7 +40,9 @@ #include #include -#include +#if !defined(_WIN32) +# include +#endif #include "have_unistd.h" #if defined(HAVE_UNISTD_H) diff --git a/hist.h b/hist.h index 04e2d7b..155def0 100644 --- a/hist.h +++ b/hist.h @@ -17,8 +17,8 @@ * received a copy with calc; if not, write to Free Software Foundation, Inc. * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. * - * @(#) $Revision: 29.2 $ - * @(#) $Id: hist.h,v 29.2 2000/06/07 14:02:13 chongo Exp $ + * @(#) $Revision: 29.3 $ + * @(#) $Id: hist.h,v 29.3 2001/03/17 21:31:47 chongo Exp $ * @(#) $Source: /usr/local/src/cmd/calc/RCS/hist.h,v $ * * Under source code control: 1993/05/02 20:09:20 @@ -64,10 +64,10 @@ #define HIST_NOTTY 3 /* terminal modes could not be set */ -extern int hist_init(char *filename); -extern void hist_term(void); -extern int hist_getline(char *prompt, char *buf, int len); -extern void hist_saveline(char *line, int len); +extern DLL int hist_init(char *filename); +extern DLL void hist_term(void); +extern DLL int hist_getline(char *prompt, char *buf, int len); +extern DLL void hist_saveline(char *line, int len); #endif /* !__HIST_H__ */ diff --git a/input.c b/input.c index bd02269..05edcf0 100644 --- a/input.c +++ b/input.c @@ -17,8 +17,8 @@ * received a copy with calc; if not, write to Free Software Foundation, Inc. * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. * - * @(#) $Revision: 29.4 $ - * @(#) $Id: input.c,v 29.4 2001/02/25 22:07:36 chongo Exp $ + * @(#) $Revision: 29.5 $ + * @(#) $Id: input.c,v 29.5 2001/03/17 21:31:47 chongo Exp $ * @(#) $Source: /usr/local/src/cmd/calc/RCS/input.c,v $ * * Under source code control: 1990/02/15 01:48:16 @@ -36,8 +36,8 @@ #include #include #if !defined(_WIN32) -#include -#endif /* Windoz free systems */ +# include +#endif #include #include @@ -259,7 +259,7 @@ opensearchfile(char *name, char *pathlist, char *extension, int rd_once) static char * homeexpand(char *name) { -#if defined (_WIN32) +#if defined(_WIN32) return NULL; @@ -804,6 +804,15 @@ runrcfiles(void) * This function returns the index of the readset element that matches * a given device/inode, -1 otherwise. * + * + * WIN32 NOTE: + * + * This function does not work under WIN32. The sbuf->st_ino is always + * zero because the FAT and NTFS filesystems do not support inodes. + * They also don't support links, which is why you need this function + * under UNIX. For WIN32, use _fullpath() to determine if you have + * already opened a file. + * * given: * sbuf stat of the inode in question */ @@ -811,6 +820,9 @@ static int isinoderead(struct stat *sbuf) { int i; +#if defined(_WIN32) + char fullpathname[_MAX_PATH]; +#endif /* deal with the empty case */ if (readset == NULL || maxreadset <= 0) { @@ -820,12 +832,22 @@ isinoderead(struct stat *sbuf) /* scan the entire readset */ for (i=0; i < maxreadset; ++i) { +#if defined(_WIN32) + if (readset[i].active && + strcmp(readset[i].path, + _fullpath(fullpathname,cip->i_name, + _MAX_PATH)) == 0) { + /* found a match */ + return i; + } +#else /* Windoz free systems */ if (readset[i].active && sbuf->st_dev == readset[i].inode.st_dev && sbuf->st_ino == readset[i].inode.st_ino) { /* found a match */ return i; } +#endif /* Windoz free systems */ } /* no match found */ @@ -932,11 +954,21 @@ addreadset(char *name, char *path, struct stat *sbuf) return -1; } strcpy(readset[ret].name, name); +#if defined(_WIN32) + /* + * For WIN32, _fullpath expands the path to a fully qualified + * path name, which under WIN32 FAT and NTFS is unique, just + * like UNIX inodes. _fullpath also allocated the memory for + * this new longer path name. + */ + readset[ret].path = _fullpath(NULL, path, 0); +#else /* Windoz free systems */ readset[ret].path = (char *)malloc(strlen(path)+1); if (readset[ret].path == NULL) { return -1; } strcpy(readset[ret].path, path); +#endif /* Windoz free systems */ readset[ret].inode = *sbuf; readset[ret].active = 1; diff --git a/lib_calc.c b/lib_calc.c index 6a861bb..948d9e1 100644 --- a/lib_calc.c +++ b/lib_calc.c @@ -17,8 +17,8 @@ * received a copy with calc; if not, write to Free Software Foundation, Inc. * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. * - * @(#) $Revision: 29.5 $ - * @(#) $Id: lib_calc.c,v 29.5 2001/02/25 22:07:36 chongo Exp $ + * @(#) $Revision: 29.6 $ + * @(#) $Id: lib_calc.c,v 29.6 2001/03/17 21:31:47 chongo Exp $ * @(#) $Source: /usr/local/src/cmd/calc/RCS/lib_calc.c,v $ * * Under source code control: 1996/06/17 18:06:19 @@ -32,7 +32,10 @@ #include #include #include -#include + +#if !defined(_WIN32) +# include +#endif #include "calc.h" #include "zmath.h" @@ -63,7 +66,7 @@ # include typedef struct termios ttystruct; -#elif defined(USE_TERMIOS) +#elif defined(USE_TERMIO) # include typedef struct termio ttystruct; @@ -73,12 +76,20 @@ typedef struct termio ttystruct; # include typedef struct sgttyb ttystruct; -#elif !defined(_WIN32) +#else + +typedef struct {int fd;} ttystruct; + +#endif + +#if !defined(_WIN32) +# if !defined(USE_SGTTY) && !defined (USE_TERMIOS) && !defined(USE_TERMIO) -=*#*=- A Windoz free system without termio, termios or sgtty!!! -=*#*=- -=*#*=- We do not know how to compile for such a host, sorry!!!! -=*#*=- -#endif +# endif +#endif /* Windoz */ /* * in case we do not have certain .h files @@ -199,7 +210,7 @@ libcalc_call_me_first(void) */ #if !defined(_WIN32) (void) signal(SIGPIPE, SIG_IGN); -#endif /* Windoz free systems */ +#endif /* * determine the basename @@ -382,7 +393,7 @@ initenv(void) { #if !defined(_WIN32) struct passwd *ent; /* our password entry */ -#endif /* Windoz free systems */ +#endif char *c; /* determine the $CALCPATH value */ @@ -742,7 +753,7 @@ calc_tty(int fd) printf("calc_tty: stty -ECHO -ECHOE -ECHOK -ICANON +ISTRIP " "VMIN=1 VTIME=0: fd %d\n", fd); -#else /* assume USE_SGTTY */ +#elif defined (USE_SGTTY)/* assume USE_SGTTY */ /* * assume USE_SGTTY tty state method @@ -768,6 +779,10 @@ calc_tty(int fd) if (conf->calc_debug & CALCDBG_TTY) printf("calc_tty: stty -ECHO -ECHOE -ECHOK -ICANON +ISTRIP " "VMIN=1 VTIME=0: fd %d\n", fd); + +#else /* Using none of the above */ + fd_cur[slot] = fd_orig[slot]; + #endif /* @@ -833,7 +848,7 @@ orig_tty(int fd) if (conf->calc_debug & CALCDBG_TTY) printf("orig_tty: TCSETAW restored fd %d\n", fd); -#else /* assume USE_SGTTY */ +#elif defined (USE_SGTTY)/* assume USE_SGTTY */ /* * assume USE_SGTTY tty state method @@ -841,6 +856,12 @@ orig_tty(int fd) (void) tcsetattr(fd, TCSANOW, fd_orig+slot); if (conf->calc_debug & CALCDBG_TTY) printf("orig_tty: TCSANOW restored fd %d\n", fd); + +#else /* nothing assigned */ + + if (conf->calc_debug & CALCDBG_TTY) + printf ("orig_tty: nothing restored to fd %d\n", fd); + #endif /* diff --git a/math_error.h b/math_error.h index 71d115e..79b8eee 100644 --- a/math_error.h +++ b/math_error.h @@ -17,8 +17,8 @@ * received a copy with calc; if not, write to Free Software Foundation, Inc. * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. * - * @(#) $Revision: 29.2 $ - * @(#) $Id: math_error.h,v 29.2 2000/06/07 14:02:13 chongo Exp $ + * @(#) $Revision: 29.3 $ + * @(#) $Id: math_error.h,v 29.3 2001/03/17 21:31:47 chongo Exp $ * @(#) $Source: /usr/local/src/cmd/calc/RCS/math_error.h,v $ * * Under source code control: 1997/03/23 18:37:10 @@ -33,10 +33,13 @@ #define __MATH_ERROR_H__ +#include "win32dll.h" + + /* * Global data definitions. */ -extern jmp_buf jmpbuf; /* for errors */ +extern DLL jmp_buf jmpbuf; /* for errors */ #endif /* !__MATH_ERROR_H__ */ diff --git a/opcodes.h b/opcodes.h index ce2c7f1..5be8b8d 100644 --- a/opcodes.h +++ b/opcodes.h @@ -17,8 +17,8 @@ * received a copy with calc; if not, write to Free Software Foundation, Inc. * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. * - * @(#) $Revision: 29.3 $ - * @(#) $Id: opcodes.h,v 29.3 2001/02/25 22:07:36 chongo Exp $ + * @(#) $Revision: 29.4 $ + * @(#) $Id: opcodes.h,v 29.4 2001/03/17 21:31:47 chongo Exp $ * @(#) $Source: /usr/local/src/cmd/calc/RCS/opcodes.h,v $ * * Under source code control: 1990/02/15 01:48:35 @@ -32,18 +32,7 @@ #define __OPCODES_H__ -#if defined (_WIN32) -#ifdef _EXPORTING - #define DLL __declspec(dllexport) -#else - #define DLL __declspec(dllimport) -#endif - -#else /* Windoz free systems */ - - #define DLL - -#endif /* Windoz free systems */ +#include "win32dll.h" /* @@ -188,8 +177,8 @@ /* * external declarations */ -extern char *funcname; /* function being executed */ -extern long funcline; /* function line being executed */ +extern DLL char *funcname; /* function being executed */ +extern DLL long funcline; /* function line being executed */ #endif /* !__OPCODES_H__ */ diff --git a/sample/Makefile b/sample/Makefile index 92eb278..b21f83f 100644 --- a/sample/Makefile +++ b/sample/Makefile @@ -17,8 +17,8 @@ # received a copy with calc; if not, write to Free Software Foundation, Inc. # 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. # -# @(#) $Revision: 29.3 $ -# @(#) $Id: Makefile,v 29.3 2000/12/17 12:28:31 chongo Exp $ +# @(#) $Revision: 29.4 $ +# @(#) $Id: Makefile,v 29.4 2001/03/17 21:37:54 chongo Exp $ # @(#) $Source: /usr/local/src/cmd/calc/sample/RCS/Makefile,v $ # # Under source code control: 1997/04/19 22:46:49 @@ -446,11 +446,12 @@ install: all # DO NOT DELETE THIS LINE + many_random.o: ../alloc.h many_random.o: ../block.h many_random.o: ../byteswap.h -many_random.o: ../calc.h many_random.o: ../calcerr.h +many_random.o: ../calc.h many_random.o: ../cmath.h many_random.o: ../config.h many_random.o: ../endian_calc.h @@ -463,21 +464,22 @@ many_random.o: ../have_stdlib.h many_random.o: ../have_string.h many_random.o: ../lib_util.h many_random.o: ../longbits.h +many_random.o: many_random.c many_random.o: ../md5.h many_random.o: ../nametype.h many_random.o: ../qmath.h -many_random.o: ../shs.h many_random.o: ../shs1.h +many_random.o: ../shs.h many_random.o: ../string.h many_random.o: ../value.h +many_random.o: ../win32dll.h many_random.o: ../zmath.h many_random.o: ../zrandom.h -many_random.o: many_random.c test_random.o: ../alloc.h test_random.o: ../block.h test_random.o: ../byteswap.h -test_random.o: ../calc.h test_random.o: ../calcerr.h +test_random.o: ../calc.h test_random.o: ../cmath.h test_random.o: ../config.h test_random.o: ../endian_calc.h @@ -493,10 +495,11 @@ test_random.o: ../longbits.h test_random.o: ../md5.h test_random.o: ../nametype.h test_random.o: ../qmath.h -test_random.o: ../shs.h test_random.o: ../shs1.h +test_random.o: ../shs.h test_random.o: ../string.h +test_random.o: test_random.c test_random.o: ../value.h +test_random.o: ../win32dll.h test_random.o: ../zmath.h test_random.o: ../zrandom.h -test_random.o: test_random.c diff --git a/seed.c b/seed.c index 876f382..fbdce2c 100644 --- a/seed.c +++ b/seed.c @@ -17,8 +17,8 @@ * received a copy with calc; if not, write to Free Software Foundation, Inc. * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. * - * @(#) $Revision: 29.3 $ - * @(#) $Id: seed.c,v 29.3 2001/02/25 22:07:36 chongo Exp $ + * @(#) $Revision: 29.4 $ + * @(#) $Id: seed.c,v 29.4 2001/03/17 21:31:47 chongo Exp $ * @(#) $Source: /usr/local/src/cmd/calc/RCS/seed.c,v $ * * Under source code control: 1999/10/03 10:06:53 @@ -47,9 +47,9 @@ #endif #if defined(_WIN32) -#include -#define pid_t int -#endif /* Windoz */ +# include +# define pid_t int +#endif /* * PORTING NOTE: @@ -75,8 +75,8 @@ #include #endif #if !defined(_WIN32) -#include -#endif /* Windoz free systems */ +# include +#endif #include #include "qmath.h" #include "longbits.h" @@ -308,7 +308,9 @@ pseudo_seed(void) struct timeval tp; /* time of day */ #endif pid_t getpid; /* process ID */ +#if !defined(_WIN32) pid_t getppid; /* parent process ID */ +#endif #if defined(HAVE_UID_T) uid_t getuid; /* real user ID */ uid_t geteuid; /* effective user ID */ @@ -387,7 +389,9 @@ pseudo_seed(void) (void) gettimeofday(&sdata.tp, NULL); #endif sdata.getpid = getpid(); +#if !defined(_WIN32) sdata.getppid = getppid(); +#endif #if defined(HAVE_UID_T) sdata.getuid = getuid(); sdata.geteuid = geteuid(); diff --git a/value.h b/value.h index f140535..fa450be 100644 --- a/value.h +++ b/value.h @@ -17,8 +17,8 @@ * received a copy with calc; if not, write to Free Software Foundation, Inc. * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. * - * @(#) $Revision: 29.4 $ - * @(#) $Id: value.h,v 29.4 2001/02/25 22:07:36 chongo Exp $ + * @(#) $Revision: 29.5 $ + * @(#) $Id: value.h,v 29.5 2001/03/17 21:31:47 chongo Exp $ * @(#) $Source: /usr/local/src/cmd/calc/RCS/value.h,v $ * * Under source code control: 1993/07/30 19:42:47 @@ -32,20 +32,7 @@ #define __VALUE_H__ -#if defined (_WIN32) -#ifdef _EXPORTING - #define DLL __declspec(dllexport) -#else - #define DLL __declspec(dllimport) -#endif - -#else /* Windoz free systems */ - - #define DLL - -#endif /* Windoz free systems */ - - +#include "win32dll.h" #include "cmath.h" #include "config.h" #include "shs.h" @@ -201,59 +188,59 @@ struct value { /* * value functions */ -DLL extern void freevalue(VALUE *vp); -DLL extern void copyvalue(VALUE *vp, VALUE *vres); -DLL extern void negvalue(VALUE *vp, VALUE *vres); -DLL extern void addvalue(VALUE *v1, VALUE *v2, VALUE *vres); -DLL extern void subvalue(VALUE *v1, VALUE *v2, VALUE *vres); -DLL extern void mulvalue(VALUE *v1, VALUE *v2, VALUE *vres); -DLL extern void orvalue(VALUE *v1, VALUE *v2, VALUE *vres); -DLL extern void andvalue(VALUE *v1, VALUE *v2, VALUE *vres); -DLL extern void compvalue(VALUE *vp, VALUE *vres); -DLL extern void xorvalue(VALUE *v1, VALUE *v2, VALUE *vres); -DLL extern void squarevalue(VALUE *vp, VALUE *vres); -DLL extern void invertvalue(VALUE *vp, VALUE *vres); -DLL extern void roundvalue(VALUE *v1, VALUE *v2, VALUE *v3, VALUE *vres); -DLL extern void broundvalue(VALUE *v1, VALUE *v2, VALUE *v3, VALUE *vres); -DLL extern void setminusvalue(VALUE *, VALUE *, VALUE *); -DLL extern void backslashvalue(VALUE *, VALUE *); -DLL extern void contentvalue(VALUE *, VALUE *); -DLL extern void hashopvalue(VALUE *, VALUE *, VALUE *); -DLL extern void apprvalue(VALUE *v1, VALUE *v2, VALUE *v3, VALUE *vres); -DLL extern void intvalue(VALUE *vp, VALUE *vres); -DLL extern void fracvalue(VALUE *vp, VALUE *vres); -DLL extern void incvalue(VALUE *vp, VALUE *vres); -DLL extern void decvalue(VALUE *vp, VALUE *vres); -DLL extern void conjvalue(VALUE *vp, VALUE *vres); -DLL extern void sqrtvalue(VALUE *v1, VALUE *v2, VALUE *v3, VALUE *vres); -DLL extern void rootvalue(VALUE *v1, VALUE *v2, VALUE *v3, VALUE *vres); -DLL extern void absvalue(VALUE *v1, VALUE *v2, VALUE *vres); -DLL extern void normvalue(VALUE *vp, VALUE *vres); -DLL extern void shiftvalue(VALUE *v1, VALUE *v2, BOOL rightshift, VALUE *vres); -DLL extern void scalevalue(VALUE *v1, VALUE *v2, VALUE *vres); -DLL extern void powivalue(VALUE *v1, VALUE *v2, VALUE *vres); -DLL extern void powervalue(VALUE *v1, VALUE *v2, VALUE *v3, VALUE *vres); -DLL extern void divvalue(VALUE *v1, VALUE *v2, VALUE *vres); -DLL extern void quovalue(VALUE *v1, VALUE *v2, VALUE *v3, VALUE *vres); -DLL extern void modvalue(VALUE *v1, VALUE *v2, VALUE *v3, VALUE *vres); -DLL extern BOOL testvalue(VALUE *vp); -DLL extern BOOL comparevalue(VALUE *v1, VALUE *v2); -DLL extern BOOL acceptvalue(VALUE *v1, VALUE *v2); -DLL extern void relvalue(VALUE *v1, VALUE *v2, VALUE *vres); -DLL extern void sgnvalue(VALUE *vp, VALUE *vres); -DLL extern QCKHASH hashvalue(VALUE *vp, QCKHASH val); -DLL extern void printvalue(VALUE *vp, int flags); -DLL extern BOOL precvalue(VALUE *v1, VALUE *v2); -DLL extern VALUE error_value(int e); -DLL extern int set_errno(int e); -DLL extern int set_errcount(int e); -DLL extern long countlistitems(LIST *lp); -DLL extern void addlistitems(LIST *lp, VALUE *vres); -DLL extern void addlistinv(LIST *lp, VALUE *vres); -DLL extern void copy2octet(VALUE *, OCTET *); -DLL extern int copystod(VALUE *, long, long, VALUE *, long); -DLL extern void protectall(VALUE *, int); -DLL extern void set_update(int); +extern DLL void freevalue(VALUE *vp); +extern DLL void copyvalue(VALUE *vp, VALUE *vres); +extern DLL void negvalue(VALUE *vp, VALUE *vres); +extern DLL void addvalue(VALUE *v1, VALUE *v2, VALUE *vres); +extern DLL void subvalue(VALUE *v1, VALUE *v2, VALUE *vres); +extern DLL void mulvalue(VALUE *v1, VALUE *v2, VALUE *vres); +extern DLL void orvalue(VALUE *v1, VALUE *v2, VALUE *vres); +extern DLL void andvalue(VALUE *v1, VALUE *v2, VALUE *vres); +extern DLL void compvalue(VALUE *vp, VALUE *vres); +extern DLL void xorvalue(VALUE *v1, VALUE *v2, VALUE *vres); +extern DLL void squarevalue(VALUE *vp, VALUE *vres); +extern DLL void invertvalue(VALUE *vp, VALUE *vres); +extern DLL void roundvalue(VALUE *v1, VALUE *v2, VALUE *v3, VALUE *vres); +extern DLL void broundvalue(VALUE *v1, VALUE *v2, VALUE *v3, VALUE *vres); +extern DLL void setminusvalue(VALUE *, VALUE *, VALUE *); +extern DLL void backslashvalue(VALUE *, VALUE *); +extern DLL void contentvalue(VALUE *, VALUE *); +extern DLL void hashopvalue(VALUE *, VALUE *, VALUE *); +extern DLL void apprvalue(VALUE *v1, VALUE *v2, VALUE *v3, VALUE *vres); +extern DLL void intvalue(VALUE *vp, VALUE *vres); +extern DLL void fracvalue(VALUE *vp, VALUE *vres); +extern DLL void incvalue(VALUE *vp, VALUE *vres); +extern DLL void decvalue(VALUE *vp, VALUE *vres); +extern DLL void conjvalue(VALUE *vp, VALUE *vres); +extern DLL void sqrtvalue(VALUE *v1, VALUE *v2, VALUE *v3, VALUE *vres); +extern DLL void rootvalue(VALUE *v1, VALUE *v2, VALUE *v3, VALUE *vres); +extern DLL void absvalue(VALUE *v1, VALUE *v2, VALUE *vres); +extern DLL void normvalue(VALUE *vp, VALUE *vres); +extern DLL void shiftvalue(VALUE *v1, VALUE *v2, BOOL rightshift, VALUE *vres); +extern DLL void scalevalue(VALUE *v1, VALUE *v2, VALUE *vres); +extern DLL void powivalue(VALUE *v1, VALUE *v2, VALUE *vres); +extern DLL void powervalue(VALUE *v1, VALUE *v2, VALUE *v3, VALUE *vres); +extern DLL void divvalue(VALUE *v1, VALUE *v2, VALUE *vres); +extern DLL void quovalue(VALUE *v1, VALUE *v2, VALUE *v3, VALUE *vres); +extern DLL void modvalue(VALUE *v1, VALUE *v2, VALUE *v3, VALUE *vres); +extern DLL BOOL testvalue(VALUE *vp); +extern DLL BOOL comparevalue(VALUE *v1, VALUE *v2); +extern DLL BOOL acceptvalue(VALUE *v1, VALUE *v2); +extern DLL void relvalue(VALUE *v1, VALUE *v2, VALUE *vres); +extern DLL void sgnvalue(VALUE *vp, VALUE *vres); +extern DLL QCKHASH hashvalue(VALUE *vp, QCKHASH val); +extern DLL void printvalue(VALUE *vp, int flags); +extern DLL BOOL precvalue(VALUE *v1, VALUE *v2); +extern DLL VALUE error_value(int e); +extern DLL int set_errno(int e); +extern DLL int set_errcount(int e); +extern DLL long countlistitems(LIST *lp); +extern DLL void addlistitems(LIST *lp, VALUE *vres); +extern DLL void addlistinv(LIST *lp, VALUE *vres); +extern DLL void copy2octet(VALUE *, OCTET *); +extern DLL int copystod(VALUE *, long, long, VALUE *, long); +extern DLL void protectall(VALUE *, int); +extern DLL void set_update(int); /* @@ -270,44 +257,44 @@ struct matrix { #define matsize(n) (sizeof(MATRIX) - sizeof(VALUE) + ((n) * sizeof(VALUE))) -DLL extern MATRIX *matadd(MATRIX *m1, MATRIX *m2); -DLL extern MATRIX *matsub(MATRIX *m1, MATRIX *m2); -DLL extern MATRIX *matmul(MATRIX *m1, MATRIX *m2); -DLL extern MATRIX *matneg(MATRIX *m); -DLL extern MATRIX *matalloc(long size); -DLL extern MATRIX *matcopy(MATRIX *m); -DLL extern MATRIX *matinit(MATRIX *m, VALUE *v1, VALUE *v2); -DLL extern MATRIX *matsquare(MATRIX *m); -DLL extern MATRIX *matinv(MATRIX *m); -DLL extern MATRIX *matscale(MATRIX *m, long n); -DLL extern MATRIX *matshift(MATRIX *m, long n); -DLL extern MATRIX *matmulval(MATRIX *m, VALUE *vp); -DLL extern MATRIX *matpowi(MATRIX *m, NUMBER *q); -DLL extern MATRIX *matconj(MATRIX *m); -DLL extern MATRIX *matquoval(MATRIX *m, VALUE *vp, VALUE *v3); -DLL extern MATRIX *matmodval(MATRIX *m, VALUE *vp, VALUE *v3); -DLL extern MATRIX *matint(MATRIX *m); -DLL extern MATRIX *matfrac(MATRIX *m); -DLL extern MATRIX *matappr(MATRIX *m, VALUE *v2, VALUE *v3); -DLL extern VALUE mattrace(MATRIX *m); -DLL extern MATRIX *mattrans(MATRIX *m); -DLL extern MATRIX *matcross(MATRIX *m1, MATRIX *m2); -DLL extern BOOL mattest(MATRIX *m); -DLL extern void matsum(MATRIX *m, VALUE *vres); -DLL extern BOOL matcmp(MATRIX *m1, MATRIX *m2); -DLL extern int matsearch(MATRIX *m, VALUE *vp, long start, long end, ZVALUE *index); -DLL extern int matrsearch(MATRIX *m, VALUE *vp, long start, long end, ZVALUE *index); -DLL extern VALUE matdet(MATRIX *m); -DLL extern VALUE matdot(MATRIX *m1, MATRIX *m2); -DLL extern void matfill(MATRIX *m, VALUE *v1, VALUE *v2); -DLL extern void matfree(MATRIX *m); -DLL extern void matprint(MATRIX *m, long max_print); -DLL extern VALUE *matindex(MATRIX *mp, BOOL create, long dim, VALUE *indices); -DLL extern void matreverse(MATRIX *m); -DLL extern void matsort(MATRIX *m); -DLL extern BOOL matisident(MATRIX *m); -DLL extern MATRIX *matround(MATRIX *m, VALUE *v2, VALUE *v3); -DLL extern MATRIX *matbround(MATRIX *m, VALUE *v2, VALUE *v3); +extern DLL MATRIX *matadd(MATRIX *m1, MATRIX *m2); +extern DLL MATRIX *matsub(MATRIX *m1, MATRIX *m2); +extern DLL MATRIX *matmul(MATRIX *m1, MATRIX *m2); +extern DLL MATRIX *matneg(MATRIX *m); +extern DLL MATRIX *matalloc(long size); +extern DLL MATRIX *matcopy(MATRIX *m); +extern DLL MATRIX *matinit(MATRIX *m, VALUE *v1, VALUE *v2); +extern DLL MATRIX *matsquare(MATRIX *m); +extern DLL MATRIX *matinv(MATRIX *m); +extern DLL MATRIX *matscale(MATRIX *m, long n); +extern DLL MATRIX *matshift(MATRIX *m, long n); +extern DLL MATRIX *matmulval(MATRIX *m, VALUE *vp); +extern DLL MATRIX *matpowi(MATRIX *m, NUMBER *q); +extern DLL MATRIX *matconj(MATRIX *m); +extern DLL MATRIX *matquoval(MATRIX *m, VALUE *vp, VALUE *v3); +extern DLL MATRIX *matmodval(MATRIX *m, VALUE *vp, VALUE *v3); +extern DLL MATRIX *matint(MATRIX *m); +extern DLL MATRIX *matfrac(MATRIX *m); +extern DLL MATRIX *matappr(MATRIX *m, VALUE *v2, VALUE *v3); +extern DLL VALUE mattrace(MATRIX *m); +extern DLL MATRIX *mattrans(MATRIX *m); +extern DLL MATRIX *matcross(MATRIX *m1, MATRIX *m2); +extern DLL BOOL mattest(MATRIX *m); +extern DLL void matsum(MATRIX *m, VALUE *vres); +extern DLL BOOL matcmp(MATRIX *m1, MATRIX *m2); +extern DLL int matsearch(MATRIX *m, VALUE *vp, long start, long end, ZVALUE *index); +extern DLL int matrsearch(MATRIX *m, VALUE *vp, long start, long end, ZVALUE *index); +extern DLL VALUE matdet(MATRIX *m); +extern DLL VALUE matdot(MATRIX *m1, MATRIX *m2); +extern DLL void matfill(MATRIX *m, VALUE *v1, VALUE *v2); +extern DLL void matfree(MATRIX *m); +extern DLL void matprint(MATRIX *m, long max_print); +extern DLL VALUE *matindex(MATRIX *mp, BOOL create, long dim, VALUE *indices); +extern DLL void matreverse(MATRIX *m); +extern DLL void matsort(MATRIX *m); +extern DLL BOOL matisident(MATRIX *m); +extern DLL MATRIX *matround(MATRIX *m, VALUE *v2, VALUE *v3); +extern DLL MATRIX *matbround(MATRIX *m, VALUE *v2, VALUE *v3); /* @@ -334,32 +321,32 @@ struct list { }; -DLL extern void insertlistfirst(LIST *lp, VALUE *vp); -DLL extern void insertlistlast(LIST *lp, VALUE *vp); -DLL extern void insertlistmiddle(LIST *lp, long index, VALUE *vp); -DLL extern void removelistfirst(LIST *lp, VALUE *vp); -DLL extern void removelistlast(LIST *lp, VALUE *vp); -DLL extern void removelistmiddle(LIST *lp, long index, VALUE *vp); -DLL extern void listfree(LIST *lp); -DLL extern void listprint(LIST *lp, long max_print); -DLL extern int listsearch(LIST *lp, VALUE *vp, long start, long end, ZVALUE *index); -DLL extern int listrsearch(LIST *lp, VALUE *vp, long start, long end, ZVALUE *index); -DLL extern BOOL listcmp(LIST *lp1, LIST *lp2); -DLL extern VALUE *listfindex(LIST *lp, long index); -DLL extern LIST *listalloc(void); -DLL extern LIST *listcopy(LIST *lp); -DLL extern void listreverse(LIST *lp); -DLL extern void listsort(LIST *lp); -DLL extern LIST *listappr(LIST *lp, VALUE *v2, VALUE *v3); -DLL extern LIST *listround(LIST *m, VALUE *v2, VALUE *v3); -DLL extern LIST *listbround(LIST *m, VALUE *v2, VALUE *v3); -DLL extern LIST *listquo(LIST *lp, VALUE *v2, VALUE *v3); -DLL extern LIST *listmod(LIST *lp, VALUE *v2, VALUE *v3); -DLL extern BOOL evp(LISTELEM *cp, LISTELEM *x, VALUE *vres); -DLL extern BOOL evalpoly(LIST *clist, LISTELEM *x, VALUE *vres); -DLL extern void insertitems(LIST *lp1, LIST *lp2); -DLL extern LISTELEM *listelement(LIST *, long); -DLL extern LIST *listsegment(LIST *, long, long); +extern DLL void insertlistfirst(LIST *lp, VALUE *vp); +extern DLL void insertlistlast(LIST *lp, VALUE *vp); +extern DLL void insertlistmiddle(LIST *lp, long index, VALUE *vp); +extern DLL void removelistfirst(LIST *lp, VALUE *vp); +extern DLL void removelistlast(LIST *lp, VALUE *vp); +extern DLL void removelistmiddle(LIST *lp, long index, VALUE *vp); +extern DLL void listfree(LIST *lp); +extern DLL void listprint(LIST *lp, long max_print); +extern DLL int listsearch(LIST *lp, VALUE *vp, long start, long end, ZVALUE *index); +extern DLL int listrsearch(LIST *lp, VALUE *vp, long start, long end, ZVALUE *index); +extern DLL BOOL listcmp(LIST *lp1, LIST *lp2); +extern DLL VALUE *listfindex(LIST *lp, long index); +extern DLL LIST *listalloc(void); +extern DLL LIST *listcopy(LIST *lp); +extern DLL void listreverse(LIST *lp); +extern DLL void listsort(LIST *lp); +extern DLL LIST *listappr(LIST *lp, VALUE *v2, VALUE *v3); +extern DLL LIST *listround(LIST *m, VALUE *v2, VALUE *v3); +extern DLL LIST *listbround(LIST *m, VALUE *v2, VALUE *v3); +extern DLL LIST *listquo(LIST *lp, VALUE *v2, VALUE *v3); +extern DLL LIST *listmod(LIST *lp, VALUE *v2, VALUE *v3); +extern DLL BOOL evp(LISTELEM *cp, LISTELEM *x, VALUE *vres); +extern DLL BOOL evalpoly(LIST *clist, LISTELEM *x, VALUE *vres); +extern DLL void insertitems(LIST *lp1, LIST *lp2); +extern DLL LISTELEM *listelement(LIST *, long); +extern DLL LIST *listsegment(LIST *, long, long); /* @@ -384,15 +371,15 @@ struct assoc { }; -DLL extern ASSOC *assocalloc(long initsize); -DLL extern ASSOC *assoccopy(ASSOC *ap); -DLL extern void assocfree(ASSOC *ap); -DLL extern void assocprint(ASSOC *ap, long max_print); -DLL extern int assocsearch(ASSOC *ap, VALUE *vp, long start, long end, ZVALUE *index); -DLL extern int assocrsearch(ASSOC *ap, VALUE *vp, long start, long end, ZVALUE *index); -DLL extern BOOL assoccmp(ASSOC *ap1, ASSOC *ap2); -DLL extern VALUE *assocfindex(ASSOC *ap, long index); -DLL extern VALUE *associndex(ASSOC *ap, BOOL create, long dim, VALUE *indices); +extern DLL ASSOC *assocalloc(long initsize); +extern DLL ASSOC *assoccopy(ASSOC *ap); +extern DLL void assocfree(ASSOC *ap); +extern DLL void assocprint(ASSOC *ap, long max_print); +extern DLL int assocsearch(ASSOC *ap, VALUE *vp, long start, long end, ZVALUE *index); +extern DLL int assocrsearch(ASSOC *ap, VALUE *vp, long start, long end, ZVALUE *index); +extern DLL BOOL assoccmp(ASSOC *ap1, ASSOC *ap2); +extern DLL VALUE *assocfindex(ASSOC *ap, long index); +extern DLL VALUE *associndex(ASSOC *ap, BOOL create, long dim, VALUE *indices); /* @@ -474,62 +461,62 @@ struct object { (sizeof(OBJECT) + ((elements) - USUAL_ELEMENTS) * sizeof(VALUE)) -DLL extern OBJECT *objcopy(OBJECT *op); -DLL extern OBJECT *objalloc(long index); -DLL extern VALUE objcall(int action, VALUE *v1, VALUE *v2, VALUE *v3); -DLL extern void objfree(OBJECT *op); -DLL extern int addelement(char *name); -DLL extern int defineobject(char *name, int indices[], int count); -DLL extern int checkobject(char *name); -DLL extern void showobjfuncs(void); -DLL extern void showobjtypes(void); -DLL extern int findelement(char *name); -DLL extern char *objtypename(unsigned long index); -DLL extern int objoffset(OBJECT *op, long index); +extern DLL OBJECT *objcopy(OBJECT *op); +extern DLL OBJECT *objalloc(long index); +extern DLL VALUE objcall(int action, VALUE *v1, VALUE *v2, VALUE *v3); +extern DLL void objfree(OBJECT *op); +extern DLL int addelement(char *name); +extern DLL int defineobject(char *name, int indices[], int count); +extern DLL int checkobject(char *name); +extern DLL void showobjfuncs(void); +extern DLL void showobjtypes(void); +extern DLL int findelement(char *name); +extern DLL char *objtypename(unsigned long index); +extern DLL int objoffset(OBJECT *op, long index); /* * Configuration parameter name and type. */ extern NAMETYPE configs[]; -DLL extern void config_value(CONFIG *cfg, int type, VALUE *ret); -DLL extern void setconfig(int type, VALUE *vp); -DLL extern void config_print(CONFIG *cfg); /* the CONFIG to print */ +extern DLL void config_value(CONFIG *cfg, int type, VALUE *ret); +extern DLL void setconfig(int type, VALUE *vp); +extern DLL void config_print(CONFIG *cfg); /* the CONFIG to print */ /* * size, memsize and sizeof support */ -DLL extern long elm_count(VALUE *vp); -DLL extern long lsizeof(VALUE *vp); -DLL extern long memsize(VALUE *vp); +extern DLL long elm_count(VALUE *vp); +extern DLL long lsizeof(VALUE *vp); +extern DLL long memsize(VALUE *vp); /* * String functions */ -DLL extern STRING *stringadd(STRING *, STRING *); -DLL extern STRING *stringcopy(STRING *); -DLL extern STRING *stringsub(STRING *, STRING *); -DLL extern STRING *stringmul(NUMBER *, STRING *); -DLL extern STRING *stringand(STRING *, STRING *); -DLL extern STRING *stringor(STRING *, STRING *); -DLL extern STRING *stringxor(STRING *, STRING *); -DLL extern STRING *stringdiff(STRING *, STRING *); -DLL extern STRING *stringsegment(STRING *, long, long); -DLL extern STRING *stringshift(STRING *, long); -DLL extern STRING *stringcomp(STRING *); -DLL extern STRING *stringneg(STRING *); -DLL extern STRING *stringcpy(STRING *, STRING *); -DLL extern STRING *stringncpy(STRING *, STRING *, long); -DLL extern long stringcontent(STRING *s); -DLL extern long stringlowbit(STRING *s); -DLL extern long stringhighbit(STRING *s); -DLL extern BOOL stringcmp(STRING *, STRING *); -DLL extern BOOL stringrel(STRING *, STRING *); -DLL extern int stringbit(STRING *, long); -DLL extern BOOL stringtest(STRING *); -DLL extern int stringsetbit(STRING *, long, BOOL); -DLL extern int stringsearch(STRING *, STRING *, long, long, ZVALUE *); -DLL extern int stringrsearch(STRING *, STRING *, long, long, ZVALUE *); +extern DLL STRING *stringadd(STRING *, STRING *); +extern DLL STRING *stringcopy(STRING *); +extern DLL STRING *stringsub(STRING *, STRING *); +extern DLL STRING *stringmul(NUMBER *, STRING *); +extern DLL STRING *stringand(STRING *, STRING *); +extern DLL STRING *stringor(STRING *, STRING *); +extern DLL STRING *stringxor(STRING *, STRING *); +extern DLL STRING *stringdiff(STRING *, STRING *); +extern DLL STRING *stringsegment(STRING *, long, long); +extern DLL STRING *stringshift(STRING *, long); +extern DLL STRING *stringcomp(STRING *); +extern DLL STRING *stringneg(STRING *); +extern DLL STRING *stringcpy(STRING *, STRING *); +extern DLL STRING *stringncpy(STRING *, STRING *, long); +extern DLL long stringcontent(STRING *s); +extern DLL long stringlowbit(STRING *s); +extern DLL long stringhighbit(STRING *s); +extern DLL BOOL stringcmp(STRING *, STRING *); +extern DLL BOOL stringrel(STRING *, STRING *); +extern DLL int stringbit(STRING *, long); +extern DLL BOOL stringtest(STRING *); +extern DLL int stringsetbit(STRING *, long, BOOL); +extern DLL int stringsearch(STRING *, STRING *, long, long, ZVALUE *); +extern DLL int stringrsearch(STRING *, STRING *, long, long, ZVALUE *); #endif /* !__VALUE_H__ */ diff --git a/version.c b/version.c index 14ed232..bb1714f 100644 --- a/version.c +++ b/version.c @@ -19,8 +19,8 @@ * received a copy with calc; if not, write to Free Software Foundation, Inc. * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. * - * @(#) $Revision: 29.19 $ - * @(#) $Id: version.c,v 29.19 2001/02/25 22:07:36 chongo Exp $ + * @(#) $Revision: 29.20 $ + * @(#) $Id: version.c,v 29.20 2001/03/17 21:31:47 chongo Exp $ * @(#) $Source: /usr/local/src/cmd/calc/RCS/version.c,v $ * * Under source code control: 1990/05/22 11:00:58 @@ -43,7 +43,7 @@ static char *program; #define MAJOR_VER 2 /* major version */ #define MINOR_VER 11 /* minor version */ #define MAJOR_PATCH 5 /* patch level or 0 if no patch */ -#define MINOR_PATCH "0" /* test number or empty string if no patch */ +#define MINOR_PATCH "1.0" /* test number or empty string if no patch */ /* * calc version constants diff --git a/win32dll.h b/win32dll.h new file mode 100644 index 0000000..2e773e1 --- /dev/null +++ b/win32dll.h @@ -0,0 +1,50 @@ +/* + * win32dll - definitions for building windoz dll files + * + * Copyright (C) 2001 Landon Curt Noll + * + * Calc is open software; you can redistribute it and/or modify it under + * the terms of the version 2.1 of the GNU Lesser General Public License + * as published by the Free Software Foundation. + * + * Calc 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 Lesser General + * Public License for more details. + * + * A copy of version 2.1 of the GNU Lesser General Public License is + * distributed with calc under the filename COPYING-LGPL. You should have + * received a copy with calc; if not, write to Free Software Foundation, Inc. + * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. + * + * @(#) $Revision: 29.1 $ + * @(#) $Id: win32dll.h,v 29.1 2001/03/18 03:03:11 chongo Exp $ + * @(#) $Source: /usr/local/src/cmd/calc/RCS/win32dll.h,v $ + * + * Under source code control: 2001/03/17 13:05:31 + * File existed as early as: 2001 + * + * chongo /\oo/\ http://www.isthe.com/chongo/ + * Share and enjoy! :-) http://www.isthe.com/chongo/tech/comp/calc/ + */ + + +#if !defined(__WIN32DLL_H__) +#define __WIN32DLL_H__ + +#if defined(_WIN32) + +# if defined(_EXPORTING) +# define DLL __declspec(dllexport) +# else +# define DLL __declspec(dllimport) +# endif + +#else /* Windoz free systems */ + +# define DLL + +#endif /* Windoz free systems */ + + +#endif /* !__WIN32DLL_H__ */ diff --git a/zmath.h b/zmath.h index 827e954..747c130 100644 --- a/zmath.h +++ b/zmath.h @@ -17,8 +17,8 @@ * received a copy with calc; if not, write to Free Software Foundation, Inc. * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. * - * @(#) $Revision: 29.4 $ - * @(#) $Id: zmath.h,v 29.4 2001/02/25 22:07:36 chongo Exp $ + * @(#) $Revision: 29.5 $ + * @(#) $Id: zmath.h,v 29.5 2001/03/17 21:31:47 chongo Exp $ * @(#) $Source: /usr/local/src/cmd/calc/RCS/zmath.h,v $ * * Under source code control: 1993/07/30 19:42:48 @@ -38,20 +38,7 @@ #define __ZMATH_H__ -#if defined (_WIN32) -#ifdef _EXPORTING - #define DLL __declspec(dllexport) -#else - #define DLL __declspec(dllimport) -#endif - -#else /* Windoz free systems */ - - #define DLL - -#endif /* Windoz free systems */ - - +#include "win32dll.h" #include "alloc.h" #include "endian_calc.h" #include "longbits.h" @@ -281,126 +268,126 @@ typedef struct { /* * Function prototypes for integer math routines. */ -DLL extern HALF * alloc(LEN len); +extern DLL HALF * alloc(LEN len); #ifdef ALLOCTEST -DLL extern void freeh(HALF *); +extern DLL void freeh(HALF *); #endif /* * Input, output, and conversion routines. */ -DLL extern void zcopy(ZVALUE z, ZVALUE *res); -DLL extern void itoz(long i, ZVALUE *res); -DLL extern void utoz(FULL i, ZVALUE *res); -DLL extern void str2z(char *s, ZVALUE *res); -DLL extern long ztoi(ZVALUE z); -DLL extern FULL ztou(ZVALUE z); -DLL extern void zprintval(ZVALUE z, long decimals, long width); -DLL extern void zprintx(ZVALUE z, long width); -DLL extern void zprintb(ZVALUE z, long width); -DLL extern void zprinto(ZVALUE z, long width); -DLL extern void fitzprint(ZVALUE, long, long); +extern DLL void zcopy(ZVALUE z, ZVALUE *res); +extern DLL void itoz(long i, ZVALUE *res); +extern DLL void utoz(FULL i, ZVALUE *res); +extern DLL void str2z(char *s, ZVALUE *res); +extern DLL long ztoi(ZVALUE z); +extern DLL FULL ztou(ZVALUE z); +extern DLL void zprintval(ZVALUE z, long decimals, long width); +extern DLL void zprintx(ZVALUE z, long width); +extern DLL void zprintb(ZVALUE z, long width); +extern DLL void zprinto(ZVALUE z, long width); +extern DLL void fitzprint(ZVALUE, long, long); /* * Basic numeric routines. */ -DLL extern void zmuli(ZVALUE z, long n, ZVALUE *res); -DLL extern long zdivi(ZVALUE z, long n, ZVALUE *res); -DLL extern long zmodi(ZVALUE z, long n); -DLL extern void zadd(ZVALUE z1, ZVALUE z2, ZVALUE *res); -DLL extern void zsub(ZVALUE z1, ZVALUE z2, ZVALUE *res); -DLL extern void zmul(ZVALUE z1, ZVALUE z2, ZVALUE *res); -DLL extern long zdiv(ZVALUE z1, ZVALUE z2, ZVALUE *res, ZVALUE *rem, long R); -DLL extern long zquo(ZVALUE z1, ZVALUE z2, ZVALUE *res, long R); -DLL extern long zmod(ZVALUE z1, ZVALUE z2, ZVALUE *rem, long R); -DLL extern void zequo(ZVALUE z1, ZVALUE z2, ZVALUE *res); -DLL extern BOOL zdivides(ZVALUE z1, ZVALUE z2); -DLL extern void zor(ZVALUE z1, ZVALUE z2, ZVALUE *res); -DLL extern void zand(ZVALUE z1, ZVALUE z2, ZVALUE *res); -DLL extern void zxor(ZVALUE z1, ZVALUE z2, ZVALUE *res); -DLL extern void zandnot(ZVALUE z1, ZVALUE z2, ZVALUE *res); -DLL extern long zpopcnt(ZVALUE z, int bitval); -DLL extern void zshift(ZVALUE z, long n, ZVALUE *res); -DLL extern void zsquare(ZVALUE z, ZVALUE *res); -DLL extern long zlowbit(ZVALUE z); -DLL extern LEN zhighbit(ZVALUE z); -DLL extern void zbitvalue(long n, ZVALUE *res); -DLL extern BOOL zisset(ZVALUE z, long n); -DLL extern BOOL zisonebit(ZVALUE z); -DLL extern BOOL zisallbits(ZVALUE z); -DLL extern FLAG ztest(ZVALUE z); -DLL extern FLAG zrel(ZVALUE z1, ZVALUE z2); -DLL extern FLAG zabsrel(ZVALUE z1, ZVALUE z2); -DLL extern BOOL zcmp(ZVALUE z1, ZVALUE z2); +extern DLL void zmuli(ZVALUE z, long n, ZVALUE *res); +extern DLL long zdivi(ZVALUE z, long n, ZVALUE *res); +extern DLL long zmodi(ZVALUE z, long n); +extern DLL void zadd(ZVALUE z1, ZVALUE z2, ZVALUE *res); +extern DLL void zsub(ZVALUE z1, ZVALUE z2, ZVALUE *res); +extern DLL void zmul(ZVALUE z1, ZVALUE z2, ZVALUE *res); +extern DLL long zdiv(ZVALUE z1, ZVALUE z2, ZVALUE *res, ZVALUE *rem, long R); +extern DLL long zquo(ZVALUE z1, ZVALUE z2, ZVALUE *res, long R); +extern DLL long zmod(ZVALUE z1, ZVALUE z2, ZVALUE *rem, long R); +extern DLL void zequo(ZVALUE z1, ZVALUE z2, ZVALUE *res); +extern DLL BOOL zdivides(ZVALUE z1, ZVALUE z2); +extern DLL void zor(ZVALUE z1, ZVALUE z2, ZVALUE *res); +extern DLL void zand(ZVALUE z1, ZVALUE z2, ZVALUE *res); +extern DLL void zxor(ZVALUE z1, ZVALUE z2, ZVALUE *res); +extern DLL void zandnot(ZVALUE z1, ZVALUE z2, ZVALUE *res); +extern DLL long zpopcnt(ZVALUE z, int bitval); +extern DLL void zshift(ZVALUE z, long n, ZVALUE *res); +extern DLL void zsquare(ZVALUE z, ZVALUE *res); +extern DLL long zlowbit(ZVALUE z); +extern DLL LEN zhighbit(ZVALUE z); +extern DLL void zbitvalue(long n, ZVALUE *res); +extern DLL BOOL zisset(ZVALUE z, long n); +extern DLL BOOL zisonebit(ZVALUE z); +extern DLL BOOL zisallbits(ZVALUE z); +extern DLL FLAG ztest(ZVALUE z); +extern DLL FLAG zrel(ZVALUE z1, ZVALUE z2); +extern DLL FLAG zabsrel(ZVALUE z1, ZVALUE z2); +extern DLL BOOL zcmp(ZVALUE z1, ZVALUE z2); /* * More complicated numeric functions. */ -DLL extern FULL uugcd(FULL i1, FULL i2); -DLL extern long iigcd(long i1, long i2); -DLL extern void zgcd(ZVALUE z1, ZVALUE z2, ZVALUE *res); -DLL extern void zlcm(ZVALUE z1, ZVALUE z2, ZVALUE *res); -DLL extern void zreduce(ZVALUE z1, ZVALUE z2, ZVALUE *z1res, ZVALUE *z2res); -DLL extern void zfact(ZVALUE z, ZVALUE *dest); -DLL extern void zperm(ZVALUE z1, ZVALUE z2, ZVALUE *res); -DLL extern int zcomb(ZVALUE z1, ZVALUE z2, ZVALUE *res); -DLL extern FLAG zjacobi(ZVALUE z1, ZVALUE z2); -DLL extern void zfib(ZVALUE z, ZVALUE *res); -DLL extern void zpowi(ZVALUE z1, ZVALUE z2, ZVALUE *res); -DLL extern void ztenpow(long power, ZVALUE *res); -DLL extern void zpowermod(ZVALUE z1, ZVALUE z2, ZVALUE z3, ZVALUE *res); -DLL extern BOOL zmodinv(ZVALUE z1, ZVALUE z2, ZVALUE *res); -DLL extern BOOL zrelprime(ZVALUE z1, ZVALUE z2); -DLL extern long zlog(ZVALUE z1, ZVALUE z2); -DLL extern long zlog10(ZVALUE z); -DLL extern long zdivcount(ZVALUE z1, ZVALUE z2); -DLL extern long zfacrem(ZVALUE z1, ZVALUE z2, ZVALUE *rem); -DLL extern long zgcdrem(ZVALUE z1, ZVALUE z2, ZVALUE *res); -DLL extern long zdigits(ZVALUE z1); -DLL extern long zdigit(ZVALUE z1, long n); -DLL extern FLAG zsqrt(ZVALUE z1, ZVALUE *dest, long R); -DLL extern void zroot(ZVALUE z1, ZVALUE z2, ZVALUE *dest); -DLL extern BOOL zissquare(ZVALUE z); -DLL extern void zhnrmod(ZVALUE v, ZVALUE h, ZVALUE zn, ZVALUE zr, ZVALUE *res); +extern DLL FULL uugcd(FULL i1, FULL i2); +extern DLL long iigcd(long i1, long i2); +extern DLL void zgcd(ZVALUE z1, ZVALUE z2, ZVALUE *res); +extern DLL void zlcm(ZVALUE z1, ZVALUE z2, ZVALUE *res); +extern DLL void zreduce(ZVALUE z1, ZVALUE z2, ZVALUE *z1res, ZVALUE *z2res); +extern DLL void zfact(ZVALUE z, ZVALUE *dest); +extern DLL void zperm(ZVALUE z1, ZVALUE z2, ZVALUE *res); +extern DLL int zcomb(ZVALUE z1, ZVALUE z2, ZVALUE *res); +extern DLL FLAG zjacobi(ZVALUE z1, ZVALUE z2); +extern DLL void zfib(ZVALUE z, ZVALUE *res); +extern DLL void zpowi(ZVALUE z1, ZVALUE z2, ZVALUE *res); +extern DLL void ztenpow(long power, ZVALUE *res); +extern DLL void zpowermod(ZVALUE z1, ZVALUE z2, ZVALUE z3, ZVALUE *res); +extern DLL BOOL zmodinv(ZVALUE z1, ZVALUE z2, ZVALUE *res); +extern DLL BOOL zrelprime(ZVALUE z1, ZVALUE z2); +extern DLL long zlog(ZVALUE z1, ZVALUE z2); +extern DLL long zlog10(ZVALUE z); +extern DLL long zdivcount(ZVALUE z1, ZVALUE z2); +extern DLL long zfacrem(ZVALUE z1, ZVALUE z2, ZVALUE *rem); +extern DLL long zgcdrem(ZVALUE z1, ZVALUE z2, ZVALUE *res); +extern DLL long zdigits(ZVALUE z1); +extern DLL long zdigit(ZVALUE z1, long n); +extern DLL FLAG zsqrt(ZVALUE z1, ZVALUE *dest, long R); +extern DLL void zroot(ZVALUE z1, ZVALUE z2, ZVALUE *dest); +extern DLL BOOL zissquare(ZVALUE z); +extern DLL void zhnrmod(ZVALUE v, ZVALUE h, ZVALUE zn, ZVALUE zr, ZVALUE *res); /* * Prime related functions. */ -DLL extern FLAG zisprime(ZVALUE z); -DLL extern FULL znprime(ZVALUE z); -DLL extern FULL next_prime(FULL v); -DLL extern FULL zpprime(ZVALUE z); -DLL extern void zpfact(ZVALUE z, ZVALUE *dest); -DLL extern BOOL zprimetest(ZVALUE z, long count, ZVALUE skip); -DLL extern BOOL zredcprimetest(ZVALUE z, long count, ZVALUE skip); -DLL extern BOOL znextcand(ZVALUE z1, long count, ZVALUE skip, ZVALUE res, ZVALUE mod, ZVALUE *cand); -DLL extern BOOL zprevcand(ZVALUE z1, long count, ZVALUE skip, ZVALUE res, ZVALUE mod, ZVALUE *cand); -DLL extern FULL zlowfactor(ZVALUE z, long count); -DLL extern FLAG zfactor(ZVALUE z1, ZVALUE z2, ZVALUE *res); -DLL extern long zpix(ZVALUE z1); -DLL extern void zlcmfact(ZVALUE z, ZVALUE *dest); +extern DLL FLAG zisprime(ZVALUE z); +extern DLL FULL znprime(ZVALUE z); +extern DLL FULL next_prime(FULL v); +extern DLL FULL zpprime(ZVALUE z); +extern DLL void zpfact(ZVALUE z, ZVALUE *dest); +extern DLL BOOL zprimetest(ZVALUE z, long count, ZVALUE skip); +extern DLL BOOL zredcprimetest(ZVALUE z, long count, ZVALUE skip); +extern DLL BOOL znextcand(ZVALUE z1, long count, ZVALUE skip, ZVALUE res, ZVALUE mod, ZVALUE *cand); +extern DLL BOOL zprevcand(ZVALUE z1, long count, ZVALUE skip, ZVALUE res, ZVALUE mod, ZVALUE *cand); +extern DLL FULL zlowfactor(ZVALUE z, long count); +extern DLL FLAG zfactor(ZVALUE z1, ZVALUE z2, ZVALUE *res); +extern DLL long zpix(ZVALUE z1); +extern DLL void zlcmfact(ZVALUE z, ZVALUE *dest); /* * Misc misc functions. :-) */ -DLL extern void zsquaremod(ZVALUE z1, ZVALUE z2, ZVALUE *res); -DLL extern void zminmod(ZVALUE z1, ZVALUE z2, ZVALUE *res); -DLL extern BOOL zcmpmod(ZVALUE z1, ZVALUE z2, ZVALUE z3); -DLL extern void zio_init(void); +extern DLL void zsquaremod(ZVALUE z1, ZVALUE z2, ZVALUE *res); +extern DLL void zminmod(ZVALUE z1, ZVALUE z2, ZVALUE *res); +extern DLL BOOL zcmpmod(ZVALUE z1, ZVALUE z2, ZVALUE z3); +extern DLL void zio_init(void); /* * These functions are for internal use only. */ -DLL extern void ztrim(ZVALUE *z); -DLL extern void zshiftr(ZVALUE z, long n); -DLL extern void zshiftl(ZVALUE z, long n); -DLL extern HALF *zalloctemp(LEN len); +extern DLL void ztrim(ZVALUE *z); +extern DLL void zshiftr(ZVALUE z, long n); +extern DLL void zshiftl(ZVALUE z, long n); +extern DLL HALF *zalloctemp(LEN len); /* @@ -417,13 +404,13 @@ typedef struct { ZVALUE one; /* REDC format for the number 1 */ } REDC; -DLL extern REDC *zredcalloc(ZVALUE z1); -DLL extern void zredcfree(REDC *rp); -DLL extern void zredcencode(REDC *rp, ZVALUE z1, ZVALUE *res); -DLL extern void zredcdecode(REDC *rp, ZVALUE z1, ZVALUE *res); -DLL extern void zredcmul(REDC *rp, ZVALUE z1, ZVALUE z2, ZVALUE *res); -DLL extern void zredcsquare(REDC *rp, ZVALUE z1, ZVALUE *res); -DLL extern void zredcpower(REDC *rp, ZVALUE z1, ZVALUE z2, ZVALUE *res); +extern DLL REDC *zredcalloc(ZVALUE z1); +extern DLL void zredcfree(REDC *rp); +extern DLL void zredcencode(REDC *rp, ZVALUE z1, ZVALUE *res); +extern DLL void zredcdecode(REDC *rp, ZVALUE z1, ZVALUE *res); +extern DLL void zredcmul(REDC *rp, ZVALUE z1, ZVALUE z2, ZVALUE *res); +extern DLL void zredcsquare(REDC *rp, ZVALUE z1, ZVALUE *res); +extern DLL void zredcpower(REDC *rp, ZVALUE z1, ZVALUE z2, ZVALUE *res); /* @@ -564,32 +551,32 @@ DLL extern void zredcpower(REDC *rp, ZVALUE z1, ZVALUE z2, ZVALUE *res); /* * Output routines for either FILE handles or strings. */ -DLL extern void math_chr(int ch); -DLL extern void math_str(char *str); -DLL extern void math_fill(char *str, long width); -DLL extern void math_flush(void); -DLL extern void math_divertio(void); -DLL extern void math_cleardiversions(void); -DLL extern char *math_getdivertedio(void); -DLL extern int math_setmode(int mode); -DLL extern LEN math_setdigits(LEN digits); -DLL extern void math_fmt(char *, ...); +extern DLL void math_chr(int ch); +extern DLL void math_str(char *str); +extern DLL void math_fill(char *str, long width); +extern DLL void math_flush(void); +extern DLL void math_divertio(void); +extern DLL void math_cleardiversions(void); +extern DLL char *math_getdivertedio(void); +extern DLL int math_setmode(int mode); +extern DLL LEN math_setdigits(LEN digits); +extern DLL void math_fmt(char *, ...); /* * The error routine. */ -DLL extern void math_error(char *, ...); +extern DLL void math_error(char *, ...); /* * external swap functions */ -DLL extern HALF *swap_b8_in_HALFs(HALF *dest, HALF *src, LEN len); -DLL extern ZVALUE *swap_b8_in_ZVALUE(ZVALUE *dest, ZVALUE *src, BOOL all); -DLL extern HALF *swap_b16_in_HALFs(HALF *dest, HALF *src, LEN len); -DLL extern ZVALUE *swap_b16_in_ZVALUE(ZVALUE *dest, ZVALUE *src, BOOL all); -DLL extern ZVALUE *swap_HALF_in_ZVALUE(ZVALUE *dest, ZVALUE *src, BOOL all); +extern DLL HALF *swap_b8_in_HALFs(HALF *dest, HALF *src, LEN len); +extern DLL ZVALUE *swap_b8_in_ZVALUE(ZVALUE *dest, ZVALUE *src, BOOL all); +extern DLL HALF *swap_b16_in_HALFs(HALF *dest, HALF *src, LEN len); +extern DLL ZVALUE *swap_b16_in_ZVALUE(ZVALUE *dest, ZVALUE *src, BOOL all); +extern DLL ZVALUE *swap_HALF_in_ZVALUE(ZVALUE *dest, ZVALUE *src, BOOL all); /* @@ -609,7 +596,7 @@ extern ZVALUE _sqbase_, _pow4base_, _pow8base_; extern ZVALUE _b32_, _b64_; -extern BOOL _math_abort_; /* nonzero to abort calculations */ +extern DLL BOOL _math_abort_; /* nonzero to abort calculations */ extern ZVALUE _tenpowers_[]; /* table of 10^2^n */ /*