Release calc version 2.12.4.11

This commit is contained in:
Landon Curt Noll
2013-09-01 15:25:13 -07:00
parent 17e3535595
commit 85bfa30897
37 changed files with 5367 additions and 3019 deletions

69
CHANGES
View File

@@ -1,4 +1,67 @@
The following are the changes from calc version 2.12.4.6 to date: The following are the changes from calc version 2.12.4.11 to date:
Fixed many typos in comments of the Makefile thanks to the review
work of Michael Somos <somos at harary dot math dot georgetown dot edu>.
Fixed typo in "help sysinfo".
The Makefile rule, debug, is now more verbose and prints more information
about the calc compiled constants.
Added a more of calc resource files by
Christoph Zurnieden <czurnieden at gmx dot de> including:
infinities.cal - handle infinities symbolically, a little helper file
intnum.cal - implementation of tanhsinh- and Gauss-Legendre quadrature
smallfactors.cal - find the factors of a number < 2^32
strings.cal - implementation of the macros in ctype.h plus str[n]casecmp
Reformatted some calc resource files. Cleanup in comment the headers
of some calc resource files.
Minor formatting changes to a few help files.
No need to be special picky about the test8900.cal calc resource file.
Added a number of ctype-like builtins:
isalnum - whether character is alpha-numeric
isalpha - whether character is alphabetic
iscntrl - whether character is a control character
isdigit - whether character is a digit character
isgraph - whether character is a graphical character
islower - whether character is lower case
isprint - whether character is a printable
ispunct - whether character is a punctuation
isspace - whether character is a space character
isupper - whether character is upper case
isxdigit - whether character a hexadecimal digit
strcasecmp - compare two strings, case independent
strncasecmp - compare two strings up to n characters, case independent
For details on these new builtins, see their help messages.
Thanks goes to Inge Zurnieden <inge dot zurnieden at gmx dot de> for
these new builtins.
Calc source code is now picky v2.3 clean using:
picky -s -v file file2 ..
With the exception of:
help/errorcodes.sed
cal/set8700.line
Due to the long lines in those files, we use:
picky -w -s -v help/errorcodes.sed cal/set8700.line
For more information about the picky tool, see:
http://cis.csuohio.edu/~somos/picky.html
The following are the changes from calc version 2.12.4.6 to version 2.12.4.10:
Updated RPM build process to remove use of deprecated flags. Updated RPM build process to remove use of deprecated flags.
@@ -6881,8 +6944,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. ## received a copy with calc; if not, write to Free Software Foundation, Inc.
## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
## ##
## @(#) $Revision: 30.32 $ ## @(#) $Revision: 30.33 $
## @(#) $Id: CHANGES,v 30.32 2013/08/11 09:10:11 chongo Exp $ ## @(#) $Id: CHANGES,v 30.33 2013/09/01 22:19:41 chongo Exp $
## @(#) $Source: /usr/local/src/bin/calc/RCS/CHANGES,v $ ## @(#) $Source: /usr/local/src/bin/calc/RCS/CHANGES,v $
## ##
## Under source code control: 1993/06/02 18:12:57 ## Under source code control: 1993/06/02 18:12:57

17
COPYING
View File

@@ -12,11 +12,11 @@ This file is Copyrighted
Everyone is permitted to copy and distribute verbatim copies Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed. of this license document, but changing it is not allowed.
# @(#) $Revision: 30.2 $ # @(#) $Revision: 30.4 $
# @(#) $Id: COPYING,v 30.2 2008/10/24 10:46:52 chongo Exp $ # @(#) $Id: COPYING,v 30.4 2013/09/01 20:14:30 chongo Exp $
# @(#) $Source: /usr/local/src/bin/calc/RCS/COPYING,v $ # @(#) $Source: /usr/local/src/bin/calc/RCS/COPYING,v $
=-= -=-
Calc is covered by the GNU Lesser General Public License Calc is covered by the GNU Lesser General Public License
-------------------------------------------------------- --------------------------------------------------------
@@ -78,7 +78,7 @@ Calc is covered by the GNU Lesser General Public License
Feel free to follow the name line with additional EMail text as desired. Feel free to follow the name line with additional EMail text as desired.
=-= -=-
Calc bug reports and calc bug fixes should be sent to: Calc bug reports and calc bug fixes should be sent to:
@@ -93,7 +93,7 @@ Calc is covered by the GNU Lesser General Public License
You may have additional words in your subject line. You may have additional words in your subject line.
=-= -=-
Calc's relationship to the GNU Lesser General Public License Calc's relationship to the GNU Lesser General Public License
------------------------------------------------------------ ------------------------------------------------------------
@@ -149,7 +149,7 @@ Calc's relationship to the GNU Lesser General Public License
except for the exception files explicitly listed in the ``Calc except for the exception files explicitly listed in the ``Calc
copyrights and exception files'' section below. copyrights and exception files'' section below.
=-= -=-
Calc copyrights and exception files Calc copyrights and exception files
----------------------------------- -----------------------------------
@@ -165,6 +165,7 @@ Calc copyrights and exception files
Copyright (C) year Ernest Bowen and Landon Curt Noll Copyright (C) year Ernest Bowen and Landon Curt Noll
Copyright (C) year Ernest Bowen Copyright (C) year Ernest Bowen
Copyright (C) year Petteri Kettunen and Landon Curt Noll Copyright (C) year Petteri Kettunen and Landon Curt Noll
Copyright (C) year Christoph Zurnieden
These files are not covered under one of the Copyrights listed above: These files are not covered under one of the Copyrights listed above:
@@ -188,7 +189,7 @@ Calc copyrights and exception files
And because one may freely distribute the LGPL covered files, the And because one may freely distribute the LGPL covered files, the
entire calc source may be freely used and distributed. entire calc source may be freely used and distributed.
=-= -=-
General Copyleft and License info General Copyleft and License info
--------------------------------- ---------------------------------
@@ -202,7 +203,7 @@ General Copyleft and License info
http://www.gnu.org/copyleft/lesser.html http://www.gnu.org/copyleft/lesser.html
http://www.gnu.org/copyleft/lesser.txt http://www.gnu.org/copyleft/lesser.txt
=-= -=-
Why calc did not use the GNU General Public License Why calc did not use the GNU General Public License
--------------------------------------------------- ---------------------------------------------------

View File

@@ -485,7 +485,8 @@ convey the exclusion of warranty; and each file should have at least the
You should have received a copy of the GNU Lesser General Public You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
USA
Also add information on how to contact you by electronic and paper mail. Also add information on how to contact you by electronic and paper mail.

216
Makefile
View File

@@ -4,7 +4,7 @@
# #
######################################################################## ########################################################################
# Gnu makefile: # This is a Gnu make makefile. If your make does not # # Gnu makefile: # This is a Gnu make makefile. If your make does not #
# Gnu makefile: # understand this makefilkke format, then edit and use # # Gnu makefile: # understand this makefile format, then edit and use #
# Gnu makefile: # Makefile.simple instead of this Makefile. # # Gnu makefile: # Makefile.simple instead of this Makefile. #
######################################################################## ########################################################################
# #
@@ -12,12 +12,12 @@
# #
# NOTE: This is NOT the calc rpm Makefile. This Makefile is a generic # NOTE: This is NOT the calc rpm Makefile. This Makefile is a generic
# Makefile for the people who build calc from the bzip2-ed tarball. # Makefile for the people who build calc from the bzip2-ed tarball.
# Without modification, it not assume the system has readline, ncurses # Without modification, it does not assume the system has readline,
# or less. It compiles with gcc -O3 -g3 as well. You can change all # ncurses or less. It compiles with gcc -O3 -g3 as well. You can
# this by modifying the Makefile variables below. # change all this by modifying the Makefile variables below.
# #
# NOTE: You might want use the READLINE facility if your system # NOTE: You might want use the READLINE facility if your system
# has the GNU readline headers and libaraies: # has the GNU readline headers and libraries:
# #
# USE_READLINE= -DUSE_READLINE # USE_READLINE= -DUSE_READLINE
# READLINE_LIB= -lreadline # READLINE_LIB= -lreadline
@@ -26,7 +26,7 @@
# Copyright (C) 1999-2008 Landon Curt Noll # Copyright (C) 1999-2008 Landon Curt Noll
# #
# Calc is open software; you can redistribute it and/or modify it under # 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 # the terms of version 2.1 of the GNU Lesser General Public License
# as published by the Free Software Foundation. # as published by the Free Software Foundation.
# #
# Calc is distributed in the hope that it will be useful, but WITHOUT # Calc is distributed in the hope that it will be useful, but WITHOUT
@@ -39,9 +39,9 @@
# received a copy with calc; if not, write to Free Software Foundation, Inc. # received a copy with calc; if not, write to Free Software Foundation, Inc.
# 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. # 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
# #
MAKEFILE_REV= $$Revision: 30.54 $$ MAKEFILE_REV= $$Revision: 30.58 $$
# @(#) $Id: Makefile.ship,v 30.54 2013/08/11 05:40:18 chongo Exp $ # @(#) $Id: Makefile.ship,v 30.58 2013/08/18 20:36:50 chongo Exp $
# @(#) $Source: /usr/local/src/cmd/calc/RCS/Makefile.ship,v $ # @(#) $Source: /usr/local/src/bin/calc/RCS/Makefile.ship,v $
# #
# Under source code control: 1990/02/15 01:48:41 # Under source code control: 1990/02/15 01:48:41
# File existed as early as: before 1990 # File existed as early as: before 1990
@@ -61,7 +61,7 @@ MAKEFILE_REV= $$Revision: 30.54 $$
# #
# make ...__optional_arguments_... target=value # make ...__optional_arguments_... target=value
# Try uname -s if the target was not alreadhy set on the make command line # Try uname -s if the target was not already set on the make command line
# #
ifeq ($(target),) ifeq ($(target),)
target=$(shell uname -s 2>/dev/null) target=$(shell uname -s 2>/dev/null)
@@ -101,7 +101,7 @@ TERMCONTROL=
# If you do not have vsprintf(), then calc will try sprintf() and hope # If you do not have vsprintf(), then calc will try sprintf() and hope
# for the best. # for the best.
# #
# A simular problem occurs if your system does not have a vsnprintf() # A similar problem occurs if your system does not have a vsnprintf()
# function. This function is like the vsprintf() function except that # function. This function is like the vsprintf() function except that
# there is an extra second argument that controls the maximum size # there is an extra second argument that controls the maximum size
# string that is produced. # string that is produced.
@@ -249,7 +249,7 @@ INODE_BITS=
# If HAVE_OFFSCL is empty, this Makefile will run the have_offscl program # If HAVE_OFFSCL is empty, this Makefile will run the have_offscl program
# to determine if off_t is a scalar. If HAVE_OFFSCL is set to the value # to determine if off_t is a scalar. If HAVE_OFFSCL is set to the value
# -DOFF_T_NON_SCALAR when calc will assume that off_t some sort of # -DOFF_T_NON_SCALAR when calc will assume that off_t some sort of
# union or struct which. # union or struct.
# #
# If in doubt, leave HAVE_OFFSCL empty and this Makefile will figure it out. # If in doubt, leave HAVE_OFFSCL empty and this Makefile will figure it out.
# #
@@ -265,7 +265,7 @@ HAVE_OFFSCL=
# to determine if off_t is a scalar, or if there is no off_t and long # to determine if off_t is a scalar, or if there is no off_t and long
# (a scalar) should be used instead. If HAVE_POSSCL is set to the value # (a scalar) should be used instead. If HAVE_POSSCL is set to the value
# -DFILEPOS_NON_SCALAR when calc will assume that fpos_t exists and is # -DFILEPOS_NON_SCALAR when calc will assume that fpos_t exists and is
# some sort of union or struct which. # some sort of union or struct.
# #
# If in doubt, leave HAVE_POSSCL empty and this Makefile will figure it out. # If in doubt, leave HAVE_POSSCL empty and this Makefile will figure it out.
# #
@@ -286,7 +286,7 @@ HAVE_CONST=
# Determine if we have uid_t # Determine if we have uid_t
# #
# If HAVE_UID_T is empty, this Makefile will run the have_uid_t program # If HAVE_UID_T is empty, this Makefile will run the have_uid_t program
# to determine if const is supported. If HAVE_UID_T is set to -DHAVE_NO_UID_T, # to determine if uid_t is supported. If HAVE_UID_T is set to -DHAVE_NO_UID_T,
# then calc will treat uid_t as an unsigned short. This only matters if # then calc will treat uid_t as an unsigned short. This only matters if
# $HOME is not set and calc must look up the home directory in /etc/passwd. # $HOME is not set and calc must look up the home directory in /etc/passwd.
# #
@@ -313,7 +313,7 @@ HAVE_NEWSTR=
# If HAVE_MEMMOVE is empty, this Makefile will run the have_memmv program # If HAVE_MEMMOVE is empty, this Makefile will run the have_memmv program
# to determine if memmove() is supported. If HAVE_MEMMOVE is set to # to determine if memmove() is supported. If HAVE_MEMMOVE is set to
# -DHAVE_NO_MEMMOVE, then calc will use internal functions to simulate # -DHAVE_NO_MEMMOVE, then calc will use internal functions to simulate
# the memory move function that does correct overlapping memory modes. # the memory move function that does correct overlapping memory moves.
# #
# If in doubt, leave HAVE_MEMMOVE empty and this Makefile will figure it out. # If in doubt, leave HAVE_MEMMOVE empty and this Makefile will figure it out.
# #
@@ -322,10 +322,10 @@ HAVE_MEMMOVE=
# Determine if we have ustat() # Determine if we have ustat()
# #
# If HAVE_USTAT is empty, this Makefile will run the have_memmv program # If HAVE_USTAT is empty, this Makefile will run the have_ustat program
# to determine if ustat() is supported. If HAVE_USTAT is set to # to determine if ustat() is supported. If HAVE_USTAT is set to
# -DHAVE_NO_USTAT, then calc will use internal functions to simulate # -DHAVE_NO_USTAT, then calc will use internal functions to simulate
# the memory move function that does correct overlapping memory modes. # the ustat() function that gets file system statistics.
# #
# Select HAVE_USTAT= -DHAVE_NO_USTAT for DJGPP. # Select HAVE_USTAT= -DHAVE_NO_USTAT for DJGPP.
# #
@@ -336,10 +336,10 @@ HAVE_USTAT=
# Determine if we have getsid() # Determine if we have getsid()
# #
# If HAVE_GETSID is empty, this Makefile will run the have_memmv program # If HAVE_GETSID is empty, this Makefile will run the have_getsid program
# to determine if getsid() is supported. If HAVE_GETSID is set to # to determine if getsid() is supported. If HAVE_GETSID is set to
# -DHAVE_NO_GETSID, then calc will use internal functions to simulate # -DHAVE_NO_GETSID, then calc will use internal functions to simulate
# the memory move function that does correct overlapping memory modes. # the getsid() function that gets session ID.
# #
# Select HAVE_GETSID= -DHAVE_NO_GETSID for DJGPP. # Select HAVE_GETSID= -DHAVE_NO_GETSID for DJGPP.
# #
@@ -350,10 +350,10 @@ HAVE_GETSID=
# Determine if we have getpgid() # Determine if we have getpgid()
# #
# If HAVE_GETPGID is empty, this Makefile will run the have_memmv program # If HAVE_GETPGID is empty, this Makefile will run the have_getpgid program
# to determine if getpgid() is supported. If HAVE_GETPGID is set to # to determine if getpgid() is supported. If HAVE_GETPGID is set to
# -DHAVE_NO_GETPGID, then calc will use internal functions to simulate # -DHAVE_NO_GETPGID, then calc will use internal functions to simulate
# the memory move function that does correct overlapping memory modes. # the getpgid() function that sets the process group ID.
# #
# Select HAVE_GETPGID= -DHAVE_NO_GETPGID for DJGPP. # Select HAVE_GETPGID= -DHAVE_NO_GETPGID for DJGPP.
# #
@@ -364,10 +364,10 @@ HAVE_GETPGID=
# Determine if we have clock_gettime() # Determine if we have clock_gettime()
# #
# If HAVE_GETTIME is empty, this Makefile will run the have_memmv program # If HAVE_GETTIME is empty, this Makefile will run the have_gettime program
# to determine if clock_gettime() is supported. If HAVE_GETTIME is set to # to determine if clock_gettime() is supported. If HAVE_GETTIME is set to
# -DHAVE_NO_GETTIME, then calc will use internal functions to simulate # -DHAVE_NO_GETTIME, then calc will use internal functions to simulate
# the memory move function that does correct overlapping memory modes. # the clock_gettime() function.
# #
# Select HAVE_GETTIME= -DHAVE_NO_GETTIME for DJGPP. # Select HAVE_GETTIME= -DHAVE_NO_GETTIME for DJGPP.
# #
@@ -378,10 +378,10 @@ HAVE_GETTIME=
# Determine if we have getprid() # Determine if we have getprid()
# #
# If HAVE_GETPRID is empty, this Makefile will run the have_memmv program # If HAVE_GETPRID is empty, this Makefile will run the have_getprid program
# to determine if getprid() is supported. If HAVE_GETPRID is set to # to determine if getprid() is supported. If HAVE_GETPRID is set to
# -DHAVE_NO_GETPRID, then calc will use internal functions to simulate # -DHAVE_NO_GETPRID, then calc will use internal functions to simulate
# the memory move function that does correct overlapping memory modes. # the getprid() function.
# #
# Select HAVE_GETPRID= -DHAVE_NO_GETPRID for DJGPP. # Select HAVE_GETPRID= -DHAVE_NO_GETPRID for DJGPP.
# #
@@ -392,7 +392,7 @@ HAVE_GETPRID=
# Determine if we have the /dev/urandom # Determine if we have the /dev/urandom
# #
# HAVE_URANDOM_H= let the Makefile look /dev/urandom # HAVE_URANDOM_H= let the Makefile look for /dev/urandom
# HAVE_URANDOM_H= YES assume that /dev/urandom exists # HAVE_URANDOM_H= YES assume that /dev/urandom exists
# HAVE_URANDOM_H= NO assume that /dev/urandom does not exist # HAVE_URANDOM_H= NO assume that /dev/urandom does not exist
# #
@@ -406,10 +406,10 @@ HAVE_URANDOM_H=
# Determine if we have getrusage() # Determine if we have getrusage()
# #
# If HAVE_GETRUSAGE is empty, this Makefile will run the have_memmv program # If HAVE_GETRUSAGE is empty, this Makefile will run the have_rusage program
# to determine if getrusage() is supported. If HAVE_GETRUSAGE is set to # to determine if getrusage() is supported. If HAVE_GETRUSAGE is set to
# -DHAVE_NO_GETRUSAGE, then calc will use internal functions to simulate # -DHAVE_NO_GETRUSAGE, then calc will use internal functions to simulate
# the memory move function that does correct overlapping memory modes. # the getrusage() function.
# #
# If in doubt, leave HAVE_GETRUSAGE empty and this Makefile will figure it out. # If in doubt, leave HAVE_GETRUSAGE empty and this Makefile will figure it out.
# #
@@ -418,10 +418,10 @@ HAVE_GETRUSAGE=
# Determine if we have strdup() # Determine if we have strdup()
# #
# If HAVE_STRDUP is empty, this Makefile will run the have_memmv program # If HAVE_STRDUP is empty, this Makefile will run the have_strdup program
# to determine if strdup() is supported. If HAVE_STRDUP is set to # to determine if strdup() is supported. If HAVE_STRDUP is set to
# -DHAVE_NO_STRDUP, then calc will use internal functions to simulate # -DHAVE_NO_STRDUP, then calc will use internal functions to simulate
# the memory move function that does correct overlapping memory modes. # the strdup() function.
# #
# If in doubt, leave HAVE_STRDUP empty and this Makefile will figure it out. # If in doubt, leave HAVE_STRDUP empty and this Makefile will figure it out.
# #
@@ -429,7 +429,7 @@ HAVE_STRDUP=
#HAVE_STRDUP= -DHAVE_NO_STRDUP #HAVE_STRDUP= -DHAVE_NO_STRDUP
# Some architectures such as Sparc do not allow one to access 32 bit values # Some architectures such as Sparc do not allow one to access 32 bit values
# that are not alligned on a 32 bit boundary. # that are not aligned on a 32 bit boundary.
# #
# The Dec Alpha running OSF/1 will produce alignment error messages when # The Dec Alpha running OSF/1 will produce alignment error messages when
# align32.c tries to figure out if alignment is needed. Use the # align32.c tries to figure out if alignment is needed. Use the
@@ -587,7 +587,7 @@ HAVE_UNUSED=
#INCDIR= /dev/env/DJDIR/include #INCDIR= /dev/env/DJDIR/include
INCDIR= /usr/include INCDIR= /usr/include
# Where to install calc realted things # Where to install calc related things
# #
# ${BINDIR} where to install calc binary files # ${BINDIR} where to install calc binary files
# ${LIBDIR} where calc link library (*.a) files are installed # ${LIBDIR} where calc link library (*.a) files are installed
@@ -754,12 +754,12 @@ CATEXT= 1
# If NROFF is non-empty, then # If NROFF is non-empty, then
# #
# ${NROFF} ${NROFF_ARG} calc.1 > ${CATDIR}/calc.${CATEXT} # ${NROFF} ${NROFF_ARG} calc.1 > ${CATDIR}/calc.${CATEXT}
# is used to built and install the cat page # is used to build and install the cat page
# #
# else (NROFF is empty) # else (NROFF is empty)
# #
# ${MANMAKE} calc.1 ${CATDIR} # ${MANMAKE} calc.1 ${CATDIR}
# is used to built and install the cat page # is used to build and install the cat page
# else # else
# #
# The cat page is not built or installed # The cat page is not built or installed
@@ -783,7 +783,7 @@ CATMODE= 0444
# By default, custom builtin functions may only be executed if calc # By default, custom builtin functions may only be executed if calc
# is given the -C option. This is because custom builtin functions # is given the -C option. This is because custom builtin functions
# may invoke non-standard or non-portable code. One may completely # may invoke non-standard or non-portable code. One may completely
# disable custom builtin functions by not compiling any of code # disable custom builtin functions by not compiling any custom code
# #
# ALLOW_CUSTOM= -DCUSTOM # allow custom only if -C is given # ALLOW_CUSTOM= -DCUSTOM # allow custom only if -C is given
# ALLOW_CUSTOM= # disable custom even if -C is given # ALLOW_CUSTOM= # disable custom even if -C is given
@@ -794,7 +794,7 @@ ALLOW_CUSTOM= -DCUSTOM
#ALLOW_CUSTOM= #ALLOW_CUSTOM=
# If the $CALCPATH environment variable is not defined, then the following # If the $CALCPATH environment variable is not defined, then the following
# path will be search for calc resource file routines. # path will be searched for calc resource file routines.
# #
# Select CALCPATH= .;./cal;~/.cal;${CALC_SHAREDIR};${CUSTOMCALDIR} for DJGPP. # Select CALCPATH= .;./cal;~/.cal;${CALC_SHAREDIR};${CUSTOMCALDIR} for DJGPP.
# #
@@ -809,7 +809,7 @@ endif
#endif /* end of skip for non-Gnu makefiles */ #endif /* end of skip for non-Gnu makefiles */
# If the $CALCRC environment variable is not defined, then the following # If the $CALCRC environment variable is not defined, then the following
# path will be search for calc resource files. # path will be searched for calc resource files.
# #
# Select CALCRC= ${CALC_SHAREDIR}/startup;~/.calcrc;./.calcinit for DJGPP. # Select CALCRC= ${CALC_SHAREDIR}/startup;~/.calcrc;./.calcinit for DJGPP.
# #
@@ -817,7 +817,7 @@ CALCRC= ${CALC_SHAREDIR}/startup:~/.calcrc:./.calcinit
#CALCRC= ${CALC_SHAREDIR}/startup;~/.calcrc;./.calcinit #CALCRC= ${CALC_SHAREDIR}/startup;~/.calcrc;./.calcinit
# Determine of the GNU-readline facility will be used instead of the # Determine of the GNU-readline facility will be used instead of the
# built-in calc binding method. # builtin calc binding method.
# #
# USE_READLINE= Do not use GNU-readline, use calc bindings # USE_READLINE= Do not use GNU-readline, use calc bindings
# USE_READLINE= -DUSE_READLINE Use GNU-readline, do not use calc bindings # USE_READLINE= -DUSE_READLINE Use GNU-readline, do not use calc bindings
@@ -910,7 +910,7 @@ RANLIB=ranlib
# Normally certain files depend on the Makefile. If the Makefile is # Normally certain files depend on the Makefile. If the Makefile is
# changed, then certain steps should be redone. If MAKE_FILE is # changed, then certain steps should be redone. If MAKE_FILE is
# set to Makefile, then these files will depend on Makefile. If # set to Makefile, then these files will depend on Makefile. If
# MAKE_FILE is empty, then they wont. # MAKE_FILE is empty, then they won't.
# #
# If in doubt, set MAKE_FILE to Makefile # If in doubt, set MAKE_FILE to Makefile
# #
@@ -971,9 +971,9 @@ CALC_ENV= CALCPATH=./cal LD_LIBRARY_PATH=.
# #
# ${MKDIR} ${MKDIR_ARG} # ${MKDIR} ${MKDIR_ARG}
# #
# to create directorties. Normall this amounts to usins mkdir -p dir ... # to create directories. Normally this amounts to using mkdir -p dir ...
# Some older systems may not have mkdir -p. If you system does not # Some older systems may not have mkdir -p. If your system does not
# make mkdir -p, then set MKDIR_ARG to empty. # have mkdir -p, then set MKDIR_ARG to empty.
# #
# MKDIR_ARG= -p # use mkdir -p when creating paths # MKDIR_ARG= -p # use mkdir -p when creating paths
# MKDIR_ARG= # use if system does not understand mkdir -p # MKDIR_ARG= # use if system does not understand mkdir -p
@@ -982,7 +982,7 @@ MKDIR_ARG= -p
#MKDIR_ARG= #MKDIR_ARG=
# Some out of date operating systems require/want an executable to # Some out of date operating systems require/want an executable to
# end with a certain file extension. Some compile systems such as # end with a certain file extension. Some compiler systems such as
# windoz build calc as calc.exe. The EXT variable is used to denote # windoz build calc as calc.exe. The EXT variable is used to denote
# the extension required by such. Note that Cygwin requires EXT to be # the extension required by such. Note that Cygwin requires EXT to be
# the same as Linux/Un*x/GNU, even though it runs under windoz. # the same as Linux/Un*x/GNU, even though it runs under windoz.
@@ -997,7 +997,7 @@ EXT=
# The default calc versions # The default calc versions
# #
VERSION= 2.12.4.10 VERSION= 2.12.4.11
VERS= 2.12.4 VERS= 2.12.4
VER= 2.12 VER= 2.12
VE= 2 VE= 2
@@ -1048,11 +1048,11 @@ STRIP= strip
# Extra compiling and linking flags # Extra compiling and linking flags
# #
# EXTRA_CFLAGS are flags given to ${CC} when compiling C files # EXTRA_CFLAGS are flags given to ${CC} when compiling C files
# EXTRA_LDFLAGS are flags given to ${CC} when linking progs # EXTRA_LDFLAGS are flags given to ${CC} when linking programs
# #
# Both CFLAGS and LDFLAGS are left blank in this Makefile by # Both CFLAGS and LDFLAGS are left blank in this Makefile by
# default so that users may use them on the make command line # default so that users may use them on the make command line
# to always the way that C is compiled and files are linked # to always set the way that C is compiled and files are linked
# respectively. For example: # respectively. For example:
# #
# make all EXTRA_CFLAGS="-DMAGIC" EXTRA_LDFLAGS="-lmagic" # make all EXTRA_CFLAGS="-DMAGIC" EXTRA_LDFLAGS="-lmagic"
@@ -1060,13 +1060,13 @@ STRIP= strip
# NOTE: These should be left blank in this Makefile to make it # NOTE: These should be left blank in this Makefile to make it
# easier to add stuff on the command line. If you want to # easier to add stuff on the command line. If you want to
# to change the way calc is compiled by this Makefile, change # to change the way calc is compiled by this Makefile, change
# the appropirate host target section below or a flag above. # the appropriate host target section below or a flag above.
# #
EXTRA_CFLAGS= EXTRA_CFLAGS=
EXTRA_LDFLAGS= EXTRA_LDFLAGS=
# COMMON_CFLAGS are the common ${CC} flags used for all progs, both # COMMON_CFLAGS are the common ${CC} flags used for all programs, both
# intermediate and final calc and calc related progs # intermediate and final calc and calc related programs
# #
#if 0 /* start of skip for non-Gnu makefiles */ #if 0 /* start of skip for non-Gnu makefiles */
ifdef ALLOW_CUSTOM ifdef ALLOW_CUSTOM
@@ -1078,8 +1078,8 @@ COMMON_CFLAGS= -DCALC_SRC -UCUSTOM ${CCWARN} ${CCMISC} ${EXTRA_CFLAGS}
endif endif
#endif /* end of skip for non-Gnu makefiles */ #endif /* end of skip for non-Gnu makefiles */
# COMMON_LDFLAGS are the common flags used for linking all progs, both # COMMON_LDFLAGS are the common flags used for linking all programs, both
# intermediate and final calc and calc related progs # intermediate and final calc and calc related programs
# #
COMMON_LDFLAGS= ${EXTRA_LDFLAGS} COMMON_LDFLAGS= ${EXTRA_LDFLAGS}
@@ -1097,16 +1097,16 @@ COMMON_LDFLAGS= ${EXTRA_LDFLAGS}
# BLD_TYPE= calc-static-only # BLD_TYPE= calc-static-only
# #
# CC_SHARE are flags given to ${CC} to build .o files suitable for shared libs # CC_SHARE are flags given to ${CC} to build .o files suitable for shared libs
# DEFAULT_LIB_INSTALL_PATH is where calc progs look for calc shared libs # DEFAULT_LIB_INSTALL_PATH is where calc programs look for calc shared libs
# LD_SHARE are common flags given to ${CC} to link with shared libraries # LD_SHARE are common flags given to ${CC} to link with shared libraries
# LIBCALC_SHLIB are flags given to ${CC} to build libcalc shared lib # LIBCALC_SHLIB are flags given to ${CC} to build libcalc shared libraries
# LIBCUSTCALC_SHLIB are flags given to ${CC} to build libcustcalc shared lib # LIBCUSTCALC_SHLIB are flags given to ${CC} to build libcustcalc shared lib
# #
# NOTE: The above 4 values are unused if BLD_TYPE= calc-static-only # NOTE: The above 4 values are unused if BLD_TYPE= calc-static-only
# #
# CC_STATIC are flags given to ${CC} to build .o files suitable for static libs # CC_STATIC are flags given to ${CC} to build .o files suitable for static libs
# LD_STATIC are common flags given to ${CC} to link with static libraries # LD_STATIC are common flags given to ${CC} to link with static libraries
# LIBCALC_STATIC are flags given to ${CC} to build libcalc static lib # LIBCALC_STATIC are flags given to ${CC} to build libcalc static libraries
# LIBCUSTCALC_STATIC are flags given to ${CC} to build libcustcalc static lib # LIBCUSTCALC_STATIC are flags given to ${CC} to build libcustcalc static lib
# #
# NOTE: The above 4 values are unused if BLD_TYPE= calc-dynamic-only # NOTE: The above 4 values are unused if BLD_TYPE= calc-dynamic-only
@@ -1119,7 +1119,7 @@ COMMON_LDFLAGS= ${EXTRA_LDFLAGS}
# to abort on warnings, then leave CCWERR blank. # to abort on warnings, then leave CCWERR blank.
# CCMISC are misc flags given to ${CC} # CCMISC are misc flags given to ${CC}
# #
# LCC how the C compiler is invoked on locally executed intermediate progs # LCC is how the C compiler is invoked on locally executed intermediate programs
# CC is how the C compiler is invoked (with an optional Purify) # CC is how the C compiler is invoked (with an optional Purify)
# #
# Specific target overrides or modifications to default values # Specific target overrides or modifications to default values
@@ -1200,7 +1200,7 @@ CCMISC= ${DARWIN_ARCH}
LCC= MACOSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET} gcc LCC= MACOSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET} gcc
CC= ${PURIFY} ${LCC} ${CCWERR} CC= ${PURIFY} ${LCC} ${CCWERR}
# #
# Darmin dynamic shared lib filenames # Darwin dynamic shared lib filenames
LIB_EXT:= .dylib LIB_EXT:= .dylib
LIB_EXT_VERSION:= .${VERSION}${LIB_EXT} LIB_EXT_VERSION:= .${VERSION}${LIB_EXT}
LIB_EXT_VERS:= .${VERS}${LIB_EXT} LIB_EXT_VERS:= .${VERS}${LIB_EXT}
@@ -1403,10 +1403,10 @@ CC= ${PURIFY} ${LCC} ${CCWERR}
# #
# The simple makefile forces the use of static ${CC} flags # The simple makefile forces the use of static ${CC} flags
# #
# ICFLAGS are given to ${CC} for intermediate progs used to help compile calc # ICFLAGS are given to ${CC} for intermediate programs used to help compile calc
# CFLAGS are given to ${CC} for calc progs other than intermediate progs # CFLAGS are given to ${CC} for calc programs other than intermediate programs
# ILDFLAGS for ${CC} in linking intermediate progs used to help compile calc # ILDFLAGS for ${CC} in linking intermediate programs used to help compile calc
# LDFLAGS for ${CC} in linking calc progs other than intermediate progs # LDFLAGS for ${CC} in linking calc programs other than intermediate programs
# #
ICFLAGS= ${COMMON_CFLAGS} ${CC_STATIC} ICFLAGS= ${COMMON_CFLAGS} ${CC_STATIC}
CFLAGS= ${ICFLAGS} ${CCOPT} CFLAGS= ${ICFLAGS} ${CCOPT}
@@ -1506,8 +1506,8 @@ endif
# Required flags to compile C files for calc # Required flags to compile C files for calc
# #
# ICFLAGS are given to ${CC} for intermediate progs used to help compile calc # ICFLAGS are given to ${CC} for intermediate programs used to help compile calc
# CFLAGS are given to ${CC} for calc progs other than intermediate progs # CFLAGS are given to ${CC} for calc programs other than intermediate programs
# #
# NOTE: This does not work for: make-XYZ-only and BLD_TYPE != make-XYZ-only # NOTE: This does not work for: make-XYZ-only and BLD_TYPE != make-XYZ-only
# #
@@ -1520,8 +1520,8 @@ CFLAGS= ${ICFLAGS} ${CCOPT}
# Required flags to link files for calc # Required flags to link files for calc
# #
# ILDFLAGS for ${CC} in linking intermediate progs used to help compile calc # ILDFLAGS for ${CC} in linking intermediate programs used to help compile calc
# LDFLAGS for ${CC} in linking calc progs other than intermediate progs # LDFLAGS for ${CC} in linking calc programs other than intermediate programs
# #
ILDFLAGS= ${COMMON_LDFLAGS} ILDFLAGS= ${COMMON_LDFLAGS}
LDFLAGS= ${LD_DEBUG} ${ILDFLAGS} LDFLAGS= ${LD_DEBUG} ${ILDFLAGS}
@@ -1740,7 +1740,7 @@ CUSTOM_PASSDOWN= \
VERSION=${VERSION} \ VERSION=${VERSION} \
target=${target} target=${target}
# The compelte list of Makefile vars passed down to help/Makefile. # The complete list of Makefile vars passed down to help/Makefile.
# #
HELP_PASSDOWN= \ HELP_PASSDOWN= \
AR=${AR} \ AR=${AR} \
@@ -1777,7 +1777,7 @@ HELP_PASSDOWN= \
TOUCH=${TOUCH} \ TOUCH=${TOUCH} \
TRUE=${TRUE} TRUE=${TRUE}
# The compelte list of Makefile vars passed down to cal/Makefile. # The complete list of Makefile vars passed down to cal/Makefile.
# #
CAL_PASSDOWN= \ CAL_PASSDOWN= \
AR=${AR} \ AR=${AR} \
@@ -1805,7 +1805,7 @@ CAL_PASSDOWN= \
TOUCH=${TOUCH} \ TOUCH=${TOUCH} \
TRUE=${TRUE} TRUE=${TRUE}
# The compelte list of Makefile vars passed down to cscript/Makefile. # The complete list of Makefile vars passed down to cscript/Makefile.
# #
CSCRIPT_PASSDOWN= \ CSCRIPT_PASSDOWN= \
AR=${AR} \ AR=${AR} \
@@ -1854,7 +1854,7 @@ DISTLIST= ${C_SRC} ${H_SRC} ${MAKE_FILE} BUGS CHANGES LIBRARY README \
README.WINDOWS calc.man HOWTO.INSTALL ${UTIL_MISC_SRC} ${LICENSE} \ README.WINDOWS calc.man HOWTO.INSTALL ${UTIL_MISC_SRC} ${LICENSE} \
sample.README calc.spec.in rpm.mk sample.README calc.spec.in rpm.mk
# These files are used to make (but not built) a calc .a link library # These files are used to make (but not build) a calc .a link library
# #
CALCLIBLIST= ${LIBSRC} ${UTIL_C_SRC} ${LIB_H_SRC} ${MAKE_FILE} \ CALCLIBLIST= ${LIBSRC} ${UTIL_C_SRC} ${LIB_H_SRC} ${MAKE_FILE} \
${UTIL_MISC_SRC} BUGS CHANGES LIBRARY ${UTIL_MISC_SRC} BUGS CHANGES LIBRARY
@@ -1875,7 +1875,7 @@ CALC_STATIC_LIBS= libcalc.a
endif endif
#endif /* end of skip for non-Gnu makefiles */ #endif /* end of skip for non-Gnu makefiles */
# Libaraies created and used to build calc # Libraries created and used to build calc
# #
#if 0 /* start of skip for non-Gnu makefiles */ #if 0 /* start of skip for non-Gnu makefiles */
ifdef ALLOW_CUSTOM ifdef ALLOW_CUSTOM
@@ -1887,7 +1887,7 @@ CALC_DYNAMIC_LIBS= libcalc${LIB_EXT_VERSION}
endif endif
#endif /* end of skip for non-Gnu makefiles */ #endif /* end of skip for non-Gnu makefiles */
# Symlinks of dymanic shared libraries # Symlinks of dynamic shared libraries
# #
#if 0 /* start of skip for non-Gnu makefiles */ #if 0 /* start of skip for non-Gnu makefiles */
ifdef ALLOW_CUSTOM ifdef ALLOW_CUSTOM
@@ -1903,7 +1903,7 @@ SYM_DYNAMIC_LIBS= libcalc${LIB_EXT_VER} libcalc${LIB_EXT_VE} libcalc${LIB_EXT} \
endif endif
#endif /* end of skip for non-Gnu makefiles */ #endif /* end of skip for non-Gnu makefiles */
# list of sample programs to that need to be built to satisfy sample rule # list of sample programs that need to be built to satisfy sample rule
# #
# NOTE: The ${SAMPLE_TARGETS} and ${SAMPLE_STATIC_TARGETS} are built but # NOTE: The ${SAMPLE_TARGETS} and ${SAMPLE_STATIC_TARGETS} are built but
# not installed at this time. # not installed at this time.
@@ -1914,7 +1914,7 @@ endif
SAMPLE_TARGETS= sample_rand${EXT} sample_many${EXT} SAMPLE_TARGETS= sample_rand${EXT} sample_many${EXT}
SAMPLE_STATIC_TARGETS= sample_rand-static${EXT} sample_many-static${EXT} SAMPLE_STATIC_TARGETS= sample_rand-static${EXT} sample_many-static${EXT}
# list of cscript programs to that need to be built to satisfy cscript/.all # list of cscript programs that need to be built to satisfy cscript/.all
# #
# NOTE: This list MUST be coordinated with the ${CSCRIPT_TARGETS} variable # NOTE: This list MUST be coordinated with the ${CSCRIPT_TARGETS} variable
# in the cscript/Makefile # in the cscript/Makefile
@@ -1977,7 +1977,7 @@ calc-dynamic-only: ${DYNAMIC_FIRST_TARGETS} ${EARLY_TARGETS} \
echo " ${MAKE} -f ${MAKE_FILE} clobber" 1>&2; \ echo " ${MAKE} -f ${MAKE_FILE} clobber" 1>&2; \
echo " ${MAKE} -f ${MAKE_FILE} $$r BLD_TYPE=$$r" 1>&2; \ echo " ${MAKE} -f ${MAKE_FILE} $$r BLD_TYPE=$$r" 1>&2; \
echo "" 1>&2; \ echo "" 1>&2; \
echo "NOTE: It is a very good idea to c first clobber any" 1>&2; \ echo "NOTE: It is a very good idea to first clobber any" 1>&2; \
echo " previously built .o, libs and executables" 1>&2; \ echo " previously built .o, libs and executables" 1>&2; \
echo " before switching to $$r!" 1>&2; \ echo " before switching to $$r!" 1>&2; \
echo "" 1>&2; \ echo "" 1>&2; \
@@ -1993,7 +1993,7 @@ calc-dynamic-only: ${DYNAMIC_FIRST_TARGETS} ${EARLY_TARGETS} \
echo " ${MAKE} -f ${MAKE_FILE} clobber" 1>&2; \ echo " ${MAKE} -f ${MAKE_FILE} clobber" 1>&2; \
echo " ${MAKE} -f ${MAKE_FILE} $$r BLD_TYPE=$$r" 1>&2; \ echo " ${MAKE} -f ${MAKE_FILE} $$r BLD_TYPE=$$r" 1>&2; \
echo "" 1>&2; \ echo "" 1>&2; \
echo "to clean out any previously build static files." 1>&2; \ echo "to clean out any previously built static files." 1>&2; \
echo "" 1>&2; \ echo "" 1>&2; \
echo "=== aborting make ===" 1>&2; \ echo "=== aborting make ===" 1>&2; \
exit 2; \ exit 2; \
@@ -2023,7 +2023,7 @@ calc-static-only: ${STATIC_FIRST_TARGETS} ${EARLY_TARGETS} \
echo " ${MAKE} -f ${MAKE_FILE} clobber" 1>&2; \ echo " ${MAKE} -f ${MAKE_FILE} clobber" 1>&2; \
echo " ${MAKE} -f ${MAKE_FILE} $$r BLD_TYPE=$$r" 1>&2; \ echo " ${MAKE} -f ${MAKE_FILE} $$r BLD_TYPE=$$r" 1>&2; \
echo "" 1>&2; \ echo "" 1>&2; \
echo "NOTE: It is a very good idea to c first clobber any" 1>&2; \ echo "NOTE: It is a very good idea to first clobber any" 1>&2; \
echo " previously built .o, libs and executables" 1>&2; \ echo " previously built .o, libs and executables" 1>&2; \
echo " before switching to $$r!" 1>&2; \ echo " before switching to $$r!" 1>&2; \
echo "" 1>&2; \ echo "" 1>&2; \
@@ -2039,7 +2039,7 @@ calc-static-only: ${STATIC_FIRST_TARGETS} ${EARLY_TARGETS} \
echo " ${MAKE} -f ${MAKE_FILE} clobber" 1>&2; \ echo " ${MAKE} -f ${MAKE_FILE} clobber" 1>&2; \
echo " ${MAKE} -f ${MAKE_FILE} $$r BLD_TYPE=$$r" 1>&2; \ echo " ${MAKE} -f ${MAKE_FILE} $$r BLD_TYPE=$$r" 1>&2; \
echo "" 1>&2; \ echo "" 1>&2; \
echo "to clean out any previously build dynamic files." 1>&2; \ echo "to clean out any previously built dynamic files." 1>&2; \
echo "" 1>&2; \ echo "" 1>&2; \
echo "=== aborting make ===" 1>&2; \ echo "=== aborting make ===" 1>&2; \
exit 4; \ exit 4; \
@@ -2136,7 +2136,7 @@ seed.o: seed.c no_implicit.arg ${MAKE_FILE}
# #
# The next set of rules cause the .h files BUILD_H_SRC files to be built # The next set of rules cause the .h files BUILD_H_SRC files to be built
# according to the system and the Makefile variables above. The hsrc rule # according to the system and the Makefile variables above. The hsrc rule
# is a convenient rule to invoke to built all of the BUILD_H_SRC. # is a convenient rule to invoke to build all of the BUILD_H_SRC.
# #
# We add in the BUILD_C_SRC files because they are similar to the # We add in the BUILD_C_SRC files because they are similar to the
# BUILD_H_SRC files in terms of the build process. # BUILD_H_SRC files in terms of the build process.
@@ -3592,7 +3592,7 @@ endif
### ###
# #
# building calc-static and static lib*.a libraires # building calc-static and static lib*.a libraries
# #
### ###
@@ -3631,10 +3631,10 @@ sample_many-static${EXT}: sample_many.o ${CALC_STATIC_LIBS} ${MAKE_FILE}
### ###
# #
# Home grown make dependency rules. Your system make not support # Homegrown make dependency rules. Your system may not support
# or have the needed tools. You can ignore this section. # or have the needed tools. You can ignore this section.
# #
# We will form a skelaton tree of *.c files containing only #include "foo.h" # We will form a skeleton tree of *.c files containing only #include "foo.h"
# lines and .h files containing the same lines surrounded by multiple include # lines and .h files containing the same lines surrounded by multiple include
# prevention lines. This allows us to build a static depend list that will # prevention lines. This allows us to build a static depend list that will
# satisfy all possible cpp symbol definition combinations. # satisfy all possible cpp symbol definition combinations.
@@ -3744,21 +3744,21 @@ h_list:
# 1 level version string. # 1 level version string.
# #
# version: # version:
# This rule simply echos the value found in this makefile. # This rule simply echoes the value found in this makefile.
# This rule produces the full version string. Note that the # This rule produces the full version string. Note that the
# full version could be 4 or 3 levels long depending on the # full version could be 4 or 3 levels long depending on the
# minor patch number. # minor patch number.
# #
# vers: # vers:
# This rule simply echos the value found in this makefile. # This rule simply echoes the value found in this makefile.
# This rule produces only a 3 level version string. # This rule produces only a 3 level version string.
# #
# ver: # ver:
# This rule simply echos the value found in this makefile. # This rule simply echoes the value found in this makefile.
# This rule produces only a 2 level version string. # This rule produces only a 2 level version string.
# #
# ve: # ve:
# This rule simply echos the value found in this makefile. # This rule simply echoes the value found in this makefile.
# This rule produces only a 1 level version string. # This rule produces only a 1 level version string.
# #
### ###
@@ -3876,7 +3876,7 @@ custom/Makefile.simple: custom/Makefile
# #
# Doing a 'make chk' will cause only the context around interesting # Doing a 'make chk' will cause only the context around interesting
# (and error) messages to be printed. Unlike 'make check', this # (and error) messages to be printed. Unlike 'make check', this
# rule does not cause things to be built. I.e., the all rule is # rule does not cause things to be built. i.e., the all rule is
# not invoked. # not invoked.
# #
### ###
@@ -4072,34 +4072,38 @@ env:
mkdebug: env version.c mkdebug: env version.c
@echo '=-=-=-=-= ${MAKE_FILE} start of $@ rule =-=-=-=-=' @echo '=-=-=-=-= ${MAKE_FILE} start of $@ rule =-=-=-=-='
@echo '=-=-=-=-= Determining the source version =-=-=-=-=' @echo '=-=-=-= Determining the source version =-=-=-='
@${MAKE} -f Makefile Q= V=@ ver_calc${EXT} @${MAKE} -f Makefile Q= V=@ ver_calc${EXT}
-@./ver_calc${EXT} -@./ver_calc${EXT}
@echo '=-=-=-=-= Invoking ${MAKE} -f Makefile Q= V=@ all =-=-=-=-=' @echo '=-=-=-= Invoking ${MAKE} -f Makefile Q= V=@ all =-=-=-='
@${MAKE} -f Makefile Q= V=@ all @${MAKE} -f Makefile Q= V=@ all
@echo '=-=-=-=-= Back to the main Makefile for $@ rule =-=-=-=-=' @echo '=-=-=-= Back to the main Makefile for $@ rule =-=-=-='
@echo '=-=-=-=-= Determining the binary version =-=-=-=-=' @echo '=-=-=-= Determining the binary version =-=-=-='
-@./calc${EXT} -e -q -v -@./calc${EXT} -e -q -v
@echo '=-=-=-=-= Back to the main Makefile for $@ rule =-=-=-=-=' @echo '=-=-=-= Back to the main Makefile for $@ rule =-=-=-='
@echo '=-=-=-=-= ${MAKE_FILE} end of $@ rule =-=-=-=-=' @echo '=-=-=-=-= ${MAKE_FILE} end of $@ rule =-=-=-=-='
debug: env debug: env
@echo '=-=-=-=-= ${MAKE_FILE} start of $@ rule =-=-=-=-=' @echo '=-=-=-=-= ${MAKE_FILE} start of $@ rule =-=-=-=-='
@echo '=-=-=-=-= Invoking ${MAKE} -f Makefile Q= V=@ clobber =-=-=-=-=' @echo '=-=-=-= Invoking ${MAKE} -f Makefile Q= V=@ clobber =-=-=-='
@${MAKE} -f Makefile Q= V=@ clobber @${MAKE} -f Makefile Q= V=@ clobber
@echo '=-=-=-=-= Back to the main Makefile for $@ rule =-=-=-=-=' @echo '=-=-=-= Back to the main Makefile for $@ rule =-=-=-='
@echo '=-=-=-=-= Determining the source version =-=-=-=-=' @echo '=-=-=-= Invoking ${MAKE} -f Makefile Q= V=@ all =-=-=-='
@echo '=-=-= this may take a bit of time =-=-='
@${MAKE} -f Makefile Q= V=@ all
@echo '=-=-=-= Back to the main Makefile for $@ rule =-=-=-='
@echo '=-=-=-= Determining the source version =-=-=-='
@${MAKE} -f Makefile Q= V=@ ver_calc${EXT} @${MAKE} -f Makefile Q= V=@ ver_calc${EXT}
-@./ver_calc${EXT} -@./ver_calc${EXT}
@echo '=-=-=-=-= Invoking ${MAKE} -f Makefile Q= V=@ all =-=-=-=-=' @echo '=-=-=-= Back to the main Makefile for $@ rule =-=-=-='
@${MAKE} -f Makefile Q= V=@ all @echo -n '=-=-=-= Print #defile values if custom functions '
@echo '=-=-=-=-= Determining the binary version =-=-=-=-=' @echo 'are allowed =-=-=-='
-@./calc${EXT} -e -q -v -@./calc${EXT} -e -q -C 'print custom("sysinfo", 2);'
@echo '=-=-=-=-= Back to the main Makefile for $@ rule =-=-=-=-=' @echo '=-=-=-= Back to the main Makefile for $@ rule =-=-=-='
@echo '=-=-=-=-= Invoking ${MAKE} -f Makefile Q= V=@ chk =-=-=-=-=' @echo '=-=-=-= Invoking ${MAKE} -f Makefile Q= V=@ check =-=-=-='
@echo '=-=-=-=-= this may take a while =-=-=-=-=' @echo '=-=-= this may take a while =-=-='
@${MAKE} -f Makefile Q= V=@ chk @${MAKE} -f Makefile Q= V=@ check
@echo '=-=-=-=-= Back to the main Makefile for $@ rule =-=-=-=-=' @echo '=-=-=-= Back to the main Makefile for $@ rule =-=-=-='
@echo '=-=-=-=-= ${MAKE_FILE} end of $@ rule =-=-=-=-=' @echo '=-=-=-=-= ${MAKE_FILE} end of $@ rule =-=-=-=-='
### ###
@@ -4210,7 +4214,7 @@ inst_files: ${MAKE_FILE} help/Makefile cal/Makefile custom/Makefile \
${Q} LANG=C ${SORT} -u inst_files -o inst_files ${Q} LANG=C ${SORT} -u inst_files -o inst_files
${V} echo '=-=-=-=-= ${MAKE_FILE} end of $@ rule =-=-=-=-=' ${V} echo '=-=-=-=-= ${MAKE_FILE} end of $@ rule =-=-=-=-='
# The olduninstall rule will remove calc files from the older, histroic # The olduninstall rule will remove calc files from the older, historic
# locations under the /usr/local directory. If you are using the # locations under the /usr/local directory. If you are using the
# new default values for ${BINDIR}, ${CALC_SHAREDIR}, ${INCDIR} and ${LIBDIR} # new default values for ${BINDIR}, ${CALC_SHAREDIR}, ${INCDIR} and ${LIBDIR}
# then you can use this rule to clean out the older calc stuff under # then you can use this rule to clean out the older calc stuff under
@@ -4329,7 +4333,7 @@ clobber: custom/Makefile clean
# install everything # install everything
# #
# NOTE: Keep the uninstall rule in reverse order to the install rule # NOTE: Keep the uninstall rule in the reverse order of the install rule
# #
install: custom/Makefile ${LIB_H_SRC} ${BUILD_H_SRC} calc.1 all install: custom/Makefile ${LIB_H_SRC} ${BUILD_H_SRC} calc.1 all
${V} echo '=-=-=-=-= ${MAKE_FILE} start of $@ rule =-=-=-=-=' ${V} echo '=-=-=-=-= ${MAKE_FILE} start of $@ rule =-=-=-=-='
@@ -4636,7 +4640,7 @@ endif
# Try to remove everything that was installed # Try to remove everything that was installed
# #
# NOTE: Keep the uninstall rule in reverse order to the install rule # NOTE: Keep the uninstall rule in the reverse order of the install rule
# #
uninstall: custom/Makefile uninstall: custom/Makefile
${V} echo '=-=-=-=-= ${MAKE_FILE} start of $@ rule =-=-=-=-=' ${V} echo '=-=-=-=-= ${MAKE_FILE} start of $@ rule =-=-=-=-='
@@ -4840,7 +4844,7 @@ strip:
done done
${V} echo '=-=-=-=-= ${MAKE_FILE} end of $@ rule =-=-=-=-=' ${V} echo '=-=-=-=-= ${MAKE_FILE} end of $@ rule =-=-=-=-='
# calc-symlink - setup symlinks from stardard locations into the ${T} tree # calc-symlink - setup symlinks from standard locations into the ${T} tree
# #
calc-symlink: calc-symlink:
${Q}if [ -z "${T}" ]; then \ ${Q}if [ -z "${T}" ]; then \

View File

@@ -4,7 +4,7 @@
# #
######################################################################## ########################################################################
# Gnu makefile: # This is a Gnu make makefile. If your make does not # # Gnu makefile: # This is a Gnu make makefile. If your make does not #
# Gnu makefile: # understand this makefilkke format, then edit and use # # Gnu makefile: # understand this makefile format, then edit and use #
# Gnu makefile: # Makefile.simple instead of this Makefile. # # Gnu makefile: # Makefile.simple instead of this Makefile. #
######################################################################## ########################################################################
# #
@@ -12,12 +12,12 @@
# #
# NOTE: This is NOT the calc rpm Makefile. This Makefile is a generic # NOTE: This is NOT the calc rpm Makefile. This Makefile is a generic
# Makefile for the people who build calc from the bzip2-ed tarball. # Makefile for the people who build calc from the bzip2-ed tarball.
# Without modification, it not assume the system has readline, ncurses # Without modification, it does not assume the system has readline,
# or less. It compiles with gcc -O3 -g3 as well. You can change all # ncurses or less. It compiles with gcc -O3 -g3 as well. You can
# this by modifying the Makefile variables below. # change all this by modifying the Makefile variables below.
# #
# NOTE: You might want use the READLINE facility if your system # NOTE: You might want use the READLINE facility if your system
# has the GNU readline headers and libaraies: # has the GNU readline headers and libraries:
# #
# USE_READLINE= -DUSE_READLINE # USE_READLINE= -DUSE_READLINE
# READLINE_LIB= -lreadline # READLINE_LIB= -lreadline
@@ -26,7 +26,7 @@
# Copyright (C) 1999-2008 Landon Curt Noll # Copyright (C) 1999-2008 Landon Curt Noll
# #
# Calc is open software; you can redistribute it and/or modify it under # 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 # the terms of version 2.1 of the GNU Lesser General Public License
# as published by the Free Software Foundation. # as published by the Free Software Foundation.
# #
# Calc is distributed in the hope that it will be useful, but WITHOUT # Calc is distributed in the hope that it will be useful, but WITHOUT
@@ -39,9 +39,9 @@
# received a copy with calc; if not, write to Free Software Foundation, Inc. # received a copy with calc; if not, write to Free Software Foundation, Inc.
# 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. # 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
# #
MAKEFILE_REV= $$Revision: 30.54 $$ MAKEFILE_REV= $$Revision: 30.58 $$
# @(#) $Id: Makefile.ship,v 30.54 2013/08/11 05:40:18 chongo Exp $ # @(#) $Id: Makefile.ship,v 30.58 2013/08/18 20:36:50 chongo Exp $
# @(#) $Source: /usr/local/src/cmd/calc/RCS/Makefile.ship,v $ # @(#) $Source: /usr/local/src/bin/calc/RCS/Makefile.ship,v $
# #
# Under source code control: 1990/02/15 01:48:41 # Under source code control: 1990/02/15 01:48:41
# File existed as early as: before 1990 # File existed as early as: before 1990
@@ -86,7 +86,7 @@ TERMCONTROL=
# If you do not have vsprintf(), then calc will try sprintf() and hope # If you do not have vsprintf(), then calc will try sprintf() and hope
# for the best. # for the best.
# #
# A simular problem occurs if your system does not have a vsnprintf() # A similar problem occurs if your system does not have a vsnprintf()
# function. This function is like the vsprintf() function except that # function. This function is like the vsprintf() function except that
# there is an extra second argument that controls the maximum size # there is an extra second argument that controls the maximum size
# string that is produced. # string that is produced.
@@ -234,7 +234,7 @@ INODE_BITS=
# If HAVE_OFFSCL is empty, this Makefile will run the have_offscl program # If HAVE_OFFSCL is empty, this Makefile will run the have_offscl program
# to determine if off_t is a scalar. If HAVE_OFFSCL is set to the value # to determine if off_t is a scalar. If HAVE_OFFSCL is set to the value
# -DOFF_T_NON_SCALAR when calc will assume that off_t some sort of # -DOFF_T_NON_SCALAR when calc will assume that off_t some sort of
# union or struct which. # union or struct.
# #
# If in doubt, leave HAVE_OFFSCL empty and this Makefile will figure it out. # If in doubt, leave HAVE_OFFSCL empty and this Makefile will figure it out.
# #
@@ -250,7 +250,7 @@ HAVE_OFFSCL=
# to determine if off_t is a scalar, or if there is no off_t and long # to determine if off_t is a scalar, or if there is no off_t and long
# (a scalar) should be used instead. If HAVE_POSSCL is set to the value # (a scalar) should be used instead. If HAVE_POSSCL is set to the value
# -DFILEPOS_NON_SCALAR when calc will assume that fpos_t exists and is # -DFILEPOS_NON_SCALAR when calc will assume that fpos_t exists and is
# some sort of union or struct which. # some sort of union or struct.
# #
# If in doubt, leave HAVE_POSSCL empty and this Makefile will figure it out. # If in doubt, leave HAVE_POSSCL empty and this Makefile will figure it out.
# #
@@ -271,7 +271,7 @@ HAVE_CONST=
# Determine if we have uid_t # Determine if we have uid_t
# #
# If HAVE_UID_T is empty, this Makefile will run the have_uid_t program # If HAVE_UID_T is empty, this Makefile will run the have_uid_t program
# to determine if const is supported. If HAVE_UID_T is set to -DHAVE_NO_UID_T, # to determine if uid_t is supported. If HAVE_UID_T is set to -DHAVE_NO_UID_T,
# then calc will treat uid_t as an unsigned short. This only matters if # then calc will treat uid_t as an unsigned short. This only matters if
# $HOME is not set and calc must look up the home directory in /etc/passwd. # $HOME is not set and calc must look up the home directory in /etc/passwd.
# #
@@ -298,7 +298,7 @@ HAVE_NEWSTR=
# If HAVE_MEMMOVE is empty, this Makefile will run the have_memmv program # If HAVE_MEMMOVE is empty, this Makefile will run the have_memmv program
# to determine if memmove() is supported. If HAVE_MEMMOVE is set to # to determine if memmove() is supported. If HAVE_MEMMOVE is set to
# -DHAVE_NO_MEMMOVE, then calc will use internal functions to simulate # -DHAVE_NO_MEMMOVE, then calc will use internal functions to simulate
# the memory move function that does correct overlapping memory modes. # the memory move function that does correct overlapping memory moves.
# #
# If in doubt, leave HAVE_MEMMOVE empty and this Makefile will figure it out. # If in doubt, leave HAVE_MEMMOVE empty and this Makefile will figure it out.
# #
@@ -307,10 +307,10 @@ HAVE_MEMMOVE=
# Determine if we have ustat() # Determine if we have ustat()
# #
# If HAVE_USTAT is empty, this Makefile will run the have_memmv program # If HAVE_USTAT is empty, this Makefile will run the have_ustat program
# to determine if ustat() is supported. If HAVE_USTAT is set to # to determine if ustat() is supported. If HAVE_USTAT is set to
# -DHAVE_NO_USTAT, then calc will use internal functions to simulate # -DHAVE_NO_USTAT, then calc will use internal functions to simulate
# the memory move function that does correct overlapping memory modes. # the ustat() function that gets file system statistics.
# #
# Select HAVE_USTAT= -DHAVE_NO_USTAT for DJGPP. # Select HAVE_USTAT= -DHAVE_NO_USTAT for DJGPP.
# #
@@ -321,10 +321,10 @@ HAVE_USTAT=
# Determine if we have getsid() # Determine if we have getsid()
# #
# If HAVE_GETSID is empty, this Makefile will run the have_memmv program # If HAVE_GETSID is empty, this Makefile will run the have_getsid program
# to determine if getsid() is supported. If HAVE_GETSID is set to # to determine if getsid() is supported. If HAVE_GETSID is set to
# -DHAVE_NO_GETSID, then calc will use internal functions to simulate # -DHAVE_NO_GETSID, then calc will use internal functions to simulate
# the memory move function that does correct overlapping memory modes. # the getsid() function that gets session ID.
# #
# Select HAVE_GETSID= -DHAVE_NO_GETSID for DJGPP. # Select HAVE_GETSID= -DHAVE_NO_GETSID for DJGPP.
# #
@@ -335,10 +335,10 @@ HAVE_GETSID=
# Determine if we have getpgid() # Determine if we have getpgid()
# #
# If HAVE_GETPGID is empty, this Makefile will run the have_memmv program # If HAVE_GETPGID is empty, this Makefile will run the have_getpgid program
# to determine if getpgid() is supported. If HAVE_GETPGID is set to # to determine if getpgid() is supported. If HAVE_GETPGID is set to
# -DHAVE_NO_GETPGID, then calc will use internal functions to simulate # -DHAVE_NO_GETPGID, then calc will use internal functions to simulate
# the memory move function that does correct overlapping memory modes. # the getpgid() function that sets the process group ID.
# #
# Select HAVE_GETPGID= -DHAVE_NO_GETPGID for DJGPP. # Select HAVE_GETPGID= -DHAVE_NO_GETPGID for DJGPP.
# #
@@ -349,10 +349,10 @@ HAVE_GETPGID=
# Determine if we have clock_gettime() # Determine if we have clock_gettime()
# #
# If HAVE_GETTIME is empty, this Makefile will run the have_memmv program # If HAVE_GETTIME is empty, this Makefile will run the have_gettime program
# to determine if clock_gettime() is supported. If HAVE_GETTIME is set to # to determine if clock_gettime() is supported. If HAVE_GETTIME is set to
# -DHAVE_NO_GETTIME, then calc will use internal functions to simulate # -DHAVE_NO_GETTIME, then calc will use internal functions to simulate
# the memory move function that does correct overlapping memory modes. # the clock_gettime() function.
# #
# Select HAVE_GETTIME= -DHAVE_NO_GETTIME for DJGPP. # Select HAVE_GETTIME= -DHAVE_NO_GETTIME for DJGPP.
# #
@@ -363,10 +363,10 @@ HAVE_GETTIME=
# Determine if we have getprid() # Determine if we have getprid()
# #
# If HAVE_GETPRID is empty, this Makefile will run the have_memmv program # If HAVE_GETPRID is empty, this Makefile will run the have_getprid program
# to determine if getprid() is supported. If HAVE_GETPRID is set to # to determine if getprid() is supported. If HAVE_GETPRID is set to
# -DHAVE_NO_GETPRID, then calc will use internal functions to simulate # -DHAVE_NO_GETPRID, then calc will use internal functions to simulate
# the memory move function that does correct overlapping memory modes. # the getprid() function.
# #
# Select HAVE_GETPRID= -DHAVE_NO_GETPRID for DJGPP. # Select HAVE_GETPRID= -DHAVE_NO_GETPRID for DJGPP.
# #
@@ -377,7 +377,7 @@ HAVE_GETPRID=
# Determine if we have the /dev/urandom # Determine if we have the /dev/urandom
# #
# HAVE_URANDOM_H= let the Makefile look /dev/urandom # HAVE_URANDOM_H= let the Makefile look for /dev/urandom
# HAVE_URANDOM_H= YES assume that /dev/urandom exists # HAVE_URANDOM_H= YES assume that /dev/urandom exists
# HAVE_URANDOM_H= NO assume that /dev/urandom does not exist # HAVE_URANDOM_H= NO assume that /dev/urandom does not exist
# #
@@ -391,10 +391,10 @@ HAVE_URANDOM_H=
# Determine if we have getrusage() # Determine if we have getrusage()
# #
# If HAVE_GETRUSAGE is empty, this Makefile will run the have_memmv program # If HAVE_GETRUSAGE is empty, this Makefile will run the have_rusage program
# to determine if getrusage() is supported. If HAVE_GETRUSAGE is set to # to determine if getrusage() is supported. If HAVE_GETRUSAGE is set to
# -DHAVE_NO_GETRUSAGE, then calc will use internal functions to simulate # -DHAVE_NO_GETRUSAGE, then calc will use internal functions to simulate
# the memory move function that does correct overlapping memory modes. # the getrusage() function.
# #
# If in doubt, leave HAVE_GETRUSAGE empty and this Makefile will figure it out. # If in doubt, leave HAVE_GETRUSAGE empty and this Makefile will figure it out.
# #
@@ -403,10 +403,10 @@ HAVE_GETRUSAGE=
# Determine if we have strdup() # Determine if we have strdup()
# #
# If HAVE_STRDUP is empty, this Makefile will run the have_memmv program # If HAVE_STRDUP is empty, this Makefile will run the have_strdup program
# to determine if strdup() is supported. If HAVE_STRDUP is set to # to determine if strdup() is supported. If HAVE_STRDUP is set to
# -DHAVE_NO_STRDUP, then calc will use internal functions to simulate # -DHAVE_NO_STRDUP, then calc will use internal functions to simulate
# the memory move function that does correct overlapping memory modes. # the strdup() function.
# #
# If in doubt, leave HAVE_STRDUP empty and this Makefile will figure it out. # If in doubt, leave HAVE_STRDUP empty and this Makefile will figure it out.
# #
@@ -414,7 +414,7 @@ HAVE_STRDUP=
#HAVE_STRDUP= -DHAVE_NO_STRDUP #HAVE_STRDUP= -DHAVE_NO_STRDUP
# Some architectures such as Sparc do not allow one to access 32 bit values # Some architectures such as Sparc do not allow one to access 32 bit values
# that are not alligned on a 32 bit boundary. # that are not aligned on a 32 bit boundary.
# #
# The Dec Alpha running OSF/1 will produce alignment error messages when # The Dec Alpha running OSF/1 will produce alignment error messages when
# align32.c tries to figure out if alignment is needed. Use the # align32.c tries to figure out if alignment is needed. Use the
@@ -572,7 +572,7 @@ HAVE_UNUSED=
#INCDIR= /dev/env/DJDIR/include #INCDIR= /dev/env/DJDIR/include
INCDIR= /usr/include INCDIR= /usr/include
# Where to install calc realted things # Where to install calc related things
# #
# ${BINDIR} where to install calc binary files # ${BINDIR} where to install calc binary files
# ${LIBDIR} where calc link library (*.a) files are installed # ${LIBDIR} where calc link library (*.a) files are installed
@@ -739,12 +739,12 @@ CATEXT= 1
# If NROFF is non-empty, then # If NROFF is non-empty, then
# #
# ${NROFF} ${NROFF_ARG} calc.1 > ${CATDIR}/calc.${CATEXT} # ${NROFF} ${NROFF_ARG} calc.1 > ${CATDIR}/calc.${CATEXT}
# is used to built and install the cat page # is used to build and install the cat page
# #
# else (NROFF is empty) # else (NROFF is empty)
# #
# ${MANMAKE} calc.1 ${CATDIR} # ${MANMAKE} calc.1 ${CATDIR}
# is used to built and install the cat page # is used to build and install the cat page
# else # else
# #
# The cat page is not built or installed # The cat page is not built or installed
@@ -768,7 +768,7 @@ CATMODE= 0444
# By default, custom builtin functions may only be executed if calc # By default, custom builtin functions may only be executed if calc
# is given the -C option. This is because custom builtin functions # is given the -C option. This is because custom builtin functions
# may invoke non-standard or non-portable code. One may completely # may invoke non-standard or non-portable code. One may completely
# disable custom builtin functions by not compiling any of code # disable custom builtin functions by not compiling any custom code
# #
# ALLOW_CUSTOM= -DCUSTOM # allow custom only if -C is given # ALLOW_CUSTOM= -DCUSTOM # allow custom only if -C is given
# ALLOW_CUSTOM= # disable custom even if -C is given # ALLOW_CUSTOM= # disable custom even if -C is given
@@ -779,14 +779,14 @@ ALLOW_CUSTOM= -DCUSTOM
#ALLOW_CUSTOM= #ALLOW_CUSTOM=
# If the $CALCPATH environment variable is not defined, then the following # If the $CALCPATH environment variable is not defined, then the following
# path will be search for calc resource file routines. # path will be searched for calc resource file routines.
# #
# Select CALCPATH= .;./cal;~/.cal;${CALC_SHAREDIR};${CUSTOMCALDIR} for DJGPP. # Select CALCPATH= .;./cal;~/.cal;${CALC_SHAREDIR};${CUSTOMCALDIR} for DJGPP.
# #
CALCPATH= .:./cal:~/.cal:${CALC_SHAREDIR}:${CUSTOMCALDIR} CALCPATH= .:./cal:~/.cal:${CALC_SHAREDIR}:${CUSTOMCALDIR}
# If the $CALCRC environment variable is not defined, then the following # If the $CALCRC environment variable is not defined, then the following
# path will be search for calc resource files. # path will be searched for calc resource files.
# #
# Select CALCRC= ${CALC_SHAREDIR}/startup;~/.calcrc;./.calcinit for DJGPP. # Select CALCRC= ${CALC_SHAREDIR}/startup;~/.calcrc;./.calcinit for DJGPP.
# #
@@ -794,7 +794,7 @@ CALCRC= ${CALC_SHAREDIR}/startup:~/.calcrc:./.calcinit
#CALCRC= ${CALC_SHAREDIR}/startup;~/.calcrc;./.calcinit #CALCRC= ${CALC_SHAREDIR}/startup;~/.calcrc;./.calcinit
# Determine of the GNU-readline facility will be used instead of the # Determine of the GNU-readline facility will be used instead of the
# built-in calc binding method. # builtin calc binding method.
# #
# USE_READLINE= Do not use GNU-readline, use calc bindings # USE_READLINE= Do not use GNU-readline, use calc bindings
# USE_READLINE= -DUSE_READLINE Use GNU-readline, do not use calc bindings # USE_READLINE= -DUSE_READLINE Use GNU-readline, do not use calc bindings
@@ -887,7 +887,7 @@ RANLIB=ranlib
# Normally certain files depend on the Makefile. If the Makefile is # Normally certain files depend on the Makefile. If the Makefile is
# changed, then certain steps should be redone. If MAKE_FILE is # changed, then certain steps should be redone. If MAKE_FILE is
# set to Makefile, then these files will depend on Makefile. If # set to Makefile, then these files will depend on Makefile. If
# MAKE_FILE is empty, then they wont. # MAKE_FILE is empty, then they won't.
# #
# If in doubt, set MAKE_FILE to Makefile # If in doubt, set MAKE_FILE to Makefile
# #
@@ -948,9 +948,9 @@ CALC_ENV= CALCPATH=./cal LD_LIBRARY_PATH=.
# #
# ${MKDIR} ${MKDIR_ARG} # ${MKDIR} ${MKDIR_ARG}
# #
# to create directorties. Normall this amounts to usins mkdir -p dir ... # to create directories. Normally this amounts to using mkdir -p dir ...
# Some older systems may not have mkdir -p. If you system does not # Some older systems may not have mkdir -p. If your system does not
# make mkdir -p, then set MKDIR_ARG to empty. # have mkdir -p, then set MKDIR_ARG to empty.
# #
# MKDIR_ARG= -p # use mkdir -p when creating paths # MKDIR_ARG= -p # use mkdir -p when creating paths
# MKDIR_ARG= # use if system does not understand mkdir -p # MKDIR_ARG= # use if system does not understand mkdir -p
@@ -959,7 +959,7 @@ MKDIR_ARG= -p
#MKDIR_ARG= #MKDIR_ARG=
# Some out of date operating systems require/want an executable to # Some out of date operating systems require/want an executable to
# end with a certain file extension. Some compile systems such as # end with a certain file extension. Some compiler systems such as
# windoz build calc as calc.exe. The EXT variable is used to denote # windoz build calc as calc.exe. The EXT variable is used to denote
# the extension required by such. Note that Cygwin requires EXT to be # the extension required by such. Note that Cygwin requires EXT to be
# the same as Linux/Un*x/GNU, even though it runs under windoz. # the same as Linux/Un*x/GNU, even though it runs under windoz.
@@ -974,7 +974,7 @@ EXT=
# The default calc versions # The default calc versions
# #
VERSION= 2.12.4.10 VERSION= 2.12.4.11
VERS= 2.12.4 VERS= 2.12.4
VER= 2.12 VER= 2.12
VE= 2 VE= 2
@@ -1025,11 +1025,11 @@ STRIP= strip
# Extra compiling and linking flags # Extra compiling and linking flags
# #
# EXTRA_CFLAGS are flags given to ${CC} when compiling C files # EXTRA_CFLAGS are flags given to ${CC} when compiling C files
# EXTRA_LDFLAGS are flags given to ${CC} when linking progs # EXTRA_LDFLAGS are flags given to ${CC} when linking programs
# #
# Both CFLAGS and LDFLAGS are left blank in this Makefile by # Both CFLAGS and LDFLAGS are left blank in this Makefile by
# default so that users may use them on the make command line # default so that users may use them on the make command line
# to always the way that C is compiled and files are linked # to always set the way that C is compiled and files are linked
# respectively. For example: # respectively. For example:
# #
# make all EXTRA_CFLAGS="-DMAGIC" EXTRA_LDFLAGS="-lmagic" # make all EXTRA_CFLAGS="-DMAGIC" EXTRA_LDFLAGS="-lmagic"
@@ -1037,18 +1037,18 @@ STRIP= strip
# NOTE: These should be left blank in this Makefile to make it # NOTE: These should be left blank in this Makefile to make it
# easier to add stuff on the command line. If you want to # easier to add stuff on the command line. If you want to
# to change the way calc is compiled by this Makefile, change # to change the way calc is compiled by this Makefile, change
# the appropirate host target section below or a flag above. # the appropriate host target section below or a flag above.
# #
EXTRA_CFLAGS= EXTRA_CFLAGS=
EXTRA_LDFLAGS= EXTRA_LDFLAGS=
# COMMON_CFLAGS are the common ${CC} flags used for all progs, both # COMMON_CFLAGS are the common ${CC} flags used for all programs, both
# intermediate and final calc and calc related progs # intermediate and final calc and calc related programs
# #
COMMON_CFLAGS= -DCALC_SRC ${ALLOW_CUSTOM} ${CCWARN} ${CCMISC} ${EXTRA_CFLAGS} COMMON_CFLAGS= -DCALC_SRC ${ALLOW_CUSTOM} ${CCWARN} ${CCMISC} ${EXTRA_CFLAGS}
# COMMON_LDFLAGS are the common flags used for linking all progs, both # COMMON_LDFLAGS are the common flags used for linking all programs, both
# intermediate and final calc and calc related progs # intermediate and final calc and calc related programs
# #
COMMON_LDFLAGS= ${EXTRA_LDFLAGS} COMMON_LDFLAGS= ${EXTRA_LDFLAGS}
@@ -1066,16 +1066,16 @@ COMMON_LDFLAGS= ${EXTRA_LDFLAGS}
# BLD_TYPE= calc-static-only # BLD_TYPE= calc-static-only
# #
# CC_SHARE are flags given to ${CC} to build .o files suitable for shared libs # CC_SHARE are flags given to ${CC} to build .o files suitable for shared libs
# DEFAULT_LIB_INSTALL_PATH is where calc progs look for calc shared libs # DEFAULT_LIB_INSTALL_PATH is where calc programs look for calc shared libs
# LD_SHARE are common flags given to ${CC} to link with shared libraries # LD_SHARE are common flags given to ${CC} to link with shared libraries
# LIBCALC_SHLIB are flags given to ${CC} to build libcalc shared lib # LIBCALC_SHLIB are flags given to ${CC} to build libcalc shared libraries
# LIBCUSTCALC_SHLIB are flags given to ${CC} to build libcustcalc shared lib # LIBCUSTCALC_SHLIB are flags given to ${CC} to build libcustcalc shared lib
# #
# NOTE: The above 4 values are unused if BLD_TYPE= calc-static-only # NOTE: The above 4 values are unused if BLD_TYPE= calc-static-only
# #
# CC_STATIC are flags given to ${CC} to build .o files suitable for static libs # CC_STATIC are flags given to ${CC} to build .o files suitable for static libs
# LD_STATIC are common flags given to ${CC} to link with static libraries # LD_STATIC are common flags given to ${CC} to link with static libraries
# LIBCALC_STATIC are flags given to ${CC} to build libcalc static lib # LIBCALC_STATIC are flags given to ${CC} to build libcalc static libraries
# LIBCUSTCALC_STATIC are flags given to ${CC} to build libcustcalc static lib # LIBCUSTCALC_STATIC are flags given to ${CC} to build libcustcalc static lib
# #
# NOTE: The above 4 values are unused if BLD_TYPE= calc-dynamic-only # NOTE: The above 4 values are unused if BLD_TYPE= calc-dynamic-only
@@ -1088,7 +1088,7 @@ COMMON_LDFLAGS= ${EXTRA_LDFLAGS}
# to abort on warnings, then leave CCWERR blank. # to abort on warnings, then leave CCWERR blank.
# CCMISC are misc flags given to ${CC} # CCMISC are misc flags given to ${CC}
# #
# LCC how the C compiler is invoked on locally executed intermediate progs # LCC is how the C compiler is invoked on locally executed intermediate programs
# CC is how the C compiler is invoked (with an optional Purify) # CC is how the C compiler is invoked (with an optional Purify)
# #
# Specific target overrides or modifications to default values # Specific target overrides or modifications to default values
@@ -1128,10 +1128,10 @@ CC= ${PURIFY} ${LCC} ${CCWERR}
# #
# The simple makefile forces the use of static ${CC} flags # The simple makefile forces the use of static ${CC} flags
# #
# ICFLAGS are given to ${CC} for intermediate progs used to help compile calc # ICFLAGS are given to ${CC} for intermediate programs used to help compile calc
# CFLAGS are given to ${CC} for calc progs other than intermediate progs # CFLAGS are given to ${CC} for calc programs other than intermediate programs
# ILDFLAGS for ${CC} in linking intermediate progs used to help compile calc # ILDFLAGS for ${CC} in linking intermediate programs used to help compile calc
# LDFLAGS for ${CC} in linking calc progs other than intermediate progs # LDFLAGS for ${CC} in linking calc programs other than intermediate programs
# #
ICFLAGS= ${COMMON_CFLAGS} ${CC_STATIC} ICFLAGS= ${COMMON_CFLAGS} ${CC_STATIC}
CFLAGS= ${ICFLAGS} ${CCOPT} CFLAGS= ${ICFLAGS} ${CCOPT}
@@ -1354,7 +1354,7 @@ CUSTOM_PASSDOWN= \
VERSION=${VERSION} \ VERSION=${VERSION} \
target=${target} target=${target}
# The compelte list of Makefile vars passed down to help/Makefile. # The complete list of Makefile vars passed down to help/Makefile.
# #
HELP_PASSDOWN= \ HELP_PASSDOWN= \
AR=${AR} \ AR=${AR} \
@@ -1391,7 +1391,7 @@ HELP_PASSDOWN= \
TOUCH=${TOUCH} \ TOUCH=${TOUCH} \
TRUE=${TRUE} TRUE=${TRUE}
# The compelte list of Makefile vars passed down to cal/Makefile. # The complete list of Makefile vars passed down to cal/Makefile.
# #
CAL_PASSDOWN= \ CAL_PASSDOWN= \
AR=${AR} \ AR=${AR} \
@@ -1419,7 +1419,7 @@ CAL_PASSDOWN= \
TOUCH=${TOUCH} \ TOUCH=${TOUCH} \
TRUE=${TRUE} TRUE=${TRUE}
# The compelte list of Makefile vars passed down to cscript/Makefile. # The complete list of Makefile vars passed down to cscript/Makefile.
# #
CSCRIPT_PASSDOWN= \ CSCRIPT_PASSDOWN= \
AR=${AR} \ AR=${AR} \
@@ -1468,7 +1468,7 @@ DISTLIST= ${C_SRC} ${H_SRC} ${MAKE_FILE} BUGS CHANGES LIBRARY README \
README.WINDOWS calc.man HOWTO.INSTALL ${UTIL_MISC_SRC} ${LICENSE} \ README.WINDOWS calc.man HOWTO.INSTALL ${UTIL_MISC_SRC} ${LICENSE} \
sample.README calc.spec.in rpm.mk sample.README calc.spec.in rpm.mk
# These files are used to make (but not built) a calc .a link library # These files are used to make (but not build) a calc .a link library
# #
CALCLIBLIST= ${LIBSRC} ${UTIL_C_SRC} ${LIB_H_SRC} ${MAKE_FILE} \ CALCLIBLIST= ${LIBSRC} ${UTIL_C_SRC} ${LIB_H_SRC} ${MAKE_FILE} \
${UTIL_MISC_SRC} BUGS CHANGES LIBRARY ${UTIL_MISC_SRC} BUGS CHANGES LIBRARY
@@ -1481,18 +1481,18 @@ OBJS= ${LIBOBJS} ${CALCOBJS} ${UTIL_OBJS} ${SAMPLE_OBJ}
# #
CALC_STATIC_LIBS= libcalc.a libcustcalc.a CALC_STATIC_LIBS= libcalc.a libcustcalc.a
# Libaraies created and used to build calc # Libraries created and used to build calc
# #
CALC_DYNAMIC_LIBS= libcalc${LIB_EXT_VERSION} libcustcalc${LIB_EXT_VERSION} CALC_DYNAMIC_LIBS= libcalc${LIB_EXT_VERSION} libcustcalc${LIB_EXT_VERSION}
# Symlinks of dymanic shared libraries # Symlinks of dynamic shared libraries
# #
SYM_DYNAMIC_LIBS= libcalc${LIB_EXT_VER} libcalc${LIB_EXT_VE} libcalc${LIB_EXT} \ SYM_DYNAMIC_LIBS= libcalc${LIB_EXT_VER} libcalc${LIB_EXT_VE} libcalc${LIB_EXT} \
libcalc${LIB_EXT_VERS} libcustcalc${LIB_EXT_VERSION} \ libcalc${LIB_EXT_VERS} libcustcalc${LIB_EXT_VERSION} \
libcustcalc${LIB_EXT_VERS} libcustcalc${LIB_EXT_VER} \ libcustcalc${LIB_EXT_VERS} libcustcalc${LIB_EXT_VER} \
libcustcalc${LIB_EXT_VE} libcustcalc${LIB_EXT} libcustcalc${LIB_EXT_VE} libcustcalc${LIB_EXT}
# list of sample programs to that need to be built to satisfy sample rule # list of sample programs that need to be built to satisfy sample rule
# #
# NOTE: The ${SAMPLE_TARGETS} and ${SAMPLE_STATIC_TARGETS} are built but # NOTE: The ${SAMPLE_TARGETS} and ${SAMPLE_STATIC_TARGETS} are built but
# not installed at this time. # not installed at this time.
@@ -1503,7 +1503,7 @@ SYM_DYNAMIC_LIBS= libcalc${LIB_EXT_VER} libcalc${LIB_EXT_VE} libcalc${LIB_EXT} \
SAMPLE_TARGETS= sample_rand${EXT} sample_many${EXT} SAMPLE_TARGETS= sample_rand${EXT} sample_many${EXT}
SAMPLE_STATIC_TARGETS= sample_rand-static${EXT} sample_many-static${EXT} SAMPLE_STATIC_TARGETS= sample_rand-static${EXT} sample_many-static${EXT}
# list of cscript programs to that need to be built to satisfy cscript/.all # list of cscript programs that need to be built to satisfy cscript/.all
# #
# NOTE: This list MUST be coordinated with the ${CSCRIPT_TARGETS} variable # NOTE: This list MUST be coordinated with the ${CSCRIPT_TARGETS} variable
# in the cscript/Makefile # in the cscript/Makefile
@@ -1558,7 +1558,7 @@ calc-dynamic-only: ${DYNAMIC_FIRST_TARGETS} ${EARLY_TARGETS} \
echo " ${MAKE} -f ${MAKE_FILE} clobber" 1>&2; \ echo " ${MAKE} -f ${MAKE_FILE} clobber" 1>&2; \
echo " ${MAKE} -f ${MAKE_FILE} $$r BLD_TYPE=$$r" 1>&2; \ echo " ${MAKE} -f ${MAKE_FILE} $$r BLD_TYPE=$$r" 1>&2; \
echo "" 1>&2; \ echo "" 1>&2; \
echo "NOTE: It is a very good idea to c first clobber any" 1>&2; \ echo "NOTE: It is a very good idea to first clobber any" 1>&2; \
echo " previously built .o, libs and executables" 1>&2; \ echo " previously built .o, libs and executables" 1>&2; \
echo " before switching to $$r!" 1>&2; \ echo " before switching to $$r!" 1>&2; \
echo "" 1>&2; \ echo "" 1>&2; \
@@ -1574,7 +1574,7 @@ calc-dynamic-only: ${DYNAMIC_FIRST_TARGETS} ${EARLY_TARGETS} \
echo " ${MAKE} -f ${MAKE_FILE} clobber" 1>&2; \ echo " ${MAKE} -f ${MAKE_FILE} clobber" 1>&2; \
echo " ${MAKE} -f ${MAKE_FILE} $$r BLD_TYPE=$$r" 1>&2; \ echo " ${MAKE} -f ${MAKE_FILE} $$r BLD_TYPE=$$r" 1>&2; \
echo "" 1>&2; \ echo "" 1>&2; \
echo "to clean out any previously build static files." 1>&2; \ echo "to clean out any previously built static files." 1>&2; \
echo "" 1>&2; \ echo "" 1>&2; \
echo "=== aborting make ===" 1>&2; \ echo "=== aborting make ===" 1>&2; \
exit 2; \ exit 2; \
@@ -1604,7 +1604,7 @@ calc-static-only: ${STATIC_FIRST_TARGETS} ${EARLY_TARGETS} \
echo " ${MAKE} -f ${MAKE_FILE} clobber" 1>&2; \ echo " ${MAKE} -f ${MAKE_FILE} clobber" 1>&2; \
echo " ${MAKE} -f ${MAKE_FILE} $$r BLD_TYPE=$$r" 1>&2; \ echo " ${MAKE} -f ${MAKE_FILE} $$r BLD_TYPE=$$r" 1>&2; \
echo "" 1>&2; \ echo "" 1>&2; \
echo "NOTE: It is a very good idea to c first clobber any" 1>&2; \ echo "NOTE: It is a very good idea to first clobber any" 1>&2; \
echo " previously built .o, libs and executables" 1>&2; \ echo " previously built .o, libs and executables" 1>&2; \
echo " before switching to $$r!" 1>&2; \ echo " before switching to $$r!" 1>&2; \
echo "" 1>&2; \ echo "" 1>&2; \
@@ -1620,7 +1620,7 @@ calc-static-only: ${STATIC_FIRST_TARGETS} ${EARLY_TARGETS} \
echo " ${MAKE} -f ${MAKE_FILE} clobber" 1>&2; \ echo " ${MAKE} -f ${MAKE_FILE} clobber" 1>&2; \
echo " ${MAKE} -f ${MAKE_FILE} $$r BLD_TYPE=$$r" 1>&2; \ echo " ${MAKE} -f ${MAKE_FILE} $$r BLD_TYPE=$$r" 1>&2; \
echo "" 1>&2; \ echo "" 1>&2; \
echo "to clean out any previously build dynamic files." 1>&2; \ echo "to clean out any previously built dynamic files." 1>&2; \
echo "" 1>&2; \ echo "" 1>&2; \
echo "=== aborting make ===" 1>&2; \ echo "=== aborting make ===" 1>&2; \
exit 4; \ exit 4; \
@@ -1717,7 +1717,7 @@ seed.o: seed.c no_implicit.arg ${MAKE_FILE}
# #
# The next set of rules cause the .h files BUILD_H_SRC files to be built # The next set of rules cause the .h files BUILD_H_SRC files to be built
# according to the system and the Makefile variables above. The hsrc rule # according to the system and the Makefile variables above. The hsrc rule
# is a convenient rule to invoke to built all of the BUILD_H_SRC. # is a convenient rule to invoke to build all of the BUILD_H_SRC.
# #
# We add in the BUILD_C_SRC files because they are similar to the # We add in the BUILD_C_SRC files because they are similar to the
# BUILD_H_SRC files in terms of the build process. # BUILD_H_SRC files in terms of the build process.
@@ -3161,7 +3161,7 @@ libcustcalc${LIB_EXT}: libcustcalc${LIB_EXT_VERSION}
### ###
# #
# building calc-static and static lib*.a libraires # building calc-static and static lib*.a libraries
# #
### ###
@@ -3194,10 +3194,10 @@ sample_many-static${EXT}: sample_many.o ${CALC_STATIC_LIBS} ${MAKE_FILE}
### ###
# #
# Home grown make dependency rules. Your system make not support # Homegrown make dependency rules. Your system may not support
# or have the needed tools. You can ignore this section. # or have the needed tools. You can ignore this section.
# #
# We will form a skelaton tree of *.c files containing only #include "foo.h" # We will form a skeleton tree of *.c files containing only #include "foo.h"
# lines and .h files containing the same lines surrounded by multiple include # lines and .h files containing the same lines surrounded by multiple include
# prevention lines. This allows us to build a static depend list that will # prevention lines. This allows us to build a static depend list that will
# satisfy all possible cpp symbol definition combinations. # satisfy all possible cpp symbol definition combinations.
@@ -3307,21 +3307,21 @@ h_list:
# 1 level version string. # 1 level version string.
# #
# version: # version:
# This rule simply echos the value found in this makefile. # This rule simply echoes the value found in this makefile.
# This rule produces the full version string. Note that the # This rule produces the full version string. Note that the
# full version could be 4 or 3 levels long depending on the # full version could be 4 or 3 levels long depending on the
# minor patch number. # minor patch number.
# #
# vers: # vers:
# This rule simply echos the value found in this makefile. # This rule simply echoes the value found in this makefile.
# This rule produces only a 3 level version string. # This rule produces only a 3 level version string.
# #
# ver: # ver:
# This rule simply echos the value found in this makefile. # This rule simply echoes the value found in this makefile.
# This rule produces only a 2 level version string. # This rule produces only a 2 level version string.
# #
# ve: # ve:
# This rule simply echos the value found in this makefile. # This rule simply echoes the value found in this makefile.
# This rule produces only a 1 level version string. # This rule produces only a 1 level version string.
# #
### ###
@@ -3413,7 +3413,7 @@ calcliblistfmt:
# #
# Doing a 'make chk' will cause only the context around interesting # Doing a 'make chk' will cause only the context around interesting
# (and error) messages to be printed. Unlike 'make check', this # (and error) messages to be printed. Unlike 'make check', this
# rule does not cause things to be built. I.e., the all rule is # rule does not cause things to be built. i.e., the all rule is
# not invoked. # not invoked.
# #
### ###
@@ -3609,34 +3609,38 @@ env:
mkdebug: env version.c mkdebug: env version.c
@echo '=-=-=-=-= ${MAKE_FILE} start of $@ rule =-=-=-=-=' @echo '=-=-=-=-= ${MAKE_FILE} start of $@ rule =-=-=-=-='
@echo '=-=-=-=-= Determining the source version =-=-=-=-=' @echo '=-=-=-= Determining the source version =-=-=-='
@${MAKE} -f Makefile Q= V=@ ver_calc${EXT} @${MAKE} -f Makefile Q= V=@ ver_calc${EXT}
-@./ver_calc${EXT} -@./ver_calc${EXT}
@echo '=-=-=-=-= Invoking ${MAKE} -f Makefile Q= V=@ all =-=-=-=-=' @echo '=-=-=-= Invoking ${MAKE} -f Makefile Q= V=@ all =-=-=-='
@${MAKE} -f Makefile Q= V=@ all @${MAKE} -f Makefile Q= V=@ all
@echo '=-=-=-=-= Back to the main Makefile for $@ rule =-=-=-=-=' @echo '=-=-=-= Back to the main Makefile for $@ rule =-=-=-='
@echo '=-=-=-=-= Determining the binary version =-=-=-=-=' @echo '=-=-=-= Determining the binary version =-=-=-='
-@./calc${EXT} -e -q -v -@./calc${EXT} -e -q -v
@echo '=-=-=-=-= Back to the main Makefile for $@ rule =-=-=-=-=' @echo '=-=-=-= Back to the main Makefile for $@ rule =-=-=-='
@echo '=-=-=-=-= ${MAKE_FILE} end of $@ rule =-=-=-=-=' @echo '=-=-=-=-= ${MAKE_FILE} end of $@ rule =-=-=-=-='
debug: env debug: env
@echo '=-=-=-=-= ${MAKE_FILE} start of $@ rule =-=-=-=-=' @echo '=-=-=-=-= ${MAKE_FILE} start of $@ rule =-=-=-=-='
@echo '=-=-=-=-= Invoking ${MAKE} -f Makefile Q= V=@ clobber =-=-=-=-=' @echo '=-=-=-= Invoking ${MAKE} -f Makefile Q= V=@ clobber =-=-=-='
@${MAKE} -f Makefile Q= V=@ clobber @${MAKE} -f Makefile Q= V=@ clobber
@echo '=-=-=-=-= Back to the main Makefile for $@ rule =-=-=-=-=' @echo '=-=-=-= Back to the main Makefile for $@ rule =-=-=-='
@echo '=-=-=-=-= Determining the source version =-=-=-=-=' @echo '=-=-=-= Invoking ${MAKE} -f Makefile Q= V=@ all =-=-=-='
@echo '=-=-= this may take a bit of time =-=-='
@${MAKE} -f Makefile Q= V=@ all
@echo '=-=-=-= Back to the main Makefile for $@ rule =-=-=-='
@echo '=-=-=-= Determining the source version =-=-=-='
@${MAKE} -f Makefile Q= V=@ ver_calc${EXT} @${MAKE} -f Makefile Q= V=@ ver_calc${EXT}
-@./ver_calc${EXT} -@./ver_calc${EXT}
@echo '=-=-=-=-= Invoking ${MAKE} -f Makefile Q= V=@ all =-=-=-=-=' @echo '=-=-=-= Back to the main Makefile for $@ rule =-=-=-='
@${MAKE} -f Makefile Q= V=@ all @echo -n '=-=-=-= Print #defile values if custom functions '
@echo '=-=-=-=-= Determining the binary version =-=-=-=-=' @echo 'are allowed =-=-=-='
-@./calc${EXT} -e -q -v -@./calc${EXT} -e -q -C 'print custom("sysinfo", 2);'
@echo '=-=-=-=-= Back to the main Makefile for $@ rule =-=-=-=-=' @echo '=-=-=-= Back to the main Makefile for $@ rule =-=-=-='
@echo '=-=-=-=-= Invoking ${MAKE} -f Makefile Q= V=@ chk =-=-=-=-=' @echo '=-=-=-= Invoking ${MAKE} -f Makefile Q= V=@ check =-=-=-='
@echo '=-=-=-=-= this may take a while =-=-=-=-=' @echo '=-=-= this may take a while =-=-='
@${MAKE} -f Makefile Q= V=@ chk @${MAKE} -f Makefile Q= V=@ check
@echo '=-=-=-=-= Back to the main Makefile for $@ rule =-=-=-=-=' @echo '=-=-=-= Back to the main Makefile for $@ rule =-=-=-='
@echo '=-=-=-=-= ${MAKE_FILE} end of $@ rule =-=-=-=-=' @echo '=-=-=-=-= ${MAKE_FILE} end of $@ rule =-=-=-=-='
### ###
@@ -3747,7 +3751,7 @@ inst_files: ${MAKE_FILE} help/Makefile cal/Makefile custom/Makefile \
${Q} LANG=C ${SORT} -u inst_files -o inst_files ${Q} LANG=C ${SORT} -u inst_files -o inst_files
${V} echo '=-=-=-=-= ${MAKE_FILE} end of $@ rule =-=-=-=-=' ${V} echo '=-=-=-=-= ${MAKE_FILE} end of $@ rule =-=-=-=-='
# The olduninstall rule will remove calc files from the older, histroic # The olduninstall rule will remove calc files from the older, historic
# locations under the /usr/local directory. If you are using the # locations under the /usr/local directory. If you are using the
# new default values for ${BINDIR}, ${CALC_SHAREDIR}, ${INCDIR} and ${LIBDIR} # new default values for ${BINDIR}, ${CALC_SHAREDIR}, ${INCDIR} and ${LIBDIR}
# then you can use this rule to clean out the older calc stuff under # then you can use this rule to clean out the older calc stuff under
@@ -3861,7 +3865,7 @@ clobber: custom/Makefile clean
# install everything # install everything
# #
# NOTE: Keep the uninstall rule in reverse order to the install rule # NOTE: Keep the uninstall rule in the reverse order of the install rule
# #
install: custom/Makefile ${LIB_H_SRC} ${BUILD_H_SRC} calc.1 all install: custom/Makefile ${LIB_H_SRC} ${BUILD_H_SRC} calc.1 all
${V} echo '=-=-=-=-= ${MAKE_FILE} start of $@ rule =-=-=-=-=' ${V} echo '=-=-=-=-= ${MAKE_FILE} start of $@ rule =-=-=-=-='
@@ -4156,7 +4160,7 @@ install: custom/Makefile ${LIB_H_SRC} ${BUILD_H_SRC} calc.1 all
# Try to remove everything that was installed # Try to remove everything that was installed
# #
# NOTE: Keep the uninstall rule in reverse order to the install rule # NOTE: Keep the uninstall rule in the reverse order of the install rule
# #
uninstall: custom/Makefile uninstall: custom/Makefile
${V} echo '=-=-=-=-= ${MAKE_FILE} start of $@ rule =-=-=-=-=' ${V} echo '=-=-=-=-= ${MAKE_FILE} start of $@ rule =-=-=-=-='
@@ -4360,7 +4364,7 @@ strip:
done done
${V} echo '=-=-=-=-= ${MAKE_FILE} end of $@ rule =-=-=-=-=' ${V} echo '=-=-=-=-= ${MAKE_FILE} end of $@ rule =-=-=-=-='
# calc-symlink - setup symlinks from stardard locations into the ${T} tree # calc-symlink - setup symlinks from standard locations into the ${T} tree
# #
calc-symlink: calc-symlink:
${Q}if [ -z "${T}" ]; then \ ${Q}if [ -z "${T}" ]; then \

View File

@@ -537,6 +537,20 @@ hms.cal
Calculate in hours, minutes, and seconds. See also dmscal. Calculate in hours, minutes, and seconds. See also dmscal.
infinities.cal
isinfinite(x)
iscinf(x)
ispinf(x)
isninf(x)
cinf()
ninf()
pinf()
The symbolic handling of infinities. Needed for intnum.cal but might be
usefull elsewhere, too.
intfile.cal intfile.cal
file2be(filename) file2be(filename)
@@ -564,6 +578,127 @@ intfile.cal
of the integer become the last octets of the file. of the integer become the last octets of the file.
intnum.cal
quadtsdeletenodes()
quadtscomputenodes(order, expo, eps)
quadtscore(a, b, n)
quadts(a, b, points)
quadglcomputenodes(N)
quadgldeletenodes()
quadglcore(a, b, n)
quadgl(a, b, points)
quad(a, b, points = -1, method = "tanhsinh")
makerange(start, end, steps)
makecircle(radius, center, points)
makeellipse(angle, a, b, center, points)
makepoints()
This file offers some methods for numerical integration. Implemented are
the Gauss-Legendre and the tanh-sinh quadrature.
All functions are usefull to some extend but the main function for
quadrature is quad(), which is not much more than an abstraction layer.
The main workers are quadgl() for Gauss-legendre and quadts() for the
tanh-sinh quadrature. The limits of the integral can be anything in the
complex plane and the extended real line. The latter means that infinite
limits are supported by way of the smbolic infinities implemented in the
file infinities.cal (automatically linked in by intnum.cal).
Integration in parts and contour is supported by the "points" argument
which takes either a number or a list. the functions starting with "make"
allow for a less error prone use.
The function to evaluate must have the name "f".
Examples (shamelessly stolen from mpmath):
; define f(x){return sin(x);}
f(x) defined
; quadts(0,pi()) - 2
0.00000000000000000000
; quadgl(0,pi()) - 2
0.00000000000000000000
Sometimes rounding errors accumulate, it might be a good idea to crank up
the working precision a notch or two.
; define f(x){ return exp(-x^2);}
f(x) redefined
; quadts(0,pinf()) - pi()
0.00000000000000000000
; quadgl(0,pinf()) - pi()
0.00000000000000000001
; define f(x){ return exp(-x^2);}
f(x) redefined
; quadgl(ninf(),pinf()) - sqrt(pi())
0.00000000000000000000
; quadts(ninf(),pinf()) - sqrt(pi())
-0.00000000000000000000
Using the "points" parameter is a bit tricky
; define f(x){ return 1/x; }
f(x) redefined
; quadts(1,1,mat[3]={1i,-1,-1i}) - 2i*pi()
0.00000000000000000001i
; quadgl(1,1,mat[3]={1i,-1,-1i}) - 2i*pi()
0.00000000000000000001i
The make* functions make it a bit simpler
; quadts(1,1,makepoints(1i,-1,-1i)) - 2i*pi()
0.00000000000000000001i
; quadgl(1,1,makepoints(1i,-1,-1i)) - 2i*pi()
0.00000000000000000001i
; define f(x){ return abs(sin(x));}
f(x) redefined
; quadts(0,2*pi(),makepoints(pi())) - 4
0.00000000000000000000
; quadgl(0,2*pi(),makepoints(pi())) - 4
0.00000000000000000000
The quad*core functions do not offer anything fancy but the third parameter
controls the so called "order" which is just the number of nodes computed.
This can be quite usefull in some circumstances.
; quadgldeletenodes()
; define f(x){ return exp(x);}
f(x) redefined
; s=usertime();quadglcore(-3,3)- (exp(3)-exp(-3));e=usertime();e-s
0.00000000000000000001
2.632164
; s=usertime();quadglcore(-3,3)- (exp(3)-exp(-3));e=usertime();e-s
0.00000000000000000001
0.016001
; quadgldeletenodes()
; s=usertime();quadglcore(-3,3,14)- (exp(3)-exp(-3));e=usertime();e-s
-0.00000000000000000000
0.024001
; s=usertime();quadglcore(-3,3,14)- (exp(3)-exp(-3));e=usertime();e-s
-0.00000000000000000000
0
It is not much but can sum up. The tanh-sinh algorithm is not optimizable
as much as the Gauss-Legendre algorithm but is per se much faster.
; s=usertime();quadtscore(-3,3)- (exp(3)-exp(-3));e=usertime();e-s
-0.00000000000000000001
0.128008
; s=usertime();quadtscore(-3,3)- (exp(3)-exp(-3));e=usertime();e-s
-0.00000000000000000001
0.036002
; s=usertime();quadtscore(-3,3,49)- (exp(3)-exp(-3));e=usertime();e-s
-0.00000000000000000000
0.036002
; s=usertime();quadtscore(-3,3,49)- (exp(3)-exp(-3));e=usertime();e-s
-0.00000000000000000000
0.01200
lambertw.cal lambertw.cal
lambertw(z,branch) lambertw(z,branch)
@@ -988,6 +1123,15 @@ set8700.line
The set8700.cal file (and dotest.cal) should be read first. The set8700.cal file (and dotest.cal) should be read first.
smallfactors.cal
smallfactors(x0)
printsmallfactors(flist)
Lists the prime factors of numbers smaller than 2^32. Try for example:
printsmallfactors(smallfactors(10!)).
solve.cal solve.cal
solve(low, high, epsilon) solve(low, high, epsilon)
@@ -1236,6 +1380,29 @@ statistics.cal
Calculates a bunch of (hopefully) aptly named statistical functions. Calculates a bunch of (hopefully) aptly named statistical functions.
strings.cal
toupper(s)
tolower(s)
strcasecmp(s1,s2)
strncasecmp(s1,s2,length)
isascii(c)
isalnum(c)
isalpha(c)
iscntrl(c)
isdigit(c)
isgraph(c)
islower(c)
isprint(c)
ispunct(c)
isspace(c)
isupper(c)
isblank(c)
isxdigit(c)
Implements most of the functions of libc's ctype.h and strings.h.
sumsq.cal sumsq.cal
ss(p) ss(p)
@@ -1625,9 +1792,9 @@ zeta2.cal
## received a copy with calc; if not, write to Free Software Foundation, Inc. ## received a copy with calc; if not, write to Free Software Foundation, Inc.
## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
## ##
## @(#) $Revision: 30.5 $ ## @(#) $Revision: 30.6 $
## @(#) $Id: README,v 30.5 2013/08/11 03:26:46 chongo Exp $ ## @(#) $Id: README,v 30.6 2013/08/18 20:01:53 chongo Exp $
## @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/README,v $ ## @(#) $Source: /usr/local/src/bin/calc/cal/RCS/README,v $
## ##
## Under source code control: 1990/02/15 01:50:32 ## Under source code control: 1990/02/15 01:50:32
## File existed as early as: before 1990 ## File existed as early as: before 1990

View File

@@ -3,11 +3,11 @@
* *
* Copyright (C) 2013 Christoph Zurnieden * Copyright (C) 2013 Christoph Zurnieden
* *
* bernpoly is open software; you can redistribute it and/or modify it under * 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 * the terms of the version 2.1 of the GNU Lesser General Public License
* as published by the Free Software Foundation. * as published by the Free Software Foundation.
* *
* bernpoly is distributed in the hope that it will be useful, but WITHOUT * Calc is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
* Public License for more details. * Public License for more details.
@@ -17,8 +17,8 @@
* received a copy with calc; if not, write to Free Software Foundation, Inc. * received a copy with calc; if not, write to Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* @(#) $Revision: 30.3 $ * @(#) $Revision: 30.4 $
* @(#) $Id: bernpoly.cal,v 30.3 2013/08/11 08:41:38 chongo Exp $ * @(#) $Id: bernpoly.cal,v 30.4 2013/08/18 20:01:53 chongo Exp $
* @(#) $Source: /usr/local/src/bin/calc/cal/RCS/bernpoly.cal,v $ * @(#) $Source: /usr/local/src/bin/calc/cal/RCS/bernpoly.cal,v $
* *
* Under source code control: 2013/08/11 01:31:28 * Under source code control: 2013/08/11 01:31:28

View File

@@ -1,13 +1,13 @@
/* /*
* brentsolve- Root finding with the Brent-Dekker trick. * brentsolve - Root finding with the Brent-Dekker trick
* *
* Copyright (C) 2013 Christoph Zurnieden * Copyright (C) 2013 Christoph Zurnieden
* *
* brentsolve is open software; you can redistribute it and/or modify it under * 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 * the terms of the version 2.1 of the GNU Lesser General Public License
* as published by the Free Software Foundation. * as published by the Free Software Foundation.
* *
* brentsolve is distributed in the hope that it will be useful, but WITHOUT * Calc is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
* Public License for more details. * Public License for more details.
@@ -17,14 +17,15 @@
* received a copy with calc; if not, write to Free Software Foundation, Inc. * received a copy with calc; if not, write to Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* @(#) $Revision: 30.3 $ * @(#) $Revision: 30.4 $
* @(#) $Id: brentsolve.cal,v 30.3 2013/08/11 08:41:38 chongo Exp $ * @(#) $Id: brentsolve.cal,v 30.4 2013/08/18 20:01:53 chongo Exp $
* @(#) $Source: /usr/local/src/bin/calc/cal/RCS/brentsolve.cal,v $ * @(#) $Source: /usr/local/src/bin/calc/cal/RCS/brentsolve.cal,v $
* *
* Under source code control: 2013/08/11 01:31:28 * Under source code control: 2013/08/11 01:31:28
* File existed as early as: 2013 * File existed as early as: 2013
*/ */
static resource_debug_level; static resource_debug_level;
resource_debug_level = config("resource_debug", 0); resource_debug_level = config("resource_debug", 0);

View File

@@ -3,11 +3,11 @@
* *
* Copyright (C) 2013 Christoph Zurnieden * Copyright (C) 2013 Christoph Zurnieden
* *
* constants is open software; you can redistribute it and/or modify it under * 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 * the terms of the version 2.1 of the GNU Lesser General Public License
* as published by the Free Software Foundation. * as published by the Free Software Foundation.
* *
* constants is distributed in the hope that it will be useful, but WITHOUT * Calc is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
* Public License for more details. * Public License for more details.
@@ -17,8 +17,8 @@
* received a copy with calc; if not, write to Free Software Foundation, Inc. * received a copy with calc; if not, write to Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* @(#) $Revision: 30.3 $ * @(#) $Revision: 30.4 $
* @(#) $Id: constants.cal,v 30.3 2013/08/11 08:41:38 chongo Exp $ * @(#) $Id: constants.cal,v 30.4 2013/08/18 20:01:53 chongo Exp $
* @(#) $Source: /usr/local/src/bin/calc/cal/RCS/constants.cal,v $ * @(#) $Source: /usr/local/src/bin/calc/cal/RCS/constants.cal,v $
* *
* Under source code control: 2013/08/11 01:31:28 * Under source code control: 2013/08/11 01:31:28

View File

@@ -3,11 +3,11 @@
* *
* Copyright (C) 2013 Christoph Zurnieden * Copyright (C) 2013 Christoph Zurnieden
* *
* factorial is open software; you can redistribute it and/or modify it under * 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 * the terms of the version 2.1 of the GNU Lesser General Public License
* as published by the Free Software Foundation. * as published by the Free Software Foundation.
* *
* factorial is distributed in the hope that it will be useful, but WITHOUT * Calc is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
* Public License for more details. * Public License for more details.
@@ -17,8 +17,8 @@
* received a copy with calc; if not, write to Free Software Foundation, Inc. * received a copy with calc; if not, write to Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* @(#) $Revision: 30.3 $ * @(#) $Revision: 30.4 $
* @(#) $Id: factorial.cal,v 30.3 2013/08/11 08:41:38 chongo Exp $ * @(#) $Id: factorial.cal,v 30.4 2013/08/18 20:01:53 chongo Exp $
* @(#) $Source: /usr/local/src/bin/calc/cal/RCS/factorial.cal,v $ * @(#) $Source: /usr/local/src/bin/calc/cal/RCS/factorial.cal,v $
* *
* Under source code control: 2013/08/11 01:31:28 * Under source code control: 2013/08/11 01:31:28

View File

@@ -3,22 +3,22 @@
* *
* Copyright (C) 2013 Christoph Zurnieden * Copyright (C) 2013 Christoph Zurnieden
* *
* factorial2 is open software; you can redistribute it and/or modify it under * 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 * the terms of the version 2.1 of the GNU Lesser General Public License
* as published by the Free Software Foundation. * as published by the Free Software Foundation.
* *
* factorial2 is distributed in the hope that it will be useful, but WITHOUT * Calc is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
* Public License for more details. * Public License for more details.
* *
* A copy of version 2.1 of the GNU Lesser General Public License is * A copy of version 2.1 of the GNU Lesser General Public License is
* distributed with factorial2 under the filename COPYING-LGPL. You should have * distributed with calc under the filename COPYING-LGPL. You should have
* received a copy with calc; if not, write to Free Software Foundation, Inc. * received a copy with calc; if not, write to Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* @(#) $Revision: 30.3 $ * @(#) $Revision: 30.4 $
* @(#) $Id: factorial2.cal,v 30.3 2013/08/11 08:41:38 chongo Exp $ * @(#) $Id: factorial2.cal,v 30.4 2013/08/18 20:01:53 chongo Exp $
* @(#) $Source: /usr/local/src/bin/calc/cal/RCS/factorial2.cal,v $ * @(#) $Source: /usr/local/src/bin/calc/cal/RCS/factorial2.cal,v $
* *
* Under source code control: 2013/08/11 01:31:28 * Under source code control: 2013/08/11 01:31:28

View File

@@ -3,11 +3,11 @@
* *
* Copyright (C) 2013 Christoph Zurnieden * Copyright (C) 2013 Christoph Zurnieden
* *
* lambertw is open software; you can redistribute it and/or modify it under * 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 * the terms of the version 2.1 of the GNU Lesser General Public License
* as published by the Free Software Foundation. * as published by the Free Software Foundation.
* *
* lambertw is distributed in the hope that it will be useful, but WITHOUT * Calc is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
* Public License for more details. * Public License for more details.
@@ -17,8 +17,8 @@
* received a copy with calc; if not, write to Free Software Foundation, Inc. * received a copy with calc; if not, write to Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* @(#) $Revision: 30.3 $ * @(#) $Revision: 30.4 $
* @(#) $Id: lambertw.cal,v 30.3 2013/08/11 08:41:38 chongo Exp $ * @(#) $Id: lambertw.cal,v 30.4 2013/08/18 20:01:53 chongo Exp $
* @(#) $Source: /usr/local/src/bin/calc/cal/RCS/lambertw.cal,v $ * @(#) $Source: /usr/local/src/bin/calc/cal/RCS/lambertw.cal,v $
* *
* Under source code control: 2013/08/11 01:31:28 * Under source code control: 2013/08/11 01:31:28

View File

@@ -1,13 +1,13 @@
/* /*
* special_functions - special functions (e.g.: gamma, zeta, psi) * lnseries - special functions (e.g.: gamma, zeta, psi)
* *
* Copyright (C) 2013 Christoph Zurnieden * Copyright (C) 2013 Christoph Zurnieden
* *
* lnseries.cal is open software; you can redistribute it and/or modify it under * 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 * the terms of the version 2.1 of the GNU Lesser General Public License
* as published by the Free Software Foundation. * as published by the Free Software Foundation.
* *
* lnseries.cal is distributed in the hope that it will be useful, but WITHOUT * Calc is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
* Public License for more details. * Public License for more details.
@@ -17,8 +17,8 @@
* received a copy with calc; if not, write to Free Software Foundation, Inc. * received a copy with calc; if not, write to Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* @(#) $Revision: 30.3 $ * @(#) $Revision: 30.4 $
* @(#) $Id: lnseries.cal,v 30.3 2013/08/11 08:41:38 chongo Exp $ * @(#) $Id: lnseries.cal,v 30.4 2013/08/18 20:01:53 chongo Exp $
* @(#) $Source: /usr/local/src/bin/calc/cal/RCS/lnseries.cal,v $ * @(#) $Source: /usr/local/src/bin/calc/cal/RCS/lnseries.cal,v $
* *
* Under source code control: 2013/08/11 01:31:28 * Under source code control: 2013/08/11 01:31:28

View File

@@ -17,8 +17,8 @@
* received a copy with calc; if not, write to Free Software Foundation, Inc. * received a copy with calc; if not, write to Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* @(#) $Revision: 30.8 $ * @(#) $Revision: 30.10 $
* @(#) $Id: regress.cal,v 30.8 2013/08/11 08:41:38 chongo Exp $ * @(#) $Id: regress.cal,v 30.10 2013/09/01 22:08:44 chongo Exp $
* @(#) $Source: /usr/local/src/bin/calc/cal/RCS/regress.cal,v $ * @(#) $Source: /usr/local/src/bin/calc/cal/RCS/regress.cal,v $
* *
* Under source code control: 1990/02/15 01:50:36 * Under source code control: 1990/02/15 01:50:36
@@ -1445,7 +1445,93 @@ define test_functions()
vrfy(jacobi(-1,-1) == 0, '1236: jacobi(-1,-1) == 0'); vrfy(jacobi(-1,-1) == 0, '1236: jacobi(-1,-1) == 0');
vrfy(jacobi(0,-1) == 0, '1237: jacobi(0,-1) == 0'); vrfy(jacobi(0,-1) == 0, '1237: jacobi(0,-1) == 0');
print '1238: Ending test_functions'; /* ctype function tests */
vrfy(isalnum("A") == 1, '1238: isalnum("A") == 1');
vrfy(isalnum("a") == 1, '1239: isalnum("a") == 1');
vrfy(isalnum("2") == 1, '1239: isalnum("2") == 1');
vrfy(isalnum("\t") == 0, '1240: isalnum("\t") == 0');
vrfy(isalpha("A") == 1, '1241: isalpha("A") == 1');
vrfy(isalpha("a") == 1, '1242: isalpha("a") == 1');
vrfy(isalpha("2") == 0, '1243: isalpha("2") == 0');
vrfy(isalpha("\t") == 0, '1244: isalpha("\t") == 0');
vrfy(iscntrl("A") == 0, '1245: iscntrl("A") == 0');
vrfy(iscntrl("a") == 0, '1246: iscntrl("a") == 0');
vrfy(iscntrl("2") == 0, '1247: iscntrl("2") == 0');
vrfy(iscntrl("\t") == 1, '1248: iscntrl("\t") == 1');
vrfy(isdigit("A") == 0, '1249: isdigit("A") == 0');
vrfy(isdigit("a") == 0, '1250: isdigit("a") == 0');
vrfy(isdigit("2") == 1, '1251: isdigit("2") == 1');
vrfy(isdigit("\t") == 0, '1252: isdigit("\t") == 0');
vrfy(isgraph("A") == 1, '1253: isgraph("A") == 1');
vrfy(isgraph("a") == 1, '1254: isgraph("a") == 1');
vrfy(isgraph("2") == 1, '1255: isgraph("2") == 1');
vrfy(isgraph("\t") == 0, '1255: isgraph("\t") == 0');
vrfy(islower("A") == 0, '1256: islower("A") == 0');
vrfy(islower("a") == 1, '1257: islower("a") == 1');
vrfy(islower("1") == 0, '1258: islower("1") == 0');
vrfy(isprint("A") == 1, '1259: isprint("A") == 1');
vrfy(isprint("a") == 1, '1260: isprint("a") == 1');
vrfy(isprint(" ") == 1, '1261: isprint(" ") == 1');
vrfy(isprint("\t") == 0, '1262: isprint("\t") == 0');
vrfy(ispunct("A") == 0, '1263: ispunct("A") == 0');
vrfy(ispunct("a") == 0, '1264: ispunct("a") == 0');
vrfy(ispunct(" ") == 0, '1265: ispunct(" ") == 0');
vrfy(ispunct("?") == 1, '1266: ispunct("?") == 1');
vrfy(isspace("A") == 0, '1267: isspace("A") == 0');
vrfy(isspace("Krik") == 0, '1268: isspace("Krik") == 0');
vrfy(isspace(" ") == 1, '1269: isspace(" ") == 1');
vrfy(isspace("?") == 0, '1270: isspace("?") == 0');
vrfy(isupper("A") == 1, '1271: isupper("A") == 1');
vrfy(isupper("a") == 0, '1272: isupper("a") == 0');
vrfy(isupper("1") == 0, '1273: isupper("1") == 0');
vrfy(isxdigit("A") == 1, '1274: isxdigit("A") == 1');
vrfy(isxdigit("f") == 1, '1275: isxdigit("f") == 1');
vrfy(isxdigit("2") == 1, '1276: isxdigit("2") == 1');
vrfy(isxdigit("x") == 0, '1277: isxdigit("x") == 0');
vrfy(strcasecmp("ab", "aBc") == -1,
'1278: strcasecmp("ab", "aBc") == -1');
vrfy(strcasecmp("abc", "aBb") == 1,
'1279: strcasecmp("abc", "aBb") == 1');
vrfy(strcasecmp("abc", "abc") == 0,
'1280: strcasecmp("abc", "abc") == 0');
vrfy(strcasecmp("abc", "aBc") == 0,
'1281: strcasecmp("abc", "aBc") == 0');
vrfy(strcasecmp("abc", "aBd") == -1,
'1282: strcasecmp("abc", "aBd") == -1');
vrfy(strcasecmp("abc\0", "aBc") == 1,
'1283: strcasecmp("abc\0", "aBc") == 1');
vrfy(strcasecmp("a\0b", "A\0c") == -1,
'1284: strcasecmp("a\0b", "A\0c") == -1');
vrfy(strncasecmp("abc", "xyz", 0) == 0,
'1285: strncasecmp("abc", "xyz", 0) == 0');
vrfy(strncasecmp("abc", "xyz", 1) == -1,
'1286: strncasecmp("abc", "xyz", 1) == -1');
vrfy(strncasecmp("abc", "", 1) == 1,
'1287: strncasecmp("abc", "", 1) == 1');
vrfy(strncasecmp("a", "b", 2) == -1,
'1288: strncasecmp("a", "b", 2) == -1');
vrfy(strncasecmp("ab", "Ac", 2) == -1,
'1289: strncasecmp("ab", "Ac", 2) == -1');
vrfy(strncasecmp("\0ac", "\0b", 2) == -1,
'1290: strncasecmp("\0ac", "\0b", 2) == -1');
vrfy(strncasecmp("ab", "aBc", 2) == 0,
'1291: strncasecmp("ab", "aBc", 2) == 0');
vrfy(strncasecmp("abc", "abd", 2) == 0,
'1292: strncasecmp("abc", "abd", 2) == 0');
print '1293: Ending test_functions';
} }
print '017: parsed test_functions()'; print '017: parsed test_functions()';
@@ -1462,14 +1548,14 @@ define _test_underscore()
local _a = 27; local _a = 27;
local __a = 23209; local __a = 23209;
print "1290: Beginning _test_underscore"; print "1294: Beginning _test_underscore";
vrfy(_a == 27, '1291: _a == 27'); vrfy(_a == 27, '1295: _a == 27');
vrfy(_ == 49, '1292: _ == 49'); vrfy(_ == 49, '1296: _ == 49');
vrfy(__ == 63, '1293: __ == 63'); vrfy(__ == 63, '1297: __ == 63');
vrfy(__a == 23209, '1294: __a == 23209'); vrfy(__a == 23209, '1298: __a == 23209');
print "1295: Ending _test_underscore"; print "1299: Ending _test_underscore";
} }
print '020: parsed _test_underscore'; print '020: parsed _test_underscore';
@@ -5031,7 +5117,7 @@ vrfy(i == 9, '151: i == 9');
/* /*
* test_commaeq - test changes to , and = * test_commaeq - test changes to = and ,
*/ */
obj xx5600 {} xx5600; obj xx5600 {} xx5600;
print '152: obj xx5600 {} xx5600'; print '152: obj xx5600 {} xx5600';

File diff suppressed because it is too large Load Diff

View File

@@ -3,11 +3,11 @@
* *
* Copyright (C) 2013 Christoph Zurnieden * Copyright (C) 2013 Christoph Zurnieden
* *
* statistics is open software; you can redistribute it and/or modify it under * 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 * the terms of the version 2.1 of the GNU Lesser General Public License
* as published by the Free Software Foundation. * as published by the Free Software Foundation.
* *
* statistics is distributed in the hope that it will be useful, but WITHOUT * Calc is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
* Public License for more details. * Public License for more details.
@@ -17,8 +17,8 @@
* received a copy with calc; if not, write to Free Software Foundation, Inc. * received a copy with calc; if not, write to Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* @(#) $Revision: 30.3 $ * @(#) $Revision: 30.4 $
* @(#) $Id: statistics.cal,v 30.3 2013/08/11 08:41:38 chongo Exp $ * @(#) $Id: statistics.cal,v 30.4 2013/08/18 20:01:53 chongo Exp $
* @(#) $Source: /usr/local/src/bin/calc/cal/RCS/statistics.cal,v $ * @(#) $Source: /usr/local/src/bin/calc/cal/RCS/statistics.cal,v $
* *
* Under source code control: 2013/08/11 01:31:28 * Under source code control: 2013/08/11 01:31:28
@@ -31,7 +31,7 @@ resource_debug_level = config("resource_debug", 0);
/* /*
get dependencies * get dependencies
*/ */
read -once factorial2 brentsolve read -once factorial2 brentsolve

File diff suppressed because it is too large Load Diff

View File

@@ -1,13 +1,13 @@
/* /*
* Toom-Cook - implementation of Toom-Cook(3,4) multiplication algorithm * toomcook - implementation of Toom-Cook(3,4) multiplication algorithm
* *
* Copyright (C) 2013 Christoph Zurnieden * Copyright (C) 2013 Christoph Zurnieden
* *
* Toom-Cook is open software; you can redistribute it and/or modify it under * 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 * the terms of the version 2.1 of the GNU Lesser General Public License
* as published by the Free Software Foundation. * as published by the Free Software Foundation.
* *
* Toom-Cook is distributed in the hope that it will be useful, but WITHOUT * Calc is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
* Public License for more details. * Public License for more details.
@@ -17,8 +17,8 @@
* received a copy with calc; if not, write to Free Software Foundation, Inc. * received a copy with calc; if not, write to Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* @(#) $Revision: 30.3 $ * @(#) $Revision: 30.4 $
* @(#) $Id: toomcook.cal,v 30.3 2013/08/11 08:41:38 chongo Exp $ * @(#) $Id: toomcook.cal,v 30.4 2013/08/18 20:01:53 chongo Exp $
* @(#) $Source: /usr/local/src/bin/calc/cal/RCS/toomcook.cal,v $ * @(#) $Source: /usr/local/src/bin/calc/cal/RCS/toomcook.cal,v $
* *
* Under source code control: 2013/08/11 01:31:28 * Under source code control: 2013/08/11 01:31:28

View File

@@ -1,27 +1,29 @@
/* /*
* zeta2 - Hurwitz Zeta function * zeta2 - Hurwitz Zeta function
* Copyright (C) 2013 Christoph Zurnieden
* Version: 0.0.1
* Licence: GPL
* *
* This program is free software; you can redistribute it and/or modify * Calc is open software; you can redistribute it and/or modify it under
* it under the terms of the GNU General Public License as published by * the terms of the version 2.1 of the GNU Lesser General Public License
* the Free Software Foundation; either version 2 of the License, or * as published by the Free Software Foundation.
* (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * Calc is distributed in the hope that it will be useful, but WITHOUT
* but WITHOUT ANY WARRANTY; without even the implied warranty of * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
* GNU General Public License for more details. * Public License for more details.
* *
* @(#) $Revision: 30.3 $ * A copy of version 2.1 of the GNU Lesser General Public License is
* @(#) $Id: zeta2.cal,v 30.3 2013/08/11 08:41:38 chongo Exp $ * distributed with calc under the filename COPYING-LGPL. You should have
* received a copy with calc; if not, write to Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* @(#) $Revision: 30.4 $
* @(#) $Id: zeta2.cal,v 30.4 2013/08/18 20:01:53 chongo Exp $
* @(#) $Source: /usr/local/src/bin/calc/cal/RCS/zeta2.cal,v $ * @(#) $Source: /usr/local/src/bin/calc/cal/RCS/zeta2.cal,v $
* *
* Under source code control: 2013/08/11 01:31:28 * Under source code control: 2013/08/11 01:31:28
* File existed as early as: 2013 * File existed as early as: 2013
*/ */
/* /*
* hide internal function from resource debugging * hide internal function from resource debugging
*/ */

4
calc.h
View File

@@ -17,8 +17,8 @@
* received a copy with calc; if not, write to Free Software Foundation, Inc. * received a copy with calc; if not, write to Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* @(#) $Revision: 30.3 $ * @(#) $Revision: 30.4 $
* @(#) $Id: calc.h,v 30.3 2013/08/11 08:41:38 chongo Exp $ * @(#) $Id: calc.h,v 30.4 2013/09/01 22:16:21 chongo Exp $
* @(#) $Source: /usr/local/src/bin/calc/RCS/calc.h,v $ * @(#) $Source: /usr/local/src/bin/calc/RCS/calc.h,v $
* *
* Under source code control: 1990/02/15 01:48:31 * Under source code control: 1990/02/15 01:48:31

View File

@@ -17,8 +17,8 @@
# received a copy with calc; if not, write to Free Software Foundation, Inc. # received a copy with calc; if not, write to Free Software Foundation, Inc.
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
# #
# @(#) $Revision: 30.1 $ # @(#) $Revision: 30.3 $
# @(#) $Id: calcerr.tbl,v 30.1 2007/03/16 11:09:46 chongo Exp $ # @(#) $Id: calcerr.tbl,v 30.3 2013/09/01 19:23:57 chongo Exp $
# @(#) $Source: /usr/local/src/bin/calc/RCS/calcerr.tbl,v $ # @(#) $Source: /usr/local/src/bin/calc/RCS/calcerr.tbl,v $
# #
# Under source code control: 1996/05/23 17:38:44 # Under source code control: 1996/05/23 17:38:44
@@ -32,6 +32,16 @@
# #
# SYMBOL meaning # SYMBOL meaning
######################################################################
# WARNING: The order of the lines below is critical! If you change #
# the order, you will break code that depends on the return #
# value of the errno() builtin function. #
# #
# If you need to add values to this table, ONLY add then #
# to the bottom of the file! #
######################################################################
E_1OVER0 Division by zero E_1OVER0 Division by zero
E_0OVER0 Indeterminate (0/0) E_0OVER0 Indeterminate (0/0)
E_ADD Bad arguments for + E_ADD Bad arguments for +
@@ -449,3 +459,17 @@ E_FGETFILE1 Non-file argument for fgetfile
E_FGETFILE2 File argument for fgetfile not open for reading E_FGETFILE2 File argument for fgetfile not open for reading
E_FGETFILE3 Unable to set file position in fgetfile E_FGETFILE3 Unable to set file position in fgetfile
E_ESTR Non-representable type for estr E_ESTR Non-representable type for estr
E_STRCASECMP Non-string argument for strcasecmp
E_STRNCASECMP Bad argument type for strncasecmp
E_ISUPPER Bad argument for isupper
E_ISLOWER Bad argument for islower
E_ISALNUM Bad argument for isalnum
E_ISALPHA Bad argument for isalpha
E_ISASCII Bad argument for isascii
E_ISCNTRL Bad argument for iscntrl
E_ISDIGIT Bad argument for isdigit
E_ISGRAPH Bad argument for isgraph
E_ISPRINT Bad argument for isprint
E_ISPUNCT Bad argument for ispunct
E_ISSPACE Bad argument for isspace
E_ISXDIGIT Bad argument for isxdigit

View File

@@ -18,9 +18,9 @@
# received a copy with calc; if not, write to Free Software Foundation, Inc. # received a copy with calc; if not, write to Free Software Foundation, Inc.
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
# #
# @(#) $Revision: 30.28 $ # @(#) $Revision: 30.29 $
# @(#) $Id: Makefile.head,v 30.28 2013/08/11 05:40:18 chongo Exp $ # @(#) $Id: Makefile.head,v 30.29 2013/08/17 01:22:19 chongo Exp $
# @(#) $Source: /usr/local/src/cmd/calc/custom/RCS/Makefile.head,v $ # @(#) $Source: /usr/local/src/bin/calc/custom/RCS/Makefile.head,v $
# #
# Under source code control: 1997/03/09 02:28:54 # Under source code control: 1997/03/09 02:28:54
# File existed as early as: 1997 # File existed as early as: 1997
@@ -366,7 +366,7 @@ EXT=
# The default calc versions # The default calc versions
# #
VERSION= 2.12.4.10 VERSION= 2.12.4.11
VERS= 2.12.4 VERS= 2.12.4
VER= 2.12 VER= 2.12
VE= 2 VE= 2
@@ -473,16 +473,16 @@ LDFLAGS= ${LD_DEBUG} ${ILDFLAGS}
# BLD_TYPE= calc-static-only # BLD_TYPE= calc-static-only
# #
# CC_SHARE are flags given to ${CC} to build .o files suitable for shared libs # CC_SHARE are flags given to ${CC} to build .o files suitable for shared libs
# DEFAULT_LIB_INSTALL_PATH is where calc progs look for calc shared libs # DEFAULT_LIB_INSTALL_PATH is where calc programs look for calc shared libs
# LD_SHARE are common flags given to ${CC} to link with shared libraries # LD_SHARE are common flags given to ${CC} to link with shared libraries
# LIBCALC_SHLIB are flags given to ${CC} to build libcalc shared lib # LIBCALC_SHLIB are flags given to ${CC} to build libcalc shared libraries
# LIBCUSTCALC_SHLIB are flags given to ${CC} to build libcustcalc shared lib # LIBCUSTCALC_SHLIB are flags given to ${CC} to build libcustcalc shared lib
# #
# NOTE: The above 4 values are unused if BLD_TYPE= calc-static-only # NOTE: The above 4 values are unused if BLD_TYPE= calc-static-only
# #
# CC_STATIC are flags given to ${CC} to build .o files suitable for static libs # CC_STATIC are flags given to ${CC} to build .o files suitable for static libs
# LD_STATIC are common flags given to ${CC} to link with static libraries # LD_STATIC are common flags given to ${CC} to link with static libraries
# LIBCALC_STATIC are flags given to ${CC} to build libcalc static lib # LIBCALC_STATIC are flags given to ${CC} to build libcalc static libraries
# LIBCUSTCALC_STATIC are flags given to ${CC} to build libcustcalc static lib # LIBCUSTCALC_STATIC are flags given to ${CC} to build libcustcalc static lib
# #
# NOTE: The above 4 values are unused if BLD_TYPE= calc-dynamic-only # NOTE: The above 4 values are unused if BLD_TYPE= calc-dynamic-only
@@ -495,7 +495,7 @@ LDFLAGS= ${LD_DEBUG} ${ILDFLAGS}
# to abort on warnings, then leave CCWERR blank. # to abort on warnings, then leave CCWERR blank.
# CCMISC are misc flags given to ${CC} # CCMISC are misc flags given to ${CC}
# #
# LCC how the C compiler is invoked on locally executed intermediate progs # LCC is how the C compiler is invoked on locally executed intermediate programs
# CC is how the C compiler is invoked (with an optional Purify) # CC is how the C compiler is invoked (with an optional Purify)
# #
# Specific target overrides or modifications to default values # Specific target overrides or modifications to default values
@@ -576,7 +576,7 @@ CCMISC= ${DARWIN_ARCH}
LCC= MACOSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET} gcc LCC= MACOSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET} gcc
CC= ${PURIFY} ${LCC} ${CCWERR} CC= ${PURIFY} ${LCC} ${CCWERR}
# #
# Darmin dynamic shared lib filenames # Darwin dynamic shared lib filenames
LIB_EXT:= .dylib LIB_EXT:= .dylib
LIB_EXT_VERSION:= .${VERSION}${LIB_EXT} LIB_EXT_VERSION:= .${VERSION}${LIB_EXT}
LIB_EXT_VERS:= .${VERS}${LIB_EXT} LIB_EXT_VERS:= .${VERS}${LIB_EXT}
@@ -779,10 +779,10 @@ CC= ${PURIFY} ${LCC} ${CCWERR}
# #
# The simple makefile forces the use of static ${CC} flags # The simple makefile forces the use of static ${CC} flags
# #
# ICFLAGS are given to ${CC} for intermediate progs used to help compile calc # ICFLAGS are given to ${CC} for intermediate programs used to help compile calc
# CFLAGS are given to ${CC} for calc progs other than intermediate progs # CFLAGS are given to ${CC} for calc programs other than intermediate programs
# ILDFLAGS for ${CC} in linking intermediate progs used to help compile calc # ILDFLAGS for ${CC} in linking intermediate programs used to help compile calc
# LDFLAGS for ${CC} in linking calc progs other than intermediate progs # LDFLAGS for ${CC} in linking calc programs other than intermediate programs
# #
ICFLAGS= ${COMMON_CFLAGS} ${CC_STATIC} ICFLAGS= ${COMMON_CFLAGS} ${CC_STATIC}
CFLAGS= ${ICFLAGS} ${CCOPT} CFLAGS= ${ICFLAGS} ${CCOPT}
@@ -882,8 +882,8 @@ endif
# Required flags to compile C files for calc # Required flags to compile C files for calc
# #
# ICFLAGS are given to ${CC} for intermediate progs used to help compile calc # ICFLAGS are given to ${CC} for intermediate programs used to help compile calc
# CFLAGS are given to ${CC} for calc progs other than intermediate progs # CFLAGS are given to ${CC} for calc programs other than intermediate programs
# #
# NOTE: This does not work for: make-XYZ-only and BLD_TYPE != make-XYZ-only # NOTE: This does not work for: make-XYZ-only and BLD_TYPE != make-XYZ-only
# #
@@ -896,8 +896,8 @@ CFLAGS= ${ICFLAGS} ${CCOPT}
# Required flags to link files for calc # Required flags to link files for calc
# #
# ILDFLAGS for ${CC} in linking intermediate progs used to help compile calc # ILDFLAGS for ${CC} in linking intermediate programs used to help compile calc
# LDFLAGS for ${CC} in linking calc progs other than intermediate progs # LDFLAGS for ${CC} in linking calc programs other than intermediate programs
# #
ILDFLAGS= ${COMMON_LDFLAGS} ILDFLAGS= ${COMMON_LDFLAGS}
LDFLAGS= ${LD_DEBUG} ${ILDFLAGS} LDFLAGS= ${LD_DEBUG} ${ILDFLAGS}

View File

@@ -18,9 +18,9 @@
# received a copy with calc; if not, write to Free Software Foundation, Inc. # received a copy with calc; if not, write to Free Software Foundation, Inc.
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
# #
# @(#) $Revision: 30.28 $ # @(#) $Revision: 30.29 $
# @(#) $Id: Makefile.head,v 30.28 2013/08/11 05:40:18 chongo Exp $ # @(#) $Id: Makefile.head,v 30.29 2013/08/17 01:22:19 chongo Exp $
# @(#) $Source: /usr/local/src/cmd/calc/custom/RCS/Makefile.head,v $ # @(#) $Source: /usr/local/src/bin/calc/custom/RCS/Makefile.head,v $
# #
# Under source code control: 1997/03/09 02:28:54 # Under source code control: 1997/03/09 02:28:54
# File existed as early as: 1997 # File existed as early as: 1997
@@ -366,7 +366,7 @@ EXT=
# The default calc versions # The default calc versions
# #
VERSION= 2.12.4.10 VERSION= 2.12.4.11
VERS= 2.12.4 VERS= 2.12.4
VER= 2.12 VER= 2.12
VE= 2 VE= 2

View File

@@ -18,9 +18,9 @@
# received a copy with calc; if not, write to Free Software Foundation, Inc. # received a copy with calc; if not, write to Free Software Foundation, Inc.
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
# #
# @(#) $Revision: 30.28 $ # @(#) $Revision: 30.29 $
# @(#) $Id: Makefile.head,v 30.28 2013/08/11 05:40:18 chongo Exp $ # @(#) $Id: Makefile.head,v 30.29 2013/08/17 01:22:19 chongo Exp $
# @(#) $Source: /usr/local/src/cmd/calc/custom/RCS/Makefile.head,v $ # @(#) $Source: /usr/local/src/bin/calc/custom/RCS/Makefile.head,v $
# #
# Under source code control: 1997/03/09 02:28:54 # Under source code control: 1997/03/09 02:28:54
# File existed as early as: 1997 # File existed as early as: 1997
@@ -351,7 +351,7 @@ EXT=
# The default calc versions # The default calc versions
# #
VERSION= 2.12.4.10 VERSION= 2.12.4.11
VERS= 2.12.4 VERS= 2.12.4
VER= 2.12 VER= 2.12
VE= 2 VE= 2
@@ -433,16 +433,16 @@ COMMON_LDFLAGS= ${EXTRA_LDFLAGS}
# BLD_TYPE= calc-static-only # BLD_TYPE= calc-static-only
# #
# CC_SHARE are flags given to ${CC} to build .o files suitable for shared libs # CC_SHARE are flags given to ${CC} to build .o files suitable for shared libs
# DEFAULT_LIB_INSTALL_PATH is where calc progs look for calc shared libs # DEFAULT_LIB_INSTALL_PATH is where calc programs look for calc shared libs
# LD_SHARE are common flags given to ${CC} to link with shared libraries # LD_SHARE are common flags given to ${CC} to link with shared libraries
# LIBCALC_SHLIB are flags given to ${CC} to build libcalc shared lib # LIBCALC_SHLIB are flags given to ${CC} to build libcalc shared libraries
# LIBCUSTCALC_SHLIB are flags given to ${CC} to build libcustcalc shared lib # LIBCUSTCALC_SHLIB are flags given to ${CC} to build libcustcalc shared lib
# #
# NOTE: The above 4 values are unused if BLD_TYPE= calc-static-only # NOTE: The above 4 values are unused if BLD_TYPE= calc-static-only
# #
# CC_STATIC are flags given to ${CC} to build .o files suitable for static libs # CC_STATIC are flags given to ${CC} to build .o files suitable for static libs
# LD_STATIC are common flags given to ${CC} to link with static libraries # LD_STATIC are common flags given to ${CC} to link with static libraries
# LIBCALC_STATIC are flags given to ${CC} to build libcalc static lib # LIBCALC_STATIC are flags given to ${CC} to build libcalc static libraries
# LIBCUSTCALC_STATIC are flags given to ${CC} to build libcustcalc static lib # LIBCUSTCALC_STATIC are flags given to ${CC} to build libcustcalc static lib
# #
# NOTE: The above 4 values are unused if BLD_TYPE= calc-dynamic-only # NOTE: The above 4 values are unused if BLD_TYPE= calc-dynamic-only
@@ -455,7 +455,7 @@ COMMON_LDFLAGS= ${EXTRA_LDFLAGS}
# to abort on warnings, then leave CCWERR blank. # to abort on warnings, then leave CCWERR blank.
# CCMISC are misc flags given to ${CC} # CCMISC are misc flags given to ${CC}
# #
# LCC how the C compiler is invoked on locally executed intermediate progs # LCC is how the C compiler is invoked on locally executed intermediate programs
# CC is how the C compiler is invoked (with an optional Purify) # CC is how the C compiler is invoked (with an optional Purify)
# #
# Specific target overrides or modifications to default values # Specific target overrides or modifications to default values
@@ -495,10 +495,10 @@ CC= ${PURIFY} ${LCC} ${CCWERR}
# #
# The simple makefile forces the use of static ${CC} flags # The simple makefile forces the use of static ${CC} flags
# #
# ICFLAGS are given to ${CC} for intermediate progs used to help compile calc # ICFLAGS are given to ${CC} for intermediate programs used to help compile calc
# CFLAGS are given to ${CC} for calc progs other than intermediate progs # CFLAGS are given to ${CC} for calc programs other than intermediate programs
# ILDFLAGS for ${CC} in linking intermediate progs used to help compile calc # ILDFLAGS for ${CC} in linking intermediate programs used to help compile calc
# LDFLAGS for ${CC} in linking calc progs other than intermediate progs # LDFLAGS for ${CC} in linking calc programs other than intermediate programs
# #
ICFLAGS= ${COMMON_CFLAGS} ${CC_STATIC} ICFLAGS= ${COMMON_CFLAGS} ${CC_STATIC}
CFLAGS= ${ICFLAGS} ${CCOPT} CFLAGS= ${ICFLAGS} ${CCOPT}

View File

@@ -17,8 +17,8 @@
* received a copy with calc; if not, write to Free Software Foundation, Inc. * received a copy with calc; if not, write to Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* @(#) $Revision: 30.3 $ * @(#) $Revision: 30.4 $
* @(#) $Id: c_sysinfo.c,v 30.3 2013/08/11 08:41:38 chongo Exp $ * @(#) $Id: c_sysinfo.c,v 30.4 2013/09/01 22:16:21 chongo Exp $
* @(#) $Source: /usr/local/src/bin/calc/custom/RCS/c_sysinfo.c,v $ * @(#) $Source: /usr/local/src/bin/calc/custom/RCS/c_sysinfo.c,v $
* *
* Under source code control: 1997/03/09 23:14:40 * Under source code control: 1997/03/09 23:14:40

View File

@@ -11,7 +11,7 @@ TYPES
DESCRIPTION DESCRIPTION
This custom function will return the value certain selected #defile This custom function will return the value certain selected #define
values. The infoname arg must be a string that matches the given values. The infoname arg must be a string that matches the given
#define name. For conveience, the case infoname does not matter, #define name. For conveience, the case infoname does not matter,
so "baseb" and "BASEB" refer to the same #define value. so "baseb" and "BASEB" refer to the same #define value.
@@ -69,8 +69,8 @@ SEE ALSO
## received a copy with calc; if not, write to Free Software Foundation, Inc. ## received a copy with calc; if not, write to Free Software Foundation, Inc.
## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
## ##
## @(#) $Revision: 30.1 $ ## @(#) $Revision: 30.2 $
## @(#) $Id: sysinfo,v 30.1 2007/03/16 11:10:04 chongo Exp $ ## @(#) $Id: sysinfo,v 30.2 2013/08/17 01:57:37 chongo Exp $
## @(#) $Source: /usr/local/src/bin/calc/custom/RCS/sysinfo,v $ ## @(#) $Source: /usr/local/src/bin/calc/custom/RCS/sysinfo,v $
## ##
## Under source code control: 1997/03/09 23:14:40 ## Under source code control: 1997/03/09 23:14:40

4
file.h
View File

@@ -19,8 +19,8 @@
* received a copy with calc; if not, write to Free Software Foundation, Inc. * received a copy with calc; if not, write to Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* @(#) $Revision: 30.2 $ * @(#) $Revision: 30.3 $
* @(#) $Id: file.h,v 30.2 2013/08/11 08:41:38 chongo Exp $ * @(#) $Id: file.h,v 30.3 2013/09/01 22:16:21 chongo Exp $
* @(#) $Source: /usr/local/src/bin/calc/RCS/file.h,v $ * @(#) $Source: /usr/local/src/bin/calc/RCS/file.h,v $
* *
* Under source code control: 1996/05/24 05:55:58 * Under source code control: 1996/05/24 05:55:58

379
func.c
View File

@@ -19,8 +19,8 @@
* received a copy with calc; if not, write to Free Software Foundation, Inc. * received a copy with calc; if not, write to Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* @(#) $Revision: 30.4 $ * @(#) $Revision: 30.8 $
* @(#) $Id: func.c,v 30.4 2013/08/11 08:41:38 chongo Exp $ * @(#) $Id: func.c,v 30.8 2013/09/01 22:11:07 chongo Exp $
* @(#) $Source: /usr/local/src/bin/calc/RCS/func.c,v $ * @(#) $Source: /usr/local/src/bin/calc/RCS/func.c,v $
* *
* Under source code control: 1990/02/15 01:48:15 * Under source code control: 1990/02/15 01:48:15
@@ -4177,6 +4177,24 @@ f_strcmp(VALUE *v1, VALUE *v2)
return result; return result;
} }
S_FUNC VALUE
f_strcasecmp(VALUE *v1, VALUE *v2)
{
VALUE result;
FLAG flag;
/* initialize VALUE */
result.v_subtype = V_NOSUBTYPE;
if (v1->v_type != V_STR || v2->v_type != V_STR)
return error_value(E_STRCASECMP);
flag = stringcaserel(v1->v_str, v2->v_str);
result.v_type = V_NUM;
result.v_num = itoq((long) flag);
return result;
}
S_FUNC VALUE S_FUNC VALUE
f_strncmp(VALUE *v1, VALUE *v2, VALUE *v3) f_strncmp(VALUE *v1, VALUE *v2, VALUE *v3)
@@ -4209,7 +4227,37 @@ f_strncmp(VALUE *v1, VALUE *v2, VALUE *v3)
result.v_num = itoq((long) flag); result.v_num = itoq((long) flag);
return result; return result;
} }
S_FUNC VALUE
f_strncasecmp(VALUE *v1, VALUE *v2, VALUE *v3)
{
long n1, n2, n;
FLAG flag;
VALUE result;
/* initialize VALUE */
result.v_subtype = V_NOSUBTYPE;
if (v1->v_type != V_STR || v2->v_type != V_STR ||
v3->v_type != V_NUM || qisneg(v3->v_num) ||
qisfrac(v3->v_num) || zge31b(v3->v_num->num))
return error_value(E_STRNCASECMP);
n1 = v1->v_str->s_len;
n2 = v2->v_str->s_len;
n = qtoi(v3->v_num);
if (n < n1)
v1->v_str->s_len = n;
if (n < n2)
v2->v_str->s_len = n;
flag = stringcaserel(v1->v_str, v2->v_str);
v1->v_str->s_len = n1;
v2->v_str->s_len = n2;
result.v_type = V_NUM;
result.v_num = itoq((long) flag);
return result;
}
S_FUNC VALUE S_FUNC VALUE
f_strcat(int count, VALUE **vals) f_strcat(int count, VALUE **vals)
@@ -4396,6 +4444,307 @@ f_ord(VALUE *vp)
return result; return result;
} }
S_FUNC VALUE
f_isupper(VALUE *vp)
{
char c;
VALUE result;
/* initialize VALUE */
result.v_subtype = V_NOSUBTYPE;
switch(vp->v_type) {
case V_STR:
c = *vp->v_str->s_str;
break;
case V_OCTET:
c = *vp->v_octet;
break;
default:
return error_value(E_ISUPPER);
}
result.v_type = V_NUM;
result.v_num = itoq( (isupper( c ))?1l:0l);
return result;
}
S_FUNC VALUE
f_islower(VALUE *vp)
{
char c;
VALUE result;
/* initialize VALUE */
result.v_subtype = V_NOSUBTYPE;
switch(vp->v_type) {
case V_STR:
c = *vp->v_str->s_str;
break;
case V_OCTET:
c = *vp->v_octet;
break;
default:
return error_value(E_ISLOWER);
}
result.v_type = V_NUM;
result.v_num = itoq( (islower( c ))?1l:0l);
return result;
}
S_FUNC VALUE
f_isalnum(VALUE *vp)
{
char c;
VALUE result;
/* initialize VALUE */
result.v_subtype = V_NOSUBTYPE;
switch(vp->v_type) {
case V_STR:
c = *vp->v_str->s_str;
break;
case V_OCTET:
c = *vp->v_octet;
break;
default:
return error_value(E_ISALNUM);
}
result.v_type = V_NUM;
result.v_num = itoq( (isalnum( c ))?1l:0l);
return result;
}
S_FUNC VALUE
f_isalpha(VALUE *vp)
{
char c;
VALUE result;
/* initialize VALUE */
result.v_subtype = V_NOSUBTYPE;
switch(vp->v_type) {
case V_STR:
c = *vp->v_str->s_str;
break;
case V_OCTET:
c = *vp->v_octet;
break;
default:
return error_value(E_ISALPHA);
}
result.v_type = V_NUM;
result.v_num = itoq( (isalpha( c ))?1l:0l);
return result;
}
#if 0
/* Not in C-standard, marked as obsolete in POSIX.1-2008 */
S_FUNC VALUE
f_isascii(VALUE *vp)
{
char c;
VALUE result;
result.v_subtype = V_NOSUBTYPE;
switch(vp->v_type) {
case V_STR:
c = *vp->v_str->s_str;
break;
case V_OCTET:
c = *vp->v_octet;
break;
default:
return error_value(E_ISASCII);
}
result.v_type = V_NUM;
result.v_num = itoq( (isascii( c ))?1l:0l);
return result;
}
#endif /* 0 */
S_FUNC VALUE
f_iscntrl(VALUE *vp)
{
char c;
VALUE result;
/* initialize VALUE */
result.v_subtype = V_NOSUBTYPE;
switch(vp->v_type) {
case V_STR:
c = *vp->v_str->s_str;
break;
case V_OCTET:
c = *vp->v_octet;
break;
default:
return error_value(E_ISCNTRL);
}
result.v_type = V_NUM;
result.v_num = itoq( (iscntrl( c ))?1l:0l);
return result;
}
S_FUNC VALUE
f_isdigit(VALUE *vp)
{
char c;
VALUE result;
/* initialize VALUE */
result.v_subtype = V_NOSUBTYPE;
switch(vp->v_type) {
case V_STR:
c = *vp->v_str->s_str;
break;
case V_OCTET:
c = *vp->v_octet;
break;
default:
return error_value(E_ISDIGIT);
}
result.v_type = V_NUM;
result.v_num = itoq( (isdigit( c ))?1l:0l);
return result;
}
S_FUNC VALUE
f_isgraph(VALUE *vp)
{
char c;
VALUE result;
/* initialize VALUE */
result.v_subtype = V_NOSUBTYPE;
switch(vp->v_type) {
case V_STR:
c = *vp->v_str->s_str;
break;
case V_OCTET:
c = *vp->v_octet;
break;
default:
return error_value(E_ISGRAPH);
}
result.v_type = V_NUM;
result.v_num = itoq( (isgraph( c ))?1l:0l);
return result;
}
S_FUNC VALUE
f_isprint(VALUE *vp)
{
char c;
VALUE result;
/* initialize VALUE */
result.v_subtype = V_NOSUBTYPE;
switch(vp->v_type) {
case V_STR:
c = *vp->v_str->s_str;
break;
case V_OCTET:
c = *vp->v_octet;
break;
default:
return error_value(E_ISPRINT);
}
result.v_type = V_NUM;
result.v_num = itoq( (isprint( c ))?1l:0l);
return result;
}
S_FUNC VALUE
f_ispunct(VALUE *vp)
{
char c;
VALUE result;
/* initialize VALUE */
result.v_subtype = V_NOSUBTYPE;
switch(vp->v_type) {
case V_STR:
c = *vp->v_str->s_str;
break;
case V_OCTET:
c = *vp->v_octet;
break;
default:
return error_value(E_ISPUNCT);
}
result.v_type = V_NUM;
result.v_num = itoq( (ispunct( c ))?1l:0l);
return result;
}
S_FUNC VALUE
f_isspace(VALUE *vp)
{
char c;
VALUE result;
/* initialize VALUE */
result.v_subtype = V_NOSUBTYPE;
switch(vp->v_type) {
case V_STR:
c = *vp->v_str->s_str;
break;
case V_OCTET:
c = *vp->v_octet;
break;
default:
return error_value(E_ISSPACE);
}
result.v_type = V_NUM;
result.v_num = itoq( (isspace( c ))?1l:0l);
return result;
}
S_FUNC VALUE
f_isxdigit(VALUE *vp)
{
char c;
VALUE result;
/* initialize VALUE */
result.v_subtype = V_NOSUBTYPE;
switch(vp->v_type) {
case V_STR:
c = *vp->v_str->s_str;
break;
case V_OCTET:
c = *vp->v_octet;
break;
default:
return error_value(E_ISXDIGIT);
}
result.v_type = V_NUM;
result.v_num = itoq( (isxdigit( c ))?1l:0l);
return result;
}
S_FUNC VALUE S_FUNC VALUE
f_protect(int count, VALUE **vals) f_protect(int count, VALUE **vals)
@@ -8459,6 +8808,28 @@ STATIC CONST struct builtin builtins[] = {
"numerator of fraction"}, "numerator of fraction"},
{"ord", 1, 1, 0, OP_NOP, 0, f_ord, {"ord", 1, 1, 0, OP_NOP, 0, f_ord,
"integer corresponding to character value"}, "integer corresponding to character value"},
{"isupper", 1, 1, 0, OP_NOP, 0, f_isupper,
"whether character is upper case"},
{"islower", 1, 1, 0, OP_NOP, 0, f_islower,
"whether character is lower case"},
{"isalnum", 1, 1, 0, OP_NOP, 0, f_isalnum,
"whether character is alpha-numeric"},
{"isalpha", 1, 1, 0, OP_NOP, 0, f_isalpha,
"whether character is alphabetic"},
{"iscntrl", 1, 1, 0, OP_NOP, 0, f_iscntrl,
"whether character is a control character"},
{"isdigit", 1, 1, 0, OP_NOP, 0, f_isdigit,
"whether character is a digit"},
{"isgraph", 1, 1, 0, OP_NOP, 0, f_isgraph,
"whether character is a graphical character"},
{"isprint", 1, 1, 0, OP_NOP, 0, f_isprint,
"whether character is printable"},
{"ispunct", 1, 1, 0, OP_NOP, 0, f_ispunct,
"whether character is a punctuation"},
{"isspace", 1, 1, 0, OP_NOP, 0, f_isspace,
"whether character is a space character"},
{"isxdigit", 1, 1, 0, OP_NOP, 0, f_isxdigit,
"whether character is a hexadecimal digit"},
{"param", 1, 1, 0, OP_ARGVALUE, 0, 0, {"param", 1, 1, 0, OP_ARGVALUE, 0, 0,
"value of parameter n (or parameter count if n\n" "value of parameter n (or parameter count if n\n"
"\t\t\tis zero)"}, "\t\t\tis zero)"},
@@ -8602,6 +8973,8 @@ STATIC CONST struct builtin builtins[] = {
"concatenate strings together"}, "concatenate strings together"},
{"strcmp", 2, 2, 0, OP_NOP, 0, f_strcmp, {"strcmp", 2, 2, 0, OP_NOP, 0, f_strcmp,
"compare two strings"}, "compare two strings"},
{"strcasecmp", 2, 2, 0, OP_NOP, 0, f_strcasecmp,
"compare two strings case independent"},
{"strcpy", 2, 2, 0, OP_NOP, 0, f_strcpy, {"strcpy", 2, 2, 0, OP_NOP, 0, f_strcpy,
"copy string to string"}, "copy string to string"},
{"strerror", 0, 1, 0, OP_NOP, 0, f_strerror, {"strerror", 0, 1, 0, OP_NOP, 0, f_strerror,
@@ -8610,6 +8983,8 @@ STATIC CONST struct builtin builtins[] = {
"length of string"}, "length of string"},
{"strncmp", 3, 3, 0, OP_NOP, 0, f_strncmp, {"strncmp", 3, 3, 0, OP_NOP, 0, f_strncmp,
"compare strings a, b to c characters"}, "compare strings a, b to c characters"},
{"strncasecmp", 3, 3, 0, OP_NOP, 0, f_strncasecmp,
"compare strings a, b to c characters case independent"},
{"strncpy", 3, 3, 0, OP_NOP, 0, f_strncpy, {"strncpy", 3, 3, 0, OP_NOP, 0, f_strncpy,
"copy up to c characters from string to string"}, "copy up to c characters from string to string"},
{"strpos", 2, 2, 0, OP_NOP, 0, f_strpos, {"strpos", 2, 2, 0, OP_NOP, 0, f_strpos,

View File

@@ -18,9 +18,9 @@
# received a copy with calc; if not, write to Free Software Foundation, Inc. # received a copy with calc; if not, write to Free Software Foundation, Inc.
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
# #
# @(#) $Revision: 30.5 $ # @(#) $Revision: 30.6 $
# @(#) $Id: Makefile,v 30.5 2007/09/21 01:27:27 chongo Exp $ # @(#) $Id: Makefile,v 30.6 2013/09/01 18:37:27 chongo Exp $
# @(#) $Source: /usr/local/src/cmd/calc/help/RCS/Makefile,v $ # @(#) $Source: /usr/local/src/bin/calc/help/RCS/Makefile,v $
# #
# Under source code control: 1991/07/23 06:47:57 # Under source code control: 1991/07/23 06:47:57
# File existed as early as: 1991 # File existed as early as: 1991
@@ -292,20 +292,20 @@ DETAIL_HELP= abs access acos acosh acot acoth acsc acsch address agd append \
floor fopen forall fpathopen fprintf fputc fputs fputstr frac free \ floor fopen forall fpathopen fprintf fputc fputs fputstr frac free \
freebernoulli freeeuler freeglobals freeredc freestatics frem freopen \ freebernoulli freeeuler freeglobals freeredc freestatics frem freopen \
fscan fscanf fseek fsize ftell gcd gcdrem gd getenv hash head highbit \ fscan fscanf fseek fsize ftell gcd gcdrem gd getenv hash head highbit \
hmean hnrmod hypot ilog ilog10 ilog2 im indices inputlevel insert int \ hmean hnrmod hypot ilog ilog10 ilog2 im indices inputlevel insert \
inverse iroot isassoc isatty isblk isconfig isdefined iserror iseven \ int inverse iroot isassoc isatty isblk isconfig isdefined iserror \
isfile ishash isident isint islist ismat ismult isnull isnum isobj \ iseven isfile ishash isident isint islist ismat ismult isnull isnum \
isobjtype isodd isprime isptr isqrt isrand israndom isreal isrel \ isobj isobjtype isodd isprime isptr isqrt isrand israndom isreal \
issimple issq isstr istype jacobi join lcm lcmfact lfactor ln log \ isrel issimple issq isstr istype jacobi join lcm lcmfact lfactor \
lowbit ltol makelist matdim matfill matmax matmin matsum mattrace \ ln log lowbit ltol makelist matdim matfill matmax matmin matsum \
mattrans max memsize meq min minv mmin mne mod modify name near \ mattrace mattrans max memsize meq min minv mmin mne mod modify \
newerror nextcand nextprime norm null num oldvalue ord param perm \ name near newerror nextcand nextprime norm null num oldvalue ord \
pfact pi pix places pmod polar poly pop popcnt pound power prevcand \ param perm pfact pi pix places pmod polar poly pop popcnt pound \
prevprime printf prompt protect ptest push putenv quo quomod rand \ power prevcand prevprime printf prompt protect ptest push putenv \
randbit random randombit randperm rcin rcmul rcout rcpow rcsq re \ quo quomod rand randbit random randombit randperm rcin rcmul rcout \
remove reverse rewind rm root round rsearch runtime saveval scale \ rcpow rcsq re remove reverse rewind rm root round rsearch runtime \
scan scanf search sec sech seed segment select sgn sha1 sin \ saveval scale scan scanf search sec sech seed segment select sgn sha1 \
sinh size sizeof sleep sort sqrt srand srandom ssq stoponerror \ sin sinh size sizeof sleep sort sqrt srand srandom ssq stoponerror \
str strcat strcmp strcpy strerror strlen strncmp strncpy strpos \ str strcat strcmp strcpy strerror strlen strncmp strncpy strpos \
strprintf strscan strscanf substr sum swap system systime tail tan \ strprintf strscan strscanf substr sum swap system systime tail tan \
tanh test time trunc usertime version xor tanh test time trunc usertime version xor

View File

@@ -30,8 +30,8 @@ DESCRIPTION
If 1 < n < nextprime(limit)^2, then f(n, limit) == 1 <==> n is prime. If 1 < n < nextprime(limit)^2, then f(n, limit) == 1 <==> n is prime.
For example, if 1 < n < 121, n is prime if and only if f(n,7) == 1. For example, if 1 < n < 121, n is prime if and only if f(n,7) == 1.
If limit >= 2^32, factor(n, limit) causes an error and factor(n, If limit >= 2^32, factor(n, limit) causes an error and
limit, err) returns the value of err. factor(n, limit, err) returns the value of err.
EXAMPLE EXAMPLE
; print factor(35,4), factor(35,5), factor(35), factor(-35) ; print factor(35,4), factor(35,5), factor(35), factor(-35)
@@ -66,9 +66,9 @@ SEE ALSO
## received a copy with calc; if not, write to Free Software Foundation, Inc. ## received a copy with calc; if not, write to Free Software Foundation, Inc.
## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
## ##
## @(#) $Revision: 30.1 $ ## @(#) $Revision: 30.2 $
## @(#) $Id: factor,v 30.1 2007/03/16 11:10:42 chongo Exp $ ## @(#) $Id: factor,v 30.2 2013/08/18 20:15:13 chongo Exp $
## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/factor,v $ ## @(#) $Source: /usr/local/src/bin/calc/help/RCS/factor,v $
## ##
## Under source code control: 1995/12/18 12:34:57 ## Under source code control: 1995/12/18 12:34:57
## File existed as early as: 1995 ## File existed as early as: 1995

4
obj.c
View File

@@ -17,8 +17,8 @@
* received a copy with calc; if not, write to Free Software Foundation, Inc. * received a copy with calc; if not, write to Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* @(#) $Revision: 30.2 $ * @(#) $Revision: 30.3 $
* @(#) $Id: obj.c,v 30.2 2013/08/11 08:41:38 chongo Exp $ * @(#) $Id: obj.c,v 30.3 2013/09/01 22:16:21 chongo Exp $
* @(#) $Source: /usr/local/src/bin/calc/RCS/obj.c,v $ * @(#) $Source: /usr/local/src/bin/calc/RCS/obj.c,v $
* *
* Under source code control: 1990/02/15 01:48:19 * Under source code control: 1990/02/15 01:48:19

View File

@@ -17,8 +17,8 @@
* received a copy with calc; if not, write to Free Software Foundation, Inc. * received a copy with calc; if not, write to Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* @(#) $Revision: 30.3 $ * @(#) $Revision: 30.4 $
* @(#) $Id: qmath.h,v 30.3 2013/08/11 08:41:38 chongo Exp $ * @(#) $Id: qmath.h,v 30.4 2013/09/01 22:16:21 chongo Exp $
* @(#) $Source: /usr/local/src/bin/calc/RCS/qmath.h,v $ * @(#) $Source: /usr/local/src/bin/calc/RCS/qmath.h,v $
* *
* Under source code control: 1993/07/30 19:42:47 * Under source code control: 1993/07/30 19:42:47

41
str.c
View File

@@ -19,8 +19,8 @@
* received a copy with calc; if not, write to Free Software Foundation, Inc. * received a copy with calc; if not, write to Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* @(#) $Revision: 30.2 $ * @(#) $Revision: 30.4 $
* @(#) $Id: str.c,v 30.2 2013/08/11 08:41:38 chongo Exp $ * @(#) $Id: str.c,v 30.4 2013/09/01 20:23:07 chongo Exp $
* @(#) $Source: /usr/local/src/bin/calc/RCS/str.c,v $ * @(#) $Source: /usr/local/src/bin/calc/RCS/str.c,v $
* *
* Under source code control: 1990/02/15 01:48:10 * Under source code control: 1990/02/15 01:48:10
@@ -31,6 +31,7 @@
#include <stdio.h> #include <stdio.h>
#include <ctype.h>
#include "calc.h" #include "calc.h"
#include "str.h" #include "str.h"
@@ -852,7 +853,43 @@ stringrel(STRING *s1, STRING *s2)
return (i1 > i2); return (i1 > i2);
} }
/* Case independent stringrel(STRING *s1, STRING *s2)
* stringcaserel returns 0 if strings are equal; otherwise 1 or -1 according
* as the greater of the first unequal characters are in the first or
* second string, or in the case of unequal-length strings when the compared
* characters are all equal, 1 or -1 according as the first or second string
* is longer.
*/
FLAG
stringcaserel(STRING *s1, STRING *s2)
{
char *c1, *c2;
long i1, i2;
if (s1 == s2)
return 0;
i1 = s1->s_len;
i2 = s2->s_len;
if (i2 == 0)
return (i1 > 0);
if (i1 == 0)
return -1;
c1 = s1->s_str;
c2 = s2->s_str;
while (i1 > 1 && i2 > 1 && tolower(*c1) == tolower(*c2)) {
i1--;
i2--;
c1++;
c2++;
}
if ( (tolower(*c1)) > (tolower(*c2)))
return 1;
if ( (tolower(*c1)) < (tolower(*c2)))
return -1;
if (i1 < i2) return -1;
return (i1 > i2);
}
/* /*
* str with characters c0, c1, ... is considered as a bitstream, 8 bits * str with characters c0, c1, ... is considered as a bitstream, 8 bits
* per character; within a character the bits ordered from low order to * per character; within a character the bits ordered from low order to

View File

@@ -17,8 +17,8 @@
* received a copy with calc; if not, write to Free Software Foundation, Inc. * received a copy with calc; if not, write to Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* @(#) $Revision: 30.4 $ * @(#) $Revision: 30.5 $
* @(#) $Id: value.h,v 30.4 2013/08/11 08:41:38 chongo Exp $ * @(#) $Id: value.h,v 30.5 2013/09/01 18:57:17 chongo Exp $
* @(#) $Source: /usr/local/src/bin/calc/RCS/value.h,v $ * @(#) $Source: /usr/local/src/bin/calc/RCS/value.h,v $
* *
* Under source code control: 1993/07/30 19:42:47 * Under source code control: 1993/07/30 19:42:47
@@ -531,6 +531,7 @@ E_FUNC long stringlowbit(STRING *s);
E_FUNC long stringhighbit(STRING *s); E_FUNC long stringhighbit(STRING *s);
E_FUNC BOOL stringcmp(STRING *, STRING *); E_FUNC BOOL stringcmp(STRING *, STRING *);
E_FUNC BOOL stringrel(STRING *, STRING *); E_FUNC BOOL stringrel(STRING *, STRING *);
E_FUNC BOOL stringcaserel(STRING *, STRING *);
E_FUNC int stringbit(STRING *, long); E_FUNC int stringbit(STRING *, long);
E_FUNC BOOL stringtest(STRING *); E_FUNC BOOL stringtest(STRING *);
E_FUNC int stringsetbit(STRING *, long, BOOL); E_FUNC int stringsetbit(STRING *, long, BOOL);

View File

@@ -19,8 +19,8 @@
* received a copy with calc; if not, write to Free Software Foundation, Inc. * received a copy with calc; if not, write to Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* @(#) $Revision: 30.19 $ * @(#) $Revision: 30.20 $
* @(#) $Id: version.c,v 30.19 2013/08/11 08:41:38 chongo Exp $ * @(#) $Id: version.c,v 30.20 2013/09/01 22:19:41 chongo Exp $
* @(#) $Source: /usr/local/src/bin/calc/RCS/version.c,v $ * @(#) $Source: /usr/local/src/bin/calc/RCS/version.c,v $
* *
* Under source code control: 1990/05/22 11:00:58 * Under source code control: 1990/05/22 11:00:58
@@ -49,7 +49,7 @@ static char *program;
#define MAJOR_VER 2 /* major library version */ #define MAJOR_VER 2 /* major library version */
#define MINOR_VER 12 /* minor library version */ #define MINOR_VER 12 /* minor library version */
#define MAJOR_PATCH 4 /* major software level under library version */ #define MAJOR_PATCH 4 /* major software level under library version */
#define MINOR_PATCH 10 /* minor software level or 0 if not patched */ #define MINOR_PATCH 11 /* minor software level or 0 if not patched */
/* /*

View File

@@ -431,5 +431,19 @@ CONST char *error_table[E__COUNT+2] = {
"File argument for fgetfile not open for reading", "File argument for fgetfile not open for reading",
"Unable to set file position in fgetfile", "Unable to set file position in fgetfile",
"Non-representable type for estr", "Non-representable type for estr",
"Non-string argument for strcasecmp",
"Bad argument type for strncasecmp",
"Bad argument for isupper",
"Bad argument for islower",
"Bad argument for isalnum",
"Bad argument for isalpha",
"Bad argument for isascii",
"Bad argument for iscntrl",
"Bad argument for isdigit",
"Bad argument for isgraph",
"Bad argument for isprint",
"Bad argument for ispunct",
"Bad argument for isspace",
"Bad argument for isxdigit",
NULL NULL
}; };

View File

@@ -428,9 +428,23 @@
#define E_FGETFILE2 10415 /* File argument for fgetfile not open for reading */ #define E_FGETFILE2 10415 /* File argument for fgetfile not open for reading */
#define E_FGETFILE3 10416 /* Unable to set file position in fgetfile */ #define E_FGETFILE3 10416 /* Unable to set file position in fgetfile */
#define E_ESTR 10417 /* Non-representable type for estr */ #define E_ESTR 10417 /* Non-representable type for estr */
#define E_STRCASECMP 10418 /* Non-string argument for strcasecmp */
#define E_STRNCASECMP 10419 /* Bad argument type for strncasecmp */
#define E_ISUPPER 10420 /* Bad argument for isupper */
#define E_ISLOWER 10421 /* Bad argument for islower */
#define E_ISALNUM 10422 /* Bad argument for isalnum */
#define E_ISALPHA 10423 /* Bad argument for isalpha */
#define E_ISASCII 10424 /* Bad argument for isascii */
#define E_ISCNTRL 10425 /* Bad argument for iscntrl */
#define E_ISDIGIT 10426 /* Bad argument for isdigit */
#define E_ISGRAPH 10427 /* Bad argument for isgraph */
#define E_ISPRINT 10428 /* Bad argument for isprint */
#define E_ISPUNCT 10429 /* Bad argument for ispunct */
#define E_ISSPACE 10430 /* Bad argument for isspace */
#define E_ISXDIGIT 10431 /* Bad argument for isxdigit */
#define E__HIGHEST 10417 /* highest calc error */ #define E__HIGHEST 10431 /* highest calc error */
#define E__COUNT 417 /* number of calc errors */ #define E__COUNT 431 /* number of calc errors */
#define E_USERDEF 20000 /* base of user defined errors */ #define E_USERDEF 20000 /* base of user defined errors */
/* names of calc error values */ /* names of calc error values */