Compare commits

..

6 Commits

Author SHA1 Message Date
Landon Curt Noll
d25186fc52 Release calc version 2.12.5.3 2017-05-21 15:39:01 -07:00
Landon Curt Noll
28d1e35362 Release calc version 2.12.5.2 2017-05-21 15:39:00 -07:00
Landon Curt Noll
1ae2f953d3 Release calc version 2.12.5.0 2017-05-21 15:39:00 -07:00
Landon Curt Noll
ed4b56d1ec Release calc version 2.12.4.14 2017-05-21 15:38:59 -07:00
Landon Curt Noll
cc2f6f7b85 Release calc version 2.12.4.13 2017-05-21 15:38:59 -07:00
Landon Curt Noll
57a22a6f39 Release calc version 2.12.4.12 2017-05-21 15:38:58 -07:00
426 changed files with 4627 additions and 2136 deletions

65
BUGS
View File

@@ -32,16 +32,25 @@ If you have tried all of the above and things still are not right,
then it may be time to send in a bug report. You can send bug
and bug fixes reports to:
calc-bugs at asthe dot com
calc-bug-report at asthe dot com
[[ NOTE: Replace 'at' with @, 'dot' is with . and remove the spaces ]]
[[ NOTE: The EMail address uses 'asthe', the web site URL uses 'isthe' ]]
NOTE: Remove spaces and replace 'at' with @, 'dot' with .
Your subject must contain the words:
This replaces the old calc-bugs at asthe dot com address.
calc bug report
To be sure we see your EMail reporting a calc bug, please use the
following phase in your EMail Subject line:
You may have additional words in your subject line.
calc bug report
That phrase in your subject line will help ensure your request
will get past our anti-spam filters. You may have additional
words in your subject line.
However, you may find it more helpful to simply subscribe
to the calc-tester mailing list (see below) and then to
send your report to that mailing list as a wider set calc
testers may be able to help you.
When you send your report, please include the following information:
@@ -68,20 +77,15 @@ 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.
=-=
Problems that have known work-a-rounds:
* There is a bug in gcc v4.1.0 that causes calc to fail the regression
test. The work-a-round is to compile with gcc v4.1.1 or later. This
problems was observed on Fedora 5.
=-=
mis-features in calc:
Some problems are not bugs but rather mis-features / things that could
@@ -129,7 +133,34 @@ mis-features in calc:
will not.
## Copyright (C) 1999-2013 Landon Curt Noll
=-=
To subscribe to the calc-tester mailing list, visit the following URL:
http://www.isthe.com/chongo/tech/comp/calc/calc-tester.html
This is a low volume moderated mailing list.
This mailing list replaces calc-tester at asthe dot com list.
If you need a human to help you with your mailing list subscription,
please send EMail to our special:
calc-tester-maillist-help at asthe dot com
NOTE: Remove spaces and replace 'at' with @, 'dot' with .
address. To be sure we see your EMail asking for help with your
mailing list subscription, please use the following phase in your
EMail Subject line:
calc tester mailing list help
That phrase in your subject line will help ensure your
request will get past our anti-spam filters. You may have
additional words in your subject line.
## 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 +176,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.5 $
## @(#) $Id: BUGS,v 30.5 2014/10/12 12:23:43 chongo Exp $
## @(#) $Source: /usr/local/src/bin/calc/RCS/BUGS,v $
##
## Under source code control: 1994/03/18 14:06:13

231
CHANGES
View File

@@ -1,7 +1,204 @@
The following are the changes from calc version 2.12.4.11 to date:
The following are the changes from calc version 2.12.5.3 to date:
Calc version 2.12.5.2 for Darwin (Mac OS X) users, code to installed
calc under /opt/calc. Moreover the CHANGES file did not mention
/opt/calc. Sorry about that!.
A much better tree for Darwin (Mac OS X) users would have been
to install cal under /opt/calc. This release ONLY changes the Darwin
(Mac OS X) install tree to /usr/local.
Darwin (Mac OS X) users who installed calc version 2.12.5.2
should, after installing version 2.12.5.3:
rm -rf /opt/calc
The following are the changes from calc version 2.12.5.1 to 2.12.5.2:
NOTE: calc version 2.12.5.2, for Darwin (Mac OS X) users,
installed under /opt/calc. We neglected to mention this
AND /usr/local would have been a better choice. Sorry!
Fixed in calc version 2.12.5.3.
Removed rules and makefile variables assocated with shortened
calc version numbers of less than 4 levels.
Under OS X (darwin), if /usr/include is missing, warnings
are issued to help the user use xcode-select --install
so that one may properly compile C code.
Lowered REDC levels:
#define MAXREDC 256 /* number of entries in REDC cache */
#define SQ_ALG2 28 /* size for alternative squaring */
config("sq2") == 28 /* was 3388 */
#define MUL_ALG2 28 /* size for alternative multiply */
config("mul2") == 28 /* was 1780 */
#define POW_ALG2 20 /* size for using REDC for powers */
config("pow2") == 20 /* was 176 */
#define REDC_ALG2 25 /* size for using alternative REDC */
config("redc2") == 25 /* was 220 */
The alg_config.cal script appears to be not correctly finding the
best REDC values. While it has been improved, alg_config.cal still
seems to be suspect on how it attempts to find the best values.
Fixed an intro help file mistake found by Roger Hardiman
<roger at rjh dot org dot uk>.
The following are the changes from calc version 2.12.5.0 to 2.12.5.1:
Calc has a new calc-tester mailing list. This list is for those
who are using/testing calc. We also use this list to announce
new versions of calc. To subscribe to the calc-tester mailing
list, visit the following URL:
http://www.isthe.com/chongo/tech/comp/calc/calc-tester.html
This is a low volume moderated mailing list.
This mailing list replaces calc-tester at asthe dot com list.
If you need a human to help you with your mailing list subscription,
please send EMail to our special:
calc-tester-maillist-help at asthe dot com
address. To be sure we see your EMail asking for help with your
mailing list subscription, please use the following phase in your
EMail Subject line:
calc tester mailing list help
That phrase in your subject line will help ensure your
request will get past our anti-spam filters. You may have
additional words in your subject line.
There is a new calc bug report EMail address:
calc-bug-report at asthe dot com
This replaces the old calc-bugs at asthe dot com address.
To be sure we see your EMail reporting a calc bug, please use the
following phase in your EMail Subject line:
calc bug report
That phrase in your subject line will help ensure your
request will get past our anti-spam filters. You may have
additional words in your subject line.
However, you may find it more helpful to simply subscribe
to the calc-tester mailing list (see above) and then to
send your report to that mailing list as a wider set calc
testers may be able to help you.
The following makefile rules that were related to printing the
upper values of the calc version, rules that were made obsolete
in calc version 2.12.4.14, have been removed:
calc_vers calc_ver calc_ve
vers ver ve
Noted that the hash() builtin function, internally known as
quickhash (used for internal objects such as the associative
arrays as well as other internal processes) uses the deprcated
32-bit FNV-0 hash. The use of this deprecated hash is sufficient
for calc internal purposes. Use of FNV-1a is recommended for
a general non-cryptographic quick hash.
The following are the changes from calc version 2.12.4.14 to 2.12.5.0:
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 <somos at harary dot math dot georgetown dot edu>.
work of Michael Somos.
Fixed typo in "help sysinfo".
@@ -12,9 +209,9 @@ The following are the changes from calc version 2.12.4.11 to date:
Christoph Zurnieden <czurnieden at gmx dot de> including:
infinities.cal - handle infinities symbolically, a little helper file
intnum.cal - implementation of tanhsinh- and Gauss-Legendre quadrature
intnum.cal - implementation of tanh sinh and Gauss-Legendre quadrature
smallfactors.cal - find the factors of a number < 2^32
strings.cal - implementation of the macros in ctype.h plus str[n]casecmp
strings.cal - implementation of isascii() and isblank()
Reformatted some calc resource files. Cleanup in comment the headers
of some calc resource files.
@@ -38,6 +235,8 @@ The following are the changes from calc version 2.12.4.11 to date:
isxdigit - whether character a hexadecimal digit
strcasecmp - compare two strings, case independent
strncasecmp - compare two strings up to n characters, case independent
strtolower - transform an ASCII string to lower case
strtoupper - transform an ASCII string to upper case
For details on these new builtins, see their help messages.
Thanks goes to Inge Zurnieden <inge dot zurnieden at gmx dot de> for
@@ -60,6 +259,21 @@ The following are the changes from calc version 2.12.4.11 to date:
http://cis.csuohio.edu/~somos/picky.html
Removed functions from strings.cal that have been replaced by
the new ctype-like builtin functions.
Fixed cal/Makefile to include missing intnum.cal file.
Added detail_help_list make target to cal/Makefile.
The detaillist make target in help/Makefile is now
called detail_help_list.
Removed requirement of gen_u0(h, n, v1) in lucas.cal that h
be odd. While still lucas(h, n) converts even h into an odd h
internally by incrementing n, gen_u0(h, n, v1) will output even
when h is even.
The following are the changes from calc version 2.12.4.6 to version 2.12.4.10:
@@ -1279,8 +1493,7 @@ The following are the changes from calc version 2.11.10 to 2.11.10:
The following are the changes from calc version 2.11.9 to 2.11.9.3:
Fixed calc man page examples to move -f to the end of the line.
Thanks goes to Michael Somos <somos at grail dot cba dot csuohio
dot edu> for pointing this out.
Thanks goes to Michael Somos for pointing this out.
Linux and gcc now compiled with -Wall -W -Wno-comment.
@@ -6928,7 +7141,7 @@ Following is a list of visible changes to calc from version 1.24.7 to 1.26.1:
A small bug in the library file regress.cal was fixed.
## 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
@@ -6944,8 +7157,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.33 $
## @(#) $Id: CHANGES,v 30.33 2013/09/01 22:19:41 chongo Exp $
## @(#) $Revision: 30.50 $
## @(#) $Id: CHANGES,v 30.50 2016/02/08 22:09:34 chongo Exp $
## @(#) $Source: /usr/local/src/bin/calc/RCS/CHANGES,v $
##
## Under source code control: 1993/06/02 18:12:57

65
COPYING
View File

@@ -6,14 +6,14 @@ This file is Copyrighted
This file is covered under the following Copyright:
Copyright (C) 1999-2008 Landon Curt Noll
Copyright (C) 1999-2014 Landon Curt Noll
All rights reserved.
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
# @(#) $Revision: 30.4 $
# @(#) $Id: COPYING,v 30.4 2013/09/01 20:14:30 chongo Exp $
# @(#) $Revision: 30.6 $
# @(#) $Id: COPYING,v 30.6 2014/10/12 12:23:43 chongo Exp $
# @(#) $Source: /usr/local/src/bin/calc/RCS/COPYING,v $
-=-
@@ -53,45 +53,62 @@ Calc is covered by the GNU Lesser General Public License
Boston, MA 02110-1301
USA
The contact addresses for calc is as follows:
To subscribe to the calc-tester mailing list, visit the following URL:
Web: http://www.isthe.com/chongo/tech/comp/calc/email.html
http://www.isthe.com/chongo/tech/comp/calc/calc-tester.html
To join the low volume calc mailing list. Send a EMail message to:
This is a low volume moderated mailing list.
calc-tester-request at asthe dot com
This mailing list replaces calc-tester at asthe dot com list.
Your subject must contain the words:
If you need a human to help you with your mailing list subscription,
please send EMail to our special:
calc mailing list subscription
calc-tester-maillist-help at asthe dot com
You may have additional words in your subject line.
NOTE: Remove spaces and replace 'at' with @, 'dot' with .
Your message body (not the subject) should consist of:
address. To be sure we see your EMail asking for help with your
mailing list subscription, please use the following phase in your
EMail Subject line:
subscribe calc-tester address
end
name your_full_name
calc tester mailing list help
where ``address'' is your EMail address and ``your_full_name'' is
your full name.
Feel free to follow the name line with additional EMail text as desired.
That phrase in your subject line will help ensure your
request will get past our anti-spam filters. You may have
additional words in your subject line.
-=-
Calc bug reports and calc bug fixes should be sent to:
calc-bugs at asthe dot com
calc-bug-report at asthe dot com
[[ NOTE: Replace 'at' with @, 'dot' is with . and remove the spaces ]]
[[ NOTE: The EMail address uses 'asthe' and the web site URL uses 'isthe' ]]
NOTE: Remove spaces and replace 'at' with @, 'dot' with .
Your subject must contain the words:
This replaces the old calc-bugs at asthe dot com address.
calc bug report
To be sure we see your EMail reporting a calc bug, please use the
following phase in your EMail Subject line:
You may have additional words in your subject line.
calc bug report
That phrase in your subject line will help ensure your
request will get past our anti-spam filters. You may have
additional words in your subject line.
However, you may find it more helpful to simply subscribe
to the calc-tester mailing list (see above) and then to
send your report to that mailing list as a wider set calc
testers may be able to help you.
-=-
The calc web site is located at:
http://www.isthe.com/chongo/tech/comp/calc/
NOTE: The EMail address uses 'asthe', while the web site uses 'isthe'.
-=-

572
Makefile

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

66
README
View File

@@ -73,52 +73,64 @@ for a wish/todo list. Code contributions are welcome.
=-=
To join the calc-tester mailing list. Send an EMail message to:
To subscribe to the calc-tester mailing list, visit the following URL:
calc-tester-request at asthe dot com
http://www.isthe.com/chongo/tech/comp/calc/calc-tester.html
[[ NOTE: Replace 'at' with @, 'dot' is with . and remove the spaces ]]
[[ NOTE: The EMail address uses 'asthe' and the web site URL uses 'isthe' ]]
This is a low volume moderated mailing list.
Your subject must contain the words:
This mailing list replaces calc-tester at asthe dot com list.
calc mailing list subscription
If you need a human to help you with your mailing list subscription,
please send EMail to our special:
You may have additional words in your subject line.
calc-tester-maillist-help at asthe dot com
Your message body (not the subject) should consist of:
NOTE: Remove spaces and replace 'at' with @, 'dot' with .
subscribe calc-tester address
end
name your_full_name
address. To be sure we see your EMail asking for help with your
mailing list subscription, please use the following phase in your
EMail Subject line:
where ``address'' is your EMail address and ``your_full_name'' is
your full name.
calc tester mailing list help
Feel free to follow the name line with additional EMail text as desired.
That phrase in your subject line will help ensure your
request will get past our anti-spam filters. You may have
additional words in your subject line.
=-=
-=-
Send Calc bug and bug fixes to:
Calc bug reports and calc bug fixes should be sent to:
calc-bugs at asthe dot com
calc-bug-report at asthe dot com
[[ NOTE: Replace 'at' with @, 'dot' is with . and remove the spaces ]]
[[ NOTE: The EMail address uses 'asthe' and the web site URL uses 'isthe' ]]
NOTE: Remove spaces and replace 'at' with @, 'dot' with .
but see the BUGS file first.
This replaces the old calc-bugs at asthe dot com address.
Your subject must contain the words:
To be sure we see your EMail reporting a calc bug, please use the
following phase in your EMail Subject line:
calc bug report
calc bug report
You may have additional words in your subject line.
That phrase in your subject line will help ensure your
request will get past our anti-spam filters. You may have
additional words in your subject line.
However, you may find it more helpful to simply subscribe
to the calc-tester mailing list (see above) and then to
send your report to that mailing list as a wider set calc
testers may be able to help you.
-=-
The calc web site is located at:
http://www.isthe.com/chongo/tech/comp/calc/
http://www.isthe.com/chongo/tech/comp/calc/
## Copyright (C) 1999 Landon Curt Noll
NOTE: The EMail address uses 'asthe', while the web site uses 'isthe'.
## 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
@@ -134,8 +146,8 @@ The calc web site is located at:
## received a copy with calc; if not, write to Free Software Foundation, Inc.
## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
##
## @(#) $Revision: 30.1 $
## @(#) $Id: README,v 30.1 2007/03/16 11:09:46 chongo Exp $
## @(#) $Revision: 30.3 $
## @(#) $Id: README,v 30.3 2014/10/12 12:23:43 chongo Exp $
## @(#) $Source: /usr/local/src/bin/calc/RCS/README,v $
##
## Under source code control: 1995/10/25 05:27:59

12
alloc.h
View File

@@ -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 */

View File

@@ -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: assocfunc.c,v 30.2 2013/08/11 08:41:38 chongo Exp $
* @(#) $Revision: 30.3 $
* @(#) $Id: assocfunc.c,v 30.3 2014/09/30 00:55:11 chongo Exp $
* @(#) $Source: /usr/local/src/bin/calc/RCS/assocfunc.c,v $
*
* Under source code control: 1993/07/20 23:04:27
@@ -83,7 +83,7 @@ associndex(ASSOC *ap, BOOL create, long dim, VALUE *indices)
* so that we can first select the correct hash chain, and
* also so we can quickly compare each element for a match.
*/
hash = FNV1_32_BASIS;
hash = QUICKHASH_BASIS;
for (i = 0; i < dim; i++)
hash = hashvalue(&indices[i], hash);

View File

@@ -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
View File

@@ -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 */

View File

@@ -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 */

View File

@@ -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.7 $
# @(#) $Id: Makefile,v 30.7 2013/08/11 09:07:26 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
@@ -179,19 +179,32 @@ MV= mv
CO= co
TRUE= true
TOUCH= touch
SED= sed
SORT= sort
FMT= fmt
# The calc files to install
#
CALC_FILES= alg_config.cal beer.cal bernoulli.cal bernpoly.cal \
bigprime.cal bindings brentsolve.cal chi.cal chrem.cal constants.cal \
deg.cal dms.cal dotest.cal ellip.cal factorial2.cal factorial.cal \
gvec.cal hello.cal hms.cal intfile.cal lambertw.cal linear.cal \
lnseries.cal lucas.cal lucas_chk.cal lucas_tbl.cal mersenne.cal \
mfactor.cal mod.cal natnumset.cal pell.cal pi.cal pix.cal pollard.cal \
poly.cal prompt.cal psqrt.cal qtime.cal quat.cal randbitrun.cal \
randmprime.cal randombitrun.cal randomrun.cal randrun.cal README \
regress.cal repeat.cal screen.cal seedrandom.cal set8700.cal \
set8700.line solve.cal specialfunctions.cal statistics.cal sumsq.cal \
# This list is prodiced by the detaillist rule when no WARNINGS are detected.
#
# Please use:
#
# make calc_files_list
#
# to keep this list in nice sorted order and to check that these
# deailed help files are under RCS control.
#
CALC_FILES= README alg_config.cal beer.cal bernoulli.cal \
bernpoly.cal bigprime.cal bindings brentsolve.cal chi.cal chrem.cal \
constants.cal deg.cal dms.cal dotest.cal ellip.cal factorial.cal \
factorial2.cal gvec.cal hello.cal hms.cal infinities.cal \
intfile.cal intnum.cal lambertw.cal linear.cal lnseries.cal \
lucas.cal lucas_chk.cal lucas_tbl.cal mersenne.cal mfactor.cal \
mod.cal natnumset.cal pell.cal pi.cal pix.cal pollard.cal poly.cal \
prompt.cal psqrt.cal qtime.cal quat.cal randbitrun.cal randmprime.cal \
randombitrun.cal randomrun.cal randrun.cal regress.cal repeat.cal \
screen.cal seedrandom.cal set8700.cal set8700.line smallfactors.cal \
solve.cal specialfunctions.cal statistics.cal strings.cal sumsq.cal \
sumtimes.cal surd.cal test1700.cal test2300.cal test2600.cal \
test2700.cal test3100.cal test3300.cal test3400.cal test3500.cal \
test4000.cal test4100.cal test4600.cal test5100.cal test5200.cal \
@@ -244,6 +257,27 @@ calcliblist:
fi; \
done
# These next rule help form the ${CALC_FILES} makefile variables above.
#
calc_files_list:
${Q} -(find . -mindepth 1 -maxdepth 1 -type f -name '*.cal' -print | \
while read i; do \
if [ X"$$i" != X"/dev/null" ]; then \
if [ ! -f RCS/$$i,v ]; then \
echo "WARNING: $$i not under RCS control" 1>&2; \
else \
echo $$i; \
fi; \
fi; \
done; \
echo '--first_line--'; \
echo README; \
echo set8700.line; \
echo bindings) | \
${SED} -e 's:^\./::' | LANG=C ${SORT} | ${FMT} -70 | \
${SED} -e '1s/--first_line--/CALC_FILES=/' -e '2,$$s/^/ /' \
-e 's/$$/ \\/' -e '$$s/ \\$$//'
##
#
# rpm rules
@@ -274,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}"; \

View File

@@ -35,12 +35,44 @@ Calc resource file files are provided because they serve as examples of
how use the calc language, and/or because the authors thought them to
be useful!
If you write something that you think is useful, please send it to:
If you write something that you think is useful, please join the
low volume calc mailing list calc-tester. Then send your contribution
to the calc-tester mailing list.
calc-contrib at asthe dot com
To subscribe to the calc-tester mailing list, visit the following URL:
[[ NOTE: Replace 'at' with @, 'dot' is with . and remove the spaces ]]
[[ NOTE: The EMail address uses 'asthe' and the web site URL uses 'isthe' ]]
https://www.listbox.com/subscribe/?list_id=239342
To help determine you are a human and not just a spam bot,
you will be required to provide the following additional info:
Your Name
Calc Version
Operating System
The date 7 days ago
This is a low volume moderated mailing list.
This mailing list replaces calc-tester at asthe dot com list.
If you need a human to help you with your mailing list subscription,
please send EMail to our special:
calc-tester-maillist-help at asthe dot com
NOTE: Remove spaces and replace 'at' with @, 'dot' with .
address. To be sure we see your EMail asking for help with your
mailing list subscription, please use the following phase in your
EMail Subject line:
calc tester mailing list help
That phrase in your subject line will help ensure your
request will get past our anti-spam filters. You may have
additional words in your subject line.
=-=
By convention, a resource file only defines and/or initializes functions,
objects and variables. (The regress.cal and testxxx.cal regression test
@@ -1382,25 +1414,17 @@ statistics.cal
strings.cal
toupper(s)
tolower(s)
strcasecmp(s1,s2)
strncasecmp(s1,s2,length)
isascii(c)
isalnum(c)
isalpha(c)
iscntrl(c)
isdigit(c)
isgraph(c)
islower(c)
isprint(c)
ispunct(c)
isspace(c)
isupper(c)
isblank(c)
isxdigit(c)
Implements most of the functions of libc's ctype.h and strings.h.
Implements some of the functions of libc's ctype.h and strings.h.
NOTE: A number of the ctype.h and strings.h functions are now builtin
functions in calc.
WARNING: If the remaining functions in this calc resource file become
calc builtin functions, then strings.cal may be removed in
a future release.
sumsq.cal
@@ -1774,7 +1798,7 @@ zeta2.cal
for information on this special zeta function.
## Copyright (C) 2000 David I. Bell and Landon Curt Noll
## Copyright (C) 2000,2014 David I. Bell and Landon Curt Noll
##
## Primary author: Landon Curt Noll
##
@@ -1792,8 +1816,8 @@ zeta2.cal
## received a copy with calc; if not, write to Free Software Foundation, Inc.
## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
##
## @(#) $Revision: 30.6 $
## @(#) $Id: README,v 30.6 2013/08/18 20:01:53 chongo Exp $
## @(#) $Revision: 30.9 $
## @(#) $Id: README,v 30.9 2014/10/06 08:44:18 chongo Exp $
## @(#) $Source: /usr/local/src/bin/calc/cal/RCS/README,v $
##
## Under source code control: 1990/02/15 01:50:32

View File

@@ -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.12 $
* @(#) $Id: alg_config.cal,v 30.12 2016/02/06 08:38:56 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,40 @@ 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);
printf("WARNING: This tool may not be computing the correct best value\n");
test_time = 5.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;
high = 8;
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 +401,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 = 2;
low = high;
high *= expand;
if (config("user_debug") > 1) {
@@ -368,20 +413,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 +478,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 +533,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 +679,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 +732,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 +775,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 +809,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 +836,40 @@ 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);
printf("WARNING: This tool may not be computing the correct best value\n");
test_time = 5.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;
high = 8;
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 +882,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 = 2;
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 +959,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 +1174,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 +1197,7 @@ define pow_ratio(len)
/*
* setup
*/
ex = 5;
ex = 7;
/*
* initialize x, the values we will pmod
@@ -1026,12 +1233,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 +1277,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 +1311,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 +1338,25 @@ 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);
printf("WARNING: This tool may not be computing the correct best value\n");
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 +1367,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 +1429,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 +1458,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;
}

88
cal/infinities.cal Normal file
View File

@@ -0,0 +1,88 @@
/*
* infinities - handle infinities symbolically, a little helper file
*
* Copyright (C) 2013 Christoph Zurnieden
*
* 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.
*/
static resource_debug_level;
resource_debug_level = config("resource_debug", 0);
define isinfinite(x)
{
if (isstr(x)) {
if (strncmp(x, "cinf", 4) == 0
|| strncmp(x, "pinf", 4) == 0 || strncmp(x, "ninf", 4) == 0)
return 1;
}
return 0;
}
define iscinf(x)
{
if (isstr(x)) {
if (strncmp(x, "cinf", 4) == 0)
return 1;
}
return 0;
}
define ispinf(x)
{
if (isstr(x)) {
if (strncmp(x, "pinf", 4) == 0)
return 1;
}
return 0;
}
define isninf(x)
{
if (isstr(x)) {
if (strncmp(x, "ninf", 4) == 0)
return 1;
}
return 0;
}
define cinf()
{
return "cinf";
}
define ninf()
{
return "ninf";
}
define pinf()
{
return "pinf";
}
config("resource_debug", resource_debug_level),;
if (config("resource_debug") & 3) {
print "isinfinite(x)";
print "iscinf(x)";
print "ispinf(x)";
print "isninf(x)";
print "cinf()";
print "ninf()";
print "pinf()";
}

728
cal/intnum.cal Normal file
View File

@@ -0,0 +1,728 @@
/*
* intnum - implementation of tanhsinh- and Gauss-Legendre quadrature
*
* Copyright (C) 2013 Christoph Zurnieden
*
* 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.
*/
static resource_debug_level;
resource_debug_level = config("resource_debug", 0);
read -once infinities;
static __CZ__tanhsinh_x;
static __CZ__tanhsinh_w;
static __CZ__tanhsinh_order;
static __CZ__tanhsinh_prec;
define quadtsdeletenodes()
{
free(__CZ__tanhsinh_x);
free(__CZ__tanhsinh_w);
free(__CZ__tanhsinh_order);
free(__CZ__tanhsinh_prec);
}
define quadtscomputenodes(order, expo, eps)
{
local t cht sht chp sum k PI places;
local h t0 x w;
if (__CZ__tanhsinh_order == order && __CZ__tanhsinh_prec == eps)
return 1;
__CZ__tanhsinh_order = order;
__CZ__tanhsinh_prec = eps;
__CZ__tanhsinh_x = list();
__CZ__tanhsinh_w = list();
/* The tanhsinh algorithm needs a slightly higher precision than G-L */
eps = epsilon(eps * 1e-2);
places = highbit(1 + int (1 / epsilon())) +1;
PI = pi();
sum = 0;
t0 = 2 ^ (-expo);
h = 2 * t0;
/*
* The author wanted to use the mpmath trick here which was
* advertised---and reasonably so!---to be faster. Didn't work out
* so well with calc.
* PI4 = PI/4;
* expt0 = bround(exp(t0),places);
* a = bround( PI4 * expt0,places);
* b = bround(PI4 / expt0,places);
* udelta = bround(exp(h),places);
* urdelta = bround(1/udelta,places);
*/
/* make use of x(-t) = -x(t), w(-t) = w(t) */
for (k = 0; k < 20 * order + 1; k++) {
/*
* x = tanh(pi/2 * sinh(t))
* w = pi/2 * cosh(t) / cosh(pi/2 * sinh(t))^2
*/
t = bround(t0 + k * h, places);
cht = bround(cosh(t), places);
sht = bround(sinh(t), places);
chp = bround(cosh(0.5 * PI * sht), places);
x = bround(tanh(0.5 * PI * sht), places);
w = bround((PI * h * cht) / (2 * chp ^ 2), places);
/*
* c = bround(exp(a-b),places);
* d = bround(1/c,places);
* co =bround( (c+d)/2,places);
* si =bround( (c-d)/2,places);
* x = bround(si / co,places);
* w = bround((a+b) / co^2,places);
*/
if (abs(x - 1) <= eps)
break;
append(__CZ__tanhsinh_x, x);
append(__CZ__tanhsinh_w, w);
/*
* a *= udelta;
* b *= urdelta;
*/
}
/* Normalize the weights to make them add up to 2 (two) */
/*
* for(k=0;k < size(__CZ__tanhsinh_w);k++)
* sum = bround(sum + __CZ__tanhsinh_w[k],places);
* sum *= 2;
* for(k=0;k < size(__CZ__tanhsinh_w);k++)
* __CZ__tanhsinh_w[k] = bround(2.0 * __CZ__tanhsinh_w[k] / sum,places);
*/
epsilon(eps);
return 1;
}
define quadtscore(a, b, n)
{
local k c d order eps places sum ret x x1 x2 xm w w1 w2 m sizel;
eps = epsilon(epsilon() * 1e-2);
places = highbit(1 + int (1 / epsilon())) +1;
m = int (4 + max(0, ln(places / 30.0) / ln(2))) + 2;
if (!isnull(n)) {
order = n;
m = ilog(order / 3, 2) + 1;
} else
order = 3 * 2 ^ (m - 1);
quadtscomputenodes(order, m, epsilon());
sizel = size(__CZ__tanhsinh_w);
if (isinfinite(a) || isinfinite(b)) {
/*
* x
* t = ------------
* 2
* sqrt(1 - y )
*/
if (isninf(a) && ispinf(b)) {
for (k = 0; k < sizel; k++) {
x1 = __CZ__tanhsinh_x[k];
x2 = -__CZ__tanhsinh_x[k];
w1 = __CZ__tanhsinh_w[k];
x = bround(x1 * (1 - x1 ^ 2) ^ (-1 / 2), places);
xm = bround(x2 * (1 - x2 ^ 2) ^ (-1 / 2), places);
w = bround(w1 * (((1 - x1 ^ 2) ^ (-1 / 2)) / (1 - x1 ^ 2)),
places);
w2 = bround(w1 * (((1 - x2 ^ 2) ^ (-1 / 2)) / (1 - x2 ^ 2)),
places);
sum += bround(w * f(x), places);
sum += bround(w2 * f(xm), places);
}
}
/*
* 1
* t = - - + b + 1
* x
*/
else if (isninf(a) && !iscinf(b)) {
for (k = 0; k < sizel; k++) {
x1 = __CZ__tanhsinh_x[k];
x2 = -__CZ__tanhsinh_x[k];
w1 = __CZ__tanhsinh_w[k];
x = bround((b + 1) - (2 / (x1 + 1)), places);
xm = bround((b + 1) - (2 / (x2 + 1)), places);
w = bround(w1 * (1 / 2 * (2 / (x1 + 1)) ^ 2), places);
w2 = bround(w1 * (1 / 2 * (2 / (x2 + 1)) ^ 2), places);
sum += bround(w * f(x), places);
sum += bround(w2 * f(xm), places);
}
}
/*
* 1
* t = - + a - 1
* x
*/
else if (!iscinf(a) && ispinf(b)) {
for (k = 0; k < sizel; k++) {
x1 = __CZ__tanhsinh_x[k];
x2 = -__CZ__tanhsinh_x[k];
w1 = __CZ__tanhsinh_w[k];
x = bround((a - 1) + (2 / (x1 + 1)), places);
xm = bround((a - 1) + (2 / (x2 + 1)), places);
w = bround(w1 * (((1 / 2) * (2 / (x1 + 1)) ^ 2)), places);
w2 = bround(w1 * (((1 / 2) * (2 / (x2 + 1)) ^ 2)), places);
sum += bround(w * f(x), places);
sum += bround(w2 * f(xm), places);
}
} else if (isninf(a) || isninf(b)) {
/*TODO: swap(a,b) and negate(w)? Lookup! */
return newerror("quadtscore: reverse limits?");
} else {
return
newerror("quadtscore: complex infinity not yet implemented");
}
ret = sum;
} else {
/* Avoid rounding errors */
if (a == -1 && b == 1) {
c = 1;
d = 0;
} else {
c = (b - a) / 2;
d = (b + a) / 2;
}
sum = 0;
for (k = 0; k < sizel; k++) {
sum +=
bround(__CZ__tanhsinh_w[k] * f(c * __CZ__tanhsinh_x[k] + d),
places);
sum +=
bround(__CZ__tanhsinh_w[k] * f(c * -__CZ__tanhsinh_x[k] + d),
places);
}
ret = c * sum;
}
epsilon(eps);
return ret;
}
static __CZ__quadts_error;
define quadts(a, b, points)
{
local k sp results epsbits nsect interval length segment slope C ;
local x1 x2 y1 y2 sum D1 D2 D3 D4;
if (param(0) < 2)
return newerror("quadts: not enough arguments");
epsbits = highbit(1 + int (1 / epsilon())) +1;
if (param(0) < 3 || isnull(points)) {
/* return as given */
return quadtscore(a, b);
} else {
if ((isinfinite(a) || isinfinite(b))
&& (!ismat(points) && !islist(points)))
return
newerror(strcat
("quadts: segments of infinite length ",
"are not yet supported"));
if (ismat(points) || islist(points)) {
sp = size(points);
if (sp == 0)
return
newerror(strcat
("quadts: variable 'points` must be a list or ",
"1d-matrix of a length > 0"));
/* check if all points are numbers */
for (k = 0; k < sp; k++) {
if (!isnum(points[k]))
return
newerror(strcat
("quadts: elements of 'points` must be",
" numbers only"));
}
/* We have n-1 intervals and a and b, hence n-1 + 2 results */
results = mat[sp + 1];
if (a != points[0]) {
results[0] = quadtscore(a, points[0]);
} else {
results[0] = 0;
}
if (sp == 1) {
if (b != points[0]) {
results[1] = quadtscore(points[0], b);
} else {
results[1] = 0;
}
} else {
for (k = 1; k < sp; k++) {
results[k] = quadtscore(points[k - 1], points[k]);
}
if (b != points[k - 1]) {
results[k] = quadtscore(points[k - 1], b);
} else {
results[k] = 0;
}
}
} else {
if (!isint(points) || points <= 0)
return newerror(strcat("quadts: variable 'points` must be a ",
"list or a positive integer"));
/* Taking "points" as the number of equally spaced intervals */
results = mat[points + 1];
/* It is easy if a,b lie on the real line */
if (isreal(a) && isreal(b)) {
length = abs(a - b);
segment = length / points;
for (k = 1; k <= points; k++) {
results[k - 1] =
quadtscore(a + (k - 1) * segment, a + k * segment);
}
} else {
/* We have at least one complex limit but treat "points" still
* as the number of equally spaced intervals on a straight line
* connecting a and b. Computing the segments here is a bit
* more complicated but not much, it should have been taught in
* highschool.
* Other contours by way of a list of points */
slope = (im(b) - im(a)) / (re(b) - re(a));
C = (im(a) + slope) * re(a);
length = abs(re(a) - re(b));
segment = length / points;
/* y = mx+C where m is the slope, x is the real part and y the
* imaginary part */
if(re(a)>re(b))swap(a,b);
for (k = re(a); k <= (re(b)); k+=segment) {
x1 = slope*(k) + C;
results[k] = quadtscore(k + x1 * 1i);
}
} /* else of isreal */
} /* else of ismat|islist */
} /* else of isnull(points) */
/* With a bit of undeserved luck we have a result by now. */
sp = size(results);
for (k = 0; k < sp; k++) {
sum += results[k];
}
return sum;
}
static __CZ__gl_x;
static __CZ__gl_w;
static __CZ__gl_order;
static __CZ__gl_prec;
define quadglcomputenodes(N)
{
local places k l x w t1 t2 t3 t4 t5 r tmp;
if (__CZ__gl_order == N && __CZ__gl_prec == epsilon())
return;
__CZ__gl_x = mat[N];
__CZ__gl_w = mat[N];
__CZ__gl_order = N;
__CZ__gl_prec = epsilon();
places = highbit(1 + int (1 / epsilon())) +1;
/*
* Compute roots and weights (doing it inline seems to be fastest)
* Trick shamelessly stolen from D. Bailey et .al (program "arprec")
*/
for (k = 1; k <= N//2; k++) {
r = bround(cos(pi() * (k - .25) / (N + .5)), places);
while (1) {
t1 = 1, t2 = 0;
for (l = 1; l <= N; l++) {
t3 = t2;
t2 = t1;
t1 = bround(((2 * l - 1) * r * t2 - (l - 1) * t3) / l, places);
}
t4 = bround(N * (r * t1 - t2) / ((r ^ 2) - 1), places);
t5 = r;
tmp = t1 / t4;
r = r - tmp;
if (abs(tmp) <= epsilon())
break;
}
x = r;
w = bround(2 / ((1 - r ^ 2) * t4 ^ 2), places);
__CZ__gl_x[k - 1] = x;
__CZ__gl_w[k - 1] = w;
__CZ__gl_x[N - k] = -__CZ__gl_x[k - 1];
__CZ__gl_w[N - k] = __CZ__gl_w[k - 1];
}
return;
}
define quadgldeletenodes()
{
free(__CZ__gl_x);
free(__CZ__gl_w);
free(__CZ__gl_order);
free(__CZ__gl_prec);
}
define quadglcore(a, b, n)
{
local k c d digs order eps places sum ret err x x1 w w1 m;
local phalf x2 px1 spx1 u b1 a1 half;
eps = epsilon(epsilon() * 1e-2);
places = highbit(1 + int (1 / epsilon())) +1;
if (!isnull(n))
order = n;
else {
m = int (4 + max(0, ln(places / 30.0) / ln(2))) + 2;
order = 3 * 2 ^ (m - 1);
}
quadglcomputenodes(order, 1);
if (isinfinite(a) || isinfinite(b)) {
if (isninf(a) && ispinf(b)) {
for (k = 0; k < order; k++) {
x1 = __CZ__gl_x[k];
w1 = __CZ__gl_w[k];
x = bround(x1 * (1 - x1 ^ 2) ^ (-1 / 2), places);
w = bround(w1 * (((1 - x1 ^ 2) ^ (-1 / 2)) / (1 - x1 ^ 2)),
places);
sum += bround(w * f(x), places);
}
} else if (isninf(a) && !iscinf(b)) {
for (k = 0; k < order; k++) {
x1 = __CZ__gl_x[k];
w1 = __CZ__gl_w[k];
x = bround((b + 1) - (2 / (x1 + 1)), places);
w = bround(w1 * (1 / 2 * (2 / (x1 + 1)) ^ 2), places);
sum += bround(w * f(x), places);
}
} else if (!iscinf(a) && ispinf(b)) {
for (k = 0; k < order; k++) {
x1 = __CZ__gl_x[k];
w1 = __CZ__gl_w[k];
x = bround((a - 1) + (2 / (x1 + 1)), places);
w = bround(w1 * (((1 / 2) * (2 / (x1 + 1)) ^ 2)), places);
sum += bround(w * f(x), places);
}
} else if (isninf(a) || isninf(b)) {
/*TODO: swap(a,b) and negate(w)? Lookup! */
return newerror("quadglcore: reverse limits?");
} else
return
newerror("quadglcore: complex infinity not yet implemented");
ret = sum;
} else {
/* Avoid rounding errors */
if (a == -1 && b == 1) {
c = 1;
d = 0;
} else {
c = (b - a) / 2;
d = (b + a) / 2;
}
sum = 0;
for (k = 0; k < order; k++) {
sum += bround(__CZ__gl_w[k] * f(c * __CZ__gl_x[k] + d), places);
}
ret = c * sum;
}
epsilon(eps);
return ret;
}
define quadgl(a, b, points)
{
local k sp results epsbits nsect interval length segment slope C x1 y1 x2
y2;
local sum D1 D2 D3 D4;
if (param(0) < 2)
return newerror("quadgl: not enough arguments");
epsbits = highbit(1 + int (1 / epsilon())) +1;
if (isnull(points)) {
/* return as given */
return quadglcore(a, b);
} else {
/* But if we could half the time needed to execute a single operation
* we could do all of it in just twice that time. */
if (isinfinite(a) || isinfinite(b)
&& (!ismat(points) && !islist(points)))
return
newerror(strcat
("quadgl: multiple segments of infinite length ",
"are not yet supported"));
if (ismat(points) || islist(points)) {
sp = size(points);
if (sp == 0)
return
newerror(strcat
("quadgl: variable 'points` must be a list or ",
"1d-matrix of a length > 0"));
/* check if all points are numbers */
for (k = 0; k < sp; k++) {
if (!isnum(points[k]))
return
newerror(strcat
("quadgl: elements of 'points` must be ",
"numbers only"));
}
/* We have n-1 intervals and a and b, hence n-1 + 2 results */
results = mat[sp + 1];
if (a != points[0]) {
results[0] = quadglcore(a, points[0]);
} else {
results[0] = 0;
}
if (sp == 1) {
if (b != points[0]) {
results[1] = quadglcore(points[0], b);
} else {
results[1] = 0;
}
} else {
for (k = 1; k < sp; k++) {
results[k] = quadglcore(points[k - 1], points[k]);
}
if (b != points[k - 1]) {
results[k] = quadglcore(points[k - 1], b);
} else {
results[k] = 0;
}
}
} else {
if (!isint(points) || points <= 0)
return newerror(strcat("quadgl: variable 'points` must be a ",
"list or a positive integer"));
/* Taking "points" as the number of equally spaced intervals */
results = mat[points + 1];
/* It is easy if a,b lie on the real line */
if (isreal(a) && isreal(b)) {
length = abs(a - b);
segment = length / points;
for (k = 1; k <= points; k++) {
results[k - 1] =
quadglcore(a + (k - 1) * segment, a + k * segment);
}
} else {
/* Other contours by way of a list of points */
slope = (im(b) - im(a)) / (re(b) - re(a));
C = (im(a) + slope) * re(a);
length = abs(re(a) - re(b));
segment = length / points;
/* y = mx+C where m is the slope, x is the real part and y the
* imaginary part */
if(re(a)>re(b))swap(a,b);
for (k = re(a); k <= (re(b)); k+=segment) {
x1 = slope*(k) + C;
results[k] = quadglcore(k + x1 * 1i);
}
} /* else of isreal */
} /* else of ismat|islist */
} /* else of isnull(points) */
/* With a bit of undeserved luck we have a result by now. */
sp = size(results);
for (k = 0; k < sp; k++) {
sum += results[k];
}
return sum;
}
define quad(a, b, points = -1, method = "tanhsinh")
{
if (isnull(a) || isnull(b) || param(0) < 2)
return newerror("quad: both limits must be given");
if (isstr(a)) {
if (strncmp(a, "cinf", 1) == 0)
return
newerror(strcat
("quad: complex infinity not yet supported, use",
" 'pinf' or 'ninf' respectively"));
}
if (isstr(b)) {
if (strncmp(b, "cinf", 1) == 0)
return
newerror(strcat
("quad: complex infinity not yet supported, use",
" 'pinf' or 'ninf' respectively"));
}
if (param(0) == 3) {
if (isstr(points))
method = points;
}
if (strncmp(method, "tanhsinh", 1) == 0) {
if (!isstr(points)) {
if (points == -1) {
return quadts(a, b);
} else {
return quadts(a, b, points);
}
} else {
return quadts(a, b);
}
}
if (strncmp(method, "gausslegendre", 1) == 0) {
if (!isstr(points)) {
if (points == -1) {
return quadgl(a, b);
} else {
return quadgl(a, b, points);
}
} else {
return quadgl(a, b);
}
}
}
define makerange(start, end, steps)
{
local ret k l step C length slope x1 x2 y1 y2;
local segment;
steps = int (steps);
if (steps < 1) {
return newerror("makerange: number of steps must be > 0");
}
if (!isnum(start) || !isnum(end)) {
return newerror("makerange: only numbers are supported yet");
}
if (isreal(start) && isreal(end)) {
step = (end - start) / (steps);
print step;
ret = mat[steps + 1];
for (k = 0; k <= steps; k++) {
ret[k] = k * step + start;
}
} else {
ret = mat[steps + 1];
if (re(start) > re(end)) {
swap(start, end);
}
slope = (im(end) - im(start)) / (re(end) - re(start));
C = im(start) - slope * re(start);
length = abs(re(start) - re(end));
segment = length / (steps);
for (k = re(start), l = 0; k <= (re(end)); k += segment, l++) {
x1 = slope * (k) + C;
ret[l] = k + x1 * 1i;
}
}
return ret;
}
define makecircle(radius, center, points)
{
local ret k a b twopi centerx centery;
if (!isint(points) || points < 2) {
return
newerror("makecircle: number of points is not a positive integer");
}
if (!isnum(center)) {
return newerror("makecircle: center does not lie on the complex plane");
}
if (!isreal(radius) || radius <= 0) {
return newerror("makecircle: radius is not a real > 0");
}
ret = mat[points];
twopi = 2 * pi();
centerx = re(center);
centery = im(center);
for (k = 0; k < points; k++) {
a = centerx + radius * cos(twopi * k / points);
b = centery + radius * sin(twopi * k / points);
ret[k] = a + b * 1i;
}
return ret;
}
define makeellipse(angle, a, b, center, points)
{
local ret k x y twopi centerx centery;
if (!isint(points) || points < 2) {
return
newerror("makeellipse: number of points is not a positive integer");
}
if (!isnum(center)) {
return
newerror("makeellipse: center does not lie on the complex plane");
}
if (!isreal(a) || a <= 0) {
return newerror("makecircle: a is not a real > 0");
}
if (!isreal(b) || b <= 0) {
return newerror("makecircle: b is not a real > 0");
}
if (!isreal(angle)) {
return newerror("makecircle: angle is not a real");
}
ret = mat[points];
twopi = 2 * pi();
centerx = re(center);
centery = im(center);
for (k = 0; k < points; k++) {
x = centerx + a * cos(twopi * k / points) * cos(angle)
- b * sin(twopi * k / points) * sin(angle);
y = centerx + a * cos(twopi * k / points) * sin(angle)
+ b * sin(twopi * k / points) * cos(angle);
ret[k] = x + y * 1i;
}
return ret;
}
define makepoints()
{
local ret k;
ret = mat[param(0)];
for (k = 0; k < param(0); k++) {
if (!isnum(param(k + 1))) {
return
newerror(strcat
("makepoints: parameter number \"", str(k + 1),
"\" is not a number"));
}
ret[k] = param(k + 1);
}
return ret;
}
config("resource_debug", resource_debug_level),;
if (config("resource_debug") & 3) {
print "quadtsdeletenodes()";
print "quadtscomputenodes(order, expo, eps)";
print "quadtscore(a,b,n)";
print "quadts(a,b,points)";
print "quadglcomputenodes(N)";
print "quadgldeletenodes()";
print "quadglcore(a,b,n)";
print "quadgl(a,b,points)";
print "quad(a,b,points=-1,method=\"tanhsinh\")";
print "makerange(start, end, steps)";
print "makecircle(radius, center, points)";
print "makeellipse(angle, a, b, center, points)";
print "makepoints(a1,[...])";
}

View File

@@ -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: lucas.cal,v 30.1 2007/03/16 11:09:54 chongo Exp $
* @(#) $Revision: 30.2 $
* @(#) $Id: lucas.cal,v 30.2 2013/09/27 08:58:46 chongo Exp $
* @(#) $Source: /usr/local/src/bin/calc/cal/RCS/lucas.cal,v $
*
* Under source code control: 1990/05/03 16:49:51
@@ -442,7 +442,7 @@ lucas(h, n)
* See the function gen_v1() for details on the value of v(1).
*
* input:
* h - h as in h*2^n-1 (h mod 2 != 0)
* h - h as in h*2^n-1
* n - n as in h*2^n-1
* v1 - gen_v1(h,n) (see function below)
*
@@ -475,13 +475,6 @@ gen_u0(h, n, v1)
quit "bogus arg: v1 is <= 0";
}
/*
* enforce the h mod rules
*/
if (h%2 == 0) {
quit "h must not be even";
}
/*
* enforce the h > 0 and n >= 2 rules
*/

View File

@@ -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.10 $
* @(#) $Id: regress.cal,v 30.10 2013/09/01 22:08:44 chongo Exp $
* @(#) $Revision: 30.13 $
* @(#) $Id: regress.cal,v 30.13 2016/02/06 08:39:35 chongo Exp $
* @(#) $Source: /usr/local/src/bin/calc/cal/RCS/regress.cal,v $
*
* Under source code control: 1990/02/15 01:50:36
@@ -403,14 +403,14 @@ define test_config()
'512: config("trace") == 0');
vrfy(config("maxprint") == 16,
'513: config("maxprint") == 16');
vrfy(config("mul2") == 1780,
'514: config("mul2") == 1780');
vrfy(config("sq2") == 3388,
'515: config("sq2") == 3388');
vrfy(config("pow2") == 176,
'516: config("pow2") == 176');
vrfy(config("redc2") == 220,
'517: config("redc2") == 220');
vrfy(config("mul2") == 28,
'514: config("mul2") == 28');
vrfy(config("sq2") == 28,
'515: config("sq2") == 28');
vrfy(config("pow2") == 20,
'516: config("pow2") == 20');
vrfy(config("redc2") == 25,
'517: config("redc2") == 25');
vrfy(config("tilde"),
'518: config("tilde")');
vrfy(config("tab"),
@@ -768,6 +768,8 @@ print '016: parsed test_bignums()';
/*
* Test many of the built-in functions.
*
* See test_functionss() starting at test 9000 for more built-in function tests.
*/
define test_functions()
{
@@ -1445,91 +1447,10 @@ define test_functions()
vrfy(jacobi(-1,-1) == 0, '1236: jacobi(-1,-1) == 0');
vrfy(jacobi(0,-1) == 0, '1237: jacobi(0,-1) == 0');
/* ctype function tests */
vrfy(isalnum("A") == 1, '1238: isalnum("A") == 1');
vrfy(isalnum("a") == 1, '1239: isalnum("a") == 1');
vrfy(isalnum("2") == 1, '1239: isalnum("2") == 1');
vrfy(isalnum("\t") == 0, '1240: isalnum("\t") == 0');
vrfy(isalpha("A") == 1, '1241: isalpha("A") == 1');
vrfy(isalpha("a") == 1, '1242: isalpha("a") == 1');
vrfy(isalpha("2") == 0, '1243: isalpha("2") == 0');
vrfy(isalpha("\t") == 0, '1244: isalpha("\t") == 0');
vrfy(iscntrl("A") == 0, '1245: iscntrl("A") == 0');
vrfy(iscntrl("a") == 0, '1246: iscntrl("a") == 0');
vrfy(iscntrl("2") == 0, '1247: iscntrl("2") == 0');
vrfy(iscntrl("\t") == 1, '1248: iscntrl("\t") == 1');
vrfy(isdigit("A") == 0, '1249: isdigit("A") == 0');
vrfy(isdigit("a") == 0, '1250: isdigit("a") == 0');
vrfy(isdigit("2") == 1, '1251: isdigit("2") == 1');
vrfy(isdigit("\t") == 0, '1252: isdigit("\t") == 0');
vrfy(isgraph("A") == 1, '1253: isgraph("A") == 1');
vrfy(isgraph("a") == 1, '1254: isgraph("a") == 1');
vrfy(isgraph("2") == 1, '1255: isgraph("2") == 1');
vrfy(isgraph("\t") == 0, '1255: isgraph("\t") == 0');
vrfy(islower("A") == 0, '1256: islower("A") == 0');
vrfy(islower("a") == 1, '1257: islower("a") == 1');
vrfy(islower("1") == 0, '1258: islower("1") == 0');
vrfy(isprint("A") == 1, '1259: isprint("A") == 1');
vrfy(isprint("a") == 1, '1260: isprint("a") == 1');
vrfy(isprint(" ") == 1, '1261: isprint(" ") == 1');
vrfy(isprint("\t") == 0, '1262: isprint("\t") == 0');
vrfy(ispunct("A") == 0, '1263: ispunct("A") == 0');
vrfy(ispunct("a") == 0, '1264: ispunct("a") == 0');
vrfy(ispunct(" ") == 0, '1265: ispunct(" ") == 0');
vrfy(ispunct("?") == 1, '1266: ispunct("?") == 1');
vrfy(isspace("A") == 0, '1267: isspace("A") == 0');
vrfy(isspace("Krik") == 0, '1268: isspace("Krik") == 0');
vrfy(isspace(" ") == 1, '1269: isspace(" ") == 1');
vrfy(isspace("?") == 0, '1270: isspace("?") == 0');
vrfy(isupper("A") == 1, '1271: isupper("A") == 1');
vrfy(isupper("a") == 0, '1272: isupper("a") == 0');
vrfy(isupper("1") == 0, '1273: isupper("1") == 0');
vrfy(isxdigit("A") == 1, '1274: isxdigit("A") == 1');
vrfy(isxdigit("f") == 1, '1275: isxdigit("f") == 1');
vrfy(isxdigit("2") == 1, '1276: isxdigit("2") == 1');
vrfy(isxdigit("x") == 0, '1277: isxdigit("x") == 0');
vrfy(strcasecmp("ab", "aBc") == -1,
'1278: strcasecmp("ab", "aBc") == -1');
vrfy(strcasecmp("abc", "aBb") == 1,
'1279: strcasecmp("abc", "aBb") == 1');
vrfy(strcasecmp("abc", "abc") == 0,
'1280: strcasecmp("abc", "abc") == 0');
vrfy(strcasecmp("abc", "aBc") == 0,
'1281: strcasecmp("abc", "aBc") == 0');
vrfy(strcasecmp("abc", "aBd") == -1,
'1282: strcasecmp("abc", "aBd") == -1');
vrfy(strcasecmp("abc\0", "aBc") == 1,
'1283: strcasecmp("abc\0", "aBc") == 1');
vrfy(strcasecmp("a\0b", "A\0c") == -1,
'1284: strcasecmp("a\0b", "A\0c") == -1');
vrfy(strncasecmp("abc", "xyz", 0) == 0,
'1285: strncasecmp("abc", "xyz", 0) == 0');
vrfy(strncasecmp("abc", "xyz", 1) == -1,
'1286: strncasecmp("abc", "xyz", 1) == -1');
vrfy(strncasecmp("abc", "", 1) == 1,
'1287: strncasecmp("abc", "", 1) == 1');
vrfy(strncasecmp("a", "b", 2) == -1,
'1288: strncasecmp("a", "b", 2) == -1');
vrfy(strncasecmp("ab", "Ac", 2) == -1,
'1289: strncasecmp("ab", "Ac", 2) == -1');
vrfy(strncasecmp("\0ac", "\0b", 2) == -1,
'1290: strncasecmp("\0ac", "\0b", 2) == -1');
vrfy(strncasecmp("ab", "aBc", 2) == 0,
'1291: strncasecmp("ab", "aBc", 2) == 0');
vrfy(strncasecmp("abc", "abd", 2) == 0,
'1292: strncasecmp("abc", "abd", 2) == 0');
/*
* NOTE: Function tests are continued in test_functionss()
* starting at test 9000.
*/
print '1293: Ending test_functions';
}
@@ -8015,9 +7936,128 @@ print '8901: read -once "test8900"';
read -once "test8900";
print '8902: about to run test8900(1,,8903)';
testnum = test8900(1,,8903);
print '8999: ecnt = 203;'
ecnt = 203;
/* 89xx: test calc resource functions by Christoph Zurnieden */
/*
* Test more of the built-in functions.
*
* See test_functions() (test 700 - 1238) for other built-in function tests.
*/
define test_functions2()
{
print '9001: Beginning test_functions2';
/* ctype function tests */
vrfy(isalnum("A") == 1, '9002: isalnum("A") == 1');
vrfy(isalnum("a") == 1, '9003: isalnum("a") == 1');
vrfy(isalnum("2") == 1, '9004: isalnum("2") == 1');
vrfy(isalnum("\t") == 0, '9005: isalnum("\\t") == 0');
vrfy(isalpha("A") == 1, '9006: isalpha("A") == 1');
vrfy(isalpha("a") == 1, '9007: isalpha("a") == 1');
vrfy(isalpha("2") == 0, '9008: isalpha("2") == 0');
vrfy(isalpha("\t") == 0, '9009: isalpha("\\t") == 0');
vrfy(iscntrl("A") == 0, '9010: iscntrl("A") == 0');
vrfy(iscntrl("a") == 0, '9011: iscntrl("a") == 0');
vrfy(iscntrl("2") == 0, '9012: iscntrl("2") == 0');
vrfy(iscntrl("\t") == 1, '9013: iscntrl("\\t") == 1');
vrfy(isdigit("A") == 0, '9014: isdigit("A") == 0');
vrfy(isdigit("a") == 0, '9015: isdigit("a") == 0');
vrfy(isdigit("2") == 1, '9016: isdigit("2") == 1');
vrfy(isdigit("\t") == 0, '9017: isdigit("\\t") == 0');
vrfy(isgraph("A") == 1, '9018: isgraph("A") == 1');
vrfy(isgraph("a") == 1, '9019: isgraph("a") == 1');
vrfy(isgraph("2") == 1, '9020: isgraph("2") == 1');
vrfy(isgraph("\t") == 0, '9021: isgraph("\\t") == 0');
vrfy(islower("A") == 0, '9022: islower("A") == 0');
vrfy(islower("a") == 1, '9023: islower("a") == 1');
vrfy(islower("1") == 0, '9024: islower("1") == 0');
vrfy(isprint("A") == 1, '9025: isprint("A") == 1');
vrfy(isprint("a") == 1, '9026: isprint("a") == 1');
vrfy(isprint(" ") == 1, '9027: isprint(" ") == 1');
vrfy(isprint("\t") == 0, '9028: isprint("\\t") == 0');
vrfy(ispunct("A") == 0, '9029: ispunct("A") == 0');
vrfy(ispunct("a") == 0, '9030: ispunct("a") == 0');
vrfy(ispunct(" ") == 0, '9031: ispunct(" ") == 0');
vrfy(ispunct("?") == 1, '9032: ispunct("?") == 1');
vrfy(isspace("A") == 0, '9033: isspace("A") == 0');
vrfy(isspace("Krik") == 0, '9034: isspace("Krik") == 0');
vrfy(isspace(" ") == 1, '9035: isspace(" ") == 1');
vrfy(isspace("?") == 0, '9036: isspace("?") == 0');
vrfy(isupper("A") == 1, '9037: isupper("A") == 1');
vrfy(isupper("a") == 0, '9038: isupper("a") == 0');
vrfy(isupper("1") == 0, '9039: isupper("1") == 0');
vrfy(isxdigit("A") == 1, '9040: isxdigit("A") == 1');
vrfy(isxdigit("f") == 1, '9041: isxdigit("f") == 1');
vrfy(isxdigit("2") == 1, '9042: isxdigit("2") == 1');
vrfy(isxdigit("x") == 0, '9043: isxdigit("x") == 0');
vrfy(strcasecmp("ab", "aBc") == -1,
'9044: strcasecmp("ab", "aBc") == -1');
vrfy(strcasecmp("abc", "aBb") == 1,
'9045: strcasecmp("abc", "aBb") == 1');
vrfy(strcasecmp("abc", "abc") == 0,
'9046: strcasecmp("abc", "abc") == 0');
vrfy(strcasecmp("abc", "aBc") == 0,
'9047: strcasecmp("abc", "aBc") == 0');
vrfy(strcasecmp("abc", "aBd") == -1,
'9048: strcasecmp("abc", "aBd") == -1');
vrfy(strcasecmp("abc\0", "aBc") == 1,
'9049: strcasecmp("a8c\\0", "aBc") == 1');
vrfy(strcasecmp("a\0b", "A\0c") == -1,
'9050: strcasecmp("a\\0b", "A\\0c") == -1');
vrfy(strncasecmp("abc", "xyz", 0) == 0,
'9051: strncasecmp("abc", "xyz", 0) == 0');
vrfy(strncasecmp("abc", "xyz", 1) == -1,
'9052: strncasecmp("abc", "xyz", 1) == -1');
vrfy(strncasecmp("abc", "", 1) == 1,
'9053: strncasecmp("abc", "", 1) == 1');
vrfy(strncasecmp("a", "b", 2) == -1,
'9054: strncasecmp("a", "b", 2) == -1');
vrfy(strncasecmp("ab", "Ac", 2) == -1,
'9055: strncasecmp("ab", "Ac", 2) == -1');
vrfy(strncasecmp("\0ac", "\0b", 2) == -1,
'9056: strncasecmp("\\0ac", "\\0b", 2) == -1');
vrfy(strncasecmp("ab", "aBc", 2) == 0,
'9057: strncasecmp("ab", "aBc", 2) == 0');
vrfy(strncasecmp("abc", "abd", 2) == 0,
'9058: strncasecmp("abc", "abd", 2) == 0');
local s1 = " gnu lesser general public license";
print '9059: local s1 = " gnu lesser general public license";';
vrfy(strcmp(strtolower(" GNU Lesser General Public License"), s1) == 0,
'9060: strcmp(strtolower(" GNU Lesser General Public License"),' +
' s1) == 0');
local s2 = " GNU LESSER GENERAL PUBLIC LICENSE";
print '9061: local s2 = " GNU LESSER GENERAL PUBLIC LICENSE";';
vrfy(strcmp(strtoupper(" GNU Lesser General Public License"), s2) == 0,
'9062: strcmp(strtoupper(" GNU Lesser General Public License"),' +
' s2) == 0');
print '9063: Ending test_functions2';
}
print;
print '9000: parsed test_functions2()';
print;
return test_functions2();
/*
* read various calc resource files
*

71
cal/smallfactors.cal Normal file
View File

@@ -0,0 +1,71 @@
/*
* smallfactors - find the factors of a number < 2^32
*
* Copyright (C) 2013 Christoph Zurnieden
*
* 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.
*/
static resource_debug_level;
resource_debug_level = config("resource_debug", 0);
define smallfactors(x0)
{
local d q x flist tuple w;
if (x >= (2 ^ 32) - 1)
return newerror("smallfactors: number must be < 2^32 -1");
tuple = mat[2];
flist = list();
x = x0;
d = 2;
q = 0;
tuple[0] = d;
if (x < 2)
return 0;
do {
q = x // d;
while (x == (q * d)) {
tuple[0] = d;
tuple[1]++;
x = floor(q);
q = x // d;
}
d = nextprime(d);
if (tuple[1] > 0)
append(flist, tuple);
tuple = mat[2];
} while (d <= x);
return flist;
}
define printsmallfactors(flist)
{
local k;
for (k = 0; k < size(flist); k++) {
print flist[k][0]:"^":flist[k][1];
}
}
config("resource_debug", resource_debug_level),;
if (config("resource_debug") & 3) {
print "smallfactors(x0)";
print "printsmallfactors(flist)";
}

41
cal/strings.cal Normal file
View File

@@ -0,0 +1,41 @@
/*
* strings - implementation of some of the macros in ctype.h
*
* Copyright (C) 2013 Christoph Zurnieden
*
* 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.
*/
static resource_debug_level;
resource_debug_level = config("resource_debug", 0);
define isascii(c){
c = ord(c);
return (c >= 0 && c< 128);
}
define isblank(c){
c = ord(c);
return ( c == 32 || c == 9 );
}
config("resource_debug", resource_debug_level),;
if (config("resource_debug") & 3) {
print "isascii(c)";
print "isblank(c)";
}

12
calc.h
View File

@@ -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 */

View File

@@ -1,5 +1,5 @@
.\"
.\" 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
@@ -15,8 +15,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: calc.man,v 30.5 2013/08/11 08:41:38 chongo Exp $
.\" @(#) $Revision: 30.6 $
.\" @(#) $Id: calc.man,v 30.6 2014/10/06 08:39:45 chongo Exp $
.\" @(#) $Source: /usr/local/src/bin/calc/RCS/calc.man,v $
.\"
.\" Under source code control: 1991/07/23 05:48:26
@@ -1115,45 +1115,62 @@ To contribute comments, suggestions, enhancements
and interesting
.B calc
resource files, and
shell scripts please join the low volume calc mailing list.
shell scripts please join the calc-tester
low volume moderated calc mailing list.
.sp
To join the low volume calc mailing list, send EMail to:
To the calc-tester mailing list, visit the following URL:
.sp
.in +0.5i
.nf
calc-tester-request at asthe dot com
https://www.listbox.com/subscribe/?list_id=239342
.fi
.in -0.5i
.sp
Your subject must contain the words:
To help determine you are a human and not just a spam bot,
you will be required to provide the following additional information:
.sp
.in +0.5i
.nf
calc mailing list subscription
Your Name
Calc Version
For example, the current version is: ${VERSION}
Operating System
If you don't know your operating system, enter: unknown
The date 7 days ago
Consult a calendar :-)
.fi
.in -0.5i
.sp
If you need a human to help you with your mailing list subscription,
or if you have problems with the above procedure, please
send EMail to our special address:
.sp
.in +0.5i
.nf
calc-tester-maillist-help at asthe dot com
NOTE: Remove spaces and replace 'at' with @, 'dot' with .
NOTE: Yes, the EMail address uses 'asthe',
while the web site uses 'isthe'.
.fi
.in -0.5i
.sp
To be sure we see your EMail asking for help with your mailing list
subscription, please use the following phase in your EMail Subject line
your subject must contain the words:
.sp
.in +0.5i
.nf
calc tester mailing list help
.fi
.in -0.5i
.sp
You may have additional words in your subject line.
.sp
Your message body must contain:
.sp
.in +0.5i
.nf
subscribe calc-tester address
end
name your_full_name
.fi
.in -0.5i
.sp
where
.B address
s your EMail address and
.B your_full_name
is your full name.
Feel free to follow the
.B name
line with additional EMail text as desired.
.sp
.SH "BUG REPORTS / BUG FIXES"
\&
.br
@@ -1162,12 +1179,12 @@ Send bug reports and bug fixes to:
.sp
.in +0.5i
.nf
calc-bugs at asthe dot com
calc-bug-report at asthe dot com
[[ NOTE: Replace 'at' with @, 'dot' is with . ]]
[[ and remove the spaces ]]
[[ NOTE: The EMail address uses 'asthe' and
[[ the web site URL uses 'isthe' ]]
NOTE: Remove spaces and replace 'at' with @, 'dot' with .
NOTE: Yes, the EMail address uses 'asthe',
while the web site uses 'isthe'.
.fi
.in -0.5i
.sp
@@ -1180,6 +1197,10 @@ calc bug report
.in -0.5i
.sp
You may have additional words in your subject line.
.in
However, you may find it more helpful to simply subscribe to the
calc-tester mailing list (see above) and then to send your report
to that mailing list as a wider set calc testers may be able to help you.
.sp
See the
.I BUGS

View File

@@ -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.11 $
# @(#) $Id: calc.spec.in,v 30.11 2013/08/11 08:41:38 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: 10
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)
@@ -146,11 +154,11 @@ rm -rf %{_buildroot}
%attr(644, root, root) %{_datadir}/%{name}/custom/*.cal
%attr(644, root, root) %{_datadir}/%{name}/help/*
%attr(644, root, root) %{_datadir}/%{name}/*.cal
%attr(644, root, root) %{_datadir}/%{name}/*.line
%attr(644, root, root) %{_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,7 +169,27 @@ rm -rf %{_buildroot}
%attr(644, root, root) %{_libdir}/libcustcalc.a
%changelog
* Sat May 05 2013 Landon Curt Noll http://www.isthe.com/chongo
* 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
* 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
@@ -171,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

View File

@@ -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: calcerr.tbl,v 30.3 2013/09/01 19:23:57 chongo Exp $
# @(#) $Revision: 30.4 $
# @(#) $Id: calcerr.tbl,v 30.4 2013/09/02 01:38:08 chongo Exp $
# @(#) $Source: /usr/local/src/bin/calc/RCS/calcerr.tbl,v $
#
# Under source code control: 1996/05/23 17:38:44
@@ -473,3 +473,5 @@ E_ISPRINT Bad argument for isprint
E_ISPUNCT Bad argument for ispunct
E_ISSPACE Bad argument for isspace
E_ISXDIGIT Bad argument for isxdigit
E_STRTOUPPER Bad argument type for strtoupper
E_STRTOLOWER Bad argument type for strtolower

View File

@@ -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
View File

@@ -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 */

View File

@@ -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 */

View File

@@ -1,4 +1,4 @@
#!/usr/local/src/cmd/calc/calc -q -s -f
#!/usr/local/src/bin/calc/calc -q -s -f
/*
* 4dsphere - determine if 6 points lie on the surface of a sphere in R^4
*
@@ -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

View File

@@ -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 $@

View File

@@ -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,27 +36,51 @@ 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 /*
# is is also wrong because the first line does not end in -f
print "This example has invalid comments"
#####
If you write something that you think is useful, please send it to:
calc-contrib at asthe dot com
[[ NOTE: Replace 'at' with @, 'dot' is with . and remove the spaces ]]
[[ NOTE: The EMail address uses 'asthe' and the web site URL uses 'isthe' ]]
=-=
For more info, see:
help script
help cscript
#####
If you write something that you think is useful, please join the
low volume calc mailing list calc-tester. Then send your contribution
to the calc-tester mailing list.
To subscribe to the calc-tester mailing list, visit the following URL:
http://www.isthe.com/chongo/tech/comp/calc/calc-tester.html
This is a low volume moderated mailing list.
This mailing list replaces calc-tester at asthe dot com list.
If you need a human to help you with your mailing list subscription,
please send EMail to our special:
calc-tester-maillist-help at asthe dot com
NOTE: Remove spaces and replace 'at' with @, 'dot' with .
address. To be sure we see your EMail asking for help with your
mailing list subscription, please use the following phase in your
EMail Subject line:
calc tester mailing list help
That phrase in your subject line will help ensure your
request will get past our anti-spam filters. You may have
additional words in your subject line.
=-=
4dsphere
@@ -101,7 +125,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 +141,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.5 $
## @(#) $Id: README.src,v 30.5 2014/10/12 12:23:43 chongo Exp $
## @(#) $Source: /usr/local/src/bin/calc/cscript/RCS/README.src,v $
##
## Under source code control: 1999/12/17 10:23:40

View File

@@ -1,4 +1,4 @@
#!/usr/local/src/cmd/calc/calc -q -s -f
#!/usr/local/src/bin/calc/calc -q -s -f
/*
* fproduct - write the big Endian product of terms to a file
*
@@ -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

View File

@@ -1,8 +1,8 @@
#!/usr/local/src/cmd/calc/calc -q -s -f
#!/usr/local/src/bin/calc/calc -q -s -f
/*
* mersenne - print the value of a mersenne number
*
* 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;

View File

@@ -1,8 +1,8 @@
#!/usr/local/src/cmd/calc/calc -q -f
#!/usr/local/src/bin/calc/calc -q -f
/*
* piforever - print digits of pi forever (or as long as your mem/cpu allow)
*
* 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

View File

@@ -1,8 +1,8 @@
#!/usr/local/src/cmd/calc/calc -q -f
#!/usr/local/src/bin/calc/calc -q -f
/*
* plus - add two or more arguments together
*
* 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

View File

@@ -1,4 +1,4 @@
#!/usr/local/src/cmd/calc/calc -q -s -f
#!/usr/local/src/bin/calc/calc -q -s -f
/*
* powerterm - print the argument as a sum of powers of integers
*
@@ -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

View File

@@ -1,8 +1,8 @@
#!/usr/local/src/cmd/calc/calc -q -f
#!/usr/local/src/bin/calc/calc -q -f
/*
* simple - an example of a simple calc shell script
*
* 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

View File

@@ -1,8 +1,8 @@
#!/usr/local/src/cmd/calc/calc -q -f
#!/usr/local/src/bin/calc/calc -q -f
/*
* sqaure - print the squares of input values
*
* 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

View File

@@ -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.29 $
# @(#) $Id: Makefile.head,v 30.29 2013/08/17 01:22:19 chongo Exp $
# @(#) $Revision: 30.40 $
# @(#) $Id: Makefile.head,v 30.40 2016/02/08 22:10:13 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,18 +352,12 @@ EXT=
# The default calc versions
#
VERSION= 2.12.4.11
VERS= 2.12.4
VER= 2.12
VE= 2
VERSION= 2.12.5.3
# Names of shared libraries with versions
#
LIB_EXT= .so
LIB_EXT_VERSION= ${LIB_EXT}.${VERSION}
LIB_EXT_VERS= ${LIB_EXT}.${VERS}
LIB_EXT_VER= ${LIB_EXT}.${VER}
LIB_EXT_VE= ${LIB_EXT}.${VE}
# standard tools
#
@@ -489,6 +469,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 +526,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 +539,9 @@ CC= ${PURIFY} ${LCC} ${CCWERR}
#
endif
#################################
# Apple MacOS X / Darwin target #
#################################
##############################
# Apple OS X / Darwin target #
##############################
ifeq ($(target),Darwin)
#
@@ -556,9 +550,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,28 +576,37 @@ 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}
LIB_EXT_VERS:= .${VERS}${LIB_EXT}
LIB_EXT_VER:= .${VER}${LIB_EXT}
LIB_EXT_VE:= .${VE}${LIB_EXT}
# LDCONFIG not required on this platform, so we redefine it to an empty string
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
#
# Starting with El Capitan OS X 10.11, root by default could not
# mkdir under system locations, so we now use the /usr/local tree.
#
OPTDIR:= /usr/local
BINDIR:= /${OPTDIR}/bin
LIBDIR:= /${OPTDIR}/lib
CALC_SHAREDIR:= /${OPTDIR}/share
CALC_INCDIR:= /${OPTDIR}/include
SCRIPTDIR:= ${BINDIR}/cscript
endif
##################
@@ -622,7 +639,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 +685,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 +703,6 @@ endif
# SunOS target #
################
# XXX - this needs to be tested
ifeq ($(target),SunOS)
#
BLD_TYPE= calc-dynamic-only
@@ -701,7 +723,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 +760,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 +797,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 +860,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 +900,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 +1123,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 +1235,10 @@ 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_VERS}
${RM} -f libcustcalc${LIB_EXT_VER}
${RM} -f libcustcalc${LIB_EXT_VE}
${RM} -f libcustcalc${LIB_EXT}
${RM} -f libcustcalc.*.dylib
${RM} -f libcustcalc.a
${V} echo remove files that are obsolete
#if 0 /* start of skip for non-Gnu makefiles */
${RM} -f Makefile.simple
#endif /* end of skip for non-Gnu makefiles */
@@ -1212,9 +1248,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 +1273,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 +1285,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 +1297,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 +1309,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 +1321,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 +1333,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}"; \

View File

@@ -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.29 $
# @(#) $Id: Makefile.head,v 30.29 2013/08/17 01:22:19 chongo Exp $
# @(#) $Revision: 30.40 $
# @(#) $Id: Makefile.head,v 30.40 2016/02/08 22:10:13 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,18 +352,12 @@ EXT=
# The default calc versions
#
VERSION= 2.12.4.11
VERS= 2.12.4
VER= 2.12
VE= 2
VERSION= 2.12.5.3
# Names of shared libraries with versions
#
LIB_EXT= .so
LIB_EXT_VERSION= ${LIB_EXT}.${VERSION}
LIB_EXT_VERS= ${LIB_EXT}.${VERS}
LIB_EXT_VER= ${LIB_EXT}.${VER}
LIB_EXT_VE= ${LIB_EXT}.${VE}
# standard tools
#

View File

@@ -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.29 $
# @(#) $Id: Makefile.head,v 30.29 2013/08/17 01:22:19 chongo Exp $
# @(#) $Revision: 30.40 $
# @(#) $Id: Makefile.head,v 30.40 2016/02/08 22:10:13 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,18 +337,12 @@ EXT=
# The default calc versions
#
VERSION= 2.12.4.11
VERS= 2.12.4
VER= 2.12
VE= 2
VERSION= 2.12.5.3
# Names of shared libraries with versions
#
LIB_EXT= .so
LIB_EXT_VERSION= ${LIB_EXT}.${VERSION}
LIB_EXT_VERS= ${LIB_EXT}.${VERS}
LIB_EXT_VER= ${LIB_EXT}.${VER}
LIB_EXT_VE= ${LIB_EXT}.${VE}
# standard tools
#
@@ -449,6 +429,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 +476,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 +673,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 +785,31 @@ 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_VERS}
${RM} -f libcustcalc${LIB_EXT_VER}
${RM} -f libcustcalc${LIB_EXT_VE}
${RM} -f libcustcalc${LIB_EXT}
${RM} -f libcustcalc.*.dylib
${RM} -f libcustcalc.a
${V} echo remove files that are obsolete
# 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 +820,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 +832,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 +844,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 +856,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 +868,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 +880,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}"; \

View File

@@ -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,10 @@ 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_VERS}
${RM} -f libcustcalc${LIB_EXT_VER}
${RM} -f libcustcalc${LIB_EXT_VE}
${RM} -f libcustcalc${LIB_EXT}
${RM} -f libcustcalc.*.dylib
${RM} -f libcustcalc.a
${V} echo remove files that are obsolete
#if 0 /* start of skip for non-Gnu makefiles */
${RM} -f Makefile.simple
#endif /* end of skip for non-Gnu makefiles */
@@ -303,9 +302,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 +327,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 +339,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 +351,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 +363,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 +375,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 +387,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
View File

@@ -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
View File

@@ -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 */

60
func.c
View File

@@ -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.8 $
* @(#) $Id: func.c,v 30.8 2013/09/01 22:11:07 chongo Exp $
* @(#) $Revision: 30.11 $
* @(#) $Id: func.c,v 30.11 2014/09/30 00:55:11 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]));
}
}
@@ -1675,7 +1676,7 @@ f_hash(int count, VALUE **vals)
result.v_type = V_NUM;
result.v_subtype = V_NOSUBTYPE;
hash = FNV1_32_BASIS;
hash = QUICKHASH_BASIS;
while (count-- > 0)
hash = hashvalue(*vals++, hash);
result.v_num = utoq((FULL) hash);
@@ -4259,6 +4260,39 @@ f_strncasecmp(VALUE *v1, VALUE *v2, VALUE *v3)
return result;
}
S_FUNC VALUE
f_strtoupper(VALUE *vp)
{
VALUE result;
/* initialize VALUE */
result.v_subtype = V_NOSUBTYPE;
if (vp->v_type != V_STR)
return error_value(E_STRTOUPPER);
result.v_str = stringtoupper(vp->v_str);
result.v_type = V_STR;
return result;
}
S_FUNC VALUE
f_strtolower(VALUE *vp)
{
VALUE result;
/* initialize VALUE */
result.v_subtype = V_NOSUBTYPE;
if (vp->v_type != V_STR)
return error_value(E_STRTOLOWER);
result.v_str = stringtolower(vp->v_str);
result.v_type = V_STR;
return result;
}
S_FUNC VALUE
f_strcat(int count, VALUE **vals)
{
@@ -8215,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];
@@ -8225,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;
}
@@ -8969,6 +9003,10 @@ STATIC CONST struct builtin builtins[] = {
"assign value to stoponerror flag"},
{"str", 1, 1, 0, OP_NOP, 0, f_str,
"simple value converted to string"},
{"strtoupper", 1, 1, 0, OP_NOP, 0, f_strtoupper,
"Make string upper case"},
{"strtolower", 1, 1, 0, OP_NOP, 0, f_strtolower,
"Make string lower case"},
{"strcat", 1,IN, 0, OP_NOP, 0, f_strcat,
"concatenate strings together"},
{"strcmp", 2, 2, 0, OP_NOP, 0, f_strcmp,

12
func.h
View File

@@ -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
View File

@@ -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 */

View File

@@ -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
View File

@@ -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

View File

@@ -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.6 $
# @(#) $Id: Makefile,v 30.6 2013/09/01 18:37:27 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
@@ -272,43 +272,47 @@ BLT_HELP_FILES= ${BLT_HELP_FILES_3} ${BLT_HELP_FILES_5} \
${BLT_HELP_FILES_11} ${BLT_HELP_FILES_13} \
${BLT_HELP_FILES_14}
# The detailed list of help files to install
#
# This list is prodiced by the detaillist rule when no WARNINGS are detected.
#
# Please use:
#
# make detaillist
# make detail_help_list
#
# to keep this list in nice sorted order and to check that these
# non-special help files are under RCS control.
#
DETAIL_HELP= abs access acos acosh acot acoth acsc acsch address agd append \
appr arg argv arrow asec asech asin asinh assign atan atan2 atanh \
avg base base2 bernoulli bit blk blkcpy blkfree blocks bround btrunc \
calc_tty calclevel calcpath catalan ceil cfappr cfsim char cmdbuf \
cmp comb conj cos cosh cot coth count cp csc csch ctime delete den \
dereference det digit digits display dp epsilon errcount errmax \
errno error estr euler eval exp fact factor fclose fcnt feof ferror \
fflush fgetc fgetfield fgetfile fgetline fgets fgetstr fib files \
floor fopen forall fpathopen fprintf fputc fputs fputstr frac free \
freebernoulli freeeuler freeglobals freeredc freestatics frem freopen \
fscan fscanf fseek fsize ftell gcd gcdrem gd getenv hash head highbit \
hmean hnrmod hypot ilog ilog10 ilog2 im indices inputlevel insert \
int inverse iroot isassoc isatty isblk isconfig isdefined iserror \
iseven isfile ishash isident isint islist ismat ismult isnull isnum \
isobj isobjtype isodd isprime isptr isqrt isrand israndom isreal \
isrel issimple issq isstr istype jacobi join lcm lcmfact lfactor \
ln log lowbit ltol makelist matdim matfill matmax matmin matsum \
mattrace mattrans max memsize meq min minv mmin mne mod modify \
name near newerror nextcand nextprime norm null num oldvalue ord \
param perm pfact pi pix places pmod polar poly pop popcnt pound \
power prevcand prevprime printf prompt protect ptest push putenv \
quo quomod rand randbit random randombit randperm rcin rcmul rcout \
rcpow rcsq re remove reverse rewind rm root round rsearch runtime \
saveval scale scan scanf search sec sech seed segment select sgn sha1 \
sin sinh size sizeof sleep sort sqrt srand srandom ssq stoponerror \
str strcat strcmp strcpy strerror strlen strncmp strncpy strpos \
strprintf strscan strscanf substr sum swap system systime tail tan \
tanh test time trunc usertime version xor
DETAIL_HELP= abs access acos acosh acot acoth acsc acsch address \
agd append appr arg argv arrow asec asech asin asinh assign atan \
atan2 atanh avg base base2 bernoulli bit blk blkcpy blkfree blocks \
bround btrunc calc_tty calclevel calcpath catalan ceil cfappr cfsim \
char cmdbuf cmp comb conj cos cosh cot coth count cp csc csch ctime \
delete den dereference det digit digits display dp epsilon errcount \
errmax errno error estr euler eval exp fact factor fclose fcnt \
feof ferror fflush fgetc fgetfield fgetfile fgetline fgets fgetstr \
fib files floor fopen forall fpathopen fprintf fputc fputs fputstr \
frac free freebernoulli freeeuler freeglobals freeredc freestatics \
frem freopen fscan fscanf fseek fsize ftell gcd gcdrem gd getenv \
hash head highbit hmean hnrmod hypot ilog ilog10 ilog2 im indices \
inputlevel insert int inverse iroot isalnum isalpha isassoc isatty \
isblk iscntrl isconfig isdefined isdigit iserror iseven isfile \
isgraph ishash isident isint islist islower ismat ismult isnull \
isnum isobj isobjtype isodd isprime isprint isptr ispunct isqrt \
isrand israndom isreal isrel issimple isspace issq isstr istype \
isupper isxdigit jacobi join lcm lcmfact lfactor ln log lowbit ltol \
makelist matdim matfill matmax matmin matsum mattrace mattrans max \
memsize meq min minv mmin mne mod modify name near newerror nextcand \
nextprime norm null num oldvalue ord param perm pfact pi pix places \
pmod polar poly pop popcnt pound power prevcand prevprime printf \
prompt protect ptest push putenv quo quomod rand randbit random \
randombit randperm rcin rcmul rcout rcpow rcsq re remove reverse \
rewind rm root round rsearch runtime saveval scale scan scanf \
search sec sech seed segment select sgn sha1 sin sinh size sizeof \
sleep sort sqrt srand srandom ssq stoponerror str strcasecmp strcat \
strcmp strcpy strerror strlen strncasecmp strncmp strncpy strpos \
strprintf strscan strscanf strtolower strtoupper substr sum swap \
system systime tail tan tanh test time trunc usertime version xor
# This list is of files that are clones of DETAIL_HELP files. They are
# built from DETAIL_HELP files.
@@ -633,11 +637,26 @@ bsdi: all
${RM} -f obj
${CP} obj.file obj
# These next rule help me form the ${DETAIL_HELP} makefile variables above.
# These next rule help form the ${DETAIL_HELP} makefile variables above.
#
detaillist:
${Q} -(echo "xxxxx"; \
for i in ${DETAIL_HELP} /dev/null; do \
# NOTE: The ${DETAIL_HELP} list does not include special help files.
#
detail_help_list:
${Q} -(find . -mindepth 1 -maxdepth 1 -type f \
! -name Makefile ! -name '.Makefile.swp' \
! -name archive ! -name assoc ! -name builtin.end \
! -name builtin.top ! -name command ! -name config \
! -name contrib ! -name credit ! -name custom ! -name define \
! -name environment ! -name errorcodes.hdr \
! -name errorcodes.sed ! -name expression ! -name file \
! -name funclist.c ! -name funclist.sed ! -name help \
! -name history ! -name interrupt ! -name intro ! -name list \
! -name mat ! -name obj.file ! -name operator \
! -name overview ! -name script ! -name statement \
! -name todo ! -name types ! -name unexpected \
! -name variable ! -name wishlist \
-print | \
while read i; do \
if [ X"$$i" != X"/dev/null" ]; then \
if [ ! -f RCS/$$i,v ]; then \
echo "WARNING: $$i not under RCS control" 1>&2; \
@@ -645,8 +664,10 @@ detaillist:
echo $$i; \
fi; \
fi; \
done | LANG=C ${SORT}) | ${FMT} -70 | \
${SED} -e '1s/xxxxx/DETAIL_HELP=/' -e '2,$$s/^/ /' \
done; \
echo '--first_line--') | \
${SED} -e 's:^\./::' | LANG=C ${SORT} | ${FMT} -70 | \
${SED} -e '1s/--first_line--/DETAIL_HELP=/' -e '2,$$s/^/ /' \
-e 's/$$/ \\/' -e '$$s/ \\$$//'
##
@@ -684,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}"; \
@@ -696,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}"; \

View File

@@ -62,7 +62,7 @@ SEE ALSO
##
## @(#) $Revision: 30.1 $
## @(#) $Id: abs,v 30.1 2007/03/16 11:10:42 chongo Exp $
## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/abs,v $
## @(#) $Source: /usr/local/src/bin/calc/help/RCS/abs,v $
##
## Under source code control: 1994/03/19 01:40:22
## File existed as early as: 1994

View File

@@ -66,7 +66,7 @@ SEE ALSO
##
## @(#) $Revision: 30.1 $
## @(#) $Id: access,v 30.1 2007/03/16 11:10:42 chongo Exp $
## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/access,v $
## @(#) $Source: /usr/local/src/bin/calc/help/RCS/access,v $
##
## Under source code control: 1996/04/30 03:36:20
## File existed as early as: 1996

View File

@@ -47,7 +47,7 @@ SEE ALSO
##
## @(#) $Revision: 30.1 $
## @(#) $Id: acos,v 30.1 2007/03/16 11:10:42 chongo Exp $
## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/acos,v $
## @(#) $Source: /usr/local/src/bin/calc/help/RCS/acos,v $
##
## Under source code control: 1994/03/19 01:40:23
## File existed as early as: 1994

View File

@@ -50,7 +50,7 @@ SEE ALSO
##
## @(#) $Revision: 30.1 $
## @(#) $Id: acosh,v 30.1 2007/03/16 11:10:42 chongo Exp $
## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/acosh,v $
## @(#) $Source: /usr/local/src/bin/calc/help/RCS/acosh,v $
##
## Under source code control: 1994/03/19 01:40:24
## File existed as early as: 1994

View File

@@ -47,7 +47,7 @@ SEE ALSO
##
## @(#) $Revision: 30.1 $
## @(#) $Id: acot,v 30.1 2007/03/16 11:10:42 chongo Exp $
## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/acot,v $
## @(#) $Source: /usr/local/src/bin/calc/help/RCS/acot,v $
##
## Under source code control: 1995/11/13 03:49:00
## File existed as early as: 1995

View File

@@ -49,7 +49,7 @@ SEE ALSO
##
## @(#) $Revision: 30.1 $
## @(#) $Id: acoth,v 30.1 2007/03/16 11:10:42 chongo Exp $
## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/acoth,v $
## @(#) $Source: /usr/local/src/bin/calc/help/RCS/acoth,v $
##
## Under source code control: 1995/11/13 03:49:01
## File existed as early as: 1995

View File

@@ -47,7 +47,7 @@ SEE ALSO
##
## @(#) $Revision: 30.1 $
## @(#) $Id: acsc,v 30.1 2007/03/16 11:10:42 chongo Exp $
## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/acsc,v $
## @(#) $Source: /usr/local/src/bin/calc/help/RCS/acsc,v $
##
## Under source code control: 1995/11/13 03:49:00
## File existed as early as: 1995

View File

@@ -50,7 +50,7 @@ SEE ALSO
##
## @(#) $Revision: 30.1 $
## @(#) $Id: acsch,v 30.1 2007/03/16 11:10:42 chongo Exp $
## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/acsch,v $
## @(#) $Source: /usr/local/src/bin/calc/help/RCS/acsch,v $
##
## Under source code control: 1995/11/13 03:49:01
## File existed as early as: 1995

View File

@@ -178,7 +178,7 @@ SEE ALSO
##
## @(#) $Revision: 30.1 $
## @(#) $Id: address,v 30.1 2007/03/16 11:10:42 chongo Exp $
## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/address,v $
## @(#) $Source: /usr/local/src/bin/calc/help/RCS/address,v $
##
## Under source code control: 1997/09/06 20:03:34
## File existed as early as: 1997

View File

@@ -74,7 +74,7 @@ SEE ALSO
##
## @(#) $Revision: 30.1 $
## @(#) $Id: agd,v 30.1 2007/03/16 11:10:42 chongo Exp $
## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/agd,v $
## @(#) $Source: /usr/local/src/bin/calc/help/RCS/agd,v $
##
## Under source code control: 1997/09/06 20:03:34
## File existed as early as: 1997

View File

@@ -78,7 +78,7 @@ SEE ALSO
##
## @(#) $Revision: 30.1 $
## @(#) $Id: append,v 30.1 2007/03/16 11:10:42 chongo Exp $
## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/append,v $
## @(#) $Source: /usr/local/src/bin/calc/help/RCS/append,v $
##
## Under source code control: 1994/03/19 03:13:17
## File existed as early as: 1994

View File

@@ -169,7 +169,7 @@ SEE ALSO
##
## @(#) $Revision: 30.1 $
## @(#) $Id: appr,v 30.1 2007/03/16 11:10:42 chongo Exp $
## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/appr,v $
## @(#) $Source: /usr/local/src/bin/calc/help/RCS/appr,v $
##
## Under source code control: 1994/09/25 17:18:21
## File existed as early as: 1994

View File

@@ -33,7 +33,7 @@ chongo <was here> /\../\
##
## @(#) $Revision: 30.2 $
## @(#) $Id: archive,v 30.2 2013/08/11 01:08:32 chongo Exp $
## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/archive,v $
## @(#) $Source: /usr/local/src/bin/calc/help/RCS/archive,v $
##
## Under source code control: 1996/06/13 02:51:48
## File existed as early as: 1996

View File

@@ -50,7 +50,7 @@ SEE ALSO
##
## @(#) $Revision: 30.1 $
## @(#) $Id: arg,v 30.1 2007/03/16 11:10:42 chongo Exp $
## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/arg,v $
## @(#) $Source: /usr/local/src/bin/calc/help/RCS/arg,v $
##
## Under source code control: 1994/09/25 20:22:31
## File existed as early as: 1994

View File

@@ -71,7 +71,7 @@ SEE ALSO
##
## @(#) $Revision: 30.1 $
## @(#) $Id: argv,v 30.1 2007/03/16 11:10:42 chongo Exp $
## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/argv,v $
## @(#) $Source: /usr/local/src/bin/calc/help/RCS/argv,v $
##
## Under source code control: 1999/11/23 19:45:05
## File existed as early as: 1999

View File

@@ -68,7 +68,7 @@ SEE ALSO
##
## @(#) $Revision: 30.1 $
## @(#) $Id: arrow,v 30.1 2007/03/16 11:10:42 chongo Exp $
## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/arrow,v $
## @(#) $Source: /usr/local/src/bin/calc/help/RCS/arrow,v $
##
## Under source code control: 1997/09/06 20:03:34
## File existed as early as: 1997

View File

@@ -47,7 +47,7 @@ SEE ALSO
##
## @(#) $Revision: 30.1 $
## @(#) $Id: asec,v 30.1 2007/03/16 11:10:42 chongo Exp $
## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/asec,v $
## @(#) $Source: /usr/local/src/bin/calc/help/RCS/asec,v $
##
## Under source code control: 1995/11/13 03:49:00
## File existed as early as: 1995

View File

@@ -49,7 +49,7 @@ SEE ALSO
##
## @(#) $Revision: 30.1 $
## @(#) $Id: asech,v 30.1 2007/03/16 11:10:42 chongo Exp $
## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/asech,v $
## @(#) $Source: /usr/local/src/bin/calc/help/RCS/asech,v $
##
## Under source code control: 1995/11/13 03:49:00
## File existed as early as: 1995

View File

@@ -47,7 +47,7 @@ SEE ALSO
##
## @(#) $Revision: 30.1 $
## @(#) $Id: asin,v 30.1 2007/03/16 11:10:42 chongo Exp $
## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/asin,v $
## @(#) $Source: /usr/local/src/bin/calc/help/RCS/asin,v $
##
## Under source code control: 1994/03/19 01:40:24
## File existed as early as: 1994

View File

@@ -49,7 +49,7 @@ SEE ALSO
##
## @(#) $Revision: 30.1 $
## @(#) $Id: asinh,v 30.1 2007/03/16 11:10:42 chongo Exp $
## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/asinh,v $
## @(#) $Source: /usr/local/src/bin/calc/help/RCS/asinh,v $
##
## Under source code control: 1994/03/19 01:40:25
## File existed as early as: 1994

View File

@@ -135,7 +135,7 @@ SEE ALSO
##
## @(#) $Revision: 30.1 $
## @(#) $Id: assign,v 30.1 2007/03/16 11:10:42 chongo Exp $
## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/assign,v $
## @(#) $Source: /usr/local/src/bin/calc/help/RCS/assign,v $
##
## Under source code control: 1995/05/11 21:03:23
## File existed as early as: 1995

View File

@@ -100,7 +100,7 @@ SEE ALSO
##
## @(#) $Revision: 30.1 $
## @(#) $Id: assoc,v 30.1 2007/03/16 11:10:42 chongo Exp $
## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/assoc,v $
## @(#) $Source: /usr/local/src/bin/calc/help/RCS/assoc,v $
##
## Under source code control: 1994/09/25 20:22:31
## File existed as early as: 1994

View File

@@ -47,7 +47,7 @@ SEE ALSO
##
## @(#) $Revision: 30.1 $
## @(#) $Id: atan,v 30.1 2007/03/16 11:10:42 chongo Exp $
## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/atan,v $
## @(#) $Source: /usr/local/src/bin/calc/help/RCS/atan,v $
##
## Under source code control: 1994/03/19 01:40:25
## File existed as early as: 1994

View File

@@ -54,7 +54,7 @@ SEE ALSO
##
## @(#) $Revision: 30.1 $
## @(#) $Id: atan2,v 30.1 2007/03/16 11:10:42 chongo Exp $
## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/atan2,v $
## @(#) $Source: /usr/local/src/bin/calc/help/RCS/atan2,v $
##
## Under source code control: 1994/03/19 01:40:26
## File existed as early as: 1994

View File

@@ -49,7 +49,7 @@ SEE ALSO
##
## @(#) $Revision: 30.1 $
## @(#) $Id: atanh,v 30.1 2007/03/16 11:10:42 chongo Exp $
## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/atanh,v $
## @(#) $Source: /usr/local/src/bin/calc/help/RCS/atanh,v $
##
## Under source code control: 1994/03/19 01:40:27
## File existed as early as: 1994

View File

@@ -67,7 +67,7 @@ SEE ALSO
##
## @(#) $Revision: 30.1 $
## @(#) $Id: avg,v 30.1 2007/03/16 11:10:42 chongo Exp $
## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/avg,v $
## @(#) $Source: /usr/local/src/bin/calc/help/RCS/avg,v $
##
## Under source code control: 1994/09/25 20:22:31
## File existed as early as: 1994

View File

@@ -99,7 +99,7 @@ SEE ALSO
##
## @(#) $Revision: 30.1 $
## @(#) $Id: base,v 30.1 2007/03/16 11:10:42 chongo Exp $
## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/base,v $
## @(#) $Source: /usr/local/src/bin/calc/help/RCS/base,v $
##
## Under source code control: 1994/09/30 00:09:39
## File existed as early as: 1994

View File

@@ -111,7 +111,7 @@ SEE ALSO
##
## @(#) $Revision: 30.1 $
## @(#) $Id: base2,v 30.1 2007/03/16 11:10:42 chongo Exp $
## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/base2,v $
## @(#) $Source: /usr/local/src/bin/calc/help/RCS/base2,v $
##
## Under source code control: 2002/12/29 00:21:07
## File existed as early as: 2002

View File

@@ -59,7 +59,7 @@ SEE ALSO
##
## @(#) $Revision: 30.1 $
## @(#) $Id: bernoulli,v 30.1 2007/03/16 11:10:42 chongo Exp $
## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/bernoulli,v $
## @(#) $Source: /usr/local/src/bin/calc/help/RCS/bernoulli,v $
##
## Under source code control: 2000/07/13 01:33:00
## File existed as early as: 2000

View File

@@ -60,7 +60,7 @@ SEE ALSO
##
## @(#) $Revision: 30.1 $
## @(#) $Id: bit,v 30.1 2007/03/16 11:10:42 chongo Exp $
## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/bit,v $
## @(#) $Source: /usr/local/src/bin/calc/help/RCS/bit,v $
##
## Under source code control: 1994/10/21 02:21:30
## File existed as early as: 1994

View File

@@ -251,7 +251,7 @@ SEE ALSO
##
## @(#) $Revision: 30.1 $
## @(#) $Id: blk,v 30.1 2007/03/16 11:10:42 chongo Exp $
## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/blk,v $
## @(#) $Source: /usr/local/src/bin/calc/help/RCS/blk,v $
##
## Under source code control: 1997/04/05 13:07:13
## File existed as early as: 1997

View File

@@ -208,7 +208,7 @@ SEE ALSO
##
## @(#) $Revision: 30.2 $
## @(#) $Id: blkcpy,v 30.2 2013/08/11 01:08:32 chongo Exp $
## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/blkcpy,v $
## @(#) $Source: /usr/local/src/bin/calc/help/RCS/blkcpy,v $
##
## Under source code control: 1997/04/05 14:08:50
## File existed as early as: 1997

View File

@@ -75,7 +75,7 @@ SEE ALSO
##
## @(#) $Revision: 30.1 $
## @(#) $Id: blkfree,v 30.1 2007/03/16 11:10:42 chongo Exp $
## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/blkfree,v $
## @(#) $Source: /usr/local/src/bin/calc/help/RCS/blkfree,v $
##
## Under source code control: 1997/04/05 13:07:13
## File existed as early as: 1997

View File

@@ -60,7 +60,7 @@ SEE ALSO
##
## @(#) $Revision: 30.1 $
## @(#) $Id: blocks,v 30.1 2007/03/16 11:10:42 chongo Exp $
## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/blocks,v $
## @(#) $Source: /usr/local/src/bin/calc/help/RCS/blocks,v $
##
## Under source code control: 1997/04/05 13:07:13
## File existed as early as: 1997

View File

@@ -140,7 +140,7 @@ SEE ALSO
##
## @(#) $Revision: 30.1 $
## @(#) $Id: bround,v 30.1 2007/03/16 11:10:42 chongo Exp $
## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/bround,v $
## @(#) $Source: /usr/local/src/bin/calc/help/RCS/bround,v $
##
## Under source code control: 1994/09/30 00:22:35
## File existed as early as: 1994

View File

@@ -61,7 +61,7 @@ SEE ALSO
##
## @(#) $Revision: 30.1 $
## @(#) $Id: btrunc,v 30.1 2007/03/16 11:10:42 chongo Exp $
## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/btrunc,v $
## @(#) $Source: /usr/local/src/bin/calc/help/RCS/btrunc,v $
##
## Under source code control: 1994/09/30 00:44:27
## File existed as early as: 1994

View File

@@ -217,7 +217,7 @@
##
## @(#) $Revision: 30.1 $
## @(#) $Id: builtin.end,v 30.1 2007/03/16 11:10:42 chongo Exp $
## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/builtin.end,v $
## @(#) $Source: /usr/local/src/bin/calc/help/RCS/builtin.end,v $
##
## Under source code control: 1995/07/10 01:17:53
## File existed as early as: 1995

View File

@@ -25,7 +25,7 @@ Builtin functions
##
## @(#) $Revision: 30.1 $
## @(#) $Id: builtin.top,v 30.1 2007/03/16 11:10:42 chongo Exp $
## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/builtin.top,v $
## @(#) $Source: /usr/local/src/bin/calc/help/RCS/builtin.top,v $
##
## Under source code control: 1995/07/10 01:17:53
## File existed as early as: 1995

View File

@@ -44,7 +44,7 @@ SEE ALSO
##
## @(#) $Revision: 30.1 $
## @(#) $Id: calc_tty,v 30.1 2007/03/16 11:10:42 chongo Exp $
## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/calc_tty,v $
## @(#) $Source: /usr/local/src/bin/calc/help/RCS/calc_tty,v $
##
## Under source code control: 2000/12/14 01:33:00
## File existed as early as: 2000

View File

@@ -52,7 +52,7 @@ SEE ALSO
##
## @(#) $Revision: 30.1 $
## @(#) $Id: calclevel,v 30.1 2007/03/16 11:10:42 chongo Exp $
## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/calclevel,v $
## @(#) $Source: /usr/local/src/bin/calc/help/RCS/calclevel,v $
##
## Under source code control: 1999/10/31 06:01:21
## File existed as early as: 1999

View File

@@ -47,7 +47,7 @@ SEE ALSO
##
## @(#) $Revision: 30.1 $
## @(#) $Id: calcpath,v 30.1 2007/03/16 11:10:42 chongo Exp $
## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/calcpath,v $
## @(#) $Source: /usr/local/src/bin/calc/help/RCS/calcpath,v $
##
## Under source code control: 2006/05/07 23:56:04
## File existed as early as: 2006

View File

@@ -55,7 +55,7 @@ SEE ALSO
##
## @(#) $Revision: 30.1 $
## @(#) $Id: catalan,v 30.1 2007/03/16 11:10:42 chongo Exp $
## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/catalan,v $
## @(#) $Source: /usr/local/src/bin/calc/help/RCS/catalan,v $
##
## Under source code control: 2000/12/14 01:33:00
## File existed as early as: 2000

View File

@@ -50,7 +50,7 @@ SEE ALSO
##
## @(#) $Revision: 30.1 $
## @(#) $Id: ceil,v 30.1 2007/03/16 11:10:42 chongo Exp $
## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/ceil,v $
## @(#) $Source: /usr/local/src/bin/calc/help/RCS/ceil,v $
##
## Under source code control: 1994/09/30 01:12:01
## File existed as early as: 1994

View File

@@ -106,7 +106,7 @@ SEE ALSO
##
## @(#) $Revision: 30.1 $
## @(#) $Id: cfappr,v 30.1 2007/03/16 11:10:42 chongo Exp $
## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/cfappr,v $
## @(#) $Source: /usr/local/src/bin/calc/help/RCS/cfappr,v $
##
## Under source code control: 1994/09/30 01:23:59
## File existed as early as: 1994

View File

@@ -131,7 +131,7 @@ SEE ALSO
##
## @(#) $Revision: 30.1 $
## @(#) $Id: cfsim,v 30.1 2007/03/16 11:10:42 chongo Exp $
## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/cfsim,v $
## @(#) $Source: /usr/local/src/bin/calc/help/RCS/cfsim,v $
##
## Under source code control: 1994/09/30 01:29:45
## File existed as early as: 1994

View File

@@ -44,7 +44,7 @@ SEE ALSO
##
## @(#) $Revision: 30.1 $
## @(#) $Id: char,v 30.1 2007/03/16 11:10:42 chongo Exp $
## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/char,v $
## @(#) $Source: /usr/local/src/bin/calc/help/RCS/char,v $
##
## Under source code control: 1994/09/30 01:45:45
## File existed as early as: 1994

View File

@@ -46,7 +46,7 @@ SEE ALSO
##
## @(#) $Revision: 30.1 $
## @(#) $Id: cmdbuf,v 30.1 2007/03/16 11:10:42 chongo Exp $
## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/cmdbuf,v $
## @(#) $Source: /usr/local/src/bin/calc/help/RCS/cmdbuf,v $
##
## Under source code control: 1995/07/09 04:05:58
## File existed as early as: 1995

View File

@@ -132,7 +132,7 @@ SEE ALSO
##
## @(#) $Revision: 30.1 $
## @(#) $Id: cmp,v 30.1 2007/03/16 11:10:42 chongo Exp $
## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/cmp,v $
## @(#) $Source: /usr/local/src/bin/calc/help/RCS/cmp,v $
##
## Under source code control: 1994/10/20 02:52:30
## File existed as early as: 1994

View File

@@ -56,7 +56,7 @@ SEE ALSO
##
## @(#) $Revision: 30.1 $
## @(#) $Id: comb,v 30.1 2007/03/16 11:10:42 chongo Exp $
## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/comb,v $
## @(#) $Source: /usr/local/src/bin/calc/help/RCS/comb,v $
##
## Under source code control: 1994/10/20 04:03:02
## File existed as early as: 1994

View File

@@ -368,7 +368,7 @@ Command sequence
##
## @(#) $Revision: 30.1 $
## @(#) $Id: command,v 30.1 2007/03/16 11:10:42 chongo Exp $
## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/command,v $
## @(#) $Source: /usr/local/src/bin/calc/help/RCS/command,v $
##
## Under source code control: 1991/07/21 04:37:17
## File existed as early as: 1991

View File

@@ -976,7 +976,7 @@ SEE ALSO
##
## @(#) $Revision: 30.3 $
## @(#) $Id: config,v 30.3 2007/09/21 01:27:27 chongo Exp $
## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/config,v $
## @(#) $Source: /usr/local/src/bin/calc/help/RCS/config,v $
##
## Under source code control: 1991/07/21 04:37:17
## File existed as early as: 1991

Some files were not shown because too many files have changed in this diff Show More