Release calc version 2.12.4.14

This commit is contained in:
Landon Curt Noll
2014-09-21 22:28:35 -07:00
parent cc2f6f7b85
commit ed4b56d1ec
88 changed files with 1688 additions and 1243 deletions

9
BUGS
View File

@@ -68,6 +68,9 @@ of a context diff patch).
Known bugs: Known bugs:
The output of the alg_config.cal resource file is bogus.
We would welcome a replacement for this code.
We are sure some more bugs exist. When you find them, please let We are sure some more bugs exist. When you find them, please let
us know! See the above for details on how to report and were to us know! See the above for details on how to report and were to
EMail your bug reports and hopefully patches to fix them. EMail your bug reports and hopefully patches to fix them.
@@ -129,7 +132,7 @@ mis-features in calc:
will not. will not.
## Copyright (C) 1999-2013 Landon Curt Noll ## Copyright (C) 1999-2014 Landon Curt Noll
## ##
## Calc is open software; you can redistribute it and/or modify it under ## Calc is open software; you can redistribute it and/or modify it under
## the terms of the version 2.1 of the GNU Lesser General Public License ## the terms of the version 2.1 of the GNU Lesser General Public License
@@ -145,8 +148,8 @@ mis-features in calc:
## received a copy with calc; if not, write to Free Software Foundation, Inc. ## received a copy with calc; if not, write to Free Software Foundation, Inc.
## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
## ##
## @(#) $Revision: 30.2 $ ## @(#) $Revision: 30.3 $
## @(#) $Id: BUGS,v 30.2 2013/08/11 01:09:27 chongo Exp $ ## @(#) $Id: BUGS,v 30.3 2014/09/07 06:20:41 chongo Exp $
## @(#) $Source: /usr/local/src/bin/calc/RCS/BUGS,v $ ## @(#) $Source: /usr/local/src/bin/calc/RCS/BUGS,v $
## ##
## Under source code control: 1994/03/18 14:06:13 ## Under source code control: 1994/03/18 14:06:13

89
CHANGES
View File

@@ -1,4 +1,87 @@
The following are the changes from calc version 2.12.4.11 to date: The following are the changes from calc version 2.12.4.14 to date:
For Apple OS X / Darwin target:
MACOSX_DEPLOYMENT_TARGET is no longer defined
using clang compiler
By default, -install-name is used when forming shared libs.
To force -install-name to not be used, set SET_INSTALL_NAME=no.
The have_stdvs.c test uses <stdlib.h> and fixed va_start() test call
that didn't use last arg.
Fixed math_fmt (printf) in value.c where a LEN (SB32) be printed as %d.
Fixed a significant bug where that resulted in an incorrect
complex number comparison. Thanks goes to David Binderman
<dcb314 at hotmail dot com> for identifying the subtle typo!
Make minor fixes to the make depend rule.
Fixed places were calc defined a reserved identifier that
begin with either __ or _[A-Z]. For example, __FILE_H__ has
been replaced with INCLUDE_FILE_H.
Fixed the addall3 example in the script help file. Thanks for this
fix goes to Igor Furlan <igor dot furlan at gmail dot com>.
We made important fixes to the calc command line history:
Fixed a bug in the command line history where calc would somtimes
crash. There was code that used memcpy() instead of memmove()
that could corrupt the command line history when entering a
into into history that was similar to a previous entry. Thanks
goes to Einar Lielmanis <einars at spicausis dot lv> for first
identifying this mistake.
The calc command line history code, in general was not robust.
We made use a patch from Mathias Buhr <napcode at users dot sf
dot net>, that while it uses a bit more memory: is much more
flexible, readable and robust. This patch replaced the improer
use of memcpy() (see above) with better code. Thanks!
The alg_config.cal calc resource file has been reworked to produce
better diagnostics while attempting to determine the ideal values
for mul2, sq2, and pow2. However, it has been shown that this
code is not correct. Suggestions for a replacement are welcome!
calc -u 'read alg_config; config("user_debug", 2),; best_mul2();'
calc -u 'read alg_config; config("user_debug", 2),; best_sq2();'
calc -u 'read alg_config; config("user_debug", 2),; best_pow2();'
Fixed a number of pedantic compiler warnings.
Removed -W and -Wno-comment from the the CCWARN makefile variable.
Removed no_implicit.arg makefile rule. Removed HAVE_NO_IMPLICIT
makefile variable. Removed no_implicit.c source file.
Added WNO_IMPLICT makefile variable to hold the compiler flag
-Wno-implicit for use on selective compile lines.
Added WNO_ERROR_LONG_LONG makefile variable to hold the compiler flag
-Wno-error=long-long for use on selective compile lines.
Added WNO_LONG_LONG makefile variable to hold the compiler flag
-Wno-long-long for use on selective compile lines.
The makefile variable ${MKDIR_ARG} has been replaced with just -p.
Minor fixes were made to the calc.spec.in file.
The target rpm architecture changed from i686 to x86_64. For those
who do not run machine with x86_64, we continue to release a src
rpm. For those without the ability to process an rpm, we will always
to release src tarball.
When building the libcalc and libcustcalc shared libraries,
ONLY the .so and .so.${VERSION} files are created. The .so is
a symlink to the .so.${VERSION} file. Here ${VERSION} is the
full "w.x.y.z" calc version.
The following are the changes from calc version 2.12.4.11 to 2.12.4.13:
Fixed many typos in comments of the Makefile thanks to the review Fixed many typos in comments of the Makefile thanks to the review
work of Michael Somos. work of Michael Somos.
@@ -6960,8 +7043,8 @@ Following is a list of visible changes to calc from version 1.24.7 to 1.26.1:
## received a copy with calc; if not, write to Free Software Foundation, Inc. ## received a copy with calc; if not, write to Free Software Foundation, Inc.
## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
## ##
## @(#) $Revision: 30.38 $ ## @(#) $Revision: 30.44 $
## @(#) $Id: CHANGES,v 30.38 2013/09/27 08:59:43 chongo Exp $ ## @(#) $Id: CHANGES,v 30.44 2014/09/22 03:40:07 chongo Exp $
## @(#) $Source: /usr/local/src/bin/calc/RCS/CHANGES,v $ ## @(#) $Source: /usr/local/src/bin/calc/RCS/CHANGES,v $
## ##
## Under source code control: 1993/06/02 18:12:57 ## Under source code control: 1993/06/02 18:12:57

520
Makefile

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

12
alloc.h
View File

@@ -1,7 +1,7 @@
/* /*
* alloc - storage allocation and storage debug macros * alloc - storage allocation and storage debug macros
* *
* Copyright (C) 1999-2007 David I. Bell * Copyright (C) 1999-2007,2014 David I. Bell
* *
* Calc is open software; you can redistribute it and/or modify it under * Calc is open software; you can redistribute it and/or modify it under
* the terms of the version 2.1 of the GNU Lesser General Public License * the terms of the version 2.1 of the GNU Lesser General Public License
@@ -17,8 +17,8 @@
* received a copy with calc; if not, write to Free Software Foundation, Inc. * received a copy with calc; if not, write to Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* @(#) $Revision: 30.3 $ * @(#) $Revision: 30.5 $
* @(#) $Id: alloc.h,v 30.3 2013/08/11 08:41:38 chongo Exp $ * @(#) $Id: alloc.h,v 30.5 2014/08/24 21:56:51 chongo Exp $
* @(#) $Source: /usr/local/src/bin/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 * Under source code control: 1990/02/15 01:48:29
@@ -28,8 +28,8 @@
*/ */
#if !defined(__ALLOC_H__) #if !defined(INCLUDE_ALLOC_H)
#define __ALLOC_H__ #define INCLUDE_ALLOC_H
#if defined(CALC_SRC) /* if we are building from the calc source tree */ #if defined(CALC_SRC) /* if we are building from the calc source tree */
@@ -92,4 +92,4 @@ E_FUNC int strcmp();
E_FUNC void *memmove(void *s1, CONST void *s2, MEMMOVE_SIZE_T n); E_FUNC void *memmove(void *s1, CONST void *s2, MEMMOVE_SIZE_T n);
#endif #endif
#endif /* !__ALLOC_H__ */ #endif /* !INCLUDE_ALLOC_H */

View File

@@ -1,7 +1,7 @@
/* /*
* blkcpy - general values and related routines used by the calculator * blkcpy - general values and related routines used by the calculator
* *
* Copyright (C) 1999-2007 Landon Curt Noll and Ernest Bowen * Copyright (C) 1999-2007,2014 Landon Curt Noll and Ernest Bowen
* *
* Primary author: Landon Curt Noll * Primary author: Landon Curt Noll
* *
@@ -19,8 +19,8 @@
* received a copy with calc; if not, write to Free Software Foundation, Inc. * received a copy with calc; if not, write to Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* @(#) $Revision: 30.1 $ * @(#) $Revision: 30.3 $
* @(#) $Id: blkcpy.h,v 30.1 2007/03/16 11:09:46 chongo Exp $ * @(#) $Id: blkcpy.h,v 30.3 2014/08/24 21:56:51 chongo Exp $
* @(#) $Source: /usr/local/src/bin/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 * Under source code control: 1997/04/18 20:41:25
@@ -30,8 +30,8 @@
*/ */
#if !defined(__BLKCPY_H__) #if !defined(INCLUDE_BLKCPY_H)
#define __BLKCPY_H__ #define INCLUDE_BLKCPY_H
/* /*
* the main copy gateway function * the main copy gateway function
@@ -59,4 +59,4 @@ E_FUNC int copystr2blk(STRING *, long, long, BLOCK *, long, BOOL);
E_FUNC int copystr2file(STRING *, long, long, FILEID, long); E_FUNC int copystr2file(STRING *, long, long, FILEID, long);
E_FUNC int copystr2str(STRING *, long, long, STRING *, long); E_FUNC int copystr2str(STRING *, long, long, STRING *, long);
#endif /* !__BLKCPY_H__ */ #endif /* !INCLUDE_BLKCPY_H */

12
block.h
View File

@@ -1,7 +1,7 @@
/* /*
* block - fixed, dynamic, fifo and circular memory blocks * block - fixed, dynamic, fifo and circular memory blocks
* *
* Copyright (C) 1999-2007 Landon Curt Noll and Ernest Bowen * Copyright (C) 1999-2007,2014 Landon Curt Noll and Ernest Bowen
* *
* Primary author: Landon Curt Noll * Primary author: Landon Curt Noll
* *
@@ -19,8 +19,8 @@
* received a copy with calc; if not, write to Free Software Foundation, Inc. * received a copy with calc; if not, write to Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* @(#) $Revision: 30.1 $ * @(#) $Revision: 30.3 $
* @(#) $Id: block.h,v 30.1 2007/03/16 11:09:46 chongo Exp $ * @(#) $Id: block.h,v 30.3 2014/08/24 21:56:51 chongo Exp $
* @(#) $Source: /usr/local/src/bin/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 * Under source code control: 1997/02/21 05:03:39
@@ -31,8 +31,8 @@
*/ */
#if !defined(__BLOCK_H__) #if !defined(INCLUDE_BLOCK_H)
#define __BLOCK_H__ #define INCLUDE_BLOCK_H
/* /*
@@ -222,4 +222,4 @@ E_FUNC int countnblocks(void);
E_FUNC void shownblocks(void); E_FUNC void shownblocks(void);
#endif /* !__BLOCK_H__ */ #endif /* !INCLUDE_BLOCK_H */

View File

@@ -1,7 +1,7 @@
/* /*
* byteswap - byte swapping macros * byteswap - byte swapping macros
* *
* Copyright (C) 1999 Landon Curt Noll * Copyright (C) 1999,2014 Landon Curt Noll
* *
* Calc is open software; you can redistribute it and/or modify it under * Calc is open software; you can redistribute it and/or modify it under
* the terms of the version 2.1 of the GNU Lesser General Public License * the terms of the version 2.1 of the GNU Lesser General Public License
@@ -17,8 +17,8 @@
* received a copy with calc; if not, write to Free Software Foundation, Inc. * received a copy with calc; if not, write to Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* @(#) $Revision: 30.1 $ * @(#) $Revision: 30.3 $
* @(#) $Id: byteswap.h,v 30.1 2007/03/16 11:09:46 chongo Exp $ * @(#) $Id: byteswap.h,v 30.3 2014/08/24 21:56:51 chongo Exp $
* @(#) $Source: /usr/local/src/bin/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 * Under source code control: 1995/10/11 04:44:01
@@ -29,8 +29,8 @@
*/ */
#if !defined(__BYTESWAP_H__) #if !defined(INCLUDE_BYTESWAP_H)
#define __BYTESWAP_H__ #define INCLUDE_BYTESWAP_H
#if defined(CALC_SRC) /* if we are building from the calc source tree */ #if defined(CALC_SRC) /* if we are building from the calc source tree */
@@ -178,4 +178,4 @@
#endif /* LONG_BITS == 64 */ #endif /* LONG_BITS == 64 */
#endif /* !__BYTESWAP_H__ */ #endif /* !INCLUDE_BYTESWAP_H */

View File

@@ -18,8 +18,8 @@
# received a copy with calc; if not, write to Free Software Foundation, Inc. # received a copy with calc; if not, write to Free Software Foundation, Inc.
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
# #
# @(#) $Revision: 30.10 $ # @(#) $Revision: 30.11 $
# @(#) $Id: Makefile,v 30.10 2013/09/02 03:02:00 chongo Exp $ # @(#) $Id: Makefile,v 30.11 2014/09/02 07:14:49 chongo Exp $
# @(#) $Source: /usr/local/src/bin/calc/cal/RCS/Makefile,v $ # @(#) $Source: /usr/local/src/bin/calc/cal/RCS/Makefile,v $
# #
# Under source code control: 1991/07/21 05:00:54 # Under source code control: 1991/07/21 05:00:54
@@ -308,8 +308,8 @@ clobber: clean
# #
install: all install: all
-${Q} if [ ! -d ${T}${CALC_SHAREDIR} ]; then \ -${Q} if [ ! -d ${T}${CALC_SHAREDIR} ]; then \
echo ${MKDIR} ${T}${CALC_SHAREDIR}; \ echo ${MKDIR} -p ${T}${CALC_SHAREDIR}; \
${MKDIR} ${T}${CALC_SHAREDIR}; \ ${MKDIR} -p ${T}${CALC_SHAREDIR}; \
if [ ! -d "${T}${CALC_SHAREDIR}" ]; then \ if [ ! -d "${T}${CALC_SHAREDIR}" ]; then \
echo ${MKDIR} -p "${T}${CALC_SHAREDIR}"; \ echo ${MKDIR} -p "${T}${CALC_SHAREDIR}"; \
${MKDIR} -p "${T}${CALC_SHAREDIR}"; \ ${MKDIR} -p "${T}${CALC_SHAREDIR}"; \

View File

@@ -1,7 +1,7 @@
/* /*
* alg_config - help determine optimal values for algorithm levels * alg_config - help determine optimal values for algorithm levels
* *
* Copyright (C) 2006 Landon Curt Noll * Copyright (C) 2006,2014 Landon Curt Noll
* *
* Calc is open software; you can redistribute it and/or modify it under * Calc is open software; you can redistribute it and/or modify it under
* the terms of the version 2.1 of the GNU Lesser General Public License * the terms of the version 2.1 of the GNU Lesser General Public License
@@ -17,8 +17,8 @@
* received a copy with calc; if not, write to Free Software Foundation, Inc. * received a copy with calc; if not, write to Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* @(#) $Revision: 30.2 $ * @(#) $Revision: 30.11 $
* @(#) $Id: alg_config.cal,v 30.2 2013/08/11 08:41:38 chongo Exp $ * @(#) $Id: alg_config.cal,v 30.11 2014/09/07 06:13:04 chongo Exp $
* @(#) $Source: /usr/local/src/bin/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 * Under source code control: 2006/06/07 14:10:11
@@ -28,8 +28,37 @@
* Share and enjoy! :-) http://www.isthe.com/chongo/tech/comp/calc/ * Share and enjoy! :-) http://www.isthe.com/chongo/tech/comp/calc/
*/ */
static test_time; /* try for this many seconds in loop test */
global test_time; /* try for this many seconds in loop test */
/*
* close_to_one - set to 1 if the ratio is close enough to 1
*
* given:
* ratio the ratio of time between two algorithms
*
* retuns:
* 1 When ratio is near 1.0
* 0 otherwise
*
* We consider the range [0.995, 1.005] to be close enough to 1 to be call unity
* because of the precision of the CPU timing.
*/
define close_to_one(ratio)
{
/* firewall */
if (!isreal(ratio)) {
quit "close: 1st arg: must be a real number";
}
/* check if the ratio is far from unity */
if ((ratio < 0.995) || (ratio > 1.005)) {
return 0;
}
/* we are close to unity */
return 1;
}
/* /*
@@ -143,7 +172,7 @@ define mul_loop(repeat, x)
* len length in BASEB-bit words to multiply * len length in BASEB-bit words to multiply
* *
* return: * return:
* ratio of (1st / 2nd) algorithm rate * ratio of (1st / 2nd) algorithm rate.
* *
* When want to determine a rate to a precision of 1 part in 1000. * When want to determine a rate to a precision of 1 part in 1000.
* Most systems today return CPU time to at least 10 msec precision. * Most systems today return CPU time to at least 10 msec precision.
@@ -166,6 +195,7 @@ define mul_ratio(len)
local tover; /* est of time for loop overhead */ local tover; /* est of time for loop overhead */
local alg1_rate; /* loop rate of 1st algorithm */ local alg1_rate; /* loop rate of 1st algorithm */
local alg2_rate; /* loop rate of 2nd algorithm */ local alg2_rate; /* loop rate of 2nd algorithm */
local ret; /* return ratio, or 1.0 */
local i; local i;
/* /*
@@ -218,12 +248,12 @@ define mul_ratio(len)
* determine the 1st algorithm rate * determine the 1st algorithm rate
*/ */
loops = max(1, ceil(loops * test_time / tlen)); loops = max(1, ceil(loops * test_time / tlen));
if (loops < 8) { if (loops < 16) {
if (config("user_debug") > 1) { if (config("user_debug") > 1) {
printf(" we must expand loop test time to more than %d secs\n", printf(" we must expand alg1 loop test time to about %d secs\n",
ceil(test_time * (8 / loops))); ceil(test_time * (16 / loops)));
} }
loops = 8; loops = 16;
} }
if (config("user_debug") > 3) { if (config("user_debug") > 3) {
printf("\t will try alg1 %d loops\n", loops); printf("\t will try alg1 %d loops\n", loops);
@@ -264,12 +294,12 @@ define mul_ratio(len)
* determine the 2nd algorithm rate * determine the 2nd algorithm rate
*/ */
loops = max(1, ceil(loops * test_time / tlen)); loops = max(1, ceil(loops * test_time / tlen));
if (loops < 8) { if (loops < 16) {
if (config("user_debug") > 1) { if (config("user_debug") > 1) {
printf(" we must expand loop test time to more than %d secs\n", printf(" we must expand alg2 loop test time to about %d secs\n",
ceil(test_time * (8 / loops))); ceil(test_time * (16 / loops)));
} }
loops = 8; loops = 16;
} }
tlen = mul_loop(loops, &x); tlen = mul_loop(loops, &x);
if (config("user_debug") > 3) { if (config("user_debug") > 3) {
@@ -298,7 +328,12 @@ define mul_ratio(len)
/* /*
* return alg1 / alg2 rate ratio * return alg1 / alg2 rate ratio
*/ */
return (alg1_rate / alg2_rate); ret = alg1_rate / alg2_rate;
if (config("user_debug") > 2) {
printf("\tprecise ratio is: %.f mul_ratio will return: %.3f\n",
alg1_rate / alg2_rate, ret);
}
return ret;
} }
@@ -320,30 +355,39 @@ define best_mul2()
{ {
local ratio; /* previously calculated alg1/alg2 ratio */ local ratio; /* previously calculated alg1/alg2 ratio */
local low; /* low loop value tested */ local low; /* low loop value tested */
local high; /* low loop value tested */ local high; /* high loop value tested */
local mid; /* between low and high */
local best_val; /* value found with ratio closest to unity */
local best_ratio; /* cloest ratio found to unity */
local expand; /* how fast to expand the length */ local expand; /* how fast to expand the length */
/* /*
* setup * setup
*/ */
test_time = 15.0; test_time = 30.0;
if (config("user_debug") > 0) { printf("The best_mul2() function will take a LONG time to run!\n");
printf("will start with loop test time of %d secs\n", test_time); printf("It is important that best_mul2() run on an othwewise idle host!\n");
if (config("user_debug") <= 0) {
printf("To monitor progress, set user_debug to 2: "
"config(\"user_debug\", 2)\n");
} }
printf("Starting with loop test time of %d secs\n", test_time);
/* /*
* firewall - must have a >1 ratio for the initial length * firewall - must have a >1 ratio for the initial length
*/ */
high = 16; high = 16;
best_val = high;
if (config("user_debug") > 0) { if (config("user_debug") > 0) {
printf("testing multiply alg1/alg2 ratio for len = %d\n", high); printf("testing multiply alg1/alg2 ratio for len = %d\n", high);
} }
ratio = mul_ratio(high); ratio = mul_ratio(high);
best_ratio = ratio;
if (config("user_debug") > 1) { if (config("user_debug") > 1) {
printf(" multiply alg1/alg2 ratio = %.3f\n", ratio); printf(" multiply alg1/alg2 ratio = %.6f\n", ratio);
} }
if (ratio <= 1.0) { if (ratio < 1.0) {
quit "best_mul2: tests imply config(\"mul2\") should be < 4"; quit "best_mul2: tests imply mul2 should be < 16, which seems bogus";
} }
/* /*
@@ -356,7 +400,7 @@ define best_mul2()
* We will multiplicatively expand our test level until * We will multiplicatively expand our test level until
* the ratio drops below 1.0. * the ratio drops below 1.0.
*/ */
expand = ((ratio >= 3.5) ? 16 : 2^round(ratio)); expand = ((ratio >= 10) ? 1024 : 2^round(ratio));
low = high; low = high;
high *= expand; high *= expand;
if (config("user_debug") > 1) { if (config("user_debug") > 1) {
@@ -368,20 +412,63 @@ define best_mul2()
* determine the alg1/alg2 test ratio for this new length * determine the alg1/alg2 test ratio for this new length
*/ */
if (high >= 2^31) { if (high >= 2^31) {
quit "best_mul2: tests imply config(\"mul2\") should be >= 2^31"; quit "best_mul2: test implies mul2 >= 2^31, which seems bogus";
} }
if (config("user_debug") > 0) { if (config("user_debug") > 0) {
printf("testing multiply alg1/alg2 ratio for len = %d\n", high); printf("testing multiply alg1/alg2 ratio for len = %d\n", high);
} }
ratio = mul_ratio(high); ratio = mul_ratio(high);
if (config("user_debug") > 1) { if (abs(ratio - 1.0) < abs(best_ratio - 1.0)) {
printf(" multiply alg1/alg2 ratio = %.3f\n", ratio); best_val = high;
best_ratio = ratio;
if (config("user_debug") > 1) {
printf(" len %d has a new cloest ratio to unity: %.6f\n",
best_val, best_ratio);
}
} }
} while (ratio >= 1.0); if (config("user_debug") > 1) {
printf(" multiply alg1/alg2 ratio = %.6f\n", ratio);
}
} while (ratio > 1.0);
/*
* If we previously expanded more than by a factor of 2, then
* we may have jumped over the crossover point. So now
* drop down powers of two until the ratio is again >= 1.0
*/
if (expand > 2) {
do {
/*
* contract by 2
*/
high /= 2;
low = high / 2;
if (config("user_debug") > 0) {
printf("retesting multiply alg1/alg2 ratio for len = %d\n",
high);
}
ratio = mul_ratio(high);
if (abs(ratio - 1.0) < abs(best_ratio - 1.0)) {
best_val = high;
best_ratio = ratio;
if (config("user_debug") > 1) {
printf(" len %d has a new cloest ratio to unity: %.6f\n",
best_val, best_ratio);
}
}
if (config("user_debug") > 1) {
printf(" multiply alg1/alg2 ratio = %.6f\n", ratio);
}
} while (ratio <= 1.0);
/* now that the ratio flipped again, use the previous range */
low = high;
high = high * 2;
}
if (config("user_debug") > 0) { if (config("user_debug") > 0) {
printf("alg1/alg2 ratio now < 1.0, starting binary search " printf("Starting binary search between %d and %d\n", low, high);
"between %d and %d\n",
low, high);
} }
/* /*
@@ -390,30 +477,54 @@ define best_mul2()
while (low+1 < high) { while (low+1 < high) {
/* try the mid-point */ /* try the mid-point */
mid = int((low+high)/2);
if (config("user_debug") > 0) { if (config("user_debug") > 0) {
printf("testing multiply alg1/alg2 ratio for len = %d\n", printf("testing multiply alg1/alg2 ratio for len = %d\n", mid);
int((low+high)/2)); }
ratio = mul_ratio(mid);
if (abs(ratio - 1.0) < abs(best_ratio - 1.0)) {
best_val = mid;
best_ratio = ratio;
if (config("user_debug") > 1) {
printf(" len %d has a new cloest ratio to unity: %.6f\n",
best_val, best_ratio);
}
} }
ratio = mul_ratio(int((low+high)/2));
if (config("user_debug") > 1) { if (config("user_debug") > 1) {
printf(" multiply alg1/alg2 ratio = %.3f\n", ratio); printf(" len %d multiply alg1/alg2 ratio = %.6f\n", mid, ratio);
}
/* stop search if near unity */
if (close_to_one(ratio)) {
low = mid;
high = mid;
if (config("user_debug") > 0) {
printf("\twe are close enough to unity ratio at: %d\n", mid);
}
break;
} }
/* bump lower range up if we went over */ /* bump lower range up if we went over */
if (ratio >= 1.0) { if (ratio > 1.0) {
if (config("user_debug") > 2) { if (config("user_debug") > 2) {
printf("\tmove low from %d up to %d\n", printf("\tmove low from %d up to %d\n",
low, int((low+high)/2)); low, mid);
} }
low = int((low+high)/2); low = mid;
/* drop higher range down if we went under */ /* drop higher range down if we went under */
} else { } else {
if (config("user_debug") > 2) { if (config("user_debug") > 2) {
printf("\tmove high from %d down to %d\n", printf("\tmove high from %d down to %d\n",
high, int((low+high)/2)); high, mid);
} }
high = int((low+high)/2); high = mid;
}
/* report on test loop progress */
if (config("user_debug") > 1) {
printf("\tsetting low: %d high: %d diff: %d\n",
low, high, high-low);
} }
} }
@@ -421,10 +532,15 @@ define best_mul2()
* return on the suggested config("mul2") value * return on the suggested config("mul2") value
*/ */
if (config("user_debug") > 0) { if (config("user_debug") > 0) {
printf("best value of config(\"mul2\") is %d\n", printf("Best value for multiply is near %d\n", best_val);
(ratio >= 1.0) ? high : low); printf("Best multiply alg1/alg2 ratio is: %.6f\n", best_ratio);
printf("We suggest placing this line in your .calcrc:\n");
printf("config(\"mul2\", %d),;\n", best_val);
printf("WARNING: It is believed that the output "
"of this resource file is bogus!\n");
printf("WARNING: You may NOT wish to follow the above suggeston.\n");
} }
return ((ratio >= 1.0) ? high : low); return mid;
} }
@@ -562,6 +678,7 @@ define sq_ratio(len)
local tover; /* est of time for loop overhead */ local tover; /* est of time for loop overhead */
local alg1_rate; /* loop rate of 1st algorithm */ local alg1_rate; /* loop rate of 1st algorithm */
local alg2_rate; /* loop rate of 2nd algorithm */ local alg2_rate; /* loop rate of 2nd algorithm */
local ret; /* return ratio, or 1.0 */
local i; local i;
/* /*
@@ -614,12 +731,12 @@ define sq_ratio(len)
* determine the 1st algorithm rate * determine the 1st algorithm rate
*/ */
loops = max(1, ceil(loops * test_time / tlen)); loops = max(1, ceil(loops * test_time / tlen));
if (loops < 8) { if (loops < 16) {
if (config("user_debug") > 1) { if (config("user_debug") > 1) {
printf(" we must expand loop test time to more than %d secs\n", printf(" we must expand alg1 loop test time to about %d secs\n",
ceil(test_time * (8 / loops))); ceil(test_time * (16 / loops)));
} }
loops = 8; loops = 16;
} }
tlen = sq_loop(loops, &x); tlen = sq_loop(loops, &x);
if (config("user_debug") > 3) { if (config("user_debug") > 3) {
@@ -657,12 +774,12 @@ define sq_ratio(len)
* determine the 2nd algorithm rate * determine the 2nd algorithm rate
*/ */
loops = max(1, ceil(loops * test_time / tlen)); loops = max(1, ceil(loops * test_time / tlen));
if (loops < 8) { if (loops < 16) {
if (config("user_debug") > 1) { if (config("user_debug") > 1) {
printf(" we must expand loop test time to more than %d secs\n", printf(" we must expand alg2 loop test time to about %d secs\n",
ceil(test_time * (8 / loops))); ceil(test_time * (16 / loops)));
} }
loops = 8; loops = 16;
} }
tlen = sq_loop(loops, &x); tlen = sq_loop(loops, &x);
if (config("user_debug") > 3) { if (config("user_debug") > 3) {
@@ -691,7 +808,12 @@ define sq_ratio(len)
/* /*
* return alg1 / alg2 rate ratio * return alg1 / alg2 rate ratio
*/ */
return (alg1_rate / alg2_rate); ret = alg1_rate / alg2_rate;
if (config("user_debug") > 2) {
printf("\tprecise ratio is: %.f sq_ratio will return: %.3f\n",
alg1_rate / alg2_rate, ret);
}
return ret;
} }
@@ -713,30 +835,39 @@ define best_sq2()
{ {
local ratio; /* previously calculated alg1/alg2 ratio */ local ratio; /* previously calculated alg1/alg2 ratio */
local low; /* low loop value tested */ local low; /* low loop value tested */
local high; /* low loop value tested */ local high; /* high loop value tested */
local mid; /* between low and high */
local best_val; /* value found with ratio closest to unity */
local best_ratio; /* cloest ratio found to unity */
local expand; /* how fast to expand the length */ local expand; /* how fast to expand the length */
/* /*
* setup * setup
*/ */
test_time = 15.0; test_time = 30.0;
if (config("user_debug") > 0) { printf("The best_sq2() function will take a LONG time to run!\n");
printf("will start with loop test time of %d secs\n", test_time); printf("It is important that best_sq2() run on an othwewise idle host!\n");
if (config("user_debug") <= 0) {
printf("To monitor progress, set user_debug to 2: "
"config(\"user_debug\", 2)\n");
} }
printf("Starting with loop test time of %d secs\n", test_time);
/* /*
* firewall - must have a >1 ratio for the initial length * firewall - must have a >1 ratio for the initial length
*/ */
high = 16; high = 16;
best_val = high;
if (config("user_debug") > 0) { if (config("user_debug") > 0) {
printf("testing square alg1/alg2 ratio for len = %d\n", high); printf("testing square alg1/alg2 ratio for len = %d\n", high);
} }
ratio = sq_ratio(high); ratio = sq_ratio(high);
best_ratio = ratio;
if (config("user_debug") > 1) { if (config("user_debug") > 1) {
printf(" square alg1/alg2 ratio = %.3f\n", ratio); printf(" square alg1/alg2 ratio = %.3f\n", ratio);
} }
if (ratio <= 1.0) { if (ratio < 1.0) {
quit "best_sq2: tests imply config(\"sq2\") should be < 4"; quit "best_sq2: test implies sq2 < 16, which seems bogus";
} }
/* /*
@@ -749,32 +880,75 @@ define best_sq2()
* We will multiplicatively expand our test level until * We will multiplicatively expand our test level until
* the ratio drops below 1.0. * the ratio drops below 1.0.
*/ */
expand = ((ratio >= 3.5) ? 16 : 2^round(ratio)); expand = ((ratio >= 10) ? 1024 : 2^round(ratio));
low = high; low = high;
high *= expand; high *= expand;
if (config("user_debug") > 1) { if (config("user_debug") > 1) {
printf(" expand the next test range by a factor of %d\n", printf(" expand the next test range by a factor of %d\n",
expand); expand);
} }
/* /*
* determine the alg1/alg2 test ratio for this new length * determine the alg1/alg2 test ratio for this new length
*/ */
if (high >= 2^31) { if (high >= 2^31) {
quit "best_sq2: tests imply config(\"sq2\") should be >= 2^31"; quit "best_sq2: tests imply sq2 >= 2^31, which seems bogus";
} }
if (config("user_debug") > 0) { if (config("user_debug") > 0) {
printf("testing square alg1/alg2 ratio for len = %d\n", high); printf("testing square alg1/alg2 ratio for len = %d\n", high);
} }
ratio = sq_ratio(high); ratio = sq_ratio(high);
if (abs(ratio - 1.0) < abs(best_ratio - 1.0)) {
best_val = high;
best_ratio = ratio;
if (config("user_debug") > 1) {
printf(" len %d has a new cloest ratio to unity: %.6f\n",
best_val, best_ratio);
}
}
if (config("user_debug") > 1) { if (config("user_debug") > 1) {
printf(" square alg1/alg2 ratio = %.3f\n", ratio); printf(" square alg1/alg2 ratio = %.3f\n", ratio);
} }
} while (ratio >= 1.0); } while (ratio > 1.0);
/*
* If we previously expanded more than by a factor of 2, then
* we may have jumped over the crossover point. So now
* drop down powers of two until the ratio is again >= 1.0
*/
if (expand > 2) {
do {
/*
* contract by 2
*/
high /= 2;
low = high / 2;
if (config("user_debug") > 0) {
printf("retesting multiply alg1/alg2 ratio for len = %d\n",
high);
}
ratio = mul_ratio(high);
if (abs(ratio - 1.0) < abs(best_ratio - 1.0)) {
best_val = high;
best_ratio = ratio;
if (config("user_debug") > 1) {
printf(" len %d has a new cloest ratio to unity: %.6f\n",
best_val, best_ratio);
}
}
if (config("user_debug") > 1) {
printf(" multiply alg1/alg2 ratio = %.6f\n", ratio);
}
} while (ratio <= 1.0);
/* now that the ratio flipped again, use the previous range */
low = high;
high = high * 2;
}
if (config("user_debug") > 0) { if (config("user_debug") > 0) {
printf("alg1/alg2 ratio now < 1.0, starting binary search " printf("Starting binary search between %d and %d\n", low, high);
"between %d and %d\n",
low, high);
} }
/* /*
@@ -783,41 +957,71 @@ define best_sq2()
while (low+1 < high) { while (low+1 < high) {
/* try the mid-point */ /* try the mid-point */
mid = int((low+high)/2);
if (config("user_debug") > 0) { if (config("user_debug") > 0) {
printf("testing square alg1/alg2 ratio for len = %d\n", printf("testing square alg1/alg2 ratio for len = %d\n", mid);
int((low+high)/2)); }
ratio = sq_ratio(mid);
if (abs(ratio - 1.0) < abs(best_ratio - 1.0)) {
best_val = mid;
best_ratio = ratio;
if (config("user_debug") > 1) {
printf(" len %d has a new cloest ratio to unity: %.6f\n",
best_val, best_ratio);
}
} }
ratio = sq_ratio(int((low+high)/2));
if (config("user_debug") > 1) { if (config("user_debug") > 1) {
printf(" square alg1/alg2 ratio = %.3f\n", ratio); printf(" len %d square alg1/alg2 ratio = %.6f\n", mid, ratio);
}
/* stop search if near unity */
if (close_to_one(ratio)) {
low = mid;
high = mid;
if (config("user_debug") > 0) {
printf("\twe are close enough to unity ratio at: %d\n", mid);
}
break;
} }
/* bump lower range up if we went over */ /* bump lower range up if we went over */
if (ratio >= 1.0) { if (ratio > 1.0) {
if (config("user_debug") > 2) { if (config("user_debug") > 2) {
printf("\tmove low from %d up to %d\n", printf("\tmove low from %d up to %d\n",
low, int((low+high)/2)); low, mid);
} }
low = int((low+high)/2); low = mid;
/* drop higher range down if we went under */ /* drop higher range down if we went under */
} else { } else {
if (config("user_debug") > 2) { if (config("user_debug") > 2) {
printf("\tmove high from %d down to %d\n", printf("\tmove high from %d down to %d\n",
high, int((low+high)/2)); high, mid);
} }
high = int((low+high)/2); high = mid;
}
/* report on test loop progress */
if (config("user_debug") > 1) {
printf("\tsetting low: %d high: %d diff: %d\n",
low, high, high-low);
} }
} }
/* /*
* return on the suggested config("sq2") value * return on the suggested config("sq2") value
*/ */
mid = int((low+high)/2);
if (config("user_debug") > 0) { if (config("user_debug") > 0) {
printf("best value of config(\"sq2\") is %d\n", printf("Best value for square is near %d\n", best_val);
(ratio >= 1.0) ? high : low); printf("Best square alg1/alg2 ratio is: %.6f\n", best_ratio);
printf("We suggest placing this line in your .calcrc:\n");
printf("config(\"sq2\", %d),;\n", best_val);
printf("WARNING: It is believed that the output "
"of this resource file is bogus!\n");
printf("WARNING: You may NOT wish to follow the above suggeston.\n");
} }
return ((ratio >= 1.0) ? high : low); return mid;
} }
@@ -968,6 +1172,7 @@ define pow_ratio(len)
local alg1_rate; /* loop rate of 1st algorithm */ local alg1_rate; /* loop rate of 1st algorithm */
local alg2_rate; /* loop rate of 2nd algorithm */ local alg2_rate; /* loop rate of 2nd algorithm */
local ex; /* exponent to use in pow_loop() */ local ex; /* exponent to use in pow_loop() */
local ret; /* return ratio, or 1.0 */
local i; local i;
/* /*
@@ -990,7 +1195,7 @@ define pow_ratio(len)
/* /*
* setup * setup
*/ */
ex = 5; ex = 7;
/* /*
* initialize x, the values we will pmod * initialize x, the values we will pmod
@@ -1026,12 +1231,12 @@ define pow_ratio(len)
* determine the 1st algorithm rate * determine the 1st algorithm rate
*/ */
loops = max(1, ceil(loops * test_time / tlen)); loops = max(1, ceil(loops * test_time / tlen));
if (loops < 8) { if (loops < 16) {
if (config("user_debug") > 1) { if (config("user_debug") > 1) {
printf(" we must expand loop test time to more than %d secs\n", printf(" we must expand alg1 loop test time to about %d secs\n",
ceil(test_time * (8 / loops))); ceil(test_time * (16 / loops)));
} }
loops = 8; loops = 16;
} }
tlen = pow_loop(loops, &x, ex); tlen = pow_loop(loops, &x, ex);
if (config("user_debug") > 3) { if (config("user_debug") > 3) {
@@ -1070,12 +1275,12 @@ define pow_ratio(len)
* determine the 2nd algorithm rate * determine the 2nd algorithm rate
*/ */
loops = max(1, ceil(loops * test_time / tlen)); loops = max(1, ceil(loops * test_time / tlen));
if (loops < 8) { if (loops < 16) {
if (config("user_debug") > 1) { if (config("user_debug") > 1) {
printf(" we must expand loop test time to more than %d secs\n", printf(" we must expand alg2 loop test time to about %d secs\n",
ceil(test_time * (8 / loops))); ceil(test_time * (16 / loops)));
} }
loops = 8; loops = 16;
} }
tlen = pow_loop(loops, &x, ex); tlen = pow_loop(loops, &x, ex);
if (config("user_debug") > 3) { if (config("user_debug") > 3) {
@@ -1104,7 +1309,12 @@ define pow_ratio(len)
/* /*
* return alg1 / alg2 rate ratio * return alg1 / alg2 rate ratio
*/ */
return (alg1_rate / alg2_rate); ret = alg1_rate / alg2_rate;
if (config("user_debug") > 2) {
printf("\tprecise ratio is: %.f pow_ratio will return: %.3f\n",
alg1_rate / alg2_rate, ret);
}
return ret;
} }
@@ -1126,17 +1336,24 @@ define best_pow2()
{ {
local ratio; /* previously calculated alg1/alg2 ratio */ local ratio; /* previously calculated alg1/alg2 ratio */
local low; /* low loop value tested */ local low; /* low loop value tested */
local high; /* low loop value tested */ local high; /* high loop value tested */
local mid; /* between low and high */
local best_val; /* value found with ratio closest to unity */
local best_ratio; /* cloest ratio found to unity */
local expand; /* how fast to expand the length */ local expand; /* how fast to expand the length */
local looped; /* 1 ==> we have expanded lengths before */ local looped; /* 1 ==> we have expanded lengths before */
/* /*
* setup * setup
*/ */
test_time = 15.0; test_time = 60.0;
if (config("user_debug") > 0) { printf("The best_pow2() function will take a LONG time to run!\n");
printf("will start with loop test time of %d secs\n", test_time); printf("It is important that best_pow2() run on an othwewise idle host!\n");
if (config("user_debug") <= 0) {
printf("To monitor progress, set user_debug to 2: "
"config(\"user_debug\", 2)\n");
} }
printf("Starting with loop test time of %d secs\n", test_time);
/* /*
* firewall - must have a >1.02 ratio for the initial length * firewall - must have a >1.02 ratio for the initial length
@@ -1147,12 +1364,22 @@ define best_pow2()
*/ */
low = 4; low = 4;
high = 4; high = 4;
best_val = high;
best_ratio = 1e10; /* not a real value */
do { do {
high *= 4; high *= 4;
if (config("user_debug") > 0) { if (config("user_debug") > 0) {
printf("testing pmod alg1/alg2 ratio for len = %d\n", high); printf("testing pmod alg1/alg2 ratio for len = %d\n", high);
} }
ratio = pow_ratio(high); ratio = pow_ratio(high);
if (abs(ratio - 1.0) < abs(best_ratio - 1.0)) {
best_val = high;
best_ratio = ratio;
if (config("user_debug") > 1) {
printf(" len %d has a new cloest ratio to unity: %.6f\n",
best_val, best_ratio);
}
}
if (config("user_debug") > 1) { if (config("user_debug") > 1) {
printf(" pmod alg1/alg2 ratio = %.3f\n", ratio); printf(" pmod alg1/alg2 ratio = %.3f\n", ratio);
if (ratio > 1.0 && ratio <= 1.02) { if (ratio > 1.0 && ratio <= 1.02) {
@@ -1199,20 +1426,27 @@ define best_pow2()
* determine the alg1/alg2 test ratio for this new length * determine the alg1/alg2 test ratio for this new length
*/ */
if (high >= 2^31) { if (high >= 2^31) {
quit "best_pow2: tests imply config(\"pow2\") should be >= 2^31"; quit "best_pow2: test implies pow2 >= 2^31, which seems bogus";
} }
if (config("user_debug") > 0) { if (config("user_debug") > 0) {
printf("testing pmod alg1/alg2 ratio for len = %d\n", high); printf("testing pmod alg1/alg2 ratio for len = %d\n", high);
} }
ratio = pow_ratio(high); ratio = pow_ratio(high);
if (abs(ratio - 1.0) < abs(best_ratio - 1.0)) {
best_val = high;
best_ratio = ratio;
if (config("user_debug") > 1) {
printf(" len %d has a new cloest ratio to unity: %.6f\n",
best_val, best_ratio);
}
}
if (config("user_debug") > 1) { if (config("user_debug") > 1) {
printf(" pmod alg1/alg2 ratio = %.3f\n", ratio); printf(" pmod alg1/alg2 ratio = %.6f\n", ratio);
} }
looped = 1; looped = 1;
} while (ratio >= 1.0); } while (ratio > 1.0);
if (config("user_debug") > 0) { if (config("user_debug") > 0) {
printf("alg1/alg2 ratio now < 1.0, starting binary search " printf("Starting binary search between %d and %d\n", low, high);
"between %d and %d\n", low, high);
} }
/* /*
@@ -1221,39 +1455,69 @@ define best_pow2()
while (low+1 < high) { while (low+1 < high) {
/* try the mid-point */ /* try the mid-point */
mid = int((low+high)/2);
if (config("user_debug") > 0) { if (config("user_debug") > 0) {
printf("testing pmod alg1/alg2 ratio for len = %d\n", printf("testing pow2 alg1/alg2 ratio for len = %d\n", mid);
int((low+high)/2)); }
ratio = pow_ratio(mid);
if (abs(ratio - 1.0) < abs(best_ratio - 1.0)) {
best_val = mid;
best_ratio = ratio;
if (config("user_debug") > 1) {
printf(" len %d has a new cloest ratio to unity: %.6f\n",
best_val, best_ratio);
}
} }
ratio = pow_ratio(int((low+high)/2));
if (config("user_debug") > 1) { if (config("user_debug") > 1) {
printf(" pmod alg1/alg2 ratio = %.3f\n", ratio); printf(" len %d pmod alg1/alg2 ratio = %.6f\n", mid, ratio);
}
/* stop search if near unity */
if (close_to_one(ratio)) {
low = mid;
high = mid;
if (config("user_debug") > 0) {
printf("\twe are close enough to unity ratio at: %d\n", mid);
}
break;
} }
/* bump lower range up if we went over */ /* bump lower range up if we went over */
if (ratio >= 1.0) { if (ratio > 1.0) {
if (config("user_debug") > 2) { if (config("user_debug") > 2) {
printf("\tmove low from %d up to %d\n", printf("\tmove low from %d up to %d\n",
low, int((low+high)/2)); low, mid);
} }
low = int((low+high)/2); low = mid;
/* drop higher range down if we went under */ /* drop higher range down if we went under */
} else { } else {
if (config("user_debug") > 2) { if (config("user_debug") > 2) {
printf("\tmove high from %d down to %d\n", printf("\tmove high from %d down to %d\n",
high, int((low+high)/2)); high, mid);
} }
high = int((low+high)/2); high = mid;
}
/* report on test loop progress */
if (config("user_debug") > 1) {
printf("\tsetting low: %d high: %d diff: %d\n",
low, high, high-low);
} }
} }
/* /*
* return on the suggested config("pow2") value * return on the suggested config("pow2") value
*/ */
mid = int((low+high)/2);
if (config("user_debug") > 0) { if (config("user_debug") > 0) {
printf("best value of config(\"pow2\") is %d\n", printf("Best value for pmod is near %d\n", best_val);
(ratio >= 1.0) ? high : low); printf("Best pmod alg1/alg2 ratio is: %.6f\n", best_ratio);
printf("We suggest placing this line in your .calcrc:\n");
printf("config(\"pow2\", %d),;\n", best_val);
printf("WARNING: It is believed that the output "
"of this resource file is bogus!\n");
printf("WARNING: You may NOT wish to follow the above suggeston.\n");
} }
return ((ratio >= 1.0) ? high : low); return mid;
} }

12
calc.h
View File

@@ -1,7 +1,7 @@
/* /*
* calc - definitions for calculator program * calc - definitions for calculator program
* *
* Copyright (C) 1999-2007 David I. Bell * Copyright (C) 1999-2007,2014 David I. Bell
* *
* Calc is open software; you can redistribute it and/or modify it under * Calc is open software; you can redistribute it and/or modify it under
* the terms of the version 2.1 of the GNU Lesser General Public License * the terms of the version 2.1 of the GNU Lesser General Public License
@@ -17,8 +17,8 @@
* received a copy with calc; if not, write to Free Software Foundation, Inc. * received a copy with calc; if not, write to Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* @(#) $Revision: 30.4 $ * @(#) $Revision: 30.6 $
* @(#) $Id: calc.h,v 30.4 2013/09/01 22:16:21 chongo Exp $ * @(#) $Id: calc.h,v 30.6 2014/08/24 21:56:51 chongo Exp $
* @(#) $Source: /usr/local/src/bin/calc/RCS/calc.h,v $ * @(#) $Source: /usr/local/src/bin/calc/RCS/calc.h,v $
* *
* Under source code control: 1990/02/15 01:48:31 * Under source code control: 1990/02/15 01:48:31
@@ -28,8 +28,8 @@
*/ */
#if !defined(__CALC_H__) #if !defined(INCLUDE_CALC_H)
#define __CALC_H__ #define INCLUDE_CALC_H
#include <setjmp.h> #include <setjmp.h>
#if defined(CALC_SRC) /* if we are building from the calc source tree */ #if defined(CALC_SRC) /* if we are building from the calc source tree */
@@ -267,4 +267,4 @@ EXTERN char *Copyright;
E_FUNC char *version(void); E_FUNC char *version(void);
#endif /* !__CALC_H__ */ #endif /* !INCLUDE_CALC_H */

View File

@@ -1,8 +1,7 @@
#****h* calc/calc.spec.in
# #
# calc.spec.in - template specfile for calc # calc.spec.in - template specfile for calc
# #
# Copyright (C) 2003-2013 Petteri Kettunen and Landon Curt Noll # Copyright (C) 2003-2014 Petteri Kettunen and Landon Curt Noll
# #
# Calc is open software; you can redistribute it and/or modify it under # Calc is open software; you can redistribute it and/or modify it under
# the terms of the version 2.1 of the GNU Lesser General Public License # the terms of the version 2.1 of the GNU Lesser General Public License
@@ -18,8 +17,8 @@
# received a copy with calc; if not, write to Free Software Foundation, Inc. # received a copy with calc; if not, write to Free Software Foundation, Inc.
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
# #
# @(#) $Revision: 30.12 $ # @(#) $Revision: 30.23 $
# @(#) $Id: calc.spec.in,v 30.12 2013/09/02 03:04:26 chongo Exp $ # @(#) $Id: calc.spec.in,v 30.23 2014/09/22 05:01:58 chongo Exp $
# @(#) $Source: /usr/local/src/bin/calc/RCS/calc.spec.in,v $ # @(#) $Source: /usr/local/src/bin/calc/RCS/calc.spec.in,v $
# #
# Under source code control: 2003/02/16 20:21:39 # Under source code control: 2003/02/16 20:21:39
@@ -31,13 +30,13 @@
# BUGS # BUGS
# - Uninstalling calc and calc-devel leaves empty dirs /usr/include/calc # - Uninstalling calc and calc-devel leaves empty dirs /usr/include/calc
# and /usr/share/calc and its subdirs. In case e.g. %{_includedir}/calc # and /usr/share/calc and its subdirs. In case e.g. %{_includedir}/calc
# is defined in `%files devel' section, then rpmbuild complains that # is defined in `files devel' section, then rpmbuild complains that
# header files are defined twice - rpmbuild bug or bug in specfile conf??? # header files are defined twice - rpmbuild bug or bug in specfile conf???
Summary: Arbitrary precision calculator. Summary: Arbitrary precision calculator.
Name: calc Name: calc
Version: <<<PROJECT_VERSION>>> Version: <<<PROJECT_VERSION>>>
Release: 11 Release: 12
License: LGPL License: LGPL
Group: Applications/Engineering Group: Applications/Engineering
Source: http://www.isthe.com/chongo/src/calc/%{name}-%{version}.tar.bz2 Source: http://www.isthe.com/chongo/src/calc/%{name}-%{version}.tar.bz2
@@ -46,6 +45,8 @@ Vendor: Landon Noll and Associates
Packager: Landon Noll and Associates (http://www.isthe.com/chongo/index.html) Packager: Landon Noll and Associates (http://www.isthe.com/chongo/index.html)
Requires: ncurses >= 5.5-24, readline >= 5.1-3, less >= 358 Requires: ncurses >= 5.5-24, readline >= 5.1-3, less >= 358
BuildRequires: ncurses-devel >= 5.5-24, readline-devel >= 5.1-3 BuildRequires: ncurses-devel >= 5.5-24, readline-devel >= 5.1-3
Provides: libcalc.so.%{version}()(64bit)
Provides: libcustcalc.so.%{version}()(64bit)
BuildRoot: %{_tmppath}/build-root BuildRoot: %{_tmppath}/build-root
%description %description
@@ -61,7 +62,10 @@ For the latest calc release, see the calc project home page:
%package devel %package devel
Summary: Development files and documentation for calc. Summary: Development files and documentation for calc.
Group: Applications/Engineering Group: Applications/Engineering
Requires: calc = %{version}-%{release} Requires: calc(x86-64) = %{version}-%{release}
Requires: libcalc.so.%{version}()(64bit)
Requires: libcustcalc.so.%{version}()(64bit)
Requires: ncurses >= 5.5-24, readline >= 5.1-3, less >= 358
%description devel %description devel
This package contains the header files and static libraries for developing This package contains the header files and static libraries for developing
@@ -76,63 +80,67 @@ For the latest calc release, see the project home page:
%build %build
echo '-=- calc.spec beginning make clobber -=-' echo '-=- calc.spec beginning make clobber -=-'
make %{?_smp_mflags} T=%{_buildroot} BINDIR=%{_bindir} LIBDIR=%{_libdir} \ make -j1 T=%{_buildroot} BINDIR=%{_bindir} LIBDIR=%{_libdir} \
CALC_SHAREDIR=%{_datadir}/%{name} CALC_INCDIR=%{_includedir}/calc \ CALC_SHAREDIR=%{_datadir}/%{name} CALC_INCDIR=%{_includedir}/calc \
MANDIR=%{_mandir}/man1 EXT= V=@ clobber MANDIR=%{_mandir}/man1 EXT= V=@ clobber
echo '-=- calc.spec ending make clobber -=-' echo '-=- calc.spec ending make clobber -=-'
echo '-=- calc.spec beginning make calc-static-only -=-' echo '-=- calc.spec beginning make calc-static-only -=-'
make %{?_smp_mflags} T=%{_buildroot} BINDIR=%{_bindir} LIBDIR=%{_libdir} \ make -j1 T=%{_buildroot} BINDIR=%{_bindir} LIBDIR=%{_libdir} \
CALC_SHAREDIR=%{_datadir}/%{name} CALC_INCDIR=%{_includedir}/calc \ CALC_SHAREDIR=%{_datadir}/%{name} CALC_INCDIR=%{_includedir}/calc \
MANDIR=%{_mandir}/man1 EXT= V=@ calc-static-only BLD_TYPE=calc-static-only MANDIR=%{_mandir}/man1 EXT= V=@ calc-static-only BLD_TYPE=calc-static-only
echo '-=- calc.spec ending make calc-static-only -=-' echo '-=- calc.spec ending make calc-static-only -=-'
echo '-=- calc.spec beginning make rpm-hide-static -=-' echo '-=- calc.spec beginning make rpm-hide-static -=-'
make %{?_smp_mflags} T=%{_buildroot} BINDIR=%{_bindir} LIBDIR=%{_libdir} \ make -j1 T=%{_buildroot} BINDIR=%{_bindir} LIBDIR=%{_libdir} \
CALC_SHAREDIR=%{_datadir}/%{name} CALC_INCDIR=%{_includedir}/calc \ CALC_SHAREDIR=%{_datadir}/%{name} CALC_INCDIR=%{_includedir}/calc \
MANDIR=%{_mandir}/man1 EXT= V=@ rpm-hide-static MANDIR=%{_mandir}/man1 EXT= V=@ rpm-hide-static
echo '-=- calc.spec ending make rpm-hide-static -=-' echo '-=- calc.spec ending make rpm-hide-static -=-'
echo '-=- calc.spec beginning make clobber (again) -=-' echo '-=- calc.spec beginning make clobber (again) -=-'
make %{?_smp_mflags} T=%{_buildroot} BINDIR=%{_bindir} LIBDIR=%{_libdir} \ make -j1 T=%{_buildroot} BINDIR=%{_bindir} LIBDIR=%{_libdir} \
CALC_SHAREDIR=%{_datadir}/%{name} CALC_INCDIR=%{_includedir}/calc \ CALC_SHAREDIR=%{_datadir}/%{name} CALC_INCDIR=%{_includedir}/calc \
MANDIR=%{_mandir}/man1 EXT= V=@ clobber MANDIR=%{_mandir}/man1 EXT= V=@ clobber
echo '-=- calc.spec ending make clobber (again) -=-' echo '-=- calc.spec ending make clobber (again) -=-'
echo '-=- calc.spec beginning make calc-dynamic-only -=-' echo '-=- calc.spec beginning make calc-dynamic-only -=-'
make %{?_smp_mflags} T=%{_buildroot} BINDIR=%{_bindir} LIBDIR=%{_libdir} \ make -j1 T=%{_buildroot} BINDIR=%{_bindir} LIBDIR=%{_libdir} \
CALC_SHAREDIR=%{_datadir}/%{name} CALC_INCDIR=%{_includedir}/calc \ CALC_SHAREDIR=%{_datadir}/%{name} CALC_INCDIR=%{_includedir}/calc \
MANDIR=%{_mandir}/man1 EXT= V=@ calc-dynamic-only \ MANDIR=%{_mandir}/man1 EXT= V=@ calc-dynamic-only \
BLD_TYPE=calc-dynamic-only LD_SHARE= BLD_TYPE=calc-dynamic-only LD_SHARE=
echo '-=- calc.spec ending make calc-dynamic-only -=-' echo '-=- calc.spec ending make calc-dynamic-only -=-'
echo '-=- calc.spec beginning make chk -=-' echo '-=- calc.spec beginning make chk -=-'
make %{?_smp_mflags} T=%{_buildroot} BINDIR=%{_bindir} LIBDIR=%{_libdir} \ make -j1 T=%{_buildroot} BINDIR=%{_bindir} LIBDIR=%{_libdir} \
CALC_SHAREDIR=%{_datadir}/%{name} CALC_INCDIR=%{_includedir}/calc \ CALC_SHAREDIR=%{_datadir}/%{name} CALC_INCDIR=%{_includedir}/calc \
MANDIR=%{_mandir}/man1 EXT= V=@ chk MANDIR=%{_mandir}/man1 EXT= V=@ chk
echo '-=- calc.spec ending make chk -=-' echo '-=- calc.spec ending make chk -=-'
echo '-=- calc.spec beginning make rpm-unhide-static -=-' echo '-=- calc.spec beginning make rpm-unhide-static -=-'
make %{?_smp_mflags} T=%{_buildroot} BINDIR=%{_bindir} LIBDIR=%{_libdir} \ make -j1 T=%{_buildroot} BINDIR=%{_bindir} LIBDIR=%{_libdir} \
CALC_SHAREDIR=%{_datadir}/%{name} CALC_INCDIR=%{_includedir}/calc \ CALC_SHAREDIR=%{_datadir}/%{name} CALC_INCDIR=%{_includedir}/calc \
MANDIR=%{_mandir}/man1 EXT= V=@ rpm-unhide-static MANDIR=%{_mandir}/man1 EXT= V=@ rpm-unhide-static
echo '-=- calc.spec ending make rpm-unhide-static -=-' echo '-=- calc.spec ending make rpm-unhide-static -=-'
echo '-=- calc.spec beginning make rpm-clean-static -=-' echo '-=- calc.spec beginning make rpm-clean-static -=-'
make %{?_smp_mflags} T=%{_buildroot} BINDIR=%{_bindir} LIBDIR=%{_libdir} \ make -j1 BINDIR=%{_bindir} LIBDIR=%{_libdir} \
CALC_SHAREDIR=%{_datadir}/%{name} CALC_INCDIR=%{_includedir}/calc \ CALC_SHAREDIR=%{_datadir}/%{name} CALC_INCDIR=%{_includedir}/calc \
MANDIR=%{_mandir}/man1 EXT= V=@ rpm-clean-static MANDIR=%{_mandir}/man1 EXT= V=@ rpm-clean-static
echo '-=- calc.spec ending make rpm-clean-static -=-' echo '-=- calc.spec ending make rpm-clean-static -=-'
echo '-=- calc.spec beginning make rpm-chk-static -=-' echo '-=- calc.spec beginning make rpm-chk-static -=-'
make %{?_smp_mflags} T=%{_buildroot} BINDIR=%{_bindir} LIBDIR=%{_libdir} \ make -j1 T=%{_buildroot} BINDIR=%{_bindir} LIBDIR=%{_libdir} \
CALC_SHAREDIR=%{_datadir}/%{name} CALC_INCDIR=%{_includedir}/calc \ CALC_SHAREDIR=%{_datadir}/%{name} CALC_INCDIR=%{_includedir}/calc \
MANDIR=%{_mandir}/man1 EXT= V=@ rpm-chk-static MANDIR=%{_mandir}/man1 EXT= V=@ rpm-chk-static
echo '-=- calc.spec ending make rpm-chk-static -=-' echo '-=- calc.spec ending make rpm-chk-static -=-'
%install %install
echo '-=- calc.spec beginning make install -=-' echo '-=- calc.spec beginning make install -=-'
rm -rf %{_buildroot}
mkdir -p %{_buildroot} mkdir -p %{_buildroot}
make T=%{_buildroot} BINDIR=%{_bindir} LIBDIR=%{_libdir} \ make -j1 T=%{_buildroot} BINDIR=%{_bindir} LIBDIR=%{_libdir} \
CALC_SHAREDIR=%{_datadir}/%{name} CALC_INCDIR=%{_includedir}/calc \ CALC_SHAREDIR=%{_datadir}/%{name} CALC_INCDIR=%{_includedir}/calc \
MANDIR=%{_mandir}/man1 EXT= V=@ install MANDIR=%{_mandir}/man1 EXT= V=@ install
echo '-=- calc.spec ending make install -=-' echo '-=- calc.spec ending make install -=-'
%clean %clean
rm -rf %{_buildroot} echo '-=- calc.spec beginning make clean -=-'
rm -rf %{_tmppath}
rm -rf %{_builddir}
rm -rf %{_specdir}
rm -rf %{_buildrootdir}
echo '-=- calc.spec beginning make clean -=-'
%files %files
%defattr(-, root, root) %defattr(-, root, root)
@@ -148,9 +156,9 @@ rm -rf %{_buildroot}
%attr(644, root, root) %{_datadir}/%{name}/*.cal %attr(644, root, root) %{_datadir}/%{name}/*.cal
%attr(644, root, root) %{_datadir}/%{name}/set8700.line %attr(644, root, root) %{_datadir}/%{name}/set8700.line
%attr(644, root, root) %{_libdir}/libcalc.so %attr(644, root, root) %{_libdir}/libcalc.so
%attr(644, root, root) %{_libdir}/libcalc.so.* %attr(644, root, root) %{_libdir}/libcalc.so.%{version}
%attr(644, root, root) %{_libdir}/libcustcalc.so %attr(644, root, root) %{_libdir}/libcustcalc.so
%attr(644, root, root) %{_libdir}/libcustcalc.so.* %attr(644, root, root) %{_libdir}/libcustcalc.so.%{version}
%files devel %files devel
%defattr(-, root, root) %defattr(-, root, root)
@@ -161,10 +169,27 @@ rm -rf %{_buildroot}
%attr(644, root, root) %{_libdir}/libcustcalc.a %attr(644, root, root) %{_libdir}/libcustcalc.a
%changelog %changelog
* Mon Sep 01 2014 Landon Curt Noll http://www.isthe.com/chongo
- Release: 12
- Removed use of %{?_smp_mflags}. On Ubuntu 14.04, the -j2
was executing make lines within a rule out of order. Always
use -j1 while building these RPMs to avoid this make bug.
This only impacts the speed of building the rpms.
- Stopped removing %{_buildroot} at the beginning of install
as this, acording to a number of sources, was asking for trouble.
- Clean removes tmp, BUILD, SPEC, and BUILDROOT dirs under topdir.
- Fixed the building of the calc-debuginfo rpm.
- Eliminated rpmbuild "bogus date" warnings due to inconsistent weekday,
by assuming the date is correct and changing the weekday via BogusDateBot.
Sun May 20 2006 --> Sun May 14 2006
Sun Sep 01 2007 --> Sun Aug 26 2007
Sat May 05 2013 --> Sat May 04 2013
* Sun Sep 01 2013 Landon Curt Noll http://www.isthe.com/chongo * Sun Sep 01 2013 Landon Curt Noll http://www.isthe.com/chongo
- Release: 11 - Release: 11
- only list %{_datadir}/%{name}/set8700.line not *.line - only list %{_datadir}/%{name}/set8700.line not *.line
* Sat May 05 2013 Landon Curt Noll http://www.isthe.com/chongo
* Sun May 05 2013 Landon Curt Noll http://www.isthe.com/chongo
- Release: 10 - Release: 10
- Major bug rpm build process bug fix - Major bug rpm build process bug fix
- Source: is a URL as per rpm requirements - Source: is a URL as per rpm requirements
@@ -174,37 +199,46 @@ rm -rf %{_buildroot}
- Fixed use of %{_buildroot} - Fixed use of %{_buildroot}
- Fixed permissions so that rpm build services can modify libraries - Fixed permissions so that rpm build services can modify libraries
- Added missing files to files section - Added missing files to files section
* Mon Mar 25 2013 Landon Curt Noll http://www.isthe.com/chongo * Mon Mar 25 2013 Landon Curt Noll http://www.isthe.com/chongo
- Release: 9 (was 1.1) - Release: 9 (was 1.1)
- Removed deprecated PreReq for calc-devel, using Requires - Removed deprecated PreReq for calc-devel, using Requires
* Sun Sep 01 2007 Landon Curt Noll http://www.isthe.com/chongo
* Sat Sep 01 2007 Landon Curt Noll http://www.isthe.com/chongo
- Release: 8 - Release: 8
- Release of calc-2.12.2 - Release of calc-2.12.2
- Calc builds with shared libraries - Calc builds with shared libraries
* Sun Jun 25 2006 Landon Curt Noll http://www.isthe.com/chongo * Sun Jun 25 2006 Landon Curt Noll http://www.isthe.com/chongo
- Release: 7 - Release: 7
- Changed Copyright to License as per new rpm v4.4 syntax - Changed Copyright to License as per new rpm v4.4 syntax
* Sun May 20 2006 Landon Curt Noll http://www.isthe.com/chongo
* Sat May 20 2006 Landon Curt Noll http://www.isthe.com/chongo
- Release: 6 - Release: 6
- Release of calc-2.12.0 - Release of calc-2.12.0
- Added *.line set files to the list of packaged files - Added *.line set files to the list of packaged files
* Sun Dec 11 2005 Landon Curt Noll http://www.isthe.com/chongo * Sun Dec 11 2005 Landon Curt Noll http://www.isthe.com/chongo
- Release: 5 - Release: 5
- Release of calc-2.11.11 - Release of calc-2.11.11
- Fixed description in spec file - Fixed description in spec file
* Wed Feb 26 2003 Landon Curt Noll http://www.isthe.com/chongo * Wed Feb 26 2003 Landon Curt Noll http://www.isthe.com/chongo
- Release: 4 - Release: 4
- Release of calc-2.11.7-2 - Release of calc-2.11.7-2
- Fixed attributes on include and lib calc-devel files - Fixed attributes on include and lib calc-devel files
- Added BUGS to calc-devel as well as calc - Added BUGS to calc-devel as well as calc
* Tue Feb 25 2003 Landon Curt Noll http://www.isthe.com/chongo * Tue Feb 25 2003 Landon Curt Noll http://www.isthe.com/chongo
- Release: 3 - Release: 3
- Release of calc-2.11.7-1 - Release of calc-2.11.7-1
- Require ncurses, readline and less to install. - Require ncurses, readline and less to install.
- Require ncurses-devel and readline-devel to build. - Require ncurses-devel and readline-devel to build.
* Tue Feb 18 2003 Landon Curt Noll http://www.isthe.com/chongo * Tue Feb 18 2003 Landon Curt Noll http://www.isthe.com/chongo
- Release: 2 - Release: 2
- Misc changes to fit local directory setup - Misc changes to fit local directory setup
* Sun Feb 16 2003 Petteri Kettunen <petterik@users.sourceforge.net> * Sun Feb 16 2003 Petteri Kettunen <petterik@users.sourceforge.net>
- Release: 1 - Release: 1
- initial RPM build - initial RPM build

View File

@@ -20,7 +20,7 @@
# #
# @(#) $Revision: 30.2 $ # @(#) $Revision: 30.2 $
# @(#) $Id: check.awk,v 30.2 2013/08/11 01:08:32 chongo Exp $ # @(#) $Id: check.awk,v 30.2 2013/08/11 01:08:32 chongo Exp $
# @(#) $Source: /usr/local/src/cmd/calc/RCS/check.awk,v $ # @(#) $Source: /usr/local/src/bin/calc/RCS/check.awk,v $
# #
# Under source code control: 1996/05/25 22:07:58 # Under source code control: 1996/05/25 22:07:58
# File existed as early as: 1996 # File existed as early as: 1996

12
cmath.h
View File

@@ -1,7 +1,7 @@
/* /*
* cmath - data structures for extended precision complex arithmetic * cmath - data structures for extended precision complex arithmetic
* *
* Copyright (C) 1999-2007 David I. Bell * Copyright (C) 1999-2007,2014 David I. Bell
* *
* Calc is open software; you can redistribute it and/or modify it under * Calc is open software; you can redistribute it and/or modify it under
* the terms of the version 2.1 of the GNU Lesser General Public License * the terms of the version 2.1 of the GNU Lesser General Public License
@@ -17,8 +17,8 @@
* received a copy with calc; if not, write to Free Software Foundation, Inc. * received a copy with calc; if not, write to Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* @(#) $Revision: 30.1 $ * @(#) $Revision: 30.3 $
* @(#) $Id: cmath.h,v 30.1 2007/03/16 11:09:46 chongo Exp $ * @(#) $Id: cmath.h,v 30.3 2014/08/24 21:56:51 chongo Exp $
* @(#) $Source: /usr/local/src/bin/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 * Under source code control: 1993/07/30 19:42:45
@@ -28,8 +28,8 @@
*/ */
#if !defined(__CMATH_H__) #if !defined(INCLUDE_CMATH_H)
#define __CMATH_H__ #define INCLUDE_CMATH_H
#if defined(CALC_SRC) /* if we are building from the calc source tree */ #if defined(CALC_SRC) /* if we are building from the calc source tree */
@@ -156,4 +156,4 @@ E_FUNC COMPLEX *swap_HALF_in_COMPLEX(COMPLEX *dest, COMPLEX *src, BOOL all);
EXTERN COMPLEX _czero_, _cone_, _conei_; EXTERN COMPLEX _czero_, _cone_, _conei_;
#endif /* !__CMATH_H__ */ #endif /* !INCLUDE_CMATH_H */

View File

@@ -1,7 +1,7 @@
/* /*
* config - configuration routines * config - configuration routines
* *
* Copyright (C) 1999-2007 Landon Curt Noll and David I. Bell * Copyright (C) 1999-2007,2014 Landon Curt Noll and David I. Bell
* *
* Primary author: Landon Curt Noll * Primary author: Landon Curt Noll
* *
@@ -19,8 +19,8 @@
* received a copy with calc; if not, write to Free Software Foundation, Inc. * received a copy with calc; if not, write to Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* @(#) $Revision: 30.2 $ * @(#) $Revision: 30.4 $
* @(#) $Id: config.h,v 30.2 2007/09/21 01:27:27 chongo Exp $ * @(#) $Id: config.h,v 30.4 2014/08/24 21:56:51 chongo Exp $
* @(#) $Source: /usr/local/src/bin/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 * Under source code control: 1995/11/01 22:20:17
@@ -31,8 +31,8 @@
*/ */
#if !defined(__CONFIG_H__) #if !defined(INCLUDE_CONFIG_H)
#define __CONFIG_H__ #define INCLUDE_CONFIG_H
#if defined(CALC_SRC) /* if we are building from the calc source tree */ #if defined(CALC_SRC) /* if we are building from the calc source tree */
@@ -226,4 +226,4 @@ E_FUNC void config_print(CONFIG*);
E_FUNC BOOL config_cmp(CONFIG*, CONFIG*); E_FUNC BOOL config_cmp(CONFIG*, CONFIG*);
#endif /* !__CONFIG_H__ */ #endif /* !INCLUDE_CONFIG_H */

View File

@@ -1,4 +1,4 @@
#!/usr/local/src/cmd/calc/calc -q -s -f #!/usr/local/src/bin/calc/calc -q -s -f
/* /*
* 4dsphere - determine if 6 points lie on the surface of a sphere in R^4 * 4dsphere - determine if 6 points lie on the surface of a sphere in R^4
* *
@@ -10,7 +10,7 @@
* ... ... * ... ...
* x5 y5 z5 w5 point 5 in R^4 * x5 y5 z5 w5 point 5 in R^4
* *
* Copyright (C) 2001 Landon Curt Noll * Copyright (C) 2001,2014 Landon Curt Noll
* *
* Calc is open software; you can redistribute it and/or modify it under * Calc is open software; you can redistribute it and/or modify it under
* the terms of the version 2.1 of the GNU Lesser General Public License * the terms of the version 2.1 of the GNU Lesser General Public License
@@ -26,8 +26,8 @@
* received a copy with calc; if not, write to Free Software Foundation, Inc. * received a copy with calc; if not, write to Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* @(#) $Revision: 30.1 $ * @(#) $Revision: 30.3 $
* @(#) $Id: 4dsphere.calc,v 30.1 2007/03/16 11:12:11 chongo Exp $ * @(#) $Id: 4dsphere.calc,v 30.3 2014/08/24 22:04:32 chongo Exp $
* @(#) $Source: /usr/local/src/bin/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 * Under source code control: 2001/05/03 19:02:03

View File

@@ -1,7 +1,7 @@
# #
# cscript - makefile for calc shell script files # cscript - makefile for calc shell script files
# #
# Copyright (C) 1999-2006 Landon Curt Noll # Copyright (C) 1999-2006,2014 Landon Curt Noll
# #
# Calc is open software; you can redistribute it and/or modify it under # Calc is open software; you can redistribute it and/or modify it under
# the terms of the version 2.1 of the GNU Lesser General Public License # the terms of the version 2.1 of the GNU Lesser General Public License
@@ -17,8 +17,8 @@
# received a copy with calc; if not, write to Free Software Foundation, Inc. # received a copy with calc; if not, write to Free Software Foundation, Inc.
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
# #
# @(#) $Revision: 30.4 $ # @(#) $Revision: 30.9 $
# @(#) $Id: Makefile,v 30.4 2013/08/11 08:41:38 chongo Exp $ # @(#) $Id: Makefile,v 30.9 2014/09/02 07:14:49 chongo Exp $
# @(#) $Source: /usr/local/src/bin/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 # Under source code control: 1999/11/29 11:10:26
@@ -227,7 +227,7 @@ all: ${TARGETS} .all
README: README.src README: README.src
@${RM} -f $@ @${RM} -f $@
@${SED} -e "s:#!/usr/local/src/cmd/calc/calc:#!${BINDIR}/calc:" $?>$@ @${SED} -e "s:#!/usr/local/src/bin/calc/calc:#!${BINDIR}/calc:" $?>$@
# used by the upper level Makefile to determine if we have done all # used by the upper level Makefile to determine if we have done all
# #
@@ -315,9 +315,8 @@ depend:
if [ X"$$i" != X"/dev/null" ]; then \ if [ X"$$i" != X"/dev/null" ]; then \
echo "$$i: $$i.calc"; \ echo "$$i: $$i.calc"; \
echo ' @$${RM} -f $$@'; \ echo ' @$${RM} -f $$@'; \
echo -n ' @$${SED} -e "1s:'; \ echo -n ' @$${SED} -e "1s:^#!/usr/local/src/bin/'; \
echo "^#!/usr/local/src/cmd/calc/calc:#!$${BINDIR}/calc:" \ echo 'calc/calc:#!$${BINDIR}/calc:" $$?>$$@'; \
$$?>$$@'; \
echo ' @$${CHMOD} +x $$@'; \ echo ' @$${CHMOD} +x $$@'; \
fi; \ fi; \
done >> makedep.out done >> makedep.out
@@ -341,9 +340,9 @@ depend:
fi; \ fi; \
${MV} ${MAKE_FILE}.tmp ${MAKE_FILE}; \ ${MV} ${MAKE_FILE}.tmp ${MAKE_FILE}; \
if [ -d RCS ]; then \ if [ -d RCS ]; then \
echo '*****************************************************'; \ echo '******************************************************'; \
echo 'new sample ${MAKE_FILE} formed -- need to check it in'; \ echo 'new cscript ${MAKE_FILE} formed -- need to check it in'; \
echo '*****************************************************'; \ echo '******************************************************'; \
fi; \ fi; \
fi fi
@@ -379,8 +378,8 @@ clobber: clean
# #
install: all install: all
-${Q} if [ ! -d ${T}${BINDIR} ]; then \ -${Q} if [ ! -d ${T}${BINDIR} ]; then \
echo ${MKDIR} ${T}${BINDIR}; \ echo ${MKDIR} -p ${T}${BINDIR}; \
${MKDIR} ${T}${BINDIR}; \ ${MKDIR} -p ${T}${BINDIR}; \
if [ ! -d "${T}${BINDIR}" ]; then \ if [ ! -d "${T}${BINDIR}" ]; then \
echo ${MKDIR} -p "${T}${BINDIR}"; \ echo ${MKDIR} -p "${T}${BINDIR}"; \
${MKDIR} -p "${T}${BINDIR}"; \ ${MKDIR} -p "${T}${BINDIR}"; \
@@ -391,8 +390,8 @@ install: all
${TRUE}; \ ${TRUE}; \
fi fi
-${Q} if [ ! -d ${T}${SCRIPTDIR} ]; then \ -${Q} if [ ! -d ${T}${SCRIPTDIR} ]; then \
echo ${MKDIR} ${T}${SCRIPTDIR}; \ echo ${MKDIR} -p ${T}${SCRIPTDIR}; \
${MKDIR} ${T}${SCRIPTDIR}; \ ${MKDIR} -p ${T}${SCRIPTDIR}; \
if [ ! -d "${T}${SCRIPTDIR}" ]; then \ if [ ! -d "${T}${SCRIPTDIR}" ]; then \
echo ${MKDIR} -p "${T}${SCRIPTDIR}"; \ echo ${MKDIR} -p "${T}${SCRIPTDIR}"; \
${MKDIR} -p "${T}${SCRIPTDIR}"; \ ${MKDIR} -p "${T}${SCRIPTDIR}"; \
@@ -446,33 +445,33 @@ uninstall:
4dsphere: 4dsphere.calc 4dsphere: 4dsphere.calc
@${RM} -f $@ @${RM} -f $@
@${SED} -e "1s:^#!/usr/local/src/cmd/calc/calc:#!${BINDIR}/calc:" $?>$@ @${SED} -e "1s:^#!/usr/local/src/bin/calc/calc:#!${BINDIR}/calc:" $?>$@
@${CHMOD} +x $@ @${CHMOD} +x $@
fproduct: fproduct.calc fproduct: fproduct.calc
@${RM} -f $@ @${RM} -f $@
@${SED} -e "1s:^#!/usr/local/src/cmd/calc/calc:#!${BINDIR}/calc:" $?>$@ @${SED} -e "1s:^#!/usr/local/src/bin/calc/calc:#!${BINDIR}/calc:" $?>$@
@${CHMOD} +x $@ @${CHMOD} +x $@
mersenne: mersenne.calc mersenne: mersenne.calc
@${RM} -f $@ @${RM} -f $@
@${SED} -e "1s:^#!/usr/local/src/cmd/calc/calc:#!${BINDIR}/calc:" $?>$@ @${SED} -e "1s:^#!/usr/local/src/bin/calc/calc:#!${BINDIR}/calc:" $?>$@
@${CHMOD} +x $@ @${CHMOD} +x $@
piforever: piforever.calc piforever: piforever.calc
@${RM} -f $@ @${RM} -f $@
@${SED} -e "1s:^#!/usr/local/src/cmd/calc/calc:#!${BINDIR}/calc:" $?>$@ @${SED} -e "1s:^#!/usr/local/src/bin/calc/calc:#!${BINDIR}/calc:" $?>$@
@${CHMOD} +x $@ @${CHMOD} +x $@
plus: plus.calc plus: plus.calc
@${RM} -f $@ @${RM} -f $@
@${SED} -e "1s:^#!/usr/local/src/cmd/calc/calc:#!${BINDIR}/calc:" $?>$@ @${SED} -e "1s:^#!/usr/local/src/bin/calc/calc:#!${BINDIR}/calc:" $?>$@
@${CHMOD} +x $@ @${CHMOD} +x $@
powerterm: powerterm.calc powerterm: powerterm.calc
@${RM} -f $@ @${RM} -f $@
@${SED} -e "1s:^#!/usr/local/src/cmd/calc/calc:#!${BINDIR}/calc:" $?>$@ @${SED} -e "1s:^#!/usr/local/src/bin/calc/calc:#!${BINDIR}/calc:" $?>$@
@${CHMOD} +x $@ @${CHMOD} +x $@
simple: simple.calc simple: simple.calc
@${RM} -f $@ @${RM} -f $@
@${SED} -e "1s:^#!/usr/local/src/cmd/calc/calc:#!${BINDIR}/calc:" $?>$@ @${SED} -e "1s:^#!/usr/local/src/bin/calc/calc:#!${BINDIR}/calc:" $?>$@
@${CHMOD} +x $@ @${CHMOD} +x $@
square: square.calc square: square.calc
@${RM} -f $@ @${RM} -f $@
@${SED} -e "1s:^#!/usr/local/src/cmd/calc/calc:#!${BINDIR}/calc:" $?>$@ @${SED} -e "1s:^#!/usr/local/src/bin/calc/calc:#!${BINDIR}/calc:" $?>$@
@${CHMOD} +x $@ @${CHMOD} +x $@

View File

@@ -7,7 +7,7 @@ be useful!
Please note that calc shell scripts must start with the line: Please note that calc shell scripts must start with the line:
#!/usr/local/src/cmd/calc/calc -q -f #!/usr/local/src/bin/calc/calc -q -f
The above line MUST start in column 1 of the first line. The first line The above line MUST start in column 1 of the first line. The first line
must also end in -f. The -q is optional, but is recommended to disable must also end in -f. The -q is optional, but is recommended to disable
@@ -18,7 +18,7 @@ Comments must be /* c-like comment */ or start with a double ## symbol.
This is the correct way to form a calc shell script: This is the correct way to form a calc shell script:
#!/usr/local/src/cmd/calc/calc -q -f #!/usr/local/src/bin/calc/calc -q -f
/* a correct comment */ /* a correct comment */
## another correct comment ## another correct comment
@@ -36,7 +36,7 @@ For more informaton about calc command lines, see "help usage".
This next example WRONG: This next example WRONG:
#!/usr/local/src/cmd/calc/calc -q #!/usr/local/src/bin/calc/calc -q
# This is not a calc calc comment because it has only a single # # This is not a calc calc comment because it has only a single #
# You must to start comments with ## or /* # You must to start comments with ## or /*
@@ -101,7 +101,7 @@ simple
A trivial example of a calc shell script. A trivial example of a calc shell script.
## Copyright (C) 1999 Landon Curt Noll ## Copyright (C) 1999,2014 Landon Curt Noll
## ##
## Calc is open software; you can redistribute it and/or modify it under ## Calc is open software; you can redistribute it and/or modify it under
## the terms of the version 2.1 of the GNU Lesser General Public License ## the terms of the version 2.1 of the GNU Lesser General Public License
@@ -117,8 +117,8 @@ simple
## received a copy with calc; if not, write to Free Software Foundation, Inc. ## received a copy with calc; if not, write to Free Software Foundation, Inc.
## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
## ##
## @(#) $Revision: 30.1 $ ## @(#) $Revision: 30.3 $
## @(#) $Id: README.src,v 30.1 2007/03/16 11:12:11 chongo Exp $ ## @(#) $Id: README.src,v 30.3 2014/08/24 22:04:32 chongo Exp $
## @(#) $Source: /usr/local/src/bin/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 ## Under source code control: 1999/12/17 10:23:40

View File

@@ -1,4 +1,4 @@
#!/usr/local/src/cmd/calc/calc -q -s -f #!/usr/local/src/bin/calc/calc -q -s -f
/* /*
* fproduct - write the big Endian product of terms to a file * fproduct - write the big Endian product of terms to a file
* *
@@ -8,7 +8,7 @@
* filename where to write the product, use - for stdout * filename where to write the product, use - for stdout
* term ... terms to multiply * term ... terms to multiply
* *
* Copyright (C) 2001 Landon Curt Noll * Copyright (C) 2001,2014 Landon Curt Noll
* *
* Calc is open software; you can redistribute it and/or modify it under * Calc is open software; you can redistribute it and/or modify it under
* the terms of the version 2.1 of the GNU Lesser General Public License * the terms of the version 2.1 of the GNU Lesser General Public License
@@ -24,8 +24,8 @@
* received a copy with calc; if not, write to Free Software Foundation, Inc. * received a copy with calc; if not, write to Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* @(#) $Revision: 30.1 $ * @(#) $Revision: 30.3 $
* @(#) $Id: fproduct.calc,v 30.1 2007/03/16 11:12:11 chongo Exp $ * @(#) $Id: fproduct.calc,v 30.3 2014/08/24 22:04:32 chongo Exp $
* @(#) $Source: /usr/local/src/bin/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 * Under source code control: 2001/04/07 20:13:11

View File

@@ -1,8 +1,8 @@
#!/usr/local/src/cmd/calc/calc -q -s -f #!/usr/local/src/bin/calc/calc -q -s -f
/* /*
* mersenne - print the value of a mersenne number * mersenne - print the value of a mersenne number
* *
* Copyright (C) 1999-2007 Landon Curt Noll * Copyright (C) 1999-2007,2014 Landon Curt Noll
* *
* Calc is open software; you can redistribute it and/or modify it under * Calc is open software; you can redistribute it and/or modify it under
* the terms of the version 2.1 of the GNU Lesser General Public License * the terms of the version 2.1 of the GNU Lesser General Public License
@@ -18,8 +18,8 @@
* received a copy with calc; if not, write to Free Software Foundation, Inc. * received a copy with calc; if not, write to Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* @(#) $Revision: 30.1 $ * @(#) $Revision: 30.3 $
* @(#) $Id: mersenne.calc,v 30.1 2007/03/16 11:12:11 chongo Exp $ * @(#) $Id: mersenne.calc,v 30.3 2014/08/24 22:04:32 chongo Exp $
* @(#) $Source: /usr/local/src/bin/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; * Under source code control: 1999/11/30 00:09:01;

View File

@@ -1,8 +1,8 @@
#!/usr/local/src/cmd/calc/calc -q -f #!/usr/local/src/bin/calc/calc -q -f
/* /*
* piforever - print digits of pi forever (or as long as your mem/cpu allow) * piforever - print digits of pi forever (or as long as your mem/cpu allow)
* *
* Copyright (C) 1999-2007 Landon Curt Noll * Copyright (C) 1999-2007,2014 Landon Curt Noll
* *
* Calc is open software; you can redistribute it and/or modify it under * Calc is open software; you can redistribute it and/or modify it under
* the terms of the version 2.1 of the GNU Lesser General Public License * the terms of the version 2.1 of the GNU Lesser General Public License
@@ -18,8 +18,8 @@
* received a copy with calc; if not, write to Free Software Foundation, Inc. * received a copy with calc; if not, write to Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* @(#) $Revision: 30.1 $ * @(#) $Revision: 30.3 $
* @(#) $Id: piforever.calc,v 30.1 2007/03/16 11:12:11 chongo Exp $ * @(#) $Id: piforever.calc,v 30.3 2014/08/24 22:04:32 chongo Exp $
* @(#) $Source: /usr/local/src/bin/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 * Under source code control: 1999/11/30 00:11:36

View File

@@ -1,8 +1,8 @@
#!/usr/local/src/cmd/calc/calc -q -f #!/usr/local/src/bin/calc/calc -q -f
/* /*
* plus - add two or more arguments together * plus - add two or more arguments together
* *
* Copyright (C) 1999-2007 Landon Curt Noll * Copyright (C) 1999-2007,2014 Landon Curt Noll
* *
* Calc is open software; you can redistribute it and/or modify it under * Calc is open software; you can redistribute it and/or modify it under
* the terms of the version 2.1 of the GNU Lesser General Public License * the terms of the version 2.1 of the GNU Lesser General Public License
@@ -18,8 +18,8 @@
* received a copy with calc; if not, write to Free Software Foundation, Inc. * received a copy with calc; if not, write to Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* @(#) $Revision: 30.1 $ * @(#) $Revision: 30.3 $
* @(#) $Id: plus.calc,v 30.1 2007/03/16 11:12:11 chongo Exp $ * @(#) $Id: plus.calc,v 30.3 2014/08/24 22:04:32 chongo Exp $
* @(#) $Source: /usr/local/src/bin/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 * Under source code control: 1999/11/29 10:22:37

View File

@@ -1,4 +1,4 @@
#!/usr/local/src/cmd/calc/calc -q -s -f #!/usr/local/src/bin/calc/calc -q -s -f
/* /*
* powerterm - print the argument as a sum of powers of integers * powerterm - print the argument as a sum of powers of integers
* *
@@ -8,7 +8,7 @@
* base_limit largest base we will consider (def: 10000) * base_limit largest base we will consider (def: 10000)
* value value to convert into sums of powers of integers * value value to convert into sums of powers of integers
* *
* Copyright (C) 2001 Landon Curt Noll * Copyright (C) 2001,2014 Landon Curt Noll
* *
* Calc is open software; you can redistribute it and/or modify it under * Calc is open software; you can redistribute it and/or modify it under
* the powerterm of the version 2.1 of the GNU Lesser General Public License * the powerterm of the version 2.1 of the GNU Lesser General Public License
@@ -24,8 +24,8 @@
* received a copy with calc; if not, write to Free Software Foundation, Inc. * received a copy with calc; if not, write to Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* @(#) $Revision: 30.1 $ * @(#) $Revision: 30.3 $
* @(#) $Id: powerterm.calc,v 30.1 2007/03/16 11:12:11 chongo Exp $ * @(#) $Id: powerterm.calc,v 30.3 2014/08/24 22:04:32 chongo Exp $
* @(#) $Source: /usr/local/src/bin/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 * Under source code control: 2001/04/24 23:49:11

View File

@@ -1,8 +1,8 @@
#!/usr/local/src/cmd/calc/calc -q -f #!/usr/local/src/bin/calc/calc -q -f
/* /*
* simple - an example of a simple calc shell script * simple - an example of a simple calc shell script
* *
* Copyright (C) 1999-2007 Landon Curt Noll * Copyright (C) 1999-2007,2014 Landon Curt Noll
* *
* Calc is open software; you can redistribute it and/or modify it under * Calc is open software; you can redistribute it and/or modify it under
* the terms of the version 2.1 of the GNU Lesser General Public License * the terms of the version 2.1 of the GNU Lesser General Public License
@@ -18,8 +18,8 @@
* received a copy with calc; if not, write to Free Software Foundation, Inc. * received a copy with calc; if not, write to Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* @(#) $Revision: 30.1 $ * @(#) $Revision: 30.3 $
* @(#) $Id: simple.calc,v 30.1 2007/03/16 11:12:11 chongo Exp $ * @(#) $Id: simple.calc,v 30.3 2014/08/24 22:04:32 chongo Exp $
* @(#) $Source: /usr/local/src/bin/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 * Under source code control: 1999/11/29 10:22:37

View File

@@ -1,8 +1,8 @@
#!/usr/local/src/cmd/calc/calc -q -f #!/usr/local/src/bin/calc/calc -q -f
/* /*
* sqaure - print the squares of input values * sqaure - print the squares of input values
* *
* Copyright (C) 2000-2007 Ernest Bowen * Copyright (C) 2000-2007,2014 Ernest Bowen
* *
* Calc is open software; you can redistribute it and/or modify it under * Calc is open software; you can redistribute it and/or modify it under
* the terms of the version 2.1 of the GNU Lesser General Public License * the terms of the version 2.1 of the GNU Lesser General Public License
@@ -18,8 +18,8 @@
* received a copy with calc; if not, write to Free Software Foundation, Inc. * received a copy with calc; if not, write to Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* @(#) $Revision: 30.1 $ * @(#) $Revision: 30.3 $
* @(#) $Id: square.calc,v 30.1 2007/03/16 11:12:11 chongo Exp $ * @(#) $Id: square.calc,v 30.3 2014/08/24 22:04:32 chongo Exp $
* @(#) $Source: /usr/local/src/bin/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 * Under source code control: 2000/12/15 06:52:01

View File

@@ -2,7 +2,7 @@
# #
# custom - makefile for calc custom routines # custom - makefile for calc custom routines
# #
# Copyright (C) 1999-2006 Landon Curt Noll # Copyright (C) 1999-2006,2014 Landon Curt Noll
# #
# Calc is open software; you can redistribute it and/or modify it under # Calc is open software; you can redistribute it and/or modify it under
# the terms of the version 2.1 of the GNU Lesser General Public License # the terms of the version 2.1 of the GNU Lesser General Public License
@@ -18,8 +18,8 @@
# received a copy with calc; if not, write to Free Software Foundation, Inc. # received a copy with calc; if not, write to Free Software Foundation, Inc.
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
# #
# @(#) $Revision: 30.31 $ # @(#) $Revision: 30.35 $
# @(#) $Id: Makefile.head,v 30.31 2013/09/27 08:55:28 chongo Exp $ # @(#) $Id: Makefile.head,v 30.35 2014/09/21 14:09:18 chongo Exp $
# @(#) $Source: /usr/local/src/bin/calc/custom/RCS/Makefile.head,v $ # @(#) $Source: /usr/local/src/bin/calc/custom/RCS/Makefile.head,v $
# #
# Under source code control: 1997/03/09 02:28:54 # Under source code control: 1997/03/09 02:28:54
@@ -337,20 +337,6 @@ CALC_ENV= CALCPATH=./cal
ALLOW_CUSTOM= -DCUSTOM ALLOW_CUSTOM= -DCUSTOM
#ALLOW_CUSTOM= #ALLOW_CUSTOM=
# The install rule uses:
#
# ${MKDIR} ${MKDIR_ARG}
#
# to create directorties. Normall this amounts to usins mkdir -p dir ...
# Some older systems may not have mkdir -p. If you system does not
# make mkdir -p, then set MKDIR_ARG to empty.
#
# MKDIR_ARG= -p # use mkdir -p when creating paths
# MKDIR_ARG= # use if system does not understand mkdir -p
#
MKDIR_ARG= -p
#MKDIR_ARG=
# Some out of date operating systems require / want an executable to # Some out of date operating systems require / want an executable to
# end with a certain file extension. Some compile systems such as # end with a certain file extension. Some compile systems such as
# Cygwin build calc as calc.exe. The EXT variable is used to denote # Cygwin build calc as calc.exe. The EXT variable is used to denote
@@ -366,15 +352,18 @@ EXT=
# The default calc versions # The default calc versions
# #
VERSION= 2.12.4.13 VERSION= 2.12.4.14
VERS= 2.12.4
VER= 2.12
VE= 2
# Names of shared libraries with versions # Names of shared libraries with versions
# #
LIB_EXT= .so LIB_EXT= .so
LIB_EXT_VERSION= ${LIB_EXT}.${VERSION} LIB_EXT_VERSION= ${LIB_EXT}.${VERSION}
# legacy partial versions are no longer used, only removed
#
VERS= 2.12.4
VER= 2.12
VE= 2
LIB_EXT_VERS= ${LIB_EXT}.${VERS} LIB_EXT_VERS= ${LIB_EXT}.${VERS}
LIB_EXT_VER= ${LIB_EXT}.${VER} LIB_EXT_VER= ${LIB_EXT}.${VER}
LIB_EXT_VE= ${LIB_EXT}.${VE} LIB_EXT_VE= ${LIB_EXT}.${VE}
@@ -489,6 +478,17 @@ LDFLAGS= ${LD_DEBUG} ${ILDFLAGS}
# #
# CCOPT are flags given to ${CC} for optimization # CCOPT are flags given to ${CC} for optimization
# CCWARN are flags given to ${CC} for warning message control # CCWARN are flags given to ${CC} for warning message control
#
# WNO_IMPLICT, WNO_ERROR_LONG_LONG and WNO_LONG_LONG are given to ${CC}
# when compiling special .o files that may need special compile options
# NOTE: These flags simply turn off certain compiler warnings,
# which is useful only when CCWERR is set to -Werror.
# NOTE: If your compiler does not have these -Wno files, just
# set these variables to nothing as in:
# WNO_IMPLICT=
# WNO_ERROR_LONG_LONG=
# WNO_LONG_LONG=
#
# CCWERR are flags given to ${CC} to make warnings fatal errors # CCWERR are flags given to ${CC} to make warnings fatal errors
# NOTE: CCWERR is only set in development Makefiles and must only be # NOTE: CCWERR is only set in development Makefiles and must only be
# used with ${CC}, not ${LCC}. If you do not want the compiler # used with ${CC}, not ${LCC}. If you do not want the compiler
@@ -535,7 +535,10 @@ LD_STATIC=
LIBCALC_STATIC= LIBCALC_STATIC=
LIBCUSTCALC_STATIC= LIBCUSTCALC_STATIC=
# #
CCWARN= -Wall -W -Wno-comment CCWARN= -Wall
WNO_IMPLICT= -Wno-implicit
WNO_ERROR_LONG_LONG= -Wno-error=long-long
WNO_LONG_LONG= -Wno-long-long
CCWERR= CCWERR=
CCOPT= ${DEBUG} CCOPT= ${DEBUG}
CCMISC= CCMISC=
@@ -545,9 +548,9 @@ CC= ${PURIFY} ${LCC} ${CCWERR}
# #
endif endif
################################# ##############################
# Apple MacOS X / Darwin target # # Apple OS X / Darwin target #
################################# ##############################
ifeq ($(target),Darwin) ifeq ($(target),Darwin)
# #
@@ -556,9 +559,23 @@ BLD_TYPE= calc-dynamic-only
CC_SHARE= -fPIC CC_SHARE= -fPIC
DEFAULT_LIB_INSTALL_PATH= ${PWD}:${LIBDIR}:/usr/local/lib DEFAULT_LIB_INSTALL_PATH= ${PWD}:${LIBDIR}:/usr/local/lib
LD_SHARE= ${DARWIN_ARCH} LD_SHARE= ${DARWIN_ARCH}
LIBCALC_SHLIB= -single_module -undefined dynamic_lookup -dynamiclib #SET_INSTALL_NAME= no
SET_INSTALL_NAME= yes
ifeq ($(SET_INSTALL_NAME),yes)
LIBCALC_SHLIB= -single_module -undefined dynamic_lookup -dynamiclib \
-install_name ${LIBDIR}/libcalc${LIB_EXT_VERSION} ${DARWIN_ARCH}
else
LIBCALC_SHLIB= -single_module -undefined dynamic_lookup -dynamiclib \
${DARWIN_ARCH}
endif
ifdef ALLOW_CUSTOM ifdef ALLOW_CUSTOM
LIBCUSTCALC_SHLIB= -single_module -undefined dynamic_lookup -dynamiclib ifeq ($(SET_INSTALL_NAME),yes)
LIBCUSTCALC_SHLIB= -single_module -undefined dynamic_lookup -dynamiclib \
-install_name ${LIBDIR}/libcustcalc${LIB_EXT_VERSION} ${DARWIN_ARCH}
else
LIBCUSTCALC_SHLIB= -single_module -undefined dynamic_lookup -dynamiclib \
${DARWIN_ARCH}
endif
else else
LIBCUSTCALC_SHLIB= LIBCUSTCALC_SHLIB=
endif endif
@@ -568,17 +585,21 @@ LD_STATIC= ${DARWIN_ARCH}
LIBCALC_STATIC= LIBCALC_STATIC=
LIBCUSTCALC_STATIC= LIBCUSTCALC_STATIC=
# #
CCWARN= -Wall -W -Wno-comment CCWARN= -Wall
WNO_IMPLICT= -Wno-implicit
WNO_ERROR_LONG_LONG= -Wno-error=long-long
WNO_LONG_LONG= -Wno-long-long
CCWERR= CCWERR=
CCOPT= ${DEBUG} CCOPT= ${DEBUG}
CCMISC= ${DARWIN_ARCH} CCMISC= ${DARWIN_ARCH}
# #
LCC= MACOSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET} gcc LCC= clang
CC= ${PURIFY} ${LCC} ${CCWERR} CC= ${PURIFY} ${LCC} ${CCWERR}
# #
# Darwin dynamic shared lib filenames # Darwin dynamic shared lib filenames
LIB_EXT:= .dylib LIB_EXT:= .dylib
LIB_EXT_VERSION:= .${VERSION}${LIB_EXT} LIB_EXT_VERSION:= .${VERSION}${LIB_EXT}
# legacy partial versions are no longer used, only removed
LIB_EXT_VERS:= .${VERS}${LIB_EXT} LIB_EXT_VERS:= .${VERS}${LIB_EXT}
LIB_EXT_VER:= .${VER}${LIB_EXT} LIB_EXT_VER:= .${VER}${LIB_EXT}
LIB_EXT_VE:= .${VE}${LIB_EXT} LIB_EXT_VE:= .${VE}${LIB_EXT}
@@ -587,8 +608,8 @@ LDCONFIG:=
# DARWIN_ARCH= -arch i386 -arch ppc # Universal binary # DARWIN_ARCH= -arch i386 -arch ppc # Universal binary
# DARWIN_ARCH= -arch i386 # Intel binary # DARWIN_ARCH= -arch i386 # Intel binary
# DARWIN_ARCH= -arch ppc # PPC binary # DARWIN_ARCH= -arch ppc # PPC binary
# DARWIN_ARCH= -arch x86_64 # native 64-bit binary
DARWIN_ARCH= # native binary DARWIN_ARCH= # native binary
MACOSX_DEPLOYMENT_TARGET=10.8
# #
endif endif
@@ -622,7 +643,10 @@ LD_STATIC=
LIBCALC_STATIC= LIBCALC_STATIC=
LIBCUSTCALC_STATIC= LIBCUSTCALC_STATIC=
# #
CCWARN= -Wall -W -Wno-comment CCWARN= -Wall
WNO_IMPLICT= -Wno-implicit
WNO_ERROR_LONG_LONG= -Wno-error=long-long
WNO_LONG_LONG= -Wno-long-long
CCWERR= CCWERR=
CCOPT= ${DEBUG} CCOPT= ${DEBUG}
CCMISC= CCMISC=
@@ -665,6 +689,9 @@ LIBCALC_STATIC=
LIBCUSTCALC_STATIC= LIBCUSTCALC_STATIC=
# #
CCWARN= -Wall CCWARN= -Wall
WNO_IMPLICT= -Wno-implicit
WNO_ERROR_LONG_LONG= -Wno-error=long-long
WNO_LONG_LONG= -Wno-long-long
CCWERR= CCWERR=
CCOPT= ${DEBUG} CCOPT= ${DEBUG}
CCMISC= CCMISC=
@@ -680,7 +707,6 @@ endif
# SunOS target # # SunOS target #
################ ################
# XXX - this needs to be tested
ifeq ($(target),SunOS) ifeq ($(target),SunOS)
# #
BLD_TYPE= calc-dynamic-only BLD_TYPE= calc-dynamic-only
@@ -701,7 +727,10 @@ LIBCALC_STATIC=
LIBCUSTCALC_STATIC= LIBCUSTCALC_STATIC=
LD_STATIC= LD_STATIC=
# #
CCWARN= -Wall -W -Wno-comment CCWARN= -Wall
WNO_IMPLICT= -Wno-implicit
WNO_ERROR_LONG_LONG= -Wno-error=long-long
WNO_LONG_LONG= -Wno-long-long
CCWERR= CCWERR=
CCOPT= ${DEBUG} CCOPT= ${DEBUG}
CCMISC= CCMISC=
@@ -735,7 +764,10 @@ LIBCALC_STATIC=
LIBCUSTCALC_STATIC= LIBCUSTCALC_STATIC=
LD_STATIC= LD_STATIC=
# #
CCWARN= -Wall -W -Wno-comment CCWARN= -Wall
WNO_IMPLICT= -Wno-implicit
WNO_ERROR_LONG_LONG= -Wno-error=long-long
WNO_LONG_LONG= -Wno-long-long
CCWERR= CCWERR=
CCOPT= ${DEBUG} CCOPT= ${DEBUG}
CCMISC= CCMISC=
@@ -769,7 +801,10 @@ LD_STATIC=
LIBCALC_STATIC= LIBCALC_STATIC=
LIBCUSTCALC_STATIC= LIBCUSTCALC_STATIC=
# #
CCWARN= -Wall -W -Wno-comment CCWARN= -Wall
WNO_IMPLICT= -Wno-implicit
WNO_ERROR_LONG_LONG= -Wno-error=long-long
WNO_LONG_LONG= -Wno-long-long
CCWERR= CCWERR=
CCOPT= ${DEBUG} CCOPT= ${DEBUG}
CCMISC= CCMISC=
@@ -829,7 +864,10 @@ LIBCALC_STATIC=
LIBCUSTCALC_STATIC= LIBCUSTCALC_STATIC=
LD_STATIC= LD_STATIC=
# #
CCWARN= -Wall -W -Wno-comment CCWARN= -Wall
WNO_IMPLICT= -Wno-implicit
WNO_ERROR_LONG_LONG= -Wno-error=long-long
WNO_LONG_LONG= -Wno-long-long
CCWERR= CCWERR=
CCOPT= ${DEBUG} CCOPT= ${DEBUG}
CCMISC= -DNOTCYGWIN CCMISC= -DNOTCYGWIN
@@ -866,7 +904,10 @@ LIBCALC_STATIC=
LIBCUSTCALC_STATIC= LIBCUSTCALC_STATIC=
LD_STATIC= LD_STATIC=
# #
CCWARN= -Wall -W -Wno-comment CCWARN= -Wall
WNO_IMPLICT= -Wno-implicit
WNO_ERROR_LONG_LONG= -Wno-error=long-long
WNO_LONG_LONG= -Wno-long-long
CCWERR= CCWERR=
CCOPT= ${DEBUG} CCOPT= ${DEBUG}
CCMISC= CCMISC=
@@ -1086,8 +1127,8 @@ depend:
fi fi
${Q} echo forming custom/skel ${Q} echo forming custom/skel
${Q} ${RM} -rf skel ${Q} ${RM} -rf skel
${Q} ${MKDIR} skel ${Q} ${MKDIR} -p skel
${Q} ${MKDIR} skel/custom ${Q} ${MKDIR} -p skel/custom
-${Q} for i in ${C_SRC} /dev/null; do \ -${Q} for i in ${C_SRC} /dev/null; do \
if [ X"$$i" != X"/dev/null" ]; then \ if [ X"$$i" != X"/dev/null" ]; then \
${SED} -n '/^#[ ]*include[ ]*"/p' \ ${SED} -n '/^#[ ]*include[ ]*"/p' \
@@ -1198,11 +1239,13 @@ clobber: clean
${RM} -f ${BLD_TYPE} ${RM} -f ${BLD_TYPE}
${RM} -f .all ${MAKE_FILE}.tmp ${MAKE_FILE}.bak ${RM} -f .all ${MAKE_FILE}.tmp ${MAKE_FILE}.bak
${RM} -f libcustcalc${LIB_EXT_VERSION} ${RM} -f libcustcalc${LIB_EXT_VERSION}
${RM} -f libcustcalc${LIB_EXT}
${RM} -f libcustcalc.*.dylib
${RM} -f libcustcalc.a
${V} echo remove files that are obsolete
${RM} -f libcustcalc${LIB_EXT_VERS} ${RM} -f libcustcalc${LIB_EXT_VERS}
${RM} -f libcustcalc${LIB_EXT_VER} ${RM} -f libcustcalc${LIB_EXT_VER}
${RM} -f libcustcalc${LIB_EXT_VE} ${RM} -f libcustcalc${LIB_EXT_VE}
${RM} -f libcustcalc${LIB_EXT}
${RM} -f libcustcalc.a
#if 0 /* start of skip for non-Gnu makefiles */ #if 0 /* start of skip for non-Gnu makefiles */
${RM} -f Makefile.simple ${RM} -f Makefile.simple
#endif /* end of skip for non-Gnu makefiles */ #endif /* end of skip for non-Gnu makefiles */
@@ -1212,9 +1255,21 @@ clobber: clean
# NOTE: Keep the uninstall rule in reverse order to the install rule # NOTE: Keep the uninstall rule in reverse order to the install rule
# #
install: all install: all
-${Q} if [ ! -d ${T}${LIBDIR} ]; then \
echo ${MKDIR} -p ${T}${LIBDIR}; \
${MKDIR} -p ${T}${LIBDIR}; \
if [ ! -d "${T}${LIBDIR}" ]; then \
echo ${MKDIR} -p "${T}${LIBDIR}"; \
${MKDIR} -p "${T}${LIBDIR}"; \
fi; \
echo ${CHMOD} 0755 ${T}${LIBDIR}; \
${CHMOD} 0755 ${T}${LIBDIR}; \
else \
${TRUE}; \
fi
-${Q} if [ ! -d ${T}${INCDIR} ]; then \ -${Q} if [ ! -d ${T}${INCDIR} ]; then \
echo ${MKDIR} ${T}${INCDIR}; \ echo ${MKDIR} -p ${T}${INCDIR}; \
${MKDIR} ${T}${INCDIR}; \ ${MKDIR} -p ${T}${INCDIR}; \
if [ ! -d "${T}${INCDIR}" ]; then \ if [ ! -d "${T}${INCDIR}" ]; then \
echo ${MKDIR} -p "${T}${INCDIR}"; \ echo ${MKDIR} -p "${T}${INCDIR}"; \
${MKDIR} -p "${T}${INCDIR}"; \ ${MKDIR} -p "${T}${INCDIR}"; \
@@ -1225,8 +1280,8 @@ install: all
${TRUE}; \ ${TRUE}; \
fi fi
-${Q} if [ ! -d ${T}${CALC_SHAREDIR} ]; then \ -${Q} if [ ! -d ${T}${CALC_SHAREDIR} ]; then \
echo ${MKDIR} ${T}${CALC_SHAREDIR}; \ echo ${MKDIR} -p ${T}${CALC_SHAREDIR}; \
${MKDIR} ${T}${CALC_SHAREDIR}; \ ${MKDIR} -p ${T}${CALC_SHAREDIR}; \
if [ ! -d "${T}${CALC_SHAREDIR}" ]; then \ if [ ! -d "${T}${CALC_SHAREDIR}" ]; then \
echo ${MKDIR} -p "${T}${CALC_SHAREDIR}"; \ echo ${MKDIR} -p "${T}${CALC_SHAREDIR}"; \
${MKDIR} -p "${T}${CALC_SHAREDIR}"; \ ${MKDIR} -p "${T}${CALC_SHAREDIR}"; \
@@ -1237,8 +1292,8 @@ install: all
${TRUE}; \ ${TRUE}; \
fi fi
-${Q} if [ ! -d ${T}${CALC_INCDIR} ]; then \ -${Q} if [ ! -d ${T}${CALC_INCDIR} ]; then \
echo ${MKDIR} ${T}${CALC_INCDIR}; \ echo ${MKDIR} -p ${T}${CALC_INCDIR}; \
${MKDIR} ${T}${CALC_INCDIR}; \ ${MKDIR} -p ${T}${CALC_INCDIR}; \
if [ ! -d "${T}${CALC_INCDIR}" ]; then \ if [ ! -d "${T}${CALC_INCDIR}" ]; then \
echo ${MKDIR} -p "${T}${CALC_INCDIR}"; \ echo ${MKDIR} -p "${T}${CALC_INCDIR}"; \
${MKDIR} -p "${T}${CALC_INCDIR}"; \ ${MKDIR} -p "${T}${CALC_INCDIR}"; \
@@ -1249,8 +1304,8 @@ install: all
${TRUE}; \ ${TRUE}; \
fi fi
-${Q} if [ ! -d ${T}${HELPDIR} ]; then \ -${Q} if [ ! -d ${T}${HELPDIR} ]; then \
echo ${MKDIR} ${T}${HELPDIR}; \ echo ${MKDIR} -p ${T}${HELPDIR}; \
${MKDIR} ${T}${HELPDIR}; \ ${MKDIR} -p ${T}${HELPDIR}; \
if [ ! -d "${T}${HELPDIR}" ]; then \ if [ ! -d "${T}${HELPDIR}" ]; then \
echo ${MKDIR} -p "${T}${HELPDIR}"; \ echo ${MKDIR} -p "${T}${HELPDIR}"; \
${MKDIR} -p "${T}${HELPDIR}"; \ ${MKDIR} -p "${T}${HELPDIR}"; \
@@ -1261,8 +1316,8 @@ install: all
${TRUE}; \ ${TRUE}; \
fi fi
-${Q} if [ ! -d ${T}${CUSTOMCALDIR} ]; then \ -${Q} if [ ! -d ${T}${CUSTOMCALDIR} ]; then \
echo ${MKDIR} ${T}${CUSTOMCALDIR}; \ echo ${MKDIR} -p ${T}${CUSTOMCALDIR}; \
${MKDIR} ${T}${CUSTOMCALDIR}; \ ${MKDIR} -p ${T}${CUSTOMCALDIR}; \
if [ ! -d "${T}${CUSTOMCALDIR}" ]; then \ if [ ! -d "${T}${CUSTOMCALDIR}" ]; then \
echo ${MKDIR} -p "${T}${CUSTOMCALDIR}"; \ echo ${MKDIR} -p "${T}${CUSTOMCALDIR}"; \
${MKDIR} -p "${T}${CUSTOMCALDIR}"; \ ${MKDIR} -p "${T}${CUSTOMCALDIR}"; \
@@ -1273,8 +1328,8 @@ install: all
${TRUE}; \ ${TRUE}; \
fi fi
-${Q} if [ ! -d ${T}${CUSTOMHELPDIR} ]; then \ -${Q} if [ ! -d ${T}${CUSTOMHELPDIR} ]; then \
echo ${MKDIR} ${T}${CUSTOMHELPDIR}; \ echo ${MKDIR} -p ${T}${CUSTOMHELPDIR}; \
${MKDIR} ${T}${CUSTOMHELPDIR}; \ ${MKDIR} -p ${T}${CUSTOMHELPDIR}; \
if [ ! -d "${T}${CUSTOMHELPDIR}" ]; then \ if [ ! -d "${T}${CUSTOMHELPDIR}" ]; then \
echo ${MKDIR} -p "${T}${CUSTOMHELPDIR}"; \ echo ${MKDIR} -p "${T}${CUSTOMHELPDIR}"; \
${MKDIR} -p "${T}${CUSTOMHELPDIR}"; \ ${MKDIR} -p "${T}${CUSTOMHELPDIR}"; \
@@ -1285,8 +1340,8 @@ install: all
${TRUE}; \ ${TRUE}; \
fi fi
-${Q} if [ ! -d ${T}${CUSTOMINCDIR} ]; then \ -${Q} if [ ! -d ${T}${CUSTOMINCDIR} ]; then \
echo ${MKDIR} ${T}${CUSTOMINCDIR}; \ echo ${MKDIR} -p ${T}${CUSTOMINCDIR}; \
${MKDIR} ${T}${CUSTOMINCDIR}; \ ${MKDIR} -p ${T}${CUSTOMINCDIR}; \
if [ ! -d "${T}${CUSTOMINCDIR}" ]; then \ if [ ! -d "${T}${CUSTOMINCDIR}" ]; then \
echo ${MKDIR} -p "${T}${CUSTOMINCDIR}"; \ echo ${MKDIR} -p "${T}${CUSTOMINCDIR}"; \
${MKDIR} -p "${T}${CUSTOMINCDIR}"; \ ${MKDIR} -p "${T}${CUSTOMINCDIR}"; \

View File

@@ -2,7 +2,7 @@
# #
# custom - makefile for calc custom routines # custom - makefile for calc custom routines
# #
# Copyright (C) 1999-2006 Landon Curt Noll # Copyright (C) 1999-2006,2014 Landon Curt Noll
# #
# Calc is open software; you can redistribute it and/or modify it under # Calc is open software; you can redistribute it and/or modify it under
# the terms of the version 2.1 of the GNU Lesser General Public License # the terms of the version 2.1 of the GNU Lesser General Public License
@@ -18,8 +18,8 @@
# received a copy with calc; if not, write to Free Software Foundation, Inc. # received a copy with calc; if not, write to Free Software Foundation, Inc.
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
# #
# @(#) $Revision: 30.31 $ # @(#) $Revision: 30.35 $
# @(#) $Id: Makefile.head,v 30.31 2013/09/27 08:55:28 chongo Exp $ # @(#) $Id: Makefile.head,v 30.35 2014/09/21 14:09:18 chongo Exp $
# @(#) $Source: /usr/local/src/bin/calc/custom/RCS/Makefile.head,v $ # @(#) $Source: /usr/local/src/bin/calc/custom/RCS/Makefile.head,v $
# #
# Under source code control: 1997/03/09 02:28:54 # Under source code control: 1997/03/09 02:28:54
@@ -337,20 +337,6 @@ CALC_ENV= CALCPATH=./cal
ALLOW_CUSTOM= -DCUSTOM ALLOW_CUSTOM= -DCUSTOM
#ALLOW_CUSTOM= #ALLOW_CUSTOM=
# The install rule uses:
#
# ${MKDIR} ${MKDIR_ARG}
#
# to create directorties. Normall this amounts to usins mkdir -p dir ...
# Some older systems may not have mkdir -p. If you system does not
# make mkdir -p, then set MKDIR_ARG to empty.
#
# MKDIR_ARG= -p # use mkdir -p when creating paths
# MKDIR_ARG= # use if system does not understand mkdir -p
#
MKDIR_ARG= -p
#MKDIR_ARG=
# Some out of date operating systems require / want an executable to # Some out of date operating systems require / want an executable to
# end with a certain file extension. Some compile systems such as # end with a certain file extension. Some compile systems such as
# Cygwin build calc as calc.exe. The EXT variable is used to denote # Cygwin build calc as calc.exe. The EXT variable is used to denote
@@ -366,15 +352,18 @@ EXT=
# The default calc versions # The default calc versions
# #
VERSION= 2.12.4.13 VERSION= 2.12.4.14
VERS= 2.12.4
VER= 2.12
VE= 2
# Names of shared libraries with versions # Names of shared libraries with versions
# #
LIB_EXT= .so LIB_EXT= .so
LIB_EXT_VERSION= ${LIB_EXT}.${VERSION} LIB_EXT_VERSION= ${LIB_EXT}.${VERSION}
# legacy partial versions are no longer used, only removed
#
VERS= 2.12.4
VER= 2.12
VE= 2
LIB_EXT_VERS= ${LIB_EXT}.${VERS} LIB_EXT_VERS= ${LIB_EXT}.${VERS}
LIB_EXT_VER= ${LIB_EXT}.${VER} LIB_EXT_VER= ${LIB_EXT}.${VER}
LIB_EXT_VE= ${LIB_EXT}.${VE} LIB_EXT_VE= ${LIB_EXT}.${VE}

View File

@@ -2,7 +2,7 @@
# #
# custom - makefile for calc custom routines # custom - makefile for calc custom routines
# #
# Copyright (C) 1999-2006 Landon Curt Noll # Copyright (C) 1999-2006,2014 Landon Curt Noll
# #
# Calc is open software; you can redistribute it and/or modify it under # Calc is open software; you can redistribute it and/or modify it under
# the terms of the version 2.1 of the GNU Lesser General Public License # the terms of the version 2.1 of the GNU Lesser General Public License
@@ -18,8 +18,8 @@
# received a copy with calc; if not, write to Free Software Foundation, Inc. # received a copy with calc; if not, write to Free Software Foundation, Inc.
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
# #
# @(#) $Revision: 30.31 $ # @(#) $Revision: 30.35 $
# @(#) $Id: Makefile.head,v 30.31 2013/09/27 08:55:28 chongo Exp $ # @(#) $Id: Makefile.head,v 30.35 2014/09/21 14:09:18 chongo Exp $
# @(#) $Source: /usr/local/src/bin/calc/custom/RCS/Makefile.head,v $ # @(#) $Source: /usr/local/src/bin/calc/custom/RCS/Makefile.head,v $
# #
# Under source code control: 1997/03/09 02:28:54 # Under source code control: 1997/03/09 02:28:54
@@ -322,20 +322,6 @@ CALC_ENV= CALCPATH=./cal
ALLOW_CUSTOM= -DCUSTOM ALLOW_CUSTOM= -DCUSTOM
#ALLOW_CUSTOM= #ALLOW_CUSTOM=
# The install rule uses:
#
# ${MKDIR} ${MKDIR_ARG}
#
# to create directorties. Normall this amounts to usins mkdir -p dir ...
# Some older systems may not have mkdir -p. If you system does not
# make mkdir -p, then set MKDIR_ARG to empty.
#
# MKDIR_ARG= -p # use mkdir -p when creating paths
# MKDIR_ARG= # use if system does not understand mkdir -p
#
MKDIR_ARG= -p
#MKDIR_ARG=
# Some out of date operating systems require / want an executable to # Some out of date operating systems require / want an executable to
# end with a certain file extension. Some compile systems such as # end with a certain file extension. Some compile systems such as
# Cygwin build calc as calc.exe. The EXT variable is used to denote # Cygwin build calc as calc.exe. The EXT variable is used to denote
@@ -351,15 +337,18 @@ EXT=
# The default calc versions # The default calc versions
# #
VERSION= 2.12.4.13 VERSION= 2.12.4.14
VERS= 2.12.4
VER= 2.12
VE= 2
# Names of shared libraries with versions # Names of shared libraries with versions
# #
LIB_EXT= .so LIB_EXT= .so
LIB_EXT_VERSION= ${LIB_EXT}.${VERSION} LIB_EXT_VERSION= ${LIB_EXT}.${VERSION}
# legacy partial versions are no longer used, only removed
#
VERS= 2.12.4
VER= 2.12
VE= 2
LIB_EXT_VERS= ${LIB_EXT}.${VERS} LIB_EXT_VERS= ${LIB_EXT}.${VERS}
LIB_EXT_VER= ${LIB_EXT}.${VER} LIB_EXT_VER= ${LIB_EXT}.${VER}
LIB_EXT_VE= ${LIB_EXT}.${VE} LIB_EXT_VE= ${LIB_EXT}.${VE}
@@ -449,6 +438,17 @@ COMMON_LDFLAGS= ${EXTRA_LDFLAGS}
# #
# CCOPT are flags given to ${CC} for optimization # CCOPT are flags given to ${CC} for optimization
# CCWARN are flags given to ${CC} for warning message control # CCWARN are flags given to ${CC} for warning message control
#
# WNO_IMPLICT, WNO_ERROR_LONG_LONG and WNO_LONG_LONG are given to ${CC}
# when compiling special .o files that may need special compile options
# NOTE: These flags simply turn off certain compiler warnings,
# which is useful only when CCWERR is set to -Werror.
# NOTE: If your compiler does not have these -Wno files, just
# set these variables to nothing as in:
# WNO_IMPLICT=
# WNO_ERROR_LONG_LONG=
# WNO_LONG_LONG=
#
# CCWERR are flags given to ${CC} to make warnings fatal errors # CCWERR are flags given to ${CC} to make warnings fatal errors
# NOTE: CCWERR is only set in development Makefiles and must only be # NOTE: CCWERR is only set in development Makefiles and must only be
# used with ${CC}, not ${LCC}. If you do not want the compiler # used with ${CC}, not ${LCC}. If you do not want the compiler
@@ -485,7 +485,10 @@ LD_STATIC=
LIBCALC_STATIC= LIBCALC_STATIC=
LIBCUSTCALC_STATIC= LIBCUSTCALC_STATIC=
# #
CCWARN= -Wall -W -Wno-comment CCWARN= -Wall
WNO_IMPLICT= -Wno-implicit
WNO_ERROR_LONG_LONG= -Wno-error=long-long
WNO_LONG_LONG= -Wno-long-long
CCWERR= CCWERR=
CCOPT= ${DEBUG} CCOPT= ${DEBUG}
CCMISC= CCMISC=
@@ -679,8 +682,8 @@ depend:
fi fi
${Q} echo forming custom/skel ${Q} echo forming custom/skel
${Q} ${RM} -rf skel ${Q} ${RM} -rf skel
${Q} ${MKDIR} skel ${Q} ${MKDIR} -p skel
${Q} ${MKDIR} skel/custom ${Q} ${MKDIR} -p skel/custom
-${Q} for i in ${C_SRC} /dev/null; do \ -${Q} for i in ${C_SRC} /dev/null; do \
if [ X"$$i" != X"/dev/null" ]; then \ if [ X"$$i" != X"/dev/null" ]; then \
${SED} -n '/^#[ ]*include[ ]*"/p' \ ${SED} -n '/^#[ ]*include[ ]*"/p' \
@@ -791,20 +794,34 @@ clobber: clean
${RM} -f ${BLD_TYPE} ${RM} -f ${BLD_TYPE}
${RM} -f .all ${MAKE_FILE}.tmp ${MAKE_FILE}.bak ${RM} -f .all ${MAKE_FILE}.tmp ${MAKE_FILE}.bak
${RM} -f libcustcalc${LIB_EXT_VERSION} ${RM} -f libcustcalc${LIB_EXT_VERSION}
${RM} -f libcustcalc${LIB_EXT}
${RM} -f libcustcalc.*.dylib
${RM} -f libcustcalc.a
${V} echo remove files that are obsolete
${RM} -f libcustcalc${LIB_EXT_VERS} ${RM} -f libcustcalc${LIB_EXT_VERS}
${RM} -f libcustcalc${LIB_EXT_VER} ${RM} -f libcustcalc${LIB_EXT_VER}
${RM} -f libcustcalc${LIB_EXT_VE} ${RM} -f libcustcalc${LIB_EXT_VE}
${RM} -f libcustcalc${LIB_EXT}
${RM} -f libcustcalc.a
# install everything # install everything
# #
# NOTE: Keep the uninstall rule in reverse order to the install rule # NOTE: Keep the uninstall rule in reverse order to the install rule
# #
install: all install: all
-${Q} if [ ! -d ${T}${LIBDIR} ]; then \
echo ${MKDIR} -p ${T}${LIBDIR}; \
${MKDIR} -p ${T}${LIBDIR}; \
if [ ! -d "${T}${LIBDIR}" ]; then \
echo ${MKDIR} -p "${T}${LIBDIR}"; \
${MKDIR} -p "${T}${LIBDIR}"; \
fi; \
echo ${CHMOD} 0755 ${T}${LIBDIR}; \
${CHMOD} 0755 ${T}${LIBDIR}; \
else \
${TRUE}; \
fi
-${Q} if [ ! -d ${T}${INCDIR} ]; then \ -${Q} if [ ! -d ${T}${INCDIR} ]; then \
echo ${MKDIR} ${T}${INCDIR}; \ echo ${MKDIR} -p ${T}${INCDIR}; \
${MKDIR} ${T}${INCDIR}; \ ${MKDIR} -p ${T}${INCDIR}; \
if [ ! -d "${T}${INCDIR}" ]; then \ if [ ! -d "${T}${INCDIR}" ]; then \
echo ${MKDIR} -p "${T}${INCDIR}"; \ echo ${MKDIR} -p "${T}${INCDIR}"; \
${MKDIR} -p "${T}${INCDIR}"; \ ${MKDIR} -p "${T}${INCDIR}"; \
@@ -815,8 +832,8 @@ install: all
${TRUE}; \ ${TRUE}; \
fi fi
-${Q} if [ ! -d ${T}${CALC_SHAREDIR} ]; then \ -${Q} if [ ! -d ${T}${CALC_SHAREDIR} ]; then \
echo ${MKDIR} ${T}${CALC_SHAREDIR}; \ echo ${MKDIR} -p ${T}${CALC_SHAREDIR}; \
${MKDIR} ${T}${CALC_SHAREDIR}; \ ${MKDIR} -p ${T}${CALC_SHAREDIR}; \
if [ ! -d "${T}${CALC_SHAREDIR}" ]; then \ if [ ! -d "${T}${CALC_SHAREDIR}" ]; then \
echo ${MKDIR} -p "${T}${CALC_SHAREDIR}"; \ echo ${MKDIR} -p "${T}${CALC_SHAREDIR}"; \
${MKDIR} -p "${T}${CALC_SHAREDIR}"; \ ${MKDIR} -p "${T}${CALC_SHAREDIR}"; \
@@ -827,8 +844,8 @@ install: all
${TRUE}; \ ${TRUE}; \
fi fi
-${Q} if [ ! -d ${T}${CALC_INCDIR} ]; then \ -${Q} if [ ! -d ${T}${CALC_INCDIR} ]; then \
echo ${MKDIR} ${T}${CALC_INCDIR}; \ echo ${MKDIR} -p ${T}${CALC_INCDIR}; \
${MKDIR} ${T}${CALC_INCDIR}; \ ${MKDIR} -p ${T}${CALC_INCDIR}; \
if [ ! -d "${T}${CALC_INCDIR}" ]; then \ if [ ! -d "${T}${CALC_INCDIR}" ]; then \
echo ${MKDIR} -p "${T}${CALC_INCDIR}"; \ echo ${MKDIR} -p "${T}${CALC_INCDIR}"; \
${MKDIR} -p "${T}${CALC_INCDIR}"; \ ${MKDIR} -p "${T}${CALC_INCDIR}"; \
@@ -839,8 +856,8 @@ install: all
${TRUE}; \ ${TRUE}; \
fi fi
-${Q} if [ ! -d ${T}${HELPDIR} ]; then \ -${Q} if [ ! -d ${T}${HELPDIR} ]; then \
echo ${MKDIR} ${T}${HELPDIR}; \ echo ${MKDIR} -p ${T}${HELPDIR}; \
${MKDIR} ${T}${HELPDIR}; \ ${MKDIR} -p ${T}${HELPDIR}; \
if [ ! -d "${T}${HELPDIR}" ]; then \ if [ ! -d "${T}${HELPDIR}" ]; then \
echo ${MKDIR} -p "${T}${HELPDIR}"; \ echo ${MKDIR} -p "${T}${HELPDIR}"; \
${MKDIR} -p "${T}${HELPDIR}"; \ ${MKDIR} -p "${T}${HELPDIR}"; \
@@ -851,8 +868,8 @@ install: all
${TRUE}; \ ${TRUE}; \
fi fi
-${Q} if [ ! -d ${T}${CUSTOMCALDIR} ]; then \ -${Q} if [ ! -d ${T}${CUSTOMCALDIR} ]; then \
echo ${MKDIR} ${T}${CUSTOMCALDIR}; \ echo ${MKDIR} -p ${T}${CUSTOMCALDIR}; \
${MKDIR} ${T}${CUSTOMCALDIR}; \ ${MKDIR} -p ${T}${CUSTOMCALDIR}; \
if [ ! -d "${T}${CUSTOMCALDIR}" ]; then \ if [ ! -d "${T}${CUSTOMCALDIR}" ]; then \
echo ${MKDIR} -p "${T}${CUSTOMCALDIR}"; \ echo ${MKDIR} -p "${T}${CUSTOMCALDIR}"; \
${MKDIR} -p "${T}${CUSTOMCALDIR}"; \ ${MKDIR} -p "${T}${CUSTOMCALDIR}"; \
@@ -863,8 +880,8 @@ install: all
${TRUE}; \ ${TRUE}; \
fi fi
-${Q} if [ ! -d ${T}${CUSTOMHELPDIR} ]; then \ -${Q} if [ ! -d ${T}${CUSTOMHELPDIR} ]; then \
echo ${MKDIR} ${T}${CUSTOMHELPDIR}; \ echo ${MKDIR} -p ${T}${CUSTOMHELPDIR}; \
${MKDIR} ${T}${CUSTOMHELPDIR}; \ ${MKDIR} -p ${T}${CUSTOMHELPDIR}; \
if [ ! -d "${T}${CUSTOMHELPDIR}" ]; then \ if [ ! -d "${T}${CUSTOMHELPDIR}" ]; then \
echo ${MKDIR} -p "${T}${CUSTOMHELPDIR}"; \ echo ${MKDIR} -p "${T}${CUSTOMHELPDIR}"; \
${MKDIR} -p "${T}${CUSTOMHELPDIR}"; \ ${MKDIR} -p "${T}${CUSTOMHELPDIR}"; \
@@ -875,8 +892,8 @@ install: all
${TRUE}; \ ${TRUE}; \
fi fi
-${Q} if [ ! -d ${T}${CUSTOMINCDIR} ]; then \ -${Q} if [ ! -d ${T}${CUSTOMINCDIR} ]; then \
echo ${MKDIR} ${T}${CUSTOMINCDIR}; \ echo ${MKDIR} -p ${T}${CUSTOMINCDIR}; \
${MKDIR} ${T}${CUSTOMINCDIR}; \ ${MKDIR} -p ${T}${CUSTOMINCDIR}; \
if [ ! -d "${T}${CUSTOMINCDIR}" ]; then \ if [ ! -d "${T}${CUSTOMINCDIR}" ]; then \
echo ${MKDIR} -p "${T}${CUSTOMINCDIR}"; \ echo ${MKDIR} -p "${T}${CUSTOMINCDIR}"; \
${MKDIR} -p "${T}${CUSTOMINCDIR}"; \ ${MKDIR} -p "${T}${CUSTOMINCDIR}"; \

View File

@@ -177,8 +177,8 @@ depend:
fi fi
${Q} echo forming custom/skel ${Q} echo forming custom/skel
${Q} ${RM} -rf skel ${Q} ${RM} -rf skel
${Q} ${MKDIR} skel ${Q} ${MKDIR} -p skel
${Q} ${MKDIR} skel/custom ${Q} ${MKDIR} -p skel/custom
-${Q} for i in ${C_SRC} /dev/null; do \ -${Q} for i in ${C_SRC} /dev/null; do \
if [ X"$$i" != X"/dev/null" ]; then \ if [ X"$$i" != X"/dev/null" ]; then \
${SED} -n '/^#[ ]*include[ ]*"/p' \ ${SED} -n '/^#[ ]*include[ ]*"/p' \
@@ -289,11 +289,13 @@ clobber: clean
${RM} -f ${BLD_TYPE} ${RM} -f ${BLD_TYPE}
${RM} -f .all ${MAKE_FILE}.tmp ${MAKE_FILE}.bak ${RM} -f .all ${MAKE_FILE}.tmp ${MAKE_FILE}.bak
${RM} -f libcustcalc${LIB_EXT_VERSION} ${RM} -f libcustcalc${LIB_EXT_VERSION}
${RM} -f libcustcalc${LIB_EXT}
${RM} -f libcustcalc.*.dylib
${RM} -f libcustcalc.a
${V} echo remove files that are obsolete
${RM} -f libcustcalc${LIB_EXT_VERS} ${RM} -f libcustcalc${LIB_EXT_VERS}
${RM} -f libcustcalc${LIB_EXT_VER} ${RM} -f libcustcalc${LIB_EXT_VER}
${RM} -f libcustcalc${LIB_EXT_VE} ${RM} -f libcustcalc${LIB_EXT_VE}
${RM} -f libcustcalc${LIB_EXT}
${RM} -f libcustcalc.a
#if 0 /* start of skip for non-Gnu makefiles */ #if 0 /* start of skip for non-Gnu makefiles */
${RM} -f Makefile.simple ${RM} -f Makefile.simple
#endif /* end of skip for non-Gnu makefiles */ #endif /* end of skip for non-Gnu makefiles */
@@ -303,9 +305,21 @@ clobber: clean
# NOTE: Keep the uninstall rule in reverse order to the install rule # NOTE: Keep the uninstall rule in reverse order to the install rule
# #
install: all install: all
-${Q} if [ ! -d ${T}${LIBDIR} ]; then \
echo ${MKDIR} -p ${T}${LIBDIR}; \
${MKDIR} -p ${T}${LIBDIR}; \
if [ ! -d "${T}${LIBDIR}" ]; then \
echo ${MKDIR} -p "${T}${LIBDIR}"; \
${MKDIR} -p "${T}${LIBDIR}"; \
fi; \
echo ${CHMOD} 0755 ${T}${LIBDIR}; \
${CHMOD} 0755 ${T}${LIBDIR}; \
else \
${TRUE}; \
fi
-${Q} if [ ! -d ${T}${INCDIR} ]; then \ -${Q} if [ ! -d ${T}${INCDIR} ]; then \
echo ${MKDIR} ${T}${INCDIR}; \ echo ${MKDIR} -p ${T}${INCDIR}; \
${MKDIR} ${T}${INCDIR}; \ ${MKDIR} -p ${T}${INCDIR}; \
if [ ! -d "${T}${INCDIR}" ]; then \ if [ ! -d "${T}${INCDIR}" ]; then \
echo ${MKDIR} -p "${T}${INCDIR}"; \ echo ${MKDIR} -p "${T}${INCDIR}"; \
${MKDIR} -p "${T}${INCDIR}"; \ ${MKDIR} -p "${T}${INCDIR}"; \
@@ -316,8 +330,8 @@ install: all
${TRUE}; \ ${TRUE}; \
fi fi
-${Q} if [ ! -d ${T}${CALC_SHAREDIR} ]; then \ -${Q} if [ ! -d ${T}${CALC_SHAREDIR} ]; then \
echo ${MKDIR} ${T}${CALC_SHAREDIR}; \ echo ${MKDIR} -p ${T}${CALC_SHAREDIR}; \
${MKDIR} ${T}${CALC_SHAREDIR}; \ ${MKDIR} -p ${T}${CALC_SHAREDIR}; \
if [ ! -d "${T}${CALC_SHAREDIR}" ]; then \ if [ ! -d "${T}${CALC_SHAREDIR}" ]; then \
echo ${MKDIR} -p "${T}${CALC_SHAREDIR}"; \ echo ${MKDIR} -p "${T}${CALC_SHAREDIR}"; \
${MKDIR} -p "${T}${CALC_SHAREDIR}"; \ ${MKDIR} -p "${T}${CALC_SHAREDIR}"; \
@@ -328,8 +342,8 @@ install: all
${TRUE}; \ ${TRUE}; \
fi fi
-${Q} if [ ! -d ${T}${CALC_INCDIR} ]; then \ -${Q} if [ ! -d ${T}${CALC_INCDIR} ]; then \
echo ${MKDIR} ${T}${CALC_INCDIR}; \ echo ${MKDIR} -p ${T}${CALC_INCDIR}; \
${MKDIR} ${T}${CALC_INCDIR}; \ ${MKDIR} -p ${T}${CALC_INCDIR}; \
if [ ! -d "${T}${CALC_INCDIR}" ]; then \ if [ ! -d "${T}${CALC_INCDIR}" ]; then \
echo ${MKDIR} -p "${T}${CALC_INCDIR}"; \ echo ${MKDIR} -p "${T}${CALC_INCDIR}"; \
${MKDIR} -p "${T}${CALC_INCDIR}"; \ ${MKDIR} -p "${T}${CALC_INCDIR}"; \
@@ -340,8 +354,8 @@ install: all
${TRUE}; \ ${TRUE}; \
fi fi
-${Q} if [ ! -d ${T}${HELPDIR} ]; then \ -${Q} if [ ! -d ${T}${HELPDIR} ]; then \
echo ${MKDIR} ${T}${HELPDIR}; \ echo ${MKDIR} -p ${T}${HELPDIR}; \
${MKDIR} ${T}${HELPDIR}; \ ${MKDIR} -p ${T}${HELPDIR}; \
if [ ! -d "${T}${HELPDIR}" ]; then \ if [ ! -d "${T}${HELPDIR}" ]; then \
echo ${MKDIR} -p "${T}${HELPDIR}"; \ echo ${MKDIR} -p "${T}${HELPDIR}"; \
${MKDIR} -p "${T}${HELPDIR}"; \ ${MKDIR} -p "${T}${HELPDIR}"; \
@@ -352,8 +366,8 @@ install: all
${TRUE}; \ ${TRUE}; \
fi fi
-${Q} if [ ! -d ${T}${CUSTOMCALDIR} ]; then \ -${Q} if [ ! -d ${T}${CUSTOMCALDIR} ]; then \
echo ${MKDIR} ${T}${CUSTOMCALDIR}; \ echo ${MKDIR} -p ${T}${CUSTOMCALDIR}; \
${MKDIR} ${T}${CUSTOMCALDIR}; \ ${MKDIR} -p ${T}${CUSTOMCALDIR}; \
if [ ! -d "${T}${CUSTOMCALDIR}" ]; then \ if [ ! -d "${T}${CUSTOMCALDIR}" ]; then \
echo ${MKDIR} -p "${T}${CUSTOMCALDIR}"; \ echo ${MKDIR} -p "${T}${CUSTOMCALDIR}"; \
${MKDIR} -p "${T}${CUSTOMCALDIR}"; \ ${MKDIR} -p "${T}${CUSTOMCALDIR}"; \
@@ -364,8 +378,8 @@ install: all
${TRUE}; \ ${TRUE}; \
fi fi
-${Q} if [ ! -d ${T}${CUSTOMHELPDIR} ]; then \ -${Q} if [ ! -d ${T}${CUSTOMHELPDIR} ]; then \
echo ${MKDIR} ${T}${CUSTOMHELPDIR}; \ echo ${MKDIR} -p ${T}${CUSTOMHELPDIR}; \
${MKDIR} ${T}${CUSTOMHELPDIR}; \ ${MKDIR} -p ${T}${CUSTOMHELPDIR}; \
if [ ! -d "${T}${CUSTOMHELPDIR}" ]; then \ if [ ! -d "${T}${CUSTOMHELPDIR}" ]; then \
echo ${MKDIR} -p "${T}${CUSTOMHELPDIR}"; \ echo ${MKDIR} -p "${T}${CUSTOMHELPDIR}"; \
${MKDIR} -p "${T}${CUSTOMHELPDIR}"; \ ${MKDIR} -p "${T}${CUSTOMHELPDIR}"; \
@@ -376,8 +390,8 @@ install: all
${TRUE}; \ ${TRUE}; \
fi fi
-${Q} if [ ! -d ${T}${CUSTOMINCDIR} ]; then \ -${Q} if [ ! -d ${T}${CUSTOMINCDIR} ]; then \
echo ${MKDIR} ${T}${CUSTOMINCDIR}; \ echo ${MKDIR} -p ${T}${CUSTOMINCDIR}; \
${MKDIR} ${T}${CUSTOMINCDIR}; \ ${MKDIR} -p ${T}${CUSTOMINCDIR}; \
if [ ! -d "${T}${CUSTOMINCDIR}" ]; then \ if [ ! -d "${T}${CUSTOMINCDIR}" ]; then \
echo ${MKDIR} -p "${T}${CUSTOMINCDIR}"; \ echo ${MKDIR} -p "${T}${CUSTOMINCDIR}"; \
${MKDIR} -p "${T}${CUSTOMINCDIR}"; \ ${MKDIR} -p "${T}${CUSTOMINCDIR}"; \

12
decl.h
View File

@@ -1,7 +1,7 @@
/* /*
* decl - variable and function declaration macros * decl - variable and function declaration macros
* *
* Copyright (C) 2007 Landon Curt Noll * Copyright (C) 2007,2014 Landon Curt Noll
* *
* Primary author: Landon Curt Noll * Primary author: Landon Curt Noll
* *
@@ -19,8 +19,8 @@
* received a copy with calc; if not, write to Free Software Foundation, Inc. * received a copy with calc; if not, write to Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* @(#) $Revision: 30.4 $ * @(#) $Revision: 30.6 $
* @(#) $Id: decl.h,v 30.4 2013/08/11 08:41:38 chongo Exp $ * @(#) $Id: decl.h,v 30.6 2014/08/24 21:56:51 chongo Exp $
* @(#) $Source: /usr/local/src/bin/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 * Under source code control: 2007/02/09 05:24:25
@@ -33,8 +33,8 @@
#include "have_const.h" #include "have_const.h"
#if !defined(__DECL_H__) #if !defined(INCLUDE_DECL_H)
#define __DECL_H__ #define INCLUDE_DECL_H
/* /*
@@ -106,4 +106,4 @@
# define PRINTF_FORMAT(fmt_idx, arg_idx) # define PRINTF_FORMAT(fmt_idx, arg_idx)
#endif #endif
#endif /* !__DECL_H__ */ #endif /* !INCLUDE_DECL_H */

12
file.h
View File

@@ -1,7 +1,7 @@
/* /*
* file - file I/O routines callable by users * file - file I/O routines callable by users
* *
* Copyright (C) 1999-2007 David I. Bell and Landon Curt Noll * Copyright (C) 1999-2007,2014 David I. Bell and Landon Curt Noll
* *
* Primary author: David I. Bell * Primary author: David I. Bell
* *
@@ -19,8 +19,8 @@
* received a copy with calc; if not, write to Free Software Foundation, Inc. * received a copy with calc; if not, write to Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* @(#) $Revision: 30.3 $ * @(#) $Revision: 30.5 $
* @(#) $Id: file.h,v 30.3 2013/09/01 22:16:21 chongo Exp $ * @(#) $Id: file.h,v 30.5 2014/08/24 21:56:51 chongo Exp $
* @(#) $Source: /usr/local/src/bin/calc/RCS/file.h,v $ * @(#) $Source: /usr/local/src/bin/calc/RCS/file.h,v $
* *
* Under source code control: 1996/05/24 05:55:58 * Under source code control: 1996/05/24 05:55:58
@@ -31,8 +31,8 @@
*/ */
#if !defined(__FILE_H__) #if !defined(INCLUDE_FILE_H)
#define __FILE_H__ #define INCLUDE_FILE_H
#if defined(CALC_SRC) /* if we are building from the calc source tree */ #if defined(CALC_SRC) /* if we are building from the calc source tree */
@@ -100,4 +100,4 @@ E_FUNC FILE *f_pathopen(char *name, char *mode, char *pathlist,
char **openpath); char **openpath);
#endif /* !__FILE_H__ */ #endif /* !INCLUDE_FILE_H */

21
func.c
View File

@@ -19,8 +19,8 @@
* received a copy with calc; if not, write to Free Software Foundation, Inc. * received a copy with calc; if not, write to Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* @(#) $Revision: 30.9 $ * @(#) $Revision: 30.10 $
* @(#) $Id: func.c,v 30.9 2013/09/02 01:38:08 chongo Exp $ * @(#) $Id: func.c,v 30.10 2014/08/31 14:54:50 chongo Exp $
* @(#) $Source: /usr/local/src/bin/calc/RCS/func.c,v $ * @(#) $Source: /usr/local/src/bin/calc/RCS/func.c,v $
* *
* Under source code control: 1990/02/15 01:48:15 * Under source code control: 1990/02/15 01:48:15
@@ -1241,10 +1241,11 @@ f_primetest(int count, NUMBER **vals)
{ {
/* parse args */ /* parse args */
switch (count) { switch (count) {
case 1: return itoq((long) qprimetest(vals[0], case 1: qlink(&_qone_);
qlink(&_qone_), qlink(&_qone_))); qlink(&_qone_);
case 2: return itoq((long) qprimetest(vals[0], return itoq((long) qprimetest(vals[0], &_qone_, &_qone_));
vals[1], qlink(&_qone_))); case 2: qlink(&_qone_);
return itoq((long) qprimetest(vals[0], vals[1], &_qone_));
default: return itoq((long) qprimetest(vals[0], vals[1], vals[2])); default: return itoq((long) qprimetest(vals[0], vals[1], vals[2]));
} }
} }
@@ -8248,6 +8249,10 @@ f_blkcpy(int count, VALUE **vals)
*/ */
args[0] = vals[1]; args[0] = vals[1];
args[1] = vals[0]; args[1] = vals[0];
null_value.v_type = V_NULL;
args[2] = &null_value;
args[3] = &null_value;
args[4] = &null_value;
switch(count) { switch(count) {
case 5: case 5:
args[2] = vals[4]; args[2] = vals[4];
@@ -8258,14 +8263,10 @@ f_blkcpy(int count, VALUE **vals)
count = 5; count = 5;
args[4] = vals[3]; args[4] = vals[3];
args[3] = vals[2]; args[3] = vals[2];
null_value.v_type = V_NULL;
args[2] = &null_value;
break; break;
case 3: case 3:
count = 4; count = 4;
args[3] = vals[2]; args[3] = vals[2];
null_value.v_type = V_NULL;
args[2] = &null_value;
break; break;
} }

12
func.h
View File

@@ -1,7 +1,7 @@
/* /*
* func - built-in function interface definitions * func - built-in function interface definitions
* *
* Copyright (C) 1999-2007 David I. Bell * Copyright (C) 1999-2007,2014 David I. Bell
* *
* Calc is open software; you can redistribute it and/or modify it under * Calc is open software; you can redistribute it and/or modify it under
* the terms of the version 2.1 of the GNU Lesser General Public License * the terms of the version 2.1 of the GNU Lesser General Public License
@@ -17,8 +17,8 @@
* received a copy with calc; if not, write to Free Software Foundation, Inc. * received a copy with calc; if not, write to Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* @(#) $Revision: 30.1 $ * @(#) $Revision: 30.3 $
* @(#) $Id: func.h,v 30.1 2007/03/16 11:09:46 chongo Exp $ * @(#) $Id: func.h,v 30.3 2014/08/24 21:56:51 chongo Exp $
* @(#) $Source: /usr/local/src/bin/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 * Under source code control: 1990/02/15 01:48:33
@@ -28,8 +28,8 @@
*/ */
#if !defined(__FUNC_H__) #if !defined(INCLUDE_FUNC_H)
#define __FUNC_H__ #define INCLUDE_FUNC_H
#if defined(CALC_SRC) /* if we are building from the calc source tree */ #if defined(CALC_SRC) /* if we are building from the calc source tree */
@@ -110,4 +110,4 @@ E_FUNC void freenumbers(FUNC *);
E_FUNC void freefunc(FUNC *); E_FUNC void freefunc(FUNC *);
#endif /* !__FUNC_H__ */ #endif /* !INCLUDE_FUNC_H */

12
hash.h
View File

@@ -1,7 +1,7 @@
/* /*
* hash - one-way hash routines * hash - one-way hash routines
* *
* Copyright (C) 1999-2007 Landon Curt Noll * Copyright (C) 1999-2007,2014 Landon Curt Noll
* *
* Calc is open software; you can redistribute it and/or modify it under * Calc is open software; you can redistribute it and/or modify it under
* the terms of the version 2.1 of the GNU Lesser General Public License * the terms of the version 2.1 of the GNU Lesser General Public License
@@ -17,8 +17,8 @@
* received a copy with calc; if not, write to Free Software Foundation, Inc. * received a copy with calc; if not, write to Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* @(#) $Revision: 30.2 $ * @(#) $Revision: 30.4 $
* @(#) $Id: hash.h,v 30.2 2007/07/05 17:37:41 chongo Exp $ * @(#) $Id: hash.h,v 30.4 2014/08/24 21:56:51 chongo Exp $
* @(#) $Source: /usr/local/src/bin/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 * Under source code control: 1995/11/14 23:57:45
@@ -29,8 +29,8 @@
*/ */
#if !defined(__HASH_H__) #if !defined(INCLUDE_HASH_H)
#define __HASH_H__ #define INCLUDE_HASH_H
#if defined(CALC_SRC) /* if we are building from the calc source tree */ #if defined(CALC_SRC) /* if we are building from the calc source tree */
@@ -132,4 +132,4 @@ E_FUNC HASH* hash_usb8(int, USB8*, int, HASH*);
E_FUNC HASH* hash_value(int, void*, HASH*); E_FUNC HASH* hash_value(int, void*, HASH*);
#endif /* !__HASH_H__ */ #endif /* !INCLUDE_HASH_H */

View File

@@ -1,7 +1,7 @@
/* /*
* have_stdvs - try <stdarg.h> to see if it really works with vsprintf() * have_stdvs - try <stdarg.h> to see if it really works with vsprintf()
* *
* Copyright (C) 1999 Landon Curt Noll * Copyright (C) 1999,2014 Landon Curt Noll
* *
* Calc is open software; you can redistribute it and/or modify it under * Calc is open software; you can redistribute it and/or modify it under
* the terms of the version 2.1 of the GNU Lesser General Public License * the terms of the version 2.1 of the GNU Lesser General Public License
@@ -17,8 +17,8 @@
* received a copy with calc; if not, write to Free Software Foundation, Inc. * received a copy with calc; if not, write to Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* @(#) $Revision: 30.2 $ * @(#) $Revision: 30.4 $
* @(#) $Id: have_stdvs.c,v 30.2 2013/08/11 08:41:38 chongo Exp $ * @(#) $Id: have_stdvs.c,v 30.4 2014/08/24 21:57:31 chongo Exp $
* @(#) $Source: /usr/local/src/bin/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 * Under source code control: 1995/09/09 22:41:10
@@ -56,6 +56,11 @@
# include <string.h> # include <string.h>
#endif #endif
#include "have_stdlib.h"
#ifdef HAVE_STDLIB_H
# include <stdlib.h>
#endif
#undef VSPRINTF_SIZE_T #undef VSPRINTF_SIZE_T
#if defined(FORCE_STDC) || (defined(__STDC__) && __STDC__ != 0) || \ #if defined(FORCE_STDC) || (defined(__STDC__) && __STDC__ != 0) || \
defined(__cplusplus) defined(__cplusplus)
@@ -87,7 +92,7 @@ try_nthis(char *fmt, VSPRINTF_SIZE_T size, ...)
{ {
va_list ap; va_list ap;
va_start(ap, fmt); va_start(ap, size);
#if !defined(DONT_HAVE_VSPRINTF) #if !defined(DONT_HAVE_VSPRINTF)
vsnprintf(buf, size, fmt, ap); vsnprintf(buf, size, fmt, ap);
#else #else

8
help.c
View File

@@ -1,7 +1,7 @@
/* /*
* help - display help for calc * help - display help for calc
* *
* Copyright (C) 1999-2007 Landon Curt Noll * Copyright (C) 1999-2007,2014 Landon Curt Noll
* *
* Calc is open software; you can redistribute it and/or modify it under * Calc is open software; you can redistribute it and/or modify it under
* the terms of the version 2.1 of the GNU Lesser General Public License * the terms of 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. * received a copy with calc; if not, write to Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* @(#) $Revision: 30.3 $ * @(#) $Revision: 30.4 $
* @(#) $Id: help.c,v 30.3 2013/08/11 01:08:32 chongo Exp $ * @(#) $Id: help.c,v 30.4 2014/08/24 21:57:31 chongo Exp $
* @(#) $Source: /usr/local/src/cmd/calc/RCS/help.c,v $ * @(#) $Source: /usr/local/src/bin/calc/RCS/help.c,v $
* *
* Under source code control: 1997/09/14 10:58:30 * Under source code control: 1997/09/14 10:58:30
* File existed as early as: 1997 * File existed as early as: 1997

View File

@@ -18,8 +18,8 @@
# received a copy with calc; if not, write to Free Software Foundation, Inc. # received a copy with calc; if not, write to Free Software Foundation, Inc.
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
# #
# @(#) $Revision: 30.9 $ # @(#) $Revision: 30.10 $
# @(#) $Id: Makefile,v 30.9 2013/09/02 02:55:19 chongo Exp $ # @(#) $Id: Makefile,v 30.10 2014/09/02 07:15:58 chongo Exp $
# @(#) $Source: /usr/local/src/bin/calc/help/RCS/Makefile,v $ # @(#) $Source: /usr/local/src/bin/calc/help/RCS/Makefile,v $
# #
# Under source code control: 1991/07/23 06:47:57 # Under source code control: 1991/07/23 06:47:57
@@ -705,8 +705,8 @@ clobber: clean
# #
install: all install: all
-${Q} if [ ! -d ${T}${CALC_SHAREDIR} ]; then \ -${Q} if [ ! -d ${T}${CALC_SHAREDIR} ]; then \
echo ${MKDIR} ${T}${CALC_SHAREDIR}; \ echo ${MKDIR} -p ${T}${CALC_SHAREDIR}; \
${MKDIR} ${T}${CALC_SHAREDIR}; \ ${MKDIR} -p ${T}${CALC_SHAREDIR}; \
if [ ! -d "${T}${CALC_SHAREDIR}" ]; then \ if [ ! -d "${T}${CALC_SHAREDIR}" ]; then \
echo ${MKDIR} -p "${T}${CALC_SHAREDIR}"; \ echo ${MKDIR} -p "${T}${CALC_SHAREDIR}"; \
${MKDIR} -p "${T}${CALC_SHAREDIR}"; \ ${MKDIR} -p "${T}${CALC_SHAREDIR}"; \
@@ -717,8 +717,8 @@ install: all
${TRUE}; \ ${TRUE}; \
fi fi
-${Q} if [ ! -d ${T}${HELPDIR} ]; then \ -${Q} if [ ! -d ${T}${HELPDIR} ]; then \
echo ${MKDIR} ${T}${HELPDIR}; \ echo ${MKDIR} -p ${T}${HELPDIR}; \
${MKDIR} ${T}${HELPDIR}; \ ${MKDIR} -p ${T}${HELPDIR}; \
if [ ! -d "${T}${HELPDIR}" ]; then \ if [ ! -d "${T}${HELPDIR}" ]; then \
echo ${MKDIR} -p "${T}${HELPDIR}"; \ echo ${MKDIR} -p "${T}${HELPDIR}"; \
${MKDIR} -p "${T}${HELPDIR}"; \ ${MKDIR} -p "${T}${HELPDIR}"; \

View File

@@ -2,7 +2,7 @@ NAME
# #
SYNOPSIS SYNOPSIS
#!/usr/local/src/cmd/calc/calc -q -f #!/usr/local/src/bin/calc/calc -q -f
# x # x
x # y x # y
## comment ## comment
@@ -52,7 +52,7 @@ DESCRIPTION
For example, of an executable file contains: For example, of an executable file contains:
#!/usr/local/src/cmd/calc/calc -q -f #!/usr/local/src/bin/calc/calc -q -f
/* NOTE: The #! above must start in column 1 of the 1st line */ /* NOTE: The #! above must start in column 1 of the 1st line */
/* The 1st line must end with -f */ /* The 1st line must end with -f */
## Single # shell comments don't work, use two or more ## Single # shell comments don't work, use two or more
@@ -100,7 +100,7 @@ LINK LIBRARY
SEE ALSO SEE ALSO
cscript, unexpected, usage cscript, unexpected, usage
## Copyright (C) 2007 Landon Curt Noll ## Copyright (C) 2007,2014 Landon Curt Noll
## ##
## Calc is open software; you can redistribute it and/or modify it under ## Calc is open software; you can redistribute it and/or modify it under
## the terms of the version 2.1 of the GNU Lesser General Public License ## the terms of the version 2.1 of the GNU Lesser General Public License
@@ -116,8 +116,8 @@ SEE ALSO
## received a copy with calc; if not, write to Free Software Foundation, Inc. ## received a copy with calc; if not, write to Free Software Foundation, Inc.
## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
## ##
## @(#) $Revision: 30.1 $ ## @(#) $Revision: 30.4 $
## @(#) $Id: pound,v 30.1 2007/03/16 11:10:42 chongo Exp $ ## @(#) $Id: pound,v 30.4 2014/08/24 21:59:45 chongo Exp $
## @(#) $Source: /usr/local/src/bin/calc/help/RCS/pound,v $ ## @(#) $Source: /usr/local/src/bin/calc/help/RCS/pound,v $
## ##
## Under source code control: 2007/02/06 14:09 ## Under source code control: 2007/02/06 14:09

View File

@@ -149,7 +149,7 @@ Calc shell scripts
#!/usr/bin/calc -q -s -f #!/usr/bin/calc -q -s -f
global i, n, s; global i, n, s;
n = argv(); n = argv();
for (i = 1; i <= n; i++) for (i = 1; i < n; i++)
s += eval(argv(i)); s += eval(argv(i));
print "sum =", s; print "sum =", s;
@@ -273,7 +273,7 @@ For more information use the following calc commands:
help config help config
help cscript help cscript
## Copyright (C) 2000 Landon Curt Noll and Ernest Bowen ## Copyright (C) 2000,2014 Landon Curt Noll and Ernest Bowen
## ##
## Calc is open software; you can redistribute it and/or modify it under ## Calc is open software; you can redistribute it and/or modify it under
## the terms of the version 2.1 of the GNU Lesser General Public License ## the terms of the version 2.1 of the GNU Lesser General Public License
@@ -289,8 +289,8 @@ For more information use the following calc commands:
## received a copy with calc; if not, write to Free Software Foundation, Inc. ## received a copy with calc; if not, write to Free Software Foundation, Inc.
## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
## ##
## @(#) $Revision: 30.1 $ ## @(#) $Revision: 30.2 $
## @(#) $Id: script,v 30.1 2007/03/16 11:10:42 chongo Exp $ ## @(#) $Id: script,v 30.2 2014/08/24 22:38:56 chongo Exp $
## @(#) $Source: /usr/local/src/bin/calc/help/RCS/script,v $ ## @(#) $Source: /usr/local/src/bin/calc/help/RCS/script,v $
## ##
## Under source code control: 1999/11/30 05:29:48 ## Under source code control: 1999/11/30 05:29:48

View File

@@ -277,7 +277,7 @@ Unexpected
A single # is an calc operator, not a comment. However two or more A single # is an calc operator, not a comment. However two or more
##'s in a row is a comment. See "help pound" for more information. ##'s in a row is a comment. See "help pound" for more information.
#!/usr/local/src/cmd/calc/calc -q -f #!/usr/local/src/bin/calc/calc -q -f
/* a correct comment */ /* a correct comment */
## another correct comment ## another correct comment
@@ -289,7 +289,7 @@ Unexpected
This next example is WRONG: This next example is WRONG:
#!/usr/local/src/cmd/calc/calc -q -f #!/usr/local/src/bin/calc/calc -q -f
# This is not a calc calc comment because it has only a single # # This is not a calc calc comment because it has only a single #
# You must to start comments with ## or /* # You must to start comments with ## or /*
@@ -404,7 +404,7 @@ Unexpected
64 64
## Copyright (C) 1999-2007 Landon Curt Noll ## Copyright (C) 1999-2007,2014 Landon Curt Noll
## ##
## Calc is open software; you can redistribute it and/or modify it under ## Calc is open software; you can redistribute it and/or modify it under
## the terms of the version 2.1 of the GNU Lesser General Public License ## the terms of the version 2.1 of the GNU Lesser General Public License
@@ -420,8 +420,8 @@ Unexpected
## received a copy with calc; if not, write to Free Software Foundation, Inc. ## received a copy with calc; if not, write to Free Software Foundation, Inc.
## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
## ##
## @(#) $Revision: 30.4 $ ## @(#) $Revision: 30.6 $
## @(#) $Id: unexpected,v 30.4 2008/05/10 13:18:09 chongo Exp $ ## @(#) $Id: unexpected,v 30.6 2014/08/24 21:59:45 chongo Exp $
## @(#) $Source: /usr/local/src/bin/calc/help/RCS/unexpected,v $ ## @(#) $Source: /usr/local/src/bin/calc/help/RCS/unexpected,v $
## ##
## Under source code control: 1997/03/21 13:15:18 ## Under source code control: 1997/03/21 13:15:18

112
hist.c
View File

@@ -17,8 +17,8 @@
* received a copy with calc; if not, write to Free Software Foundation, Inc. * received a copy with calc; if not, write to Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* @(#) $Revision: 30.1 $ * @(#) $Revision: 30.2 $
* @(#) $Id: hist.c,v 30.1 2007/03/16 11:09:46 chongo Exp $ * @(#) $Id: hist.c,v 30.2 2014/08/24 23:57:57 chongo Exp $
* @(#) $Source: /usr/local/src/bin/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 * Under source code control: 1993/05/02 20:09:19
@@ -88,7 +88,7 @@ STATIC struct {
char *mark; char *mark;
int bufsize; int bufsize;
int linelen; int linelen;
int histcount; int histcount; /* valid history entries */
int curhist; int curhist;
BOOL virgin_line; /* 1 => never typed chars, 0 => chars typed */ BOOL virgin_line; /* 1 => never typed chars, 0 => chars typed */
} HS; } HS;
@@ -199,29 +199,22 @@ STATIC KEY_MAP maps[] = {
{esc_map_name, {NULL, NULL}, {NULL, NULL}}, {esc_map_name, {NULL, NULL}, {NULL, NULL}},
}; };
typedef struct history_entry {
#define INTROUND (sizeof(int) - 1) int len; /* length of data */
#define HISTLEN(hp) ((((hp)->len + INTROUND) & ~INTROUND) + sizeof(int)) char *data; /* varying length data */
#define HISTOFFSET(hp) (((char *) (hp)) - histbuf) struct history_entry* prev;
#define FIRSTHIST ((HIST *) histbuf) struct history_entry* next;
#define NEXTHIST(hp) ((HIST *) (((char *) (hp)) + HISTLEN(hp)))
typedef struct {
int len; /* length of data */
char data[1]; /* varying length data */
} HIST; } HIST;
STATIC int inited; STATIC int inited;
STATIC int canedit; STATIC int canedit;
STATIC int histused;
STATIC int key_count; STATIC int key_count;
STATIC int save_len; STATIC int save_len;
STATIC KEY_MAP *cur_map; STATIC KEY_MAP *cur_map;
STATIC KEY_MAP *base_map; STATIC KEY_MAP *base_map;
STATIC KEY_ENT key_table[MAX_KEYS]; STATIC KEY_ENT key_table[MAX_KEYS];
STATIC char histbuf[HIST_SIZE + 1]; STATIC HIST* hist_first = NULL;
STATIC HIST* hist_last = NULL;
STATIC char save_buffer[SAVE_SIZE]; STATIC char save_buffer[SAVE_SIZE];
/* declare other static functions */ /* declare other static functions */
@@ -399,6 +392,19 @@ hist_term(void)
return; return;
} }
if (hist_first) {
HIST* hp = hist_first;
HIST* next;
while(hp) {
next = hp->next;
free(hp->data);
free(hp);
hp = next;
}
}
hist_first = NULL;
hist_last = NULL;
/* /*
* restore orignal tty state * restore orignal tty state
*/ */
@@ -656,14 +662,18 @@ read_key(void)
S_FUNC HIST * S_FUNC HIST *
get_event(int n) get_event(int n)
{ {
register HIST * hp; register HIST * hp = hist_first;
int i = 0;
if ((n < 0) || (n >= HS.histcount)) do {
return NULL; if(!hp)
hp = FIRSTHIST; break;
while (n-- > 0) if(i == n)
hp = NEXTHIST(hp); return hp;
return hp; ++i;
hp = hp->next;
} while(hp);
return NULL;
} }
@@ -674,11 +684,11 @@ get_event(int n)
S_FUNC HIST * S_FUNC HIST *
find_event(char *pat, int len) find_event(char *pat, int len)
{ {
register HIST * hp; register HIST * hp = hist_first;
for (hp = FIRSTHIST; hp->len; hp = NEXTHIST(hp)) { for(hp = hist_first; hp != NULL; hp = hp->next) {
if ((hp->len == len) && (memcmp(hp->data, pat, len) == 0)) if ((hp->len == len) && (memcmp(hp->data, pat, len) == 0))
return hp; return hp;
} }
return NULL; return NULL;
} }
@@ -694,8 +704,6 @@ void
hist_saveline(char *line, int len) hist_saveline(char *line, int len)
{ {
HIST * hp; HIST * hp;
HIST * hp2;
int left;
if ((len > 0) && (line[len - 1] == '\n')) if ((len > 0) && (line[len - 1] == '\n'))
len--; len--;
@@ -709,13 +717,17 @@ hist_saveline(char *line, int len)
*/ */
hp = find_event(line, len); hp = find_event(line, len);
if (hp) { if (hp) {
hp2 = NEXTHIST(hp); if (hp == hist_last)
left = histused - HISTOFFSET(hp2);
if (left <= 0)
return; return;
histused -= HISTLEN(hp); if (hp->prev)
memcpy(hp, hp2, left + 1); hp->prev->next = hp->next;
HS.histcount--; hp->next->prev = hp->prev;
hist_last->next = hp;
hp->next = NULL;
hp->prev = hist_last;
hist_last = hp;
return;
} }
/* /*
@@ -723,24 +735,34 @@ hist_saveline(char *line, int len)
* the new command, then repeatedly delete the earliest command * the new command, then repeatedly delete the earliest command
* as many times as necessary in order to make enough room. * as many times as necessary in order to make enough room.
*/ */
while ((histused + len) >= HIST_SIZE) { if (HS.histcount >= HIST_SIZE) {
hp = (HIST *) histbuf; HIST *new_first = hist_first->next;
hp2 = NEXTHIST(hp); free(hist_first->data);
left = histused - HISTOFFSET(hp2); free(hist_first);
histused -= HISTLEN(hp); new_first->prev = NULL;
memcpy(hp, hp2, left + 1); hist_first = new_first;
HS.histcount--; HS.histcount--;
} }
/* /*
* Add the line to the end of the history table. * Add the line to the end of the history table.
*/ */
hp = (HIST *) &histbuf[histused]; hp = malloc(sizeof(HIST));
hp->next = NULL;
hp->prev = NULL;
hp->len = len; hp->len = len;
hp->data = malloc(len);
memcpy(hp->data, line, len); memcpy(hp->data, line, len);
histused += HISTLEN(hp);
histbuf[histused] = 0;
HS.curhist = ++HS.histcount; HS.curhist = ++HS.histcount;
if (!hist_first)
hist_first = hp;
if (!hist_last)
hist_last = hp;
else {
hist_last->next = hp;
hp->prev = hist_last;
hist_last = hp;
}
} }

12
hist.h
View File

@@ -1,7 +1,7 @@
/* /*
* hist - definitions for command history module * hist - definitions for command history module
* *
* Copyright (C) 1999-2007 David I. Bell * Copyright (C) 1999-2007,2014 David I. Bell
* *
* Calc is open software; you can redistribute it and/or modify it under * Calc is open software; you can redistribute it and/or modify it under
* the terms of the version 2.1 of the GNU Lesser General Public License * the terms of the version 2.1 of the GNU Lesser General Public License
@@ -17,8 +17,8 @@
* received a copy with calc; if not, write to Free Software Foundation, Inc. * received a copy with calc; if not, write to Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* @(#) $Revision: 30.1 $ * @(#) $Revision: 30.3 $
* @(#) $Id: hist.h,v 30.1 2007/03/16 11:09:46 chongo Exp $ * @(#) $Id: hist.h,v 30.3 2014/08/24 21:56:51 chongo Exp $
* @(#) $Source: /usr/local/src/bin/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 * Under source code control: 1993/05/02 20:09:20
@@ -28,8 +28,8 @@
*/ */
#if !defined(__HIST_H__) #if !defined(INCLUDE_HIST_H)
#define __HIST_H__ #define INCLUDE_HIST_H
/* /*
@@ -74,4 +74,4 @@ E_FUNC size_t hist_getline(char *prompt, char *buf, size_t len);
E_FUNC void hist_saveline(char *line, int len); E_FUNC void hist_saveline(char *line, int len);
#endif /* !__HIST_H__ */ #endif /* !INCLUDE_HIST_H */

22
input.c
View File

@@ -1,7 +1,7 @@
/* /*
* input - nested input source file reader * input - nested input source file reader
* *
* Copyright (C) 1999-2007 David I. Bell * Copyright (C) 1999-2007,2014 David I. Bell
* *
* Calc is open software; you can redistribute it and/or modify it under * Calc is open software; you can redistribute it and/or modify it under
* the terms of the version 2.1 of the GNU Lesser General Public License * the terms of the version 2.1 of the GNU Lesser General Public License
@@ -17,8 +17,8 @@
* received a copy with calc; if not, write to Free Software Foundation, Inc. * received a copy with calc; if not, write to Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* @(#) $Revision: 30.3 $ * @(#) $Revision: 30.6 $
* @(#) $Id: input.c,v 30.3 2013/08/11 08:41:38 chongo Exp $ * @(#) $Id: input.c,v 30.6 2014/08/31 14:54:50 chongo Exp $
* @(#) $Source: /usr/local/src/bin/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 * Under source code control: 1990/02/15 01:48:16
@@ -51,7 +51,7 @@
#if defined(__MSDOS__) #if defined(__MSDOS__)
#include <limits.h> #include <limits.h>
#define _fullpath(f,n,s) (_fixpath(n,f),f) #define _fullpath(f,n,s) (_fixpath(n,f),f)
#define _MAX_PATH PATH_MAX #define MSDOS_MAX_PATH PATH_MAX
#endif #endif
#include "calc.h" #include "calc.h"
@@ -815,6 +815,7 @@ ttychar(void)
*/ */
if (charbuf[0] == '!') { /* do a shell command */ if (charbuf[0] == '!') { /* do a shell command */
char *cmd; char *cmd;
int ret;
cmd = charbuf + 1; cmd = charbuf + 1;
if (*cmd == '\0' || *cmd == '\n') if (*cmd == '\0' || *cmd == '\n')
@@ -823,7 +824,10 @@ ttychar(void)
if (conf->calc_debug & CALCDBG_SYSTEM) { if (conf->calc_debug & CALCDBG_SYSTEM) {
printf("%s\n", cmd); printf("%s\n", cmd);
} }
system(cmd); ret = system(cmd);
if (ret < 0) {
fprintf(stderr, "error in cmd: %s\n", cmd);
}
} else { } else {
fprintf(stderr, "execution disallowed by -m flag\n"); fprintf(stderr, "execution disallowed by -m flag\n");
} }
@@ -977,9 +981,9 @@ isinoderead(struct stat *sbuf)
/* scan the entire readset */ /* scan the entire readset */
for (i=0; i < maxreadset; ++i) { for (i=0; i < maxreadset; ++i) {
#if defined(_WIN32) || defined(__MSDOS__) #if defined(_WIN32) || defined(__MSDOS__)
char tmp[_MAX_PATH+1]; char tmp[MSDOS_MAX_PATH+1];
tmp[_MAX_PATH] = '\0'; tmp[MSDOS_MAX_PATH] = '\0';
if (_fullpath(tmp, cip->i_name, _MAX_PATH) && if (_fullpath(tmp, cip->i_name, MSDOS_MAX_PATH) &&
readset[i].active && readset[i].active &&
strcasecmp(readset[i].path, tmp) == 0) { strcasecmp(readset[i].path, tmp) == 0) {
/* found a match */ /* found a match */
@@ -1110,7 +1114,7 @@ addreadset(char *name, char *path, struct stat *sbuf)
* this new longer path name. * this new longer path name.
*/ */
{ {
readset[ret].path = _fullpath(NULL, path, _MAX_PATH); readset[ret].path = _fullpath(NULL, path, MSDOS_MAX_PATH);
if (readset[ret].path == NULL) { if (readset[ret].path == NULL) {
return -1; return -1;
} }

12
jump.h
View File

@@ -1,7 +1,7 @@
/* /*
* jump - trivial prime jump table * jump - trivial prime jump table
* *
* Copyright (C) 1999-2007 Landon Curt Noll * Copyright (C) 1999-2007,2014 Landon Curt Noll
* *
* Calc is open software; you can redistribute it and/or modify it under * Calc is open software; you can redistribute it and/or modify it under
* the terms of the version 2.1 of the GNU Lesser General Public License * the terms of the version 2.1 of the GNU Lesser General Public License
@@ -17,8 +17,8 @@
* received a copy with calc; if not, write to Free Software Foundation, Inc. * received a copy with calc; if not, write to Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* @(#) $Revision: 30.1 $ * @(#) $Revision: 30.3 $
* @(#) $Id: jump.h,v 30.1 2007/03/16 11:09:46 chongo Exp $ * @(#) $Id: jump.h,v 30.3 2014/08/24 21:56:51 chongo Exp $
* @(#) $Source: /usr/local/src/bin/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 * Under source code control: 1994/06/29 04:03:55
@@ -62,8 +62,8 @@
*/ */
#if !defined(__JUMP_H__) #if !defined(INCLUDE_JUMP_H)
#define __JUMP_H__ #define INCLUDE_JUMP_H
#if defined(CALC_SRC) /* if we are building from the calc source tree */ #if defined(CALC_SRC) /* if we are building from the calc source tree */
@@ -107,4 +107,4 @@ EXTERN CONST short jmpindx[];
EXTERN CONST unsigned char jmp[]; EXTERN CONST unsigned char jmp[];
EXTERN CONST unsigned char *CONST lastjmp; EXTERN CONST unsigned char *CONST lastjmp;
#endif /* !__JUMP_H__ */ #endif /* !INCLUDE_JUMP_H */

12
label.h
View File

@@ -1,7 +1,7 @@
/* /*
* label - label handling routines * label - label handling routines
* *
* Copyright (C) 1999-2007 David I. Bell * Copyright (C) 1999-2007,2014 David I. Bell
* *
* Calc is open software; you can redistribute it and/or modify it under * Calc is open software; you can redistribute it and/or modify it under
* the terms of the version 2.1 of the GNU Lesser General Public License * the terms of the version 2.1 of the GNU Lesser General Public License
@@ -17,8 +17,8 @@
* received a copy with calc; if not, write to Free Software Foundation, Inc. * received a copy with calc; if not, write to Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* @(#) $Revision: 30.1 $ * @(#) $Revision: 30.3 $
* @(#) $Id: label.h,v 30.1 2007/03/16 11:09:46 chongo Exp $ * @(#) $Id: label.h,v 30.3 2014/08/24 21:56:51 chongo Exp $
* @(#) $Source: /usr/local/src/bin/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 * Under source code control: 1990/02/15 01:48:33
@@ -28,8 +28,8 @@
*/ */
#if !defined(__LABEL_H__) #if !defined(INCLUDE_LABEL_H)
#define __LABEL_H__ #define INCLUDE_LABEL_H
#if defined(CALC_SRC) /* if we are building from the calc source tree */ #if defined(CALC_SRC) /* if we are building from the calc source tree */
@@ -61,4 +61,4 @@ E_FUNC void uselabel(LABEL *lp);
E_FUNC void checklabels(void); E_FUNC void checklabels(void);
#endif /* !__LABEL_H__ */ #endif /* !INCLUDE_LABEL_H */

View File

@@ -1,7 +1,7 @@
/* /*
* math_error - a simple libcalc math error routine * math_error - a simple libcalc math error routine
* *
* Copyright (C) 1999-2007 Landon Curt Noll * Copyright (C) 1999-2007,2014 Landon Curt Noll
* *
* Calc is open software; you can redistribute it and/or modify it under * Calc is open software; you can redistribute it and/or modify it under
* the terms of the version 2.1 of the GNU Lesser General Public License * the terms of the version 2.1 of the GNU Lesser General Public License
@@ -17,8 +17,8 @@
* received a copy with calc; if not, write to Free Software Foundation, Inc. * received a copy with calc; if not, write to Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* @(#) $Revision: 30.1 $ * @(#) $Revision: 30.3 $
* @(#) $Id: lib_calc.h,v 30.1 2007/03/16 11:09:46 chongo Exp $ * @(#) $Id: lib_calc.h,v 30.3 2014/08/24 21:56:51 chongo Exp $
* @(#) $Source: /usr/local/src/bin/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 * Under source code control: 1997/03/23 18:37:10
@@ -29,8 +29,8 @@
*/ */
#if !defined(__MATH_ERROR_H__) #if !defined(INCLUDE_MATH_ERROR_H)
#define __MATH_ERROR_H__ #define INCLUDE_MATH_ERROR_H
#include <setjmp.h> #include <setjmp.h>
@@ -78,4 +78,4 @@ EXTERN int calc_print_scanwarn_msg;
/* number of parse/scan warnings found */ /* number of parse/scan warnings found */
EXTERN unsigned long calc_warn_cnt; EXTERN unsigned long calc_warn_cnt;
#endif /* !__MATH_ERROR_H__ */ #endif /* !INCLUDE_MATH_ERROR_H */

View File

@@ -1,7 +1,7 @@
/* /*
* lib_util - calc link library utility routines * lib_util - calc link library utility routines
* *
* Copyright (C) 1999-2007 Landon Curt Noll * Copyright (C) 1999-2007,2014 Landon Curt Noll
* *
* Calc is open software; you can redistribute it and/or modify it under * Calc is open software; you can redistribute it and/or modify it under
* the terms of the version 2.1 of the GNU Lesser General Public License * the terms of the version 2.1 of the GNU Lesser General Public License
@@ -17,8 +17,8 @@
* received a copy with calc; if not, write to Free Software Foundation, Inc. * received a copy with calc; if not, write to Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* @(#) $Revision: 30.1 $ * @(#) $Revision: 30.3 $
* @(#) $Id: lib_util.h,v 30.1 2007/03/16 11:09:46 chongo Exp $ * @(#) $Id: lib_util.h,v 30.3 2014/08/24 21:56:51 chongo Exp $
* @(#) $Source: /usr/local/src/bin/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 * Under source code control: 1997/04/19 21:38:30
@@ -34,8 +34,8 @@
*/ */
#if !defined(__LIB_UTIL_H__) #if !defined(INCLUDE_LIB_UTIL_H)
#define __LIB_UTIL_H__ #define INCLUDE_LIB_UTIL_H
/* external functions in lib_util.c */ /* external functions in lib_util.c */
EXTERN int lowhex2bin[256]; EXTERN int lowhex2bin[256];
@@ -44,4 +44,4 @@ E_FUNC ZVALUE convstr2z(char*);
E_FUNC ZVALUE convhex2z(char *hex); E_FUNC ZVALUE convhex2z(char *hex);
E_FUNC char *convz2hex(ZVALUE z); E_FUNC char *convz2hex(ZVALUE z);
#endif /* __LIB_UTIL_H__ */ #endif /* INCLUDE_LIB_UTIL_H */

View File

@@ -1,7 +1,7 @@
/* /*
* longbits - Determine the number if bits in a char, short, int or long * longbits - Determine the number if bits in a char, short, int or long
* *
* Copyright (C) 1999-2007 Landon Curt Noll * Copyright (C) 1999-2007,2014 Landon Curt Noll
* *
* Calc is open software; you can redistribute it and/or modify it under * Calc is open software; you can redistribute it and/or modify it under
* the terms of the version 2.1 of the GNU Lesser General Public License * the terms of the version 2.1 of the GNU Lesser General Public License
@@ -17,8 +17,8 @@
* received a copy with calc; if not, write to Free Software Foundation, Inc. * received a copy with calc; if not, write to Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* @(#) $Revision: 30.2 $ * @(#) $Revision: 30.3 $
* @(#) $Id: longbits.c,v 30.2 2013/08/11 08:41:38 chongo Exp $ * @(#) $Id: longbits.c,v 30.3 2014/08/24 21:57:31 chongo Exp $
* @(#) $Source: /usr/local/src/bin/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 * Under source code control: 1994/03/18 03:06:18

View File

@@ -1,7 +1,7 @@
/* /*
* nametype - associate names with values * nametype - associate names with values
* *
* Copyright (C) 1999 Landon Curt Noll * Copyright (C) 1999,2014 Landon Curt Noll
* *
* Calc is open software; you can redistribute it and/or modify it under * Calc is open software; you can redistribute it and/or modify it under
* the terms of the version 2.1 of the GNU Lesser General Public License * the terms of the version 2.1 of the GNU Lesser General Public License
@@ -17,8 +17,8 @@
* received a copy with calc; if not, write to Free Software Foundation, Inc. * received a copy with calc; if not, write to Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* @(#) $Revision: 30.1 $ * @(#) $Revision: 30.3 $
* @(#) $Id: nametype.h,v 30.1 2007/03/16 11:09:46 chongo Exp $ * @(#) $Id: nametype.h,v 30.3 2014/08/24 21:56:51 chongo Exp $
* @(#) $Source: /usr/local/src/bin/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 * Under source code control: 1997/03/08 13:44:55
@@ -29,8 +29,8 @@
*/ */
#if !defined(__NAMETYPE_H__) #if !defined(INCLUDE_NAMETYPE_H)
#define __NAMETYPE_H__ #define INCLUDE_NAMETYPE_H
/* /*
@@ -42,4 +42,4 @@ typedef struct {
} NAMETYPE; } NAMETYPE;
#endif /* !__NAMETYPE_H__ */ #endif /* !INCLUDE_NAMETYPE_H */

View File

@@ -1,47 +0,0 @@
/*
* no-implicit - Determine if the compiler allows -Wno-implicit
*
* Copyright (C) 2003 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.1 $
* @(#) $Id: no_implicit.c,v 30.1 2007/03/16 11:09:46 chongo Exp $
* @(#) $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
*
* chongo <was here> /\oo/\ http://www.isthe.com/chongo/
* Share and enjoy! :-) http://www.isthe.com/chongo/tech/comp/calc/
*/
/*
* If we are able to compile this program, then we the compiler must
* allow the -Wno-implicit flag so we output the -Wno-implicit symbol.
*/
#include <stdio.h>
int
main(void)
{
/* -Wno-implicit flag is allowed */
printf("-Wno-implicit\n");
/* exit(0); */
return 0;
}

View File

@@ -19,8 +19,8 @@
* received a copy with calc; if not, write to Free Software Foundation, Inc. * received a copy with calc; if not, write to Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* @(#) $Revision: 30.5 $ * @(#) $Revision: 30.6 $
* @(#) $Id: opcodes.c,v 30.5 2013/08/11 08:41:38 chongo Exp $ * @(#) $Id: opcodes.c,v 30.6 2014/08/31 14:54:50 chongo Exp $
* @(#) $Source: /usr/local/src/bin/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 * Under source code control: 1990/02/15 01:48:19
@@ -3936,7 +3936,7 @@ calculate(FUNC *fp, int argcount)
case OPGLB: /* global symbol reference (pointer arg) */ case OPGLB: /* global symbol reference (pointer arg) */
/* ignore Saber-C warning #68 - benign type mismatch */ /* ignore Saber-C warning #68 - benign type mismatch */
/* ok to ignore in proc calculate */ /* ok to ignore in proc calculate */
(*op->o_func)(fp, *((char **) &fp->f_opcodes[pc])); (*op->o_func)(fp, *(&fp->f_opcodes[pc]));
pc += PTR_SIZE; pc += PTR_SIZE;
break; break;

View File

@@ -1,7 +1,7 @@
/* /*
* opcodes - opcode execution module definition * opcodes - opcode execution module definition
* *
* Copyright (C) 1999-2007 David I. Bell * Copyright (C) 1999-2007,2014 David I. Bell
* *
* Calc is open software; you can redistribute it and/or modify it under * Calc is open software; you can redistribute it and/or modify it under
* the terms of the version 2.1 of the GNU Lesser General Public License * the terms of the version 2.1 of the GNU Lesser General Public License
@@ -17,8 +17,8 @@
* received a copy with calc; if not, write to Free Software Foundation, Inc. * received a copy with calc; if not, write to Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* @(#) $Revision: 30.1 $ * @(#) $Revision: 30.3 $
* @(#) $Id: opcodes.h,v 30.1 2007/03/16 11:09:46 chongo Exp $ * @(#) $Id: opcodes.h,v 30.3 2014/08/24 21:56:51 chongo Exp $
* @(#) $Source: /usr/local/src/bin/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 * Under source code control: 1990/02/15 01:48:35
@@ -28,8 +28,8 @@
*/ */
#if !defined(__OPCODES_H__) #if !defined(INCLUDE_OPCODES_H)
#define __OPCODES_H__ #define INCLUDE_OPCODES_H
#if defined(CALC_SRC) /* if we are building from the calc source tree */ #if defined(CALC_SRC) /* if we are building from the calc source tree */
@@ -184,4 +184,4 @@ EXTERN char *funcname; /* function being executed */
EXTERN long funcline; /* function line being executed */ EXTERN long funcline; /* function line being executed */
#endif /* !__OPCODES_H__ */ #endif /* !INCLUDE_OPCODES_H */

12
prime.h
View File

@@ -1,7 +1,7 @@
/* /*
* prime - quickly determine if a small number is prime * prime - quickly determine if a small number is prime
* *
* Copyright (C) 1999-2007 Landon Curt Noll * Copyright (C) 1999-2007,2014 Landon Curt Noll
* *
* Calc is open software; you can redistribute it and/or modify it under * Calc is open software; you can redistribute it and/or modify it under
* the terms of the version 2.1 of the GNU Lesser General Public License * the terms of the version 2.1 of the GNU Lesser General Public License
@@ -17,8 +17,8 @@
* received a copy with calc; if not, write to Free Software Foundation, Inc. * received a copy with calc; if not, write to Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* @(#) $Revision: 30.1 $ * @(#) $Revision: 30.3 $
* @(#) $Id: prime.h,v 30.1 2007/03/16 11:09:46 chongo Exp $ * @(#) $Id: prime.h,v 30.3 2014/08/24 21:56:51 chongo Exp $
* @(#) $Source: /usr/local/src/bin/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 * Under source code control: 1994/06/04 03:26:15
@@ -29,8 +29,8 @@
*/ */
#if !defined(__PRIME_H__) #if !defined(INCLUDE_PRIME_H)
#define __PRIME_H__ #define INCLUDE_PRIME_H
#if defined(CALC_SRC) /* if we are building from the calc source tree */ #if defined(CALC_SRC) /* if we are building from the calc source tree */
@@ -91,4 +91,4 @@ EXTERN CONST ZVALUE _nxt_prime_; /* 2^32+15 - smallest prime > 2^32 */
EXTERN CONST ZVALUE _jmpmod2_; /* JMPMOD*2 as a ZVALUE */ EXTERN CONST ZVALUE _jmpmod2_; /* JMPMOD*2 as a ZVALUE */
#endif /* !__PRIME_H__ */ #endif /* !INCLUDE_PRIME_H */

View File

@@ -1,7 +1,7 @@
/* /*
* qmath - extended precision rational arithmetic primitive routines * qmath - extended precision rational arithmetic primitive routines
* *
* Copyright (C) 1999-2007 David I. Bell and Ernest Bowen * Copyright (C) 1999-2007,2014 David I. Bell and Ernest Bowen
* *
* Primary author: David I. Bell * Primary author: David I. Bell
* *
@@ -19,8 +19,8 @@
* received a copy with calc; if not, write to Free Software Foundation, Inc. * received a copy with calc; if not, write to Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* @(#) $Revision: 30.2 $ * @(#) $Revision: 30.4 $
* @(#) $Id: qmath.c,v 30.2 2013/08/11 08:41:38 chongo Exp $ * @(#) $Id: qmath.c,v 30.4 2014/08/24 21:56:51 chongo Exp $
* @(#) $Source: /usr/local/src/bin/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 * Under source code control: 1990/02/15 01:48:21
@@ -1312,7 +1312,7 @@ qcmp(NUMBER *q1, NUMBER *q2)
if (q1 == q2) if (q1 == q2)
return FALSE; return FALSE;
if ((q1->num.sign != q2->num.sign) || (q1->num.len != q2->num.len) || if ((q1->num.sign != q2->num.sign) || (q1->num.len != q2->num.len) ||
(q2->den.len != q2->den.len) || (*q1->num.v != *q2->num.v) || (q1->den.len != q2->den.len) || (*q1->num.v != *q2->num.v) ||
(*q1->den.v != *q2->den.v)) (*q1->den.v != *q2->den.v))
return TRUE; return TRUE;
if (zcmp(q1->num, q2->num)) if (zcmp(q1->num, q2->num))

12
qmath.h
View File

@@ -1,7 +1,7 @@
/* /*
* qmath - declarations for extended precision rational arithmetic * qmath - declarations for extended precision rational arithmetic
* *
* Copyright (C) 1999-2007 David I. Bell * Copyright (C) 1999-2007,2014 David I. Bell
* *
* Calc is open software; you can redistribute it and/or modify it under * Calc is open software; you can redistribute it and/or modify it under
* the terms of the version 2.1 of the GNU Lesser General Public License * the terms of the version 2.1 of the GNU Lesser General Public License
@@ -17,8 +17,8 @@
* received a copy with calc; if not, write to Free Software Foundation, Inc. * received a copy with calc; if not, write to Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* @(#) $Revision: 30.4 $ * @(#) $Revision: 30.6 $
* @(#) $Id: qmath.h,v 30.4 2013/09/01 22:16:21 chongo Exp $ * @(#) $Id: qmath.h,v 30.6 2014/08/24 21:56:51 chongo Exp $
* @(#) $Source: /usr/local/src/bin/calc/RCS/qmath.h,v $ * @(#) $Source: /usr/local/src/bin/calc/RCS/qmath.h,v $
* *
* Under source code control: 1993/07/30 19:42:47 * Under source code control: 1993/07/30 19:42:47
@@ -28,8 +28,8 @@
*/ */
#if !defined(__QMATH_H__) #if !defined(INCLUDE_QMATH_H)
#define __QMATH_H__ #define INCLUDE_QMATH_H
#if defined(CALC_SRC) /* if we are building from the calc source tree */ #if defined(CALC_SRC) /* if we are building from the calc source tree */
@@ -278,4 +278,4 @@ EXTERN NUMBER _qtwo_, _qthree_, _qfour_, _qten_;
EXTERN NUMBER * initnumbs[]; EXTERN NUMBER * initnumbs[];
#endif /* !__QMATH_H__ */ #endif /* !INCLUDE_QMATH_H */

56
rpm.mk
View File

@@ -3,7 +3,7 @@
# #
# rpm.mk - Makefile for building rpm packages for calc # rpm.mk - Makefile for building rpm packages for calc
# #
# Copyright (C) 2003 Petteri Kettunen and Landon Curt Noll # Copyright (C) 2003,2014 Petteri Kettunen and Landon Curt Noll
# #
# Calc is open software; you can redistribute it and/or modify it under # Calc is open software; you can redistribute it and/or modify it under
# the terms of the version 2.1 of the GNU Lesser General Public License # the terms of the version 2.1 of the GNU Lesser General Public License
@@ -19,8 +19,8 @@
# received a copy with calc; if not, write to Free Software Foundation, Inc. # received a copy with calc; if not, write to Free Software Foundation, Inc.
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
# #
MAKEFILE_REV= $$Revision: 30.11 $$ MAKEFILE_REV= $$Revision: 30.15 $$
# @(#) $Id: rpm.mk,v 30.11 2013/08/11 08:41:38 chongo Exp $ # @(#) $Id: rpm.mk,v 30.15 2014/09/08 00:04:13 chongo Exp $
# @(#) $Source: /usr/local/src/bin/calc/RCS/rpm.mk,v $ # @(#) $Source: /usr/local/src/bin/calc/RCS/rpm.mk,v $
# #
# Under source code control: 2003/02/16 20:21:39 # Under source code control: 2003/02/16 20:21:39
@@ -35,21 +35,22 @@ MAKEFILE_REV= $$Revision: 30.11 $$
# IMPORTANT NOTE: The rpm process assumes that ~/.rpmmacros contains # IMPORTANT NOTE: The rpm process assumes that ~/.rpmmacros contains
# the following: # the following:
# #
# %_topdir /var/tmp/rpmbuild
# %_tmppath %{_topdir}/tmp
# %_builddir %{_topdir}/BUILD
# %_rpmdir %{_topdir}/RPMS
# %_sourcedir %{_topdir}/SOURCES
# %_specdir %{_topdir}/SPECS
# %_srcrpmdir %{_topdir}/SRPMS
# %_buildroot %{_topdir}/BUILDROOT
# %_rpmfilename %%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm
#
# If you are signing the rpms, you also need:
#
# %_signature gpg # %_signature gpg
# %_gpg_path ~/.gnupg # %_gpg_path ~/.gnupg
# %_gpg_name __YOUR_NAME_HERE__ # %_gpg_name __YOUR_NAME_HERE__
# %_gpgbin /usr/bin/gpg # %_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, # IMPORTANT NOTE: Unless the package redhat-rpm-config is installed,
# the calc-debuginfo rpm will not be created. # the calc-debuginfo rpm will not be created.
@@ -68,8 +69,8 @@ MAKEFILE_REV= $$Revision: 30.11 $$
# #
SHELL= /bin/sh SHELL= /bin/sh
RPMBUILD_TOOL= rpmbuild RPMBUILD_TOOL= rpmbuild
TARCH= i686 TARCH= x86_64
RPMBUILD_OPTION= -ba --target=$(TARCH) RPMBUILD_OPTION= -ba --target=$(TARCH) --buildroot=${RPM_BUILD_ROOT}
RPM_TOOL= rpm RPM_TOOL= rpm
SED= sed SED= sed
FIND= find FIND= find
@@ -95,11 +96,13 @@ PROJECT_RELEASE=
PROJECT= ${PROJECT_NAME}-${PROJECT_VERSION} PROJECT= ${PROJECT_NAME}-${PROJECT_VERSION}
SPECFILE= ${PROJECT_NAME}.spec SPECFILE= ${PROJECT_NAME}.spec
TARBALL= ${PROJECT}.${TAR}.bz2 TARBALL= ${PROJECT}.${TAR}.bz2
RPM686= ${PROJECT}-${PROJECT_RELEASE}.${TARCH}.rpm RPMx86_64= ${PROJECT}-${PROJECT_RELEASE}.${TARCH}.rpm
DRPM686= \ DRPMx86_64= \
${PROJECT_NAME}-devel-${PROJECT_VERSION}-${PROJECT_RELEASE}.${TARCH}.rpm ${PROJECT_NAME}-devel-${PROJECT_VERSION}-${PROJECT_RELEASE}.${TARCH}.rpm
SRPM= ${PROJECT}-${PROJECT_RELEASE}.src.rpm SRPM= ${PROJECT}-${PROJECT_RELEASE}.src.rpm
RPM_TOP= ${HOME}/rpm/${NAME} # NOTE: RPM_TOP must be the same as %_topdir in ~/.rpmmacros
RPM_TOP= /var/tmp/rpmbuild
RPM_BUILD_ROOT= ${RPM_TOP}/BUILDROOT
TMPDIR= ${RPM_TOP}/tmp TMPDIR= ${RPM_TOP}/tmp
# Makefile debug # Makefile debug
@@ -149,6 +152,7 @@ calc.spec: calc.spec.in ver_calc
srcpkg: make_rhdir srcpkg: make_rhdir
${V} echo '=-=-=-=-= rpm.mk start of $@ rule =-=-=-=-=' ${V} echo '=-=-=-=-= rpm.mk start of $@ rule =-=-=-=-='
${V} echo RPM_TOP="${RPM_TOP}" ${V} echo RPM_TOP="${RPM_TOP}"
${V} echo RPM_BUILD_ROOT="${RPM_BUILD_ROOT}"
${V} echo PROJECT_VERSION="${PROJECT_VERSION}" ${V} echo PROJECT_VERSION="${PROJECT_VERSION}"
${V} echo PROJECT_RELEASE="${PROJECT_RELEASE}" ${V} echo PROJECT_RELEASE="${PROJECT_RELEASE}"
${RM} -rf "$(TMPDIR)/$(PROJECT)" ${RM} -rf "$(TMPDIR)/$(PROJECT)"
@@ -171,12 +175,13 @@ srcpkg: make_rhdir
rpm: srcpkg calc.spec rpm: srcpkg calc.spec
${V} echo '=-=-=-=-= rpm.mk start of $@ rule =-=-=-=-=' ${V} echo '=-=-=-=-= rpm.mk start of $@ rule =-=-=-=-='
${V} echo RPM_TOP="${RPM_TOP}" ${V} echo RPM_TOP="${RPM_TOP}"
${V} echo RPM_BUILD_ROOT="${RPM_BUILD_ROOT}"
${V} echo PROJECT_VERSION="${PROJECT_VERSION}" ${V} echo PROJECT_VERSION="${PROJECT_VERSION}"
${V} echo PROJECT_RELEASE="${PROJECT_RELEASE}" ${V} echo PROJECT_RELEASE="${PROJECT_RELEASE}"
$(MAKE) -f Makefile clean $(MAKE) -f Makefile clean
${CP} "$(SPECFILE)" "$(RPM_TOP)/SPECS/$(SPECFILE)" ${CP} "$(SPECFILE)" "$(RPM_TOP)/SPECS/$(SPECFILE)"
${RM} -f "$(RPM_TOP)/RPMS/$(TARCH)/$(RPM686)" ${RM} -f "$(RPM_TOP)/RPMS/$(TARCH)/$(RPMx86_64)"
${RM} -f "$(RPM_TOP)/RPMS/$(TARCH)/$(DRPM686)" ${RM} -f "$(RPM_TOP)/RPMS/$(TARCH)/$(DRPMx86_64)"
${RM} -f "$(RPM_TOP)/SRPMS/$(SRPM)" ${RM} -f "$(RPM_TOP)/SRPMS/$(SRPM)"
${RPMBUILD_TOOL} ${RPMBUILD_OPTION} "$(RPM_TOP)/SPECS/$(SPECFILE)" ${RPMBUILD_TOOL} ${RPMBUILD_OPTION} "$(RPM_TOP)/SPECS/$(SPECFILE)"
@if [ ! -f "$(RPM_TOP)/SRPMS/$(SRPM)" ]; then \ @if [ ! -f "$(RPM_TOP)/SRPMS/$(SRPM)" ]; then \
@@ -190,6 +195,7 @@ rpm: srcpkg calc.spec
make_rhdir: make_rhdir:
${V} echo '=-=-=-=-= rpm.mk start of $@ rule =-=-=-=-=' ${V} echo '=-=-=-=-= rpm.mk start of $@ rule =-=-=-=-='
${V} echo RPM_TOP="${RPM_TOP}" ${V} echo RPM_TOP="${RPM_TOP}"
${V} echo RPM_BUILD_ROOT="${RPM_BUILD_ROOT}"
${V} echo PROJECT_VERSION="${PROJECT_VERSION}" ${V} echo PROJECT_VERSION="${PROJECT_VERSION}"
${V} echo PROJECT_RELEASE="${PROJECT_RELEASE}" ${V} echo PROJECT_RELEASE="${PROJECT_RELEASE}"
for subdir in "" BUILD RPMS SOURCES SPECS SRPMS tmp; do \ for subdir in "" BUILD RPMS SOURCES SPECS SRPMS tmp; do \
@@ -243,8 +249,8 @@ logdate:
.PHONY: chkpkg .PHONY: chkpkg
chkpkg: chkpkg:
${V} echo '=-=-=-=-= rpm.mk start of $@ rule =-=-=-=-=' ${V} echo '=-=-=-=-= rpm.mk start of $@ rule =-=-=-=-='
for i in "$(RPM_TOP)/RPMS/$(TARCH)/$(RPM686)" \ for i in "$(RPM_TOP)/RPMS/$(TARCH)/$(RPMx86_64)" \
"$(RPM_TOP)/RPMS/$(TARCH)/$(DRPM686)" \ "$(RPM_TOP)/RPMS/$(TARCH)/$(DRPMx86_64)" \
"$(RPM_TOP)/SRPMS/$(SRPM)" ; do \ "$(RPM_TOP)/SRPMS/$(SRPM)" ; do \
echo "***** start $$i" ; \ echo "***** start $$i" ; \
${RPM_TOOL} -qpi "$$"i ; \ ${RPM_TOOL} -qpi "$$"i ; \
@@ -278,8 +284,8 @@ installrpm:
echo "must be root to install RPMs" 1>&2; \ echo "must be root to install RPMs" 1>&2; \
exit 7; \ exit 7; \
fi fi
${RPM_TOOL} -ivh "$(RPM_TOP)/RPMS/$(TARCH)/$(RPM686)" ${RPM_TOOL} -ivh "$(RPM_TOP)/RPMS/$(TARCH)/$(RPMx86_64)"
${RPM_TOOL} -ivh "$(RPM_TOP)/RPMS/$(TARCH)/$(DRPM686)" ${RPM_TOOL} -ivh "$(RPM_TOP)/RPMS/$(TARCH)/$(DRPMx86_64)"
${V} echo '=-=-=-=-= rpm.mk end of $@ rule =-=-=-=-=' ${V} echo '=-=-=-=-= rpm.mk end of $@ rule =-=-=-=-='
.PHONY: uninstallrpm .PHONY: uninstallrpm

2
sha1.c
View File

@@ -24,7 +24,7 @@
* *
* @(#) $Revision: 30.4 $ * @(#) $Revision: 30.4 $
* @(#) $Id: sha1.c,v 30.4 2013/08/11 01:08:32 chongo Exp $ * @(#) $Id: sha1.c,v 30.4 2013/08/11 01:08:32 chongo Exp $
* @(#) $Source: /usr/local/src/cmd/calc/RCS/sha1.c,v $ * @(#) $Source: /usr/local/src/bin/calc/RCS/sha1.c,v $
* *
* This file is not covered under version 2.1 of the GNU LGPL. * This file is not covered under version 2.1 of the GNU LGPL.
*/ */

10
sha1.h
View File

@@ -22,16 +22,16 @@
* NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
* *
* @(#) $Revision: 30.3 $ * @(#) $Revision: 30.4 $
* @(#) $Id: sha1.h,v 30.3 2007/07/05 17:37:41 chongo Exp $ * @(#) $Id: sha1.h,v 30.4 2014/09/02 06:37:39 chongo Exp $
* @(#) $Source: /usr/local/src/bin/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. * This file is not covered under version 2.1 of the GNU LGPL.
*/ */
#if !defined(__SHA1_H__) #if !defined(INCLUDE_SHA1_H)
#define __SHA1_H__ #define INCLUDE_SHA1_H
/* SHA1_CHUNKSIZE must be a power of 2 - fixed value defined by the algorithm */ /* SHA1_CHUNKSIZE must be a power of 2 - fixed value defined by the algorithm */
@@ -76,4 +76,4 @@ typedef struct {
} }
#endif /* !__SHA1_H__ */ #endif /* !INCLUDE_SHA1_H */

12
str.h
View File

@@ -1,7 +1,7 @@
/* /*
* str - string list routines * str - string list routines
* *
* Copyright (C) 1999-2007 David I. Bell * Copyright (C) 1999-2007,2014 David I. Bell
* *
* Calc is open software; you can redistribute it and/or modify it under * Calc is open software; you can redistribute it and/or modify it under
* the terms of the version 2.1 of the GNU Lesser General Public License * the terms of the version 2.1 of the GNU Lesser General Public License
@@ -17,8 +17,8 @@
* received a copy with calc; if not, write to Free Software Foundation, Inc. * received a copy with calc; if not, write to Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* @(#) $Revision: 30.1 $ * @(#) $Revision: 30.3 $
* @(#) $Id: str.h,v 30.1 2007/03/16 11:09:46 chongo Exp $ * @(#) $Id: str.h,v 30.3 2014/08/24 21:56:51 chongo Exp $
* @(#) $Source: /usr/local/src/bin/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 * Under source code control: 1990/02/15 01:48:36
@@ -28,8 +28,8 @@
*/ */
#if !defined(__CALCSTRING_H__) #if !defined(INCLUDE_CALCSTRING_H)
#define __CALCSTRING_H__ #define INCLUDE_CALCSTRING_H
#if defined(CALC_SRC) /* if we are building from the calc source tree */ #if defined(CALC_SRC) /* if we are building from the calc source tree */
@@ -79,4 +79,4 @@ E_FUNC void showliterals(void);
EXTERN STRING _nullstring_; EXTERN STRING _nullstring_;
#endif /* !__CALCSTRING_H__ */ #endif /* !INCLUDE_CALCSTRING_H */

View File

@@ -1,7 +1,7 @@
/* /*
* symbol - global and local symbol routines * symbol - global and local symbol routines
* *
* Copyright (C) 1999-2007 David I. Bell * Copyright (C) 1999-2007,2014 David I. Bell
* *
* Calc is open software; you can redistribute it and/or modify it under * Calc is open software; you can redistribute it and/or modify it under
* the terms of the version 2.1 of the GNU Lesser General Public License * the terms of the version 2.1 of the GNU Lesser General Public License
@@ -17,8 +17,8 @@
* received a copy with calc; if not, write to Free Software Foundation, Inc. * received a copy with calc; if not, write to Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* @(#) $Revision: 30.1 $ * @(#) $Revision: 30.3 $
* @(#) $Id: symbol.h,v 30.1 2007/03/16 11:09:46 chongo Exp $ * @(#) $Id: symbol.h,v 30.3 2014/08/24 21:56:51 chongo Exp $
* @(#) $Source: /usr/local/src/bin/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 * Under source code control: 1990/02/15 01:48:37
@@ -28,8 +28,8 @@
*/ */
#if !defined(__SYMBOL_H__) #if !defined(INCLUDE_SYMBOL_H)
#define __SYMBOL_H__ #define INCLUDE_SYMBOL_H
#if defined(CALC_SRC) /* if we are building from the calc source tree */ #if defined(CALC_SRC) /* if we are building from the calc source tree */
@@ -107,4 +107,4 @@ E_FUNC void showstatics(void);
E_FUNC void freestatics(void); E_FUNC void freestatics(void);
#endif /* !__SYMBOL_H__ */ #endif /* !INCLUDE_SYMBOL_H */

12
token.h
View File

@@ -1,7 +1,7 @@
/* /*
* token - token defines * token - token defines
* *
* Copyright (C) 1999-2007 David I. Bell * Copyright (C) 1999-2007,2014 David I. Bell
* *
* Calc is open software; you can redistribute it and/or modify it under * Calc is open software; you can redistribute it and/or modify it under
* the terms of the version 2.1 of the GNU Lesser General Public License * the terms of the version 2.1 of the GNU Lesser General Public License
@@ -17,8 +17,8 @@
* received a copy with calc; if not, write to Free Software Foundation, Inc. * received a copy with calc; if not, write to Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* @(#) $Revision: 30.3 $ * @(#) $Revision: 30.5 $
* @(#) $Id: token.h,v 30.3 2013/08/11 08:41:38 chongo Exp $ * @(#) $Id: token.h,v 30.5 2014/08/24 21:56:51 chongo Exp $
* @(#) $Source: /usr/local/src/bin/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 * Under source code control: 1990/02/15 01:48:37
@@ -28,8 +28,8 @@
*/ */
#if !defined(__TOKEN_H__) #if !defined(INCLUDE_TOKEN_H)
#define __TOKEN_H__ #define INCLUDE_TOKEN_H
#if defined(CALC_SRC) /* if we are building from the calc source tree */ #if defined(CALC_SRC) /* if we are building from the calc source tree */
@@ -183,4 +183,4 @@ E_FUNC void scanerror(int, char *, ...) PRINTF_FORMAT(2, 3);
E_FUNC void warning(char *, ...) PRINTF_FORMAT(1, 2); E_FUNC void warning(char *, ...) PRINTF_FORMAT(1, 2);
#endif /* !__TOKEN_H__ */ #endif /* !INCLUDE_TOKEN_H */

14
value.c
View File

@@ -1,7 +1,7 @@
/* /*
* value - generic value manipulation routines * value - generic value manipulation routines
* *
* Copyright (C) 1999-2007 David I. Bell * Copyright (C) 1999-2007,2014 David I. Bell
* *
* Calc is open software; you can redistribute it and/or modify it under * Calc is open software; you can redistribute it and/or modify it under
* the terms of the version 2.1 of the GNU Lesser General Public License * the terms of the version 2.1 of the GNU Lesser General Public License
@@ -17,8 +17,8 @@
* received a copy with calc; if not, write to Free Software Foundation, Inc. * received a copy with calc; if not, write to Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* @(#) $Revision: 30.5 $ * @(#) $Revision: 30.8 $
* @(#) $Id: value.c,v 30.5 2013/08/11 08:41:38 chongo Exp $ * @(#) $Id: value.c,v 30.8 2014/08/31 15:43:39 chongo Exp $
* @(#) $Source: /usr/local/src/bin/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 * Under source code control: 1990/02/15 01:48:25
@@ -2846,13 +2846,13 @@ printvalue(VALUE *vp, int flags)
math_fmt("o-ptr: %p", vp->v_octet); math_fmt("o-ptr: %p", vp->v_octet);
break; break;
case V_VPTR: case V_VPTR:
math_fmt("v-ptr: %p", vp->v_addr); math_fmt("v-ptr: %p", (void *)vp->v_addr);
break; break;
case V_SPTR: case V_SPTR:
math_fmt("s_ptr: %p", vp->v_str); math_fmt("s_ptr: %p", (void *)vp->v_str);
break; break;
case V_NPTR: case V_NPTR:
math_fmt("n_ptr: %p", vp->v_num); math_fmt("n_ptr: %p", (void *)vp->v_num);
break; break;
case V_NBLOCK: case V_NBLOCK:
if (!userfunc("nblk_print", vp)) if (!userfunc("nblk_print", vp))
@@ -2948,7 +2948,7 @@ printestr(VALUE *vp)
bp = vp->v_nblock->blk; bp = vp->v_nblock->blk;
} }
i = bp->datalen; i = bp->datalen;
math_fmt("%ld,%ld)", i, bp->blkchunk); math_fmt("%ld,%d)", i, bp->blkchunk);
cp = bp->data; cp = bp->data;
if (i > 0) { if (i > 0) {
math_str("={"); math_str("={");

12
value.h
View File

@@ -1,7 +1,7 @@
/* /*
* value - definitions of general values and related routines used by calc * value - definitions of general values and related routines used by calc
* *
* Copyright (C) 1999-2007 David I. Bell * Copyright (C) 1999-2007,2014 David I. Bell
* *
* Calc is open software; you can redistribute it and/or modify it under * Calc is open software; you can redistribute it and/or modify it under
* the terms of the version 2.1 of the GNU Lesser General Public License * the terms of the version 2.1 of the GNU Lesser General Public License
@@ -17,8 +17,8 @@
* received a copy with calc; if not, write to Free Software Foundation, Inc. * received a copy with calc; if not, write to Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* @(#) $Revision: 30.6 $ * @(#) $Revision: 30.8 $
* @(#) $Id: value.h,v 30.6 2013/09/02 01:38:08 chongo Exp $ * @(#) $Id: value.h,v 30.8 2014/08/24 21:56:51 chongo Exp $
* @(#) $Source: /usr/local/src/bin/calc/RCS/value.h,v $ * @(#) $Source: /usr/local/src/bin/calc/RCS/value.h,v $
* *
* Under source code control: 1993/07/30 19:42:47 * Under source code control: 1993/07/30 19:42:47
@@ -28,8 +28,8 @@
*/ */
#if !defined(__VALUE_H__) #if !defined(INCLUDE_VALUE_H)
#define __VALUE_H__ #define INCLUDE_VALUE_H
#if defined(CALC_SRC) /* if we are building from the calc source tree */ #if defined(CALC_SRC) /* if we are building from the calc source tree */
@@ -540,4 +540,4 @@ E_FUNC int stringsetbit(STRING *, long, BOOL);
E_FUNC int stringsearch(STRING *, STRING *, long, long, ZVALUE *); E_FUNC int stringsearch(STRING *, STRING *, long, long, ZVALUE *);
E_FUNC int stringrsearch(STRING *, STRING *, long, long, ZVALUE *); E_FUNC int stringrsearch(STRING *, STRING *, long, long, ZVALUE *);
#endif /* !__VALUE_H__ */ #endif /* !INCLUDE_VALUE_H */

View File

@@ -1,7 +1,7 @@
/* /*
* version - determine the version of calc * version - determine the version of calc
* *
* Copyright (C) 1999-2007 David I. Bell and Landon Curt Noll * Copyright (C) 1999-2014 David I. Bell and Landon Curt Noll
* *
* Primary author: David I. Bell * Primary author: David I. Bell
* *
@@ -19,8 +19,8 @@
* received a copy with calc; if not, write to Free Software Foundation, Inc. * received a copy with calc; if not, write to Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* @(#) $Revision: 30.22 $ * @(#) $Revision: 30.24 $
* @(#) $Id: version.c,v 30.22 2013/09/27 08:59:43 chongo Exp $ * @(#) $Id: version.c,v 30.24 2014/08/31 15:43:39 chongo Exp $
* @(#) $Source: /usr/local/src/bin/calc/RCS/version.c,v $ * @(#) $Source: /usr/local/src/bin/calc/RCS/version.c,v $
* *
* Under source code control: 1990/05/22 11:00:58 * Under source code control: 1990/05/22 11:00:58
@@ -49,7 +49,7 @@ static char *program;
#define MAJOR_VER 2 /* major library version */ #define MAJOR_VER 2 /* major library version */
#define MINOR_VER 12 /* minor library version */ #define MINOR_VER 12 /* minor library version */
#define MAJOR_PATCH 4 /* major software level under library version */ #define MAJOR_PATCH 4 /* major software level under library version */
#define MINOR_PATCH 13 /* minor software level or 0 if not patched */ #define MINOR_PATCH 14 /* minor software level or 0 if not patched */
/* /*
@@ -73,19 +73,20 @@ STATIC char *stored_version = NULL; /* version formed if != NULL */
char *Copyright = "\n" char *Copyright = "\n"
"calc - arbitrary precision calculator\n" "calc - arbitrary precision calculator\n"
"\n" "\n"
"@(#) Copyright (C) 2007 David I. Bell, Landon Curt Noll and Ernest Bowen\n" "@(#) Copyright (C) 1999-2014 David I. Bell, Landon Curt Noll "
"and Ernest Bowen\n"
"\n" "\n"
"Initial author: David I. Bell\n" "Initial author: David I. Bell\n"
"\n" "\n"
"Calc is open software; you can redistribute it and/or modify it under\n" "Calc is open software; you can redistribute it and/or modify it under\n"
"the terms of the version 2.1 of the GNU Lesser General Public License\n" "the terms of the version 2.1 of the GNU Lesser General Public License\n"
"as published by the Free Software Foundation.\n" "as published by the Free Software Foundation.\n";
"\n" char *Usability = "\n"
"Calc is distributed in the hope that it will be useful, but WITHOUT\n" "Calc is distributed in the hope that it will be useful, but WITHOUT\n"
"ANY WARRANTY; without even the implied warranty of MERCHANTABILITY\n" "ANY WARRANTY; without even the implied warranty of MERCHANTABILITY\n"
"or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General\n" "or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General\n"
"Public License for more details.\n" "Public License for more details.\n";
"\n" char *COPYING_LGPL = "\n"
"A copy of version 2.1 of the GNU Lesser General Public License is\n" "A copy of version 2.1 of the GNU Lesser General Public License is\n"
"distributed with calc under the filename COPYING-LGPL. You should have\n" "distributed with calc under the filename COPYING-LGPL. You should have\n"
"received a copy with calc; if not, write to Free Software Foundation, Inc.\n" "received a copy with calc; if not, write to Free Software Foundation, Inc.\n"

View File

@@ -3,8 +3,8 @@
*/ */
#if !defined(__HAVE_CONST_H__) #if !defined(CALC_HAVE_CONST_H)
#define __HAVE_CONST_H__ #define CALC_HAVE_CONST_H
/* do we have or want const? */ /* do we have or want const? */
@@ -13,4 +13,4 @@
#define CONST const /* yes */ #define CONST const /* yes */
#endif /* !__HAVE_CONST_H__ */ #endif /* !CALC_HAVE_CONST_H */

View File

@@ -3,8 +3,8 @@
*/ */
#if !defined(__HAVE_FPOS_H__) #if !defined(CALC_HAVE_FPOS_H)
#define __HAVE_FPOS_H__ #define CALC_HAVE_FPOS_H
/* do we have fgetpos & fsetpos functions? */ /* do we have fgetpos & fsetpos functions? */
@@ -13,4 +13,4 @@
typedef long FILEPOS; typedef long FILEPOS;
#endif /* !__HAVE_FPOS_H__ */ #endif /* !CALC_HAVE_FPOS_H */

View File

@@ -3,8 +3,8 @@
*/ */
#if !defined(__HAVE_FPOS_POS_H__) #if !defined(CALC_HAVE_FPOS_POS_H)
#define __HAVE_FPOS_POS_H__ #define CALC_HAVE_FPOS_POS_H
/* do we have fgetpos & fsetpos functions? */ /* do we have fgetpos & fsetpos functions? */
@@ -13,4 +13,4 @@
#undef FPOS_POS_LEN #undef FPOS_POS_LEN
#endif /* !__HAVE_FPOS_POS_H__ */ #endif /* !CALC_HAVE_FPOS_POS_H */

View File

@@ -3,12 +3,12 @@
*/ */
#if !defined(__HAVE_GETPGID_H__) #if !defined(CALC_HAVE_GETPGID_H)
#define __HAVE_GETPGID_H__ #define CALC_HAVE_GETPGID_H
/* do we have or want getpgid()? */ /* do we have or want getpgid()? */
#undef HAVE_GETPGID /* no */ #undef HAVE_GETPGID /* no */
#endif /* !__HAVE_GETPGID_H__ */ #endif /* !CALC_HAVE_GETPGID_H */

View File

@@ -3,12 +3,12 @@
*/ */
#if !defined(__HAVE_GETPRID_H__) #if !defined(CALC_HAVE_GETPRID_H)
#define __HAVE_GETPRID_H__ #define CALC_HAVE_GETPRID_H
/* do we have or want getprid()? */ /* do we have or want getprid()? */
#undef HAVE_GETPRID /* no */ #undef HAVE_GETPRID /* no */
#endif /* !__HAVE_GETPRID_H__ */ #endif /* !CALC_HAVE_GETPRID_H */

View File

@@ -3,12 +3,12 @@
*/ */
#if !defined(__HAVE_GETSID_H__) #if !defined(CALC_HAVE_GETSID_H)
#define __HAVE_GETSID_H__ #define CALC_HAVE_GETSID_H
/* do we have or want getsid()? */ /* do we have or want getsid()? */
#undef HAVE_GETSID /* no */ #undef HAVE_GETSID /* no */
#endif /* !__HAVE_GETSID_H__ */ #endif /* !CALC_HAVE_GETSID_H */

View File

@@ -3,12 +3,12 @@
*/ */
#if !defined(__HAVE_GETTIME_H__) #if !defined(CALC_HAVE_GETTIME_H)
#define __HAVE_GETTIME_H__ #define CALC_HAVE_GETTIME_H
/* do we have or want clock_gettime()? */ /* do we have or want clock_gettime()? */
#undef HAVE_GETTIME /* no */ #undef HAVE_GETTIME /* no */
#endif /* !__HAVE_GETTIME_H__ */ #endif /* !CALC_HAVE_GETTIME_H */

View File

@@ -3,12 +3,12 @@
*/ */
#if !defined(__HAVE_MEMMV_H__) #if !defined(CALC_HAVE_MEMMV_H)
#define __HAVE_MEMMV_H__ #define CALC_HAVE_MEMMV_H
/* do we have or want memmove()? */ /* do we have or want memmove()? */
#define HAVE_MEMMOVE /* yes */ #define HAVE_MEMMOVE /* yes */
#endif /* !__HAVE_MEMMV_H__ */ #endif /* !CALC_HAVE_MEMMV_H */

View File

@@ -3,12 +3,12 @@
*/ */
#if !defined(__HAVE_NEWSTR_H__) #if !defined(CALC_HAVE_NEWSTR_H)
#define __HAVE_NEWSTR_H__ #define CALC_HAVE_NEWSTR_H
/* do we have or want memcpy(), memset() & strchr()? */ /* do we have or want memcpy(), memset() & strchr()? */
#define HAVE_NEWSTR /* yes */ #define HAVE_NEWSTR /* yes */
#endif /* !__HAVE_NEWSTR_H__ */ #endif /* !CALC_HAVE_NEWSTR_H */

View File

@@ -3,12 +3,12 @@
*/ */
#if !defined(__HAVE_OFFSCL_H__) #if !defined(CALC_HAVE_OFFSCL_H)
#define __HAVE_OFFSCL_H__ #define CALC_HAVE_OFFSCL_H
#undef HAVE_OFF_T_SCALAR #undef HAVE_OFF_T_SCALAR
#define HAVE_OFF_T_SCALAR /* off_t is a simple value */ #define HAVE_OFF_T_SCALAR /* off_t is a simple value */
#endif /* !__HAVE_OFFSCL_H__ */ #endif /* !CALC_HAVE_OFFSCL_H */

View File

@@ -3,12 +3,12 @@
*/ */
#if !defined(__HAVE_POSSCL_H__) #if !defined(CALC_HAVE_POSSCL_H)
#define __HAVE_POSSCL_H__ #define CALC_HAVE_POSSCL_H
#undef HAVE_FILEPOS_SCALAR #undef HAVE_FILEPOS_SCALAR
#define HAVE_FILEPOS_SCALAR /* FILEPOS is a simple value */ #define HAVE_FILEPOS_SCALAR /* FILEPOS is a simple value */
#endif /* !__HAVE_POSSCL_H__ */ #endif /* !CALC_HAVE_POSSCL_H */

View File

@@ -3,12 +3,12 @@
*/ */
#if !defined(__HAVE_RUSAGE_H__) #if !defined(CALC_HAVE_RUSAGE_H)
#define __HAVE_RUSAGE_H__ #define CALC_HAVE_RUSAGE_H
/* do we have or want getrusage()? */ /* do we have or want getrusage()? */
#undef HAVE_GETRUSAGE /* no */ #undef HAVE_GETRUSAGE /* no */
#endif /* !__HAVE_RUSAGE_H__ */ #endif /* !CALC_HAVE_RUSAGE_H */

View File

@@ -3,12 +3,12 @@
*/ */
#if !defined(__HAVE_STDLIB_H__) #if !defined(CALC_HAVE_STDLIB_H)
#define __HAVE_STDLIB_H__ #define CALC_HAVE_STDLIB_H
/* do we have <stdlib.h>? */ /* do we have <stdlib.h>? */
#define HAVE_STDLIB_H /* yes */ #define HAVE_STDLIB_H /* yes */
#endif /* !__HAVE_STDLIB_H__ */ #endif /* !CALC_HAVE_STDLIB_H */

View File

@@ -3,12 +3,12 @@
*/ */
#if !defined(__HAVE_STRDUP_H__) #if !defined(CALC_HAVE_STRDUP_H)
#define __HAVE_STRDUP_H__ #define CALC_HAVE_STRDUP_H
/* do we have or want getstrdup()? */ /* do we have or want getstrdup()? */
#define HAVE_STRDUP /* yes */ #define HAVE_STRDUP /* yes */
#endif /* !__HAVE_STRDUP_H__ */ #endif /* !CALC_HAVE_STRDUP_H */

View File

@@ -3,12 +3,12 @@
*/ */
#if !defined(__HAVE_STRING_H__) #if !defined(CALC_HAVE_STRING_H)
#define __HAVE_STRING_H__ #define CALC_HAVE_STRING_H
/* do we have <string.h>? */ /* do we have <string.h>? */
#define HAVE_STRING_H /* yes */ #define HAVE_STRING_H /* yes */
#endif /* !__HAVE_STRING_H__ */ #endif /* !CALC_HAVE_STRING_H */

View File

@@ -3,8 +3,8 @@
*/ */
#if !defined(__HAVE_TIMES_H__) #if !defined(CALC_HAVE_TIMES_H)
#define __HAVE_TIMES_H__ #define CALC_HAVE_TIMES_H
/* do we have <times.h>? */ /* do we have <times.h>? */
@@ -14,4 +14,4 @@
#undef HAVE_SYS_TIME_H /* no */ #undef HAVE_SYS_TIME_H /* no */
#endif /* !__HAVE_TIMES_H__ */ #endif /* !CALC_HAVE_TIMES_H */

View File

@@ -3,12 +3,12 @@
*/ */
#if !defined(__HAVE_UID_T_H__) #if !defined(CALC_HAVE_UID_T_H)
#define __HAVE_UID_T_H__ #define CALC_HAVE_UID_T_H
/* do we have or want uid_t? */ /* do we have or want uid_t? */
#undef HAVE_UID_T /* no */ #undef HAVE_UID_T /* no */
#endif /* !__HAVE_UID_T_H__ */ #endif /* !CALC_HAVE_UID_T_H */

View File

@@ -3,12 +3,12 @@
*/ */
#if !defined(__HAVE_UNISTD_H__) #if !defined(CALC_HAVE_UNISTD_H)
#define __HAVE_UNISTD_H__ #define CALC_HAVE_UNISTD_H
/* do we have <unistd.h>? */ /* do we have <unistd.h>? */
#undef HAVE_UNISTD_H /* no */ #undef HAVE_UNISTD_H /* no */
#endif /* !__HAVE_UNISTD_H__ */ #endif /* !CALC_HAVE_UNISTD_H */

View File

@@ -3,8 +3,8 @@
*/ */
#if !defined(__HAVE_UNUSED_H__) #if !defined(CALC_HAVE_UNUSED_H)
#define __HAVE_UNUSED_H__ #define CALC_HAVE_UNUSED_H
/* do we have/want the unused attribute? */ /* do we have/want the unused attribute? */
@@ -13,4 +13,4 @@
#define UNUSED __attribute__((unused)) /* yes */ #define UNUSED __attribute__((unused)) /* yes */
#endif /* !__HAVE_UNUSED_H__ */ #endif /* !CALC_HAVE_UNUSED_H */

View File

@@ -3,12 +3,12 @@
*/ */
#if !defined(__HAVE_URANDOM_H__) #if !defined(CALC_HAVE_URANDOM_H)
#define __HAVE_URANDOM_H__ #define CALC_HAVE_URANDOM_H
/* do we have /dev/urandom? */ /* do we have /dev/urandom? */
#undef HAVE_URANDOM_H /* no */ #undef HAVE_URANDOM_H /* no */
#endif /* !__HAVE_URANDOM_H__ */ #endif /* !CALC_HAVE_URANDOM_H */

View File

@@ -3,12 +3,12 @@
*/ */
#if !defined(__HAVE_USTAT_H__) #if !defined(CALC_HAVE_USTAT_H)
#define __HAVE_USTAT_H__ #define CALC_HAVE_USTAT_H
/* do we have or want ustat()? */ /* do we have or want ustat()? */
#undef HAVE_USTAT /* no */ #undef HAVE_USTAT /* no */
#endif /* !__HAVE_USTAT_H__ */ #endif /* !CALC_HAVE_USTAT_H */

12
zmath.h
View File

@@ -1,7 +1,7 @@
/* /*
* zmath - declarations for extended precision integer arithmetic * zmath - declarations for extended precision integer arithmetic
* *
* Copyright (C) 1999-2007 David I. Bell * Copyright (C) 1999-2007,2014 David I. Bell
* *
* Calc is open software; you can redistribute it and/or modify it under * Calc is open software; you can redistribute it and/or modify it under
* the terms of the version 2.1 of the GNU Lesser General Public License * the terms of the version 2.1 of the GNU Lesser General Public License
@@ -17,8 +17,8 @@
* received a copy with calc; if not, write to Free Software Foundation, Inc. * received a copy with calc; if not, write to Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* @(#) $Revision: 30.3 $ * @(#) $Revision: 30.5 $
* @(#) $Id: zmath.h,v 30.3 2013/08/11 08:41:38 chongo Exp $ * @(#) $Id: zmath.h,v 30.5 2014/08/24 21:56:51 chongo Exp $
* @(#) $Source: /usr/local/src/bin/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 * Under source code control: 1993/07/30 19:42:48
@@ -34,8 +34,8 @@
*/ */
#if !defined(__ZMATH_H__) #if !defined(INCLUDE_ZMATH_H)
#define __ZMATH_H__ #define INCLUDE_ZMATH_H
#if defined(CALC_SRC) /* if we are building from the calc source tree */ #if defined(CALC_SRC) /* if we are building from the calc source tree */
@@ -669,4 +669,4 @@ typedef struct {
} BITSTR; } BITSTR;
#endif /* !__ZMATH_H__*/ #endif /* !INCLUDE_ZMATH_H*/

12
zrand.h
View File

@@ -1,7 +1,7 @@
/* /*
* zrand - subtractive 100 shuffle generator * zrand - subtractive 100 shuffle generator
* *
* Copyright (C) 1999-2007 Landon Curt Noll * Copyright (C) 1999-2007,2014 Landon Curt Noll
* *
* Calc is open software; you can redistribute it and/or modify it under * Calc is open software; you can redistribute it and/or modify it under
* the terms of the version 2.1 of the GNU Lesser General Public License * the terms of the version 2.1 of the GNU Lesser General Public License
@@ -17,8 +17,8 @@
* received a copy with calc; if not, write to Free Software Foundation, Inc. * received a copy with calc; if not, write to Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* @(#) $Revision: 30.1 $ * @(#) $Revision: 30.3 $
* @(#) $Id: zrand.h,v 30.1 2007/03/16 11:09:46 chongo Exp $ * @(#) $Id: zrand.h,v 30.3 2014/08/24 21:56:51 chongo Exp $
* @(#) $Source: /usr/local/src/bin/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 * Under source code control: 1995/01/07 09:45:26
@@ -33,8 +33,8 @@
*/ */
#if !defined(__ZRAND_H__) #if !defined(INCLUDE_ZRAND_H)
#define __ZRAND_H__ #define INCLUDE_ZRAND_H
#if defined(CALC_SRC) /* if we are building from the calc source tree */ #if defined(CALC_SRC) /* if we are building from the calc source tree */
@@ -222,4 +222,4 @@ E_FUNC BOOL randcmp(CONST RAND *s1, CONST RAND *s2);
E_FUNC void randprint(CONST RAND *state, int flags); E_FUNC void randprint(CONST RAND *state, int flags);
#endif /* !__ZRAND_H__ */ #endif /* !INCLUDE_ZRAND_H */

View File

@@ -1,7 +1,7 @@
/* /*
* zrandom - Blum-Blum-Shub pseudo-random generator * zrandom - Blum-Blum-Shub pseudo-random generator
* *
* Copyright (C) 1999-2007 Landon Curt Noll * Copyright (C) 1999-2007,2014 Landon Curt Noll
* *
* Calc is open software; you can redistribute it and/or modify it under * Calc is open software; you can redistribute it and/or modify it under
* the terms of the version 2.1 of the GNU Lesser General Public License * the terms of the version 2.1 of the GNU Lesser General Public License
@@ -17,8 +17,8 @@
* received a copy with calc; if not, write to Free Software Foundation, Inc. * received a copy with calc; if not, write to Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* *
* @(#) $Revision: 30.1 $ * @(#) $Revision: 30.3 $
* @(#) $Id: zrandom.h,v 30.1 2007/03/16 11:09:46 chongo Exp $ * @(#) $Id: zrandom.h,v 30.3 2014/08/24 21:56:51 chongo Exp $
* @(#) $Source: /usr/local/src/bin/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 * Under source code control: 1997/02/15 04:01:56
@@ -29,8 +29,8 @@
*/ */
#if !defined(__ZRANDOM_H__) #if !defined(INCLUDE_ZRANDOM_H)
#define __ZRANDOM_H__ #define INCLUDE_ZRANDOM_H
#if defined(CALC_SRC) /* if we are building from the calc source tree */ #if defined(CALC_SRC) /* if we are building from the calc source tree */
@@ -91,4 +91,4 @@ E_FUNC void randomprint(CONST RANDOM *state, int flags);
E_FUNC void random_libcalc_cleanup(void); E_FUNC void random_libcalc_cleanup(void);
#endif /* !__ZRANDOM_H__ */ #endif /* !INCLUDE_ZRANDOM_H */