mirror of
https://github.com/lcn2/calc.git
synced 2025-08-16 01:03:29 +03:00
Release calc version 2.12.4.14
This commit is contained in:
9
BUGS
9
BUGS
@@ -68,6 +68,9 @@ of a context diff patch).
|
||||
|
||||
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
|
||||
us know! See the above for details on how to report and were to
|
||||
EMail your bug reports and hopefully patches to fix them.
|
||||
@@ -129,7 +132,7 @@ mis-features in calc:
|
||||
|
||||
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
|
||||
## 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.
|
||||
## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
##
|
||||
## @(#) $Revision: 30.2 $
|
||||
## @(#) $Id: BUGS,v 30.2 2013/08/11 01:09:27 chongo Exp $
|
||||
## @(#) $Revision: 30.3 $
|
||||
## @(#) $Id: BUGS,v 30.3 2014/09/07 06:20:41 chongo Exp $
|
||||
## @(#) $Source: /usr/local/src/bin/calc/RCS/BUGS,v $
|
||||
##
|
||||
## Under source code control: 1994/03/18 14:06:13
|
||||
|
89
CHANGES
89
CHANGES
@@ -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
|
||||
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.
|
||||
## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
##
|
||||
## @(#) $Revision: 30.38 $
|
||||
## @(#) $Id: CHANGES,v 30.38 2013/09/27 08:59:43 chongo Exp $
|
||||
## @(#) $Revision: 30.44 $
|
||||
## @(#) $Id: CHANGES,v 30.44 2014/09/22 03:40:07 chongo Exp $
|
||||
## @(#) $Source: /usr/local/src/bin/calc/RCS/CHANGES,v $
|
||||
##
|
||||
## Under source code control: 1993/06/02 18:12:57
|
||||
|
449
Makefile.simple
449
Makefile.simple
File diff suppressed because it is too large
Load Diff
12
alloc.h
12
alloc.h
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* 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
|
||||
* 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.
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* @(#) $Revision: 30.3 $
|
||||
* @(#) $Id: alloc.h,v 30.3 2013/08/11 08:41:38 chongo Exp $
|
||||
* @(#) $Revision: 30.5 $
|
||||
* @(#) $Id: alloc.h,v 30.5 2014/08/24 21:56:51 chongo Exp $
|
||||
* @(#) $Source: /usr/local/src/bin/calc/RCS/alloc.h,v $
|
||||
*
|
||||
* Under source code control: 1990/02/15 01:48:29
|
||||
@@ -28,8 +28,8 @@
|
||||
*/
|
||||
|
||||
|
||||
#if !defined(__ALLOC_H__)
|
||||
#define __ALLOC_H__
|
||||
#if !defined(INCLUDE_ALLOC_H)
|
||||
#define INCLUDE_ALLOC_H
|
||||
|
||||
|
||||
#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);
|
||||
#endif
|
||||
|
||||
#endif /* !__ALLOC_H__ */
|
||||
#endif /* !INCLUDE_ALLOC_H */
|
||||
|
12
blkcpy.h
12
blkcpy.h
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* 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
|
||||
*
|
||||
@@ -19,8 +19,8 @@
|
||||
* received a copy with calc; if not, write to Free Software Foundation, Inc.
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* @(#) $Revision: 30.1 $
|
||||
* @(#) $Id: blkcpy.h,v 30.1 2007/03/16 11:09:46 chongo Exp $
|
||||
* @(#) $Revision: 30.3 $
|
||||
* @(#) $Id: blkcpy.h,v 30.3 2014/08/24 21:56:51 chongo Exp $
|
||||
* @(#) $Source: /usr/local/src/bin/calc/RCS/blkcpy.h,v $
|
||||
*
|
||||
* Under source code control: 1997/04/18 20:41:25
|
||||
@@ -30,8 +30,8 @@
|
||||
*/
|
||||
|
||||
|
||||
#if !defined(__BLKCPY_H__)
|
||||
#define __BLKCPY_H__
|
||||
#if !defined(INCLUDE_BLKCPY_H)
|
||||
#define INCLUDE_BLKCPY_H
|
||||
|
||||
/*
|
||||
* 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 copystr2str(STRING *, long, long, STRING *, long);
|
||||
|
||||
#endif /* !__BLKCPY_H__ */
|
||||
#endif /* !INCLUDE_BLKCPY_H */
|
||||
|
12
block.h
12
block.h
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* 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
|
||||
*
|
||||
@@ -19,8 +19,8 @@
|
||||
* received a copy with calc; if not, write to Free Software Foundation, Inc.
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* @(#) $Revision: 30.1 $
|
||||
* @(#) $Id: block.h,v 30.1 2007/03/16 11:09:46 chongo Exp $
|
||||
* @(#) $Revision: 30.3 $
|
||||
* @(#) $Id: block.h,v 30.3 2014/08/24 21:56:51 chongo Exp $
|
||||
* @(#) $Source: /usr/local/src/bin/calc/RCS/block.h,v $
|
||||
*
|
||||
* Under source code control: 1997/02/21 05:03:39
|
||||
@@ -31,8 +31,8 @@
|
||||
*/
|
||||
|
||||
|
||||
#if !defined(__BLOCK_H__)
|
||||
#define __BLOCK_H__
|
||||
#if !defined(INCLUDE_BLOCK_H)
|
||||
#define INCLUDE_BLOCK_H
|
||||
|
||||
|
||||
/*
|
||||
@@ -222,4 +222,4 @@ E_FUNC int countnblocks(void);
|
||||
E_FUNC void shownblocks(void);
|
||||
|
||||
|
||||
#endif /* !__BLOCK_H__ */
|
||||
#endif /* !INCLUDE_BLOCK_H */
|
||||
|
12
byteswap.h
12
byteswap.h
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* 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
|
||||
* 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.
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* @(#) $Revision: 30.1 $
|
||||
* @(#) $Id: byteswap.h,v 30.1 2007/03/16 11:09:46 chongo Exp $
|
||||
* @(#) $Revision: 30.3 $
|
||||
* @(#) $Id: byteswap.h,v 30.3 2014/08/24 21:56:51 chongo Exp $
|
||||
* @(#) $Source: /usr/local/src/bin/calc/RCS/byteswap.h,v $
|
||||
*
|
||||
* Under source code control: 1995/10/11 04:44:01
|
||||
@@ -29,8 +29,8 @@
|
||||
*/
|
||||
|
||||
|
||||
#if !defined(__BYTESWAP_H__)
|
||||
#define __BYTESWAP_H__
|
||||
#if !defined(INCLUDE_BYTESWAP_H)
|
||||
#define INCLUDE_BYTESWAP_H
|
||||
|
||||
|
||||
#if defined(CALC_SRC) /* if we are building from the calc source tree */
|
||||
@@ -178,4 +178,4 @@
|
||||
#endif /* LONG_BITS == 64 */
|
||||
|
||||
|
||||
#endif /* !__BYTESWAP_H__ */
|
||||
#endif /* !INCLUDE_BYTESWAP_H */
|
||||
|
@@ -18,8 +18,8 @@
|
||||
# received a copy with calc; if not, write to Free Software Foundation, Inc.
|
||||
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
#
|
||||
# @(#) $Revision: 30.10 $
|
||||
# @(#) $Id: Makefile,v 30.10 2013/09/02 03:02:00 chongo Exp $
|
||||
# @(#) $Revision: 30.11 $
|
||||
# @(#) $Id: Makefile,v 30.11 2014/09/02 07:14:49 chongo Exp $
|
||||
# @(#) $Source: /usr/local/src/bin/calc/cal/RCS/Makefile,v $
|
||||
#
|
||||
# Under source code control: 1991/07/21 05:00:54
|
||||
@@ -308,8 +308,8 @@ clobber: clean
|
||||
#
|
||||
install: all
|
||||
-${Q} if [ ! -d ${T}${CALC_SHAREDIR} ]; then \
|
||||
echo ${MKDIR} ${T}${CALC_SHAREDIR}; \
|
||||
${MKDIR} ${T}${CALC_SHAREDIR}; \
|
||||
echo ${MKDIR} -p ${T}${CALC_SHAREDIR}; \
|
||||
${MKDIR} -p ${T}${CALC_SHAREDIR}; \
|
||||
if [ ! -d "${T}${CALC_SHAREDIR}" ]; then \
|
||||
echo ${MKDIR} -p "${T}${CALC_SHAREDIR}"; \
|
||||
${MKDIR} -p "${T}${CALC_SHAREDIR}"; \
|
||||
|
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* 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
|
||||
* 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.
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* @(#) $Revision: 30.2 $
|
||||
* @(#) $Id: alg_config.cal,v 30.2 2013/08/11 08:41:38 chongo Exp $
|
||||
* @(#) $Revision: 30.11 $
|
||||
* @(#) $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 $
|
||||
*
|
||||
* 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/
|
||||
*/
|
||||
|
||||
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
|
||||
*
|
||||
* 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.
|
||||
* 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 alg1_rate; /* loop rate of 1st algorithm */
|
||||
local alg2_rate; /* loop rate of 2nd algorithm */
|
||||
local ret; /* return ratio, or 1.0 */
|
||||
local i;
|
||||
|
||||
/*
|
||||
@@ -218,12 +248,12 @@ define mul_ratio(len)
|
||||
* determine the 1st algorithm rate
|
||||
*/
|
||||
loops = max(1, ceil(loops * test_time / tlen));
|
||||
if (loops < 8) {
|
||||
if (loops < 16) {
|
||||
if (config("user_debug") > 1) {
|
||||
printf(" we must expand loop test time to more than %d secs\n",
|
||||
ceil(test_time * (8 / loops)));
|
||||
printf(" we must expand alg1 loop test time to about %d secs\n",
|
||||
ceil(test_time * (16 / loops)));
|
||||
}
|
||||
loops = 8;
|
||||
loops = 16;
|
||||
}
|
||||
if (config("user_debug") > 3) {
|
||||
printf("\t will try alg1 %d loops\n", loops);
|
||||
@@ -264,12 +294,12 @@ define mul_ratio(len)
|
||||
* determine the 2nd algorithm rate
|
||||
*/
|
||||
loops = max(1, ceil(loops * test_time / tlen));
|
||||
if (loops < 8) {
|
||||
if (loops < 16) {
|
||||
if (config("user_debug") > 1) {
|
||||
printf(" we must expand loop test time to more than %d secs\n",
|
||||
ceil(test_time * (8 / loops)));
|
||||
printf(" we must expand alg2 loop test time to about %d secs\n",
|
||||
ceil(test_time * (16 / loops)));
|
||||
}
|
||||
loops = 8;
|
||||
loops = 16;
|
||||
}
|
||||
tlen = mul_loop(loops, &x);
|
||||
if (config("user_debug") > 3) {
|
||||
@@ -298,7 +328,12 @@ define mul_ratio(len)
|
||||
/*
|
||||
* 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 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 */
|
||||
|
||||
/*
|
||||
* setup
|
||||
*/
|
||||
test_time = 15.0;
|
||||
if (config("user_debug") > 0) {
|
||||
printf("will start with loop test time of %d secs\n", test_time);
|
||||
test_time = 30.0;
|
||||
printf("The best_mul2() function will take a LONG time to run!\n");
|
||||
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
|
||||
*/
|
||||
high = 16;
|
||||
best_val = high;
|
||||
if (config("user_debug") > 0) {
|
||||
printf("testing multiply alg1/alg2 ratio for len = %d\n", high);
|
||||
}
|
||||
ratio = mul_ratio(high);
|
||||
best_ratio = ratio;
|
||||
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) {
|
||||
quit "best_mul2: tests imply config(\"mul2\") should be < 4";
|
||||
if (ratio < 1.0) {
|
||||
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
|
||||
* the ratio drops below 1.0.
|
||||
*/
|
||||
expand = ((ratio >= 3.5) ? 16 : 2^round(ratio));
|
||||
expand = ((ratio >= 10) ? 1024 : 2^round(ratio));
|
||||
low = high;
|
||||
high *= expand;
|
||||
if (config("user_debug") > 1) {
|
||||
@@ -368,20 +412,63 @@ define best_mul2()
|
||||
* determine the alg1/alg2 test ratio for this new length
|
||||
*/
|
||||
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) {
|
||||
printf("testing multiply alg1/alg2 ratio for len = %d\n", high);
|
||||
}
|
||||
ratio = mul_ratio(high);
|
||||
if (config("user_debug") > 1) {
|
||||
printf(" multiply alg1/alg2 ratio = %.3f\n", ratio);
|
||||
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);
|
||||
}
|
||||
}
|
||||
} 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) {
|
||||
printf("alg1/alg2 ratio now < 1.0, starting binary search "
|
||||
"between %d and %d\n",
|
||||
low, high);
|
||||
printf("Starting binary search between %d and %d\n", low, high);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -390,30 +477,54 @@ define best_mul2()
|
||||
while (low+1 < high) {
|
||||
|
||||
/* try the mid-point */
|
||||
mid = int((low+high)/2);
|
||||
if (config("user_debug") > 0) {
|
||||
printf("testing multiply alg1/alg2 ratio for len = %d\n",
|
||||
int((low+high)/2));
|
||||
printf("testing multiply alg1/alg2 ratio for len = %d\n", mid);
|
||||
}
|
||||
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) {
|
||||
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 */
|
||||
if (ratio >= 1.0) {
|
||||
if (ratio > 1.0) {
|
||||
if (config("user_debug") > 2) {
|
||||
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 */
|
||||
} else {
|
||||
if (config("user_debug") > 2) {
|
||||
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
|
||||
*/
|
||||
if (config("user_debug") > 0) {
|
||||
printf("best value of config(\"mul2\") is %d\n",
|
||||
(ratio >= 1.0) ? high : low);
|
||||
printf("Best value for multiply is near %d\n", best_val);
|
||||
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 alg1_rate; /* loop rate of 1st algorithm */
|
||||
local alg2_rate; /* loop rate of 2nd algorithm */
|
||||
local ret; /* return ratio, or 1.0 */
|
||||
local i;
|
||||
|
||||
/*
|
||||
@@ -614,12 +731,12 @@ define sq_ratio(len)
|
||||
* determine the 1st algorithm rate
|
||||
*/
|
||||
loops = max(1, ceil(loops * test_time / tlen));
|
||||
if (loops < 8) {
|
||||
if (loops < 16) {
|
||||
if (config("user_debug") > 1) {
|
||||
printf(" we must expand loop test time to more than %d secs\n",
|
||||
ceil(test_time * (8 / loops)));
|
||||
printf(" we must expand alg1 loop test time to about %d secs\n",
|
||||
ceil(test_time * (16 / loops)));
|
||||
}
|
||||
loops = 8;
|
||||
loops = 16;
|
||||
}
|
||||
tlen = sq_loop(loops, &x);
|
||||
if (config("user_debug") > 3) {
|
||||
@@ -657,12 +774,12 @@ define sq_ratio(len)
|
||||
* determine the 2nd algorithm rate
|
||||
*/
|
||||
loops = max(1, ceil(loops * test_time / tlen));
|
||||
if (loops < 8) {
|
||||
if (loops < 16) {
|
||||
if (config("user_debug") > 1) {
|
||||
printf(" we must expand loop test time to more than %d secs\n",
|
||||
ceil(test_time * (8 / loops)));
|
||||
printf(" we must expand alg2 loop test time to about %d secs\n",
|
||||
ceil(test_time * (16 / loops)));
|
||||
}
|
||||
loops = 8;
|
||||
loops = 16;
|
||||
}
|
||||
tlen = sq_loop(loops, &x);
|
||||
if (config("user_debug") > 3) {
|
||||
@@ -691,7 +808,12 @@ define sq_ratio(len)
|
||||
/*
|
||||
* 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 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 */
|
||||
|
||||
/*
|
||||
* setup
|
||||
*/
|
||||
test_time = 15.0;
|
||||
if (config("user_debug") > 0) {
|
||||
printf("will start with loop test time of %d secs\n", test_time);
|
||||
test_time = 30.0;
|
||||
printf("The best_sq2() function will take a LONG time to run!\n");
|
||||
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
|
||||
*/
|
||||
high = 16;
|
||||
best_val = high;
|
||||
if (config("user_debug") > 0) {
|
||||
printf("testing square alg1/alg2 ratio for len = %d\n", high);
|
||||
}
|
||||
ratio = sq_ratio(high);
|
||||
best_ratio = ratio;
|
||||
if (config("user_debug") > 1) {
|
||||
printf(" square alg1/alg2 ratio = %.3f\n", ratio);
|
||||
}
|
||||
if (ratio <= 1.0) {
|
||||
quit "best_sq2: tests imply config(\"sq2\") should be < 4";
|
||||
if (ratio < 1.0) {
|
||||
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
|
||||
* the ratio drops below 1.0.
|
||||
*/
|
||||
expand = ((ratio >= 3.5) ? 16 : 2^round(ratio));
|
||||
expand = ((ratio >= 10) ? 1024 : 2^round(ratio));
|
||||
low = high;
|
||||
high *= expand;
|
||||
if (config("user_debug") > 1) {
|
||||
printf(" expand the next test range by a factor of %d\n",
|
||||
expand);
|
||||
expand);
|
||||
}
|
||||
|
||||
/*
|
||||
* determine the alg1/alg2 test ratio for this new length
|
||||
*/
|
||||
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) {
|
||||
printf("testing square alg1/alg2 ratio for len = %d\n", 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) {
|
||||
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) {
|
||||
printf("alg1/alg2 ratio now < 1.0, starting binary search "
|
||||
"between %d and %d\n",
|
||||
low, high);
|
||||
printf("Starting binary search between %d and %d\n", low, high);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -783,41 +957,71 @@ define best_sq2()
|
||||
while (low+1 < high) {
|
||||
|
||||
/* try the mid-point */
|
||||
mid = int((low+high)/2);
|
||||
if (config("user_debug") > 0) {
|
||||
printf("testing square alg1/alg2 ratio for len = %d\n",
|
||||
int((low+high)/2));
|
||||
printf("testing square alg1/alg2 ratio for len = %d\n", mid);
|
||||
}
|
||||
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) {
|
||||
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 */
|
||||
if (ratio >= 1.0) {
|
||||
if (ratio > 1.0) {
|
||||
if (config("user_debug") > 2) {
|
||||
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 */
|
||||
} else {
|
||||
if (config("user_debug") > 2) {
|
||||
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
|
||||
*/
|
||||
mid = int((low+high)/2);
|
||||
if (config("user_debug") > 0) {
|
||||
printf("best value of config(\"sq2\") is %d\n",
|
||||
(ratio >= 1.0) ? high : low);
|
||||
printf("Best value for square is near %d\n", best_val);
|
||||
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 alg2_rate; /* loop rate of 2nd algorithm */
|
||||
local ex; /* exponent to use in pow_loop() */
|
||||
local ret; /* return ratio, or 1.0 */
|
||||
local i;
|
||||
|
||||
/*
|
||||
@@ -990,7 +1195,7 @@ define pow_ratio(len)
|
||||
/*
|
||||
* setup
|
||||
*/
|
||||
ex = 5;
|
||||
ex = 7;
|
||||
|
||||
/*
|
||||
* initialize x, the values we will pmod
|
||||
@@ -1026,12 +1231,12 @@ define pow_ratio(len)
|
||||
* determine the 1st algorithm rate
|
||||
*/
|
||||
loops = max(1, ceil(loops * test_time / tlen));
|
||||
if (loops < 8) {
|
||||
if (loops < 16) {
|
||||
if (config("user_debug") > 1) {
|
||||
printf(" we must expand loop test time to more than %d secs\n",
|
||||
ceil(test_time * (8 / loops)));
|
||||
printf(" we must expand alg1 loop test time to about %d secs\n",
|
||||
ceil(test_time * (16 / loops)));
|
||||
}
|
||||
loops = 8;
|
||||
loops = 16;
|
||||
}
|
||||
tlen = pow_loop(loops, &x, ex);
|
||||
if (config("user_debug") > 3) {
|
||||
@@ -1070,12 +1275,12 @@ define pow_ratio(len)
|
||||
* determine the 2nd algorithm rate
|
||||
*/
|
||||
loops = max(1, ceil(loops * test_time / tlen));
|
||||
if (loops < 8) {
|
||||
if (loops < 16) {
|
||||
if (config("user_debug") > 1) {
|
||||
printf(" we must expand loop test time to more than %d secs\n",
|
||||
ceil(test_time * (8 / loops)));
|
||||
printf(" we must expand alg2 loop test time to about %d secs\n",
|
||||
ceil(test_time * (16 / loops)));
|
||||
}
|
||||
loops = 8;
|
||||
loops = 16;
|
||||
}
|
||||
tlen = pow_loop(loops, &x, ex);
|
||||
if (config("user_debug") > 3) {
|
||||
@@ -1104,7 +1309,12 @@ define pow_ratio(len)
|
||||
/*
|
||||
* 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 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 looped; /* 1 ==> we have expanded lengths before */
|
||||
|
||||
/*
|
||||
* setup
|
||||
*/
|
||||
test_time = 15.0;
|
||||
if (config("user_debug") > 0) {
|
||||
printf("will start with loop test time of %d secs\n", test_time);
|
||||
test_time = 60.0;
|
||||
printf("The best_pow2() function will take a LONG time to run!\n");
|
||||
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
|
||||
@@ -1147,12 +1364,22 @@ define best_pow2()
|
||||
*/
|
||||
low = 4;
|
||||
high = 4;
|
||||
best_val = high;
|
||||
best_ratio = 1e10; /* not a real value */
|
||||
do {
|
||||
high *= 4;
|
||||
if (config("user_debug") > 0) {
|
||||
printf("testing pmod alg1/alg2 ratio for len = %d\n", 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) {
|
||||
printf(" pmod alg1/alg2 ratio = %.3f\n", ratio);
|
||||
if (ratio > 1.0 && ratio <= 1.02) {
|
||||
@@ -1199,20 +1426,27 @@ define best_pow2()
|
||||
* determine the alg1/alg2 test ratio for this new length
|
||||
*/
|
||||
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) {
|
||||
printf("testing pmod alg1/alg2 ratio for len = %d\n", 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) {
|
||||
printf(" pmod alg1/alg2 ratio = %.3f\n", ratio);
|
||||
printf(" pmod alg1/alg2 ratio = %.6f\n", ratio);
|
||||
}
|
||||
looped = 1;
|
||||
} while (ratio >= 1.0);
|
||||
} while (ratio > 1.0);
|
||||
if (config("user_debug") > 0) {
|
||||
printf("alg1/alg2 ratio now < 1.0, starting binary search "
|
||||
"between %d and %d\n", low, high);
|
||||
printf("Starting binary search between %d and %d\n", low, high);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1221,39 +1455,69 @@ define best_pow2()
|
||||
while (low+1 < high) {
|
||||
|
||||
/* try the mid-point */
|
||||
mid = int((low+high)/2);
|
||||
if (config("user_debug") > 0) {
|
||||
printf("testing pmod alg1/alg2 ratio for len = %d\n",
|
||||
int((low+high)/2));
|
||||
printf("testing pow2 alg1/alg2 ratio for len = %d\n", mid);
|
||||
}
|
||||
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) {
|
||||
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 */
|
||||
if (ratio >= 1.0) {
|
||||
if (ratio > 1.0) {
|
||||
if (config("user_debug") > 2) {
|
||||
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 */
|
||||
} else {
|
||||
if (config("user_debug") > 2) {
|
||||
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
|
||||
*/
|
||||
mid = int((low+high)/2);
|
||||
if (config("user_debug") > 0) {
|
||||
printf("best value of config(\"pow2\") is %d\n",
|
||||
(ratio >= 1.0) ? high : low);
|
||||
printf("Best value for pmod is near %d\n", best_val);
|
||||
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
12
calc.h
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* 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
|
||||
* 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.
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* @(#) $Revision: 30.4 $
|
||||
* @(#) $Id: calc.h,v 30.4 2013/09/01 22:16:21 chongo Exp $
|
||||
* @(#) $Revision: 30.6 $
|
||||
* @(#) $Id: calc.h,v 30.6 2014/08/24 21:56:51 chongo Exp $
|
||||
* @(#) $Source: /usr/local/src/bin/calc/RCS/calc.h,v $
|
||||
*
|
||||
* Under source code control: 1990/02/15 01:48:31
|
||||
@@ -28,8 +28,8 @@
|
||||
*/
|
||||
|
||||
|
||||
#if !defined(__CALC_H__)
|
||||
#define __CALC_H__
|
||||
#if !defined(INCLUDE_CALC_H)
|
||||
#define INCLUDE_CALC_H
|
||||
|
||||
#include <setjmp.h>
|
||||
#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);
|
||||
|
||||
|
||||
#endif /* !__CALC_H__ */
|
||||
#endif /* !INCLUDE_CALC_H */
|
||||
|
82
calc.spec.in
82
calc.spec.in
@@ -1,8 +1,7 @@
|
||||
#****h* calc/calc.spec.in
|
||||
#
|
||||
# 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
|
||||
# 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.
|
||||
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
#
|
||||
# @(#) $Revision: 30.12 $
|
||||
# @(#) $Id: calc.spec.in,v 30.12 2013/09/02 03:04:26 chongo Exp $
|
||||
# @(#) $Revision: 30.23 $
|
||||
# @(#) $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 $
|
||||
#
|
||||
# Under source code control: 2003/02/16 20:21:39
|
||||
@@ -31,13 +30,13 @@
|
||||
# BUGS
|
||||
# - Uninstalling calc and calc-devel leaves empty dirs /usr/include/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???
|
||||
|
||||
Summary: Arbitrary precision calculator.
|
||||
Name: calc
|
||||
Version: <<<PROJECT_VERSION>>>
|
||||
Release: 11
|
||||
Release: 12
|
||||
License: LGPL
|
||||
Group: Applications/Engineering
|
||||
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)
|
||||
Requires: ncurses >= 5.5-24, readline >= 5.1-3, less >= 358
|
||||
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
|
||||
|
||||
%description
|
||||
@@ -61,7 +62,10 @@ For the latest calc release, see the calc project home page:
|
||||
%package devel
|
||||
Summary: Development files and documentation for calc.
|
||||
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
|
||||
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
|
||||
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 \
|
||||
MANDIR=%{_mandir}/man1 EXT= V=@ clobber
|
||||
echo '-=- calc.spec ending make clobber -=-'
|
||||
echo '-=- calc.spec beginning make calc-static-only -=-'
|
||||
make %{?_smp_mflags} T=%{_buildroot} BINDIR=%{_bindir} LIBDIR=%{_libdir} \
|
||||
make -j1 T=%{_buildroot} BINDIR=%{_bindir} LIBDIR=%{_libdir} \
|
||||
CALC_SHAREDIR=%{_datadir}/%{name} CALC_INCDIR=%{_includedir}/calc \
|
||||
MANDIR=%{_mandir}/man1 EXT= V=@ calc-static-only BLD_TYPE=calc-static-only
|
||||
echo '-=- calc.spec ending make calc-static-only -=-'
|
||||
echo '-=- calc.spec beginning make rpm-hide-static -=-'
|
||||
make %{?_smp_mflags} T=%{_buildroot} BINDIR=%{_bindir} LIBDIR=%{_libdir} \
|
||||
make -j1 T=%{_buildroot} BINDIR=%{_bindir} LIBDIR=%{_libdir} \
|
||||
CALC_SHAREDIR=%{_datadir}/%{name} CALC_INCDIR=%{_includedir}/calc \
|
||||
MANDIR=%{_mandir}/man1 EXT= V=@ rpm-hide-static
|
||||
echo '-=- calc.spec ending make rpm-hide-static -=-'
|
||||
echo '-=- calc.spec beginning make clobber (again) -=-'
|
||||
make %{?_smp_mflags} T=%{_buildroot} BINDIR=%{_bindir} LIBDIR=%{_libdir} \
|
||||
make -j1 T=%{_buildroot} BINDIR=%{_bindir} LIBDIR=%{_libdir} \
|
||||
CALC_SHAREDIR=%{_datadir}/%{name} CALC_INCDIR=%{_includedir}/calc \
|
||||
MANDIR=%{_mandir}/man1 EXT= V=@ clobber
|
||||
echo '-=- calc.spec ending make clobber (again) -=-'
|
||||
echo '-=- calc.spec beginning make calc-dynamic-only -=-'
|
||||
make %{?_smp_mflags} T=%{_buildroot} BINDIR=%{_bindir} LIBDIR=%{_libdir} \
|
||||
make -j1 T=%{_buildroot} BINDIR=%{_bindir} LIBDIR=%{_libdir} \
|
||||
CALC_SHAREDIR=%{_datadir}/%{name} CALC_INCDIR=%{_includedir}/calc \
|
||||
MANDIR=%{_mandir}/man1 EXT= V=@ calc-dynamic-only \
|
||||
BLD_TYPE=calc-dynamic-only LD_SHARE=
|
||||
echo '-=- calc.spec ending make calc-dynamic-only -=-'
|
||||
echo '-=- calc.spec beginning make chk -=-'
|
||||
make %{?_smp_mflags} T=%{_buildroot} BINDIR=%{_bindir} LIBDIR=%{_libdir} \
|
||||
make -j1 T=%{_buildroot} BINDIR=%{_bindir} LIBDIR=%{_libdir} \
|
||||
CALC_SHAREDIR=%{_datadir}/%{name} CALC_INCDIR=%{_includedir}/calc \
|
||||
MANDIR=%{_mandir}/man1 EXT= V=@ chk
|
||||
echo '-=- calc.spec ending make chk -=-'
|
||||
echo '-=- calc.spec beginning make rpm-unhide-static -=-'
|
||||
make %{?_smp_mflags} T=%{_buildroot} BINDIR=%{_bindir} LIBDIR=%{_libdir} \
|
||||
make -j1 T=%{_buildroot} BINDIR=%{_bindir} LIBDIR=%{_libdir} \
|
||||
CALC_SHAREDIR=%{_datadir}/%{name} CALC_INCDIR=%{_includedir}/calc \
|
||||
MANDIR=%{_mandir}/man1 EXT= V=@ rpm-unhide-static
|
||||
echo '-=- calc.spec ending make rpm-unhide-static -=-'
|
||||
echo '-=- calc.spec beginning make rpm-clean-static -=-'
|
||||
make %{?_smp_mflags} T=%{_buildroot} BINDIR=%{_bindir} LIBDIR=%{_libdir} \
|
||||
make -j1 BINDIR=%{_bindir} LIBDIR=%{_libdir} \
|
||||
CALC_SHAREDIR=%{_datadir}/%{name} CALC_INCDIR=%{_includedir}/calc \
|
||||
MANDIR=%{_mandir}/man1 EXT= V=@ rpm-clean-static
|
||||
echo '-=- calc.spec ending make rpm-clean-static -=-'
|
||||
echo '-=- calc.spec beginning make rpm-chk-static -=-'
|
||||
make %{?_smp_mflags} T=%{_buildroot} BINDIR=%{_bindir} LIBDIR=%{_libdir} \
|
||||
make -j1 T=%{_buildroot} BINDIR=%{_bindir} LIBDIR=%{_libdir} \
|
||||
CALC_SHAREDIR=%{_datadir}/%{name} CALC_INCDIR=%{_includedir}/calc \
|
||||
MANDIR=%{_mandir}/man1 EXT= V=@ rpm-chk-static
|
||||
echo '-=- calc.spec ending make rpm-chk-static -=-'
|
||||
|
||||
%install
|
||||
echo '-=- calc.spec beginning make install -=-'
|
||||
rm -rf %{_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 \
|
||||
MANDIR=%{_mandir}/man1 EXT= V=@ install
|
||||
echo '-=- calc.spec ending make install -=-'
|
||||
|
||||
%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
|
||||
%defattr(-, root, root)
|
||||
@@ -148,9 +156,9 @@ rm -rf %{_buildroot}
|
||||
%attr(644, root, root) %{_datadir}/%{name}/*.cal
|
||||
%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.%{version}
|
||||
%attr(644, root, root) %{_libdir}/libcustcalc.so
|
||||
%attr(644, root, root) %{_libdir}/libcustcalc.so.*
|
||||
%attr(644, root, root) %{_libdir}/libcustcalc.so.%{version}
|
||||
|
||||
%files devel
|
||||
%defattr(-, root, root)
|
||||
@@ -161,10 +169,27 @@ rm -rf %{_buildroot}
|
||||
%attr(644, root, root) %{_libdir}/libcustcalc.a
|
||||
|
||||
%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
|
||||
- Release: 11
|
||||
- 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
|
||||
- Major bug rpm build process bug fix
|
||||
- Source: is a URL as per rpm requirements
|
||||
@@ -174,37 +199,46 @@ rm -rf %{_buildroot}
|
||||
- Fixed use of %{_buildroot}
|
||||
- Fixed permissions so that rpm build services can modify libraries
|
||||
- Added missing files to files section
|
||||
|
||||
* Mon Mar 25 2013 Landon Curt Noll http://www.isthe.com/chongo
|
||||
- Release: 9 (was 1.1)
|
||||
- Removed deprecated PreReq for calc-devel, using Requires
|
||||
* Sun Sep 01 2007 Landon Curt Noll http://www.isthe.com/chongo
|
||||
|
||||
* Sat Sep 01 2007 Landon Curt Noll http://www.isthe.com/chongo
|
||||
- Release: 8
|
||||
- Release of calc-2.12.2
|
||||
- Calc builds with shared libraries
|
||||
|
||||
* Sun Jun 25 2006 Landon Curt Noll http://www.isthe.com/chongo
|
||||
- Release: 7
|
||||
- Changed Copyright to License as per new rpm v4.4 syntax
|
||||
* Sun May 20 2006 Landon Curt Noll http://www.isthe.com/chongo
|
||||
|
||||
* Sat May 20 2006 Landon Curt Noll http://www.isthe.com/chongo
|
||||
- Release: 6
|
||||
- Release of calc-2.12.0
|
||||
- Added *.line set files to the list of packaged files
|
||||
|
||||
* Sun Dec 11 2005 Landon Curt Noll http://www.isthe.com/chongo
|
||||
- Release: 5
|
||||
- Release of calc-2.11.11
|
||||
- Fixed description in spec file
|
||||
|
||||
* Wed Feb 26 2003 Landon Curt Noll http://www.isthe.com/chongo
|
||||
- Release: 4
|
||||
- Release of calc-2.11.7-2
|
||||
- Fixed attributes on include and lib calc-devel files
|
||||
- Added BUGS to calc-devel as well as calc
|
||||
|
||||
* Tue Feb 25 2003 Landon Curt Noll http://www.isthe.com/chongo
|
||||
- Release: 3
|
||||
- Release of calc-2.11.7-1
|
||||
- Require ncurses, readline and less to install.
|
||||
- Require ncurses-devel and readline-devel to build.
|
||||
|
||||
* Tue Feb 18 2003 Landon Curt Noll http://www.isthe.com/chongo
|
||||
- Release: 2
|
||||
- Misc changes to fit local directory setup
|
||||
|
||||
* Sun Feb 16 2003 Petteri Kettunen <petterik@users.sourceforge.net>
|
||||
- Release: 1
|
||||
- initial RPM build
|
||||
|
@@ -20,7 +20,7 @@
|
||||
#
|
||||
# @(#) $Revision: 30.2 $
|
||||
# @(#) $Id: check.awk,v 30.2 2013/08/11 01:08:32 chongo Exp $
|
||||
# @(#) $Source: /usr/local/src/cmd/calc/RCS/check.awk,v $
|
||||
# @(#) $Source: /usr/local/src/bin/calc/RCS/check.awk,v $
|
||||
#
|
||||
# Under source code control: 1996/05/25 22:07:58
|
||||
# File existed as early as: 1996
|
||||
|
12
cmath.h
12
cmath.h
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* 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
|
||||
* 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.
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* @(#) $Revision: 30.1 $
|
||||
* @(#) $Id: cmath.h,v 30.1 2007/03/16 11:09:46 chongo Exp $
|
||||
* @(#) $Revision: 30.3 $
|
||||
* @(#) $Id: cmath.h,v 30.3 2014/08/24 21:56:51 chongo Exp $
|
||||
* @(#) $Source: /usr/local/src/bin/calc/RCS/cmath.h,v $
|
||||
*
|
||||
* Under source code control: 1993/07/30 19:42:45
|
||||
@@ -28,8 +28,8 @@
|
||||
*/
|
||||
|
||||
|
||||
#if !defined(__CMATH_H__)
|
||||
#define __CMATH_H__
|
||||
#if !defined(INCLUDE_CMATH_H)
|
||||
#define INCLUDE_CMATH_H
|
||||
|
||||
|
||||
#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_;
|
||||
|
||||
|
||||
#endif /* !__CMATH_H__ */
|
||||
#endif /* !INCLUDE_CMATH_H */
|
||||
|
12
config.h
12
config.h
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* 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
|
||||
*
|
||||
@@ -19,8 +19,8 @@
|
||||
* received a copy with calc; if not, write to Free Software Foundation, Inc.
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* @(#) $Revision: 30.2 $
|
||||
* @(#) $Id: config.h,v 30.2 2007/09/21 01:27:27 chongo Exp $
|
||||
* @(#) $Revision: 30.4 $
|
||||
* @(#) $Id: config.h,v 30.4 2014/08/24 21:56:51 chongo Exp $
|
||||
* @(#) $Source: /usr/local/src/bin/calc/RCS/config.h,v $
|
||||
*
|
||||
* Under source code control: 1995/11/01 22:20:17
|
||||
@@ -31,8 +31,8 @@
|
||||
*/
|
||||
|
||||
|
||||
#if !defined(__CONFIG_H__)
|
||||
#define __CONFIG_H__
|
||||
#if !defined(INCLUDE_CONFIG_H)
|
||||
#define INCLUDE_CONFIG_H
|
||||
|
||||
|
||||
#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*);
|
||||
|
||||
|
||||
#endif /* !__CONFIG_H__ */
|
||||
#endif /* !INCLUDE_CONFIG_H */
|
||||
|
@@ -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
|
||||
*
|
||||
@@ -10,7 +10,7 @@
|
||||
* ... ...
|
||||
* 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
|
||||
* 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.
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* @(#) $Revision: 30.1 $
|
||||
* @(#) $Id: 4dsphere.calc,v 30.1 2007/03/16 11:12:11 chongo Exp $
|
||||
* @(#) $Revision: 30.3 $
|
||||
* @(#) $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 $
|
||||
*
|
||||
* Under source code control: 2001/05/03 19:02:03
|
||||
|
@@ -1,7 +1,7 @@
|
||||
#
|
||||
# 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
|
||||
# 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.
|
||||
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
#
|
||||
# @(#) $Revision: 30.4 $
|
||||
# @(#) $Id: Makefile,v 30.4 2013/08/11 08:41:38 chongo Exp $
|
||||
# @(#) $Revision: 30.9 $
|
||||
# @(#) $Id: Makefile,v 30.9 2014/09/02 07:14:49 chongo Exp $
|
||||
# @(#) $Source: /usr/local/src/bin/calc/cscript/RCS/Makefile,v $
|
||||
#
|
||||
# Under source code control: 1999/11/29 11:10:26
|
||||
@@ -227,7 +227,7 @@ all: ${TARGETS} .all
|
||||
|
||||
README: README.src
|
||||
@${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
|
||||
#
|
||||
@@ -315,9 +315,8 @@ depend:
|
||||
if [ X"$$i" != X"/dev/null" ]; then \
|
||||
echo "$$i: $$i.calc"; \
|
||||
echo ' @$${RM} -f $$@'; \
|
||||
echo -n ' @$${SED} -e "1s:'; \
|
||||
echo "^#!/usr/local/src/cmd/calc/calc:#!$${BINDIR}/calc:" \
|
||||
$$?>$$@'; \
|
||||
echo -n ' @$${SED} -e "1s:^#!/usr/local/src/bin/'; \
|
||||
echo 'calc/calc:#!$${BINDIR}/calc:" $$?>$$@'; \
|
||||
echo ' @$${CHMOD} +x $$@'; \
|
||||
fi; \
|
||||
done >> makedep.out
|
||||
@@ -341,9 +340,9 @@ depend:
|
||||
fi; \
|
||||
${MV} ${MAKE_FILE}.tmp ${MAKE_FILE}; \
|
||||
if [ -d RCS ]; then \
|
||||
echo '*****************************************************'; \
|
||||
echo 'new sample ${MAKE_FILE} formed -- need to check it in'; \
|
||||
echo '*****************************************************'; \
|
||||
echo '******************************************************'; \
|
||||
echo 'new cscript ${MAKE_FILE} formed -- need to check it in'; \
|
||||
echo '******************************************************'; \
|
||||
fi; \
|
||||
fi
|
||||
|
||||
@@ -379,8 +378,8 @@ clobber: clean
|
||||
#
|
||||
install: all
|
||||
-${Q} if [ ! -d ${T}${BINDIR} ]; then \
|
||||
echo ${MKDIR} ${T}${BINDIR}; \
|
||||
${MKDIR} ${T}${BINDIR}; \
|
||||
echo ${MKDIR} -p ${T}${BINDIR}; \
|
||||
${MKDIR} -p ${T}${BINDIR}; \
|
||||
if [ ! -d "${T}${BINDIR}" ]; then \
|
||||
echo ${MKDIR} -p "${T}${BINDIR}"; \
|
||||
${MKDIR} -p "${T}${BINDIR}"; \
|
||||
@@ -391,8 +390,8 @@ install: all
|
||||
${TRUE}; \
|
||||
fi
|
||||
-${Q} if [ ! -d ${T}${SCRIPTDIR} ]; then \
|
||||
echo ${MKDIR} ${T}${SCRIPTDIR}; \
|
||||
${MKDIR} ${T}${SCRIPTDIR}; \
|
||||
echo ${MKDIR} -p ${T}${SCRIPTDIR}; \
|
||||
${MKDIR} -p ${T}${SCRIPTDIR}; \
|
||||
if [ ! -d "${T}${SCRIPTDIR}" ]; then \
|
||||
echo ${MKDIR} -p "${T}${SCRIPTDIR}"; \
|
||||
${MKDIR} -p "${T}${SCRIPTDIR}"; \
|
||||
@@ -446,33 +445,33 @@ uninstall:
|
||||
|
||||
4dsphere: 4dsphere.calc
|
||||
@${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 $@
|
||||
fproduct: fproduct.calc
|
||||
@${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 $@
|
||||
mersenne: mersenne.calc
|
||||
@${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 $@
|
||||
piforever: piforever.calc
|
||||
@${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 $@
|
||||
plus: plus.calc
|
||||
@${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 $@
|
||||
powerterm: powerterm.calc
|
||||
@${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 $@
|
||||
simple: simple.calc
|
||||
@${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 $@
|
||||
square: square.calc
|
||||
@${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 $@
|
||||
|
@@ -7,7 +7,7 @@ be useful!
|
||||
|
||||
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
|
||||
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:
|
||||
|
||||
#!/usr/local/src/cmd/calc/calc -q -f
|
||||
#!/usr/local/src/bin/calc/calc -q -f
|
||||
|
||||
/* a correct comment */
|
||||
## another correct comment
|
||||
@@ -36,7 +36,7 @@ For more informaton about calc command lines, see "help usage".
|
||||
|
||||
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 #
|
||||
# You must to start comments with ## or /*
|
||||
@@ -101,7 +101,7 @@ simple
|
||||
|
||||
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
|
||||
## 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.
|
||||
## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
##
|
||||
## @(#) $Revision: 30.1 $
|
||||
## @(#) $Id: README.src,v 30.1 2007/03/16 11:12:11 chongo Exp $
|
||||
## @(#) $Revision: 30.3 $
|
||||
## @(#) $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 $
|
||||
##
|
||||
## Under source code control: 1999/12/17 10:23:40
|
||||
|
@@ -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
|
||||
*
|
||||
@@ -8,7 +8,7 @@
|
||||
* filename where to write the product, use - for stdout
|
||||
* 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
|
||||
* 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.
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* @(#) $Revision: 30.1 $
|
||||
* @(#) $Id: fproduct.calc,v 30.1 2007/03/16 11:12:11 chongo Exp $
|
||||
* @(#) $Revision: 30.3 $
|
||||
* @(#) $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 $
|
||||
*
|
||||
* Under source code control: 2001/04/07 20:13:11
|
||||
|
@@ -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
|
||||
*
|
||||
* 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
|
||||
* 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.
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* @(#) $Revision: 30.1 $
|
||||
* @(#) $Id: mersenne.calc,v 30.1 2007/03/16 11:12:11 chongo Exp $
|
||||
* @(#) $Revision: 30.3 $
|
||||
* @(#) $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 $
|
||||
*
|
||||
* Under source code control: 1999/11/30 00:09:01;
|
||||
|
@@ -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)
|
||||
*
|
||||
* 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
|
||||
* 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.
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* @(#) $Revision: 30.1 $
|
||||
* @(#) $Id: piforever.calc,v 30.1 2007/03/16 11:12:11 chongo Exp $
|
||||
* @(#) $Revision: 30.3 $
|
||||
* @(#) $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 $
|
||||
*
|
||||
* Under source code control: 1999/11/30 00:11:36
|
||||
|
@@ -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
|
||||
*
|
||||
* 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
|
||||
* 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.
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* @(#) $Revision: 30.1 $
|
||||
* @(#) $Id: plus.calc,v 30.1 2007/03/16 11:12:11 chongo Exp $
|
||||
* @(#) $Revision: 30.3 $
|
||||
* @(#) $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 $
|
||||
*
|
||||
* Under source code control: 1999/11/29 10:22:37
|
||||
|
@@ -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
|
||||
*
|
||||
@@ -8,7 +8,7 @@
|
||||
* base_limit largest base we will consider (def: 10000)
|
||||
* 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
|
||||
* 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.
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* @(#) $Revision: 30.1 $
|
||||
* @(#) $Id: powerterm.calc,v 30.1 2007/03/16 11:12:11 chongo Exp $
|
||||
* @(#) $Revision: 30.3 $
|
||||
* @(#) $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 $
|
||||
*
|
||||
* Under source code control: 2001/04/24 23:49:11
|
||||
|
@@ -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
|
||||
*
|
||||
* 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
|
||||
* 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.
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* @(#) $Revision: 30.1 $
|
||||
* @(#) $Id: simple.calc,v 30.1 2007/03/16 11:12:11 chongo Exp $
|
||||
* @(#) $Revision: 30.3 $
|
||||
* @(#) $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 $
|
||||
*
|
||||
* Under source code control: 1999/11/29 10:22:37
|
||||
|
@@ -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
|
||||
*
|
||||
* 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
|
||||
* 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.
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* @(#) $Revision: 30.1 $
|
||||
* @(#) $Id: square.calc,v 30.1 2007/03/16 11:12:11 chongo Exp $
|
||||
* @(#) $Revision: 30.3 $
|
||||
* @(#) $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 $
|
||||
*
|
||||
* Under source code control: 2000/12/15 06:52:01
|
||||
|
165
custom/Makefile
165
custom/Makefile
@@ -2,7 +2,7 @@
|
||||
#
|
||||
# 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
|
||||
# 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.
|
||||
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
#
|
||||
# @(#) $Revision: 30.31 $
|
||||
# @(#) $Id: Makefile.head,v 30.31 2013/09/27 08:55:28 chongo Exp $
|
||||
# @(#) $Revision: 30.35 $
|
||||
# @(#) $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 $
|
||||
#
|
||||
# Under source code control: 1997/03/09 02:28:54
|
||||
@@ -337,20 +337,6 @@ CALC_ENV= CALCPATH=./cal
|
||||
ALLOW_CUSTOM= -DCUSTOM
|
||||
#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
|
||||
# end with a certain file extension. Some compile systems such as
|
||||
# Cygwin build calc as calc.exe. The EXT variable is used to denote
|
||||
@@ -366,15 +352,18 @@ EXT=
|
||||
|
||||
# The default calc versions
|
||||
#
|
||||
VERSION= 2.12.4.13
|
||||
VERS= 2.12.4
|
||||
VER= 2.12
|
||||
VE= 2
|
||||
VERSION= 2.12.4.14
|
||||
|
||||
# Names of shared libraries with versions
|
||||
#
|
||||
LIB_EXT= .so
|
||||
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_VER= ${LIB_EXT}.${VER}
|
||||
LIB_EXT_VE= ${LIB_EXT}.${VE}
|
||||
@@ -489,6 +478,17 @@ LDFLAGS= ${LD_DEBUG} ${ILDFLAGS}
|
||||
#
|
||||
# CCOPT are flags given to ${CC} for optimization
|
||||
# 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
|
||||
# NOTE: CCWERR is only set in development Makefiles and must only be
|
||||
# used with ${CC}, not ${LCC}. If you do not want the compiler
|
||||
@@ -535,7 +535,10 @@ LD_STATIC=
|
||||
LIBCALC_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=
|
||||
CCOPT= ${DEBUG}
|
||||
CCMISC=
|
||||
@@ -545,9 +548,9 @@ CC= ${PURIFY} ${LCC} ${CCWERR}
|
||||
#
|
||||
endif
|
||||
|
||||
#################################
|
||||
# Apple MacOS X / Darwin target #
|
||||
#################################
|
||||
##############################
|
||||
# Apple OS X / Darwin target #
|
||||
##############################
|
||||
|
||||
ifeq ($(target),Darwin)
|
||||
#
|
||||
@@ -556,9 +559,23 @@ BLD_TYPE= calc-dynamic-only
|
||||
CC_SHARE= -fPIC
|
||||
DEFAULT_LIB_INSTALL_PATH= ${PWD}:${LIBDIR}:/usr/local/lib
|
||||
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
|
||||
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
|
||||
LIBCUSTCALC_SHLIB=
|
||||
endif
|
||||
@@ -568,17 +585,21 @@ LD_STATIC= ${DARWIN_ARCH}
|
||||
LIBCALC_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=
|
||||
CCOPT= ${DEBUG}
|
||||
CCMISC= ${DARWIN_ARCH}
|
||||
#
|
||||
LCC= MACOSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET} gcc
|
||||
LCC= clang
|
||||
CC= ${PURIFY} ${LCC} ${CCWERR}
|
||||
#
|
||||
# Darwin dynamic shared lib filenames
|
||||
LIB_EXT:= .dylib
|
||||
LIB_EXT_VERSION:= .${VERSION}${LIB_EXT}
|
||||
# legacy partial versions are no longer used, only removed
|
||||
LIB_EXT_VERS:= .${VERS}${LIB_EXT}
|
||||
LIB_EXT_VER:= .${VER}${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 # Intel binary
|
||||
# DARWIN_ARCH= -arch ppc # PPC binary
|
||||
# DARWIN_ARCH= -arch x86_64 # native 64-bit binary
|
||||
DARWIN_ARCH= # native binary
|
||||
MACOSX_DEPLOYMENT_TARGET=10.8
|
||||
#
|
||||
endif
|
||||
|
||||
@@ -622,7 +643,10 @@ LD_STATIC=
|
||||
LIBCALC_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=
|
||||
CCOPT= ${DEBUG}
|
||||
CCMISC=
|
||||
@@ -665,6 +689,9 @@ LIBCALC_STATIC=
|
||||
LIBCUSTCALC_STATIC=
|
||||
#
|
||||
CCWARN= -Wall
|
||||
WNO_IMPLICT= -Wno-implicit
|
||||
WNO_ERROR_LONG_LONG= -Wno-error=long-long
|
||||
WNO_LONG_LONG= -Wno-long-long
|
||||
CCWERR=
|
||||
CCOPT= ${DEBUG}
|
||||
CCMISC=
|
||||
@@ -680,7 +707,6 @@ endif
|
||||
# SunOS target #
|
||||
################
|
||||
|
||||
# XXX - this needs to be tested
|
||||
ifeq ($(target),SunOS)
|
||||
#
|
||||
BLD_TYPE= calc-dynamic-only
|
||||
@@ -701,7 +727,10 @@ LIBCALC_STATIC=
|
||||
LIBCUSTCALC_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=
|
||||
CCOPT= ${DEBUG}
|
||||
CCMISC=
|
||||
@@ -735,7 +764,10 @@ LIBCALC_STATIC=
|
||||
LIBCUSTCALC_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=
|
||||
CCOPT= ${DEBUG}
|
||||
CCMISC=
|
||||
@@ -769,7 +801,10 @@ LD_STATIC=
|
||||
LIBCALC_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=
|
||||
CCOPT= ${DEBUG}
|
||||
CCMISC=
|
||||
@@ -829,7 +864,10 @@ LIBCALC_STATIC=
|
||||
LIBCUSTCALC_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=
|
||||
CCOPT= ${DEBUG}
|
||||
CCMISC= -DNOTCYGWIN
|
||||
@@ -866,7 +904,10 @@ LIBCALC_STATIC=
|
||||
LIBCUSTCALC_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=
|
||||
CCOPT= ${DEBUG}
|
||||
CCMISC=
|
||||
@@ -1086,8 +1127,8 @@ depend:
|
||||
fi
|
||||
${Q} echo forming custom/skel
|
||||
${Q} ${RM} -rf skel
|
||||
${Q} ${MKDIR} skel
|
||||
${Q} ${MKDIR} skel/custom
|
||||
${Q} ${MKDIR} -p skel
|
||||
${Q} ${MKDIR} -p skel/custom
|
||||
-${Q} for i in ${C_SRC} /dev/null; do \
|
||||
if [ X"$$i" != X"/dev/null" ]; then \
|
||||
${SED} -n '/^#[ ]*include[ ]*"/p' \
|
||||
@@ -1198,11 +1239,13 @@ clobber: clean
|
||||
${RM} -f ${BLD_TYPE}
|
||||
${RM} -f .all ${MAKE_FILE}.tmp ${MAKE_FILE}.bak
|
||||
${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_VER}
|
||||
${RM} -f libcustcalc${LIB_EXT_VE}
|
||||
${RM} -f libcustcalc${LIB_EXT}
|
||||
${RM} -f libcustcalc.a
|
||||
#if 0 /* start of skip for non-Gnu makefiles */
|
||||
${RM} -f Makefile.simple
|
||||
#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
|
||||
#
|
||||
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 \
|
||||
echo ${MKDIR} ${T}${INCDIR}; \
|
||||
${MKDIR} ${T}${INCDIR}; \
|
||||
echo ${MKDIR} -p ${T}${INCDIR}; \
|
||||
${MKDIR} -p ${T}${INCDIR}; \
|
||||
if [ ! -d "${T}${INCDIR}" ]; then \
|
||||
echo ${MKDIR} -p "${T}${INCDIR}"; \
|
||||
${MKDIR} -p "${T}${INCDIR}"; \
|
||||
@@ -1225,8 +1280,8 @@ install: all
|
||||
${TRUE}; \
|
||||
fi
|
||||
-${Q} if [ ! -d ${T}${CALC_SHAREDIR} ]; then \
|
||||
echo ${MKDIR} ${T}${CALC_SHAREDIR}; \
|
||||
${MKDIR} ${T}${CALC_SHAREDIR}; \
|
||||
echo ${MKDIR} -p ${T}${CALC_SHAREDIR}; \
|
||||
${MKDIR} -p ${T}${CALC_SHAREDIR}; \
|
||||
if [ ! -d "${T}${CALC_SHAREDIR}" ]; then \
|
||||
echo ${MKDIR} -p "${T}${CALC_SHAREDIR}"; \
|
||||
${MKDIR} -p "${T}${CALC_SHAREDIR}"; \
|
||||
@@ -1237,8 +1292,8 @@ install: all
|
||||
${TRUE}; \
|
||||
fi
|
||||
-${Q} if [ ! -d ${T}${CALC_INCDIR} ]; then \
|
||||
echo ${MKDIR} ${T}${CALC_INCDIR}; \
|
||||
${MKDIR} ${T}${CALC_INCDIR}; \
|
||||
echo ${MKDIR} -p ${T}${CALC_INCDIR}; \
|
||||
${MKDIR} -p ${T}${CALC_INCDIR}; \
|
||||
if [ ! -d "${T}${CALC_INCDIR}" ]; then \
|
||||
echo ${MKDIR} -p "${T}${CALC_INCDIR}"; \
|
||||
${MKDIR} -p "${T}${CALC_INCDIR}"; \
|
||||
@@ -1249,8 +1304,8 @@ install: all
|
||||
${TRUE}; \
|
||||
fi
|
||||
-${Q} if [ ! -d ${T}${HELPDIR} ]; then \
|
||||
echo ${MKDIR} ${T}${HELPDIR}; \
|
||||
${MKDIR} ${T}${HELPDIR}; \
|
||||
echo ${MKDIR} -p ${T}${HELPDIR}; \
|
||||
${MKDIR} -p ${T}${HELPDIR}; \
|
||||
if [ ! -d "${T}${HELPDIR}" ]; then \
|
||||
echo ${MKDIR} -p "${T}${HELPDIR}"; \
|
||||
${MKDIR} -p "${T}${HELPDIR}"; \
|
||||
@@ -1261,8 +1316,8 @@ install: all
|
||||
${TRUE}; \
|
||||
fi
|
||||
-${Q} if [ ! -d ${T}${CUSTOMCALDIR} ]; then \
|
||||
echo ${MKDIR} ${T}${CUSTOMCALDIR}; \
|
||||
${MKDIR} ${T}${CUSTOMCALDIR}; \
|
||||
echo ${MKDIR} -p ${T}${CUSTOMCALDIR}; \
|
||||
${MKDIR} -p ${T}${CUSTOMCALDIR}; \
|
||||
if [ ! -d "${T}${CUSTOMCALDIR}" ]; then \
|
||||
echo ${MKDIR} -p "${T}${CUSTOMCALDIR}"; \
|
||||
${MKDIR} -p "${T}${CUSTOMCALDIR}"; \
|
||||
@@ -1273,8 +1328,8 @@ install: all
|
||||
${TRUE}; \
|
||||
fi
|
||||
-${Q} if [ ! -d ${T}${CUSTOMHELPDIR} ]; then \
|
||||
echo ${MKDIR} ${T}${CUSTOMHELPDIR}; \
|
||||
${MKDIR} ${T}${CUSTOMHELPDIR}; \
|
||||
echo ${MKDIR} -p ${T}${CUSTOMHELPDIR}; \
|
||||
${MKDIR} -p ${T}${CUSTOMHELPDIR}; \
|
||||
if [ ! -d "${T}${CUSTOMHELPDIR}" ]; then \
|
||||
echo ${MKDIR} -p "${T}${CUSTOMHELPDIR}"; \
|
||||
${MKDIR} -p "${T}${CUSTOMHELPDIR}"; \
|
||||
@@ -1285,8 +1340,8 @@ install: all
|
||||
${TRUE}; \
|
||||
fi
|
||||
-${Q} if [ ! -d ${T}${CUSTOMINCDIR} ]; then \
|
||||
echo ${MKDIR} ${T}${CUSTOMINCDIR}; \
|
||||
${MKDIR} ${T}${CUSTOMINCDIR}; \
|
||||
echo ${MKDIR} -p ${T}${CUSTOMINCDIR}; \
|
||||
${MKDIR} -p ${T}${CUSTOMINCDIR}; \
|
||||
if [ ! -d "${T}${CUSTOMINCDIR}" ]; then \
|
||||
echo ${MKDIR} -p "${T}${CUSTOMINCDIR}"; \
|
||||
${MKDIR} -p "${T}${CUSTOMINCDIR}"; \
|
||||
|
@@ -2,7 +2,7 @@
|
||||
#
|
||||
# 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
|
||||
# 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.
|
||||
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
#
|
||||
# @(#) $Revision: 30.31 $
|
||||
# @(#) $Id: Makefile.head,v 30.31 2013/09/27 08:55:28 chongo Exp $
|
||||
# @(#) $Revision: 30.35 $
|
||||
# @(#) $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 $
|
||||
#
|
||||
# Under source code control: 1997/03/09 02:28:54
|
||||
@@ -337,20 +337,6 @@ CALC_ENV= CALCPATH=./cal
|
||||
ALLOW_CUSTOM= -DCUSTOM
|
||||
#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
|
||||
# end with a certain file extension. Some compile systems such as
|
||||
# Cygwin build calc as calc.exe. The EXT variable is used to denote
|
||||
@@ -366,15 +352,18 @@ EXT=
|
||||
|
||||
# The default calc versions
|
||||
#
|
||||
VERSION= 2.12.4.13
|
||||
VERS= 2.12.4
|
||||
VER= 2.12
|
||||
VE= 2
|
||||
VERSION= 2.12.4.14
|
||||
|
||||
# Names of shared libraries with versions
|
||||
#
|
||||
LIB_EXT= .so
|
||||
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_VER= ${LIB_EXT}.${VER}
|
||||
LIB_EXT_VE= ${LIB_EXT}.${VE}
|
||||
|
@@ -2,7 +2,7 @@
|
||||
#
|
||||
# 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
|
||||
# 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.
|
||||
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
#
|
||||
# @(#) $Revision: 30.31 $
|
||||
# @(#) $Id: Makefile.head,v 30.31 2013/09/27 08:55:28 chongo Exp $
|
||||
# @(#) $Revision: 30.35 $
|
||||
# @(#) $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 $
|
||||
#
|
||||
# Under source code control: 1997/03/09 02:28:54
|
||||
@@ -322,20 +322,6 @@ CALC_ENV= CALCPATH=./cal
|
||||
ALLOW_CUSTOM= -DCUSTOM
|
||||
#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
|
||||
# end with a certain file extension. Some compile systems such as
|
||||
# Cygwin build calc as calc.exe. The EXT variable is used to denote
|
||||
@@ -351,15 +337,18 @@ EXT=
|
||||
|
||||
# The default calc versions
|
||||
#
|
||||
VERSION= 2.12.4.13
|
||||
VERS= 2.12.4
|
||||
VER= 2.12
|
||||
VE= 2
|
||||
VERSION= 2.12.4.14
|
||||
|
||||
# Names of shared libraries with versions
|
||||
#
|
||||
LIB_EXT= .so
|
||||
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_VER= ${LIB_EXT}.${VER}
|
||||
LIB_EXT_VE= ${LIB_EXT}.${VE}
|
||||
@@ -449,6 +438,17 @@ COMMON_LDFLAGS= ${EXTRA_LDFLAGS}
|
||||
#
|
||||
# CCOPT are flags given to ${CC} for optimization
|
||||
# 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
|
||||
# NOTE: CCWERR is only set in development Makefiles and must only be
|
||||
# used with ${CC}, not ${LCC}. If you do not want the compiler
|
||||
@@ -485,7 +485,10 @@ LD_STATIC=
|
||||
LIBCALC_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=
|
||||
CCOPT= ${DEBUG}
|
||||
CCMISC=
|
||||
@@ -679,8 +682,8 @@ depend:
|
||||
fi
|
||||
${Q} echo forming custom/skel
|
||||
${Q} ${RM} -rf skel
|
||||
${Q} ${MKDIR} skel
|
||||
${Q} ${MKDIR} skel/custom
|
||||
${Q} ${MKDIR} -p skel
|
||||
${Q} ${MKDIR} -p skel/custom
|
||||
-${Q} for i in ${C_SRC} /dev/null; do \
|
||||
if [ X"$$i" != X"/dev/null" ]; then \
|
||||
${SED} -n '/^#[ ]*include[ ]*"/p' \
|
||||
@@ -791,20 +794,34 @@ clobber: clean
|
||||
${RM} -f ${BLD_TYPE}
|
||||
${RM} -f .all ${MAKE_FILE}.tmp ${MAKE_FILE}.bak
|
||||
${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_VER}
|
||||
${RM} -f libcustcalc${LIB_EXT_VE}
|
||||
${RM} -f libcustcalc${LIB_EXT}
|
||||
${RM} -f libcustcalc.a
|
||||
|
||||
# install everything
|
||||
#
|
||||
# NOTE: Keep the uninstall rule in reverse order to the install rule
|
||||
#
|
||||
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 \
|
||||
echo ${MKDIR} ${T}${INCDIR}; \
|
||||
${MKDIR} ${T}${INCDIR}; \
|
||||
echo ${MKDIR} -p ${T}${INCDIR}; \
|
||||
${MKDIR} -p ${T}${INCDIR}; \
|
||||
if [ ! -d "${T}${INCDIR}" ]; then \
|
||||
echo ${MKDIR} -p "${T}${INCDIR}"; \
|
||||
${MKDIR} -p "${T}${INCDIR}"; \
|
||||
@@ -815,8 +832,8 @@ install: all
|
||||
${TRUE}; \
|
||||
fi
|
||||
-${Q} if [ ! -d ${T}${CALC_SHAREDIR} ]; then \
|
||||
echo ${MKDIR} ${T}${CALC_SHAREDIR}; \
|
||||
${MKDIR} ${T}${CALC_SHAREDIR}; \
|
||||
echo ${MKDIR} -p ${T}${CALC_SHAREDIR}; \
|
||||
${MKDIR} -p ${T}${CALC_SHAREDIR}; \
|
||||
if [ ! -d "${T}${CALC_SHAREDIR}" ]; then \
|
||||
echo ${MKDIR} -p "${T}${CALC_SHAREDIR}"; \
|
||||
${MKDIR} -p "${T}${CALC_SHAREDIR}"; \
|
||||
@@ -827,8 +844,8 @@ install: all
|
||||
${TRUE}; \
|
||||
fi
|
||||
-${Q} if [ ! -d ${T}${CALC_INCDIR} ]; then \
|
||||
echo ${MKDIR} ${T}${CALC_INCDIR}; \
|
||||
${MKDIR} ${T}${CALC_INCDIR}; \
|
||||
echo ${MKDIR} -p ${T}${CALC_INCDIR}; \
|
||||
${MKDIR} -p ${T}${CALC_INCDIR}; \
|
||||
if [ ! -d "${T}${CALC_INCDIR}" ]; then \
|
||||
echo ${MKDIR} -p "${T}${CALC_INCDIR}"; \
|
||||
${MKDIR} -p "${T}${CALC_INCDIR}"; \
|
||||
@@ -839,8 +856,8 @@ install: all
|
||||
${TRUE}; \
|
||||
fi
|
||||
-${Q} if [ ! -d ${T}${HELPDIR} ]; then \
|
||||
echo ${MKDIR} ${T}${HELPDIR}; \
|
||||
${MKDIR} ${T}${HELPDIR}; \
|
||||
echo ${MKDIR} -p ${T}${HELPDIR}; \
|
||||
${MKDIR} -p ${T}${HELPDIR}; \
|
||||
if [ ! -d "${T}${HELPDIR}" ]; then \
|
||||
echo ${MKDIR} -p "${T}${HELPDIR}"; \
|
||||
${MKDIR} -p "${T}${HELPDIR}"; \
|
||||
@@ -851,8 +868,8 @@ install: all
|
||||
${TRUE}; \
|
||||
fi
|
||||
-${Q} if [ ! -d ${T}${CUSTOMCALDIR} ]; then \
|
||||
echo ${MKDIR} ${T}${CUSTOMCALDIR}; \
|
||||
${MKDIR} ${T}${CUSTOMCALDIR}; \
|
||||
echo ${MKDIR} -p ${T}${CUSTOMCALDIR}; \
|
||||
${MKDIR} -p ${T}${CUSTOMCALDIR}; \
|
||||
if [ ! -d "${T}${CUSTOMCALDIR}" ]; then \
|
||||
echo ${MKDIR} -p "${T}${CUSTOMCALDIR}"; \
|
||||
${MKDIR} -p "${T}${CUSTOMCALDIR}"; \
|
||||
@@ -863,8 +880,8 @@ install: all
|
||||
${TRUE}; \
|
||||
fi
|
||||
-${Q} if [ ! -d ${T}${CUSTOMHELPDIR} ]; then \
|
||||
echo ${MKDIR} ${T}${CUSTOMHELPDIR}; \
|
||||
${MKDIR} ${T}${CUSTOMHELPDIR}; \
|
||||
echo ${MKDIR} -p ${T}${CUSTOMHELPDIR}; \
|
||||
${MKDIR} -p ${T}${CUSTOMHELPDIR}; \
|
||||
if [ ! -d "${T}${CUSTOMHELPDIR}" ]; then \
|
||||
echo ${MKDIR} -p "${T}${CUSTOMHELPDIR}"; \
|
||||
${MKDIR} -p "${T}${CUSTOMHELPDIR}"; \
|
||||
@@ -875,8 +892,8 @@ install: all
|
||||
${TRUE}; \
|
||||
fi
|
||||
-${Q} if [ ! -d ${T}${CUSTOMINCDIR} ]; then \
|
||||
echo ${MKDIR} ${T}${CUSTOMINCDIR}; \
|
||||
${MKDIR} ${T}${CUSTOMINCDIR}; \
|
||||
echo ${MKDIR} -p ${T}${CUSTOMINCDIR}; \
|
||||
${MKDIR} -p ${T}${CUSTOMINCDIR}; \
|
||||
if [ ! -d "${T}${CUSTOMINCDIR}" ]; then \
|
||||
echo ${MKDIR} -p "${T}${CUSTOMINCDIR}"; \
|
||||
${MKDIR} -p "${T}${CUSTOMINCDIR}"; \
|
||||
|
@@ -177,8 +177,8 @@ depend:
|
||||
fi
|
||||
${Q} echo forming custom/skel
|
||||
${Q} ${RM} -rf skel
|
||||
${Q} ${MKDIR} skel
|
||||
${Q} ${MKDIR} skel/custom
|
||||
${Q} ${MKDIR} -p skel
|
||||
${Q} ${MKDIR} -p skel/custom
|
||||
-${Q} for i in ${C_SRC} /dev/null; do \
|
||||
if [ X"$$i" != X"/dev/null" ]; then \
|
||||
${SED} -n '/^#[ ]*include[ ]*"/p' \
|
||||
@@ -289,11 +289,13 @@ clobber: clean
|
||||
${RM} -f ${BLD_TYPE}
|
||||
${RM} -f .all ${MAKE_FILE}.tmp ${MAKE_FILE}.bak
|
||||
${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_VER}
|
||||
${RM} -f libcustcalc${LIB_EXT_VE}
|
||||
${RM} -f libcustcalc${LIB_EXT}
|
||||
${RM} -f libcustcalc.a
|
||||
#if 0 /* start of skip for non-Gnu makefiles */
|
||||
${RM} -f Makefile.simple
|
||||
#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
|
||||
#
|
||||
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 \
|
||||
echo ${MKDIR} ${T}${INCDIR}; \
|
||||
${MKDIR} ${T}${INCDIR}; \
|
||||
echo ${MKDIR} -p ${T}${INCDIR}; \
|
||||
${MKDIR} -p ${T}${INCDIR}; \
|
||||
if [ ! -d "${T}${INCDIR}" ]; then \
|
||||
echo ${MKDIR} -p "${T}${INCDIR}"; \
|
||||
${MKDIR} -p "${T}${INCDIR}"; \
|
||||
@@ -316,8 +330,8 @@ install: all
|
||||
${TRUE}; \
|
||||
fi
|
||||
-${Q} if [ ! -d ${T}${CALC_SHAREDIR} ]; then \
|
||||
echo ${MKDIR} ${T}${CALC_SHAREDIR}; \
|
||||
${MKDIR} ${T}${CALC_SHAREDIR}; \
|
||||
echo ${MKDIR} -p ${T}${CALC_SHAREDIR}; \
|
||||
${MKDIR} -p ${T}${CALC_SHAREDIR}; \
|
||||
if [ ! -d "${T}${CALC_SHAREDIR}" ]; then \
|
||||
echo ${MKDIR} -p "${T}${CALC_SHAREDIR}"; \
|
||||
${MKDIR} -p "${T}${CALC_SHAREDIR}"; \
|
||||
@@ -328,8 +342,8 @@ install: all
|
||||
${TRUE}; \
|
||||
fi
|
||||
-${Q} if [ ! -d ${T}${CALC_INCDIR} ]; then \
|
||||
echo ${MKDIR} ${T}${CALC_INCDIR}; \
|
||||
${MKDIR} ${T}${CALC_INCDIR}; \
|
||||
echo ${MKDIR} -p ${T}${CALC_INCDIR}; \
|
||||
${MKDIR} -p ${T}${CALC_INCDIR}; \
|
||||
if [ ! -d "${T}${CALC_INCDIR}" ]; then \
|
||||
echo ${MKDIR} -p "${T}${CALC_INCDIR}"; \
|
||||
${MKDIR} -p "${T}${CALC_INCDIR}"; \
|
||||
@@ -340,8 +354,8 @@ install: all
|
||||
${TRUE}; \
|
||||
fi
|
||||
-${Q} if [ ! -d ${T}${HELPDIR} ]; then \
|
||||
echo ${MKDIR} ${T}${HELPDIR}; \
|
||||
${MKDIR} ${T}${HELPDIR}; \
|
||||
echo ${MKDIR} -p ${T}${HELPDIR}; \
|
||||
${MKDIR} -p ${T}${HELPDIR}; \
|
||||
if [ ! -d "${T}${HELPDIR}" ]; then \
|
||||
echo ${MKDIR} -p "${T}${HELPDIR}"; \
|
||||
${MKDIR} -p "${T}${HELPDIR}"; \
|
||||
@@ -352,8 +366,8 @@ install: all
|
||||
${TRUE}; \
|
||||
fi
|
||||
-${Q} if [ ! -d ${T}${CUSTOMCALDIR} ]; then \
|
||||
echo ${MKDIR} ${T}${CUSTOMCALDIR}; \
|
||||
${MKDIR} ${T}${CUSTOMCALDIR}; \
|
||||
echo ${MKDIR} -p ${T}${CUSTOMCALDIR}; \
|
||||
${MKDIR} -p ${T}${CUSTOMCALDIR}; \
|
||||
if [ ! -d "${T}${CUSTOMCALDIR}" ]; then \
|
||||
echo ${MKDIR} -p "${T}${CUSTOMCALDIR}"; \
|
||||
${MKDIR} -p "${T}${CUSTOMCALDIR}"; \
|
||||
@@ -364,8 +378,8 @@ install: all
|
||||
${TRUE}; \
|
||||
fi
|
||||
-${Q} if [ ! -d ${T}${CUSTOMHELPDIR} ]; then \
|
||||
echo ${MKDIR} ${T}${CUSTOMHELPDIR}; \
|
||||
${MKDIR} ${T}${CUSTOMHELPDIR}; \
|
||||
echo ${MKDIR} -p ${T}${CUSTOMHELPDIR}; \
|
||||
${MKDIR} -p ${T}${CUSTOMHELPDIR}; \
|
||||
if [ ! -d "${T}${CUSTOMHELPDIR}" ]; then \
|
||||
echo ${MKDIR} -p "${T}${CUSTOMHELPDIR}"; \
|
||||
${MKDIR} -p "${T}${CUSTOMHELPDIR}"; \
|
||||
@@ -376,8 +390,8 @@ install: all
|
||||
${TRUE}; \
|
||||
fi
|
||||
-${Q} if [ ! -d ${T}${CUSTOMINCDIR} ]; then \
|
||||
echo ${MKDIR} ${T}${CUSTOMINCDIR}; \
|
||||
${MKDIR} ${T}${CUSTOMINCDIR}; \
|
||||
echo ${MKDIR} -p ${T}${CUSTOMINCDIR}; \
|
||||
${MKDIR} -p ${T}${CUSTOMINCDIR}; \
|
||||
if [ ! -d "${T}${CUSTOMINCDIR}" ]; then \
|
||||
echo ${MKDIR} -p "${T}${CUSTOMINCDIR}"; \
|
||||
${MKDIR} -p "${T}${CUSTOMINCDIR}"; \
|
||||
|
12
decl.h
12
decl.h
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* decl - variable and function declaration macros
|
||||
*
|
||||
* Copyright (C) 2007 Landon Curt Noll
|
||||
* Copyright (C) 2007,2014 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.
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* @(#) $Revision: 30.4 $
|
||||
* @(#) $Id: decl.h,v 30.4 2013/08/11 08:41:38 chongo Exp $
|
||||
* @(#) $Revision: 30.6 $
|
||||
* @(#) $Id: decl.h,v 30.6 2014/08/24 21:56:51 chongo Exp $
|
||||
* @(#) $Source: /usr/local/src/bin/calc/RCS/decl.h,v $
|
||||
*
|
||||
* Under source code control: 2007/02/09 05:24:25
|
||||
@@ -33,8 +33,8 @@
|
||||
#include "have_const.h"
|
||||
|
||||
|
||||
#if !defined(__DECL_H__)
|
||||
#define __DECL_H__
|
||||
#if !defined(INCLUDE_DECL_H)
|
||||
#define INCLUDE_DECL_H
|
||||
|
||||
|
||||
/*
|
||||
@@ -106,4 +106,4 @@
|
||||
# define PRINTF_FORMAT(fmt_idx, arg_idx)
|
||||
#endif
|
||||
|
||||
#endif /* !__DECL_H__ */
|
||||
#endif /* !INCLUDE_DECL_H */
|
||||
|
12
file.h
12
file.h
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* 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
|
||||
*
|
||||
@@ -19,8 +19,8 @@
|
||||
* received a copy with calc; if not, write to Free Software Foundation, Inc.
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* @(#) $Revision: 30.3 $
|
||||
* @(#) $Id: file.h,v 30.3 2013/09/01 22:16:21 chongo Exp $
|
||||
* @(#) $Revision: 30.5 $
|
||||
* @(#) $Id: file.h,v 30.5 2014/08/24 21:56:51 chongo Exp $
|
||||
* @(#) $Source: /usr/local/src/bin/calc/RCS/file.h,v $
|
||||
*
|
||||
* Under source code control: 1996/05/24 05:55:58
|
||||
@@ -31,8 +31,8 @@
|
||||
*/
|
||||
|
||||
|
||||
#if !defined(__FILE_H__)
|
||||
#define __FILE_H__
|
||||
#if !defined(INCLUDE_FILE_H)
|
||||
#define INCLUDE_FILE_H
|
||||
|
||||
|
||||
#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);
|
||||
|
||||
|
||||
#endif /* !__FILE_H__ */
|
||||
#endif /* !INCLUDE_FILE_H */
|
||||
|
21
func.c
21
func.c
@@ -19,8 +19,8 @@
|
||||
* received a copy with calc; if not, write to Free Software Foundation, Inc.
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* @(#) $Revision: 30.9 $
|
||||
* @(#) $Id: func.c,v 30.9 2013/09/02 01:38:08 chongo Exp $
|
||||
* @(#) $Revision: 30.10 $
|
||||
* @(#) $Id: func.c,v 30.10 2014/08/31 14:54:50 chongo Exp $
|
||||
* @(#) $Source: /usr/local/src/bin/calc/RCS/func.c,v $
|
||||
*
|
||||
* Under source code control: 1990/02/15 01:48:15
|
||||
@@ -1241,10 +1241,11 @@ f_primetest(int count, NUMBER **vals)
|
||||
{
|
||||
/* parse args */
|
||||
switch (count) {
|
||||
case 1: return itoq((long) qprimetest(vals[0],
|
||||
qlink(&_qone_), qlink(&_qone_)));
|
||||
case 2: return itoq((long) qprimetest(vals[0],
|
||||
vals[1], qlink(&_qone_)));
|
||||
case 1: qlink(&_qone_);
|
||||
qlink(&_qone_);
|
||||
return itoq((long) qprimetest(vals[0], &_qone_, &_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]));
|
||||
}
|
||||
}
|
||||
@@ -8248,6 +8249,10 @@ f_blkcpy(int count, VALUE **vals)
|
||||
*/
|
||||
args[0] = vals[1];
|
||||
args[1] = vals[0];
|
||||
null_value.v_type = V_NULL;
|
||||
args[2] = &null_value;
|
||||
args[3] = &null_value;
|
||||
args[4] = &null_value;
|
||||
switch(count) {
|
||||
case 5:
|
||||
args[2] = vals[4];
|
||||
@@ -8258,14 +8263,10 @@ f_blkcpy(int count, VALUE **vals)
|
||||
count = 5;
|
||||
args[4] = vals[3];
|
||||
args[3] = vals[2];
|
||||
null_value.v_type = V_NULL;
|
||||
args[2] = &null_value;
|
||||
break;
|
||||
case 3:
|
||||
count = 4;
|
||||
args[3] = vals[2];
|
||||
null_value.v_type = V_NULL;
|
||||
args[2] = &null_value;
|
||||
break;
|
||||
}
|
||||
|
||||
|
12
func.h
12
func.h
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* 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
|
||||
* 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.
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* @(#) $Revision: 30.1 $
|
||||
* @(#) $Id: func.h,v 30.1 2007/03/16 11:09:46 chongo Exp $
|
||||
* @(#) $Revision: 30.3 $
|
||||
* @(#) $Id: func.h,v 30.3 2014/08/24 21:56:51 chongo Exp $
|
||||
* @(#) $Source: /usr/local/src/bin/calc/RCS/func.h,v $
|
||||
*
|
||||
* Under source code control: 1990/02/15 01:48:33
|
||||
@@ -28,8 +28,8 @@
|
||||
*/
|
||||
|
||||
|
||||
#if !defined(__FUNC_H__)
|
||||
#define __FUNC_H__
|
||||
#if !defined(INCLUDE_FUNC_H)
|
||||
#define INCLUDE_FUNC_H
|
||||
|
||||
|
||||
#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 *);
|
||||
|
||||
|
||||
#endif /* !__FUNC_H__ */
|
||||
#endif /* !INCLUDE_FUNC_H */
|
||||
|
12
hash.h
12
hash.h
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* 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
|
||||
* 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.
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* @(#) $Revision: 30.2 $
|
||||
* @(#) $Id: hash.h,v 30.2 2007/07/05 17:37:41 chongo Exp $
|
||||
* @(#) $Revision: 30.4 $
|
||||
* @(#) $Id: hash.h,v 30.4 2014/08/24 21:56:51 chongo Exp $
|
||||
* @(#) $Source: /usr/local/src/bin/calc/RCS/hash.h,v $
|
||||
*
|
||||
* Under source code control: 1995/11/14 23:57:45
|
||||
@@ -29,8 +29,8 @@
|
||||
*/
|
||||
|
||||
|
||||
#if !defined(__HASH_H__)
|
||||
#define __HASH_H__
|
||||
#if !defined(INCLUDE_HASH_H)
|
||||
#define INCLUDE_HASH_H
|
||||
|
||||
|
||||
#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*);
|
||||
|
||||
|
||||
#endif /* !__HASH_H__ */
|
||||
#endif /* !INCLUDE_HASH_H */
|
||||
|
13
have_stdvs.c
13
have_stdvs.c
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* 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
|
||||
* 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.
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* @(#) $Revision: 30.2 $
|
||||
* @(#) $Id: have_stdvs.c,v 30.2 2013/08/11 08:41:38 chongo Exp $
|
||||
* @(#) $Revision: 30.4 $
|
||||
* @(#) $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 $
|
||||
*
|
||||
* Under source code control: 1995/09/09 22:41:10
|
||||
@@ -56,6 +56,11 @@
|
||||
# include <string.h>
|
||||
#endif
|
||||
|
||||
#include "have_stdlib.h"
|
||||
#ifdef HAVE_STDLIB_H
|
||||
# include <stdlib.h>
|
||||
#endif
|
||||
|
||||
#undef VSPRINTF_SIZE_T
|
||||
#if defined(FORCE_STDC) || (defined(__STDC__) && __STDC__ != 0) || \
|
||||
defined(__cplusplus)
|
||||
@@ -87,7 +92,7 @@ try_nthis(char *fmt, VSPRINTF_SIZE_T size, ...)
|
||||
{
|
||||
va_list ap;
|
||||
|
||||
va_start(ap, fmt);
|
||||
va_start(ap, size);
|
||||
#if !defined(DONT_HAVE_VSPRINTF)
|
||||
vsnprintf(buf, size, fmt, ap);
|
||||
#else
|
||||
|
8
help.c
8
help.c
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* 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
|
||||
* the terms of the version 2.1 of the GNU Lesser General Public License
|
||||
@@ -17,9 +17,9 @@
|
||||
* received a copy with calc; if not, write to Free Software Foundation, Inc.
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* @(#) $Revision: 30.3 $
|
||||
* @(#) $Id: help.c,v 30.3 2013/08/11 01:08:32 chongo Exp $
|
||||
* @(#) $Source: /usr/local/src/cmd/calc/RCS/help.c,v $
|
||||
* @(#) $Revision: 30.4 $
|
||||
* @(#) $Id: help.c,v 30.4 2014/08/24 21:57:31 chongo Exp $
|
||||
* @(#) $Source: /usr/local/src/bin/calc/RCS/help.c,v $
|
||||
*
|
||||
* Under source code control: 1997/09/14 10:58:30
|
||||
* File existed as early as: 1997
|
||||
|
@@ -18,8 +18,8 @@
|
||||
# received a copy with calc; if not, write to Free Software Foundation, Inc.
|
||||
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
#
|
||||
# @(#) $Revision: 30.9 $
|
||||
# @(#) $Id: Makefile,v 30.9 2013/09/02 02:55:19 chongo Exp $
|
||||
# @(#) $Revision: 30.10 $
|
||||
# @(#) $Id: Makefile,v 30.10 2014/09/02 07:15:58 chongo Exp $
|
||||
# @(#) $Source: /usr/local/src/bin/calc/help/RCS/Makefile,v $
|
||||
#
|
||||
# Under source code control: 1991/07/23 06:47:57
|
||||
@@ -705,8 +705,8 @@ clobber: clean
|
||||
#
|
||||
install: all
|
||||
-${Q} if [ ! -d ${T}${CALC_SHAREDIR} ]; then \
|
||||
echo ${MKDIR} ${T}${CALC_SHAREDIR}; \
|
||||
${MKDIR} ${T}${CALC_SHAREDIR}; \
|
||||
echo ${MKDIR} -p ${T}${CALC_SHAREDIR}; \
|
||||
${MKDIR} -p ${T}${CALC_SHAREDIR}; \
|
||||
if [ ! -d "${T}${CALC_SHAREDIR}" ]; then \
|
||||
echo ${MKDIR} -p "${T}${CALC_SHAREDIR}"; \
|
||||
${MKDIR} -p "${T}${CALC_SHAREDIR}"; \
|
||||
@@ -717,8 +717,8 @@ install: all
|
||||
${TRUE}; \
|
||||
fi
|
||||
-${Q} if [ ! -d ${T}${HELPDIR} ]; then \
|
||||
echo ${MKDIR} ${T}${HELPDIR}; \
|
||||
${MKDIR} ${T}${HELPDIR}; \
|
||||
echo ${MKDIR} -p ${T}${HELPDIR}; \
|
||||
${MKDIR} -p ${T}${HELPDIR}; \
|
||||
if [ ! -d "${T}${HELPDIR}" ]; then \
|
||||
echo ${MKDIR} -p "${T}${HELPDIR}"; \
|
||||
${MKDIR} -p "${T}${HELPDIR}"; \
|
||||
|
10
help/pound
10
help/pound
@@ -2,7 +2,7 @@ NAME
|
||||
#
|
||||
|
||||
SYNOPSIS
|
||||
#!/usr/local/src/cmd/calc/calc -q -f
|
||||
#!/usr/local/src/bin/calc/calc -q -f
|
||||
# x
|
||||
x # y
|
||||
## comment
|
||||
@@ -52,7 +52,7 @@ DESCRIPTION
|
||||
|
||||
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 */
|
||||
/* The 1st line must end with -f */
|
||||
## Single # shell comments don't work, use two or more
|
||||
@@ -100,7 +100,7 @@ LINK LIBRARY
|
||||
SEE ALSO
|
||||
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
|
||||
## 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.
|
||||
## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
##
|
||||
## @(#) $Revision: 30.1 $
|
||||
## @(#) $Id: pound,v 30.1 2007/03/16 11:10:42 chongo Exp $
|
||||
## @(#) $Revision: 30.4 $
|
||||
## @(#) $Id: pound,v 30.4 2014/08/24 21:59:45 chongo Exp $
|
||||
## @(#) $Source: /usr/local/src/bin/calc/help/RCS/pound,v $
|
||||
##
|
||||
## Under source code control: 2007/02/06 14:09
|
||||
|
@@ -149,7 +149,7 @@ Calc shell scripts
|
||||
#!/usr/bin/calc -q -s -f
|
||||
global i, n, s;
|
||||
n = argv();
|
||||
for (i = 1; i <= n; i++)
|
||||
for (i = 1; i < n; i++)
|
||||
s += eval(argv(i));
|
||||
print "sum =", s;
|
||||
|
||||
@@ -273,7 +273,7 @@ For more information use the following calc commands:
|
||||
help config
|
||||
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
|
||||
## 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.
|
||||
## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
##
|
||||
## @(#) $Revision: 30.1 $
|
||||
## @(#) $Id: script,v 30.1 2007/03/16 11:10:42 chongo Exp $
|
||||
## @(#) $Revision: 30.2 $
|
||||
## @(#) $Id: script,v 30.2 2014/08/24 22:38:56 chongo Exp $
|
||||
## @(#) $Source: /usr/local/src/bin/calc/help/RCS/script,v $
|
||||
##
|
||||
## Under source code control: 1999/11/30 05:29:48
|
||||
|
@@ -277,7 +277,7 @@ Unexpected
|
||||
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.
|
||||
|
||||
#!/usr/local/src/cmd/calc/calc -q -f
|
||||
#!/usr/local/src/bin/calc/calc -q -f
|
||||
|
||||
/* a correct comment */
|
||||
## another correct comment
|
||||
@@ -289,7 +289,7 @@ Unexpected
|
||||
|
||||
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 #
|
||||
# You must to start comments with ## or /*
|
||||
@@ -404,7 +404,7 @@ Unexpected
|
||||
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
|
||||
## 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.
|
||||
## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
##
|
||||
## @(#) $Revision: 30.4 $
|
||||
## @(#) $Id: unexpected,v 30.4 2008/05/10 13:18:09 chongo Exp $
|
||||
## @(#) $Revision: 30.6 $
|
||||
## @(#) $Id: unexpected,v 30.6 2014/08/24 21:59:45 chongo Exp $
|
||||
## @(#) $Source: /usr/local/src/bin/calc/help/RCS/unexpected,v $
|
||||
##
|
||||
## Under source code control: 1997/03/21 13:15:18
|
||||
|
112
hist.c
112
hist.c
@@ -17,8 +17,8 @@
|
||||
* received a copy with calc; if not, write to Free Software Foundation, Inc.
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* @(#) $Revision: 30.1 $
|
||||
* @(#) $Id: hist.c,v 30.1 2007/03/16 11:09:46 chongo Exp $
|
||||
* @(#) $Revision: 30.2 $
|
||||
* @(#) $Id: hist.c,v 30.2 2014/08/24 23:57:57 chongo Exp $
|
||||
* @(#) $Source: /usr/local/src/bin/calc/RCS/hist.c,v $
|
||||
*
|
||||
* Under source code control: 1993/05/02 20:09:19
|
||||
@@ -88,7 +88,7 @@ STATIC struct {
|
||||
char *mark;
|
||||
int bufsize;
|
||||
int linelen;
|
||||
int histcount;
|
||||
int histcount; /* valid history entries */
|
||||
int curhist;
|
||||
BOOL virgin_line; /* 1 => never typed chars, 0 => chars typed */
|
||||
} HS;
|
||||
@@ -199,29 +199,22 @@ STATIC KEY_MAP maps[] = {
|
||||
{esc_map_name, {NULL, NULL}, {NULL, NULL}},
|
||||
};
|
||||
|
||||
|
||||
#define INTROUND (sizeof(int) - 1)
|
||||
#define HISTLEN(hp) ((((hp)->len + INTROUND) & ~INTROUND) + sizeof(int))
|
||||
#define HISTOFFSET(hp) (((char *) (hp)) - histbuf)
|
||||
#define FIRSTHIST ((HIST *) histbuf)
|
||||
#define NEXTHIST(hp) ((HIST *) (((char *) (hp)) + HISTLEN(hp)))
|
||||
|
||||
|
||||
typedef struct {
|
||||
int len; /* length of data */
|
||||
char data[1]; /* varying length data */
|
||||
typedef struct history_entry {
|
||||
int len; /* length of data */
|
||||
char *data; /* varying length data */
|
||||
struct history_entry* prev;
|
||||
struct history_entry* next;
|
||||
} HIST;
|
||||
|
||||
|
||||
STATIC int inited;
|
||||
STATIC int canedit;
|
||||
STATIC int histused;
|
||||
STATIC int key_count;
|
||||
STATIC int save_len;
|
||||
STATIC KEY_MAP *cur_map;
|
||||
STATIC KEY_MAP *base_map;
|
||||
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];
|
||||
|
||||
/* declare other static functions */
|
||||
@@ -399,6 +392,19 @@ hist_term(void)
|
||||
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
|
||||
*/
|
||||
@@ -656,14 +662,18 @@ read_key(void)
|
||||
S_FUNC HIST *
|
||||
get_event(int n)
|
||||
{
|
||||
register HIST * hp;
|
||||
register HIST * hp = hist_first;
|
||||
int i = 0;
|
||||
|
||||
if ((n < 0) || (n >= HS.histcount))
|
||||
return NULL;
|
||||
hp = FIRSTHIST;
|
||||
while (n-- > 0)
|
||||
hp = NEXTHIST(hp);
|
||||
return hp;
|
||||
do {
|
||||
if(!hp)
|
||||
break;
|
||||
if(i == n)
|
||||
return hp;
|
||||
++i;
|
||||
hp = hp->next;
|
||||
} while(hp);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
@@ -674,11 +684,11 @@ get_event(int n)
|
||||
S_FUNC HIST *
|
||||
find_event(char *pat, int len)
|
||||
{
|
||||
register HIST * hp;
|
||||
register HIST * hp = hist_first;
|
||||
|
||||
for (hp = FIRSTHIST; hp->len; hp = NEXTHIST(hp)) {
|
||||
if ((hp->len == len) && (memcmp(hp->data, pat, len) == 0))
|
||||
return hp;
|
||||
for(hp = hist_first; hp != NULL; hp = hp->next) {
|
||||
if ((hp->len == len) && (memcmp(hp->data, pat, len) == 0))
|
||||
return hp;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
@@ -694,8 +704,6 @@ void
|
||||
hist_saveline(char *line, int len)
|
||||
{
|
||||
HIST * hp;
|
||||
HIST * hp2;
|
||||
int left;
|
||||
|
||||
if ((len > 0) && (line[len - 1] == '\n'))
|
||||
len--;
|
||||
@@ -709,13 +717,17 @@ hist_saveline(char *line, int len)
|
||||
*/
|
||||
hp = find_event(line, len);
|
||||
if (hp) {
|
||||
hp2 = NEXTHIST(hp);
|
||||
left = histused - HISTOFFSET(hp2);
|
||||
if (left <= 0)
|
||||
if (hp == hist_last)
|
||||
return;
|
||||
histused -= HISTLEN(hp);
|
||||
memcpy(hp, hp2, left + 1);
|
||||
HS.histcount--;
|
||||
if (hp->prev)
|
||||
hp->prev->next = hp->next;
|
||||
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
|
||||
* as many times as necessary in order to make enough room.
|
||||
*/
|
||||
while ((histused + len) >= HIST_SIZE) {
|
||||
hp = (HIST *) histbuf;
|
||||
hp2 = NEXTHIST(hp);
|
||||
left = histused - HISTOFFSET(hp2);
|
||||
histused -= HISTLEN(hp);
|
||||
memcpy(hp, hp2, left + 1);
|
||||
if (HS.histcount >= HIST_SIZE) {
|
||||
HIST *new_first = hist_first->next;
|
||||
free(hist_first->data);
|
||||
free(hist_first);
|
||||
new_first->prev = NULL;
|
||||
hist_first = new_first;
|
||||
HS.histcount--;
|
||||
}
|
||||
|
||||
/*
|
||||
* 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->data = malloc(len);
|
||||
memcpy(hp->data, line, len);
|
||||
histused += HISTLEN(hp);
|
||||
histbuf[histused] = 0;
|
||||
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
12
hist.h
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* 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
|
||||
* 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.
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* @(#) $Revision: 30.1 $
|
||||
* @(#) $Id: hist.h,v 30.1 2007/03/16 11:09:46 chongo Exp $
|
||||
* @(#) $Revision: 30.3 $
|
||||
* @(#) $Id: hist.h,v 30.3 2014/08/24 21:56:51 chongo Exp $
|
||||
* @(#) $Source: /usr/local/src/bin/calc/RCS/hist.h,v $
|
||||
*
|
||||
* Under source code control: 1993/05/02 20:09:20
|
||||
@@ -28,8 +28,8 @@
|
||||
*/
|
||||
|
||||
|
||||
#if !defined(__HIST_H__)
|
||||
#define __HIST_H__
|
||||
#if !defined(INCLUDE_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);
|
||||
|
||||
|
||||
#endif /* !__HIST_H__ */
|
||||
#endif /* !INCLUDE_HIST_H */
|
||||
|
22
input.c
22
input.c
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* 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
|
||||
* 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.
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* @(#) $Revision: 30.3 $
|
||||
* @(#) $Id: input.c,v 30.3 2013/08/11 08:41:38 chongo Exp $
|
||||
* @(#) $Revision: 30.6 $
|
||||
* @(#) $Id: input.c,v 30.6 2014/08/31 14:54:50 chongo Exp $
|
||||
* @(#) $Source: /usr/local/src/bin/calc/RCS/input.c,v $
|
||||
*
|
||||
* Under source code control: 1990/02/15 01:48:16
|
||||
@@ -51,7 +51,7 @@
|
||||
#if defined(__MSDOS__)
|
||||
#include <limits.h>
|
||||
#define _fullpath(f,n,s) (_fixpath(n,f),f)
|
||||
#define _MAX_PATH PATH_MAX
|
||||
#define MSDOS_MAX_PATH PATH_MAX
|
||||
#endif
|
||||
|
||||
#include "calc.h"
|
||||
@@ -815,6 +815,7 @@ ttychar(void)
|
||||
*/
|
||||
if (charbuf[0] == '!') { /* do a shell command */
|
||||
char *cmd;
|
||||
int ret;
|
||||
|
||||
cmd = charbuf + 1;
|
||||
if (*cmd == '\0' || *cmd == '\n')
|
||||
@@ -823,7 +824,10 @@ ttychar(void)
|
||||
if (conf->calc_debug & CALCDBG_SYSTEM) {
|
||||
printf("%s\n", cmd);
|
||||
}
|
||||
system(cmd);
|
||||
ret = system(cmd);
|
||||
if (ret < 0) {
|
||||
fprintf(stderr, "error in cmd: %s\n", cmd);
|
||||
}
|
||||
} else {
|
||||
fprintf(stderr, "execution disallowed by -m flag\n");
|
||||
}
|
||||
@@ -977,9 +981,9 @@ isinoderead(struct stat *sbuf)
|
||||
/* scan the entire readset */
|
||||
for (i=0; i < maxreadset; ++i) {
|
||||
#if defined(_WIN32) || defined(__MSDOS__)
|
||||
char tmp[_MAX_PATH+1];
|
||||
tmp[_MAX_PATH] = '\0';
|
||||
if (_fullpath(tmp, cip->i_name, _MAX_PATH) &&
|
||||
char tmp[MSDOS_MAX_PATH+1];
|
||||
tmp[MSDOS_MAX_PATH] = '\0';
|
||||
if (_fullpath(tmp, cip->i_name, MSDOS_MAX_PATH) &&
|
||||
readset[i].active &&
|
||||
strcasecmp(readset[i].path, tmp) == 0) {
|
||||
/* found a match */
|
||||
@@ -1110,7 +1114,7 @@ addreadset(char *name, char *path, struct stat *sbuf)
|
||||
* 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) {
|
||||
return -1;
|
||||
}
|
||||
|
12
jump.h
12
jump.h
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* 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
|
||||
* 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.
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* @(#) $Revision: 30.1 $
|
||||
* @(#) $Id: jump.h,v 30.1 2007/03/16 11:09:46 chongo Exp $
|
||||
* @(#) $Revision: 30.3 $
|
||||
* @(#) $Id: jump.h,v 30.3 2014/08/24 21:56:51 chongo Exp $
|
||||
* @(#) $Source: /usr/local/src/bin/calc/RCS/jump.h,v $
|
||||
*
|
||||
* Under source code control: 1994/06/29 04:03:55
|
||||
@@ -62,8 +62,8 @@
|
||||
*/
|
||||
|
||||
|
||||
#if !defined(__JUMP_H__)
|
||||
#define __JUMP_H__
|
||||
#if !defined(INCLUDE_JUMP_H)
|
||||
#define INCLUDE_JUMP_H
|
||||
|
||||
|
||||
#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 *CONST lastjmp;
|
||||
|
||||
#endif /* !__JUMP_H__ */
|
||||
#endif /* !INCLUDE_JUMP_H */
|
||||
|
12
label.h
12
label.h
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* 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
|
||||
* 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.
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* @(#) $Revision: 30.1 $
|
||||
* @(#) $Id: label.h,v 30.1 2007/03/16 11:09:46 chongo Exp $
|
||||
* @(#) $Revision: 30.3 $
|
||||
* @(#) $Id: label.h,v 30.3 2014/08/24 21:56:51 chongo Exp $
|
||||
* @(#) $Source: /usr/local/src/bin/calc/RCS/label.h,v $
|
||||
*
|
||||
* Under source code control: 1990/02/15 01:48:33
|
||||
@@ -28,8 +28,8 @@
|
||||
*/
|
||||
|
||||
|
||||
#if !defined(__LABEL_H__)
|
||||
#define __LABEL_H__
|
||||
#if !defined(INCLUDE_LABEL_H)
|
||||
#define INCLUDE_LABEL_H
|
||||
|
||||
|
||||
#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);
|
||||
|
||||
|
||||
#endif /* !__LABEL_H__ */
|
||||
#endif /* !INCLUDE_LABEL_H */
|
||||
|
12
lib_calc.h
12
lib_calc.h
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* 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
|
||||
* 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.
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* @(#) $Revision: 30.1 $
|
||||
* @(#) $Id: lib_calc.h,v 30.1 2007/03/16 11:09:46 chongo Exp $
|
||||
* @(#) $Revision: 30.3 $
|
||||
* @(#) $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 $
|
||||
*
|
||||
* Under source code control: 1997/03/23 18:37:10
|
||||
@@ -29,8 +29,8 @@
|
||||
*/
|
||||
|
||||
|
||||
#if !defined(__MATH_ERROR_H__)
|
||||
#define __MATH_ERROR_H__
|
||||
#if !defined(INCLUDE_MATH_ERROR_H)
|
||||
#define INCLUDE_MATH_ERROR_H
|
||||
|
||||
#include <setjmp.h>
|
||||
|
||||
@@ -78,4 +78,4 @@ EXTERN int calc_print_scanwarn_msg;
|
||||
/* number of parse/scan warnings found */
|
||||
EXTERN unsigned long calc_warn_cnt;
|
||||
|
||||
#endif /* !__MATH_ERROR_H__ */
|
||||
#endif /* !INCLUDE_MATH_ERROR_H */
|
||||
|
12
lib_util.h
12
lib_util.h
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* 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
|
||||
* 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.
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* @(#) $Revision: 30.1 $
|
||||
* @(#) $Id: lib_util.h,v 30.1 2007/03/16 11:09:46 chongo Exp $
|
||||
* @(#) $Revision: 30.3 $
|
||||
* @(#) $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 $
|
||||
*
|
||||
* Under source code control: 1997/04/19 21:38:30
|
||||
@@ -34,8 +34,8 @@
|
||||
*/
|
||||
|
||||
|
||||
#if !defined(__LIB_UTIL_H__)
|
||||
#define __LIB_UTIL_H__
|
||||
#if !defined(INCLUDE_LIB_UTIL_H)
|
||||
#define INCLUDE_LIB_UTIL_H
|
||||
|
||||
/* external functions in lib_util.c */
|
||||
EXTERN int lowhex2bin[256];
|
||||
@@ -44,4 +44,4 @@ E_FUNC ZVALUE convstr2z(char*);
|
||||
E_FUNC ZVALUE convhex2z(char *hex);
|
||||
E_FUNC char *convz2hex(ZVALUE z);
|
||||
|
||||
#endif /* __LIB_UTIL_H__ */
|
||||
#endif /* INCLUDE_LIB_UTIL_H */
|
||||
|
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* 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
|
||||
* 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.
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* @(#) $Revision: 30.2 $
|
||||
* @(#) $Id: longbits.c,v 30.2 2013/08/11 08:41:38 chongo Exp $
|
||||
* @(#) $Revision: 30.3 $
|
||||
* @(#) $Id: longbits.c,v 30.3 2014/08/24 21:57:31 chongo Exp $
|
||||
* @(#) $Source: /usr/local/src/bin/calc/RCS/longbits.c,v $
|
||||
*
|
||||
* Under source code control: 1994/03/18 03:06:18
|
||||
|
12
nametype.h
12
nametype.h
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* 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
|
||||
* 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.
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* @(#) $Revision: 30.1 $
|
||||
* @(#) $Id: nametype.h,v 30.1 2007/03/16 11:09:46 chongo Exp $
|
||||
* @(#) $Revision: 30.3 $
|
||||
* @(#) $Id: nametype.h,v 30.3 2014/08/24 21:56:51 chongo Exp $
|
||||
* @(#) $Source: /usr/local/src/bin/calc/RCS/nametype.h,v $
|
||||
*
|
||||
* Under source code control: 1997/03/08 13:44:55
|
||||
@@ -29,8 +29,8 @@
|
||||
*/
|
||||
|
||||
|
||||
#if !defined(__NAMETYPE_H__)
|
||||
#define __NAMETYPE_H__
|
||||
#if !defined(INCLUDE_NAMETYPE_H)
|
||||
#define INCLUDE_NAMETYPE_H
|
||||
|
||||
|
||||
/*
|
||||
@@ -42,4 +42,4 @@ typedef struct {
|
||||
} NAMETYPE;
|
||||
|
||||
|
||||
#endif /* !__NAMETYPE_H__ */
|
||||
#endif /* !INCLUDE_NAMETYPE_H */
|
||||
|
@@ -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;
|
||||
}
|
@@ -19,8 +19,8 @@
|
||||
* received a copy with calc; if not, write to Free Software Foundation, Inc.
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* @(#) $Revision: 30.5 $
|
||||
* @(#) $Id: opcodes.c,v 30.5 2013/08/11 08:41:38 chongo Exp $
|
||||
* @(#) $Revision: 30.6 $
|
||||
* @(#) $Id: opcodes.c,v 30.6 2014/08/31 14:54:50 chongo Exp $
|
||||
* @(#) $Source: /usr/local/src/bin/calc/RCS/opcodes.c,v $
|
||||
*
|
||||
* 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) */
|
||||
/* ignore Saber-C warning #68 - benign type mismatch */
|
||||
/* 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;
|
||||
break;
|
||||
|
||||
|
12
opcodes.h
12
opcodes.h
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* 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
|
||||
* 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.
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* @(#) $Revision: 30.1 $
|
||||
* @(#) $Id: opcodes.h,v 30.1 2007/03/16 11:09:46 chongo Exp $
|
||||
* @(#) $Revision: 30.3 $
|
||||
* @(#) $Id: opcodes.h,v 30.3 2014/08/24 21:56:51 chongo Exp $
|
||||
* @(#) $Source: /usr/local/src/bin/calc/RCS/opcodes.h,v $
|
||||
*
|
||||
* Under source code control: 1990/02/15 01:48:35
|
||||
@@ -28,8 +28,8 @@
|
||||
*/
|
||||
|
||||
|
||||
#if !defined(__OPCODES_H__)
|
||||
#define __OPCODES_H__
|
||||
#if !defined(INCLUDE_OPCODES_H)
|
||||
#define INCLUDE_OPCODES_H
|
||||
|
||||
|
||||
#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 */
|
||||
|
||||
|
||||
#endif /* !__OPCODES_H__ */
|
||||
#endif /* !INCLUDE_OPCODES_H */
|
||||
|
12
prime.h
12
prime.h
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* 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
|
||||
* 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.
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* @(#) $Revision: 30.1 $
|
||||
* @(#) $Id: prime.h,v 30.1 2007/03/16 11:09:46 chongo Exp $
|
||||
* @(#) $Revision: 30.3 $
|
||||
* @(#) $Id: prime.h,v 30.3 2014/08/24 21:56:51 chongo Exp $
|
||||
* @(#) $Source: /usr/local/src/bin/calc/RCS/prime.h,v $
|
||||
*
|
||||
* Under source code control: 1994/06/04 03:26:15
|
||||
@@ -29,8 +29,8 @@
|
||||
*/
|
||||
|
||||
|
||||
#if !defined(__PRIME_H__)
|
||||
#define __PRIME_H__
|
||||
#if !defined(INCLUDE_PRIME_H)
|
||||
#define INCLUDE_PRIME_H
|
||||
|
||||
|
||||
#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 */
|
||||
|
||||
|
||||
#endif /* !__PRIME_H__ */
|
||||
#endif /* !INCLUDE_PRIME_H */
|
||||
|
8
qmath.c
8
qmath.c
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* 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
|
||||
*
|
||||
@@ -19,8 +19,8 @@
|
||||
* received a copy with calc; if not, write to Free Software Foundation, Inc.
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* @(#) $Revision: 30.2 $
|
||||
* @(#) $Id: qmath.c,v 30.2 2013/08/11 08:41:38 chongo Exp $
|
||||
* @(#) $Revision: 30.4 $
|
||||
* @(#) $Id: qmath.c,v 30.4 2014/08/24 21:56:51 chongo Exp $
|
||||
* @(#) $Source: /usr/local/src/bin/calc/RCS/qmath.c,v $
|
||||
*
|
||||
* Under source code control: 1990/02/15 01:48:21
|
||||
@@ -1312,7 +1312,7 @@ qcmp(NUMBER *q1, NUMBER *q2)
|
||||
if (q1 == q2)
|
||||
return FALSE;
|
||||
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))
|
||||
return TRUE;
|
||||
if (zcmp(q1->num, q2->num))
|
||||
|
12
qmath.h
12
qmath.h
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* 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
|
||||
* 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.
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* @(#) $Revision: 30.4 $
|
||||
* @(#) $Id: qmath.h,v 30.4 2013/09/01 22:16:21 chongo Exp $
|
||||
* @(#) $Revision: 30.6 $
|
||||
* @(#) $Id: qmath.h,v 30.6 2014/08/24 21:56:51 chongo Exp $
|
||||
* @(#) $Source: /usr/local/src/bin/calc/RCS/qmath.h,v $
|
||||
*
|
||||
* Under source code control: 1993/07/30 19:42:47
|
||||
@@ -28,8 +28,8 @@
|
||||
*/
|
||||
|
||||
|
||||
#if !defined(__QMATH_H__)
|
||||
#define __QMATH_H__
|
||||
#if !defined(INCLUDE_QMATH_H)
|
||||
#define INCLUDE_QMATH_H
|
||||
|
||||
|
||||
#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[];
|
||||
|
||||
|
||||
#endif /* !__QMATH_H__ */
|
||||
#endif /* !INCLUDE_QMATH_H */
|
||||
|
56
rpm.mk
56
rpm.mk
@@ -3,7 +3,7 @@
|
||||
#
|
||||
# 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
|
||||
# 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.
|
||||
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
#
|
||||
MAKEFILE_REV= $$Revision: 30.11 $$
|
||||
# @(#) $Id: rpm.mk,v 30.11 2013/08/11 08:41:38 chongo Exp $
|
||||
MAKEFILE_REV= $$Revision: 30.15 $$
|
||||
# @(#) $Id: rpm.mk,v 30.15 2014/09/08 00:04:13 chongo Exp $
|
||||
# @(#) $Source: /usr/local/src/bin/calc/RCS/rpm.mk,v $
|
||||
#
|
||||
# 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
|
||||
# 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
|
||||
# %_gpg_path ~/.gnupg
|
||||
# %_gpg_name __YOUR_NAME_HERE__
|
||||
# %_gpgbin /usr/bin/gpg
|
||||
# %_topdir %(echo $HOME)/rpm/%{name}
|
||||
# %_sourcedir %(echo $HOME)/rpm/%{name}/SOURCES
|
||||
# %_specdir %(echo $HOME)/rpm/%{name}/SPECS
|
||||
# %_tmppath %(echo $HOME)/rpm/%{name}/tmp
|
||||
# %_builddir %(echo $HOME)/rpm/%{name}/BUILD
|
||||
# %_buildroot %(echo $HOME)/rpm/%{name}/tmp/build-root
|
||||
# %_rpmdir %(echo $HOME)/rpm/%{name}/RPMS
|
||||
# %_srcrpmdir %(echo $HOME)/rpm/%{name}/SRPMS
|
||||
# %_rpmfilename %%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm
|
||||
# %packager __YOUR_NAME_HERE__
|
||||
# %vendor __YOUR_ORG_OR_GROUP_OR_COMPANY_HERE__
|
||||
|
||||
# IMPORTANT NOTE: Unless the package redhat-rpm-config is installed,
|
||||
# the calc-debuginfo rpm will not be created.
|
||||
@@ -68,8 +69,8 @@ MAKEFILE_REV= $$Revision: 30.11 $$
|
||||
#
|
||||
SHELL= /bin/sh
|
||||
RPMBUILD_TOOL= rpmbuild
|
||||
TARCH= i686
|
||||
RPMBUILD_OPTION= -ba --target=$(TARCH)
|
||||
TARCH= x86_64
|
||||
RPMBUILD_OPTION= -ba --target=$(TARCH) --buildroot=${RPM_BUILD_ROOT}
|
||||
RPM_TOOL= rpm
|
||||
SED= sed
|
||||
FIND= find
|
||||
@@ -95,11 +96,13 @@ PROJECT_RELEASE=
|
||||
PROJECT= ${PROJECT_NAME}-${PROJECT_VERSION}
|
||||
SPECFILE= ${PROJECT_NAME}.spec
|
||||
TARBALL= ${PROJECT}.${TAR}.bz2
|
||||
RPM686= ${PROJECT}-${PROJECT_RELEASE}.${TARCH}.rpm
|
||||
DRPM686= \
|
||||
RPMx86_64= ${PROJECT}-${PROJECT_RELEASE}.${TARCH}.rpm
|
||||
DRPMx86_64= \
|
||||
${PROJECT_NAME}-devel-${PROJECT_VERSION}-${PROJECT_RELEASE}.${TARCH}.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
|
||||
|
||||
# Makefile debug
|
||||
@@ -149,6 +152,7 @@ calc.spec: calc.spec.in ver_calc
|
||||
srcpkg: make_rhdir
|
||||
${V} echo '=-=-=-=-= rpm.mk start of $@ rule =-=-=-=-='
|
||||
${V} echo RPM_TOP="${RPM_TOP}"
|
||||
${V} echo RPM_BUILD_ROOT="${RPM_BUILD_ROOT}"
|
||||
${V} echo PROJECT_VERSION="${PROJECT_VERSION}"
|
||||
${V} echo PROJECT_RELEASE="${PROJECT_RELEASE}"
|
||||
${RM} -rf "$(TMPDIR)/$(PROJECT)"
|
||||
@@ -171,12 +175,13 @@ srcpkg: make_rhdir
|
||||
rpm: srcpkg calc.spec
|
||||
${V} echo '=-=-=-=-= rpm.mk start of $@ rule =-=-=-=-='
|
||||
${V} echo RPM_TOP="${RPM_TOP}"
|
||||
${V} echo RPM_BUILD_ROOT="${RPM_BUILD_ROOT}"
|
||||
${V} echo PROJECT_VERSION="${PROJECT_VERSION}"
|
||||
${V} echo PROJECT_RELEASE="${PROJECT_RELEASE}"
|
||||
$(MAKE) -f Makefile clean
|
||||
${CP} "$(SPECFILE)" "$(RPM_TOP)/SPECS/$(SPECFILE)"
|
||||
${RM} -f "$(RPM_TOP)/RPMS/$(TARCH)/$(RPM686)"
|
||||
${RM} -f "$(RPM_TOP)/RPMS/$(TARCH)/$(DRPM686)"
|
||||
${RM} -f "$(RPM_TOP)/RPMS/$(TARCH)/$(RPMx86_64)"
|
||||
${RM} -f "$(RPM_TOP)/RPMS/$(TARCH)/$(DRPMx86_64)"
|
||||
${RM} -f "$(RPM_TOP)/SRPMS/$(SRPM)"
|
||||
${RPMBUILD_TOOL} ${RPMBUILD_OPTION} "$(RPM_TOP)/SPECS/$(SPECFILE)"
|
||||
@if [ ! -f "$(RPM_TOP)/SRPMS/$(SRPM)" ]; then \
|
||||
@@ -190,6 +195,7 @@ rpm: srcpkg calc.spec
|
||||
make_rhdir:
|
||||
${V} echo '=-=-=-=-= rpm.mk start of $@ rule =-=-=-=-='
|
||||
${V} echo RPM_TOP="${RPM_TOP}"
|
||||
${V} echo RPM_BUILD_ROOT="${RPM_BUILD_ROOT}"
|
||||
${V} echo PROJECT_VERSION="${PROJECT_VERSION}"
|
||||
${V} echo PROJECT_RELEASE="${PROJECT_RELEASE}"
|
||||
for subdir in "" BUILD RPMS SOURCES SPECS SRPMS tmp; do \
|
||||
@@ -243,8 +249,8 @@ logdate:
|
||||
.PHONY: chkpkg
|
||||
chkpkg:
|
||||
${V} echo '=-=-=-=-= rpm.mk start of $@ rule =-=-=-=-='
|
||||
for i in "$(RPM_TOP)/RPMS/$(TARCH)/$(RPM686)" \
|
||||
"$(RPM_TOP)/RPMS/$(TARCH)/$(DRPM686)" \
|
||||
for i in "$(RPM_TOP)/RPMS/$(TARCH)/$(RPMx86_64)" \
|
||||
"$(RPM_TOP)/RPMS/$(TARCH)/$(DRPMx86_64)" \
|
||||
"$(RPM_TOP)/SRPMS/$(SRPM)" ; do \
|
||||
echo "***** start $$i" ; \
|
||||
${RPM_TOOL} -qpi "$$"i ; \
|
||||
@@ -278,8 +284,8 @@ installrpm:
|
||||
echo "must be root to install RPMs" 1>&2; \
|
||||
exit 7; \
|
||||
fi
|
||||
${RPM_TOOL} -ivh "$(RPM_TOP)/RPMS/$(TARCH)/$(RPM686)"
|
||||
${RPM_TOOL} -ivh "$(RPM_TOP)/RPMS/$(TARCH)/$(DRPM686)"
|
||||
${RPM_TOOL} -ivh "$(RPM_TOP)/RPMS/$(TARCH)/$(RPMx86_64)"
|
||||
${RPM_TOOL} -ivh "$(RPM_TOP)/RPMS/$(TARCH)/$(DRPMx86_64)"
|
||||
${V} echo '=-=-=-=-= rpm.mk end of $@ rule =-=-=-=-='
|
||||
|
||||
.PHONY: uninstallrpm
|
||||
|
2
sha1.c
2
sha1.c
@@ -24,7 +24,7 @@
|
||||
*
|
||||
* @(#) $Revision: 30.4 $
|
||||
* @(#) $Id: sha1.c,v 30.4 2013/08/11 01:08:32 chongo Exp $
|
||||
* @(#) $Source: /usr/local/src/cmd/calc/RCS/sha1.c,v $
|
||||
* @(#) $Source: /usr/local/src/bin/calc/RCS/sha1.c,v $
|
||||
*
|
||||
* This file is not covered under version 2.1 of the GNU LGPL.
|
||||
*/
|
||||
|
10
sha1.h
10
sha1.h
@@ -22,16 +22,16 @@
|
||||
* NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
|
||||
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*
|
||||
* @(#) $Revision: 30.3 $
|
||||
* @(#) $Id: sha1.h,v 30.3 2007/07/05 17:37:41 chongo Exp $
|
||||
* @(#) $Revision: 30.4 $
|
||||
* @(#) $Id: sha1.h,v 30.4 2014/09/02 06:37:39 chongo Exp $
|
||||
* @(#) $Source: /usr/local/src/bin/calc/RCS/sha1.h,v $
|
||||
*
|
||||
* This file is not covered under version 2.1 of the GNU LGPL.
|
||||
*/
|
||||
|
||||
|
||||
#if !defined(__SHA1_H__)
|
||||
#define __SHA1_H__
|
||||
#if !defined(INCLUDE_SHA1_H)
|
||||
#define INCLUDE_SHA1_H
|
||||
|
||||
|
||||
/* 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
12
str.h
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* 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
|
||||
* 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.
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* @(#) $Revision: 30.1 $
|
||||
* @(#) $Id: str.h,v 30.1 2007/03/16 11:09:46 chongo Exp $
|
||||
* @(#) $Revision: 30.3 $
|
||||
* @(#) $Id: str.h,v 30.3 2014/08/24 21:56:51 chongo Exp $
|
||||
* @(#) $Source: /usr/local/src/bin/calc/RCS/str.h,v $
|
||||
*
|
||||
* Under source code control: 1990/02/15 01:48:36
|
||||
@@ -28,8 +28,8 @@
|
||||
*/
|
||||
|
||||
|
||||
#if !defined(__CALCSTRING_H__)
|
||||
#define __CALCSTRING_H__
|
||||
#if !defined(INCLUDE_CALCSTRING_H)
|
||||
#define INCLUDE_CALCSTRING_H
|
||||
|
||||
|
||||
#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_;
|
||||
|
||||
|
||||
#endif /* !__CALCSTRING_H__ */
|
||||
#endif /* !INCLUDE_CALCSTRING_H */
|
||||
|
12
symbol.h
12
symbol.h
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* 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
|
||||
* 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.
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* @(#) $Revision: 30.1 $
|
||||
* @(#) $Id: symbol.h,v 30.1 2007/03/16 11:09:46 chongo Exp $
|
||||
* @(#) $Revision: 30.3 $
|
||||
* @(#) $Id: symbol.h,v 30.3 2014/08/24 21:56:51 chongo Exp $
|
||||
* @(#) $Source: /usr/local/src/bin/calc/RCS/symbol.h,v $
|
||||
*
|
||||
* Under source code control: 1990/02/15 01:48:37
|
||||
@@ -28,8 +28,8 @@
|
||||
*/
|
||||
|
||||
|
||||
#if !defined(__SYMBOL_H__)
|
||||
#define __SYMBOL_H__
|
||||
#if !defined(INCLUDE_SYMBOL_H)
|
||||
#define INCLUDE_SYMBOL_H
|
||||
|
||||
|
||||
#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);
|
||||
|
||||
|
||||
#endif /* !__SYMBOL_H__ */
|
||||
#endif /* !INCLUDE_SYMBOL_H */
|
||||
|
12
token.h
12
token.h
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* 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
|
||||
* 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.
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* @(#) $Revision: 30.3 $
|
||||
* @(#) $Id: token.h,v 30.3 2013/08/11 08:41:38 chongo Exp $
|
||||
* @(#) $Revision: 30.5 $
|
||||
* @(#) $Id: token.h,v 30.5 2014/08/24 21:56:51 chongo Exp $
|
||||
* @(#) $Source: /usr/local/src/bin/calc/RCS/token.h,v $
|
||||
*
|
||||
* Under source code control: 1990/02/15 01:48:37
|
||||
@@ -28,8 +28,8 @@
|
||||
*/
|
||||
|
||||
|
||||
#if !defined(__TOKEN_H__)
|
||||
#define __TOKEN_H__
|
||||
#if !defined(INCLUDE_TOKEN_H)
|
||||
#define INCLUDE_TOKEN_H
|
||||
|
||||
|
||||
#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);
|
||||
|
||||
|
||||
#endif /* !__TOKEN_H__ */
|
||||
#endif /* !INCLUDE_TOKEN_H */
|
||||
|
14
value.c
14
value.c
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* 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
|
||||
* 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.
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* @(#) $Revision: 30.5 $
|
||||
* @(#) $Id: value.c,v 30.5 2013/08/11 08:41:38 chongo Exp $
|
||||
* @(#) $Revision: 30.8 $
|
||||
* @(#) $Id: value.c,v 30.8 2014/08/31 15:43:39 chongo Exp $
|
||||
* @(#) $Source: /usr/local/src/bin/calc/RCS/value.c,v $
|
||||
*
|
||||
* 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);
|
||||
break;
|
||||
case V_VPTR:
|
||||
math_fmt("v-ptr: %p", vp->v_addr);
|
||||
math_fmt("v-ptr: %p", (void *)vp->v_addr);
|
||||
break;
|
||||
case V_SPTR:
|
||||
math_fmt("s_ptr: %p", vp->v_str);
|
||||
math_fmt("s_ptr: %p", (void *)vp->v_str);
|
||||
break;
|
||||
case V_NPTR:
|
||||
math_fmt("n_ptr: %p", vp->v_num);
|
||||
math_fmt("n_ptr: %p", (void *)vp->v_num);
|
||||
break;
|
||||
case V_NBLOCK:
|
||||
if (!userfunc("nblk_print", vp))
|
||||
@@ -2948,7 +2948,7 @@ printestr(VALUE *vp)
|
||||
bp = vp->v_nblock->blk;
|
||||
}
|
||||
i = bp->datalen;
|
||||
math_fmt("%ld,%ld)", i, bp->blkchunk);
|
||||
math_fmt("%ld,%d)", i, bp->blkchunk);
|
||||
cp = bp->data;
|
||||
if (i > 0) {
|
||||
math_str("={");
|
||||
|
12
value.h
12
value.h
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* 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
|
||||
* 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.
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* @(#) $Revision: 30.6 $
|
||||
* @(#) $Id: value.h,v 30.6 2013/09/02 01:38:08 chongo Exp $
|
||||
* @(#) $Revision: 30.8 $
|
||||
* @(#) $Id: value.h,v 30.8 2014/08/24 21:56:51 chongo Exp $
|
||||
* @(#) $Source: /usr/local/src/bin/calc/RCS/value.h,v $
|
||||
*
|
||||
* Under source code control: 1993/07/30 19:42:47
|
||||
@@ -28,8 +28,8 @@
|
||||
*/
|
||||
|
||||
|
||||
#if !defined(__VALUE_H__)
|
||||
#define __VALUE_H__
|
||||
#if !defined(INCLUDE_VALUE_H)
|
||||
#define INCLUDE_VALUE_H
|
||||
|
||||
|
||||
#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 stringrsearch(STRING *, STRING *, long, long, ZVALUE *);
|
||||
|
||||
#endif /* !__VALUE_H__ */
|
||||
#endif /* !INCLUDE_VALUE_H */
|
||||
|
19
version.c
19
version.c
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* 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
|
||||
*
|
||||
@@ -19,8 +19,8 @@
|
||||
* received a copy with calc; if not, write to Free Software Foundation, Inc.
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* @(#) $Revision: 30.22 $
|
||||
* @(#) $Id: version.c,v 30.22 2013/09/27 08:59:43 chongo Exp $
|
||||
* @(#) $Revision: 30.24 $
|
||||
* @(#) $Id: version.c,v 30.24 2014/08/31 15:43:39 chongo Exp $
|
||||
* @(#) $Source: /usr/local/src/bin/calc/RCS/version.c,v $
|
||||
*
|
||||
* Under source code control: 1990/05/22 11:00:58
|
||||
@@ -49,7 +49,7 @@ static char *program;
|
||||
#define MAJOR_VER 2 /* major library version */
|
||||
#define MINOR_VER 12 /* minor library version */
|
||||
#define MAJOR_PATCH 4 /* major software level under library version */
|
||||
#define MINOR_PATCH 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"
|
||||
"calc - arbitrary precision calculator\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"
|
||||
"Initial author: David I. Bell\n"
|
||||
"\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"
|
||||
"as published by the Free Software Foundation.\n"
|
||||
"\n"
|
||||
"as published by the Free Software Foundation.\n";
|
||||
char *Usability = "\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"
|
||||
"or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General\n"
|
||||
"Public License for more details.\n"
|
||||
"\n"
|
||||
"Public License for more details.\n";
|
||||
char *COPYING_LGPL = "\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"
|
||||
"received a copy with calc; if not, write to Free Software Foundation, Inc.\n"
|
||||
|
@@ -3,8 +3,8 @@
|
||||
*/
|
||||
|
||||
|
||||
#if !defined(__HAVE_CONST_H__)
|
||||
#define __HAVE_CONST_H__
|
||||
#if !defined(CALC_HAVE_CONST_H)
|
||||
#define CALC_HAVE_CONST_H
|
||||
|
||||
|
||||
/* do we have or want const? */
|
||||
@@ -13,4 +13,4 @@
|
||||
#define CONST const /* yes */
|
||||
|
||||
|
||||
#endif /* !__HAVE_CONST_H__ */
|
||||
#endif /* !CALC_HAVE_CONST_H */
|
||||
|
@@ -3,8 +3,8 @@
|
||||
*/
|
||||
|
||||
|
||||
#if !defined(__HAVE_FPOS_H__)
|
||||
#define __HAVE_FPOS_H__
|
||||
#if !defined(CALC_HAVE_FPOS_H)
|
||||
#define CALC_HAVE_FPOS_H
|
||||
|
||||
|
||||
/* do we have fgetpos & fsetpos functions? */
|
||||
@@ -13,4 +13,4 @@
|
||||
typedef long FILEPOS;
|
||||
|
||||
|
||||
#endif /* !__HAVE_FPOS_H__ */
|
||||
#endif /* !CALC_HAVE_FPOS_H */
|
||||
|
@@ -3,8 +3,8 @@
|
||||
*/
|
||||
|
||||
|
||||
#if !defined(__HAVE_FPOS_POS_H__)
|
||||
#define __HAVE_FPOS_POS_H__
|
||||
#if !defined(CALC_HAVE_FPOS_POS_H)
|
||||
#define CALC_HAVE_FPOS_POS_H
|
||||
|
||||
|
||||
/* do we have fgetpos & fsetpos functions? */
|
||||
@@ -13,4 +13,4 @@
|
||||
#undef FPOS_POS_LEN
|
||||
|
||||
|
||||
#endif /* !__HAVE_FPOS_POS_H__ */
|
||||
#endif /* !CALC_HAVE_FPOS_POS_H */
|
||||
|
@@ -3,12 +3,12 @@
|
||||
*/
|
||||
|
||||
|
||||
#if !defined(__HAVE_GETPGID_H__)
|
||||
#define __HAVE_GETPGID_H__
|
||||
#if !defined(CALC_HAVE_GETPGID_H)
|
||||
#define CALC_HAVE_GETPGID_H
|
||||
|
||||
|
||||
/* do we have or want getpgid()? */
|
||||
#undef HAVE_GETPGID /* no */
|
||||
|
||||
|
||||
#endif /* !__HAVE_GETPGID_H__ */
|
||||
#endif /* !CALC_HAVE_GETPGID_H */
|
||||
|
@@ -3,12 +3,12 @@
|
||||
*/
|
||||
|
||||
|
||||
#if !defined(__HAVE_GETPRID_H__)
|
||||
#define __HAVE_GETPRID_H__
|
||||
#if !defined(CALC_HAVE_GETPRID_H)
|
||||
#define CALC_HAVE_GETPRID_H
|
||||
|
||||
|
||||
/* do we have or want getprid()? */
|
||||
#undef HAVE_GETPRID /* no */
|
||||
|
||||
|
||||
#endif /* !__HAVE_GETPRID_H__ */
|
||||
#endif /* !CALC_HAVE_GETPRID_H */
|
||||
|
@@ -3,12 +3,12 @@
|
||||
*/
|
||||
|
||||
|
||||
#if !defined(__HAVE_GETSID_H__)
|
||||
#define __HAVE_GETSID_H__
|
||||
#if !defined(CALC_HAVE_GETSID_H)
|
||||
#define CALC_HAVE_GETSID_H
|
||||
|
||||
|
||||
/* do we have or want getsid()? */
|
||||
#undef HAVE_GETSID /* no */
|
||||
|
||||
|
||||
#endif /* !__HAVE_GETSID_H__ */
|
||||
#endif /* !CALC_HAVE_GETSID_H */
|
||||
|
@@ -3,12 +3,12 @@
|
||||
*/
|
||||
|
||||
|
||||
#if !defined(__HAVE_GETTIME_H__)
|
||||
#define __HAVE_GETTIME_H__
|
||||
#if !defined(CALC_HAVE_GETTIME_H)
|
||||
#define CALC_HAVE_GETTIME_H
|
||||
|
||||
|
||||
/* do we have or want clock_gettime()? */
|
||||
#undef HAVE_GETTIME /* no */
|
||||
|
||||
|
||||
#endif /* !__HAVE_GETTIME_H__ */
|
||||
#endif /* !CALC_HAVE_GETTIME_H */
|
||||
|
@@ -3,12 +3,12 @@
|
||||
*/
|
||||
|
||||
|
||||
#if !defined(__HAVE_MEMMV_H__)
|
||||
#define __HAVE_MEMMV_H__
|
||||
#if !defined(CALC_HAVE_MEMMV_H)
|
||||
#define CALC_HAVE_MEMMV_H
|
||||
|
||||
|
||||
/* do we have or want memmove()? */
|
||||
#define HAVE_MEMMOVE /* yes */
|
||||
|
||||
|
||||
#endif /* !__HAVE_MEMMV_H__ */
|
||||
#endif /* !CALC_HAVE_MEMMV_H */
|
||||
|
@@ -3,12 +3,12 @@
|
||||
*/
|
||||
|
||||
|
||||
#if !defined(__HAVE_NEWSTR_H__)
|
||||
#define __HAVE_NEWSTR_H__
|
||||
#if !defined(CALC_HAVE_NEWSTR_H)
|
||||
#define CALC_HAVE_NEWSTR_H
|
||||
|
||||
|
||||
/* do we have or want memcpy(), memset() & strchr()? */
|
||||
#define HAVE_NEWSTR /* yes */
|
||||
|
||||
|
||||
#endif /* !__HAVE_NEWSTR_H__ */
|
||||
#endif /* !CALC_HAVE_NEWSTR_H */
|
||||
|
@@ -3,12 +3,12 @@
|
||||
*/
|
||||
|
||||
|
||||
#if !defined(__HAVE_OFFSCL_H__)
|
||||
#define __HAVE_OFFSCL_H__
|
||||
#if !defined(CALC_HAVE_OFFSCL_H)
|
||||
#define CALC_HAVE_OFFSCL_H
|
||||
|
||||
|
||||
#undef HAVE_OFF_T_SCALAR
|
||||
#define HAVE_OFF_T_SCALAR /* off_t is a simple value */
|
||||
|
||||
|
||||
#endif /* !__HAVE_OFFSCL_H__ */
|
||||
#endif /* !CALC_HAVE_OFFSCL_H */
|
||||
|
@@ -3,12 +3,12 @@
|
||||
*/
|
||||
|
||||
|
||||
#if !defined(__HAVE_POSSCL_H__)
|
||||
#define __HAVE_POSSCL_H__
|
||||
#if !defined(CALC_HAVE_POSSCL_H)
|
||||
#define CALC_HAVE_POSSCL_H
|
||||
|
||||
|
||||
#undef HAVE_FILEPOS_SCALAR
|
||||
#define HAVE_FILEPOS_SCALAR /* FILEPOS is a simple value */
|
||||
|
||||
|
||||
#endif /* !__HAVE_POSSCL_H__ */
|
||||
#endif /* !CALC_HAVE_POSSCL_H */
|
||||
|
@@ -3,12 +3,12 @@
|
||||
*/
|
||||
|
||||
|
||||
#if !defined(__HAVE_RUSAGE_H__)
|
||||
#define __HAVE_RUSAGE_H__
|
||||
#if !defined(CALC_HAVE_RUSAGE_H)
|
||||
#define CALC_HAVE_RUSAGE_H
|
||||
|
||||
|
||||
/* do we have or want getrusage()? */
|
||||
#undef HAVE_GETRUSAGE /* no */
|
||||
|
||||
|
||||
#endif /* !__HAVE_RUSAGE_H__ */
|
||||
#endif /* !CALC_HAVE_RUSAGE_H */
|
||||
|
@@ -3,12 +3,12 @@
|
||||
*/
|
||||
|
||||
|
||||
#if !defined(__HAVE_STDLIB_H__)
|
||||
#define __HAVE_STDLIB_H__
|
||||
#if !defined(CALC_HAVE_STDLIB_H)
|
||||
#define CALC_HAVE_STDLIB_H
|
||||
|
||||
|
||||
/* do we have <stdlib.h>? */
|
||||
#define HAVE_STDLIB_H /* yes */
|
||||
|
||||
|
||||
#endif /* !__HAVE_STDLIB_H__ */
|
||||
#endif /* !CALC_HAVE_STDLIB_H */
|
||||
|
@@ -3,12 +3,12 @@
|
||||
*/
|
||||
|
||||
|
||||
#if !defined(__HAVE_STRDUP_H__)
|
||||
#define __HAVE_STRDUP_H__
|
||||
#if !defined(CALC_HAVE_STRDUP_H)
|
||||
#define CALC_HAVE_STRDUP_H
|
||||
|
||||
|
||||
/* do we have or want getstrdup()? */
|
||||
#define HAVE_STRDUP /* yes */
|
||||
|
||||
|
||||
#endif /* !__HAVE_STRDUP_H__ */
|
||||
#endif /* !CALC_HAVE_STRDUP_H */
|
||||
|
@@ -3,12 +3,12 @@
|
||||
*/
|
||||
|
||||
|
||||
#if !defined(__HAVE_STRING_H__)
|
||||
#define __HAVE_STRING_H__
|
||||
#if !defined(CALC_HAVE_STRING_H)
|
||||
#define CALC_HAVE_STRING_H
|
||||
|
||||
|
||||
/* do we have <string.h>? */
|
||||
#define HAVE_STRING_H /* yes */
|
||||
|
||||
|
||||
#endif /* !__HAVE_STRING_H__ */
|
||||
#endif /* !CALC_HAVE_STRING_H */
|
||||
|
@@ -3,8 +3,8 @@
|
||||
*/
|
||||
|
||||
|
||||
#if !defined(__HAVE_TIMES_H__)
|
||||
#define __HAVE_TIMES_H__
|
||||
#if !defined(CALC_HAVE_TIMES_H)
|
||||
#define CALC_HAVE_TIMES_H
|
||||
|
||||
|
||||
/* do we have <times.h>? */
|
||||
@@ -14,4 +14,4 @@
|
||||
#undef HAVE_SYS_TIME_H /* no */
|
||||
|
||||
|
||||
#endif /* !__HAVE_TIMES_H__ */
|
||||
#endif /* !CALC_HAVE_TIMES_H */
|
||||
|
@@ -3,12 +3,12 @@
|
||||
*/
|
||||
|
||||
|
||||
#if !defined(__HAVE_UID_T_H__)
|
||||
#define __HAVE_UID_T_H__
|
||||
#if !defined(CALC_HAVE_UID_T_H)
|
||||
#define CALC_HAVE_UID_T_H
|
||||
|
||||
|
||||
/* do we have or want uid_t? */
|
||||
#undef HAVE_UID_T /* no */
|
||||
|
||||
|
||||
#endif /* !__HAVE_UID_T_H__ */
|
||||
#endif /* !CALC_HAVE_UID_T_H */
|
||||
|
@@ -3,12 +3,12 @@
|
||||
*/
|
||||
|
||||
|
||||
#if !defined(__HAVE_UNISTD_H__)
|
||||
#define __HAVE_UNISTD_H__
|
||||
#if !defined(CALC_HAVE_UNISTD_H)
|
||||
#define CALC_HAVE_UNISTD_H
|
||||
|
||||
|
||||
/* do we have <unistd.h>? */
|
||||
#undef HAVE_UNISTD_H /* no */
|
||||
|
||||
|
||||
#endif /* !__HAVE_UNISTD_H__ */
|
||||
#endif /* !CALC_HAVE_UNISTD_H */
|
||||
|
@@ -3,8 +3,8 @@
|
||||
*/
|
||||
|
||||
|
||||
#if !defined(__HAVE_UNUSED_H__)
|
||||
#define __HAVE_UNUSED_H__
|
||||
#if !defined(CALC_HAVE_UNUSED_H)
|
||||
#define CALC_HAVE_UNUSED_H
|
||||
|
||||
|
||||
/* do we have/want the unused attribute? */
|
||||
@@ -13,4 +13,4 @@
|
||||
#define UNUSED __attribute__((unused)) /* yes */
|
||||
|
||||
|
||||
#endif /* !__HAVE_UNUSED_H__ */
|
||||
#endif /* !CALC_HAVE_UNUSED_H */
|
||||
|
@@ -3,12 +3,12 @@
|
||||
*/
|
||||
|
||||
|
||||
#if !defined(__HAVE_URANDOM_H__)
|
||||
#define __HAVE_URANDOM_H__
|
||||
#if !defined(CALC_HAVE_URANDOM_H)
|
||||
#define CALC_HAVE_URANDOM_H
|
||||
|
||||
|
||||
/* do we have /dev/urandom? */
|
||||
#undef HAVE_URANDOM_H /* no */
|
||||
|
||||
|
||||
#endif /* !__HAVE_URANDOM_H__ */
|
||||
#endif /* !CALC_HAVE_URANDOM_H */
|
||||
|
@@ -3,12 +3,12 @@
|
||||
*/
|
||||
|
||||
|
||||
#if !defined(__HAVE_USTAT_H__)
|
||||
#define __HAVE_USTAT_H__
|
||||
#if !defined(CALC_HAVE_USTAT_H)
|
||||
#define CALC_HAVE_USTAT_H
|
||||
|
||||
|
||||
/* do we have or want ustat()? */
|
||||
#undef HAVE_USTAT /* no */
|
||||
|
||||
|
||||
#endif /* !__HAVE_USTAT_H__ */
|
||||
#endif /* !CALC_HAVE_USTAT_H */
|
||||
|
12
zmath.h
12
zmath.h
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* 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
|
||||
* 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.
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* @(#) $Revision: 30.3 $
|
||||
* @(#) $Id: zmath.h,v 30.3 2013/08/11 08:41:38 chongo Exp $
|
||||
* @(#) $Revision: 30.5 $
|
||||
* @(#) $Id: zmath.h,v 30.5 2014/08/24 21:56:51 chongo Exp $
|
||||
* @(#) $Source: /usr/local/src/bin/calc/RCS/zmath.h,v $
|
||||
*
|
||||
* Under source code control: 1993/07/30 19:42:48
|
||||
@@ -34,8 +34,8 @@
|
||||
*/
|
||||
|
||||
|
||||
#if !defined(__ZMATH_H__)
|
||||
#define __ZMATH_H__
|
||||
#if !defined(INCLUDE_ZMATH_H)
|
||||
#define INCLUDE_ZMATH_H
|
||||
|
||||
|
||||
#if defined(CALC_SRC) /* if we are building from the calc source tree */
|
||||
@@ -669,4 +669,4 @@ typedef struct {
|
||||
} BITSTR;
|
||||
|
||||
|
||||
#endif /* !__ZMATH_H__*/
|
||||
#endif /* !INCLUDE_ZMATH_H*/
|
||||
|
12
zrand.h
12
zrand.h
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* 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
|
||||
* 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.
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* @(#) $Revision: 30.1 $
|
||||
* @(#) $Id: zrand.h,v 30.1 2007/03/16 11:09:46 chongo Exp $
|
||||
* @(#) $Revision: 30.3 $
|
||||
* @(#) $Id: zrand.h,v 30.3 2014/08/24 21:56:51 chongo Exp $
|
||||
* @(#) $Source: /usr/local/src/bin/calc/RCS/zrand.h,v $
|
||||
*
|
||||
* Under source code control: 1995/01/07 09:45:26
|
||||
@@ -33,8 +33,8 @@
|
||||
*/
|
||||
|
||||
|
||||
#if !defined(__ZRAND_H__)
|
||||
#define __ZRAND_H__
|
||||
#if !defined(INCLUDE_ZRAND_H)
|
||||
#define INCLUDE_ZRAND_H
|
||||
|
||||
|
||||
#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);
|
||||
|
||||
|
||||
#endif /* !__ZRAND_H__ */
|
||||
#endif /* !INCLUDE_ZRAND_H */
|
||||
|
12
zrandom.h
12
zrandom.h
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* 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
|
||||
* 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.
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* @(#) $Revision: 30.1 $
|
||||
* @(#) $Id: zrandom.h,v 30.1 2007/03/16 11:09:46 chongo Exp $
|
||||
* @(#) $Revision: 30.3 $
|
||||
* @(#) $Id: zrandom.h,v 30.3 2014/08/24 21:56:51 chongo Exp $
|
||||
* @(#) $Source: /usr/local/src/bin/calc/RCS/zrandom.h,v $
|
||||
*
|
||||
* Under source code control: 1997/02/15 04:01:56
|
||||
@@ -29,8 +29,8 @@
|
||||
*/
|
||||
|
||||
|
||||
#if !defined(__ZRANDOM_H__)
|
||||
#define __ZRANDOM_H__
|
||||
#if !defined(INCLUDE_ZRANDOM_H)
|
||||
#define INCLUDE_ZRANDOM_H
|
||||
|
||||
|
||||
#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);
|
||||
|
||||
|
||||
#endif /* !__ZRANDOM_H__ */
|
||||
#endif /* !INCLUDE_ZRANDOM_H */
|
||||
|
Reference in New Issue
Block a user