diff --git a/BUGS b/BUGS index 8e05487..491f1f4 100644 --- a/BUGS +++ b/BUGS @@ -84,7 +84,7 @@ Problems that have known work-a-rounds: mis-features in calc: - Some problems are not bugs but rarther mis-features / things that could + Some problems are not bugs but rather mis-features / things that could work better. The following is a list of mis-features that should be addressed and improved someday. @@ -129,7 +129,7 @@ mis-features in calc: will not. -## Copyright (C) 1999-2007 Landon Curt Noll +## Copyright (C) 1999-2013 Landon Curt Noll ## ## Calc is open software; you can redistribute it and/or modify it under ## the terms of the version 2.1 of the GNU Lesser General Public License @@ -145,8 +145,8 @@ mis-features in calc: ## 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.1 $ -## @(#) $Id: BUGS,v 30.1 2007/03/16 11:09:46 chongo Exp $ +## @(#) $Revision: 30.2 $ +## @(#) $Id: BUGS,v 30.2 2013/08/11 01:09:27 chongo Exp $ ## @(#) $Source: /usr/local/src/cmd/calc/RCS/BUGS,v $ ## ## Under source code control: 1994/03/18 14:06:13 diff --git a/CHANGES b/CHANGES index 628f488..854e0a5 100644 --- a/CHANGES +++ b/CHANGES @@ -1,4 +1,77 @@ -The following are the changes from calc version 2.12.4.0 to date: +The following are the changes from calc version 2.12.4.6 to date: + + Updated RPM build process to remove use of deprecated flags. + + Applied a number of fixes to calc.spec and rpm.mk file. + See calc.spec.in for details. Changed rpm release to 2.1. + + Set MACOSX_DEPLOYMENT_TARGET=10.8 as we upgraded all of + our development Mac OS X to 10.8. + + Libraries are chmodded as 0644 to allow for building rpms + without root. + + Silenced annoying warning about unused variable 'intp' + while compiline endian.c under some circumstances. + + Fixed typo in redeclaration warnings. Thanks to + Christoph Zurnieden for this report. + + Added a number of calc resource functions by + Christoph Zurnieden including: + + bernpoly.cal - Computes the nth Bernoulli polynomial at z for any n,z + brentsolve.cal - root-finder implementwed with the Brent-Dekker trick + factorial.cal - product of the positive integers + factorial2.cal - variety of integer functions quasi-related to factoral + lambertw.cal - Computes Lambert's W-function at "z" at branch "branch" + lnseries.cal - Calculates a series of natural logarithms at 1,2,3,4...n + specialfunctions.cal - Calculates the value of the beta function + statistics.cal - a wide vareity of stastical functions + toomcook.cal - Multiply by way of the Toom-Cook algorithm + zeta2.cal - Calculate the value of the Hurwitz Zeta function + + Improved the formatting of the output from: + + help resource + + Cleaned up old DOS-like CRLF line terminators in some + help files. Thanks goes to to Michael Somos + + for pointing this out. + + We replaced COPYING-LGPL with the version that is found at + http://www.gnu.org/licenses/lgpl-2.1.txt because that version + contans some whitespace formatting cleanup. Otherwise the + license is the same. + + We fixed a number of places where "the the" was used + when just "the" should be used. + + NOTE: Fixes to grammar, spelling and minor formatting + problems are welcome. Please send us your patches! + + +The following are the changes from calc version 2.12.4.3 to 2.12.4.5: + + Added gvec.cal resource script. + + Added calc-symlink make rule to setup symlinks from stardard locations + into a tree specified by a non-empty ${T} makefile variable. Added + calc-unsymlink to remove any symlinks that may have been created by + the calc-symlink rule. + + If is OK for the calc-symlink make rule to pre-remove a symlink. + + Fixed bug was uncovered in calc that caused script failures when calc + is called within a while loop in BASH if the while loop is fed from + stdin due to calc's redirection/inheritance of stdin and no option + to change this behavior. Thanks gores to David C. Rankin + for the bug fix and to David Haller + for helping debug this problem. + + +The following are the changes from calc version 2.12.4.0 to 2.12.4.2: Fixed a documentation bug for the sgn() builtin. @@ -32,6 +105,35 @@ The following are the changes from calc version 2.12.4.0 to date: Fixed a bug where an certains typos (e.g., calling an unknown function) would previously cause calc to exit. + Updated the COPYING file to reflect the new filenames associated + with the SHA1 hash function, and removed mention of files related + to the SHA (SHA0, not SHA1) and the MD5 hash functions (which is + no longer supported in calc). + + Fixed a bug where a calling vsnprintf() twice created problems. + The thanks for this fix goes to Matthew Miller (mattdm at mattdm + dot org) for this patch. + + Michael Penk (mpenk at wuska dot com) reported success in installs + under windoz via Cygwin by making a change to the Cygwin target. + These changes have been folded into the main calc Makefile. + The old recommendation of using 'make win32_hsrc' is no longer + required for Cygwin. See the README.WINDOWS file for details. + + Added dms.cal and hms.cal resource files. The dms.cal is a more + functional version of deg.cal. It is a superset except that increment + and decrement is on the arc second level. The hms.cal is for + 24-hour cycle instread of the 360 degree cycle of dms.cal. + + Changed deg.cal object name from dms to deg so that the more functional + dms.cal can own the dms object name. + + Updated 'help obj' to reflect changes to 'show objfunctions' and + resource file example list since 1999. + + Fixed problem where CALC_BYTE_ORDER refering to CALC_BIG_ENDIAN + and CALC_LITTLE_ENDIAN instead of BIG_ENDIAN and LITTLE_ENDIAN. + The following are the changes from calc version 2.12.3.0 to 2.12.3.3: @@ -2060,7 +2162,7 @@ The following are the changes from calc version 2.11.1 to 2.11.1t2.2: Cleaned up help display system. Help file lines that begin with '##' are not displayed. - Calc source and documentation now uses the the these terms: + Calc source and documentation now uses these terms: *.cal files calc resource file *.a files calc binary link library @@ -2098,7 +2200,7 @@ The following are the changes from calc version 2.11.0t10 to 2.11.0t11: Fixed whitespace to make the best use of 8 character tabs. Fixed some bugs relating to '// and %' in combination with some - of the the rounding modes based on a patch from Ernest Bowen + of the rounding modes based on a patch from Ernest Bowen . A patch from Klaus Alexander Seistrup , when @@ -2292,7 +2394,7 @@ The following are the changes from calc version 2.11.0t10 to 2.11.0t11: Where ``/usr/local/bin/calc'' is the path to the calc binary. Additional -options may be added to the line, but it MUST - start with -S. For example, the the executable file ``plus'' + start with -S. For example, the executable file ``plus'' contain the following: #!/usr/local/bin/calc -S -e @@ -4755,7 +4857,7 @@ The following are the changes from calc version 2.10.3t0 to 2.10.3t2: global variable: to the end of the session with calc - static within a function definition: to the the first of: + static within a function definition: to the first of: an end of a global, static or local declaration (including initialization code) with the same identifier @@ -4853,7 +4955,7 @@ The following are the changes from calc version 2.10.3t0 to 2.10.3t2: global a, b, mat A, B[2] = {3,4}, C[2] = {4,5}, obj point P = {5,6}, Q - Fixed some bugs related to global and static scoping. See the the + Fixed some bugs related to global and static scoping. See the 5200 regress test and lib/test5200.cal for details. Optimized opcode generator so that functions defined using '=' do not @@ -5350,7 +5452,7 @@ The following are the changes from calc version 2.10.2t4 to 2.10.2t24: ILDFLAGS are flags given to ${CC} for linking .o files for intermediate progs - CC is how the the C compiler is invoked + CC is how the C compiler is invoked Added more tests to regress.cal. @@ -5575,7 +5677,7 @@ The following are the changes from calc version 2.10.2t1 to 2.10.2t3: Some systems has a libc symbolic qadd() that conflicted with calc's qadd function. To avoid this, qadd() has been renamed to qqadd(). - The calc error codes are produced from the the calcerr.tbl file. + The calc error codes are produced from the calcerr.tbl file. Instead of changing #defines in value.h, one can not edit calcerr.tbl. The Makefile builds calcerr.h from this file. @@ -6118,7 +6220,7 @@ The following are the changes from calc version 2.9.3t11 to 2.10.0t12: LDFLAGS are flags given to ${CC} for linking .o files ILDFLAGS are given to ${CC} for linking .o's for intermediate progs - CC is how the the C compiler is invoked + CC is how the C compiler is invoked The syntax error: @@ -6769,9 +6871,9 @@ 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. ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ## -## @(#) $Revision: 30.18 $ -## @(#) $Id: CHANGES,v 30.18 2008/10/24 09:55:12 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/RCS/CHANGES,v $ +## @(#) $Revision: 30.28 $ +## @(#) $Id: CHANGES,v 30.28 2013/08/11 01:18:56 chongo Exp chongo $ +## @(#) $Source: /usr/local/src/bin/calc/RCS/CHANGES,v $ ## ## Under source code control: 1993/06/02 18:12:57 ## File existed as early as: 1989 diff --git a/COPYING b/COPYING index 3446e88..ae8d88e 100644 --- a/COPYING +++ b/COPYING @@ -6,15 +6,15 @@ This file is Copyrighted This file is covered under the following Copyright: - Copyright (C) 1999 Landon Curt Noll + Copyright (C) 1999-2008 Landon Curt Noll All rights reserved. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. - # @(#) $Revision: 30.1 $ - # @(#) $Id: COPYING,v 30.1 2007/03/16 11:09:46 chongo Exp $ - # @(#) $Source: /usr/local/src/cmd/calc/RCS/COPYING,v $ + # @(#) $Revision: 30.2 $ + # @(#) $Id: COPYING,v 30.2 2008/10/24 10:46:52 chongo Exp $ + # @(#) $Source: /usr/local/src/bin/calc/RCS/COPYING,v $ =-= @@ -168,9 +168,8 @@ Calc copyrights and exception files These files are not covered under one of the Copyrights listed above: - shs1.c shs1.h shs.c shs.h - md5.c md5.h COPYING COPYING-LGPL - cal/qtime.cal cal/screen.cal + sha1.c sha1.h COPYING + COPYING-LGPL cal/qtime.cal cal/screen.cal The file COPYING-LGPL, which contains a copy of the version 2.1 GNU Lesser General Public License, is itself Copyrighted by the @@ -182,11 +181,8 @@ Calc copyrights and exception files top of this file. It is important to note that you may distribute verbatim copies of this file but you may not modify this file. - Some of these exception files are in the public domain. The md5.c - and md5.h files were "derived from the RSA Data Security, Inc. MD5 - Message-Digest Algorithm" and are under a copyright that allows these - two files to be freely used and distributed. Other files are under - the LGPL but have different authors that those listed above. + Some of these exception files are in the public domain. Other files + are under the LGPL but have different authors that those listed above. In all cases one may use and distribute these exception files freely. And because one may freely distribute the LGPL covered files, the diff --git a/COPYING-LGPL b/COPYING-LGPL index a2a1d92..4362b49 100644 --- a/COPYING-LGPL +++ b/COPYING-LGPL @@ -1,8 +1,8 @@ - GNU LESSER GENERAL PUBLIC LICENSE - Version 2.1, February 1999 + GNU LESSER GENERAL PUBLIC LICENSE + Version 2.1, February 1999 Copyright (C) 1991, 1999 Free Software Foundation, Inc. - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. @@ -10,7 +10,7 @@ as the successor of the GNU Library Public License, version 2, hence the version number 2.1.] - Preamble + Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public @@ -112,7 +112,7 @@ modification follow. Pay close attention to the difference between a former contains code derived from the library, whereas the latter must be combined with the library in order to run. - GNU LESSER GENERAL PUBLIC LICENSE + GNU LESSER GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library or other @@ -146,7 +146,7 @@ such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. - + 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an @@ -432,7 +432,7 @@ decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. - NO WARRANTY + NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. @@ -455,7 +455,7 @@ FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - END OF TERMS AND CONDITIONS + END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Libraries @@ -485,7 +485,7 @@ 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 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. @@ -500,5 +500,3 @@ necessary. Here is a sample; alter the names: Ty Coon, President of Vice That's all there is to it! - - diff --git a/HOWTO.INSTALL b/HOWTO.INSTALL index 2063f72..c5bd435 100644 --- a/HOWTO.INSTALL +++ b/HOWTO.INSTALL @@ -206,7 +206,7 @@ the calc help subsystem. See the README file for details. ## ## @(#) $Revision: 30.6 $ ## @(#) $Id: HOWTO.INSTALL,v 30.6 2007/10/16 12:22:22 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/RCS/HOWTO.INSTALL,v $ +## @(#) $Source: /usr/local/src/bin/calc/RCS/HOWTO.INSTALL,v $ ## ## Under source code control: 1999/09/27 20:48:44 ## File existed as early as: 1999 diff --git a/LIBRARY b/LIBRARY index be3d529..1a6c745 100644 --- a/LIBRARY +++ b/LIBRARY @@ -640,7 +640,7 @@ need call libcalc_call_me_last() only once. ## ## @(#) $Revision: 30.1 $ ## @(#) $Id: LIBRARY,v 30.1 2007/03/16 11:09:46 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/RCS/LIBRARY,v $ +## @(#) $Source: /usr/local/src/bin/calc/RCS/LIBRARY,v $ ## ## Under source code control: 1993/07/30 19:44:49 ## File existed as early as: 1993 diff --git a/Makefile b/Makefile index cc84386..47a96d3 100644 --- a/Makefile +++ b/Makefile @@ -39,8 +39,8 @@ # received a copy with calc; if not, write to Free Software Foundation, Inc. # 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. # -MAKEFILE_REV= $$Revision: 30.41 $$ -# @(#) $Id: Makefile.ship,v 30.41 2008/10/24 09:20:09 chongo Exp $ +MAKEFILE_REV= $$Revision: 30.53 $$ +# @(#) $Id: Makefile.ship,v 30.53 2013/08/11 01:16:36 chongo Exp $ # @(#) $Source: /usr/local/src/cmd/calc/RCS/Makefile.ship,v $ # # Under source code control: 1990/02/15 01:48:41 @@ -132,8 +132,8 @@ HAVE_VSPRINTF= # Select CALC_BYTE_ORDER= -DCALC_LITTLE_ENDIAN for DJGPP. # CALC_BYTE_ORDER= -#CALC_BYTE_ORDER= -DCALC_BIG_ENDIAN -#CALC_BYTE_ORDER= -DCALC_LITTLE_ENDIAN +#CALC_BYTE_ORDER= -DBIG_ENDIAN +#CALC_BYTE_ORDER= -DLITTLE_ENDIAN # Determine the number of bits in a long # @@ -983,11 +983,12 @@ MKDIR_ARG= -p # Some out of date operating systems require / want an executable to # end with a certain file extension. Some compile systems such as -# Cygwin build calc as calc.exe. The EXT variable is used to denote -# the extension required by such. +# 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 same as Linux/Un*x/GNU, even though it runs under windoz. # -# EXT= # normal Un*x / Linux / GNU/Linux systems -# EXT=.exe # windoz / Cygwin +# EXT= # normal Un*x / Linux / GNU/Linux / Cygwin +# EXT=.exe # windoz # # If in doubt, use EXT= # @@ -996,7 +997,7 @@ EXT= # The default calc versions # -VERSION= 2.12.4.0 +VERSION= 2.12.4.9 VERS= 2.12.4 VER= 2.12 VE= 2 @@ -1118,8 +1119,8 @@ COMMON_LDFLAGS= ${EXTRA_LDFLAGS} # to abort on warnings, then leave CCWERR blank. # CCMISC are misc flags given to ${CC} # -# LCC how the the C compiler is invoked on locally executed intermediate progs -# CC is how the the C compiler is invoked (with an optional Purify) +# LCC how the C compiler is invoked on locally executed intermediate progs +# CC is how the C compiler is invoked (with an optional Purify) # # Specific target overrides or modifications to default values @@ -1211,7 +1212,7 @@ LDCONFIG:= # DARWIN_ARCH= -arch i386 # Intel binary # DARWIN_ARCH= -arch ppc # PPC binary DARWIN_ARCH= # native binary -MACOSX_DEPLOYMENT_TARGET=10.4 +MACOSX_DEPLOYMENT_TARGET=10.8 # endif @@ -1334,6 +1335,40 @@ CC= ${PURIFY} ${LCC} ${CCWERR} # endif +################# +# Cygwin target # +################# + +ifeq ($(target),Cygwin) +# +BLD_TYPE= calc-static-only +# +CC_SHARE= -fPIC +DEFAULT_LIB_INSTALL_PATH= ${PWD}:/lib:/usr/lib:${LIBDIR}:/usr/local/lib +LD_SHARE= "-Wl,-rpath,${DEFAULT_LIB_INSTALL_PATH}" \ + "-Wl,-rpath-link,${DEFAULT_LIB_INSTALL_PATH}" +LIBCALC_SHLIB= -shared "-Wl,-soname,libcalc${LIB_EXT_VERSION}" +ifdef ALLOW_CUSTOM +LIBCUSTCALC_SHLIB= -shared "-Wl,-soname,libcustcalc${LIB_EXT_VERSION}" +else +LIBCUSTCALC_SHLIB= +endif +# +CC_STATIC= +LIBCALC_STATIC= +LIBCUSTCALC_STATIC= +LD_STATIC= +# +CCWARN= -Wall -W -Wno-comment +CCWERR= +CCOPT= ${DEBUG} +CCMISC= +# +LCC= gcc +CC= ${PURIFY} ${LCC} ${CCWERR} +# +endif + ####################################################### # simple target - values used to form Makefile.simple # ####################################################### @@ -4081,9 +4116,14 @@ gdb: # ### -rpm: clobber rpm.mk calc.spec.in +rpm: clobber rpm-preclean rpm.mk calc.spec.in ${V} echo '=-=-=-=-= ${MAKE_FILE} start of $@ rule =-=-=-=-=' - ${MAKE} -f rpm.mk V=${V} + ${MAKE} -f rpm.mk all V=${V} RPM_TOP="${RPM_TOP}" + ${V} echo '=-=-=-=-= ${MAKE_FILE} end of $@ rule =-=-=-=-=' + +rpm-preclean: + ${V} echo '=-=-=-=-= ${MAKE_FILE} start of $@ rule =-=-=-=-=' + ${MAKE} -f rpm.mk $@ V=${V} RPM_TOP="${RPM_TOP}" ${V} echo '=-=-=-=-= ${MAKE_FILE} end of $@ rule =-=-=-=-=' # rpm static rules @@ -4441,9 +4481,9 @@ endif else \ ${RM} -f ${T}${LIBDIR}/libcalc.a.new; \ ${CP} -f libcalc.a ${T}${LIBDIR}/libcalc.a.new; \ + ${CHMOD} 0644 ${T}${LIBDIR}/libcalc.a.new; \ ${MV} -f ${T}${LIBDIR}/libcalc.a.new ${T}${LIBDIR}/libcalc.a; \ ${RANLIB} ${T}${LIBDIR}/libcalc.a; \ - ${CHMOD} 0444 ${T}${LIBDIR}/libcalc.a; \ echo "installed ${T}${LIBDIR}/libcalc.a"; \ fi; \ fi @@ -4459,6 +4499,7 @@ endif ${RM} -f ${T}${LIBDIR}/libcalc${LIB_EXT_VERSION}.new; \ ${CP} -f libcalc${LIB_EXT_VERSION} \ ${T}${LIBDIR}/libcalc${LIB_EXT_VERSION}.new; \ + ${CHMOD} 0644 ${T}${LIBDIR}/libcalc${LIB_EXT_VERSION}.new; \ ${MV} -f ${T}${LIBDIR}/libcalc${LIB_EXT_VERSION}.new \ ${T}${LIBDIR}/libcalc${LIB_EXT_VERSION}; \ echo "installed ${T}${LIBDIR}/libcalc${LIB_EXT_VERSION}"; \ @@ -4477,6 +4518,7 @@ endif ${RM} -f ${T}${LIBDIR}/libcustcalc${LIB_EXT_VERSION}.new; \ ${CP} -f custom/libcustcalc${LIB_EXT_VERSION} \ ${T}${LIBDIR}/libcustcalc${LIB_EXT_VERSION}.new; \ + ${CHMOD} 0644 ${T}${LIBDIR}/libcustcalc${LIB_EXT_VERSION}.new; \ ${MV} -f ${T}${LIBDIR}/libcustcalc${LIB_EXT_VERSION}.new \ ${T}${LIBDIR}/libcustcalc${LIB_EXT_VERSION}; \ echo "installed ${T}${LIBDIR}/libcustcalc${LIB_EXT_VERSION}"; \ @@ -4776,6 +4818,81 @@ strip: done ${V} echo '=-=-=-=-= ${MAKE_FILE} end of $@ rule =-=-=-=-=' +# calc-symlink - setup symlinks from stardard locations into the ${T} tree +# +calc-symlink: + ${Q}if [ -z "${T}" ]; then \ + echo "cannot use $@ make rule when T make var is empty" 1>&2; \ + echo "aborting" 1>&2; \ + exit 1; \ + fi + -${Q} for i in ${BINDIR}/calc${EXT} \ + ${BINDIR}/calc-static${EXT} \ + ${SCRIPTDIR} \ + ${LIBDIR}/libcalc${LIB_EXT_VERSION} \ + ${LIBDIR}/libcustcalc${LIB_EXT_VERSION} \ + ${MANDIR}/calc.${MANEXT} \ + ${CALC_SHAREDIR} \ + ${CALC_INCDIR} \ + ; do \ + if [ -e "${T}$$i" ]; then \ + if [ ! -L "$$i" -a "${T}$$i" -ef "$$i" ]; then \ + echo "ERROR: ${T}$$i is the same as $$i" 1>&2; \ + else \ + if [ -e "$$i" ]; then \ + echo ${RM} -f "$$i"; \ + ${RM} -f "$$i"; \ + fi; \ + echo ${LN} -s "${T}$$i" "$$i"; \ + ${LN} -s "${T}$$i" "$$i"; \ + fi; \ + else \ + echo "Warning: not found: ${T}$$i" 1>&2; \ + fi; \ + done + -${Q} if [ -n "${CATDIR}" ]; then \ + if [ -e "${T}${CATDIR}/calc.${CATEXT}" ]; then \ + if [ ! -L "${CATDIR}/calc.${CATEXT}" -a "${T}${CATDIR}/calc.${CATEXT}" -ef "${CATDIR}/calc.${CATEXT}" ]; then \ + echo "ERROR: ${T}${CATDIR}/calc.${CATEXT} is the same as ${CATDIR}/calc.${CATEXT}" 1>&2; \ + else \ + if [ -e "${CATDIR}/calc.${CATEXT}" ]; then \ + echo ${RM} -f "${CATDIR}/calc.${CATEXT}"; \ + ${RM} -f "${CATDIR}/calc.${CATEXT}"; \ + fi; \ + echo ${LN} -s "${T}${CATDIR}/calc.${CATEXT}" "${CATDIR}/calc.${CATEXT}"; \ + ${LN} -s "${T}${CATDIR}/calc.${CATEXT}" "${CATDIR}/calc.${CATEXT}"; \ + fi; \ + fi; \ + fi + +# remove any symlinks that may have been created by calc-symlink +# +calc-unsymlink: + -${Q} for i in ${BINDIR}/calc${EXT} \ + ${BINDIR}/calc-static${EXT} \ + ${SCRIPTDIR} \ + ${LIBDIR}/libcalc${LIB_EXT_VERSION} \ + ${LIBDIR}/libcustcalc${LIB_EXT_VERSION} \ + ${MANDIR}/calc.${MANEXT} \ + ${CALC_SHAREDIR} \ + ${CALC_INCDIR} \ + ; do \ + if [ -L "$$i" ]; then \ + echo ${RM} -f "$$i"; \ + ${RM} -f "$$i"; \ + else \ + echo "Warning: ignoring non-symlink: $$i" 1>&2; \ + fi; \ + done + -${Q} if [ -n "${CATDIR}" ]; then \ + if [ -L "${CATDIR}/calc.${CATEXT}" ]; then \ + echo ${RM} -f "${CATDIR}/calc.${CATEXT}"; \ + ${RM} -f "${CATDIR}/calc.${CATEXT}"; \ + else \ + echo "Warning: ignoring non-symlink: ${CATDIR}/calc.${CATEXT}" 1>&2; \ + fi; \ + fi + ### # # make depend stuff diff --git a/Makefile.simple b/Makefile.simple index 6c0b790..48a52a8 100644 --- a/Makefile.simple +++ b/Makefile.simple @@ -39,8 +39,8 @@ # received a copy with calc; if not, write to Free Software Foundation, Inc. # 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. # -MAKEFILE_REV= $$Revision: 30.41 $$ -# @(#) $Id: Makefile.ship,v 30.41 2008/10/24 09:20:09 chongo Exp $ +MAKEFILE_REV= $$Revision: 30.53 $$ +# @(#) $Id: Makefile.ship,v 30.53 2013/08/11 01:16:36 chongo Exp $ # @(#) $Source: /usr/local/src/cmd/calc/RCS/Makefile.ship,v $ # # Under source code control: 1990/02/15 01:48:41 @@ -117,8 +117,8 @@ HAVE_VSPRINTF= # Select CALC_BYTE_ORDER= -DCALC_LITTLE_ENDIAN for DJGPP. # CALC_BYTE_ORDER= -#CALC_BYTE_ORDER= -DCALC_BIG_ENDIAN -#CALC_BYTE_ORDER= -DCALC_LITTLE_ENDIAN +#CALC_BYTE_ORDER= -DBIG_ENDIAN +#CALC_BYTE_ORDER= -DLITTLE_ENDIAN # Determine the number of bits in a long # @@ -960,11 +960,12 @@ MKDIR_ARG= -p # Some out of date operating systems require / want an executable to # end with a certain file extension. Some compile systems such as -# Cygwin build calc as calc.exe. The EXT variable is used to denote -# the extension required by such. +# 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 same as Linux/Un*x/GNU, even though it runs under windoz. # -# EXT= # normal Un*x / Linux / GNU/Linux systems -# EXT=.exe # windoz / Cygwin +# EXT= # normal Un*x / Linux / GNU/Linux / Cygwin +# EXT=.exe # windoz # # If in doubt, use EXT= # @@ -973,7 +974,7 @@ EXT= # The default calc versions # -VERSION= 2.12.4.0 +VERSION= 2.12.4.9 VERS= 2.12.4 VER= 2.12 VE= 2 @@ -1087,8 +1088,8 @@ COMMON_LDFLAGS= ${EXTRA_LDFLAGS} # to abort on warnings, then leave CCWERR blank. # CCMISC are misc flags given to ${CC} # -# LCC how the the C compiler is invoked on locally executed intermediate progs -# CC is how the the C compiler is invoked (with an optional Purify) +# LCC how the C compiler is invoked on locally executed intermediate progs +# CC is how the C compiler is invoked (with an optional Purify) # # Specific target overrides or modifications to default values @@ -3652,9 +3653,14 @@ gdb: # ### -rpm: clobber rpm.mk calc.spec.in +rpm: clobber rpm-preclean rpm.mk calc.spec.in ${V} echo '=-=-=-=-= ${MAKE_FILE} start of $@ rule =-=-=-=-=' - ${MAKE} -f rpm.mk V=${V} + ${MAKE} -f rpm.mk all V=${V} RPM_TOP="${RPM_TOP}" + ${V} echo '=-=-=-=-= ${MAKE_FILE} end of $@ rule =-=-=-=-=' + +rpm-preclean: + ${V} echo '=-=-=-=-= ${MAKE_FILE} start of $@ rule =-=-=-=-=' + ${MAKE} -f rpm.mk $@ V=${V} RPM_TOP="${RPM_TOP}" ${V} echo '=-=-=-=-= ${MAKE_FILE} end of $@ rule =-=-=-=-=' # rpm static rules @@ -3995,9 +4001,9 @@ install: custom/Makefile ${LIB_H_SRC} ${BUILD_H_SRC} calc.1 all else \ ${RM} -f ${T}${LIBDIR}/libcalc.a.new; \ ${CP} -f libcalc.a ${T}${LIBDIR}/libcalc.a.new; \ + ${CHMOD} 0644 ${T}${LIBDIR}/libcalc.a.new; \ ${MV} -f ${T}${LIBDIR}/libcalc.a.new ${T}${LIBDIR}/libcalc.a; \ ${RANLIB} ${T}${LIBDIR}/libcalc.a; \ - ${CHMOD} 0444 ${T}${LIBDIR}/libcalc.a; \ echo "installed ${T}${LIBDIR}/libcalc.a"; \ fi; \ fi @@ -4013,6 +4019,7 @@ install: custom/Makefile ${LIB_H_SRC} ${BUILD_H_SRC} calc.1 all ${RM} -f ${T}${LIBDIR}/libcalc${LIB_EXT_VERSION}.new; \ ${CP} -f libcalc${LIB_EXT_VERSION} \ ${T}${LIBDIR}/libcalc${LIB_EXT_VERSION}.new; \ + ${CHMOD} 0644 ${T}${LIBDIR}/libcalc${LIB_EXT_VERSION}.new; \ ${MV} -f ${T}${LIBDIR}/libcalc${LIB_EXT_VERSION}.new \ ${T}${LIBDIR}/libcalc${LIB_EXT_VERSION}; \ echo "installed ${T}${LIBDIR}/libcalc${LIB_EXT_VERSION}"; \ @@ -4031,6 +4038,7 @@ install: custom/Makefile ${LIB_H_SRC} ${BUILD_H_SRC} calc.1 all ${RM} -f ${T}${LIBDIR}/libcustcalc${LIB_EXT_VERSION}.new; \ ${CP} -f custom/libcustcalc${LIB_EXT_VERSION} \ ${T}${LIBDIR}/libcustcalc${LIB_EXT_VERSION}.new; \ + ${CHMOD} 0644 ${T}${LIBDIR}/libcustcalc${LIB_EXT_VERSION}.new; \ ${MV} -f ${T}${LIBDIR}/libcustcalc${LIB_EXT_VERSION}.new \ ${T}${LIBDIR}/libcustcalc${LIB_EXT_VERSION}; \ echo "installed ${T}${LIBDIR}/libcustcalc${LIB_EXT_VERSION}"; \ @@ -4330,6 +4338,81 @@ strip: done ${V} echo '=-=-=-=-= ${MAKE_FILE} end of $@ rule =-=-=-=-=' +# calc-symlink - setup symlinks from stardard locations into the ${T} tree +# +calc-symlink: + ${Q}if [ -z "${T}" ]; then \ + echo "cannot use $@ make rule when T make var is empty" 1>&2; \ + echo "aborting" 1>&2; \ + exit 1; \ + fi + -${Q} for i in ${BINDIR}/calc${EXT} \ + ${BINDIR}/calc-static${EXT} \ + ${SCRIPTDIR} \ + ${LIBDIR}/libcalc${LIB_EXT_VERSION} \ + ${LIBDIR}/libcustcalc${LIB_EXT_VERSION} \ + ${MANDIR}/calc.${MANEXT} \ + ${CALC_SHAREDIR} \ + ${CALC_INCDIR} \ + ; do \ + if [ -e "${T}$$i" ]; then \ + if [ ! -L "$$i" -a "${T}$$i" -ef "$$i" ]; then \ + echo "ERROR: ${T}$$i is the same as $$i" 1>&2; \ + else \ + if [ -e "$$i" ]; then \ + echo ${RM} -f "$$i"; \ + ${RM} -f "$$i"; \ + fi; \ + echo ${LN} -s "${T}$$i" "$$i"; \ + ${LN} -s "${T}$$i" "$$i"; \ + fi; \ + else \ + echo "Warning: not found: ${T}$$i" 1>&2; \ + fi; \ + done + -${Q} if [ -n "${CATDIR}" ]; then \ + if [ -e "${T}${CATDIR}/calc.${CATEXT}" ]; then \ + if [ ! -L "${CATDIR}/calc.${CATEXT}" -a "${T}${CATDIR}/calc.${CATEXT}" -ef "${CATDIR}/calc.${CATEXT}" ]; then \ + echo "ERROR: ${T}${CATDIR}/calc.${CATEXT} is the same as ${CATDIR}/calc.${CATEXT}" 1>&2; \ + else \ + if [ -e "${CATDIR}/calc.${CATEXT}" ]; then \ + echo ${RM} -f "${CATDIR}/calc.${CATEXT}"; \ + ${RM} -f "${CATDIR}/calc.${CATEXT}"; \ + fi; \ + echo ${LN} -s "${T}${CATDIR}/calc.${CATEXT}" "${CATDIR}/calc.${CATEXT}"; \ + ${LN} -s "${T}${CATDIR}/calc.${CATEXT}" "${CATDIR}/calc.${CATEXT}"; \ + fi; \ + fi; \ + fi + +# remove any symlinks that may have been created by calc-symlink +# +calc-unsymlink: + -${Q} for i in ${BINDIR}/calc${EXT} \ + ${BINDIR}/calc-static${EXT} \ + ${SCRIPTDIR} \ + ${LIBDIR}/libcalc${LIB_EXT_VERSION} \ + ${LIBDIR}/libcustcalc${LIB_EXT_VERSION} \ + ${MANDIR}/calc.${MANEXT} \ + ${CALC_SHAREDIR} \ + ${CALC_INCDIR} \ + ; do \ + if [ -L "$$i" ]; then \ + echo ${RM} -f "$$i"; \ + ${RM} -f "$$i"; \ + else \ + echo "Warning: ignoring non-symlink: $$i" 1>&2; \ + fi; \ + done + -${Q} if [ -n "${CATDIR}" ]; then \ + if [ -L "${CATDIR}/calc.${CATEXT}" ]; then \ + echo ${RM} -f "${CATDIR}/calc.${CATEXT}"; \ + ${RM} -f "${CATDIR}/calc.${CATEXT}"; \ + else \ + echo "Warning: ignoring non-symlink: ${CATDIR}/calc.${CATEXT}" 1>&2; \ + fi; \ + fi + ### # # make depend stuff diff --git a/README b/README index 1e21cf0..eac0e13 100644 --- a/README +++ b/README @@ -136,7 +136,7 @@ The calc web site is located at: ## ## @(#) $Revision: 30.1 $ ## @(#) $Id: README,v 30.1 2007/03/16 11:09:46 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/RCS/README,v $ +## @(#) $Source: /usr/local/src/bin/calc/RCS/README,v $ ## ## Under source code control: 1995/10/25 05:27:59 ## File existed as early as: 1995 diff --git a/README.WINDOWS b/README.WINDOWS index b9ed8bb..bbd085e 100644 --- a/README.WINDOWS +++ b/README.WINDOWS @@ -10,6 +10,63 @@ NOTE: The main developers do not have access to a Windoz based platform. Of course you are welcome to send us any patches that fix your Windoz build environment. +=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +=-= compiling with Cygwin =-= +=-=-=-=-=-=-=-=-=-=-=-=-=-=-= + +An effort is being made to allow windows users to compile calc using the +Cygwin project (http://sources.redhat.com/cygwin/) with the GCC compiler +and Un*x tools for Windows. + +The major porting work for Cygwin was performed by Thomas Jones-Low +(tjoneslo at softstart dot com). + +In March 2009, Michael Penk (mpenk at wuska dot com) reported success in +installs under Cygwin: + + On my fairly complete Cygwin installs, everything compiles, + checks, and installs correctly. My Cygwin is configured + in a very standard way (out of the box, using all of Cygwin's + defaults). The install worked on 5 different machines with + Cygwin on them: one XP home, one XP professional, and three + Vista professionals. + +Using the calc Makefile, he did the following: + + make all target=Cygwin + make check + make install + +He also reports: + + Of course, one should be logged in as an Administrator when + one builds and installs calc. + +He was compiling calc 2.12.4.0 with Cygwin version 1.5.25-15. + +=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +=-= If all else fails, for Cygwin =-= +=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= + +Much earlier (2001?) Thomas Jones-Low (tjoneslo at softstart dot com) +recommended that you generate by hand all of the header files that +by the Makefile. This has been done for you via the makefile rule: + + make win32_hsrc + +which uses the Makefile variables in win32.mkdef to form these header +files under win32 directory. + +You will find generated versions of these files located in the win32 +sub-directory. These files may be appropriate for your Cygwin building +needs. + +In particular: + + Just copy the win32/*.[ch] files up into the top level calc + source directory, edit them (if needed) and build using the + Cygwin GCC compiler and Cygwin build environment. + =-=-=-=-=-=-=-=-=-=-=-=-=-=-= =-= compiling under DJGPP =-= =-=-=-=-=-=-=-=-=-=-=-=-=-=-= @@ -68,52 +125,8 @@ Look for Makefile comments of the form: Follow those recommendations. In cases where they conflict with the above Makefile list, follow the recommendation in the Makefile. -=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -=-= compiling with Cygwin =-= -=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -An effort is being made to allow windows users to compile calc using the -Cygwin project (http://sources.redhat.com/cygwin/) with the GCC compiler -and Un*x tools for Windows. - -The major porting work was performed by Thomas Jones-Low -(tjoneslo at softstart dot com). He said: - - I had previous stated to this group that I have successfully managed - to port a version of Calc to Windows, and promised some point to - post what was required, so here it is. - - One obvious manner of doing this port is to get the latest version - of the Cygwin project (http://sources.redhat.com/cygwin/) with the - GCC compiler and Un*x tools for Windows and recompile. - - I built my working version using Calc ... I am using Visual C++ - version 7.0, which is an older version of the Microsoft development - tools. The make file provided with Calc is not compatible with - NMAKE, so I used the Visual Studio tools to generate another one - (not included). Calc is built in two parts, calc.dll, which is the - library, and calc.exe which is the command line interface. - -He recommended that you generate by hand all of the header files that -by the Makefile. This has been done for you via the makefile rule: - - make win32_hsrc - -which uses the Makefile variables in win32.mkdef to form these header -files under win32 directory. - -You will find generated versions of these files located in the win32 -sub-directory. These files may be appropriate for your Cygwin building -needs. - -In particular: - - Just copy the win32/*.[ch] files up into the top level calc - source directory, edit them (if needed) and build using the - Cygwin GCC compiler and Cygwin build environment. - - -## Copyright (C) 2002-2007 Landon Curt Noll and Thomas Jones-Low +## Copyright (C) 2002-2009 Landon Curt Noll and Thomas Jones-Low ## ## 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 @@ -129,9 +142,9 @@ In particular: ## 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.1 $ -## @(#) $Id: README.WINDOWS,v 30.1 2007/03/16 11:09:46 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/RCS/README.WINDOWS,v $ +## @(#) $Revision: 30.2 $ +## @(#) $Id: README.WINDOWS,v 30.2 2009/03/14 02:29:31 chongo Exp $ +## @(#) $Source: /usr/local/src/bin/calc/RCS/README.WINDOWS,v $ ## ## Under source code control: 2001/02/25 14:00:05 ## File existed as early as: 2001 diff --git a/addop.c b/addop.c index 5a01456..a34e434 100644 --- a/addop.c +++ b/addop.c @@ -21,7 +21,7 @@ * * @(#) $Revision: 30.1 $ * @(#) $Id: addop.c,v 30.1 2007/03/16 11:09:46 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/addop.c,v $ + * @(#) $Source: /usr/local/src/bin/calc/RCS/addop.c,v $ * * Under source code control: 1990/02/15 01:48:10 * File existed as early as: before 1990 diff --git a/align32.c b/align32.c index c8174f0..3031aee 100644 --- a/align32.c +++ b/align32.c @@ -19,7 +19,7 @@ * * @(#) $Revision: 30.1 $ * @(#) $Id: align32.c,v 30.1 2007/03/16 11:09:46 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/align32.c,v $ + * @(#) $Source: /usr/local/src/bin/calc/RCS/align32.c,v $ * * Under source code control: 1995/11/23 05:18:06 * File existed as early as: 1995 diff --git a/alloc.h b/alloc.h index fc94960..3cae2fe 100644 --- a/alloc.h +++ b/alloc.h @@ -19,7 +19,7 @@ * * @(#) $Revision: 30.2 $ * @(#) $Id: alloc.h,v 30.2 2008/04/15 21:17:57 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/alloc.h,v $ + * @(#) $Source: /usr/local/src/bin/calc/RCS/alloc.h,v $ * * Under source code control: 1990/02/15 01:48:29 * File existed as early as: before 1990 diff --git a/assocfunc.c b/assocfunc.c index 5892831..7044f05 100644 --- a/assocfunc.c +++ b/assocfunc.c @@ -19,7 +19,7 @@ * * @(#) $Revision: 30.1 $ * @(#) $Id: assocfunc.c,v 30.1 2007/03/16 11:09:46 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/assocfunc.c,v $ + * @(#) $Source: /usr/local/src/bin/calc/RCS/assocfunc.c,v $ * * Under source code control: 1993/07/20 23:04:27 * File existed as early as: 1993 diff --git a/blkcpy.c b/blkcpy.c index 17d0337..47fb29c 100644 --- a/blkcpy.c +++ b/blkcpy.c @@ -21,7 +21,7 @@ * * @(#) $Revision: 30.1 $ * @(#) $Id: blkcpy.c,v 30.1 2007/03/16 11:09:46 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/blkcpy.c,v $ + * @(#) $Source: /usr/local/src/bin/calc/RCS/blkcpy.c,v $ * * Under source code control: 1997/04/18 20:41:26 * File existed as early as: 1997 diff --git a/blkcpy.h b/blkcpy.h index 7d3774f..7389f0d 100644 --- a/blkcpy.h +++ b/blkcpy.h @@ -21,7 +21,7 @@ * * @(#) $Revision: 30.1 $ * @(#) $Id: blkcpy.h,v 30.1 2007/03/16 11:09:46 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/blkcpy.h,v $ + * @(#) $Source: /usr/local/src/bin/calc/RCS/blkcpy.h,v $ * * Under source code control: 1997/04/18 20:41:25 * File existed as early as: 1997 diff --git a/block.c b/block.c index 5ff4bd3..87c6073 100644 --- a/block.c +++ b/block.c @@ -21,7 +21,7 @@ * * @(#) $Revision: 30.1 $ * @(#) $Id: block.c,v 30.1 2007/03/16 11:09:46 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/block.c,v $ + * @(#) $Source: /usr/local/src/bin/calc/RCS/block.c,v $ * * Under source code control: 1997/02/27 00:29:40 * File existed as early as: 1997 diff --git a/block.h b/block.h index 1634eb0..3b4240d 100644 --- a/block.h +++ b/block.h @@ -21,7 +21,7 @@ * * @(#) $Revision: 30.1 $ * @(#) $Id: block.h,v 30.1 2007/03/16 11:09:46 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/block.h,v $ + * @(#) $Source: /usr/local/src/bin/calc/RCS/block.h,v $ * * Under source code control: 1997/02/21 05:03:39 * File existed as early as: 1997 diff --git a/byteswap.c b/byteswap.c index e522cb9..6372c3b 100644 --- a/byteswap.c +++ b/byteswap.c @@ -19,7 +19,7 @@ * * @(#) $Revision: 30.1 $ * @(#) $Id: byteswap.c,v 30.1 2007/03/16 11:09:46 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/byteswap.c,v $ + * @(#) $Source: /usr/local/src/bin/calc/RCS/byteswap.c,v $ * * Under source code control: 1995/10/11 04:44:01 * File existed as early as: 1995 diff --git a/byteswap.h b/byteswap.h index b740784..2809f51 100644 --- a/byteswap.h +++ b/byteswap.h @@ -19,7 +19,7 @@ * * @(#) $Revision: 30.1 $ * @(#) $Id: byteswap.h,v 30.1 2007/03/16 11:09:46 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/byteswap.h,v $ + * @(#) $Source: /usr/local/src/bin/calc/RCS/byteswap.h,v $ * * Under source code control: 1995/10/11 04:44:01 * File existed as early as: 1995 diff --git a/cal/Makefile b/cal/Makefile index 93db62b..1834cfa 100644 --- a/cal/Makefile +++ b/cal/Makefile @@ -18,9 +18,9 @@ # 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.3 $ -# @(#) $Id: Makefile,v 30.3 2007/09/21 01:27:27 chongo Exp $ -# @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/Makefile,v $ +# @(#) $Revision: 30.5 $ +# @(#) $Id: Makefile,v 30.5 2011/05/23 22:50:18 chongo Exp $ +# @(#) $Source: /usr/local/src/bin/calc/cal/RCS/Makefile,v $ # # Under source code control: 1991/07/21 05:00:54 # File existed as early as: 1991 @@ -193,7 +193,8 @@ CALC_FILES= README bigprime.cal deg.cal ellip.cal lucas.cal lucas_chk.cal \ beer.cal hello.cal test5100.cal test5200.cal randombitrun.cal \ randomrun.cal repeat.cal xx_print.cal natnumset.cal qtime.cal \ test8400.cal test8500.cal test8600.cal chi.cal intfile.cal screen.cal \ - dotest.cal set8700.cal set8700.line alg_config.cal sumtimes.cal + dotest.cal set8700.cal set8700.line alg_config.cal sumtimes.cal \ + dms.cal hms.cal gvec.cal # These files are found (but not built) in the distribution # diff --git a/cal/README b/cal/README index 98126dd..7ecda39 100644 --- a/cal/README +++ b/cal/README @@ -173,7 +173,8 @@ alg_config.cal beer.cal - Calc's contribution to the 99 Bottles of Beer web page: + This calc resource is calc's contribution to the 99 Bottles of Beer + web page: http://www.ionet.net/~timtroyr/funhouse/beer.html#calc @@ -191,6 +192,18 @@ bernoulli.cal the builtin function. +bernpoly.cal + + bernpoly(n,z) + + Computes the nth Bernoulli polynomial at z for arbitrary n,z. See: + + http://en.wikipedia.org/wiki/Bernoulli_polynomials + http://mathworld.wolfram.com/BernoulliPolynomial.html + + for further information + + bigprime.cal bigprime(a, m, p) @@ -198,6 +211,34 @@ bigprime.cal A prime test, base a, on p*2^x+1 for even x>m. +brentsolve.cal + + brentsolve(low, high,eps) + + A root-finder implementwed with the Brent-Dekker trick. + + brentsolve2(low, high,which,eps) + + The second function, brentsolve2(low, high,which,eps) has some lines + added to make it easier to hardcode the name of the helper function + different from the obligatory "f". + + See: + + http://en.wikipedia.org/wiki/Brent%27s_method + http://mathworld.wolfram.com/BrentsMethod.html + + to find out more about the Brent-Dekker method. + + +constants.cal + + e() + G() + + An implementation of different constants to arbitrary precision. + + chi.cal Z(x[, eps]) @@ -226,14 +267,37 @@ chrem.cal deg.cal + deg(deg, min, sec) + deg_add(a, b) + deg_neg(a) + deg_sub(a, b) + deg_mul(a, b) + deg_print(a) + + Calculate in degrees, minutes, and seconds. For a more functional + version see dms.cal. + + +dms.cal + dms(deg, min, sec) dms_add(a, b) dms_neg(a) dms_sub(a, b) dms_mul(a, b) dms_print(a) + dms_abs(a) + dms_norm(a) + dms_test(a) + dms_int(a) + dms_frac(a) + dms_rel(a,b) + dms_cmp(a,b) + dms_inc(a) + dms_dec(a) - Calculate in degrees, minutes, and seconds. + Calculate in degrees, minutes, and seconds. Unlike deg.cal, increments + are on the arc second level. See also hms.cal. dotest.cal @@ -268,6 +332,166 @@ dotest.cal dotest("set8700.line"); +factorial.cal + + factorial(n) + + Calculates the product of the positive integers up to and including n. + + See: + + http://en.wikipedia.org/wiki/Factorial + + for information on the factorial. This function depends on the script + toomcook.cal. + + + primorial(a,b) + + Calculates the product of the primes between a and b. If a is not prime + the next higher prime is taken as the starting point. If b is not prime + the next lower prime is taking as the end point b. The end point b must + not exceed 4294967291. See: + + http://en.wikipedia.org/wiki/Primorial + + for information on the primorial. + + +factorial2.cal + + This file contents a small variety of integer functions that can, with + more or less pressure, be related to the factorial. + + doublefactorial(n) + + Calculates the double factorial n!! with different algorithms for + - n odd + - n even and positive + - n (real|complex) sans the negative half integers + + See: + + http://en.wikipedia.org/wiki/Double_factorial + http://mathworld.wolfram.com/DoubleFactorial.html + + for information on the double factorial. This function depends on + the script toomcook.cal, factorial.cal and specialfunctions.cal. + + + binomial(n,k) + + Calculates the binomial coefficients for n large and k = k \pm + n/2. Defaults to the built-in function for smaller and/or different + values. Meant as a complete replacement for comb(n,k) with only a + very small overhead. See: + + http://en.wikipedia.org/wiki/Binomial_coefficient + + for information on the binomial. This function depends on the script + toomcook.cal factorial.cal and specialfunctions.cal. + + + bigcatalan(n) + + Calculates the n-th Catalan number for n large. It is usefull + above n~50,000 but defaults to the builtin function for smaller + values.Meant as a complete replacement for catalan(n) with only a + very small overhead. See: + + http://en.wikipedia.org/wiki/Catalan_number + http://mathworld.wolfram.com/CatalanNumber.html + + for information on Catalan numbers. This function depends on the scripts + toomcook.cal, factorial.cal and specialfunctions.cal. + + + stirling1(n,m) + + Calculates the Stirling number of the first kind. It does so with + building a list of all of the smaller results. It might be a good + idea, though, to run it once for the highest n,m first if many + Stirling numbers are needed at once, for example in a series. See: + + http://en.wikipedia.org/wiki/Stirling_numbers_of_the_first_kind + http://mathworld.wolfram.com/StirlingNumberoftheFirstKind.html + Algorithm 3.17, Donald Kreher and Douglas Simpson, "Combinatorial + Algorithms", CRC Press, 1998, page 89. + + for information on Stirling numbers of the first kind. + + + stirling2(n,m) + stirling2caching(n,m) + + Calculate the Stirling number of the second kind. + The first function stirling2(n,m) does it with the sum + m + ==== + 1 \ n m - k + -- > k (- 1) binomial(m, k) + m! / + ==== + k = 0 + + The other function stirling2caching(n,m) does it by way of the + reccurence relation and keeps all earlier results. This function + is much slower for computing a single value than stirling2(n,m) but + is very usefull if many Stirling numbers are needed, for example in + a series. See: + + http://en.wikipedia.org/wiki/Stirling_numbers_of_the_second_kind + http://mathworld.wolfram.com/StirlingNumberoftheSecondKind.html + + Algorithm 3.17, Donald Kreher and Douglas Simpson, "Combinatorial + Algorithms", CRC Press, 1998, page 89. + + for information on Stirling numbers of the second kind. + + + bell(n) + + Calculate the n-th Bell number. This may take some time for large n. + See: + + http://oeis.org/A000110 + http://en.wikipedia.org/wiki/Bell_number + http://mathworld.wolfram.com/BellNumber.html + + for information on Bell numbers. + + + subfactorial(n) + + Calculate the n-th subfactorial or derangement. This may take some + time for large n. See: + + http://mathworld.wolfram.com/Derangement.html + http://en.wikipedia.org/wiki/Derangement + + for information on subfactorials. + + + risingfactorial(x,n) + + Calculates the rising factorial or Pochammer symbol of almost arbitrary + x,n. See: + + http://en.wikipedia.org/wiki/Pochhammer_symbol + http://mathworld.wolfram.com/PochhammerSymbol.html + + for information on rising factorials. + + fallingfactorial(x,n) + + Calculates the rising factorial of almost arbitrary x,n. See: + + http://en.wikipedia.org/wiki/Pochhammer_symbol + http://mathworld.wolfram.com/PochhammerSymbol.html + + for information on falling factorials. + + ellip.cal efactor(iN, ia, B, force) @@ -275,6 +499,13 @@ ellip.cal Attempt to factor using the elliptic functions: y^2 = x^3 + a*x + b. +gvec.cal + + gvec(function, vector) + + Vectorize any single-input function or trailing operator. + + hello.cal Calc's contribution to the Hello World! page: @@ -285,6 +516,27 @@ hello.cal NOTE: This resource produces a lot of output. :-) +hms.cal + + hms(hour, min, sec) + hms_add(a, b) + hms_neg(a) + hms_sub(a, b) + hms_mul(a, b) + hms_print(a) + hms_abs(a) + hms_norm(a) + hms_test(a) + hms_int(a) + hms_frac(a) + hms_rel(a,b) + hms_cmp(a,b) + hms_inc(a) + hms_dec(a) + + Calculate in hours, minutes, and seconds. See also dmscal. + + intfile.cal file2be(filename) @@ -312,6 +564,37 @@ intfile.cal of the integer become the last octets of the file. +lambertw.cal + + lambertw(z,branch) + + Computes Lambert's W-function at "z" at branch "branch". See + + http://en.wikipedia.org/wiki/Lambert_W_function + http://mathworld.wolfram.com/LambertW-Function.html + https://cs.uwaterloo.ca/research/tr/1993/03/W.pdf + http://arxiv.org/abs/1003.1628 + + to get more information. + + This file includes also an implementation for the series described in + Corless et al. (1996) eq. 4.22 (W-pdf) and Verebic (2010) (arxive link) + eqs.35-37. + + The series has been implemented to get a different algorithm + for checking the results. This was necessary because the results + of the implementation in Maxima, the only program with a general + lambert-w implementation at hand at that time, differed slightly. The + Maxima versions tested were: Maxima 5.21.1 and 5.29.1. The current + version of this code concurs with the results of Mathematica`s(tm) + ProductLog[branch,z] with the tested values. + + The series is only valid for the branches 0,-1, real z, converges + for values of z _very_ near the branchpoint -exp(-1) only, and must + be given the branches explicitly. See the code in lambertw.cal + for further information. + + linear.cal linear(x0, y0, x1, y1, x) @@ -320,6 +603,24 @@ linear.cal Requires x0 != y0. +lnseries.cal + + lnseries(limit) + lnfromseries(n) + deletelnseries() + + Calculates a series of n natural logarithms at 1,2,3,4...n. It + does so by computing the prime factorization of all of the number + sequence 1,2,3...n, calculates the natural logarithms of the primes + in 1,2,3...n and uses the above factorization to build the natural + logarithms of the rest of the sequence by sadding the logarithms of + the primes in the factorization. This is faster for high precision + of the logarithms and/or long sequences. + + The sequence need to be initiated by running either lnseries(n) or + lnfromseries(n) once with n the upper limit of the sequence. + + lucas.cal lucas(h, n) @@ -365,6 +666,7 @@ mfactor.cal fastest even thought the initial startup overhead is larger than for p_elim == 13. + mod.cal lmod(a) @@ -454,6 +756,7 @@ pi.cal Lambert Meertens. See also the ABC Programmer's Handbook, by Geurts, Meertens & Pemberton, published by Prentice-Hall (UK) Ltd., 1990. + pix.cal pi_of_x(x) @@ -536,10 +839,10 @@ randmprime.cal randmprime(bits, seed [,dbg]) - Find a prime of the form h*2^n-1 >= 2^bits for some given x. The initial - search points for 'h' and 'n' are selected by a cryptographic pseudo-random - number generator. The optional argument, dbg, if set to 1, 2 or 3 - turn on various debugging print statements. + Find a prime of the form h*2^n-1 >= 2^bits for some given x. The + initial search points for 'h' and 'n' are selected by a cryptographic + pseudo-random number generator. The optional argument, dbg, if set + to 1, 2 or 3 turn on various debugging print statements. randombitrun.cal @@ -591,8 +894,8 @@ repeat.cal regress.cal - Test the correct execution of the calculator by reading this resource file. - Errors are reported with '****' messages, or worse. :-) + Test the correct execution of the calculator by reading this resource + file. Errors are reported with '****' messages, or worse. :-) screen.cal @@ -638,15 +941,17 @@ screen.cal Cyan White - Define ANSI control sequences providing (i.e., cursor movement, changing - foreground or background color, etc.) for VT100 terminals and terminal - window emulators (i.e., xterm, Apple OS/X Terminal, etc.) that support them. + Define ANSI control sequences providing (i.e., cursor movement, + changing foreground or background color, etc.) for VT100 terminals + and terminal window emulators (i.e., xterm, Apple OS/X Terminal, + etc.) that support them. For example: read screen print green:"This is green. ":red:"This is red.":black + seedrandom.cal seedrandom(seed1, seed2, bitsize [,trials]) @@ -688,8 +993,247 @@ solve.cal solve(low, high, epsilon) Solve the equation f(x) = 0 to within the desired error value for x. - The function 'f' must be defined outside of this routine, and the low - and high values are guesses which must produce values with opposite signs. + The function 'f' must be defined outside of this routine, and the + low and high values are guesses which must produce values with + opposite signs. + + +specialfunctions.cal + + beta(a,b) + + Calculates the value of the beta function. See: + + https://en.wikipedia.org/wiki/Beta_function + http://mathworld.wolfram.com/BetaFunction.html + http://dlmf.nist.gov/5.12 + + for information on the beta function. + + + betainc(a,b,z) + + Calculates the value of the regularized incomplete beta function. See: + + https://en.wikipedia.org/wiki/Beta_function + http://mathworld.wolfram.com/RegularizedBetaFunction.html + http://dlmf.nist.gov/8.17 + + for information on the regularized incomplete beta function. + + + expoint(z) + + Calculates the value of the exponential integral Ei(z) function at z. + See: + + http://en.wikipedia.org/wiki/Exponential_integral + http://www.cs.utah.edu/~vpegorar/research/2011_JGT/ + + for information on the exponential integral Ei(z) function. + + + erf(z) + + Calculates the value of the error function at z. See: + + http://en.wikipedia.org/wiki/Error_function + + for information on the error function function. + + + erfc(z) + + Calculates the value of the complementary error function at z. See: + + http://en.wikipedia.org/wiki/Error_function + + for information on the complementary error function function. + + + erfi(z) + + Calculates the value of the imaginary error function at z. See: + + http://en.wikipedia.org/wiki/Error_function + + for information on the imaginary error function function. + + + erfinv(x) + + Calculates the inverse of the error function at x. See: + + http://en.wikipedia.org/wiki/Error_function + + for information on the inverse of the error function function. + + + faddeeva(z) + + Calculates the value of the complex error function at z. See: + + http://en.wikipedia.org/wiki/Faddeeva_function + + for information on the complex error function function. + + + gamma(z) + + Calculates the value of the Euler gamma function at z. See: + + http://en.wikipedia.org/wiki/Gamma_function + http://dlmf.nist.gov/5 + + for information on the Euler gamma function. + + + gammainc(a,z) + + Calculates the value of the lower incomplete gamma function for + arbitrary a, z. See: + + http://en.wikipedia.org/wiki/Incomplete_gamma_function + + for information on the lower incomplete gamma function. + + gammap(a,z) + + Calculates the value of the regularized lower incomplete gamma + function for a, z with a not in -N. See: + + http://en.wikipedia.org/wiki/Incomplete_gamma_function + + for information on the regularized lower incomplete gamma function. + + gammaq(a,z) + + Calculates the value of the regularized upper incomplete gamma + function for a, z with a not in -N. See: + + http://en.wikipedia.org/wiki/Incomplete_gamma_function + + for information on the regularized upper incomplete gamma function. + + + heavisidestep(x) + + Computes the Heaviside stepp function (1+sign(x))/2 + + + harmonic(limit) + + Calculates partial values of the harmonic series up to limit. See: + + http://en.wikipedia.org/wiki/Harmonic_series_(mathematics) + http://mathworld.wolfram.com/HarmonicSeries.html + + for information on the harmonic series. + + + lnbeta(a,b) + + Calculates the natural logarithm of the beta function. See: + + https://en.wikipedia.org/wiki/Beta_function + http://mathworld.wolfram.com/BetaFunction.html + http://dlmf.nist.gov/5.12 + + for information on the beta function. + + lngamma(z) + + Calculates the value of the logarithm of the Euler gamma function + at z. See: + + http://en.wikipedia.org/wiki/Gamma_function + http://dlmf.nist.gov/5.15 + + for information on the derivatives of the the Euler gamma function. + + + polygamma(m,z) + + Calculates the value of the m-th derivative of the Euler gamma + function at z. See: + + http://en.wikipedia.org/wiki/Polygamma + http://dlmf.nist.gov/5 + + for information on the n-th derivative ofthe Euler gamma function. This + function depends on the script zeta2.cal. + + + psi(z) + + Calculates the value of the first derivative of the Euler gamma + function at z. See: + + http://en.wikipedia.org/wiki/Digamma_function + http://dlmf.nist.gov/5 + + for information on the first derivative of the Euler gamma function. + + + zeta(s) + + Calculates the value of the Rieman Zeta function at s. See: + + http://en.wikipedia.org/wiki/Riemann_zeta_function + http://dlmf.nist.gov/25.2 + + for information on the Riemann zeta function. This function depends + on the script zeta2.cal. + + +statistics.cal + + gammaincoctave(z,a) + + Computes the regularized incomplete gamma function in a way to + correspond with the function in Octave. + + invbetainc(x,a,b) + + Computes the inverse of the regularized beta function. Does so the + brute-force way wich makes it a bit slower. + + betapdf(x,a,b) + betacdf(x,a,b) + betacdfinv(x,a,b) + betamedian(a,b) + betamode(a,b) + betavariance(a,b) + betalnvariance(a,b) + betaskewness(a,b) + betakurtosis(a,b) + betaentropy(a,b) + normalpdf(x,mu,sigma) + normalcdf(x,mu,sigma) + probit(p) + normalcdfinv(p,mu,sigma) + normalmean(mu,sigma) + normalmedian(mu,sigma) + normalmode(mu,sigma) + normalvariance(mu,sigma) + normalskewness(mu,sigma) + normalkurtosis(mu,sigma) + normalentropy(mu,sigma) + normalmgf(mu,sigma,t) + normalcf(mu,sigma,t) + chisquaredpdf(x,k) + chisquaredpcdf(x,k) + chisquaredmean(x,k) + chisquaredmedian(x,k) + chisquaredmode(x,k) + chisquaredvariance(x,k) + chisquaredskewness(x,k) + chisquaredkurtosis(x,k) + chisquaredentropy(x,k) + chisquaredmfg(k,t) + chisquaredcf(k,t) + + Calculates a bunch of (hopefully) aptly named statistical functions. sumsq.cal @@ -751,7 +1295,8 @@ test1700.cal value - This resource files is used by regress.cal to test the read and use keywords. + This resource files is used by regress.cal to test the read and + use keywords. test2600.cal @@ -776,8 +1321,8 @@ test2600.cal checkresult(x, y, z, a) test2600(verbose, tnum) - This resource files is used by regress.cal to test some of builtin functions - in terms of accuracy and roundoff. + This resource files is used by regress.cal to test some of builtin + functions in terms of accuracy and roundoff. test2700.cal @@ -814,7 +1359,8 @@ test3100.cal res_inv(a) res(x) - This resource file is used by regress.cal to test determinants of a matrix + This resource file is used by regress.cal to test determinants of + a matrix. test3300.cal @@ -825,8 +1371,9 @@ test3300.cal testr(str, n, N, verbose) test3300(verbose, tnum) - This resource file is used by regress.cal to provide for more determinant - tests. + This resource file is used by regress.cal to provide for more + determinant tests. + test3400.cal @@ -857,6 +1404,7 @@ test3500.cal This resource file is used by regress.cal to test the functions frem, fcnt, gcdrem. + test4000.cal global defaultverbose @@ -889,6 +1437,7 @@ test4000.cal This resource file is used by regress.cal to test ptest, nextcand and prevcand builtins. + test4100.cal global defaultverbose @@ -908,6 +1457,7 @@ test4100.cal This resource file is used by regress.cal to test REDC operations. + test4600.cal stest(str [, verbose]) defined @@ -919,6 +1469,7 @@ test4600.cal This resource file is used by regress.cal to test searching in files. + test5100.cal global a5100 @@ -928,6 +1479,7 @@ test5100.cal This resource file is used by regress.cal to test the new code generator declaration scope and order. + test5200.cal global a5200 @@ -939,6 +1491,7 @@ test5200.cal This resource file is used by regress.cal to test the fix of a global/static bug. + test8400.cal test8400() defined @@ -946,6 +1499,7 @@ test8400.cal This resource file is used by regress.cal to check for quit-based memory leaks. + test8500.cal global err_8500 @@ -958,6 +1512,7 @@ test8500.cal This resource file is used by regress.cal to the // and % operators. + test8600.cal global min_8600 @@ -968,6 +1523,25 @@ test8600.cal This resource file is used by regress.cal to test a change of allowing up to 1024 args to be passed to a builtin function. + +test8900.cal + + This function tests a number of calc resource functions contributed + by Christoph Zurnieden. These include: + + bernpoly.cal + brentsolve.cal + constants.cal + factorial2.cal + factorial.cal + lambertw.cal + lnseries.cal + specialfunctions.cal + statistics.cal + toomcook.cal + zeta2.cal + + unitfrac.cal unitfrac(x) @@ -975,6 +1549,29 @@ unitfrac.cal Represent a fraction as sum of distinct unit fractions. +toomcook.cal + + + toomcook3(a,b) + toomcook4(a,b) + + Toom-Cook multiplication algorithm. Multiply two integers a,b by + way of the Toom-Cook algorithm. See: + + http://en.wikipedia.org/wiki/Toom%E2%80%93Cook_multiplication + + toomcook3square(a) + toomcook4square(a) + + Square the integer a by way of the Toom-Cook algorithm. See: + + http://en.wikipedia.org/wiki/Toom%E2%80%93Cook_multiplication + + The function toomCook4(a,b) calls the function toomCook3(a,b) which + calls built-in multiplication at a specific cut-off point. The + squaring functions act in the same way. + + varargs.cal sc(a, b, ...) @@ -982,6 +1579,7 @@ varargs.cal Example program to use 'varargs'. Program to sum the cubes of all the specified numbers. + xx_print.cal is_octet(a) defined @@ -996,6 +1594,19 @@ xx_print.cal Demo for the xx_print object routines. + +zeta2.cal + + hurwitzzeta(s,a) + + Calculate the value of the Hurwitz Zeta function. See: + + http://en.wikipedia.org/wiki/Hurwitz_zeta_function + http://dlmf.nist.gov/25.11 + + for information on this special zeta function. + + ## Copyright (C) 2000 David I. Bell and Landon Curt Noll ## ## Primary author: Landon Curt Noll @@ -1014,8 +1625,8 @@ xx_print.cal ## 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.1 $ -## @(#) $Id: README,v 30.1 2007/03/16 11:09:54 chongo Exp $ +## @(#) $Revision: 30.5 $ +## @(#) $Id: README,v 30.5 2013/08/11 03:26:46 chongo Exp $ ## @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/README,v $ ## ## Under source code control: 1990/02/15 01:50:32 diff --git a/cal/alg_config.cal b/cal/alg_config.cal index 5bf002a..c6f1dda 100644 --- a/cal/alg_config.cal +++ b/cal/alg_config.cal @@ -19,7 +19,7 @@ * * @(#) $Revision: 30.1 $ * @(#) $Id: alg_config.cal,v 30.1 2007/03/16 11:09:54 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/alg_config.cal,v $ + * @(#) $Source: /usr/local/src/bin/calc/cal/RCS/alg_config.cal,v $ * * Under source code control: 2006/06/07 14:10:11 * File existed as early as: 2006 diff --git a/cal/beer.cal b/cal/beer.cal index 226cda5..2a12be8 100644 --- a/cal/beer.cal +++ b/cal/beer.cal @@ -19,7 +19,7 @@ * * @(#) $Revision: 30.1 $ * @(#) $Id: beer.cal,v 30.1 2007/03/16 11:09:54 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/beer.cal,v $ + * @(#) $Source: /usr/local/src/bin/calc/cal/RCS/beer.cal,v $ * * Under source code control: 1996/11/13 13:21:05 * File existed as early as: 1996 diff --git a/cal/bernoulli.cal b/cal/bernoulli.cal index 9bcd14b..8bd3186 100644 --- a/cal/bernoulli.cal +++ b/cal/bernoulli.cal @@ -19,7 +19,7 @@ * * @(#) $Revision: 30.1 $ * @(#) $Id: bernoulli.cal,v 30.1 2007/03/16 11:09:54 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/bernoulli.cal,v $ + * @(#) $Source: /usr/local/src/bin/calc/cal/RCS/bernoulli.cal,v $ * * Under source code control: 1991/09/30 11:18:41 * File existed as early as: 1991 diff --git a/cal/bigprime.cal b/cal/bigprime.cal index 3de4332..a70c7f2 100644 --- a/cal/bigprime.cal +++ b/cal/bigprime.cal @@ -19,7 +19,7 @@ * * @(#) $Revision: 30.1 $ * @(#) $Id: bigprime.cal,v 30.1 2007/03/16 11:09:54 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/bigprime.cal,v $ + * @(#) $Source: /usr/local/src/bin/calc/cal/RCS/bigprime.cal,v $ * * Under source code control: 1991/05/22 21:56:32 * File existed as early as: 1991 diff --git a/cal/bindings b/cal/bindings index ce09e0b..8911377 100644 --- a/cal/bindings +++ b/cal/bindings @@ -18,7 +18,7 @@ # # @(#) $Revision: 30.1 $ # @(#) $Id: bindings,v 30.1 2007/03/16 11:09:54 chongo Exp $ -# @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/bindings,v $ +# @(#) $Source: /usr/local/src/bin/calc/cal/RCS/bindings,v $ # # Under source code control: 1993/05/02 20:09:19 # File existed as early as: 1993 diff --git a/cal/chi.cal b/cal/chi.cal index 974b6b5..4d154e8 100644 --- a/cal/chi.cal +++ b/cal/chi.cal @@ -19,7 +19,7 @@ * * @(#) $Revision: 30.1 $ * @(#) $Id: chi.cal,v 30.1 2007/03/16 11:09:54 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/chi.cal,v $ + * @(#) $Source: /usr/local/src/bin/calc/cal/RCS/chi.cal,v $ * * Under source code control: 2001/03/27 14:10:11 * File existed as early as: 2001 diff --git a/cal/chrem.cal b/cal/chrem.cal index fe0b8db..6ab64cc 100644 --- a/cal/chrem.cal +++ b/cal/chrem.cal @@ -21,7 +21,7 @@ * * @(#) $Revision: 30.1 $ * @(#) $Id: chrem.cal,v 30.1 2007/03/16 11:09:54 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/chrem.cal,v $ + * @(#) $Source: /usr/local/src/bin/calc/cal/RCS/chrem.cal,v $ * * Under source code control: 1992/09/26 01:00:47 * File existed as early as: 1992 diff --git a/cal/deg.cal b/cal/deg.cal index 97af5ac..e71b0f3 100644 --- a/cal/deg.cal +++ b/cal/deg.cal @@ -17,9 +17,9 @@ * 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.1 $ - * @(#) $Id: deg.cal,v 30.1 2007/03/16 11:09:54 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/deg.cal,v $ + * @(#) $Revision: 30.2 $ + * @(#) $Id: deg.cal,v 30.2 2010/09/02 06:01:14 chongo Exp $ + * @(#) $Source: /usr/local/src/bin/calc/cal/RCS/deg.cal,v $ * * Under source code control: 1990/02/15 01:50:33 * File existed as early as: before 1990 @@ -28,9 +28,9 @@ */ -obj dms {deg, min, sec}; +obj deg {deg, min, sec}; -define dms(deg, min, sec) +define deg(deg, min, sec) { local ans; @@ -38,18 +38,18 @@ define dms(deg, min, sec) sec = 0; if (isnull(min)) min = 0; - obj dms ans; + obj deg ans; ans.deg = deg; ans.min = min; ans.sec = sec; - fixdms(ans); + fixdeg(ans); return ans; } -define dms_add(a, b) +define deg_add(a, b) { - local obj dms ans; + local obj deg ans; ans.deg = 0; ans.min = 0; @@ -66,14 +66,14 @@ define dms_add(a, b) ans.sec += b.sec; } else ans.deg += b; - fixdms(ans); + fixdeg(ans); return ans; } -define dms_neg(a) +define deg_neg(a) { - local obj dms ans; + local obj deg ans; ans.deg = -a.deg; ans.min = -a.min; @@ -82,15 +82,15 @@ define dms_neg(a) } -define dms_sub(a, b) +define deg_sub(a, b) { return a - b; } -define dms_mul(a, b) +define deg_mul(a, b) { - local obj dms ans; + local obj deg ans; if (istype(a, ans) && istype(b, ans)) quit "Cannot multiply degrees together"; @@ -103,24 +103,24 @@ define dms_mul(a, b) ans.min = b.min * a; ans.sec = b.sec * a; } - fixdms(ans); + fixdeg(ans); return ans; } -define dms_print(a) +define deg_print(a) { print a.deg : 'd' : a.min : 'm' : a.sec : 's' :; } -define dms_abs(a) +define deg_abs(a) { return a.deg + a.min / 60 + a.sec / 3600; } -define fixdms(a) +define fixdeg(a) { a.min += frac(a.deg) * 60; a.deg = int(a.deg); @@ -134,5 +134,5 @@ define fixdms(a) } if (config("resource_debug") & 3) { - print "obj dms {deg, min, sec} defined"; + print "obj deg {deg, min, sec} defined"; } diff --git a/cal/dms.cal b/cal/dms.cal new file mode 100644 index 0000000..bd7c2d7 --- /dev/null +++ b/cal/dms.cal @@ -0,0 +1,384 @@ +/* + * dms - calculate in degrees, minutes, and seconds (based on deg) + * + * Copyright (C) 1999,2010 David I. Bell and Landon Curt Noll + * + * Calc is open software; you can redistribute it and/or modify it under + * the terms of the version 2.1 of the GNU Lesser General Public License + * as published by the Free Software Foundation. + * + * Calc is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + * Public License for more details. + * + * A copy of version 2.1 of the GNU Lesser General Public License is + * distributed with calc under the filename COPYING-LGPL. You should have + * received a copy with calc; if not, write to Free Software Foundation, Inc. + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * @(#) $Revision: 30.2 $ + * @(#) $Id: dms.cal,v 30.2 2010/09/02 06:14:16 chongo Exp $ + * @(#) $Source: /usr/local/src/bin/calc/cal/RCS/dms.cal,v $ + * + * Under source code control: 1990/02/15 01:50:33 + * File existed as early as: before 1990 + * + * Share and enjoy! :-) http://www.isthe.com/chongo/tech/comp/calc/ + */ + + +obj dms {deg, min, sec}; + +define dms(deg, min, sec) +{ + local obj dms ans; /* return value */ + + /* default missing args to 0 */ + if (isnull(sec)) { + sec = 0; + } + if (isnull(min)) { + min = 0; + } + + /* load object */ + ans.deg = deg; + ans.min = min; + ans.sec = sec; + + /* return properly formed object */ + ans = fixdms(ans); + return ans; +} + + +define dms_add(a, b) +{ + local obj dms ans; /* return value */ + + /* initalize value to 1st arg */ + if (istype(a, ans)) { + /* 1st arg is dms object, load it */ + ans.deg = a.deg; + ans.min = a.min; + ans.sec = a.sec; + } else { + /* 1st arg is not dms, assume scalar degrees */ + ans.deg = a; + ans.min = 0; + ans.sec = 0; + } + + /* add value of 2nd arg */ + if (istype(b, ans)) { + /* 2nd arg is dms object, add it */ + ans.deg += b.deg; + ans.min += b.min; + ans.sec += b.sec; + } else { + /* 2nd arg is not dms, add scalar degrees */ + ans.deg += b; + } + + /* return normalized result */ + ans = fixdms(ans); + return ans; +} + + +define dms_neg(a) +{ + local obj dms ans; /* return value */ + + /* negate argument */ + if (istype(a, ans)) { + /* 1st arg is dms object, load it */ + ans.deg = -a.deg; + ans.min = -a.min; + ans.sec = -a.sec; + } else { + /* 2nd arg is not dms, negate scalar degrees */ + ans.deg = -a; + ans.min = 0; + ans.sec = 0; + } + + /* return normalized result */ + ans = fixdms(ans); + return ans; +} + + +define dms_sub(a, b) +{ + local obj dms ans; /* return value */ + + /* initalize value to 1st arg */ + if (istype(a, ans)) { + /* 1st arg is dms object, load it */ + ans.deg = a.deg; + ans.min = a.min; + ans.sec = a.sec; + } else { + /* 1st arg is not dms, assume scalar degrees */ + ans.deg = a; + ans.min = 0; + ans.sec = 0; + } + + /* subtract value of 2nd arg */ + if (istype(b, ans)) { + /* 2nd arg is dms object, subtract it */ + ans.deg -= b.deg; + ans.min -= b.min; + ans.sec -= b.sec; + } else { + /* 2nd arg is not dms, subtract scalar degrees */ + ans.deg -= b; + } + + /* return normalized result */ + ans = fixdms(ans); + return ans; +} + + +define dms_mul(a, b) +{ + local obj dms ans; /* return value */ + + /* dms object multiplication */ + if (istype(a, ans) && istype(b, ans)) { + ans.deg = dms_abs(a) * dms_abs(b); + ans.min = 0; + ans.sec = 0; + + /* scalar multiplication */ + } else if (istype(a, ans)) { + ans.deg = a.deg * b; + ans.min = a.min * b; + ans.sec = a.sec * b; + } else { + ans.deg = b.deg * a; + ans.min = b.min * a; + ans.sec = b.sec * a; + } + + /* return normalized result */ + ans = fixdms(ans); + return ans; +} + + +define dms_print(a) +{ + local obj dms ans; /* temp object for dms type testing */ + + /* firewall - arg must be a dms object */ + if (! istype(a, ans)) { + quit "dms_print called with non dms object"; + } + + /* print in dms form */ + print a.deg : 'd' : a.min : 'm' : a.sec : 's' :; +} + + +define dms_abs(a) +{ + local obj dms ans; /* temp object for dms type testing */ + local deg; /* return scalar value */ + + /* firewall - just absolute value non dms objects */ + if (! istype(a, ans)) { + return abs(a); + } + + /* compute degrees */ + deg = a.deg + a.min / 60 + a.sec / 3600; + + /* return degrees */ + return deg; +} + + +define dms_norm(a) +{ + local obj dms ans; /* temp object for dms type testing */ + local deg; /* degrees */ + + /* firewall - arg must be a dms object */ + if (! istype(a, ans)) { + quit "dms_norm called with non dms object"; + } + + /* square degrees (norm is the square of absolute value */ + deg = dms_abs(a); + + /* return degrees */ + return deg*deg; +} + + +define dms_test(a) +{ + local obj dms ans; /* temp value */ + + /* firewall - arg must be a dms object */ + if (! istype(a, ans)) { + quit "dms_test called with non dms object"; + } + + /* return false of non-zero */ + ans = fixdms(a); + if (ans.deg == 0 && ans.min == 0 && ans.sec == 0) { + /* false */ + return 0; + } + /* true */ + return 1; +} + + +define dms_int(a) +{ + local obj dms ans; /* return value */ + + /* firewall - arg must be a dms object */ + if (! istype(a, ans)) { + quit "dms_int called with non dms object"; + } + + /* normalize the argument */ + ans = fixdms(a); + + /* truncate to the nearest second */ + ans.sec = int(ans.sec); + + /* return value to the nearest second */ + return ans; +} + + +define dms_frac(a) +{ + local obj dms ans; /* return value */ + + /* firewall - arg must be a dms object */ + if (! istype(a, ans)) { + quit "dms_frac called with non dms object"; + } + + /* normalize the argument */ + ans = fixdms(a); + + /* remove all but fractional seconds */ + ans.deg = 0; + ans.min = 0; + ans.sec = frac(ans.sec); + + /* return value to the second fraction */ + return ans; +} + + +define dms_rel(a,b) +{ + local abs_a, abs_b; /* scalars of the arguments */ + + /* compute scalars of the arguments */ + abs_a = dms_abs(a); + abs_b = dms_abs(b); + + /* return the comparison */ + return cmp(abs_a, abs_b); +} + + +define dms_cmp(a,b) +{ + local abs_a, abs_b; /* scalars of the arguments */ + + /* compute scalars of the arguments */ + abs_a = dms_abs(a); + abs_b = dms_abs(b); + + /* return the equality comparison */ + return (abs_a == abs_b); +} + + +define dms_inc(a) +{ + local obj dms ans; /* return value */ + + /* increment a dms object */ + if (istype(a, ans)) { + ans = a; + ++ans.sec; + + /* return normalized result */ + ans = fixdms(ans); + return ans; + } + + /* increment a scalar */ + return a+1; +} + + +define dms_dec(a) +{ + local obj dms ans; /* return value */ + + /* decrement a dms object */ + if (istype(a, ans)) { + ans = a; + --ans.sec; + + /* return normalized result */ + ans = fixdms(ans); + return ans; + } + + /* decrement a scalar */ + return a-1; +} + + +define fixdms(a) +{ + local obj dms ans; /* temp value */ + + /* firewall */ + if (! istype(a, ans)) { + quit "attempt to fix a non dms object"; + } + + /* force minutes to be intergral */ + a.min += frac(a.deg) * 60; + a.deg = int(a.deg); + + /* force degrees to be intergral */ + a.sec += frac(a.min) * 60; + a.min = int(a.min); + + /* carry excess seconds into minutes */ + a.min += a.sec // 60; + a.sec %= 60; + + /* carry excess minutes into degrees */ + a.deg += a.min // 60; + a.min %= 60; + + /* round degrees :-) */ + a.deg %= 360; + + /* return normalized result */ + return a; +} + +if (config("resource_debug") & 3) { + print "obj dms {deg, min, sec} defined"; +} diff --git a/cal/dotest.cal b/cal/dotest.cal index 4cc225d..996f3fa 100644 --- a/cal/dotest.cal +++ b/cal/dotest.cal @@ -18,7 +18,7 @@ * * @(#) $Revision: 30.2 $ * @(#) $Id: dotest.cal,v 30.2 2007/03/16 11:09:54 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/dotest.cal,v $ + * @(#) $Source: /usr/local/src/bin/calc/cal/RCS/dotest.cal,v $ * * This file is not covered under version 2.1 of the GNU LGPL. * diff --git a/cal/ellip.cal b/cal/ellip.cal index 37dc41d..753204f 100644 --- a/cal/ellip.cal +++ b/cal/ellip.cal @@ -19,7 +19,7 @@ * * @(#) $Revision: 30.1 $ * @(#) $Id: ellip.cal,v 30.1 2007/03/16 11:09:54 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/ellip.cal,v $ + * @(#) $Source: /usr/local/src/bin/calc/cal/RCS/ellip.cal,v $ * * Under source code control: 1990/02/15 01:50:33 * File existed as early as: before 1990 diff --git a/cal/gvec.cal b/cal/gvec.cal new file mode 100644 index 0000000..6da022b --- /dev/null +++ b/cal/gvec.cal @@ -0,0 +1,107 @@ +/* + * gvec - vectorize any single-input function or trailing operator + * + * This version accepts arbitrary number of arguments, but of course + * they must all be same length vectors. + * + * The gvec function is for use in either a two-arg function or a two-arg + * operation "function" must be first; calc doesn't care how many more + * arguments there actually are. + * + * @(#) $Revision: 30.3 $ + * @(#) $Id: gvec.cal,v 30.3 2011/05/23 23:00:55 chongo Exp $ + * @(#) $Source: /usr/local/src/bin/calc/cal/RCS/gvec.cal,v $ + * + * Under source code control: 2011/03/31 17:54:55 + * File existed as early as: 2010 + * + * By Carl Witthoft carl at witthoft dot com + */ + +define gvec(function, vector) +{ + local xlen,y,foo; + local precx = 1e-50; /* default for now */ + local argc = param(0)-1; + local old_tilde; /* previous config("tilde") */ + + /* + * parse args + */ + local plist = mat[argc]; + if (config("resource_debug") & 8) { + print "plist=", plist; + print "argc=", argc; + } + for(local i = 0; i< argc; i++) { + local ii = i + 2; + if (config("resource_debug") & 8) { + print "ii=", ii; + print "param(" : ii : "}=", param(ii); + print "size(param(" : ii : ")=", size(param(ii)); + } + plist[i] = size(param(ii)); + } + local slist=sort(plist); + if (config("resource_debug") & 8) { + print "plist=", plist; + } + local argm = argc-1; + if (config("resource_debug") & 8) { + print "argm=", argm; + } + if (slist[0] != slist[argm]) { + quit "lengths don't match"; + } + xlen = size(vector); + y = mat[xlen]; + + /* + * We can't do str(vector[j]) outside loop, eval() petulantly refuses to + * look at local variables. + * + * Also we need to config("tilde",0) to turn off lead tilde + * (so str(vector[j]) looks like a number. + */ + old_tilde = config("tilde",0); + + /* + * Ok, now check to see if "function" is a function. If not, it's an + * operation and it's up to user to make it valid + */ + if (isdefined(function)) { + + /* yep, it's a function, either builtin or user-defined */ + for (local j=0; j>> -Release: 1.1 +Release: 10 License: LGPL Group: Applications/Engineering -Source: %{name}-%{version}.tar.bz2 +Source: http://www.isthe.com/chongo/src/calc/%{name}-%{version}.tar.bz2 URL: http://www.isthe.com/chongo/tech/comp/calc/index.html -Requires: ncurses >= 5.2-26, readline >= 4.2, less >= 358 -BuildRequires: ncurses-devel >= 5.2-26, readline-devel >= 4.2 -BuildRoot: %{_tmppath}/%{name}-root +Vendor: Landon Noll and Associates +Packager: Landon Noll and Associates (http://www.isthe.com/chongo/index.html) +Requires: ncurses >= 5.5-24, readline >= 5.1-3, less >= 358 +BuildRequires: ncurses-devel >= 5.5-24, readline-devel >= 5.1-3 +BuildRoot: %{_tmppath}/build-root %description Calc is arbitrary precision C-like arithmetic system that is a @@ -58,8 +60,8 @@ For the latest calc release, see the calc project home page: %package devel Summary: Development files and documentation for calc. -Group: Development/Libraries -PreReq: %{name} = %{version}-%{release} +Group: Applications/Engineering +Requires: calc = %{version}-%{release} %description devel This package contains the header files and static libraries for developing @@ -70,46 +72,46 @@ For the latest calc release, see the project home page: http://www.isthe.com/chongo/tech/comp/calc/index.html %prep -%setup -q +%setup -T -b 0 %build echo '-=- calc.spec beginning make clobber -=-' -make %{?_smp_mflags} T=%{buildroot} BINDIR=%{_bindir} LIBDIR=%{_libdir} CALC_SHAREDIR=%{_datadir}/%{name} CALC_INCDIR=%{_includedir}/calc MANDIR=%{_mandir}/man1 EXT= V=@ clobber +make %{?_smp_mflags} T=%{_buildroot} BINDIR=%{_bindir} LIBDIR=%{_libdir} CALC_SHAREDIR=%{_datadir}/%{name} CALC_INCDIR=%{_includedir}/calc MANDIR=%{_mandir}/man1 EXT= V=@ clobber echo '-=- calc.spec ending make clobber -=-' echo '-=- calc.spec beginning make calc-static-only -=-' -make %{?_smp_mflags} T=%{buildroot} BINDIR=%{_bindir} LIBDIR=%{_libdir} CALC_SHAREDIR=%{_datadir}/%{name} CALC_INCDIR=%{_includedir}/calc MANDIR=%{_mandir}/man1 EXT= V=@ calc-static-only BLD_TYPE=calc-static-only +make %{?_smp_mflags} T=%{_buildroot} BINDIR=%{_bindir} LIBDIR=%{_libdir} CALC_SHAREDIR=%{_datadir}/%{name} CALC_INCDIR=%{_includedir}/calc MANDIR=%{_mandir}/man1 EXT= V=@ calc-static-only BLD_TYPE=calc-static-only echo '-=- calc.spec ending make calc-static-only -=-' echo '-=- calc.spec beginning make rpm-hide-static -=-' -make %{?_smp_mflags} T=%{buildroot} BINDIR=%{_bindir} LIBDIR=%{_libdir} CALC_SHAREDIR=%{_datadir}/%{name} CALC_INCDIR=%{_includedir}/calc MANDIR=%{_mandir}/man1 EXT= V=@ rpm-hide-static +make %{?_smp_mflags} T=%{_buildroot} BINDIR=%{_bindir} LIBDIR=%{_libdir} CALC_SHAREDIR=%{_datadir}/%{name} CALC_INCDIR=%{_includedir}/calc MANDIR=%{_mandir}/man1 EXT= V=@ rpm-hide-static echo '-=- calc.spec ending make rpm-hide-static -=-' echo '-=- calc.spec beginning make clobber (again) -=-' -make %{?_smp_mflags} T=%{buildroot} BINDIR=%{_bindir} LIBDIR=%{_libdir} CALC_SHAREDIR=%{_datadir}/%{name} CALC_INCDIR=%{_includedir}/calc MANDIR=%{_mandir}/man1 EXT= V=@ clobber +make %{?_smp_mflags} T=%{_buildroot} BINDIR=%{_bindir} LIBDIR=%{_libdir} CALC_SHAREDIR=%{_datadir}/%{name} CALC_INCDIR=%{_includedir}/calc MANDIR=%{_mandir}/man1 EXT= V=@ clobber echo '-=- calc.spec ending make clobber (again) -=-' echo '-=- calc.spec beginning make calc-dynamic-only -=-' -make %{?_smp_mflags} T=%{buildroot} BINDIR=%{_bindir} LIBDIR=%{_libdir} CALC_SHAREDIR=%{_datadir}/%{name} CALC_INCDIR=%{_includedir}/calc MANDIR=%{_mandir}/man1 EXT= V=@ calc-dynamic-only BLD_TYPE=calc-dynamic-only LD_SHARE= +make %{?_smp_mflags} T=%{_buildroot} BINDIR=%{_bindir} LIBDIR=%{_libdir} CALC_SHAREDIR=%{_datadir}/%{name} CALC_INCDIR=%{_includedir}/calc MANDIR=%{_mandir}/man1 EXT= V=@ calc-dynamic-only BLD_TYPE=calc-dynamic-only LD_SHARE= echo '-=- calc.spec ending make calc-dynamic-only -=-' echo '-=- calc.spec beginning make chk -=-' -make %{?_smp_mflags} T=%{buildroot} BINDIR=%{_bindir} LIBDIR=%{_libdir} CALC_SHAREDIR=%{_datadir}/%{name} CALC_INCDIR=%{_includedir}/calc MANDIR=%{_mandir}/man1 EXT= V=@ chk +make %{?_smp_mflags} T=%{_buildroot} BINDIR=%{_bindir} LIBDIR=%{_libdir} CALC_SHAREDIR=%{_datadir}/%{name} CALC_INCDIR=%{_includedir}/calc MANDIR=%{_mandir}/man1 EXT= V=@ chk echo '-=- calc.spec ending make chk -=-' echo '-=- calc.spec beginning make rpm-unhide-static -=-' -make %{?_smp_mflags} T=%{buildroot} BINDIR=%{_bindir} LIBDIR=%{_libdir} CALC_SHAREDIR=%{_datadir}/%{name} CALC_INCDIR=%{_includedir}/calc MANDIR=%{_mandir}/man1 EXT= V=@ rpm-unhide-static +make %{?_smp_mflags} T=%{_buildroot} BINDIR=%{_bindir} LIBDIR=%{_libdir} CALC_SHAREDIR=%{_datadir}/%{name} CALC_INCDIR=%{_includedir}/calc MANDIR=%{_mandir}/man1 EXT= V=@ rpm-unhide-static echo '-=- calc.spec ending make rpm-unhide-static -=-' echo '-=- calc.spec beginning make rpm-clean-static -=-' -make %{?_smp_mflags} T=%{buildroot} BINDIR=%{_bindir} LIBDIR=%{_libdir} CALC_SHAREDIR=%{_datadir}/%{name} CALC_INCDIR=%{_includedir}/calc MANDIR=%{_mandir}/man1 EXT= V=@ rpm-clean-static +make %{?_smp_mflags} T=%{_buildroot} BINDIR=%{_bindir} LIBDIR=%{_libdir} CALC_SHAREDIR=%{_datadir}/%{name} CALC_INCDIR=%{_includedir}/calc MANDIR=%{_mandir}/man1 EXT= V=@ rpm-clean-static echo '-=- calc.spec ending make rpm-clean-static -=-' echo '-=- calc.spec beginning make rpm-chk-static -=-' -make %{?_smp_mflags} T=%{buildroot} BINDIR=%{_bindir} LIBDIR=%{_libdir} CALC_SHAREDIR=%{_datadir}/%{name} CALC_INCDIR=%{_includedir}/calc MANDIR=%{_mandir}/man1 EXT= V=@ rpm-chk-static +make %{?_smp_mflags} T=%{_buildroot} BINDIR=%{_bindir} LIBDIR=%{_libdir} CALC_SHAREDIR=%{_datadir}/%{name} CALC_INCDIR=%{_includedir}/calc MANDIR=%{_mandir}/man1 EXT= V=@ rpm-chk-static echo '-=- calc.spec ending make rpm-chk-static -=-' %install -rm -rf %{buildroot} -mkdir -p %{buildroot} echo '-=- calc.spec beginning make install -=-' -make T=%{buildroot} BINDIR=%{_bindir} LIBDIR=%{_libdir} CALC_SHAREDIR=%{_datadir}/%{name} CALC_INCDIR=%{_includedir}/calc MANDIR=%{_mandir}/man1 EXT= V=@ install +rm -rf %{_buildroot} +mkdir -p %{_buildroot} +make T=%{_buildroot} BINDIR=%{_bindir} LIBDIR=%{_libdir} CALC_SHAREDIR=%{_datadir}/%{name} CALC_INCDIR=%{_includedir}/calc MANDIR=%{_mandir}/man1 EXT= V=@ install echo '-=- calc.spec ending make install -=-' %clean -rm -rf %{buildroot} +rm -rf %{_buildroot} %files %defattr(-, root, root) @@ -124,8 +126,10 @@ rm -rf %{buildroot} %attr(644, root, root) %{_datadir}/%{name}/help/* %attr(644, root, root) %{_datadir}/%{name}/*.cal %attr(644, root, root) %{_datadir}/%{name}/*.line -%attr(644, root, root) %{_libdir}/libcalc.so.%{version} -%attr(644, root, root) %{_libdir}/libcustcalc.so.%{version} +%attr(644, root, root) %{_libdir}/libcalc.so +%attr(644, root, root) %{_libdir}/libcalc.so.* +%attr(644, root, root) %{_libdir}/libcustcalc.so +%attr(644, root, root) %{_libdir}/libcustcalc.so.* %files devel %defattr(-, root, root) @@ -136,28 +140,49 @@ rm -rf %{buildroot} %attr(644, root, root) %{_libdir}/libcustcalc.a %changelog +* Sat May 05 2013 Landon Curt Noll http://www.isthe.com/chongo +- Release: 10 +- Major bug rpm build process bug fix +- Source: is a URL as per rpm requirements +- Requires: ncurses >= 5.5-24, readline >= 5.1-3, less >= 358 +- BuildRequires: ncurses-devel >= 5.5-24, readline-devel >= 5.1-3 +- BuildRoot: %{_tmppath}/build-root +- Fixed use of %{_buildroot} +- Fixed permissions so that rpm build services can modify libraries +- Added missing files to files section +* Mon Mar 25 2013 Landon Curt Noll http://www.isthe.com/chongo +- Release: 9 (was 1.1) +- Removed deprecated PreReq for calc-devel, using Requires * Sun Sep 01 2007 Landon Curt Noll http://www.isthe.com/chongo +- Release: 8 - Release of calc-2.12.2 - Calc builds with shared libraries * Sun Jun 25 2006 Landon Curt Noll http://www.isthe.com/chongo +- Release: 7 - Changed Copyright to License as per new rpm v4.4 syntax * Sun May 20 2006 Landon Curt Noll http://www.isthe.com/chongo +- Release: 6 - Release of calc-2.12.0 - Added *.line set files to the list of packaged files * Sun Dec 11 2005 Landon Curt Noll http://www.isthe.com/chongo +- Release: 5 - Release of calc-2.11.11 - Fixed description in spec file * Wed Feb 26 2003 Landon Curt Noll http://www.isthe.com/chongo +- Release: 4 - Release of calc-2.11.7-2 - Fixed attributes on include and lib calc-devel files - Added BUGS to calc-devel as well as calc * Tue Feb 25 2003 Landon Curt Noll http://www.isthe.com/chongo +- Release: 3 - Release of calc-2.11.7-1 - Require ncurses, readline and less to install. - Require ncurses-devel and readline-devel to build. * Tue Feb 18 2003 Landon Curt Noll http://www.isthe.com/chongo +- Release: 2 - Misc changes to fit local directory setup * Sun Feb 16 2003 Petteri Kettunen +- Release: 1 - initial RPM build #**** diff --git a/calcerr.tbl b/calcerr.tbl index 81827fd..4cf4c12 100644 --- a/calcerr.tbl +++ b/calcerr.tbl @@ -19,7 +19,7 @@ # # @(#) $Revision: 30.1 $ # @(#) $Id: calcerr.tbl,v 30.1 2007/03/16 11:09:46 chongo Exp $ -# @(#) $Source: /usr/local/src/cmd/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 # File existed as early as: 1996 diff --git a/calcerr_c.awk b/calcerr_c.awk index f0d416d..d1354bc 100644 --- a/calcerr_c.awk +++ b/calcerr_c.awk @@ -20,7 +20,7 @@ # # @(#) $Revision: 30.1 $ # @(#) $Id: calcerr_c.awk,v 30.1 2007/03/16 11:09:46 chongo Exp $ -# @(#) $Source: /usr/local/src/cmd/calc/RCS/calcerr_c.awk,v $ +# @(#) $Source: /usr/local/src/bin/calc/RCS/calcerr_c.awk,v $ # # Under source code control: 1996/05/24 03:15:35 # File existed as early as: 1996 diff --git a/calcerr_c.sed b/calcerr_c.sed index 5f1c165..a6866b1 100644 --- a/calcerr_c.sed +++ b/calcerr_c.sed @@ -20,7 +20,7 @@ # # @(#) $Revision: 30.1 $ # @(#) $Id: calcerr_c.sed,v 30.1 2007/03/16 11:09:46 chongo Exp $ -# @(#) $Source: /usr/local/src/cmd/calc/RCS/calcerr_c.sed,v $ +# @(#) $Source: /usr/local/src/bin/calc/RCS/calcerr_c.sed,v $ # # Under source code control: 1996/05/24 03:15:35 # File existed as early as: 1996 diff --git a/calcerr_h.awk b/calcerr_h.awk index 1958a84..52392e9 100644 --- a/calcerr_h.awk +++ b/calcerr_h.awk @@ -20,7 +20,7 @@ # # @(#) $Revision: 30.1 $ # @(#) $Id: calcerr_h.awk,v 30.1 2007/03/16 11:09:46 chongo Exp $ -# @(#) $Source: /usr/local/src/cmd/calc/RCS/calcerr_h.awk,v $ +# @(#) $Source: /usr/local/src/bin/calc/RCS/calcerr_h.awk,v $ # # Under source code control: 1996/05/23 17:38:44 # File existed as early as: 1996 diff --git a/calcerr_h.sed b/calcerr_h.sed index 2f43925..0980feb 100644 --- a/calcerr_h.sed +++ b/calcerr_h.sed @@ -20,7 +20,7 @@ # # @(#) $Revision: 30.1 $ # @(#) $Id: calcerr_h.sed,v 30.1 2007/03/16 11:09:46 chongo Exp $ -# @(#) $Source: /usr/local/src/cmd/calc/RCS/calcerr_h.sed,v $ +# @(#) $Source: /usr/local/src/bin/calc/RCS/calcerr_h.sed,v $ # # Under source code control: 1996/05/23 17:38:44 # File existed as early as: 1996 diff --git a/check.awk b/check.awk index ee98e03..f637efa 100644 --- a/check.awk +++ b/check.awk @@ -18,8 +18,8 @@ # 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.1 $ -# @(#) $Id: check.awk,v 30.1 2007/03/16 11:09:46 chongo Exp $ +# @(#) $Revision: 30.2 $ +# @(#) $Id: check.awk,v 30.2 2013/08/11 01:08:32 chongo Exp $ # @(#) $Source: /usr/local/src/cmd/calc/RCS/check.awk,v $ # # Under source code control: 1996/05/25 22:07:58 @@ -30,7 +30,7 @@ # # This awk script will print 3 lines before and after any non-blank line that # does not begin with a number. This allows the 'make debug' rule to remove -# all non-interest lines the the 'make check' regression output while providing +# all non-interest lines the 'make check' regression output while providing # 3 lines of context around unexpected output. # BEGIN { diff --git a/cmath.h b/cmath.h index 3981ec8..a2e010e 100644 --- a/cmath.h +++ b/cmath.h @@ -19,7 +19,7 @@ * * @(#) $Revision: 30.1 $ * @(#) $Id: cmath.h,v 30.1 2007/03/16 11:09:46 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/cmath.h,v $ + * @(#) $Source: /usr/local/src/bin/calc/RCS/cmath.h,v $ * * Under source code control: 1993/07/30 19:42:45 * File existed as early as: 1993 diff --git a/codegen.c b/codegen.c index 46f3c0c..685cb96 100644 --- a/codegen.c +++ b/codegen.c @@ -19,8 +19,8 @@ * 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.2 $ - * @(#) $Id: codegen.c,v 30.2 2007/07/05 13:30:38 chongo Exp $ + * @(#) $Revision: 30.3 $ + * @(#) $Id: codegen.c,v 30.3 2013/07/12 22:41:33 chongo Exp $ * @(#) $Source: /usr/local/src/cmd/calc/RCS/codegen.c,v $ * * Under source code control: 1990/02/15 01:48:13 @@ -2605,7 +2605,7 @@ definesymbol(char *name, int symtype) break; case SYM_GLOBAL: if (symtype == SYM_GLOBAL && conf->redecl_warn) { - warning("redeclaraion of global \"%s\"", + warning("redeclaration of global \"%s\"", name); return; } @@ -2613,7 +2613,7 @@ definesymbol(char *name, int symtype) case SYM_LOCAL: if (symtype == SYM_LOCAL && conf->redecl_warn) { - warning("redeclaraion of local \"%s\"", + warning("redeclaration of local \"%s\"", name); return; } diff --git a/comfunc.c b/comfunc.c index 76443ea..d43ecff 100644 --- a/comfunc.c +++ b/comfunc.c @@ -21,7 +21,7 @@ * * @(#) $Revision: 30.3 $ * @(#) $Id: comfunc.c,v 30.3 2008/10/24 07:09:41 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/comfunc.c,v $ + * @(#) $Source: /usr/local/src/bin/calc/RCS/comfunc.c,v $ * * Under source code control: 1990/02/15 01:48:13 * File existed as early as: before 1990 diff --git a/commath.c b/commath.c index e73da2b..6aadeec 100644 --- a/commath.c +++ b/commath.c @@ -19,7 +19,7 @@ * * @(#) $Revision: 30.1 $ * @(#) $Id: commath.c,v 30.1 2007/03/16 11:09:46 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/commath.c,v $ + * @(#) $Source: /usr/local/src/bin/calc/RCS/commath.c,v $ * * Under source code control: 1990/02/15 01:48:10 * File existed as early as: before 1990 diff --git a/config.c b/config.c index 8ea552b..596da37 100644 --- a/config.c +++ b/config.c @@ -21,7 +21,7 @@ * * @(#) $Revision: 30.2 $ * @(#) $Id: config.c,v 30.2 2007/07/05 13:30:38 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/config.c,v $ + * @(#) $Source: /usr/local/src/bin/calc/RCS/config.c,v $ * * Under source code control: 1991/07/20 00:21:56 * File existed as early as: 1991 diff --git a/config.h b/config.h index f8b280e..a431973 100644 --- a/config.h +++ b/config.h @@ -21,7 +21,7 @@ * * @(#) $Revision: 30.2 $ * @(#) $Id: config.h,v 30.2 2007/09/21 01:27:27 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/config.h,v $ + * @(#) $Source: /usr/local/src/bin/calc/RCS/config.h,v $ * * Under source code control: 1995/11/01 22:20:17 * File existed as early as: 1995 diff --git a/const.c b/const.c index de6c257..ee9f935 100644 --- a/const.c +++ b/const.c @@ -19,7 +19,7 @@ * * @(#) $Revision: 30.1 $ * @(#) $Id: const.c,v 30.1 2007/03/16 11:09:46 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/const.c,v $ + * @(#) $Source: /usr/local/src/bin/calc/RCS/const.c,v $ * * Under source code control: 1990/02/15 01:48:14 * File existed as early as: before 1990 diff --git a/cscript/4dsphere.calc b/cscript/4dsphere.calc index 3a56a19..9bfc35f 100644 --- a/cscript/4dsphere.calc +++ b/cscript/4dsphere.calc @@ -28,7 +28,7 @@ * * @(#) $Revision: 30.1 $ * @(#) $Id: 4dsphere.calc,v 30.1 2007/03/16 11:12:11 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/cscript/RCS/4dsphere.calc,v $ + * @(#) $Source: /usr/local/src/bin/calc/cscript/RCS/4dsphere.calc,v $ * * Under source code control: 2001/05/03 19:02:03 * File existed as early as: 2001 diff --git a/cscript/Makefile b/cscript/Makefile index f82afa1..633276f 100644 --- a/cscript/Makefile +++ b/cscript/Makefile @@ -19,7 +19,7 @@ # # @(#) $Revision: 30.3 $ # @(#) $Id: Makefile,v 30.3 2007/09/21 01:27:27 chongo Exp $ -# @(#) $Source: /usr/local/src/cmd/calc/cscript/RCS/Makefile,v $ +# @(#) $Source: /usr/local/src/bin/calc/cscript/RCS/Makefile,v $ # # Under source code control: 1999/11/29 11:10:26 # File existed as early as: 1999 diff --git a/cscript/README.src b/cscript/README.src index 4d4acb7..a3fec10 100644 --- a/cscript/README.src +++ b/cscript/README.src @@ -119,7 +119,7 @@ simple ## ## @(#) $Revision: 30.1 $ ## @(#) $Id: README.src,v 30.1 2007/03/16 11:12:11 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/cscript/RCS/README.src,v $ +## @(#) $Source: /usr/local/src/bin/calc/cscript/RCS/README.src,v $ ## ## Under source code control: 1999/12/17 10:23:40 ## File existed as early as: 1999 diff --git a/cscript/fproduct.calc b/cscript/fproduct.calc index a44b0d0..0e8215f 100644 --- a/cscript/fproduct.calc +++ b/cscript/fproduct.calc @@ -26,7 +26,7 @@ * * @(#) $Revision: 30.1 $ * @(#) $Id: fproduct.calc,v 30.1 2007/03/16 11:12:11 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/cscript/RCS/fproduct.calc,v $ + * @(#) $Source: /usr/local/src/bin/calc/cscript/RCS/fproduct.calc,v $ * * Under source code control: 2001/04/07 20:13:11 * File existed as early as: 2001 diff --git a/cscript/mersenne.calc b/cscript/mersenne.calc index 74490fb..6ab3eb2 100644 --- a/cscript/mersenne.calc +++ b/cscript/mersenne.calc @@ -20,7 +20,7 @@ * * @(#) $Revision: 30.1 $ * @(#) $Id: mersenne.calc,v 30.1 2007/03/16 11:12:11 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/cscript/RCS/mersenne.calc,v $ + * @(#) $Source: /usr/local/src/bin/calc/cscript/RCS/mersenne.calc,v $ * * Under source code control: 1999/11/30 00:09:01; * File existed as early as: 1999 diff --git a/cscript/piforever.calc b/cscript/piforever.calc index 9d467ed..e4cdb9e 100644 --- a/cscript/piforever.calc +++ b/cscript/piforever.calc @@ -20,7 +20,7 @@ * * @(#) $Revision: 30.1 $ * @(#) $Id: piforever.calc,v 30.1 2007/03/16 11:12:11 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/cscript/RCS/piforever.calc,v $ + * @(#) $Source: /usr/local/src/bin/calc/cscript/RCS/piforever.calc,v $ * * Under source code control: 1999/11/30 00:11:36 * File existed as early as: 1999 diff --git a/cscript/plus.calc b/cscript/plus.calc index e189b05..430f646 100644 --- a/cscript/plus.calc +++ b/cscript/plus.calc @@ -20,7 +20,7 @@ * * @(#) $Revision: 30.1 $ * @(#) $Id: plus.calc,v 30.1 2007/03/16 11:12:11 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/cscript/RCS/plus.calc,v $ + * @(#) $Source: /usr/local/src/bin/calc/cscript/RCS/plus.calc,v $ * * Under source code control: 1999/11/29 10:22:37 * File existed as early as: 1999 diff --git a/cscript/powerterm.calc b/cscript/powerterm.calc index 13b6920..28b8d31 100644 --- a/cscript/powerterm.calc +++ b/cscript/powerterm.calc @@ -26,7 +26,7 @@ * * @(#) $Revision: 30.1 $ * @(#) $Id: powerterm.calc,v 30.1 2007/03/16 11:12:11 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/cscript/RCS/powerterm.calc,v $ + * @(#) $Source: /usr/local/src/bin/calc/cscript/RCS/powerterm.calc,v $ * * Under source code control: 2001/04/24 23:49:11 * File existed as early as: 2001 diff --git a/cscript/simple.calc b/cscript/simple.calc index 557e53e..1380b19 100644 --- a/cscript/simple.calc +++ b/cscript/simple.calc @@ -20,7 +20,7 @@ * * @(#) $Revision: 30.1 $ * @(#) $Id: simple.calc,v 30.1 2007/03/16 11:12:11 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/cscript/RCS/simple.calc,v $ + * @(#) $Source: /usr/local/src/bin/calc/cscript/RCS/simple.calc,v $ * * Under source code control: 1999/11/29 10:22:37 * File existed as early as: 1999 diff --git a/cscript/square.calc b/cscript/square.calc index ea28639..a2df7ac 100644 --- a/cscript/square.calc +++ b/cscript/square.calc @@ -20,7 +20,7 @@ * * @(#) $Revision: 30.1 $ * @(#) $Id: square.calc,v 30.1 2007/03/16 11:12:11 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/cscript/RCS/square.calc,v $ + * @(#) $Source: /usr/local/src/bin/calc/cscript/RCS/square.calc,v $ * * Under source code control: 2000/12/15 06:52:01 * File existed as early as: 2000 diff --git a/custom.c b/custom.c index d3d321a..05d0af6 100644 --- a/custom.c +++ b/custom.c @@ -19,7 +19,7 @@ * * @(#) $Revision: 30.2 $ * @(#) $Id: custom.c,v 30.2 2007/09/21 01:27:27 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/custom.c,v $ + * @(#) $Source: /usr/local/src/bin/calc/RCS/custom.c,v $ * * Under source code control: 1997/03/03 04:53:08 * File existed as early as: 1997 diff --git a/custom.h b/custom.h index 411330c..be94e2b 100644 --- a/custom.h +++ b/custom.h @@ -19,7 +19,7 @@ * * @(#) $Revision: 30.3 $ * @(#) $Id: custom.h,v 30.3 2007/07/10 17:54:03 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/custom.h,v $ + * @(#) $Source: /usr/local/src/bin/calc/RCS/custom.h,v $ * * Under source code control: 1997/03/03 04:53:08 * File existed as early as: 1997 diff --git a/custom/CUSTOM_CAL b/custom/CUSTOM_CAL index 8544afe..472d10d 100644 --- a/custom/CUSTOM_CAL +++ b/custom/CUSTOM_CAL @@ -59,7 +59,7 @@ pzasusb8.cal ## ## @(#) $Revision: 30.1 $ ## @(#) $Id: CUSTOM_CAL,v 30.1 2007/03/16 11:10:04 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/custom/RCS/CUSTOM_CAL,v $ +## @(#) $Source: /usr/local/src/bin/calc/custom/RCS/CUSTOM_CAL,v $ ## ## Under source code control: 1997/03/08 20:51:32 ## File existed as early as: 1997 diff --git a/custom/HOW_TO_ADD b/custom/HOW_TO_ADD index ce804ad..db08382 100644 --- a/custom/HOW_TO_ADD +++ b/custom/HOW_TO_ADD @@ -663,7 +663,7 @@ Step 12: Contribute ## ## @(#) $Revision: 30.4 $ ## @(#) $Id: HOW_TO_ADD,v 30.4 2007/09/21 01:27:27 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/custom/RCS/HOW_TO_ADD,v $ +## @(#) $Source: /usr/local/src/bin/calc/custom/RCS/HOW_TO_ADD,v $ ## ## Under source code control: 1997/03/10 03:03:21 ## File existed as early as: 1997 diff --git a/custom/Makefile b/custom/Makefile index c65f3c0..0a58a6e 100644 --- a/custom/Makefile +++ b/custom/Makefile @@ -18,8 +18,8 @@ # 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.20 $ -# @(#) $Id: Makefile.head,v 30.20 2008/10/23 00:13:44 chongo Exp $ +# @(#) $Revision: 30.27 $ +# @(#) $Id: Makefile.head,v 30.27 2013/08/11 01:16:36 chongo Exp $ # @(#) $Source: /usr/local/src/cmd/calc/custom/RCS/Makefile.head,v $ # # Under source code control: 1997/03/09 02:28:54 @@ -366,7 +366,7 @@ EXT= # The default calc versions # -VERSION= 2.12.4.0 +VERSION= 2.12.4.9 VERS= 2.12.4 VER= 2.12 VE= 2 @@ -495,8 +495,8 @@ LDFLAGS= ${LD_DEBUG} ${ILDFLAGS} # to abort on warnings, then leave CCWERR blank. # CCMISC are misc flags given to ${CC} # -# LCC how the the C compiler is invoked on locally executed intermediate progs -# CC is how the the C compiler is invoked (with an optional Purify) +# LCC how the C compiler is invoked on locally executed intermediate progs +# CC is how the C compiler is invoked (with an optional Purify) # # Specific target overrides or modifications to default values @@ -588,7 +588,7 @@ LDCONFIG:= # DARWIN_ARCH= -arch i386 # Intel binary # DARWIN_ARCH= -arch ppc # PPC binary DARWIN_ARCH= # native binary -MACOSX_DEPLOYMENT_TARGET=10.4 +MACOSX_DEPLOYMENT_TARGET=10.8 # endif @@ -711,6 +711,40 @@ CC= ${PURIFY} ${LCC} ${CCWERR} # endif +################# +# Cygwin target # +################# + +ifeq ($(target),Cygwin) +# +BLD_TYPE= calc-static-only +# +CC_SHARE= -fPIC +DEFAULT_LIB_INSTALL_PATH= ${PWD}:/lib:/usr/lib:${LIBDIR}:/usr/local/lib +LD_SHARE= "-Wl,-rpath,${DEFAULT_LIB_INSTALL_PATH}" \ + "-Wl,-rpath-link,${DEFAULT_LIB_INSTALL_PATH}" +LIBCALC_SHLIB= -shared "-Wl,-soname,libcalc${LIB_EXT_VERSION}" +ifdef ALLOW_CUSTOM +LIBCUSTCALC_SHLIB= -shared "-Wl,-soname,libcustcalc${LIB_EXT_VERSION}" +else +LIBCUSTCALC_SHLIB= +endif +# +CC_STATIC= +LIBCALC_STATIC= +LIBCUSTCALC_STATIC= +LD_STATIC= +# +CCWARN= -Wall -W -Wno-comment +CCWERR= +CCOPT= ${DEBUG} +CCMISC= +# +LCC= gcc +CC= ${PURIFY} ${LCC} ${CCWERR} +# +endif + ####################################################### # simple target - values used to form Makefile.simple # ####################################################### diff --git a/custom/Makefile.head b/custom/Makefile.head index 2b8c2e6..73afb14 100644 --- a/custom/Makefile.head +++ b/custom/Makefile.head @@ -18,8 +18,8 @@ # 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.20 $ -# @(#) $Id: Makefile.head,v 30.20 2008/10/23 00:13:44 chongo Exp $ +# @(#) $Revision: 30.27 $ +# @(#) $Id: Makefile.head,v 30.27 2013/08/11 01:16:36 chongo Exp $ # @(#) $Source: /usr/local/src/cmd/calc/custom/RCS/Makefile.head,v $ # # Under source code control: 1997/03/09 02:28:54 @@ -366,7 +366,7 @@ EXT= # The default calc versions # -VERSION= 2.12.4.0 +VERSION= 2.12.4.9 VERS= 2.12.4 VER= 2.12 VE= 2 diff --git a/custom/Makefile.simple b/custom/Makefile.simple index 8d1efb7..305bfcd 100644 --- a/custom/Makefile.simple +++ b/custom/Makefile.simple @@ -18,8 +18,8 @@ # 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.20 $ -# @(#) $Id: Makefile.head,v 30.20 2008/10/23 00:13:44 chongo Exp $ +# @(#) $Revision: 30.27 $ +# @(#) $Id: Makefile.head,v 30.27 2013/08/11 01:16:36 chongo Exp $ # @(#) $Source: /usr/local/src/cmd/calc/custom/RCS/Makefile.head,v $ # # Under source code control: 1997/03/09 02:28:54 @@ -351,7 +351,7 @@ EXT= # The default calc versions # -VERSION= 2.12.4.0 +VERSION= 2.12.4.9 VERS= 2.12.4 VER= 2.12 VE= 2 @@ -455,8 +455,8 @@ COMMON_LDFLAGS= ${EXTRA_LDFLAGS} # to abort on warnings, then leave CCWERR blank. # CCMISC are misc flags given to ${CC} # -# LCC how the the C compiler is invoked on locally executed intermediate progs -# CC is how the the C compiler is invoked (with an optional Purify) +# LCC how the C compiler is invoked on locally executed intermediate progs +# CC is how the C compiler is invoked (with an optional Purify) # # Specific target overrides or modifications to default values diff --git a/custom/argv b/custom/argv index 8ba1a5a..2bb222d 100644 --- a/custom/argv +++ b/custom/argv @@ -58,7 +58,7 @@ SEE ALSO ## ## @(#) $Revision: 30.1 $ ## @(#) $Id: argv,v 30.1 2007/03/16 11:10:04 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/custom/RCS/argv,v $ +## @(#) $Source: /usr/local/src/bin/calc/custom/RCS/argv,v $ ## ## Under source code control: 1997/03/09 20:28:01 ## File existed as early as: 1997 diff --git a/custom/argv.cal b/custom/argv.cal index 6c526bc..45968ab 100644 --- a/custom/argv.cal +++ b/custom/argv.cal @@ -19,7 +19,7 @@ * * @(#) $Revision: 30.1 $ * @(#) $Id: argv.cal,v 30.1 2007/03/16 11:10:04 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/custom/RCS/argv.cal,v $ + * @(#) $Source: /usr/local/src/bin/calc/custom/RCS/argv.cal,v $ * * Under source code control: 1997/03/10 00:27:17 * File existed as early as: 1997 diff --git a/custom/c_argv.c b/custom/c_argv.c index 2d1b6c4..2a83cc0 100644 --- a/custom/c_argv.c +++ b/custom/c_argv.c @@ -19,7 +19,7 @@ * * @(#) $Revision: 30.1 $ * @(#) $Id: c_argv.c,v 30.1 2007/03/16 11:10:04 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/custom/RCS/c_argv.c,v $ + * @(#) $Source: /usr/local/src/bin/calc/custom/RCS/c_argv.c,v $ * * Under source code control: 1997/03/09 20:27:37 * File existed as early as: 1997 diff --git a/custom/c_devnull.c b/custom/c_devnull.c index 53a5209..ea03ea4 100644 --- a/custom/c_devnull.c +++ b/custom/c_devnull.c @@ -19,7 +19,7 @@ * * @(#) $Revision: 30.1 $ * @(#) $Id: c_devnull.c,v 30.1 2007/03/16 11:10:04 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/custom/RCS/c_devnull.c,v $ + * @(#) $Source: /usr/local/src/bin/calc/custom/RCS/c_devnull.c,v $ * * Under source code control: 1997/03/09 17:49:12 * File existed as early as: 1997 diff --git a/custom/c_help.c b/custom/c_help.c index 72a4259..6b26749 100644 --- a/custom/c_help.c +++ b/custom/c_help.c @@ -19,7 +19,7 @@ * * @(#) $Revision: 30.1 $ * @(#) $Id: c_help.c,v 30.1 2007/03/16 11:10:04 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/custom/RCS/c_help.c,v $ + * @(#) $Source: /usr/local/src/bin/calc/custom/RCS/c_help.c,v $ * * Under source code control: 1997/03/09 05:25:41 * File existed as early as: 1997 diff --git a/custom/c_pmodm127.c b/custom/c_pmodm127.c index 0946e4f..c523444 100644 --- a/custom/c_pmodm127.c +++ b/custom/c_pmodm127.c @@ -19,7 +19,7 @@ * * @(#) $Revision: 30.1 $ * @(#) $Id: c_pmodm127.c,v 30.1 2007/03/16 11:10:04 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/custom/RCS/c_pmodm127.c,v $ + * @(#) $Source: /usr/local/src/bin/calc/custom/RCS/c_pmodm127.c,v $ * * Under source code control: 2004/07/28 22:12:25 * File existed as early as: 2004 diff --git a/custom/c_pzasusb8.c b/custom/c_pzasusb8.c index 4ddd405..929cf96 100644 --- a/custom/c_pzasusb8.c +++ b/custom/c_pzasusb8.c @@ -19,7 +19,7 @@ * * @(#) $Revision: 30.1 $ * @(#) $Id: c_pzasusb8.c,v 30.1 2007/03/16 11:10:04 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/custom/RCS/c_pzasusb8.c,v $ + * @(#) $Source: /usr/local/src/bin/calc/custom/RCS/c_pzasusb8.c,v $ * * Under source code control: 1999/10/06 03:12:25 * File existed as early as: 1999 diff --git a/custom/c_register.c b/custom/c_register.c index c9b3a17..12d2f50 100644 --- a/custom/c_register.c +++ b/custom/c_register.c @@ -19,7 +19,7 @@ * * @(#) $Revision: 30.1 $ * @(#) $Id: c_register.c,v 30.1 2007/07/15 02:24:34 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/custom/RCS/c_register.c,v $ + * @(#) $Source: /usr/local/src/bin/calc/custom/RCS/c_register.c,v $ * * Under source code control: 2007/07/14 20:23:46 * File existed as early as: 2007 diff --git a/custom/c_sysinfo.c b/custom/c_sysinfo.c index 1a3b793..a3c5d5e 100644 --- a/custom/c_sysinfo.c +++ b/custom/c_sysinfo.c @@ -19,7 +19,7 @@ * * @(#) $Revision: 30.2 $ * @(#) $Id: c_sysinfo.c,v 30.2 2007/07/05 19:35:20 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/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 * File existed as early as: 1997 diff --git a/custom/custtbl.c b/custom/custtbl.c index 1a16a5e..f5e41d2 100644 --- a/custom/custtbl.c +++ b/custom/custtbl.c @@ -19,7 +19,7 @@ * * @(#) $Revision: 30.2 $ * @(#) $Id: custtbl.c,v 30.2 2007/07/05 19:35:20 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/custom/RCS/custtbl.c,v $ + * @(#) $Source: /usr/local/src/bin/calc/custom/RCS/custtbl.c,v $ * * Under source code control: 1997/03/09 02:28:54 * File existed as early as: 1997 diff --git a/custom/devnull b/custom/devnull index 9799775..015e3d9 100644 --- a/custom/devnull +++ b/custom/devnull @@ -44,7 +44,7 @@ SEE ALSO ## ## @(#) $Revision: 30.1 $ ## @(#) $Id: devnull,v 30.1 2007/03/16 11:10:04 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/custom/RCS/devnull,v $ +## @(#) $Source: /usr/local/src/bin/calc/custom/RCS/devnull,v $ ## ## Under source code control: 1997/03/09 17:49:12 ## File existed as early as: 1997 diff --git a/custom/halflen.cal b/custom/halflen.cal index 192a8c1..011213d 100644 --- a/custom/halflen.cal +++ b/custom/halflen.cal @@ -19,7 +19,7 @@ * * @(#) $Revision: 30.1 $ * @(#) $Id: halflen.cal,v 30.1 2007/03/16 11:10:04 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/custom/RCS/halflen.cal,v $ + * @(#) $Source: /usr/local/src/bin/calc/custom/RCS/halflen.cal,v $ * * Under source code control: 1997/03/08 20:51:32 * File existed as early as: 1997 diff --git a/custom/help b/custom/help index b2da22a..516bec8 100644 --- a/custom/help +++ b/custom/help @@ -45,7 +45,7 @@ SEE ALSO ## ## @(#) $Revision: 30.1 $ ## @(#) $Id: help,v 30.1 2007/03/16 11:10:04 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/custom/RCS/help,v $ +## @(#) $Source: /usr/local/src/bin/calc/custom/RCS/help,v $ ## ## Under source code control: 1997/03/09 06:03:58 ## File existed as early as: 1997 diff --git a/custom/pmodm127 b/custom/pmodm127 index 2b6d947..b8fa9a8 100644 --- a/custom/pmodm127 +++ b/custom/pmodm127 @@ -69,7 +69,7 @@ SEE ALSO ## ## @(#) $Revision: 30.1 $ ## @(#) $Id: pmodm127,v 30.1 2007/03/16 11:10:04 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/custom/RCS/pmodm127,v $ +## @(#) $Source: /usr/local/src/bin/calc/custom/RCS/pmodm127,v $ ## ## Under source code control: 2004/02/25 07:13:15 ## File existed as early as: 2004 diff --git a/custom/pmodm127.cal b/custom/pmodm127.cal index 512c579..7686cc6 100644 --- a/custom/pmodm127.cal +++ b/custom/pmodm127.cal @@ -19,7 +19,7 @@ * * @(#) $Revision: 30.1 $ * @(#) $Id: pmodm127.cal,v 30.1 2007/03/16 11:10:04 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/custom/RCS/pmodm127.cal,v $ + * @(#) $Source: /usr/local/src/bin/calc/custom/RCS/pmodm127.cal,v $ * * Under source code control: 2004/02/25 14:25:32 * File existed as early as: 2004 diff --git a/custom/pzasusb8 b/custom/pzasusb8 index 917f1d7..1dfe7aa 100644 --- a/custom/pzasusb8 +++ b/custom/pzasusb8 @@ -67,7 +67,7 @@ SEE ALSO ## ## @(#) $Revision: 30.1 $ ## @(#) $Id: pzasusb8,v 30.1 2007/03/16 11:10:04 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/custom/RCS/pzasusb8,v $ +## @(#) $Source: /usr/local/src/bin/calc/custom/RCS/pzasusb8,v $ ## ## Under source code control: 1999/10/06 04:05:43 ## File existed as early as: 1999 diff --git a/custom/pzasusb8.cal b/custom/pzasusb8.cal index 7e52319..8f30969 100644 --- a/custom/pzasusb8.cal +++ b/custom/pzasusb8.cal @@ -21,7 +21,7 @@ * * @(#) $Revision: 30.1 $ * @(#) $Id: pzasusb8.cal,v 30.1 2007/03/16 11:10:04 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/custom/RCS/pzasusb8.cal,v $ + * @(#) $Source: /usr/local/src/bin/calc/custom/RCS/pzasusb8.cal,v $ * * Under source code control: 1999/10/06 03:11:12 * File existed as early as: 1998 diff --git a/custom/register b/custom/register index e74e91e..e686e6c 100644 --- a/custom/register +++ b/custom/register @@ -73,7 +73,7 @@ SEE ALSO ## ## @(#) $Revision: 29.2 $ ## @(#) $Id: register,v 29.2 2007/07/05 19:35:20 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/custom/RCS/register,v $ +## @(#) $Source: /usr/local/src/bin/calc/custom/RCS/register,v $ ## ## Under source code control: 2005/02/04 22:39:50 ## File existed as early as: 2005 diff --git a/custom/register.cal b/custom/register.cal index b806d0d..ed60cbe 100644 --- a/custom/register.cal +++ b/custom/register.cal @@ -19,7 +19,7 @@ * * @(#) $Revision: 30.1 $ * @(#) $Id: register.cal,v 30.1 2007/07/05 19:35:54 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/custom/RCS/register.cal,v $ + * @(#) $Source: /usr/local/src/bin/calc/custom/RCS/register.cal,v $ * * Under source code control: 2007/07/05 11:11:11 * File existed as early as: 2007 diff --git a/custom/sysinfo b/custom/sysinfo index 4b4d23e..2d09e11 100644 --- a/custom/sysinfo +++ b/custom/sysinfo @@ -71,7 +71,7 @@ SEE ALSO ## ## @(#) $Revision: 30.1 $ ## @(#) $Id: sysinfo,v 30.1 2007/03/16 11:10:04 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/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 ## File existed as early as: 1997 diff --git a/decl.h b/decl.h index acb7bf1..cc70e44 100644 --- a/decl.h +++ b/decl.h @@ -21,7 +21,7 @@ * * @(#) $Revision: 30.3 $ * @(#) $Id: decl.h,v 30.3 2008/04/15 21:17:57 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/decl.h,v $ + * @(#) $Source: /usr/local/src/bin/calc/RCS/decl.h,v $ * * Under source code control: 2007/02/09 05:24:25 * File existed as early as: 2007 diff --git a/endian.c b/endian.c index 5ea95ce..358e270 100644 --- a/endian.c +++ b/endian.c @@ -1,7 +1,7 @@ /* * endian - determine the byte order of a long on your machine * - * Copyright (C) 1999 Landon Curt Noll + * Copyright (C) 1999-2013 Landon Curt Noll * * Calc is open software; you can redistribute it and/or modify it under * the terms of the version 2.1 of the GNU Lesser General Public License @@ -17,9 +17,9 @@ * 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.2 $ - * @(#) $Id: endian.c,v 30.2 2007/09/29 16:56:40 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/endian.c,v $ + * @(#) $Revision: 30.4 $ + * @(#) $Id: endian.c,v 30.4 2013/05/05 13:57:08 chongo Exp $ + * @(#) $Source: /usr/local/src/bin/calc/RCS/endian.c,v $ * * Under source code control: 1993/11/15 04:32:58 * File existed as early as: 1993 @@ -54,7 +54,9 @@ int main(void) { /* pointers into the byte order array */ +#if defined(DEBUG) || (!defined(BIG_ENDIAN) && !defined(BIG_ENDIAN)) int *intp = (int *)byte; +#endif #if defined(DEBUG) short *shortp = (short *)byte; long *longp = (long *)byte; @@ -77,9 +79,9 @@ main(void) printf("#define LITTLE_ENDIAN\t1234\n"); printf("#undef CALC_BYTE_ORDER\n"); -#if defined(CALC_BIG_ENDIAN) +#if defined(BIG_ENDIAN) printf("#define CALC_BYTE_ORDER\tBIG_ENDIAN\n"); -#elif defined(CALC_LITTLE_ENDIAN) +#elif defined(LITTLE_ENDIAN) printf("#define CALC_BYTE_ORDER\tLITTLW_ENDIAN\n"); #else /* Determine byte order */ @@ -93,8 +95,8 @@ main(void) fprintf(stderr, "@=-=@ Fatal build error - cannot @=-=@\n"); fprintf(stderr, "@=-=@ determine byte order. Set @=-=@\n"); fprintf(stderr, "@=-=@ ${CALC_BYTE_ORDER} in the Makefile @=-=@\n"); - fprintf(stderr, "@=-=@ to be either -DCALC_BIG_ENDIAN or @=-=@\n"); - fprintf(stderr, "@=-=@ to be -DCALC_LITTLE_ENDIAN @=-=@\n"); + fprintf(stderr, "@=-=@ to be either -DBIG_ENDIAN or @=-=@\n"); + fprintf(stderr, "@=-=@ to be -DLITTLE_ENDIAN @=-=@\n"); exit(1); } #endif diff --git a/file.c b/file.c index f2c3499..10b8e1f 100644 --- a/file.c +++ b/file.c @@ -21,7 +21,7 @@ * * @(#) $Revision: 30.2 $ * @(#) $Id: file.c,v 30.2 2007/07/05 13:30:38 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/file.c,v $ + * @(#) $Source: /usr/local/src/bin/calc/RCS/file.c,v $ * * Under source code control: 1991/07/20 00:21:56 * File existed as early as: 1991 diff --git a/file.h b/file.h index 22392c3..8d441af 100644 --- a/file.h +++ b/file.h @@ -21,7 +21,7 @@ * * @(#) $Revision: 30.1 $ * @(#) $Id: file.h,v 30.1 2007/03/16 11:09:46 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/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 * File existed as early as: 1996 diff --git a/fposval.c b/fposval.c index 3d7b301..62e5da8 100644 --- a/fposval.c +++ b/fposval.c @@ -19,7 +19,7 @@ * * @(#) $Revision: 30.2 $ * @(#) $Id: fposval.c,v 30.2 2007/09/19 22:34:22 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/fposval.c,v $ + * @(#) $Source: /usr/local/src/bin/calc/RCS/fposval.c,v $ * * Under source code control: 1994/11/05 03:19:52 * File existed as early as: 1994 diff --git a/func.c b/func.c index 8fa1e8c..c197896 100644 --- a/func.c +++ b/func.c @@ -21,7 +21,7 @@ * * @(#) $Revision: 30.3 $ * @(#) $Id: func.c,v 30.3 2008/04/15 21:17:57 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/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 * File existed as early as: before 1990 diff --git a/func.h b/func.h index e57ea35..7e11a62 100644 --- a/func.h +++ b/func.h @@ -19,7 +19,7 @@ * * @(#) $Revision: 30.1 $ * @(#) $Id: func.h,v 30.1 2007/03/16 11:09:46 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/func.h,v $ + * @(#) $Source: /usr/local/src/bin/calc/RCS/func.h,v $ * * Under source code control: 1990/02/15 01:48:33 * File existed as early as: before 1990 diff --git a/hash.c b/hash.c index a155a9c..f5141a1 100644 --- a/hash.c +++ b/hash.c @@ -19,7 +19,7 @@ * * @(#) $Revision: 30.2 $ * @(#) $Id: hash.c,v 30.2 2007/07/05 17:37:41 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/hash.c,v $ + * @(#) $Source: /usr/local/src/bin/calc/RCS/hash.c,v $ * * Under source code control: 1995/11/23 05:13:11 * File existed as early as: 1995 diff --git a/hash.h b/hash.h index 175179b..552ea6c 100644 --- a/hash.h +++ b/hash.h @@ -19,7 +19,7 @@ * * @(#) $Revision: 30.2 $ * @(#) $Id: hash.h,v 30.2 2007/07/05 17:37:41 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/hash.h,v $ + * @(#) $Source: /usr/local/src/bin/calc/RCS/hash.h,v $ * * Under source code control: 1995/11/14 23:57:45 * File existed as early as: 1995 diff --git a/have_const.c b/have_const.c index 3ff60a5..ff27507 100644 --- a/have_const.c +++ b/have_const.c @@ -19,7 +19,7 @@ * * @(#) $Revision: 30.1 $ * @(#) $Id: have_const.c,v 30.1 2007/03/16 11:09:46 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/have_const.c,v $ + * @(#) $Source: /usr/local/src/bin/calc/RCS/have_const.c,v $ * * Under source code control: 1995/04/22 13:18:44 * File existed as early as: 1995 diff --git a/have_fpos.c b/have_fpos.c index 77da011..1762e42 100644 --- a/have_fpos.c +++ b/have_fpos.c @@ -19,7 +19,7 @@ * * @(#) $Revision: 30.1 $ * @(#) $Id: have_fpos.c,v 30.1 2007/03/16 11:09:46 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/have_fpos.c,v $ + * @(#) $Source: /usr/local/src/bin/calc/RCS/have_fpos.c,v $ * * Under source code control: 1994/11/05 03:19:52 * File existed as early as: 1994 diff --git a/have_fpos_pos.c b/have_fpos_pos.c index c33abc9..94da77e 100644 --- a/have_fpos_pos.c +++ b/have_fpos_pos.c @@ -19,7 +19,7 @@ * * @(#) $Revision: 30.2 $ * @(#) $Id: have_fpos_pos.c,v 30.2 2007/09/19 22:34:22 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/have_fpos_pos.c,v $ + * @(#) $Source: /usr/local/src/bin/calc/RCS/have_fpos_pos.c,v $ * * Under source code control: 2000/12/17 01:23 * File existed as early as: 2000 diff --git a/have_getpgid.c b/have_getpgid.c index db4354e..fe76a0f 100644 --- a/have_getpgid.c +++ b/have_getpgid.c @@ -19,7 +19,7 @@ * * @(#) $Revision: 30.1 $ * @(#) $Id: have_getpgid.c,v 30.1 2007/03/16 11:09:46 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/have_getpgid.c,v $ + * @(#) $Source: /usr/local/src/bin/calc/RCS/have_getpgid.c,v $ * * Under source code control: 1999/10/20 22:51:13 * File existed as early as: 1999 diff --git a/have_getprid.c b/have_getprid.c index 83725b3..e93b12c 100644 --- a/have_getprid.c +++ b/have_getprid.c @@ -19,7 +19,7 @@ * * @(#) $Revision: 30.1 $ * @(#) $Id: have_getprid.c,v 30.1 2007/03/16 11:09:46 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/have_getprid.c,v $ + * @(#) $Source: /usr/local/src/bin/calc/RCS/have_getprid.c,v $ * * Under source code control: 1999/10/20 23:43:42 * File existed as early as: 1999 diff --git a/have_getsid.c b/have_getsid.c index 2b067d0..815884f 100644 --- a/have_getsid.c +++ b/have_getsid.c @@ -19,7 +19,7 @@ * * @(#) $Revision: 30.1 $ * @(#) $Id: have_getsid.c,v 30.1 2007/03/16 11:09:46 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/have_getsid.c,v $ + * @(#) $Source: /usr/local/src/bin/calc/RCS/have_getsid.c,v $ * * Under source code control: 1999/10/20 22:51:13 * File existed as early as: 1999 diff --git a/have_gettime.c b/have_gettime.c index 225ca8f..28acb29 100644 --- a/have_gettime.c +++ b/have_gettime.c @@ -19,7 +19,7 @@ * * @(#) $Revision: 30.1 $ * @(#) $Id: have_gettime.c,v 30.1 2007/03/16 11:09:46 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/have_gettime.c,v $ + * @(#) $Source: /usr/local/src/bin/calc/RCS/have_gettime.c,v $ * * Under source code control: 1999/10/20 23:43:42 * File existed as early as: 1999 diff --git a/have_memmv.c b/have_memmv.c index 5ccfbc4..e04fefd 100644 --- a/have_memmv.c +++ b/have_memmv.c @@ -19,7 +19,7 @@ * * @(#) $Revision: 30.1 $ * @(#) $Id: have_memmv.c,v 30.1 2007/03/16 11:09:46 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/have_memmv.c,v $ + * @(#) $Source: /usr/local/src/bin/calc/RCS/have_memmv.c,v $ * * Under source code control: 1997/04/16 02:02:34 * File existed as early as: 1997 diff --git a/have_newstr.c b/have_newstr.c index c3c6bd7..24d2b14 100644 --- a/have_newstr.c +++ b/have_newstr.c @@ -19,7 +19,7 @@ * * @(#) $Revision: 30.1 $ * @(#) $Id: have_newstr.c,v 30.1 2007/03/16 11:09:46 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/have_newstr.c,v $ + * @(#) $Source: /usr/local/src/bin/calc/RCS/have_newstr.c,v $ * * Under source code control: 1995/05/02 03:55:08 * File existed as early as: 1995 diff --git a/have_offscl.c b/have_offscl.c index 01b16b4..3e48db0 100644 --- a/have_offscl.c +++ b/have_offscl.c @@ -19,7 +19,7 @@ * * @(#) $Revision: 30.2 $ * @(#) $Id: have_offscl.c,v 30.2 2008/04/15 21:17:57 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/have_offscl.c,v $ + * @(#) $Source: /usr/local/src/bin/calc/RCS/have_offscl.c,v $ * * Under source code control: 1996/07/13 12:57:22 * File existed as early as: 1996 diff --git a/have_posscl.c b/have_posscl.c index 2bd97d8..9c9fc68 100644 --- a/have_posscl.c +++ b/have_posscl.c @@ -19,7 +19,7 @@ * * @(#) $Revision: 30.2 $ * @(#) $Id: have_posscl.c,v 30.2 2008/04/15 21:17:57 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/have_posscl.c,v $ + * @(#) $Source: /usr/local/src/bin/calc/RCS/have_posscl.c,v $ * * Under source code control: 1996/07/13 12:57:22 * File existed as early as: 1996 diff --git a/have_rusage.c b/have_rusage.c index 0051c31..cc55464 100644 --- a/have_rusage.c +++ b/have_rusage.c @@ -19,7 +19,7 @@ * * @(#) $Revision: 30.1 $ * @(#) $Id: have_rusage.c,v 30.1 2007/03/16 11:09:46 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/have_rusage.c,v $ + * @(#) $Source: /usr/local/src/bin/calc/RCS/have_rusage.c,v $ * * Under source code control: 1999/11/05 11:28:15 * File existed as early as: 1999 diff --git a/have_stdvs.c b/have_stdvs.c index dc0803c..89608d4 100644 --- a/have_stdvs.c +++ b/have_stdvs.c @@ -19,7 +19,7 @@ * * @(#) $Revision: 30.1 $ * @(#) $Id: have_stdvs.c,v 30.1 2007/03/16 11:09:46 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/have_stdvs.c,v $ + * @(#) $Source: /usr/local/src/bin/calc/RCS/have_stdvs.c,v $ * * Under source code control: 1995/09/09 22:41:10 * File existed as early as: 1995 diff --git a/have_strdup.c b/have_strdup.c index 415d7f3..a3f574e 100644 --- a/have_strdup.c +++ b/have_strdup.c @@ -19,7 +19,7 @@ * * @(#) $Revision: 30.1 $ * @(#) $Id: have_strdup.c,v 30.1 2007/03/16 11:09:46 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/have_strdup.c,v $ + * @(#) $Source: /usr/local/src/bin/calc/RCS/have_strdup.c,v $ * * Under source code control: 1999/11/09 12:46:54 * File existed as early as: 1999 diff --git a/have_uid_t.c b/have_uid_t.c index 8d591e8..431b983 100644 --- a/have_uid_t.c +++ b/have_uid_t.c @@ -19,7 +19,7 @@ * * @(#) $Revision: 30.1 $ * @(#) $Id: have_uid_t.c,v 30.1 2007/03/16 11:09:46 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/have_uid_t.c,v $ + * @(#) $Source: /usr/local/src/bin/calc/RCS/have_uid_t.c,v $ * * Under source code control: 1995/05/02 03:03:24 * File existed as early as: 1995 diff --git a/have_unused.c b/have_unused.c index 51b68ae..7ea09d5 100644 --- a/have_unused.c +++ b/have_unused.c @@ -19,7 +19,7 @@ * * @(#) $Revision: 30.1 $ * @(#) $Id: have_unused.c,v 30.1 2007/03/16 11:09:46 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/have_unused.c,v $ + * @(#) $Source: /usr/local/src/bin/calc/RCS/have_unused.c,v $ * * Under source code control: 2004/02/22 22:36:10 * File existed as early as: 2004 diff --git a/have_ustat.c b/have_ustat.c index f7d5802..7e2f5b2 100644 --- a/have_ustat.c +++ b/have_ustat.c @@ -19,7 +19,7 @@ * * @(#) $Revision: 30.1 $ * @(#) $Id: have_ustat.c,v 30.1 2007/03/16 11:09:46 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/have_ustat.c,v $ + * @(#) $Source: /usr/local/src/bin/calc/RCS/have_ustat.c,v $ * * Under source code control: 1999/10/20 22:51:13 * File existed as early as: 1999 diff --git a/have_varvs.c b/have_varvs.c index 389d826..44f3d4b 100644 --- a/have_varvs.c +++ b/have_varvs.c @@ -19,7 +19,7 @@ * * @(#) $Revision: 30.1 $ * @(#) $Id: have_varvs.c,v 30.1 2007/03/16 11:09:46 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/have_varvs.c,v $ + * @(#) $Source: /usr/local/src/bin/calc/RCS/have_varvs.c,v $ * * Under source code control: 1995/09/09 22:41:10 * File existed as early as: 1995 diff --git a/help.c b/help.c index c50b221..c6241c2 100644 --- a/help.c +++ b/help.c @@ -17,8 +17,8 @@ * 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.2 $ - * @(#) $Id: help.c,v 30.2 2007/09/21 01:27:27 chongo Exp $ + * @(#) $Revision: 30.3 $ + * @(#) $Id: help.c,v 30.3 2013/08/11 01:08:32 chongo Exp $ * @(#) $Source: /usr/local/src/cmd/calc/RCS/help.c,v $ * * Under source code control: 1997/09/14 10:58:30 @@ -274,7 +274,7 @@ givehelp(char *type) #if defined(CUSTOM) /* - * open the the helpfile (looking in CUSTOMHELPDIR last) + * open the helpfile (looking in CUSTOMHELPDIR last) */ } else { diff --git a/help/archive b/help/archive index b7ef2cf..dc6751a 100644 --- a/help/archive +++ b/help/archive @@ -1,4 +1,4 @@ -Where to get the the latest versions of calc +Where to get the latest versions of calc Landon Noll maintains the official calc home page at: @@ -31,8 +31,8 @@ chongo /\../\ ## 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.1 $ -## @(#) $Id: archive,v 30.1 2007/03/16 11:10:42 chongo Exp $ +## @(#) $Revision: 30.2 $ +## @(#) $Id: archive,v 30.2 2013/08/11 01:08:32 chongo Exp $ ## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/archive,v $ ## ## Under source code control: 1996/06/13 02:51:48 diff --git a/help/blkcpy b/help/blkcpy index 33b6f46..d1e4bf1 100644 --- a/help/blkcpy +++ b/help/blkcpy @@ -86,7 +86,7 @@ DESCRIPTION ; blkcpy(L, M); For copying from a block B (named or unnamed), the total number of octets - available for copying is taken to the the datalen for that block, + available for copying is taken to the datalen for that block, so that num can be at most size(B) - ssi. For copying to a block B (named or unnamed), reallocation will be @@ -206,8 +206,8 @@ SEE ALSO ## 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.1 $ -## @(#) $Id: blkcpy,v 30.1 2007/03/16 11:10:42 chongo Exp $ +## @(#) $Revision: 30.2 $ +## @(#) $Id: blkcpy,v 30.2 2013/08/11 01:08:32 chongo Exp $ ## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/blkcpy,v $ ## ## Under source code control: 1997/04/05 14:08:50 diff --git a/help/fgetc b/help/fgetc index 730c81e..9f94082 100644 --- a/help/fgetc +++ b/help/fgetc @@ -50,9 +50,8 @@ SEE ALSO ## 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.1 $ -## @(#) $Id: fgetc,v 30.1 2007/03/16 11:10:42 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/fgetc,v $ +## @(#) $Revision: 30.2 $ +## @(#) $Id: fgetc,v 30.2 2013/03/27 06:08:56 root Exp $ ## ## Under source code control: 1995/03/04 11:33:19 ## File existed as early as: 1995 diff --git a/help/obj.file b/help/obj.file index 283a30f..ca91735 100644 --- a/help/obj.file +++ b/help/obj.file @@ -128,58 +128,72 @@ Using objects The following is a list of the operations possible for objects. The 'xx' in each function name is replaced with the actual object - type name. This table is displayed by the 'show objfuncs' command. + type name. This table is displayed by the 'show objfunctions' command. Name Args Comments - xx_print 1 print value, default prints elements - xx_one 1 multiplicative identity, default is 1 - xx_test 1 logical test (false,true => 0,1), - default tests elements - xx_add 2 - xx_sub 2 subtraction, default adds negative - xx_neg 1 negative - xx_mul 2 - xx_div 2 non-integral division, default multiplies - by inverse - xx_inv 1 multiplicative inverse - xx_abs 2 absolute value within given error - xx_norm 1 square of absolute value - xx_conj 1 conjugate - xx_pow 2 integer power, default does multiply, - square, inverse - xx_sgn 1 sign of value (-1, 0, 1) - xx_cmp 2 equality (equal,non-equal => 0,1), - default tests elements - xx_rel 2 inequality (less,equal,greater => -1,0,1) - xx_quo 2 integer quotient - xx_mod 2 remainder of division - xx_int 1 integer part - xx_frac 1 fractional part - xx_inc 1 increment, default adds 1 - xx_dec 1 decrement, default subtracts 1 - xx_square 1 default multiplies by itself - xx_scale 2 multiply by power of 2 - xx_shift 2 shift left by n bits (right if negative) - xx_round 2 round to given number of decimal places - xx_bround 2 round to given number of binary places - xx_root 3 root of value within given error - xx_sqrt 2 square root within given error - xx_or 2 boolean or - xx_and 2 boolean and - xx_not 1 boolean not - xx_fact 1 factorial - + xx_print 1 print value, default prints elements + xx_one 1 multiplicative identity, default is 1 + xx_test 1 logical test (false,true => 0,1), default tests elements + xx_add 2 + xx_sub 2 + xx_neg 1 negative + xx_mul 2 + xx_div 2 non-integral division + xx_inv 1 multiplicative inverse + xx_abs 2 absolute value within given error + xx_norm 1 square of absolute value + xx_conj 1 conjugate + xx_pow 2 integer power, default does multiply, square, inverse + xx_sgn 1 sign of value (-1, 0, 1) + xx_cmp 2 equality (equal,nonequal => 0,1), default tests elements + xx_rel 2 relative order, positive for >, etc. + xx_quo 3 integer quotient + xx_mod 3 remainder of division + xx_int 1 integer part + xx_frac 1 fractional part + xx_inc 1 increment, default adds 1 + xx_dec 1 decrement, default subtracts 1 + xx_square 1 default multiplies by itself + xx_scale 2 multiply by power of 2 + xx_shift 2 shift left by n bits (right if negative) + xx_round 3 round to given number of decimal places + xx_bround 3 round to given number of binary places + xx_root 3 root of value within given error + xx_sqrt 3 square root within given error + xx_or 2 bitwise or + xx_and 2 bitwise and + xx_not 1 logical not + xx_fact 1 factorial or postfix ! + xx_min 1 value for min(...) + xx_max 1 value for max(...) + xx_sum 1 value for sum(...) + xx_assign 2 assign, defaults to a = b + xx_xor 2 value for binary ~ + xx_comp 1 value for unary ~ + xx_content 1 unary hash op + xx_hashop 2 binary hash op + xx_backslash 1 unary backslash op + xx_setminus 2 binary backslash op + xx_plus 1 unary + op Also see the standard resource files: + deg.cal dms.cal + ellip.cal + hms.cal mod.cal + natnumset.cal poly.cal quat.cal + regress.cal + set8700.cal surd.cal + test2300.cal + test3100.cal -## Copyright (C) 1999 Landon Curt Noll +## Copyright (C) 1999,2010 Landon Curt Noll ## ## Calc is open software; you can redistribute it and/or modify it under ## the terms of the version 2.1 of the GNU Lesser General Public License @@ -195,8 +209,8 @@ Using objects ## 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.1 $ -## @(#) $Id: obj.file,v 30.1 2007/03/16 11:10:42 chongo Exp $ +## @(#) $Revision: 30.3 $ +## @(#) $Id: obj.file,v 30.3 2010/09/02 06:36:21 chongo Exp $ ## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/obj.file,v $ ## ## Under source code control: 1991/07/21 04:37:22 diff --git a/help/srandom b/help/srandom index 1190b39..03fbf00 100644 --- a/help/srandom +++ b/help/srandom @@ -264,7 +264,7 @@ DESCRIPTION to having their Blum moduli factored, depending in their size, by small PCs in a reasonable to large supercomputers/highly parallel processors over a long time. Their value lies in their - speed relative the the default Blum generator. As of Feb 1997, + speed relative the default Blum generator. As of Feb 1997, the Blum moduli associated with 13 <= newn < 20 appear to be well beyond the scope of hardware and algorithms, and 9 <= newn < 12 might be factorable with extreme difficulty. @@ -354,8 +354,8 @@ SEE ALSO ## 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.1 $ -## @(#) $Id: srandom,v 30.1 2007/03/16 11:10:42 chongo Exp $ +## @(#) $Revision: 30.2 $ +## @(#) $Id: srandom,v 30.2 2013/08/11 01:08:32 chongo Exp $ ## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/srandom,v $ ## ## Under source code control: 1997/02/17 01:18:22 diff --git a/help/strcmp b/help/strcmp index 4b1c6ad..93dea81 100644 --- a/help/strcmp +++ b/help/strcmp @@ -1,66 +1,66 @@ -NAME - strcmp - compare two strings in the customary ordering of strings - -SYNOPSIS - strcmp(s1, s2) - -TYPES - s1 string - s2 string - - return integer (1, 0 or -1) - -DESCRIPTION - Let n1 = size(s1), n2 = size(s2) and m = min(n1, n2). - This function compares up to m values of consecutive characters - in the strings s1 and s2. If an inequality is encountered, the - function returns 1 or -1 according as the greater character is - in s1 or s2. If there has been no inequality, the function - returns 1, 0, or -1 according as n1 is greater than, equal to, - or less than n2. - Note that null characters within the strings are included in the - comparison. - -EXAMPLE - strcmp("ab", "abc") == -1 - strcmp("abc", "abb") == 1 - strcmp("abc", "abc") == 0 - strcmp("abc", "abd") == -1 - strcmp("abc\0", "abc") == 1 - strcmp("a\0b", "a\0c") == -1 - -LIMITS - none - -LINK LIBRARY - FLAG stringrel(STRING *s1, STRING *s2) - -SEE ALSO - strcat, strcpy, strerror, strlen, strncmp, strncpy, strpos, - strprintf, strscan, strscanf, substr - -## Copyright (C) 2006 Ernest Bowen -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 30.1 $ -## @(#) $Id: strcmp,v 30.1 2007/03/16 11:10:42 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/strcmp,v $ -## -## Under source code control: 2006/03/03 03:32:44 -## File existed as early as: 2006 -## -## chongo /\oo/\ http://www.isthe.com/chongo/ -## Share and enjoy! :-) http://www.isthe.com/chongo/tech/comp/calc/ +NAME + strcmp - compare two strings in the customary ordering of strings + +SYNOPSIS + strcmp(s1, s2) + +TYPES + s1 string + s2 string + + return integer (1, 0 or -1) + +DESCRIPTION + Let n1 = size(s1), n2 = size(s2) and m = min(n1, n2). + This function compares up to m values of consecutive characters + in the strings s1 and s2. If an inequality is encountered, the + function returns 1 or -1 according as the greater character is + in s1 or s2. If there has been no inequality, the function + returns 1, 0, or -1 according as n1 is greater than, equal to, + or less than n2. + Note that null characters within the strings are included in the + comparison. + +EXAMPLE + strcmp("ab", "abc") == -1 + strcmp("abc", "abb") == 1 + strcmp("abc", "abc") == 0 + strcmp("abc", "abd") == -1 + strcmp("abc\0", "abc") == 1 + strcmp("a\0b", "a\0c") == -1 + +LIMITS + none + +LINK LIBRARY + FLAG stringrel(STRING *s1, STRING *s2) + +SEE ALSO + strcat, strcpy, strerror, strlen, strncmp, strncpy, strpos, + strprintf, strscan, strscanf, substr + +## Copyright (C) 2006 Ernest Bowen +## +## Calc is open software; you can redistribute it and/or modify it under +## the terms of the version 2.1 of the GNU Lesser General Public License +## as published by the Free Software Foundation. +## +## Calc is distributed in the hope that it will be useful, but WITHOUT +## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General +## Public License for more details. +## +## A copy of version 2.1 of the GNU Lesser General Public License is +## distributed with calc under the filename COPYING-LGPL. You should have +## received a copy with calc; if not, write to Free Software Foundation, Inc. +## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. +## +## @(#) $Revision: 30.3 $ +## @(#) $Id: strcmp,v 30.3 2013/08/11 01:16:03 chongo Exp $ +## @(#) $Source: /usr/local/src/bin/calc/help/RCS/strcmp,v $ +## +## Under source code control: 2006/03/03 03:32:44 +## File existed as early as: 2006 +## +## chongo /\oo/\ http://www.isthe.com/chongo/ +## Share and enjoy! :-) http://www.isthe.com/chongo/tech/comp/calc/ diff --git a/help/strcpy b/help/strcpy index 9b8926d..58e911c 100644 --- a/help/strcpy +++ b/help/strcpy @@ -1,68 +1,68 @@ -NAME - strcpy - copy head or all of a string to head or all of a string - -SYNOPSIS - strcpy(s1, s2) - -TYPES - s1 string - s2 string - - return string - -DESCRIPTION - Let n1 = size(s1), n2 = size(n2), and m = min(n1, n2). - This function replaces the first m characters of s1 by the first - m characters of s2, and if m < n1, replaces the next character of - s1 by '\0'. The size of s1 and any later characters of s1 are unchanged. - s1, with its new value, is returned. - Unlike the C Library function with the same name, this function does - not require n1 to be greater than or equal to n2, but if this is so, - normal printing of the returned value will give the same result as - normal printing of s2. - -EXAMPLE - strcpy("", "xyz") == "" - strcpy("a", "xyz") == "x" - strcpy("ab", "xyz") == "xy" - strcpy("abc", "xyz") == "xyz" - strcpy("abcd", "xyz") == "xyz\0" - strcpy("abcde", "xyz") == "xyz\0e" - strcpy("abcdef", "xyz") == "xyz\0ef" - strcpy("abc", "") == "\0bc" - -LIMITS - none - -LINK LIBRARY - STRING* stringcpy(STRING *s1, STRING *s2) - -SEE ALSO - strcat, strcpy, strerror, strlen, strncmp, strncpy, strpos, - strprintf, strscan, strscanf, substr - -## Copyright (C) 2006 Ernest Bowen -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 30.1 $ -## @(#) $Id: strcpy,v 30.1 2007/03/16 11:10:42 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/strcpy,v $ -## -## Under source code control: 2006/03/03 03:32:44 -## File existed as early as: 2006 -## -## chongo /\oo/\ http://www.isthe.com/chongo/ -## Share and enjoy! :-) http://www.isthe.com/chongo/tech/comp/calc/ +NAME + strcpy - copy head or all of a string to head or all of a string + +SYNOPSIS + strcpy(s1, s2) + +TYPES + s1 string + s2 string + + return string + +DESCRIPTION + Let n1 = size(s1), n2 = size(n2), and m = min(n1, n2). + This function replaces the first m characters of s1 by the first + m characters of s2, and if m < n1, replaces the next character of + s1 by '\0'. The size of s1 and any later characters of s1 are unchanged. + s1, with its new value, is returned. + Unlike the C Library function with the same name, this function does + not require n1 to be greater than or equal to n2, but if this is so, + normal printing of the returned value will give the same result as + normal printing of s2. + +EXAMPLE + strcpy("", "xyz") == "" + strcpy("a", "xyz") == "x" + strcpy("ab", "xyz") == "xy" + strcpy("abc", "xyz") == "xyz" + strcpy("abcd", "xyz") == "xyz\0" + strcpy("abcde", "xyz") == "xyz\0e" + strcpy("abcdef", "xyz") == "xyz\0ef" + strcpy("abc", "") == "\0bc" + +LIMITS + none + +LINK LIBRARY + STRING* stringcpy(STRING *s1, STRING *s2) + +SEE ALSO + strcat, strcpy, strerror, strlen, strncmp, strncpy, strpos, + strprintf, strscan, strscanf, substr + +## Copyright (C) 2006 Ernest Bowen +## +## Calc is open software; you can redistribute it and/or modify it under +## the terms of the version 2.1 of the GNU Lesser General Public License +## as published by the Free Software Foundation. +## +## Calc is distributed in the hope that it will be useful, but WITHOUT +## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General +## Public License for more details. +## +## A copy of version 2.1 of the GNU Lesser General Public License is +## distributed with calc under the filename COPYING-LGPL. You should have +## received a copy with calc; if not, write to Free Software Foundation, Inc. +## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. +## +## @(#) $Revision: 30.3 $ +## @(#) $Id: strcpy,v 30.3 2013/08/11 01:16:03 chongo Exp $ +## @(#) $Source: /usr/local/src/bin/calc/help/RCS/strcpy,v $ +## +## Under source code control: 2006/03/03 03:32:44 +## File existed as early as: 2006 +## +## chongo /\oo/\ http://www.isthe.com/chongo/ +## Share and enjoy! :-) http://www.isthe.com/chongo/tech/comp/calc/ diff --git a/help/strncmp b/help/strncmp index b4599ee..b62d752 100644 --- a/help/strncmp +++ b/help/strncmp @@ -1,71 +1,71 @@ -NAME - strncmp - compare two strings up to a specified number of characters - -SYNOPSIS - strncmp(s1, s2, n) - -TYPES - s1 string - s2 string - n nonnegative integer - - return integer (1, 0 or -1) - -DESCRIPTION - Let n1 = size(s1), n2 = size(s2) and m = min(n1, n2, n). - This function compares up to m values of consecutive characters - in the strings s1 and s2. If an inequality is encountered, the - function returns 1 or -1 according as the greater character is - in s1 or s2. If there has been no inequality, the function - returns 1, 0, or -1 according as min(n1, n) is greater than, equal - to, or less than min(n2, n); in particular, if n1 and n2 are - both greater than equal to n, 0 is returned. - - -EXAMPLE -strncmp("abc", "xyz", 0) == 0 -strncmp("abc", "xyz", 1) == -1 -strncmp("abc", "", 1) == 1 -strncmp("a", "b", 2) == -1 -strncmp("ab", "ac", 2) == -1 -strncmp("\0ac", "\0b", 2) == -1 -strncmp("ab", "abc", 2) == 0 -strncmp("abc", "abd", 2) == 0 - - -LIMITS - none - -LINK LIBRARY - This function uses FLAG stringrel(STRING *s1, STRING *s2), - temporarily replacing the string sizes by min(n1,n) and min(n2,n). - -SEE ALSO - strcat, strcpy, strerror, strlen, strncpy, strpos, - strprintf, strscan, strscanf, substr - -## Copyright (C) 2006 Ernest Bowen -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 30.1 $ -## @(#) $Id: strncmp,v 30.1 2007/03/16 11:10:42 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/strncmp,v $ -## -## Under source code control: 2006/03/03 03:32:44 -## File existed as early as: 2006 -## -## chongo /\oo/\ http://www.isthe.com/chongo/ -## Share and enjoy! :-) http://www.isthe.com/chongo/tech/comp/calc/ +NAME + strncmp - compare two strings up to a specified number of characters + +SYNOPSIS + strncmp(s1, s2, n) + +TYPES + s1 string + s2 string + n nonnegative integer + + return integer (1, 0 or -1) + +DESCRIPTION + Let n1 = size(s1), n2 = size(s2) and m = min(n1, n2, n). + This function compares up to m values of consecutive characters + in the strings s1 and s2. If an inequality is encountered, the + function returns 1 or -1 according as the greater character is + in s1 or s2. If there has been no inequality, the function + returns 1, 0, or -1 according as min(n1, n) is greater than, equal + to, or less than min(n2, n); in particular, if n1 and n2 are + both greater than equal to n, 0 is returned. + + +EXAMPLE +strncmp("abc", "xyz", 0) == 0 +strncmp("abc", "xyz", 1) == -1 +strncmp("abc", "", 1) == 1 +strncmp("a", "b", 2) == -1 +strncmp("ab", "ac", 2) == -1 +strncmp("\0ac", "\0b", 2) == -1 +strncmp("ab", "abc", 2) == 0 +strncmp("abc", "abd", 2) == 0 + + +LIMITS + none + +LINK LIBRARY + This function uses FLAG stringrel(STRING *s1, STRING *s2), + temporarily replacing the string sizes by min(n1,n) and min(n2,n). + +SEE ALSO + strcat, strcpy, strerror, strlen, strncpy, strpos, + strprintf, strscan, strscanf, substr + +## Copyright (C) 2006 Ernest Bowen +## +## Calc is open software; you can redistribute it and/or modify it under +## the terms of the version 2.1 of the GNU Lesser General Public License +## as published by the Free Software Foundation. +## +## Calc is distributed in the hope that it will be useful, but WITHOUT +## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General +## Public License for more details. +## +## A copy of version 2.1 of the GNU Lesser General Public License is +## distributed with calc under the filename COPYING-LGPL. You should have +## received a copy with calc; if not, write to Free Software Foundation, Inc. +## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. +## +## @(#) $Revision: 30.3 $ +## @(#) $Id: strncmp,v 30.3 2013/08/11 01:16:03 chongo Exp $ +## @(#) $Source: /usr/local/src/bin/calc/help/RCS/strncmp,v $ +## +## Under source code control: 2006/03/03 03:32:44 +## File existed as early as: 2006 +## +## chongo /\oo/\ http://www.isthe.com/chongo/ +## Share and enjoy! :-) http://www.isthe.com/chongo/tech/comp/calc/ diff --git a/help/strncpy b/help/strncpy index a740a6a..8040414 100644 --- a/help/strncpy +++ b/help/strncpy @@ -1,66 +1,66 @@ -NAME - strncpy - copy a number of chracters from head or all of a stringr - to head or all of a string - -SYNOPSIS - strncpy(s1, s2, n) - -TYPES - s1 string - s2 string - n nonnegative integer - - return string - -DESCRIPTION - Let n1 = size(s1), n2 = size(n2), and m = min(n1, n2, n). - This function replaces the first m characters of s1 by the first - m characters of s2, and if min(n1, n) > n2, replaces the next - min(n1,n) - n2 characters of s1 by '\0'. The size of s1 and any - later characters of s1 are unchanged. The function returns s1, with - new value. - -EXAMPLE - strncpy("abcdef", "xyz", 0) == "abcdef" - strncpy("abcdef", "xyz", 1) == "xbcdef" - strncpy("abcdef", "xyz", 2) == "xycdef" - strncpy("abcdef", "xyz", 3) == "xyzdef" - strncpy("abcdef", "xyz", 4) == "xyz\0ef" - strncpy("abcdef", "xyz", 5) == "xyz\0\0f" - strncpy("ab", "xyz", 3) == "xy" - -LIMITS - none - -LINK LIBRARY - STRING* stringncpy(STRING *s1, STRING *s2, long num) - -SEE ALSO - strcat, strcpy, strerror, strlen, strncmp, strpos, - strprintf, strscan, strscanf, substr - -## Copyright (C) 2006 Ernest Bowen -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 30.1 $ -## @(#) $Id: strncpy,v 30.1 2007/03/16 11:10:42 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/strncpy,v $ -## -## Under source code control: 2006/03/03 03:32:44 -## File existed as early as: 2006 -## -## chongo /\oo/\ http://www.isthe.com/chongo/ -## Share and enjoy! :-) http://www.isthe.com/chongo/tech/comp/calc/ +NAME + strncpy - copy a number of chracters from head or all of a stringr + to head or all of a string + +SYNOPSIS + strncpy(s1, s2, n) + +TYPES + s1 string + s2 string + n nonnegative integer + + return string + +DESCRIPTION + Let n1 = size(s1), n2 = size(n2), and m = min(n1, n2, n). + This function replaces the first m characters of s1 by the first + m characters of s2, and if min(n1, n) > n2, replaces the next + min(n1,n) - n2 characters of s1 by '\0'. The size of s1 and any + later characters of s1 are unchanged. The function returns s1, with + new value. + +EXAMPLE + strncpy("abcdef", "xyz", 0) == "abcdef" + strncpy("abcdef", "xyz", 1) == "xbcdef" + strncpy("abcdef", "xyz", 2) == "xycdef" + strncpy("abcdef", "xyz", 3) == "xyzdef" + strncpy("abcdef", "xyz", 4) == "xyz\0ef" + strncpy("abcdef", "xyz", 5) == "xyz\0\0f" + strncpy("ab", "xyz", 3) == "xy" + +LIMITS + none + +LINK LIBRARY + STRING* stringncpy(STRING *s1, STRING *s2, long num) + +SEE ALSO + strcat, strcpy, strerror, strlen, strncmp, strpos, + strprintf, strscan, strscanf, substr + +## Copyright (C) 2006 Ernest Bowen +## +## Calc is open software; you can redistribute it and/or modify it under +## the terms of the version 2.1 of the GNU Lesser General Public License +## as published by the Free Software Foundation. +## +## Calc is distributed in the hope that it will be useful, but WITHOUT +## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General +## Public License for more details. +## +## A copy of version 2.1 of the GNU Lesser General Public License is +## distributed with calc under the filename COPYING-LGPL. You should have +## received a copy with calc; if not, write to Free Software Foundation, Inc. +## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. +## +## @(#) $Revision: 30.3 $ +## @(#) $Id: strncpy,v 30.3 2013/08/11 01:16:03 chongo Exp $ +## @(#) $Source: /usr/local/src/bin/calc/help/RCS/strncpy,v $ +## +## Under source code control: 2006/03/03 03:32:44 +## File existed as early as: 2006 +## +## chongo /\oo/\ http://www.isthe.com/chongo/ +## Share and enjoy! :-) http://www.isthe.com/chongo/tech/comp/calc/ diff --git a/help/strscanf b/help/strscanf index 1686de6..488e40e 100644 --- a/help/strscanf +++ b/help/strscanf @@ -69,7 +69,7 @@ DESCRIPTION might be taken to suggest a number like +2345; 'r' might suggest a representation like -27/49; 'e' might suggest a representation like 1.24e-7; 'f' might suggest a representation like 27.145. However, there - is no test that the the result conforms to the specifier. Whatever + is no test that the result conforms to the specifier. Whatever the specifier in these cases, the result depends on the characters read until a space or other exceptional character is read. The characters read may include one or more occurrences of +, -, * as @@ -131,8 +131,8 @@ SEE ALSO ## 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.1 $ -## @(#) $Id: strscanf,v 30.1 2007/03/16 11:10:42 chongo Exp $ +## @(#) $Revision: 30.2 $ +## @(#) $Id: strscanf,v 30.2 2013/08/11 01:08:32 chongo Exp $ ## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/strscanf,v $ ## ## Under source code control: 1996/04/30 03:05:18 diff --git a/help/version b/help/version index 35ba774..bcc63b6 100644 --- a/help/version +++ b/help/version @@ -17,7 +17,7 @@ DESCRIPTION x.y where x, y, z, w, v are integers (without leading 0's) and, - t is the the liternal character 't'. + t is the liternal character 't'. EXAMPLE ; version() @@ -48,8 +48,8 @@ SEE ALSO ## 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.1 $ -## @(#) $Id: version,v 30.1 2007/03/16 11:10:42 chongo Exp $ +## @(#) $Revision: 30.2 $ +## @(#) $Id: version,v 30.2 2013/08/11 01:08:32 chongo Exp $ ## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/version,v $ ## ## Under source code control: 2001/05/28 17:38:01 diff --git a/hist.c b/hist.c index 2b7b94c..62b4a67 100644 --- a/hist.c +++ b/hist.c @@ -19,7 +19,7 @@ * * @(#) $Revision: 30.1 $ * @(#) $Id: hist.c,v 30.1 2007/03/16 11:09:46 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/hist.c,v $ + * @(#) $Source: /usr/local/src/bin/calc/RCS/hist.c,v $ * * Under source code control: 1993/05/02 20:09:19 * File existed as early as: 1993 diff --git a/hist.h b/hist.h index de9f759..08bf9dc 100644 --- a/hist.h +++ b/hist.h @@ -19,7 +19,7 @@ * * @(#) $Revision: 30.1 $ * @(#) $Id: hist.h,v 30.1 2007/03/16 11:09:46 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/hist.h,v $ + * @(#) $Source: /usr/local/src/bin/calc/RCS/hist.h,v $ * * Under source code control: 1993/05/02 20:09:20 * File existed as early as: 1993 diff --git a/input.c b/input.c index d937067..8488e57 100644 --- a/input.c +++ b/input.c @@ -19,7 +19,7 @@ * * @(#) $Revision: 30.2 $ * @(#) $Id: input.c,v 30.2 2008/04/15 21:17:57 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/input.c,v $ + * @(#) $Source: /usr/local/src/bin/calc/RCS/input.c,v $ * * Under source code control: 1990/02/15 01:48:16 * File existed as early as: before 1990 diff --git a/jump.c b/jump.c index d665005..f18c9b2 100644 --- a/jump.c +++ b/jump.c @@ -19,7 +19,7 @@ * * @(#) $Revision: 30.1 $ * @(#) $Id: jump.c,v 30.1 2007/03/16 11:09:46 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/jump.c,v $ + * @(#) $Source: /usr/local/src/bin/calc/RCS/jump.c,v $ * * Under source code control: 1994/06/29 04:03:54 * File existed as early as: 1994 diff --git a/jump.h b/jump.h index 39b2ec1..7f55168 100644 --- a/jump.h +++ b/jump.h @@ -19,7 +19,7 @@ * * @(#) $Revision: 30.1 $ * @(#) $Id: jump.h,v 30.1 2007/03/16 11:09:46 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/jump.h,v $ + * @(#) $Source: /usr/local/src/bin/calc/RCS/jump.h,v $ * * Under source code control: 1994/06/29 04:03:55 * File existed as early as: 1994 diff --git a/label.c b/label.c index c4959f1..24c3d53 100644 --- a/label.c +++ b/label.c @@ -19,7 +19,7 @@ * * @(#) $Revision: 30.1 $ * @(#) $Id: label.c,v 30.1 2007/03/16 11:09:46 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/label.c,v $ + * @(#) $Source: /usr/local/src/bin/calc/RCS/label.c,v $ * * Under source code control: 1990/02/15 01:48:17 * File existed as early as: before 1990 diff --git a/label.h b/label.h index a427531..71ce4d3 100644 --- a/label.h +++ b/label.h @@ -19,7 +19,7 @@ * * @(#) $Revision: 30.1 $ * @(#) $Id: label.h,v 30.1 2007/03/16 11:09:46 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/label.h,v $ + * @(#) $Source: /usr/local/src/bin/calc/RCS/label.h,v $ * * Under source code control: 1990/02/15 01:48:33 * File existed as early as: before 1990 diff --git a/lib_calc.c b/lib_calc.c index 7ca731b..6e0fe22 100644 --- a/lib_calc.c +++ b/lib_calc.c @@ -19,7 +19,7 @@ * * @(#) $Revision: 30.3 $ * @(#) $Id: lib_calc.c,v 30.3 2007/07/10 17:57:04 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/lib_calc.c,v $ + * @(#) $Source: /usr/local/src/bin/calc/RCS/lib_calc.c,v $ * * Under source code control: 1996/06/17 18:06:19 * File existed as early as: 1996 diff --git a/lib_calc.h b/lib_calc.h index bdd05ca..4849678 100644 --- a/lib_calc.h +++ b/lib_calc.h @@ -19,7 +19,7 @@ * * @(#) $Revision: 30.1 $ * @(#) $Id: lib_calc.h,v 30.1 2007/03/16 11:09:46 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/lib_calc.h,v $ + * @(#) $Source: /usr/local/src/bin/calc/RCS/lib_calc.h,v $ * * Under source code control: 1997/03/23 18:37:10 * File existed as early as: 1997 diff --git a/lib_util.c b/lib_util.c index 1a77bbd..f5beabb 100644 --- a/lib_util.c +++ b/lib_util.c @@ -19,7 +19,7 @@ * * @(#) $Revision: 30.1 $ * @(#) $Id: lib_util.c,v 30.1 2007/03/16 11:09:46 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/lib_util.c,v $ + * @(#) $Source: /usr/local/src/bin/calc/RCS/lib_util.c,v $ * * Under source code control: 1997/04/19 21:38:30 * File existed as early as: 1997 diff --git a/lib_util.h b/lib_util.h index d9be319..0eb2835 100644 --- a/lib_util.h +++ b/lib_util.h @@ -19,7 +19,7 @@ * * @(#) $Revision: 30.1 $ * @(#) $Id: lib_util.h,v 30.1 2007/03/16 11:09:46 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/lib_util.h,v $ + * @(#) $Source: /usr/local/src/bin/calc/RCS/lib_util.h,v $ * * Under source code control: 1997/04/19 21:38:30 * File existed as early as: 1997 diff --git a/listfunc.c b/listfunc.c index 23b6468..a373f1c 100644 --- a/listfunc.c +++ b/listfunc.c @@ -19,7 +19,7 @@ * * @(#) $Revision: 30.1 $ * @(#) $Id: listfunc.c,v 30.1 2007/03/16 11:09:46 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/listfunc.c,v $ + * @(#) $Source: /usr/local/src/bin/calc/RCS/listfunc.c,v $ * * Under source code control: 1990/02/15 01:48:18 * File existed as early as: before 1990 diff --git a/longbits.c b/longbits.c index ec8c18d..547455a 100644 --- a/longbits.c +++ b/longbits.c @@ -19,7 +19,7 @@ * * @(#) $Revision: 30.1 $ * @(#) $Id: longbits.c,v 30.1 2007/03/16 11:09:46 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/longbits.c,v $ + * @(#) $Source: /usr/local/src/bin/calc/RCS/longbits.c,v $ * * Under source code control: 1994/03/18 03:06:18 * File existed as early as: 1994 diff --git a/matfunc.c b/matfunc.c index 332415c..cba8115 100644 --- a/matfunc.c +++ b/matfunc.c @@ -19,7 +19,7 @@ * * @(#) $Revision: 30.2 $ * @(#) $Id: matfunc.c,v 30.2 2007/07/05 13:30:38 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/matfunc.c,v $ + * @(#) $Source: /usr/local/src/bin/calc/RCS/matfunc.c,v $ * * Under source code control: 1990/02/15 01:48:18 * File existed as early as: before 1990 diff --git a/math_error.c b/math_error.c index e2efea2..4bb25e5 100644 --- a/math_error.c +++ b/math_error.c @@ -19,7 +19,7 @@ * * @(#) $Revision: 30.2 $ * @(#) $Id: math_error.c,v 30.2 2008/10/24 09:49:20 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/math_error.c,v $ + * @(#) $Source: /usr/local/src/bin/calc/RCS/math_error.c,v $ * * Under source code control: 1994/08/03 05:08:22 * File existed as early as: 1994 diff --git a/nametype.h b/nametype.h index 1660665..440a5e1 100644 --- a/nametype.h +++ b/nametype.h @@ -19,7 +19,7 @@ * * @(#) $Revision: 30.1 $ * @(#) $Id: nametype.h,v 30.1 2007/03/16 11:09:46 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/nametype.h,v $ + * @(#) $Source: /usr/local/src/bin/calc/RCS/nametype.h,v $ * * Under source code control: 1997/03/08 13:44:55 * File existed as early as: 1997 diff --git a/no_implicit.c b/no_implicit.c index 377907a..968b68c 100644 --- a/no_implicit.c +++ b/no_implicit.c @@ -19,7 +19,7 @@ * * @(#) $Revision: 30.1 $ * @(#) $Id: no_implicit.c,v 30.1 2007/03/16 11:09:46 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/no_implicit.c,v $ + * @(#) $Source: /usr/local/src/bin/calc/RCS/no_implicit.c,v $ * * Under source code control: 2003/01/14 01:45:19 * File existed as early as: 2003 diff --git a/obj.c b/obj.c index 3812092..e334bcd 100644 --- a/obj.c +++ b/obj.c @@ -19,7 +19,7 @@ * * @(#) $Revision: 30.1 $ * @(#) $Id: obj.c,v 30.1 2007/03/16 11:09:46 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/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 * File existed as early as: before 1990 diff --git a/opcodes.c b/opcodes.c index 8a02f23..d6089d9 100644 --- a/opcodes.c +++ b/opcodes.c @@ -21,7 +21,7 @@ * * @(#) $Revision: 30.4 $ * @(#) $Id: opcodes.c,v 30.4 2008/05/10 13:51:32 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/opcodes.c,v $ + * @(#) $Source: /usr/local/src/bin/calc/RCS/opcodes.c,v $ * * Under source code control: 1990/02/15 01:48:19 * File existed as early as: before 1990 diff --git a/opcodes.h b/opcodes.h index 17f9783..f976647 100644 --- a/opcodes.h +++ b/opcodes.h @@ -19,7 +19,7 @@ * * @(#) $Revision: 30.1 $ * @(#) $Id: opcodes.h,v 30.1 2007/03/16 11:09:46 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/opcodes.h,v $ + * @(#) $Source: /usr/local/src/bin/calc/RCS/opcodes.h,v $ * * Under source code control: 1990/02/15 01:48:35 * File existed as early as: before 1990 diff --git a/pix.c b/pix.c index 9257e4c..8dbe8cc 100644 --- a/pix.c +++ b/pix.c @@ -19,7 +19,7 @@ * * @(#) $Revision: 30.1 $ * @(#) $Id: pix.c,v 30.1 2007/03/16 11:09:46 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/pix.c,v $ + * @(#) $Source: /usr/local/src/bin/calc/RCS/pix.c,v $ * * Under source code control: 1994/07/01 19:44:21 * File existed as early as: 1994 diff --git a/poly.c b/poly.c index 09299fe..a179e6d 100644 --- a/poly.c +++ b/poly.c @@ -21,7 +21,7 @@ * * @(#) $Revision: 30.1 $ * @(#) $Id: poly.c,v 30.1 2007/03/16 11:09:46 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/poly.c,v $ + * @(#) $Source: /usr/local/src/bin/calc/RCS/poly.c,v $ * * Under source code control: 1995/12/02 03:10:28 * File existed as early as: 1995 diff --git a/prime.c b/prime.c index 0766760..5bf2661 100644 --- a/prime.c +++ b/prime.c @@ -19,7 +19,7 @@ * * @(#) $Revision: 30.1 $ * @(#) $Id: prime.c,v 30.1 2007/03/16 11:09:46 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/prime.c,v $ + * @(#) $Source: /usr/local/src/bin/calc/RCS/prime.c,v $ * * Under source code control: 1994/06/04 03:26:14 * File existed as early as: 1994 diff --git a/prime.h b/prime.h index 69ba4bc..2c8e000 100644 --- a/prime.h +++ b/prime.h @@ -19,7 +19,7 @@ * * @(#) $Revision: 30.1 $ * @(#) $Id: prime.h,v 30.1 2007/03/16 11:09:46 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/prime.h,v $ + * @(#) $Source: /usr/local/src/bin/calc/RCS/prime.h,v $ * * Under source code control: 1994/06/04 03:26:15 * File existed as early as: 1994 diff --git a/qfunc.c b/qfunc.c index 3e38b7f..899ec0c 100644 --- a/qfunc.c +++ b/qfunc.c @@ -21,7 +21,7 @@ * * @(#) $Revision: 30.1 $ * @(#) $Id: qfunc.c,v 30.1 2007/03/16 11:09:46 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/qfunc.c,v $ + * @(#) $Source: /usr/local/src/bin/calc/RCS/qfunc.c,v $ * * Under source code control: 1990/02/15 01:48:20 * File existed as early as: before 1990 diff --git a/qio.c b/qio.c index a251800..3c57f2f 100644 --- a/qio.c +++ b/qio.c @@ -19,7 +19,7 @@ * * @(#) $Revision: 30.1 $ * @(#) $Id: qio.c,v 30.1 2007/03/16 11:09:46 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/qio.c,v $ + * @(#) $Source: /usr/local/src/bin/calc/RCS/qio.c,v $ * * Under source code control: 1993/07/30 19:42:46 * File existed as early as: 1993 diff --git a/qmath.c b/qmath.c index 9f4955f..5f5b5bb 100644 --- a/qmath.c +++ b/qmath.c @@ -21,7 +21,7 @@ * * @(#) $Revision: 30.1 $ * @(#) $Id: qmath.c,v 30.1 2007/03/16 11:09:46 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/qmath.c,v $ + * @(#) $Source: /usr/local/src/bin/calc/RCS/qmath.c,v $ * * Under source code control: 1990/02/15 01:48:21 * File existed as early as: before 1990 diff --git a/qmath.h b/qmath.h index ca23b7d..731b090 100644 --- a/qmath.h +++ b/qmath.h @@ -19,7 +19,7 @@ * * @(#) $Revision: 30.2 $ * @(#) $Id: qmath.h,v 30.2 2007/07/05 19:35:20 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/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 * File existed as early as: 1993 diff --git a/qmod.c b/qmod.c index df31287..3ea9f46 100644 --- a/qmod.c +++ b/qmod.c @@ -21,7 +21,7 @@ * * @(#) $Revision: 30.1 $ * @(#) $Id: qmod.c,v 30.1 2007/03/16 11:09:46 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/qmod.c,v $ + * @(#) $Source: /usr/local/src/bin/calc/RCS/qmod.c,v $ * * Under source code control: 1991/05/22 23:15:07 * File existed as early as: 1991 diff --git a/qtrans.c b/qtrans.c index 6f3e774..90d5104 100644 --- a/qtrans.c +++ b/qtrans.c @@ -21,7 +21,7 @@ * * @(#) $Revision: 30.2 $ * @(#) $Id: qtrans.c,v 30.2 2008/10/24 07:09:41 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/qtrans.c,v $ + * @(#) $Source: /usr/local/src/bin/calc/RCS/qtrans.c,v $ * * Under source code control: 1990/02/15 01:48:22 * File existed as early as: before 1990 diff --git a/quickhash.c b/quickhash.c index c0ee4f9..fe3782a 100644 --- a/quickhash.c +++ b/quickhash.c @@ -19,7 +19,7 @@ * * @(#) $Revision: 30.1 $ * @(#) $Id: quickhash.c,v 30.1 2007/03/16 11:09:46 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/quickhash.c,v $ + * @(#) $Source: /usr/local/src/bin/calc/RCS/quickhash.c,v $ * * Under source code control: 1995/03/04 11:34:23 * File existed as early as: 1995 diff --git a/rpm.mk b/rpm.mk index 7ef892b..cfce681 100644 --- a/rpm.mk +++ b/rpm.mk @@ -19,9 +19,9 @@ # received a copy with calc; if not, write to Free Software Foundation, Inc. # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # -MAKEFILE_REV= $$Revision: 30.5 $$ -# @(#) $Id: rpm.mk,v 30.5 2008/10/24 08:44:00 chongo Exp $ -# @(#) $Source: /usr/local/src/cmd/calc/RCS/rpm.mk,v $ +MAKEFILE_REV= $$Revision: 30.10 $$ +# @(#) $Id: rpm.mk,v 30.10 2013/05/05 11:59:51 chongo Exp $ +# @(#) $Source: /usr/local/src/bin/calc/RCS/rpm.mk,v $ # # Under source code control: 2003/02/16 20:21:39 # File existed as early as: 2003 @@ -32,15 +32,44 @@ MAKEFILE_REV= $$Revision: 30.5 $$ # calculator by David I. Bell with help/mods from others # Makefile by Petteri Kettunen with modifications from Landon Curt Noll +# IMPORTANT NOTE: The rpm process assumes that ~/.rpmmacros contains the following: +# +# %_signature gpg +# %_gpg_path ~/.gnupg +# %_gpg_name __YOUR_NAME_HERE__ +# %_gpgbin /usr/bin/gpg +# %_topdir %(echo $HOME)/rpm/%{name} +# %_sourcedir %(echo $HOME)/rpm/%{name}/SOURCES +# %_specdir %(echo $HOME)/rpm/%{name}/SPECS +# %_tmppath %(echo $HOME)/rpm/%{name}/tmp +# %_builddir %(echo $HOME)/rpm/%{name}/BUILD +# %_buildroot %(echo $HOME)/rpm/%{name}/tmp/build-root +# %_rpmdir %(echo $HOME)/rpm/%{name}/RPMS +# %_srcrpmdir %(echo $HOME)/rpm/%{name}/SRPMS +# %_rpmfilename %%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm +# %packager __YOUR_NAME_HERE__ +# %vendor __YOUR_ORG_OR_GROUP_OR_COMPANY_HERE__ + +# IMPORTANT NOTE: Unless the package redhat-rpm-config is installed, +# the calc-debuginfo rpm will not be created. +# +# IMPORTANT NOTE: These packages are important for general +# rpm processing: +# +# rpm +# rpm-python +# rpmlint +# rpm-build +# rpm-libs +# redhat-rpm-config + # setup # SHELL= /bin/sh RPMBUILD_TOOL= rpmbuild TARCH= i686 -RPMBUILD_OPTION= -ba --target=${TARCH} +RPMBUILD_OPTION= -ba --target=$(TARCH) RPM_TOOL= rpm -MD5SUM= md5sum -SHA1SUM= sha1sum SED= sed FIND= find BZIP2_PROG= bzip2 @@ -54,20 +83,22 @@ MKDIR= mkdir GREP= grep SORT= sort CHMOD= chmod +LN= ln # rpm-related parameters # -PROJECT_NAME= calc +NAME= calc +PROJECT_NAME= ${NAME} PROJECT_VERSION= PROJECT_RELEASE= -PROJECT= $(PROJECT_NAME)-$(PROJECT_VERSION) -SPECFILE= $(PROJECT_NAME).spec -TARBALL= $(PROJECT).${TAR}.bz2 -RPM686= $(PROJECT)-$(PROJECT_RELEASE).${TARCH}.rpm -DRPM686= $(PROJECT_NAME)-devel-$(PROJECT_VERSION)-$(PROJECT_RELEASE).${TARCH}.rpm -SRPM= $(PROJECT)-$(PROJECT_RELEASE).src.rpm -TMPDIR= /var/tmp -RPMDIR= /usr/src/redhat +PROJECT= ${PROJECT_NAME}-${PROJECT_VERSION} +SPECFILE= ${PROJECT_NAME}.spec +TARBALL= ${PROJECT}.${TAR}.bz2 +RPM686= ${PROJECT}-${PROJECT_RELEASE}.${TARCH}.rpm +DRPM686= ${PROJECT_NAME}-devel-${PROJECT_VERSION}-${PROJECT_RELEASE}.${TARCH}.rpm +SRPM= ${PROJECT}-${PROJECT_RELEASE}.src.rpm +RPM_TOP= ${HOME}/rpm/${NAME} +TMPDIR= ${RPM_TOP}/tmp # Makefile debug # @@ -82,11 +113,14 @@ Q=@ V=@: #V=@ -all: calc.spec ver_calc +all: ver_calc calc.spec ${V} echo '=-=-=-=-= rpm.mk start of $@ rule =-=-=-=-=' - $(MAKE) -f rpm.mk PROJECT_VERSION="`./ver_calc`" \ - PROJECT_RELEASE="`${SED} -n -e '/^Release:/s/^Release: *//p' \ - calc.spec.in`" rpm + PROJECT_VERSION="`./ver_calc`"; \ + PROJECT_RELEASE="`${SED} -n \ + -e '/^Release:/s/^Release: *//p' calc.spec.in`"; \ + $(MAKE) -f rpm.mk rpm \ + PROJECT_VERSION="$$PROJECT_VERSION" \ + PROJECT_RELEASE="$$PROJECT_RELEASE" ${V} echo '=-=-=-=-= rpm.mk end of $@ rule =-=-=-=-=' pkgme: $(PROJECT_NAME)-spec.${TAR}.bz2 @@ -112,6 +146,10 @@ calc.spec: calc.spec.in ver_calc .PHONY: srcpkg srcpkg: make_rhdir ${V} echo '=-=-=-=-= rpm.mk start of $@ rule =-=-=-=-=' + ${V} echo RPM_TOP="${RPM_TOP}" + ${V} echo PROJECT_VERSION="${PROJECT_VERSION}" + ${V} echo PROJECT_RELEASE="${PROJECT_RELEASE}" + ${RM} -rf "$(TMPDIR)/$(PROJECT)" ${FIND} . -depth -print | \ ${EGREP} -v '/RCS|/CVS|/NOTES|/\.|\.out$$|\.safe$$\.tar\.bz2$$' | \ ${EGREP} -v '/old[._-]|\.old$$|\.tar\.gz$$|/ver_calc$$' | \ @@ -123,60 +161,78 @@ srcpkg: make_rhdir -e 's/^CHECK= check/CHECK= true/' \ Makefile > "$(TMPDIR)/$(PROJECT)/Makefile" ${CHMOD} 0444 "$(TMPDIR)/$(PROJECT)/Makefile" - (cd "$(TMPDIR)"; ${TAR} cf - "$(PROJECT)") | \ - ${BZIP2_PROG} --best -c -z > "$(RPMDIR)/SOURCES/$(TARBALL)" - ${RM} -fr "$(TMPDIR)/$(PROJECT)" + cd "$(TMPDIR)"; ${TAR} cf - "$(PROJECT)" | \ + ${BZIP2_PROG} --best -c -z > "$(RPM_TOP)/SOURCES/$(TARBALL)" ${V} echo '=-=-=-=-= rpm.mk end of $@ rule =-=-=-=-=' .PHONY: rpm rpm: srcpkg calc.spec ${V} echo '=-=-=-=-= rpm.mk start of $@ rule =-=-=-=-=' + ${V} echo RPM_TOP="${RPM_TOP}" + ${V} echo PROJECT_VERSION="${PROJECT_VERSION}" + ${V} echo PROJECT_RELEASE="${PROJECT_RELEASE}" $(MAKE) -f Makefile clean - ${CP} "$(SPECFILE)" "$(RPMDIR)/SPECS/$(SPECFILE)" - ${RM} -f "$(RPMDIR)/RPMS/${TARCH}/$(RPM686)" - ${RM} -f "$(RPMDIR)/RPMS/${TARCH}/$(DRPM686)" - ${RM} -f "$(RPMDIR)/SRPMS/$(SRPM)" - ${RPMBUILD_TOOL} ${RPMBUILD_OPTION} "$(RPMDIR)/SPECS/$(SPECFILE)" - @if [ ! -f "$(RPMDIR)/SRPMS/$(SRPM)" ]; then \ + ${CP} "$(SPECFILE)" "$(RPM_TOP)/SPECS/$(SPECFILE)" + ${RM} -f "$(RPM_TOP)/RPMS/$(TARCH)/$(RPM686)" + ${RM} -f "$(RPM_TOP)/RPMS/$(TARCH)/$(DRPM686)" + ${RM} -f "$(RPM_TOP)/SRPMS/$(SRPM)" + ${RPMBUILD_TOOL} ${RPMBUILD_OPTION} "$(RPM_TOP)/SPECS/$(SPECFILE)" + @if [ ! -f "$(RPM_TOP)/SRPMS/$(SRPM)" ]; then \ echo "SRPMS/$(SRPM) not found" 1>&2; \ exit 3; \ fi @echo - @echo "RPM package sizes:" - @echo - @cd $(RPMDIR); ${LS} -1s "RPMS/${TARCH}/$(RPM686)" \ - "RPMS/${TARCH}/$(DRPM686)" "SRPMS/$(SRPM)" - @echo - @echo "RPM package md5 hashes:" - @echo - -@cd $(RPMDIR); ${MD5SUM} "RPMS/${TARCH}/$(RPM686)" \ - "RPMS/${TARCH}/$(DRPM686)" "SRPMS/$(SRPM)" - @echo - @echo "RPM package sha1 hashes:" - @echo - -@cd $(RPMDIR); ${SHA1SUM} "RPMS/${TARCH}/$(RPM686)" \ - "RPMS/${TARCH}/$(DRPM686)" "SRPMS/$(SRPM)" - @echo - @echo "RPM package locations:" - @echo - @${LS} -1 "$(RPMDIR)/RPMS/${TARCH}/$(RPM686)" \ - "$(RPMDIR)/RPMS/${TARCH}/$(DRPM686)" "$(RPMDIR)/SRPMS/$(SRPM)" - @echo - @echo "All done! -- Jessica Noll, Age 2" - @echo ${V} echo '=-=-=-=-= rpm.mk end of $@ rule =-=-=-=-=' .PHONY: make_rhdir make_rhdir: ${V} echo '=-=-=-=-= rpm.mk start of $@ rule =-=-=-=-=' - for i in "$(RPMDIR)" "$(RPMDIR)/RPMS" "$(RPMDIR)/SOURCES" \ - "$(RPMDIR)/SPECS" "$(RPMDIR)/SRPMS" "$(RPMDIR)/BUILD"; do \ + ${V} echo RPM_TOP="${RPM_TOP}" + ${V} echo PROJECT_VERSION="${PROJECT_VERSION}" + ${V} echo PROJECT_RELEASE="${PROJECT_RELEASE}" + for subdir in "" BUILD RPMS SOURCES SPECS SRPMS tmp; do \ + i="$(RPM_TOP)/$$subdir"; \ if [ ! -d "$$i" ] ; then \ ${MKDIR} -p "$$i"; \ fi; \ + if [ ! -d "$$i" ] ; then \ + echo "FATAL: unable to create: $$i" 1>&2; \ + exit 4; \ + fi; \ + if [ ! -w "$$i" ] ; then \ + ${CHMOD} +w "$$i"; \ + fi; \ + if [ ! -w "$$i" ] ; then \ + echo "FATAL: unable to make writable: $$i" 1>&2; \ + exit 5; \ + fi; \ done; ${V} echo '=-=-=-=-= rpm.mk end of $@ rule =-=-=-=-=' +.PHONY: -preclean +rpm-preclean: + ${V} echo '=-=-=-=-= ${MAKE_FILE} start of $@ rule =-=-=-=-=' + ${Q} if [ -n "$(RPM_TOP)" ]; then \ + if [ -d "$(RPM_TOP)" ]; then \ + echo ${RM} -rf "$(RPM_TOP)"; \ + ${RM} -rf "$(RPM_TOP)"; \ + fi; \ + if [ -d "$(RPM_TOP)" ]; then \ + echo "FATAL: cannot rm -rf $(RPM_TOP)" 1>&2; \ + exit 1; \ + fi; \ + echo ${MKDIR} -p "$(RPM_TOP)"; \ + ${MKDIR} -p "$(RPM_TOP)"; \ + if [ ! -d "$(RPM_TOP)" ]; then \ + echo "FATAL: cannot mkdir -p $(RPM_TOP)" 1>&2; \ + exit 1; \ + fi; \ + else \ + echo "FATAL: make symbol RPM_TOP is empty" 1>&2; \ + exit 2; \ + fi + ${V} echo '=-=-=-=-= ${MAKE_FILE} end of $@ rule =-=-=-=-=' + # date format for spec file .PHONY: logdate logdate: @@ -185,9 +241,9 @@ logdate: .PHONY: chkpkg chkpkg: ${V} echo '=-=-=-=-= rpm.mk start of $@ rule =-=-=-=-=' - for i in "$(RPMDIR)/RPMS/${TARCH}/$(RPM686)" \ - "$(RPMDIR)/RPMS/${TARCH}/$(DRPM686)" \ - "$(RPMDIR)/SRPMS/$(SRPM)" ; do \ + for i in "$(RPM_TOP)/RPMS/$(TARCH)/$(RPM686)" \ + "$(RPM_TOP)/RPMS/$(TARCH)/$(DRPM686)" \ + "$(RPM_TOP)/SRPMS/$(SRPM)" ; do \ echo "***** start $$i" ; \ ${RPM_TOOL} -qpi "$$"i ; \ echo "***** files $$i" ; \ @@ -208,7 +264,7 @@ test: ver_calc ${V} echo '=-=-=-=-= rpm.mk start of $@ rule =-=-=-=-=' @if [ X"`id -u`" != X"0" ]; then \ echo "test needs to install, must be root to test" 1>&2; \ - exit 4; \ + exit 6; \ fi $(MAKE) -f rpm.mk PROJECT_VERSION="`./ver_calc`" installrpm chksys ${V} echo '=-=-=-=-= rpm.mk end of $@ rule =-=-=-=-=' @@ -218,10 +274,10 @@ installrpm: ${V} echo '=-=-=-=-= rpm.mk start of $@ rule =-=-=-=-=' @if [ X"`id -u`" != X"0" ]; then \ echo "must be root to install RPMs" 1>&2; \ - exit 5; \ + exit 7; \ fi - ${RPM_TOOL} -ivh "$(RPMDIR)/RPMS/${TARCH}/$(RPM686)" - ${RPM_TOOL} -ivh "$(RPMDIR)/RPMS/${TARCH}/$(DRPM686)" + ${RPM_TOOL} -ivh "$(RPM_TOP)/RPMS/$(TARCH)/$(RPM686)" + ${RPM_TOOL} -ivh "$(RPM_TOP)/RPMS/$(TARCH)/$(DRPM686)" ${V} echo '=-=-=-=-= rpm.mk end of $@ rule =-=-=-=-=' .PHONY: uninstallrpm @@ -229,7 +285,7 @@ uninstallrpm: ${V} echo '=-=-=-=-= rpm.mk start of $@ rule =-=-=-=-=' @if [ X"`id -u`" != X"0" ]; then \ echo "must be root to uninstall RPMs" 1>&2; \ - exit 6; \ + exit 8; \ fi ${RPM_TOOL} -e "$(PROJECT_NAME)-devel" ${RPM_TOOL} -e "$(PROJECT_NAME)" diff --git a/sample.README b/sample.README index 3de2d9e..bed4cc8 100644 --- a/sample.README +++ b/sample.README @@ -70,7 +70,7 @@ many_random ## ## @(#) $Revision: 30.1 $ ## @(#) $Id: sample.README,v 30.1 2007/03/16 11:09:46 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/RCS/sample.README,v $ +## @(#) $Source: /usr/local/src/bin/calc/RCS/sample.README,v $ ## ## Under source code control: 1997/04/19 23:15:42 ## File existed as early as: 1997 diff --git a/sample_many.c b/sample_many.c index 815a2ae..501d17a 100644 --- a/sample_many.c +++ b/sample_many.c @@ -19,7 +19,7 @@ * * @(#) $Revision: 30.1 $ * @(#) $Id: sample_many.c,v 30.1 2007/03/16 11:09:46 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/sample_many.c,v $ + * @(#) $Source: /usr/local/src/bin/calc/RCS/sample_many.c,v $ * * Under source code control: 1997/04/19 22:46:49 * File existed as early as: 1997 diff --git a/sample_rand.c b/sample_rand.c index f269d1e..e614b2c 100644 --- a/sample_rand.c +++ b/sample_rand.c @@ -19,7 +19,7 @@ * * @(#) $Revision: 30.1 $ * @(#) $Id: sample_rand.c,v 30.1 2007/03/16 11:09:46 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/sample_rand.c,v $ + * @(#) $Source: /usr/local/src/bin/calc/RCS/sample_rand.c,v $ * * Under source code control: 1997/04/19 22:46:49 * File existed as early as: 1997 diff --git a/seed.c b/seed.c index bd6bafa..9310173 100644 --- a/seed.c +++ b/seed.c @@ -19,7 +19,7 @@ * * @(#) $Revision: 30.1 $ * @(#) $Id: seed.c,v 30.1 2007/03/16 11:09:46 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/seed.c,v $ + * @(#) $Source: /usr/local/src/bin/calc/RCS/seed.c,v $ * * Under source code control: 1999/10/03 10:06:53 * File existed as early as: 1999 diff --git a/sha1.c b/sha1.c index 7d03c39..d61ffb5 100644 --- a/sha1.c +++ b/sha1.c @@ -22,8 +22,8 @@ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * @(#) $Revision: 30.3 $ - * @(#) $Id: sha1.c,v 30.3 2007/07/05 17:37:41 chongo Exp $ + * @(#) $Revision: 30.4 $ + * @(#) $Id: sha1.c,v 30.4 2013/08/11 01:08:32 chongo Exp $ * @(#) $Source: /usr/local/src/cmd/calc/RCS/sha1.c,v $ * * This file is not covered under version 2.1 of the GNU LGPL. @@ -403,7 +403,7 @@ sha1Final(HASH *state) * given: * state the state to checkpoint * - * This function will ensure that the the hash chunk buffer is empty. + * This function will ensure that the hash chunk buffer is empty. * Any partially hashed data will be padded out with 0's and hashed. */ S_FUNC void diff --git a/sha1.h b/sha1.h index 08b3835..4614a79 100644 --- a/sha1.h +++ b/sha1.h @@ -24,7 +24,7 @@ * * @(#) $Revision: 30.3 $ * @(#) $Id: sha1.h,v 30.3 2007/07/05 17:37:41 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/sha1.h,v $ + * @(#) $Source: /usr/local/src/bin/calc/RCS/sha1.h,v $ * * This file is not covered under version 2.1 of the GNU LGPL. */ diff --git a/size.c b/size.c index 8385be5..639bad4 100644 --- a/size.c +++ b/size.c @@ -19,7 +19,7 @@ * * @(#) $Revision: 30.1 $ * @(#) $Id: size.c,v 30.1 2007/03/16 11:09:46 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/size.c,v $ + * @(#) $Source: /usr/local/src/bin/calc/RCS/size.c,v $ * * Under source code control: 1997/03/10 01:56:51 * File existed as early as: 1997 diff --git a/str.c b/str.c index e5ece96..ab067ba 100644 --- a/str.c +++ b/str.c @@ -21,7 +21,7 @@ * * @(#) $Revision: 30.1 $ * @(#) $Id: str.c,v 30.1 2007/03/16 11:09:46 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/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 * File existed as early as: before 1990 diff --git a/str.h b/str.h index e3e2abf..a98d599 100644 --- a/str.h +++ b/str.h @@ -19,7 +19,7 @@ * * @(#) $Revision: 30.1 $ * @(#) $Id: str.h,v 30.1 2007/03/16 11:09:46 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/str.h,v $ + * @(#) $Source: /usr/local/src/bin/calc/RCS/str.h,v $ * * Under source code control: 1990/02/15 01:48:36 * File existed as early as: before 1990 diff --git a/symbol.c b/symbol.c index ecdc8e7..9b9e383 100644 --- a/symbol.c +++ b/symbol.c @@ -21,7 +21,7 @@ * * @(#) $Revision: 30.1 $ * @(#) $Id: symbol.c,v 30.1 2007/03/16 11:09:46 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/symbol.c,v $ + * @(#) $Source: /usr/local/src/bin/calc/RCS/symbol.c,v $ * * Under source code control: 1990/02/15 01:48:23 * File existed as early as: before 1990 diff --git a/symbol.h b/symbol.h index 881a525..b3729ff 100644 --- a/symbol.h +++ b/symbol.h @@ -19,7 +19,7 @@ * * @(#) $Revision: 30.1 $ * @(#) $Id: symbol.h,v 30.1 2007/03/16 11:09:46 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/symbol.h,v $ + * @(#) $Source: /usr/local/src/bin/calc/RCS/symbol.h,v $ * * Under source code control: 1990/02/15 01:48:37 * File existed as early as: before 1990 diff --git a/token.c b/token.c index de334fe..d15780a 100644 --- a/token.c +++ b/token.c @@ -19,9 +19,9 @@ * 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.1 $ - * @(#) $Id: token.c,v 30.1 2007/03/16 11:09:46 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/token.c,v $ + * @(#) $Revision: 30.2 $ + * @(#) $Id: token.c,v 30.2 2008/11/05 17:32:19 chongo Exp $ + * @(#) $Source: /usr/local/src/bin/calc/RCS/token.c,v $ * * Under source code control: 1990/02/15 01:48:25 * File existed as early as: before 1990 @@ -823,7 +823,6 @@ warning(char *fmt, ...) /* form the error message */ name = inputname(); va_start(ap, fmt); - vsnprintf(calc_warn_msg, MAXERROR, fmt, ap); if (name) { snprintf(calc_warn_msg, MAXERROR, "\"%s\", line %ld: ", name, linenumber()); diff --git a/token.h b/token.h index 251d70f..c6a0e46 100644 --- a/token.h +++ b/token.h @@ -19,7 +19,7 @@ * * @(#) $Revision: 30.2 $ * @(#) $Id: token.h,v 30.2 2007/07/05 13:30:38 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/token.h,v $ + * @(#) $Source: /usr/local/src/bin/calc/RCS/token.h,v $ * * Under source code control: 1990/02/15 01:48:37 * File existed as early as: before 1990 diff --git a/value.c b/value.c index 50caec5..eb01990 100644 --- a/value.c +++ b/value.c @@ -19,7 +19,7 @@ * * @(#) $Revision: 30.4 $ * @(#) $Id: value.c,v 30.4 2008/05/10 13:44:28 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/value.c,v $ + * @(#) $Source: /usr/local/src/bin/calc/RCS/value.c,v $ * * Under source code control: 1990/02/15 01:48:25 * File existed as early as: before 1990 diff --git a/value.h b/value.h index 80c276b..1ce796a 100644 --- a/value.h +++ b/value.h @@ -19,7 +19,7 @@ * * @(#) $Revision: 30.3 $ * @(#) $Id: value.h,v 30.3 2007/07/10 21:18:08 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/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 * File existed as early as: 1993 diff --git a/version.c b/version.c index a65a693..10f8fe4 100644 --- a/version.c +++ b/version.c @@ -19,8 +19,8 @@ * 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.10 $ - * @(#) $Id: version.c,v 30.10 2008/10/24 09:55:12 chongo Exp $ + * @(#) $Revision: 30.18 $ + * @(#) $Id: version.c,v 30.18 2013/08/11 01:14:26 chongo Exp $ * @(#) $Source: /usr/local/src/cmd/calc/RCS/version.c,v $ * * 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 MINOR_VER 12 /* minor library version */ #define MAJOR_PATCH 4 /* major software level under library version */ -#define MINOR_PATCH 0 /* minor software level or 0 if not patched */ +#define MINOR_PATCH 9 /* minor software level or 0 if not patched */ /* diff --git a/zfunc.c b/zfunc.c index 5c58b44..940d495 100644 --- a/zfunc.c +++ b/zfunc.c @@ -21,7 +21,7 @@ * * @(#) $Revision: 30.2 $ * @(#) $Id: zfunc.c,v 30.2 2008/02/24 07:41:49 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/zfunc.c,v $ + * @(#) $Source: /usr/local/src/bin/calc/RCS/zfunc.c,v $ * * Under source code control: 1990/02/15 01:48:27 * File existed as early as: before 1990 diff --git a/zio.c b/zio.c index f9ea0bb..f5ac1b7 100644 --- a/zio.c +++ b/zio.c @@ -19,7 +19,7 @@ * * @(#) $Revision: 30.1 $ * @(#) $Id: zio.c,v 30.1 2007/03/16 11:09:46 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/zio.c,v $ + * @(#) $Source: /usr/local/src/bin/calc/RCS/zio.c,v $ * * Under source code control: 1993/07/30 19:42:48 * File existed as early as: 1993 diff --git a/zmath.c b/zmath.c index 83ed8d7..827dd52 100644 --- a/zmath.c +++ b/zmath.c @@ -21,7 +21,7 @@ * * @(#) $Revision: 30.1 $ * @(#) $Id: zmath.c,v 30.1 2007/03/16 11:09:46 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/zmath.c,v $ + * @(#) $Source: /usr/local/src/bin/calc/RCS/zmath.c,v $ * * Under source code control: 1990/02/15 01:48:28 * File existed as early as: before 1990 diff --git a/zmath.h b/zmath.h index 8d00de3..cf639c7 100644 --- a/zmath.h +++ b/zmath.h @@ -19,7 +19,7 @@ * * @(#) $Revision: 30.2 $ * @(#) $Id: zmath.h,v 30.2 2007/07/05 13:30:38 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/zmath.h,v $ + * @(#) $Source: /usr/local/src/bin/calc/RCS/zmath.h,v $ * * Under source code control: 1993/07/30 19:42:48 * File existed as early as: 1993 diff --git a/zmod.c b/zmod.c index b428367..2268e8e 100644 --- a/zmod.c +++ b/zmod.c @@ -21,7 +21,7 @@ * * @(#) $Revision: 30.1 $ * @(#) $Id: zmod.c,v 30.1 2007/03/16 11:09:46 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/zmod.c,v $ + * @(#) $Source: /usr/local/src/bin/calc/RCS/zmod.c,v $ * * Under source code control: 1991/05/22 23:03:55 * File existed as early as: 1991 diff --git a/zmul.c b/zmul.c index 9f06694..837f457 100644 --- a/zmul.c +++ b/zmul.c @@ -19,7 +19,7 @@ * * @(#) $Revision: 30.1 $ * @(#) $Id: zmul.c,v 30.1 2007/03/16 11:09:46 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/zmul.c,v $ + * @(#) $Source: /usr/local/src/bin/calc/RCS/zmul.c,v $ * * Under source code control: 1991/01/09 20:01:31 * File existed as early as: 1991 diff --git a/zprime.c b/zprime.c index c1926af..2995f82 100644 --- a/zprime.c +++ b/zprime.c @@ -19,7 +19,7 @@ * * @(#) $Revision: 30.1 $ * @(#) $Id: zprime.c,v 30.1 2007/03/16 11:09:46 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/zprime.c,v $ + * @(#) $Source: /usr/local/src/bin/calc/RCS/zprime.c,v $ * * Under source code control: 1994/05/29 04:34:36 * File existed as early as: 1994 diff --git a/zrand.c b/zrand.c index 3011d5b..30ae497 100644 --- a/zrand.c +++ b/zrand.c @@ -19,7 +19,7 @@ * * @(#) $Revision: 30.2 $ * @(#) $Id: zrand.c,v 30.2 2007/09/21 01:47:34 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/zrand.c,v $ + * @(#) $Source: /usr/local/src/bin/calc/RCS/zrand.c,v $ * * Under source code control: 1995/01/07 09:45:25 * File existed as early as: 1994 diff --git a/zrand.h b/zrand.h index 0d1d863..6303a5c 100644 --- a/zrand.h +++ b/zrand.h @@ -19,7 +19,7 @@ * * @(#) $Revision: 30.1 $ * @(#) $Id: zrand.h,v 30.1 2007/03/16 11:09:46 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/zrand.h,v $ + * @(#) $Source: /usr/local/src/bin/calc/RCS/zrand.h,v $ * * Under source code control: 1995/01/07 09:45:26 * File existed as early as: 1994 diff --git a/zrandom.c b/zrandom.c index 614fe7f..24cd6a0 100644 --- a/zrandom.c +++ b/zrandom.c @@ -17,8 +17,8 @@ * 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.2 $ - * @(#) $Id: zrandom.c,v 30.2 2007/09/21 01:47:34 chongo Exp $ + * @(#) $Revision: 30.3 $ + * @(#) $Id: zrandom.c,v 30.3 2013/08/11 01:08:32 chongo Exp $ * @(#) $Source: /usr/local/src/cmd/calc/RCS/zrandom.c,v $ * * Under source code control: 1997/02/15 04:01:56 @@ -318,7 +318,7 @@ * * seed >= 2^32, 0 < newn <= 20: * ----------------------------- - * Set the Blum modulus to one of the the pre-defined Blum moduli. + * Set the Blum modulus to one of the pre-defined Blum moduli. * See below for the values of these pre-defined Blum moduli and how * they were computed. * @@ -341,7 +341,7 @@ * * seed == 0, 0 < newn <= 20: * -------------------------- - * Set the Blum modulus to one of the the pre-defined Blum moduli. + * Set the Blum modulus to one of the pre-defined Blum moduli. * The new quadratic residue will also be set to one of * the pre-defined quadratic residues. * @@ -609,7 +609,7 @@ * to having their Blum moduli factored, depending in their size, * by small PCs in a reasonable to large supercomputers/highly * parallel processors over a long time. Their value lies in their - * speed relative the the default Blum generator. As of Jan 1997, + * speed relative the default Blum generator. As of Jan 1997, * the Blum moduli associated with 13 <= newn < 20 appear to * be well beyond the scope of hardware and algorithms, * and 9 <= newn < 12 might be factorable with extreme difficulty. @@ -1064,7 +1064,7 @@ * Blum generator. A combination of better algorithms, helped by faster * hardware will be needed. * - * It is true that the the pre-defined moduli are 'magic'. On the other + * It is true that the pre-defined moduli are 'magic'. On the other * hand, there purpose was in part to produce users with pre-seeded * generators where the individual Blum primes are not well known. If * this bothers you, don't use them and seed your own! @@ -2373,7 +2373,7 @@ zsrandom2(CONST ZVALUE seed, CONST ZVALUE newn) /* * srandom(seed, 0 < newn <= 20) * - * Set the Blum modulus to one of the the pre-defined Blum moduli. + * Set the Blum modulus to one of the pre-defined Blum moduli. * The new quadratic residue will also be set to one of * the pre-defined quadratic residues. */ diff --git a/zrandom.h b/zrandom.h index b89e9f9..f79448e 100644 --- a/zrandom.h +++ b/zrandom.h @@ -19,7 +19,7 @@ * * @(#) $Revision: 30.1 $ * @(#) $Id: zrandom.h,v 30.1 2007/03/16 11:09:46 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/zrandom.h,v $ + * @(#) $Source: /usr/local/src/bin/calc/RCS/zrandom.h,v $ * * Under source code control: 1997/02/15 04:01:56 * File existed as early as: 1997