mirror of
https://github.com/lcn2/calc.git
synced 2025-08-22 01:23:28 +03:00
Compare commits
8 Commits
2.11.5t4.3
...
2.11.6.2
Author | SHA1 | Date | |
---|---|---|---|
|
8aedcf801a | ||
|
b60eec99bb | ||
|
383290a844 | ||
|
7e40db44e3 | ||
|
a57ee19ca5 | ||
|
a6e226fa80 | ||
|
86e0f98c8f | ||
|
e4dcbf7ecf |
51
BUGS
51
BUGS
@@ -74,6 +74,53 @@ Known bugs:
|
|||||||
|
|
||||||
Problems with known work-a-rounds:
|
Problems with known work-a-rounds:
|
||||||
|
|
||||||
|
* The gcc as shipped with Redhat 7 perhaps other Linux distributions
|
||||||
|
has a bug causes calc to dump core on startup when calc is:
|
||||||
|
|
||||||
|
compiled optimized (-O, -O1, -O2 or -O3)
|
||||||
|
|
||||||
|
AND
|
||||||
|
|
||||||
|
compiled with debugging (-g or -g3)
|
||||||
|
|
||||||
|
AND
|
||||||
|
|
||||||
|
when calc is compiled with readline (see USE_READLINE,
|
||||||
|
READLINE_LIB and READLINE_INCLUDE in the Makefile)
|
||||||
|
|
||||||
|
On Redhat, the gcc -v which has this problem is:
|
||||||
|
|
||||||
|
gcc version 2.96 20000731 (Red Hat Linux 7.1 2.96-85)
|
||||||
|
|
||||||
|
there may be other gcc versions that also suffer this fate.
|
||||||
|
|
||||||
|
The readlines associated with problem are:
|
||||||
|
|
||||||
|
readline-4.1-5
|
||||||
|
readline2.2.1-2.2.1-2
|
||||||
|
readline-devel-4.1-5
|
||||||
|
|
||||||
|
One work-a-round is to compile calc WITHOUT readline. In the
|
||||||
|
Makefile be sure that:
|
||||||
|
|
||||||
|
USE_READLINE=
|
||||||
|
READLINE_LIB=
|
||||||
|
READLINE_INCLUDE=
|
||||||
|
|
||||||
|
i.e., these Makefile vars are empty.
|
||||||
|
|
||||||
|
If you must use readline, then an alternate work-a-round is to
|
||||||
|
change the DEBUG Makefile variable to either:
|
||||||
|
|
||||||
|
compile for speed: -O3 (or -O2 if you do not have -O3)
|
||||||
|
compile to debug: -g3 (or -g if you do not have -g3)
|
||||||
|
|
||||||
|
but not both.
|
||||||
|
|
||||||
|
See RH bug #57889 for details:
|
||||||
|
|
||||||
|
http://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=57889
|
||||||
|
|
||||||
* There is a bug in gcc-2.95 that causes calc, when compiled with -O2,
|
* There is a bug in gcc-2.95 that causes calc, when compiled with -O2,
|
||||||
to fail the regression test. The work-a-round is to compile with -O
|
to fail the regression test. The work-a-round is to compile with -O
|
||||||
or to use gcc-2.96 or later.
|
or to use gcc-2.96 or later.
|
||||||
@@ -241,8 +288,8 @@ Problems with known work-a-rounds:
|
|||||||
## received a copy with calc; if not, write to Free Software Foundation, Inc.
|
## received a copy with calc; if not, write to Free Software Foundation, Inc.
|
||||||
## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
||||||
##
|
##
|
||||||
## @(#) $Revision: 29.12 $
|
## @(#) $Revision: 29.17 $
|
||||||
## @(#) $Id: BUGS,v 29.12 2001/06/01 11:32:01 chongo Exp $
|
## @(#) $Id: BUGS,v 29.17 2001/12/31 22:12:35 chongo Exp $
|
||||||
## @(#) $Source: /usr/local/src/cmd/calc/RCS/BUGS,v $
|
## @(#) $Source: /usr/local/src/cmd/calc/RCS/BUGS,v $
|
||||||
##
|
##
|
||||||
## Under source code control: 1994/03/18 14:06:13
|
## Under source code control: 1994/03/18 14:06:13
|
||||||
|
202
CHANGES
202
CHANGES
@@ -1,14 +1,167 @@
|
|||||||
The following are the changes from calc version 2.11.5t4.1 to date:
|
The following are the changes from calc version 2.11.6.0 to date:
|
||||||
|
|
||||||
|
Clarified remark in lucas.cal about use of n mod 2^n == 0.
|
||||||
|
|
||||||
|
Fixed help typos reported by Marc Mezzarobba <mm at mm dot ovh dot org>.
|
||||||
|
|
||||||
|
Forced system("") to return 0 under windoz.
|
||||||
|
|
||||||
|
The direct.h include file is not used when compiling under Cygwin.
|
||||||
|
|
||||||
|
Fixed bug where random(10,11) caused calc to dump core when issued
|
||||||
|
the 2nd time.
|
||||||
|
|
||||||
|
Moved the setting of the Makefile variable ${CALC_INCDIR} to
|
||||||
|
the section where things like ${BINDIR} and ${LIBDIR} are set.
|
||||||
|
Idea from Clifford Kite <kite_public1 at ev1 dot net>.
|
||||||
|
|
||||||
|
The Makefile is shipped mode 0644 since a number of folks
|
||||||
|
edit it (to build and check calc) as a non-root user and later
|
||||||
|
on su to root to install. Idea from Clifford Kite <kite_public1
|
||||||
|
at ev1 dot net>.
|
||||||
|
|
||||||
|
Added base2() builtin function to calc. Normally calc prints
|
||||||
|
values according to base(). Frequently some users want to see
|
||||||
|
a value in two bases. Flipping back and forth between to bases
|
||||||
|
is a bit of a pain. With base2(), calc will output a value twice:
|
||||||
|
|
||||||
|
; 234567
|
||||||
|
234567
|
||||||
|
; base2(16),
|
||||||
|
; 234567
|
||||||
|
234567 /* 0x39447 */
|
||||||
|
; 131072
|
||||||
|
131072 /* 0x20000 */
|
||||||
|
; base2(0),
|
||||||
|
; 131072
|
||||||
|
131072
|
||||||
|
|
||||||
|
By default, base2() is disabled. Calling base2(0) will also turn
|
||||||
|
off the double base mode. Thanks goes to Erik Anggard
|
||||||
|
<erik dot anggard at packetfront dot com> for his idea and
|
||||||
|
his initial patch.
|
||||||
|
|
||||||
|
Added repeat.cal as a calc resource file script:
|
||||||
|
|
||||||
|
repeat(digit_set, repeat_count)
|
||||||
|
|
||||||
|
Return the value of the digit_set repeated repeat_count times.
|
||||||
|
Both digit_set and repeat_count must be integers > 0.
|
||||||
|
|
||||||
|
For example repeat(423,5) returns the value 423423423423423,
|
||||||
|
which is the digit_set 423 repeated 5 times.
|
||||||
|
|
||||||
|
Makefile no longer makes a direct reference to Red Hat 6.0.
|
||||||
|
|
||||||
|
Added missing math_setmode2() prototype to zmath.h.
|
||||||
|
|
||||||
|
Fixed some implicit declarations of functions by either making
|
||||||
|
them explicit or by including the proper system .h files.
|
||||||
|
|
||||||
|
Makefile no longer uses -Wno-implicit flag, by default, for
|
||||||
|
gcc based compiles on calc source. Makefile now attempts to
|
||||||
|
compile no_implicit.c with an explicit -Wno-implicit arg in an
|
||||||
|
effort to determine of -Wno-implicit is a valid compiler flag.
|
||||||
|
If no_implicit.c is compiled with -Wno-implicit, then
|
||||||
|
the file no_implicit.arg is created with the contents
|
||||||
|
of the -Wno-implicit flag. Otherwise no_implicit.arg
|
||||||
|
is created as an empty file.
|
||||||
|
|
||||||
|
Added the Makefile variable ${HAVE_NO_IMPLICIT}, which if
|
||||||
|
not set to YES will prevent no_implicit.c from being
|
||||||
|
compiled and prevent the -Wno-implicit flag from being used.
|
||||||
|
If ${HAVE_NO_IMPLICIT} is not YES, then an empty no_implicit.arg
|
||||||
|
file is created and no_implicit.c is not compiled.
|
||||||
|
|
||||||
|
The seed.c file, because the pseudo_seed() function contains
|
||||||
|
calls to a number of various system functions, attempts to
|
||||||
|
compile with the -Wno-implicit flag (if allowed by the
|
||||||
|
formation of the no_implicit.arg file).
|
||||||
|
|
||||||
|
Misc make depend fixes and cleanup.
|
||||||
|
|
||||||
|
Fixed formation of the custom/.all file.
|
||||||
|
|
||||||
|
Fixed repeat(1, repeat_count) bug.
|
||||||
|
|
||||||
|
|
||||||
|
The following are the changes from calc version 2.11.5.5 to 2.11.5.9:
|
||||||
|
|
||||||
|
Now using version numbers of one of these forms:
|
||||||
|
|
||||||
|
x.y.z.w
|
||||||
|
x.y.z
|
||||||
|
x.y
|
||||||
|
|
||||||
|
Changed the READLINE_LIB Makefile variable to not link with -lreadline
|
||||||
|
by default. If you do have readline, we recommend that you use it.
|
||||||
|
If you can install the GNU readline:
|
||||||
|
|
||||||
|
http://freshmeat.net/projects/gnureadline/
|
||||||
|
http://cnswww.cns.cwru.edu/php/chet/readline/rltop.html
|
||||||
|
|
||||||
|
we recommend it. But if not, you should set the USE_READLINE,
|
||||||
|
READLINE_LIB, and READLINE_INCLUDE Makefile variables to empty.
|
||||||
|
NOTE: See the BUGS file for a Linux issue when compiling calc
|
||||||
|
with -O (or -O2 or -O3) AND with -g (or -g3) AND with readline.
|
||||||
|
|
||||||
|
Removed an obsolete reference to TOPDIR. This was fixed thanks to
|
||||||
|
a bug report by Clifford Kite <kite_public1 at ev1 dot net>.
|
||||||
|
Fixed other inconsistencies related to things like BINDIR.
|
||||||
|
|
||||||
|
Fixed calc man page so that is refers to -f instead of the old -S flag.
|
||||||
|
Fixed thanks to Clifford Kite <kite_public1 at ev1 dot net> for
|
||||||
|
point this out.
|
||||||
|
|
||||||
|
All for loops end with /dev/null to avoid any problems related
|
||||||
|
to systems that cannot grok empty for loops.
|
||||||
|
|
||||||
|
Changed the libcalc functions creal and cimag to c_real and c_imag
|
||||||
|
to about conflicts with new libc such as those used by gcc v3.
|
||||||
|
Thanks Eli Zaretskii <eliz at is dot elta dot co dot il> and
|
||||||
|
Martin Buck <m at rtin-buck dot de> for alerting us to this conflict.
|
||||||
|
|
||||||
|
The Makefile no longer hard code's /usr/include. Instead it uses
|
||||||
|
the ${INCDIR} Makefile variable. Thanks goes to Eli Zaretskii
|
||||||
|
<eliz at is dot elta dot co dot il> for pointing out this inconsistency.
|
||||||
|
|
||||||
|
Added mods to support compilation under DJGPP. DJGPP runs on 386
|
||||||
|
and newer PCs running DOS or dos-compatible operating systems.
|
||||||
|
See http://www.delorie.com/djgpp/. Thanks goes to Eli Zaretskii
|
||||||
|
<eliz at is dot elta dot co dot il> for sending in these mods.
|
||||||
|
|
||||||
|
Updated README.WINDOWS to include information on building with DJGPP.
|
||||||
|
|
||||||
|
The pld folks are building RPMs based on our calc distrbutions.
|
||||||
|
See: ftp://ftp.pld.org.pl/dists/ra/PLD/i686/PLD/RPMS or
|
||||||
|
http://ftp.pld.org.pl/dists/ra/PLD/i686/PLD/RPMS more information.
|
||||||
|
We appreciate their work in this regard. In the next release, we
|
||||||
|
plan to also build and release our own RPMs based on their efforts.
|
||||||
|
|
||||||
|
Changed the Makefile variable CUSTOMLIBDIR to CUSTOMCALDIR.
|
||||||
|
Changed the Makefile variable CSHAREDIR to CALC_SHAREDIR.
|
||||||
|
Changed the Makefile variable INCDIRCALC to CALC_INCDIR.
|
||||||
|
Removed the Makefile variable SHAREDIR.
|
||||||
|
|
||||||
|
Updated the HOWTO.INSTALL and README.WINDOWS files.
|
||||||
|
|
||||||
|
Fixed definition of MAXUFULL. Thanks to a bus report from
|
||||||
|
Jill Poland <jpoland at cadence dot com>.
|
||||||
|
|
||||||
|
The following are the changes from calc version 2.11.5t4.1 to 2.11.5t4.4:
|
||||||
|
|
||||||
Updated dependency rules in Makefiles.
|
Updated dependency rules in Makefiles.
|
||||||
|
|
||||||
|
NOTE: -DSRC, as used in 2.11.5t4.1 was renamed -DCALC_SRC
|
||||||
|
in a later version.
|
||||||
|
|
||||||
Calc include files use #include "foo.h" to include other calc
|
Calc include files use #include "foo.h" to include other calc
|
||||||
header files if -DSRC. Otherwise they use <calc/foo.h>.
|
header files if -DCALC_SRC. Otherwise they use <calc/foo.h>.
|
||||||
The -DSRC symbol is defined by default in calc's Makefile
|
The -DCALC_SRC symbol is defined by default in calc's Makefile
|
||||||
and so it uses the header files from within the calc src tree.
|
and so it uses the header files from within the calc src tree.
|
||||||
If an external non-calc program includes an installed calc
|
If an external non-calc program includes an installed calc
|
||||||
header file (from under /usr/include), and it does NOT define
|
header file (from under /usr/include), and it does NOT define
|
||||||
SRC, then it will obtain the calc header files from the
|
CALC_SRC, then it will obtain the calc header files from the
|
||||||
correct system location (such as /usr/include/calc/foo.h).
|
correct system location (such as /usr/include/calc/foo.h).
|
||||||
|
|
||||||
Added calc builtin function: version() which returns the calc
|
Added calc builtin function: version() which returns the calc
|
||||||
@@ -36,6 +189,41 @@ The following are the changes from calc version 2.11.5t4.1 to date:
|
|||||||
If you are using the GNU readline then the Makefile recommends that
|
If you are using the GNU readline then the Makefile recommends that
|
||||||
you link with the ncurses library.
|
you link with the ncurses library.
|
||||||
|
|
||||||
|
Applied Makefile, cscript/Makefile and custom/Makefile patches to
|
||||||
|
fix install mode problems, to deal with sorting and dates in I18n
|
||||||
|
environments (such as Japanese), to fix some problems with calc.spec
|
||||||
|
and to fix the cscript #! header lines. Thanks goes to KAWAMURA Masao
|
||||||
|
(kawamura at mlb.co.jp) for the bug report and patch!
|
||||||
|
|
||||||
|
Fixed headers on fproduct.calc powerterm.calc 4dsphere.calc so
|
||||||
|
that they are correcly changed on installation.
|
||||||
|
|
||||||
|
Added ${GREP} Makefile variable.
|
||||||
|
|
||||||
|
The top level Makefile now sets LANG=C and passes it down to
|
||||||
|
lower level Makefiles.
|
||||||
|
|
||||||
|
Updated URLs in cal/lucas.cal comments.
|
||||||
|
|
||||||
|
Now shipping calc.spec, inst_files, spec-template and Makefile.linux
|
||||||
|
with the standard calc source distribution. Note that the standard
|
||||||
|
Makefile has not changed. The Makefile.linux only in minor ways
|
||||||
|
needed to build calc rpms.
|
||||||
|
|
||||||
|
Added $T Makefile variable. $T is the top level directory under
|
||||||
|
which calc will be installed. The calc install is performed under $T,
|
||||||
|
the calc build is performed under /. The purpose for $T is to allow
|
||||||
|
someone to install calc somewhere other than into the system area.
|
||||||
|
For examplewhen forming the calc rpm, the Makefile is called with
|
||||||
|
T=$RPM_BUILD_ROOT. If $T is empty, calc is installed under /.
|
||||||
|
|
||||||
|
Removed all echo_XXX rules except for echo_inst_files from lower
|
||||||
|
level makefile. The calc.spec will use a make install rule
|
||||||
|
with T=$RPM_BUILD_ROOT.
|
||||||
|
|
||||||
|
Updated LIBRARY file with instructions related to -DCALC_SRC,
|
||||||
|
the new default include file locatin and -lcustcalc.
|
||||||
|
|
||||||
|
|
||||||
The following are the changes from calc version 2.11.5t3 to 2.11.5t4:
|
The following are the changes from calc version 2.11.5t3 to 2.11.5t4:
|
||||||
|
|
||||||
@@ -166,7 +354,7 @@ The following are the changes from calc version 2.11.5t0 to 2.11.5t1.1:
|
|||||||
|
|
||||||
An effort was made to make calc easier to build under Windoz
|
An effort was made to make calc easier to build under Windoz
|
||||||
using the Cygwin project (http://sources.redhat.com/cygwin/).
|
using the Cygwin project (http://sources.redhat.com/cygwin/).
|
||||||
Thanks to the work of Thomas Jones-Low (tjoneslo and softstart
|
Thanks to the work of Thomas Jones-Low (tjoneslo at softstart
|
||||||
dot com), a number of #if defined(_WIN32)'s have been added
|
dot com), a number of #if defined(_WIN32)'s have been added
|
||||||
to calc source. These changes should not effect Windoz
|
to calc source. These changes should not effect Windoz
|
||||||
free system such as GNU/Linux, Solaris, POSIX-like, etc ...
|
free system such as GNU/Linux, Solaris, POSIX-like, etc ...
|
||||||
@@ -5320,8 +5508,8 @@ Following is a list of visible changes to calc from version 1.24.7 to 1.26.1:
|
|||||||
## received a copy with calc; if not, write to Free Software Foundation, Inc.
|
## received a copy with calc; if not, write to Free Software Foundation, Inc.
|
||||||
## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
||||||
##
|
##
|
||||||
## @(#) $Revision: 29.35 $
|
## @(#) $Revision: 29.54 $
|
||||||
## @(#) $Id: CHANGES,v 29.35 2001/06/01 21:44:44 chongo Exp $
|
## @(#) $Id: CHANGES,v 29.54 2003/01/14 04:04:26 chongo Exp $
|
||||||
## @(#) $Source: /usr/local/src/cmd/calc/RCS/CHANGES,v $
|
## @(#) $Source: /usr/local/src/cmd/calc/RCS/CHANGES,v $
|
||||||
##
|
##
|
||||||
## Under source code control: 1993/06/02 18:12:57
|
## Under source code control: 1993/06/02 18:12:57
|
||||||
|
122
HOWTO.INSTALL
122
HOWTO.INSTALL
@@ -1,34 +1,105 @@
|
|||||||
Installing calc in 4 easy steps:
|
Installing calc in 4 easy steps:
|
||||||
|
|
||||||
1) Look at the makefile, and adjust it to suit your needs.
|
1) Look at the makefile, and adjust it to suit your needs.
|
||||||
|
|
||||||
Here are some Makefile hints:
|
The Makefile, as shipped, is suitable for installation under
|
||||||
|
Linux and Un*x-like environments. For the most part, the default
|
||||||
|
values should work. If in doubt, follow the 'When in doubt'
|
||||||
|
suggestion.
|
||||||
|
|
||||||
Select a compiler set by commenting in the appropriate set
|
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||||
of cc options. As shipped the Makefile assumes a gcc-like
|
! If you are building under Windoz or a Windoz-like environment !
|
||||||
environment such as Linux. If a more appropriate cc set if
|
! (such as Cygwin or DJGPP), read the README.WINDOWS file. !
|
||||||
found below, comment out the Linux set and comment in that
|
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||||
set or edit the gcc set or the common cc set as needed.
|
|
||||||
|
|
||||||
You may or may not need RANLIB when building libraries.
|
You should determine if these Makefile variables are reasonable:
|
||||||
As shipped the Makefile assumes RANLIB is needed.
|
|
||||||
Comment the in/out the RANLIB value if ranlib does
|
|
||||||
not work or does not exist.
|
|
||||||
|
|
||||||
You may want to change the default pager used by calc.
|
INCDIR Where the system include (.h) files are kept.
|
||||||
As shipped the Makefile assumes 'more'. On your system
|
BINDIR Where to install calc binary files.
|
||||||
you may find 'less' to be a better pager.
|
LIBDIR Where to install calc link library (*.a) files.
|
||||||
|
CALC_SHAREDIR Where to install calc help, .cal, startup, and
|
||||||
|
config files.
|
||||||
|
|
||||||
Set TOPDIR to be the place under which help files, calc,
|
You may want to change the default installation locations for
|
||||||
include files and calc libs are to be installed. As shipped
|
these values, which are based on the 4 values listed above:
|
||||||
the Makefile assumes a TOPDIR of /usr/local/lib.
|
|
||||||
|
|
||||||
Set BINDIR to the place where calc is installed. As shipped
|
HELPDIR where the help directory is installed
|
||||||
the Makefile assumes a BINDIR /usr/local/bin.
|
CALC_INCDIR where the calc include files are installed
|
||||||
|
CUSTOMCALDIR where custom *.cal files are installed
|
||||||
|
CUSTOMHELPDIR where custom help files are installed
|
||||||
|
CUSTOMINCPDIR where custom .h files are installed
|
||||||
|
SCRIPTDIR where calc shell scripts are installed
|
||||||
|
|
||||||
|
If you want to install calc files under a top level directory,
|
||||||
|
then set the T value:
|
||||||
|
|
||||||
|
The calc install is performed under $T, the calc build is
|
||||||
|
performed under /. The purpose for $T is to allow someone
|
||||||
|
to install calc somewhere other than into the system area.
|
||||||
|
|
||||||
|
For example, if:
|
||||||
|
|
||||||
|
BINDIR= /usr/bin
|
||||||
|
LIBDIR= /usr/lib
|
||||||
|
CALC_SHAREDIR= /usr/share/calc
|
||||||
|
|
||||||
|
and if:
|
||||||
|
|
||||||
|
T= /var/tmp/testing
|
||||||
|
|
||||||
|
Then the installation locations will be:
|
||||||
|
|
||||||
|
calc binary files: /var/tmp/testing/usr/bin
|
||||||
|
calc link library: /var/tmp/testing/usr/lib
|
||||||
|
calc help, .cal ...: /var/tmp/testing/usr/share/calc
|
||||||
|
... etc ... /var/tmp/testing/...
|
||||||
|
|
||||||
|
If $T is empty, calc is installed under /, which is the same
|
||||||
|
top of tree for which it was built. If $T is non-empty, then
|
||||||
|
calc is installed under $T, as if one had to chroot under
|
||||||
|
$T for calc to operate.
|
||||||
|
|
||||||
|
Look for the section that starts:
|
||||||
|
|
||||||
|
################
|
||||||
|
# compiler set #
|
||||||
|
################
|
||||||
|
|
||||||
|
Select a compiler set by commenting in the appropriate set
|
||||||
|
of cc options. As shipped the Makefile assumes a gcc-like
|
||||||
|
environment such as Linux. If a more appropriate cc set if
|
||||||
|
found below, comment out the Linux set and comment in that
|
||||||
|
set or edit the gcc set or the common cc set as needed.
|
||||||
|
|
||||||
|
You may want to change these Makrfile variables from their defaults:
|
||||||
|
|
||||||
|
RANLIB
|
||||||
|
|
||||||
|
You may or may not need RANLIB when building libraries.
|
||||||
|
As shipped the Makefile assumes RANLIB is needed.
|
||||||
|
Comment the in/out the RANLIB value if ranlib does
|
||||||
|
not work or does not exist.
|
||||||
|
|
||||||
|
CALCPAGER
|
||||||
|
|
||||||
|
You may want to change the default pager used by calc.
|
||||||
|
As shipped the Makefile assumes 'more'. On your system
|
||||||
|
you may find 'less' to be a better pager.
|
||||||
|
|
||||||
|
DEBUG
|
||||||
|
|
||||||
|
Some compilers (to put it mildly) have bugs. Sometimes the
|
||||||
|
DEBUG Makefile variable causes the compiler / optimizer to
|
||||||
|
produce bad code. Other compilers do just fine.
|
||||||
|
|
||||||
|
If possible try to use DEBUG=-O3 -g3 (maximum optimization
|
||||||
|
and debug symbols). If the calc test fails (see step 3),
|
||||||
|
try lowering either the -O value and/or the -g3. Also try
|
||||||
|
using -Osomething without -g.
|
||||||
|
|
||||||
Adjust other Makefile variables as needed.
|
Adjust other Makefile variables as needed.
|
||||||
|
|
||||||
2) build calc:
|
2) build calc:
|
||||||
|
|
||||||
make all
|
make all
|
||||||
|
|
||||||
@@ -36,13 +107,14 @@ Installing calc in 4 easy steps:
|
|||||||
you may find. See the BUGS file if you find any compiler
|
you may find. See the BUGS file if you find any compiler
|
||||||
warning or errors.
|
warning or errors.
|
||||||
|
|
||||||
3) test calc:
|
3) test calc:
|
||||||
|
|
||||||
make check
|
make check
|
||||||
|
|
||||||
==> If you run into problems, follow the BUGS file instructions.
|
==> If you run into problems, read the BUGS file and follow
|
||||||
|
the instructions found in there.
|
||||||
|
|
||||||
4) install calc:
|
4) install calc:
|
||||||
|
|
||||||
make install
|
make install
|
||||||
|
|
||||||
@@ -65,8 +137,8 @@ the calc help subsystem. See the README file for details.
|
|||||||
## received a copy with calc; if not, write to Free Software Foundation, Inc.
|
## received a copy with calc; if not, write to Free Software Foundation, Inc.
|
||||||
## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
||||||
##
|
##
|
||||||
## @(#) $Revision: 29.2 $
|
## @(#) $Revision: 29.6 $
|
||||||
## @(#) $Id: HOWTO.INSTALL,v 29.2 2000/06/07 14:02:13 chongo Exp $
|
## @(#) $Id: HOWTO.INSTALL,v 29.6 2002/03/14 00:28:28 chongo Exp $
|
||||||
## @(#) $Source: /usr/local/src/cmd/calc/RCS/HOWTO.INSTALL,v $
|
## @(#) $Source: /usr/local/src/cmd/calc/RCS/HOWTO.INSTALL,v $
|
||||||
##
|
##
|
||||||
## Under source code control: 1999/09/27 20:48:44
|
## Under source code control: 1999/09/27 20:48:44
|
||||||
|
28
LIBRARY
28
LIBRARY
@@ -48,12 +48,30 @@ convenient for outside use. So you should read the source for a routine
|
|||||||
to see if it really does what you think it does. I won't guarantee that
|
to see if it really does what you think it does. I won't guarantee that
|
||||||
obscure internal routines won't change or disappear in future releases!
|
obscure internal routines won't change or disappear in future releases!
|
||||||
|
|
||||||
When calc is installed, all of the include files needed to build
|
When calc is installed, all of libraries are installed into ${LIBDIR}.
|
||||||
libcalc.a along with the link library itself are installed into ${LIBDIR}.
|
All of the calc header files are installed under ${INCDIRCALC}.
|
||||||
|
|
||||||
|
If CALC_SRC is defined, then the calc header files will assume that
|
||||||
|
they are in or under the current directory. However, most external
|
||||||
|
programs most likely will not be located under calc'c source tree.
|
||||||
|
External programs most likely want to use the installed calc header
|
||||||
|
files under ${INCDIRCALC}. External programs most likely NOT want
|
||||||
|
to define CALC_SRC.
|
||||||
|
|
||||||
External programs may want to compile with:
|
External programs may want to compile with:
|
||||||
|
|
||||||
-I${LIBDIR} -L${LIBDIR} -lcalc
|
-L${LIBDIR} -lcalc
|
||||||
|
|
||||||
|
If custom functions are also used, they may want to compile with:
|
||||||
|
|
||||||
|
-L${LIBDIR} -lcalc -lcustcalc
|
||||||
|
|
||||||
|
The CALC_SRC symbol should NOT be defined by default. However if you are
|
||||||
|
feeling pedantic you may want to force CALC_SRC to be undefined:
|
||||||
|
|
||||||
|
-UCALC_SRC
|
||||||
|
|
||||||
|
as well.
|
||||||
|
|
||||||
--------------
|
--------------
|
||||||
ERROR HANDLING
|
ERROR HANDLING
|
||||||
@@ -471,8 +489,8 @@ need call libcalc_call_me_last() only once.
|
|||||||
## received a copy with calc; if not, write to Free Software Foundation, Inc.
|
## received a copy with calc; if not, write to Free Software Foundation, Inc.
|
||||||
## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
||||||
##
|
##
|
||||||
## @(#) $Revision: 29.2 $
|
## @(#) $Revision: 29.5 $
|
||||||
## @(#) $Id: LIBRARY,v 29.2 2000/06/07 14:02:13 chongo Exp $
|
## @(#) $Id: LIBRARY,v 29.5 2001/06/08 22:57:35 chongo Exp $
|
||||||
## @(#) $Source: /usr/local/src/cmd/calc/RCS/LIBRARY,v $
|
## @(#) $Source: /usr/local/src/cmd/calc/RCS/LIBRARY,v $
|
||||||
##
|
##
|
||||||
## Under source code control: 1993/07/30 19:44:49
|
## Under source code control: 1993/07/30 19:44:49
|
||||||
|
@@ -3,15 +3,6 @@ Dear calc user on a Windoz based system,
|
|||||||
See the HOWTO.INSTALL file for information on how to build and install calc.
|
See the HOWTO.INSTALL file for information on how to build and install calc.
|
||||||
See also the README file.
|
See also the README file.
|
||||||
|
|
||||||
NOTE: The Windoz port is extremely experimental, untested and perhaps
|
|
||||||
incomplete. We are in the process of making it easier. The
|
|
||||||
following should help anyone who is trying to make a go of this
|
|
||||||
under the current code conditions.
|
|
||||||
|
|
||||||
NOTE: We are currently ONLY making an effort to support building under
|
|
||||||
Windoz using the Cygwin project (http://sources.redhat.com/cygwin/)
|
|
||||||
with the GCC compiler and Un*x tools for Windows.
|
|
||||||
|
|
||||||
NOTE: The main developers do not have access to a Windoz based platform.
|
NOTE: The main developers do not have access to a Windoz based platform.
|
||||||
While we will make an effort to not break calc Windoz based system,
|
While we will make an effort to not break calc Windoz based system,
|
||||||
our lack of a Windoz test environment will mean we will make mistakes
|
our lack of a Windoz test environment will mean we will make mistakes
|
||||||
@@ -19,7 +10,68 @@ NOTE: The main developers do not have access to a Windoz based platform.
|
|||||||
Of course you are welcome to send us any patches that fix your
|
Of course you are welcome to send us any patches that fix your
|
||||||
Windoz build environment.
|
Windoz build environment.
|
||||||
|
|
||||||
=-=
|
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
|
||||||
|
=-= compiling under DJGPP =-=
|
||||||
|
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
|
||||||
|
|
||||||
|
You might want to try using the DJGPP system to compile calc. See:
|
||||||
|
|
||||||
|
http://www.delorie.com/djgpp/
|
||||||
|
|
||||||
|
for DJGPP details and availability.
|
||||||
|
|
||||||
|
To compile with DJGPP, one needs to select a number of Makefile
|
||||||
|
variable changes. Eli Zaretskii <eliz at is dot elta dot co dot il>
|
||||||
|
recommends the following settings:
|
||||||
|
|
||||||
|
TERMCONTROL= -DUSE_TERMIOS
|
||||||
|
BYTE_ORDER= -DLITTLE_ENDIAN
|
||||||
|
LONG_BITS= 32
|
||||||
|
LONGLONG_BITS= 64
|
||||||
|
HAVE_FPOS_POS= -DHAVE_NO_FPOS_POS
|
||||||
|
FPOS_BITS= 32
|
||||||
|
OFF_T_BITS= 32
|
||||||
|
DEV_BITS= 32
|
||||||
|
INODE_BITS= 32
|
||||||
|
HAVE_USTAT= -DHAVE_NO_USTAT
|
||||||
|
HAVE_GETSID= -DHAVE_NO_GETSID
|
||||||
|
HAVE_GETPGID= -DHAVE_NO_GETPGID
|
||||||
|
HAVE_GETTIME= -DHAVE_NO_GETTIME
|
||||||
|
HAVE_GETPRID= -DHAVE_NO_GETPRID
|
||||||
|
HAVE_URANDOM_H= NO
|
||||||
|
ALIGN32= -UMUST_ALIGN32
|
||||||
|
HAVE_MALLOC_H= YES
|
||||||
|
HAVE_STDLIB_H= YES
|
||||||
|
HAVE_STRING_H= YES
|
||||||
|
HAVE_TIMES_H= NO
|
||||||
|
HAVE_SYS_TIMES_H= YES
|
||||||
|
HAVE_TIME_H= YES
|
||||||
|
HAVE_SYS_TIME_H= YES
|
||||||
|
HAVE_UNISTD_H= YES
|
||||||
|
BINDIR= /dev/env/DJDIR/bin
|
||||||
|
INCDIR= /dev/env/DJDIR/include
|
||||||
|
LIBDIR= /dev/env/DJDIR/lib
|
||||||
|
MANDIR= /dev/env/DJDIR/man/man1
|
||||||
|
CATDIR= /dev/env/DJDIR/man/cat1
|
||||||
|
NROFF= groff
|
||||||
|
CALCPATH= .;./cal;~/.cal;${CALC_SHAREDIR};${CUSTOMCALDIR}
|
||||||
|
CALCRC= ${CALC_SHAREDIR}/startup;~/.calcrc;./.calcinit
|
||||||
|
CALCPAGER= less.exe -ci
|
||||||
|
DEBUG= -O2 -gstabs+
|
||||||
|
|
||||||
|
The 'Linux set' or 'gcc set' (see the Select your compiler type section)
|
||||||
|
should work for DJGPP systems if you set the above Makefile variables.
|
||||||
|
|
||||||
|
Look for Makefile comments of the form:
|
||||||
|
|
||||||
|
# Select ...something... for DJGPP.
|
||||||
|
|
||||||
|
Follow those recommendations. In cases where they conflict with
|
||||||
|
the above Makefile list, follow the recommendation in the Makefile.
|
||||||
|
|
||||||
|
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
|
||||||
|
=-= compiling with Cygwin =-=
|
||||||
|
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
|
||||||
|
|
||||||
An effort is being made to allow windows users to compile calc using the
|
An effort is being made to allow windows users to compile calc using the
|
||||||
Cygwin project (http://sources.redhat.com/cygwin/) with the GCC compiler
|
Cygwin project (http://sources.redhat.com/cygwin/) with the GCC compiler
|
||||||
@@ -61,8 +113,6 @@ needs. Just copy the win32/*.[ch] files up into the top level calc
|
|||||||
source directory, edited (if needed) and build using the Cygwin GCC
|
source directory, edited (if needed) and build using the Cygwin GCC
|
||||||
compiler.
|
compiler.
|
||||||
|
|
||||||
=-=
|
|
||||||
|
|
||||||
People who maintain calc need to keep in mind the following:
|
People who maintain calc need to keep in mind the following:
|
||||||
|
|
||||||
The following was added to opcodes.h, config.h, zmath.h and value.h:
|
The following was added to opcodes.h, config.h, zmath.h and value.h:
|
||||||
@@ -89,7 +139,7 @@ was changed to:
|
|||||||
DLL extern int configtype(char*);
|
DLL extern int configtype(char*);
|
||||||
|
|
||||||
|
|
||||||
## Copyright (C) 2001 Landon Curt Noll and Thomas Jones-Low
|
## Copyright (C) 2002 Landon Curt Noll and Thomas Jones-Low
|
||||||
##
|
##
|
||||||
## Calc is open software; you can redistribute it and/or modify it under
|
## Calc is open software; you can redistribute it and/or modify it under
|
||||||
## the terms of the version 2.1 of the GNU Lesser General Public License
|
## the terms of the version 2.1 of the GNU Lesser General Public License
|
||||||
@@ -105,8 +155,8 @@ was changed to:
|
|||||||
## received a copy with calc; if not, write to Free Software Foundation, Inc.
|
## received a copy with calc; if not, write to Free Software Foundation, Inc.
|
||||||
## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
||||||
##
|
##
|
||||||
## @(#) $Revision: 29.6 $
|
## @(#) $Revision: 29.8 $
|
||||||
## @(#) $Id: README.WINDOWS,v 29.6 2001/04/08 22:13:38 chongo Exp $
|
## @(#) $Id: README.WINDOWS,v 29.8 2002/03/14 00:28:28 chongo Exp $
|
||||||
## @(#) $Source: /usr/local/src/cmd/calc/RCS/README.WINDOWS,v $
|
## @(#) $Source: /usr/local/src/cmd/calc/RCS/README.WINDOWS,v $
|
||||||
##
|
##
|
||||||
## Under source code control: 2001/02/25 14:00:05
|
## Under source code control: 2001/02/25 14:00:05
|
||||||
|
6
alloc.h
6
alloc.h
@@ -17,8 +17,8 @@
|
|||||||
* received a copy with calc; if not, write to Free Software Foundation, Inc.
|
* received a copy with calc; if not, write to Free Software Foundation, Inc.
|
||||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
* 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
||||||
*
|
*
|
||||||
* @(#) $Revision: 29.3 $
|
* @(#) $Revision: 29.4 $
|
||||||
* @(#) $Id: alloc.h,v 29.3 2001/05/29 00:16:53 chongo Exp $
|
* @(#) $Id: alloc.h,v 29.4 2001/06/08 21:00:58 chongo Exp $
|
||||||
* @(#) $Source: /usr/local/src/cmd/calc/RCS/alloc.h,v $
|
* @(#) $Source: /usr/local/src/cmd/calc/RCS/alloc.h,v $
|
||||||
*
|
*
|
||||||
* Under source code control: 1990/02/15 01:48:29
|
* Under source code control: 1990/02/15 01:48:29
|
||||||
@@ -32,7 +32,7 @@
|
|||||||
#define __ALLOC_H__
|
#define __ALLOC_H__
|
||||||
|
|
||||||
|
|
||||||
#if defined(SRC) /* if we are building from the calc source tree */
|
#if defined(CALC_SRC) /* if we are building from the calc source tree */
|
||||||
# include "have_malloc.h"
|
# include "have_malloc.h"
|
||||||
# include "have_newstr.h"
|
# include "have_newstr.h"
|
||||||
# include "have_string.h"
|
# include "have_string.h"
|
||||||
|
@@ -17,8 +17,8 @@
|
|||||||
* received a copy with calc; if not, write to Free Software Foundation, Inc.
|
* received a copy with calc; if not, write to Free Software Foundation, Inc.
|
||||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
* 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
||||||
*
|
*
|
||||||
* @(#) $Revision: 29.3 $
|
* @(#) $Revision: 29.4 $
|
||||||
* @(#) $Id: byteswap.h,v 29.3 2001/05/29 00:16:53 chongo Exp $
|
* @(#) $Id: byteswap.h,v 29.4 2001/06/08 21:00:58 chongo Exp $
|
||||||
* @(#) $Source: /usr/local/src/cmd/calc/RCS/byteswap.h,v $
|
* @(#) $Source: /usr/local/src/cmd/calc/RCS/byteswap.h,v $
|
||||||
*
|
*
|
||||||
* Under source code control: 1995/10/11 04:44:01
|
* Under source code control: 1995/10/11 04:44:01
|
||||||
@@ -33,7 +33,7 @@
|
|||||||
#define __BYTESWAP_H__
|
#define __BYTESWAP_H__
|
||||||
|
|
||||||
|
|
||||||
#if defined(SRC) /* if we are building from the calc source tree */
|
#if defined(CALC_SRC) /* if we are building from the calc source tree */
|
||||||
# include "longbits.h"
|
# include "longbits.h"
|
||||||
#else
|
#else
|
||||||
# include <calc/longbits.h>
|
# include <calc/longbits.h>
|
||||||
|
180
cal/Makefile
180
cal/Makefile
@@ -18,8 +18,8 @@
|
|||||||
# received a copy with calc; if not, write to Free Software Foundation, Inc.
|
# received a copy with calc; if not, write to Free Software Foundation, Inc.
|
||||||
# 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
# 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
||||||
#
|
#
|
||||||
# @(#) $Revision: 29.9 $
|
# @(#) $Revision: 29.15 $
|
||||||
# @(#) $Id: Makefile,v 29.9 2001/05/28 21:56:08 chongo Exp $
|
# @(#) $Id: Makefile,v 29.15 2003/01/05 08:10:56 chongo Exp $
|
||||||
# @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/Makefile,v $
|
# @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/Makefile,v $
|
||||||
#
|
#
|
||||||
# Under source code control: 1991/07/21 05:00:54
|
# Under source code control: 1991/07/21 05:00:54
|
||||||
@@ -36,16 +36,120 @@
|
|||||||
SHELL = /bin/sh
|
SHELL = /bin/sh
|
||||||
MAKE_FILE = Makefile
|
MAKE_FILE = Makefile
|
||||||
|
|
||||||
|
####
|
||||||
# Normally, the upper level makefile will set these values. We provide
|
# Normally, the upper level makefile will set these values. We provide
|
||||||
# a default here just in case you want to build from this directory.
|
# a default here just in case you want to build from this directory.
|
||||||
#
|
####
|
||||||
# where to install things
|
|
||||||
#SHAREDIR= /usr/local/lib
|
|
||||||
#SHAREDIR= /usr/lib
|
|
||||||
SHAREDIR= /usr/share
|
|
||||||
#SHAREDIR= /usr/libdata
|
|
||||||
|
|
||||||
CSHAREDIR= ${SHAREDIR}/calc
|
# Where the system include (.h) files are kept
|
||||||
|
#
|
||||||
|
# For DJGPP, select:
|
||||||
|
#
|
||||||
|
# INCDIR= /dev/env/DJDIR/include
|
||||||
|
#
|
||||||
|
# If in doubt, set:
|
||||||
|
#
|
||||||
|
# INCDIR= /usr/include
|
||||||
|
#
|
||||||
|
|
||||||
|
#INCDIR= /usr/local/include
|
||||||
|
#INCDIR= /dev/env/DJDIR/include
|
||||||
|
INCDIR= /usr/include
|
||||||
|
|
||||||
|
# where to install calc realted things
|
||||||
|
#
|
||||||
|
# ${BINDIR} where to install calc binary files
|
||||||
|
# ${LIBDIR} where calc link library (*.a) files are installed
|
||||||
|
# ${CALC_SHAREDIR} where to install calc help, .cal, startup, config files
|
||||||
|
#
|
||||||
|
# NOTE: The install rule prepends installation paths with $T, which
|
||||||
|
# by default is empty. If $T is non-empty, then installation
|
||||||
|
# locations will be relative to the $T directory.
|
||||||
|
#
|
||||||
|
# For DJGPP, select:
|
||||||
|
#
|
||||||
|
# BINDIR= /dev/env/DJDIR/bin
|
||||||
|
# LIBDIR= /dev/env/DJDIR/lib
|
||||||
|
# CALC_SHAREDIR= /dev/env/DJDIR/share/calc
|
||||||
|
#
|
||||||
|
# If in doubt, set:
|
||||||
|
#
|
||||||
|
# BINDIR= /usr/bin
|
||||||
|
# LIBDIR= /usr/lib
|
||||||
|
# CALC_SHAREDIR= /usr/share/calc
|
||||||
|
#
|
||||||
|
#BINDIR= /usr/local/bin
|
||||||
|
#BINDIR= /dev/env/DJDIR/bin
|
||||||
|
BINDIR= /usr/bin
|
||||||
|
|
||||||
|
#LIBDIR= /usr/local/lib
|
||||||
|
#LIBDIR= /dev/env/DJDIR/lib
|
||||||
|
LIBDIR= /usr/lib
|
||||||
|
|
||||||
|
#CALC_SHAREDIR= /usr/local/lib/calc
|
||||||
|
#CALC_SHAREDIR= /dev/env/DJDIR/share/calc
|
||||||
|
CALC_SHAREDIR= /usr/share/calc
|
||||||
|
|
||||||
|
# By default, these values are based CALC_SHAREDIR, INCDIR, BINDIR
|
||||||
|
# ---------------------------------------------------------------
|
||||||
|
# ${HELPDIR} where the help directory is installed
|
||||||
|
# ${CALC_INCDIR} where the calc include files are installed
|
||||||
|
# ${CUSTOMCALDIR} where custom *.cal files are installed
|
||||||
|
# ${CUSTOMHELPDIR} where custom help files are installed
|
||||||
|
# ${CUSTOMINCPDIR} where custom .h files are installed
|
||||||
|
# ${SCRIPTDIR} where calc shell scripts are installed
|
||||||
|
#
|
||||||
|
# NOTE: The install rule prepends installation paths with $T, which
|
||||||
|
# by default is empty. If $T is non-empty, then installation
|
||||||
|
# locations will be relative to the $T directory.
|
||||||
|
#
|
||||||
|
# If in doubt, set:
|
||||||
|
#
|
||||||
|
# HELPDIR= ${CALC_SHAREDIR}/help
|
||||||
|
# CALC_INCDIR= ${INCDIR}/calc
|
||||||
|
# CUSTOMCALDIR= ${CALC_SHAREDIR}/custom
|
||||||
|
# CUSTOMHELPDIR= ${CALC_SHAREDIR}/custhelp
|
||||||
|
# CUSTOMINCDIR= ${CALC_INCDIR}/custom
|
||||||
|
# SCRIPTDIR= ${BINDIR}/cscript
|
||||||
|
#
|
||||||
|
HELPDIR= ${CALC_SHAREDIR}/help
|
||||||
|
CALC_INCDIR= ${INCDIR}/calc
|
||||||
|
CUSTOMCALDIR= ${CALC_SHAREDIR}/custom
|
||||||
|
CUSTOMHELPDIR= ${CALC_SHAREDIR}/custhelp
|
||||||
|
CUSTOMINCDIR= ${CALC_INCDIR}/custom
|
||||||
|
SCRIPTDIR= ${BINDIR}/cscript
|
||||||
|
|
||||||
|
# T - top level directory under which calc will be installed
|
||||||
|
#
|
||||||
|
# The calc install is performed under $T, the calc build is
|
||||||
|
# performed under /. The purpose for $T is to allow someone
|
||||||
|
# to install calc somewhere other than into the system area.
|
||||||
|
#
|
||||||
|
# For example, if:
|
||||||
|
#
|
||||||
|
# BINDIR= /usr/bin
|
||||||
|
# LIBDIR= /usr/lib
|
||||||
|
# CALC_SHAREDIR= /usr/share/calc
|
||||||
|
#
|
||||||
|
# and if:
|
||||||
|
#
|
||||||
|
# T= /var/tmp/testing
|
||||||
|
#
|
||||||
|
# Then the installation locations will be:
|
||||||
|
#
|
||||||
|
# calc binary files: /var/tmp/testing/usr/bin
|
||||||
|
# calc link library: /var/tmp/testing/usr/lib
|
||||||
|
# calc help, .cal ...: /var/tmp/testing/usr/share/calc
|
||||||
|
# ... etc ... /var/tmp/testing/...
|
||||||
|
#
|
||||||
|
# If $T is empty, calc is installed under /, which is the same
|
||||||
|
# top of tree for which it was built. If $T is non-empty, then
|
||||||
|
# calc is installed under $T, as if one had to chroot under
|
||||||
|
# $T for calc to operate.
|
||||||
|
#
|
||||||
|
# If in doubt, use T=
|
||||||
|
#
|
||||||
|
T=
|
||||||
|
|
||||||
# Makefile debug
|
# Makefile debug
|
||||||
#
|
#
|
||||||
@@ -71,8 +175,8 @@ CALC_FILES= README bigprime.cal deg.cal ellip.cal lucas.cal lucas_chk.cal \
|
|||||||
test2700.cal test3100.cal test3300.cal test3400.cal prompt.cal \
|
test2700.cal test3100.cal test3300.cal test3400.cal prompt.cal \
|
||||||
test3500.cal seedrandom.cal test4000.cal test4100.cal test4600.cal \
|
test3500.cal seedrandom.cal test4000.cal test4100.cal test4600.cal \
|
||||||
beer.cal hello.cal test5100.cal test5200.cal randombitrun.cal \
|
beer.cal hello.cal test5100.cal test5200.cal randombitrun.cal \
|
||||||
randomrun.cal xx_print.cal natnumset.cal qtime.cal test8400.cal \
|
randomrun.cal repeat.cal xx_print.cal natnumset.cal qtime.cal \
|
||||||
test8500.cal test8600.cal chi.cal intfile.cal
|
test8400.cal test8500.cal test8600.cal chi.cal intfile.cal
|
||||||
|
|
||||||
# These files are found (but not built) in the distribution
|
# These files are found (but not built) in the distribution
|
||||||
#
|
#
|
||||||
@@ -104,8 +208,10 @@ all: ${CALC_FILES} ${MAKE_FILE} .all
|
|||||||
##
|
##
|
||||||
|
|
||||||
distlist: ${DISTLIST}
|
distlist: ${DISTLIST}
|
||||||
${Q}for i in ${DISTLIST}; do \
|
${Q}for i in ${DISTLIST} /dev/null; do \
|
||||||
|
if [ X"$$i" != X"/dev/null" ]; then \
|
||||||
echo cal/$$i; \
|
echo cal/$$i; \
|
||||||
|
fi; \
|
||||||
done
|
done
|
||||||
|
|
||||||
distdir:
|
distdir:
|
||||||
@@ -124,12 +230,11 @@ calcliblist:
|
|||||||
#
|
#
|
||||||
##
|
##
|
||||||
|
|
||||||
echo_CALC_FILES: ${MAKE_FILE}
|
echo_inst_files:
|
||||||
@echo ${CALC_FILES}
|
${Q}for i in ${CALC_FILES} /dev/null; do \
|
||||||
|
if [ X"$$i" != X"/dev/null" ]; then \
|
||||||
echo_install.list: ${MAKE_FILE}
|
echo __file__ ${CALC_SHAREDIR}/$$i; \
|
||||||
@for i in ${CALC_FILES}; do \
|
fi; \
|
||||||
echo ${CSHAREDIR}/$$i; \
|
|
||||||
done
|
done
|
||||||
|
|
||||||
##
|
##
|
||||||
@@ -144,30 +249,29 @@ clobber:
|
|||||||
rm -f .all
|
rm -f .all
|
||||||
|
|
||||||
install: all
|
install: all
|
||||||
-${Q}if [ ! -d ${SHAREDIR} ]; then \
|
-${Q}if [ ! -d $T${CALC_SHAREDIR} ]; then \
|
||||||
echo mkdir ${SHAREDIR}; \
|
echo mkdir $T${CALC_SHAREDIR}; \
|
||||||
mkdir ${SHAREDIR}; \
|
mkdir $T${CALC_SHAREDIR}; \
|
||||||
echo ${CHMOD} 0755 ${SHAREDIR}; \
|
if [ ! -d "$T${CALC_SHAREDIR}" ]; then \
|
||||||
${CHMOD} 0755 ${SHAREDIR}; \
|
echo mkdir -p "$T${CALC_SHAREDIR}"; \
|
||||||
|
mkdir -p "$T${CALC_SHAREDIR}"; \
|
||||||
|
fi; \
|
||||||
|
echo ${CHMOD} 0755 $T${CALC_SHAREDIR}; \
|
||||||
|
${CHMOD} 0755 $T${CALC_SHAREDIR}; \
|
||||||
else \
|
else \
|
||||||
true; \
|
true; \
|
||||||
fi
|
fi
|
||||||
-${Q}if [ ! -d ${CSHAREDIR} ]; then \
|
${Q}for i in ${CALC_FILES} /dev/null; do \
|
||||||
echo mkdir ${CSHAREDIR}; \
|
if [ "$$i" = "/dev/null" ]; then \
|
||||||
mkdir ${CSHAREDIR}; \
|
continue; \
|
||||||
echo ${CHMOD} 0755 ${CSHAREDIR}; \
|
fi; \
|
||||||
${CHMOD} 0755 ${CSHAREDIR}; \
|
if ${CMP} -s $$i $T${CALC_SHAREDIR}/$$i; then \
|
||||||
else \
|
|
||||||
true; \
|
|
||||||
fi
|
|
||||||
${Q}for i in ${CALC_FILES}; do \
|
|
||||||
if ${CMP} -s $$i ${CSHAREDIR}/$$i; then \
|
|
||||||
true; \
|
true; \
|
||||||
else \
|
else \
|
||||||
rm -f ${CSHAREDIR}/$$i.new; \
|
rm -f $T${CALC_SHAREDIR}/$$i.new; \
|
||||||
cp -f $$i ${CSHAREDIR}/$$i.new; \
|
cp -f $$i $T${CALC_SHAREDIR}/$$i.new; \
|
||||||
${CHMOD} 0444 ${CSHAREDIR}/$$i.new; \
|
${CHMOD} 0444 $T${CALC_SHAREDIR}/$$i.new; \
|
||||||
mv -f ${CSHAREDIR}/$$i.new ${CSHAREDIR}/$$i; \
|
mv -f $T${CALC_SHAREDIR}/$$i.new $T${CALC_SHAREDIR}/$$i; \
|
||||||
echo "installed ${CSHAREDIR}/$$i"; \
|
echo "installed $T${CALC_SHAREDIR}/$$i"; \
|
||||||
fi; \
|
fi; \
|
||||||
done
|
done
|
||||||
|
14
cal/README
14
cal/README
@@ -480,6 +480,16 @@ randrun.cal
|
|||||||
|
|
||||||
This tests the a55 generator.
|
This tests the a55 generator.
|
||||||
|
|
||||||
|
repeat.cal
|
||||||
|
|
||||||
|
repeat(digit_set, repeat_count)
|
||||||
|
|
||||||
|
Return the value of the digit_set repeated repeat_count times.
|
||||||
|
Both digit_set and repeat_count must be integers > 0.
|
||||||
|
|
||||||
|
For example repeat(423,5) returns the value 423423423423423,
|
||||||
|
which is the digit_set 423 repeated 5 times.
|
||||||
|
|
||||||
|
|
||||||
regress.cal
|
regress.cal
|
||||||
|
|
||||||
@@ -815,8 +825,8 @@ xx_print.cal
|
|||||||
## received a copy with calc; if not, write to Free Software Foundation, Inc.
|
## received a copy with calc; if not, write to Free Software Foundation, Inc.
|
||||||
## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
||||||
##
|
##
|
||||||
## @(#) $Revision: 29.8 $
|
## @(#) $Revision: 29.9 $
|
||||||
## @(#) $Id: README,v 29.8 2001/03/31 16:26:23 chongo Exp $
|
## @(#) $Id: README,v 29.9 2003/01/05 08:10:56 chongo Exp $
|
||||||
## @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/README,v $
|
## @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/README,v $
|
||||||
##
|
##
|
||||||
## Under source code control: 1990/02/15 01:50:32
|
## Under source code control: 1990/02/15 01:50:32
|
||||||
|
@@ -17,8 +17,8 @@
|
|||||||
* received a copy with calc; if not, write to Free Software Foundation, Inc.
|
* received a copy with calc; if not, write to Free Software Foundation, Inc.
|
||||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
* 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
||||||
*
|
*
|
||||||
* @(#) $Revision: 29.3 $
|
* @(#) $Revision: 29.6 $
|
||||||
* @(#) $Id: lucas.cal,v 29.3 2001/03/31 13:31:34 chongo Exp $
|
* @(#) $Id: lucas.cal,v 29.6 2002/07/10 09:43:46 chongo Exp $
|
||||||
* @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/lucas.cal,v $
|
* @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/lucas.cal,v $
|
||||||
*
|
*
|
||||||
* Under source code control: 1990/05/03 16:49:51
|
* Under source code control: 1990/05/03 16:49:51
|
||||||
@@ -28,6 +28,16 @@
|
|||||||
* Share and enjoy! :-) http://www.isthe.com/chongo/tech/comp/calc/
|
* Share and enjoy! :-) http://www.isthe.com/chongo/tech/comp/calc/
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* NOTE: This is a standard calc resource file. For information on calc see:
|
||||||
|
*
|
||||||
|
* http://www.isthe.com/chongo/tech/comp/calc/index.html
|
||||||
|
*
|
||||||
|
* To obtain your own copy of calc, see:
|
||||||
|
*
|
||||||
|
* http://www.isthe.com/chongo/tech/comp/calc/calc-download.html
|
||||||
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* HISTORICAL NOTE:
|
* HISTORICAL NOTE:
|
||||||
*
|
*
|
||||||
@@ -52,12 +62,19 @@
|
|||||||
*
|
*
|
||||||
* At the time of discovery, this was the largest known twin prime pair.
|
* At the time of discovery, this was the largest known twin prime pair.
|
||||||
*
|
*
|
||||||
|
* See:
|
||||||
|
*
|
||||||
|
* http://www.isthe.com/chongo/tech/math/prime/amdahl6.html
|
||||||
|
*
|
||||||
|
* for more information on the Amdahl 6 group.
|
||||||
|
*
|
||||||
* NOTE: Both largest known and largest known twin prime records have been
|
* NOTE: Both largest known and largest known twin prime records have been
|
||||||
* broken. Rather than update this file each time, I'll just
|
* broken. Rather than update this file each time, I'll just
|
||||||
* congratulate the finders and encourage others to try for
|
* congratulate the finders and encourage others to try for
|
||||||
* larger finds. Records were made to be broken afterall!
|
* larger finds. Records were made to be broken afterall!
|
||||||
*
|
*/
|
||||||
* ON GAINING A WORLD RECORD:
|
|
||||||
|
/* ON GAINING A WORLD RECORD:
|
||||||
*
|
*
|
||||||
* The routines in calc were designed to be portable, and to work on
|
* The routines in calc were designed to be portable, and to work on
|
||||||
* numbers of 'sane' size. The Amdahl 6 team used a 'ultra-high speed
|
* numbers of 'sane' size. The Amdahl 6 team used a 'ultra-high speed
|
||||||
@@ -73,7 +90,7 @@
|
|||||||
*
|
*
|
||||||
* test numbers of the form h*2^n-1
|
* test numbers of the form h*2^n-1
|
||||||
* fix a value of n and vary the value h
|
* fix a value of n and vary the value h
|
||||||
* n mod 128 == 0
|
* n mod 2^x == 0 for some value of x, say > 7 or more
|
||||||
* h*2^n-1 is not divisible by any small prime < 2^40
|
* h*2^n-1 is not divisible by any small prime < 2^40
|
||||||
* 0 < h < 2^39
|
* 0 < h < 2^39
|
||||||
* h*2^n+1 is not divisible by any small prime < 2^40
|
* h*2^n+1 is not divisible by any small prime < 2^40
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* regress - calc regression and correctness test suite
|
* regress - calc regression and correctness test suite
|
||||||
*
|
*
|
||||||
* Copyright (C) 1999 David I. Bell
|
* Copyright (C) 1999-2002 David I. Bell and Landon Curt Noll
|
||||||
*
|
*
|
||||||
* Calc is open software; you can redistribute it and/or modify it under
|
* Calc is open software; you can redistribute it and/or modify it under
|
||||||
* the terms of the version 2.1 of the GNU Lesser General Public License
|
* the terms of the version 2.1 of the GNU Lesser General Public License
|
||||||
@@ -17,8 +17,8 @@
|
|||||||
* received a copy with calc; if not, write to Free Software Foundation, Inc.
|
* received a copy with calc; if not, write to Free Software Foundation, Inc.
|
||||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
* 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
||||||
*
|
*
|
||||||
* @(#) $Revision: 29.10 $
|
* @(#) $Revision: 29.14 $
|
||||||
* @(#) $Id: regress.cal,v 29.10 2001/04/14 22:53:57 chongo Exp $
|
* @(#) $Id: regress.cal,v 29.14 2002/12/29 09:16:07 chongo Exp $
|
||||||
* @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/regress.cal,v $
|
* @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/regress.cal,v $
|
||||||
*
|
*
|
||||||
* Under source code control: 1990/02/15 01:50:36
|
* Under source code control: 1990/02/15 01:50:36
|
||||||
@@ -492,7 +492,11 @@ define test_config()
|
|||||||
vrfy(strlen(config("version")) > 0,
|
vrfy(strlen(config("version")) > 0,
|
||||||
'555: strlen(config("version")) > 0');
|
'555: strlen(config("version")) > 0');
|
||||||
|
|
||||||
print '556: Ending test_config';
|
/* mode2 is off by default */
|
||||||
|
vrfy(config("mode2") == "off",
|
||||||
|
'556: config("mode2") == "off"');
|
||||||
|
|
||||||
|
print '557: Ending test_config';
|
||||||
}
|
}
|
||||||
print '010: parsed test_config()';
|
print '010: parsed test_config()';
|
||||||
|
|
||||||
@@ -1793,7 +1797,23 @@ define test_mode()
|
|||||||
vrfy(str(3e9) == "3000000000", \
|
vrfy(str(3e9) == "3000000000", \
|
||||||
'1650: str(3e9) == \"3000000000\"');
|
'1650: str(3e9) == \"3000000000\"');
|
||||||
|
|
||||||
print '1651: Ending mode/base test';
|
/* test base2() functionality */
|
||||||
|
vrfy(base2() == 0, '1651: base2() == 0');
|
||||||
|
vrfy(base2(0) == 0, '1652: base2(0) == 0');
|
||||||
|
vrfy(base2() == 0, '1653: base2() == 0');
|
||||||
|
vrfy(base2(16) == 0, '1654: base2(16) == 0');
|
||||||
|
vrfy(base2() == 16, '1655: base2() == 16');
|
||||||
|
vrfy(str(3e9) == "3000000000 /* 0xb2d05e00 */",
|
||||||
|
'1656: str(3e9) == "3000000000 /* 0xb2d05e00 */"');
|
||||||
|
vrfy(base2(1/3) == 16, '1657: base2(16) == 16');
|
||||||
|
vrfy(str(23209) == "23209 /* 23209 */",
|
||||||
|
'1658: str(23209) == "23209 /* 23209 */"');
|
||||||
|
vrfy(str(3/2) == "1.5 /* 3/2 */",
|
||||||
|
'1659: str(3/2) == "1.5 /* 3/2 */"');
|
||||||
|
vrfy(base() == 10, '1660: base() == 10');
|
||||||
|
vrfy(base2(0) == 1/3, '1661: base2(0) == 1/3');
|
||||||
|
|
||||||
|
print '1662: Ending mode/base test';
|
||||||
}
|
}
|
||||||
print '026: parsed test_mode()';
|
print '026: parsed test_mode()';
|
||||||
|
|
||||||
@@ -4547,7 +4567,14 @@ define test_random()
|
|||||||
vrfy(seed() < 2^64, '5465: seed() < 2^64');
|
vrfy(seed() < 2^64, '5465: seed() < 2^64');
|
||||||
vrfy(israndom(srandom(seed())), '5466: israndom(srandom(seed()))');
|
vrfy(israndom(srandom(seed())), '5466: israndom(srandom(seed()))');
|
||||||
|
|
||||||
print '5467: Ending test_random';
|
/* verify random(10,11) double bug fix */
|
||||||
|
vrfy(random(10,11) == 10, '5467: random(10,11) == 10');
|
||||||
|
vrfy(random(10,11) == 10, '5468: random(10,11) == 10');
|
||||||
|
vrfy(random(10,11) == 10, '5469: random(10,11) == 10');
|
||||||
|
vrfy(random(0,1) == 0, '5470: random(0,1) == 0');
|
||||||
|
vrfy(random(0,1) == 0, '5471: random(0,1) == 0');
|
||||||
|
|
||||||
|
print '5472: Ending test_random';
|
||||||
}
|
}
|
||||||
print '137: parsed test_random()';
|
print '137: parsed test_random()';
|
||||||
|
|
||||||
|
53
cal/repeat.cal
Normal file
53
cal/repeat.cal
Normal file
@@ -0,0 +1,53 @@
|
|||||||
|
/*
|
||||||
|
* repeat - return the value of a repeated set of digits
|
||||||
|
*
|
||||||
|
* Copyright (C) 2003 Landon Curt Noll
|
||||||
|
*
|
||||||
|
* Calc is open software; you can redistribute it and/or modify it under
|
||||||
|
* the terms of the version 2.1 of the GNU Lesser General Public License
|
||||||
|
* as published by the Free Software Foundation.
|
||||||
|
*
|
||||||
|
* Calc is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||||
|
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
|
||||||
|
* Public License for more details.
|
||||||
|
*
|
||||||
|
* A copy of version 2.1 of the GNU Lesser General Public License is
|
||||||
|
* distributed with calc under the filename COPYING-LGPL. You should have
|
||||||
|
* received a copy with calc; if not, write to Free Software Foundation, Inc.
|
||||||
|
* 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
||||||
|
*
|
||||||
|
* @(#) $Revision: 29.3 $
|
||||||
|
* @(#) $Id: repeat.cal,v 29.3 2003/01/14 04:03:20 chongo Exp $
|
||||||
|
* @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/repeat.cal,v $
|
||||||
|
*
|
||||||
|
* Under source code control: 2003/01/05 00:00:01
|
||||||
|
* File existed as early as: 2003
|
||||||
|
*
|
||||||
|
* chongo <was here> /\oo/\ http://www.isthe.com/chongo/
|
||||||
|
* Share and enjoy! :-) http://www.isthe.com/chongo/tech/comp/calc/
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* repeat - return the value of a repeated set of digits
|
||||||
|
*
|
||||||
|
* usage:
|
||||||
|
* repeat(digit_set, repeat_count)
|
||||||
|
*/
|
||||||
|
define repeat(digit_set, repeat_count)
|
||||||
|
{
|
||||||
|
local digit_count; /* digits in the digit_set */
|
||||||
|
|
||||||
|
/* firewall */
|
||||||
|
if (!isint(digit_set) || digit_set <= 0) {
|
||||||
|
quit "digit set must be an integer > 0";
|
||||||
|
}
|
||||||
|
if (!isint(repeat_count) || repeat_count <= 0) {
|
||||||
|
quit "repeat count must be an integer > 0";
|
||||||
|
}
|
||||||
|
|
||||||
|
/* return repeated set of digits */
|
||||||
|
digit_count = max(digits(digit_set), 1);
|
||||||
|
return digit_set * (10^(digit_count*repeat_count)-1) / (10^digit_count-1);
|
||||||
|
}
|
12
calc.h
12
calc.h
@@ -17,8 +17,8 @@
|
|||||||
* received a copy with calc; if not, write to Free Software Foundation, Inc.
|
* received a copy with calc; if not, write to Free Software Foundation, Inc.
|
||||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
* 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
||||||
*
|
*
|
||||||
* @(#) $Revision: 29.7 $
|
* @(#) $Revision: 29.10 $
|
||||||
* @(#) $Id: calc.h,v 29.7 2001/05/29 00:16:53 chongo Exp $
|
* @(#) $Id: calc.h,v 29.10 2002/03/12 09:40:57 chongo Exp $
|
||||||
* @(#) $Source: /usr/local/src/cmd/calc/RCS/calc.h,v $
|
* @(#) $Source: /usr/local/src/cmd/calc/RCS/calc.h,v $
|
||||||
*
|
*
|
||||||
* Under source code control: 1990/02/15 01:48:31
|
* Under source code control: 1990/02/15 01:48:31
|
||||||
@@ -32,7 +32,7 @@
|
|||||||
#define __CALC_H__
|
#define __CALC_H__
|
||||||
|
|
||||||
#include <setjmp.h>
|
#include <setjmp.h>
|
||||||
#if defined(SRC) /* if we are building from the calc source tree */
|
#if defined(CALC_SRC) /* if we are building from the calc source tree */
|
||||||
# include "win32dll.h"
|
# include "win32dll.h"
|
||||||
# include "value.h"
|
# include "value.h"
|
||||||
# include "have_const.h"
|
# include "have_const.h"
|
||||||
@@ -60,7 +60,11 @@
|
|||||||
#define HOMECHAR '~' /* char which indicates home directory */
|
#define HOMECHAR '~' /* char which indicates home directory */
|
||||||
#define DOTCHAR '.' /* char which indicates current directory */
|
#define DOTCHAR '.' /* char which indicates current directory */
|
||||||
#define PATHCHAR '/' /* char which separates path components */
|
#define PATHCHAR '/' /* char which separates path components */
|
||||||
|
#if defined(__MSDOS__) || defined(__WIN32)
|
||||||
|
#define LISTCHAR ';' /* char which separates paths in a list */
|
||||||
|
#else
|
||||||
#define LISTCHAR ':' /* char which separates paths in a list */
|
#define LISTCHAR ':' /* char which separates paths in a list */
|
||||||
|
#endif
|
||||||
#define MAXCMD 16384 /* maximum length of command invocation */
|
#define MAXCMD 16384 /* maximum length of command invocation */
|
||||||
#define MAXERROR 512 /* maximum length of error message string */
|
#define MAXERROR 512 /* maximum length of error message string */
|
||||||
|
|
||||||
@@ -258,7 +262,7 @@ extern DLL char *run_state_name(run state);
|
|||||||
extern int calc_major_ver;
|
extern int calc_major_ver;
|
||||||
extern int calc_minor_ver;
|
extern int calc_minor_ver;
|
||||||
extern int calc_major_patch;
|
extern int calc_major_patch;
|
||||||
extern char *calc_minor_patch;
|
extern int calc_minor_patch;
|
||||||
extern char *Copyright;
|
extern char *Copyright;
|
||||||
extern DLL char *version(void);
|
extern DLL char *version(void);
|
||||||
|
|
||||||
|
26
calc.man
26
calc.man
@@ -15,8 +15,8 @@
|
|||||||
.\" received a copy with calc; if not, write to Free Software Foundation, Inc.
|
.\" received a copy with calc; if not, write to Free Software Foundation, Inc.
|
||||||
.\" 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
.\" 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
||||||
.\"
|
.\"
|
||||||
.\" @(#) $Revision: 29.7 $
|
.\" @(#) $Revision: 29.9 $
|
||||||
.\" @(#) $Id: calc.man,v 29.7 2001/06/01 11:26:53 chongo Exp $
|
.\" @(#) $Id: calc.man,v 29.9 2002/03/14 00:28:28 chongo Exp $
|
||||||
.\" @(#) $Source: /usr/local/src/cmd/calc/RCS/calc.man,v $
|
.\" @(#) $Source: /usr/local/src/cmd/calc/RCS/calc.man,v $
|
||||||
.\"
|
.\"
|
||||||
.\" Under source code control: 1991/07/23 05:48:26
|
.\" Under source code control: 1991/07/23 05:48:26
|
||||||
@@ -54,7 +54,7 @@ calc \- arbitrary precision calculator
|
|||||||
.RB [ calc_cmd\ \&.\|.\|. ]
|
.RB [ calc_cmd\ \&.\|.\|. ]
|
||||||
.in -5n
|
.in -5n
|
||||||
.sp
|
.sp
|
||||||
\fI#!${BINDIR}/calc\fP\ \fB\-S\fP\ [other_flags\ \&...]
|
\fI#!${BINDIR}/calc\fP\ \fB\-f\fP\ [other_flags\ \&...]
|
||||||
.SH DESCRIPTION
|
.SH DESCRIPTION
|
||||||
\&
|
\&
|
||||||
.br
|
.br
|
||||||
@@ -514,8 +514,8 @@ searches in succession:
|
|||||||
./myfile.cal
|
./myfile.cal
|
||||||
${LIBDIR}/myfile
|
${LIBDIR}/myfile
|
||||||
${LIBDIR}/myfile.cal
|
${LIBDIR}/myfile.cal
|
||||||
${CUSTOMLIBDIR}/myfile
|
${CUSTOMCALDIR}/myfile
|
||||||
${CUSTOMLIBDIR}/myfile.cal
|
${CUSTOMCALDIR}/myfile.cal
|
||||||
.fi
|
.fi
|
||||||
.in -5n
|
.in -5n
|
||||||
.sp 1
|
.sp 1
|
||||||
@@ -572,27 +572,25 @@ If first line of an executable file begins
|
|||||||
followed by the absolute pathname of the
|
followed by the absolute pathname of the
|
||||||
.B calc
|
.B calc
|
||||||
program and the flag
|
program and the flag
|
||||||
.B \-S
|
.B \-f
|
||||||
as in:
|
as in:
|
||||||
.sp 1
|
.sp 1
|
||||||
.in +5n
|
.in +5n
|
||||||
.nf
|
.nf
|
||||||
\fI#!${BINDIR}/calc\fP\ \fB\-S\fP\ [other_flags\ \&...]
|
\fI#!${BINDIR}/calc\fP\ \fB\-f\fP\ [other_flags\ \&...]
|
||||||
.fi
|
.fi
|
||||||
.in -5n
|
.in -5n
|
||||||
.sp 1
|
.sp 1
|
||||||
the rest of the file will be processed in
|
the rest of the file will be processed in
|
||||||
.BR "shell script mode" .
|
.BR "shell script mode" .
|
||||||
Note that
|
Note that
|
||||||
.B \-S
|
.B \-f
|
||||||
(UPPER CASE
|
|
||||||
.BR \-S )
|
|
||||||
must be the first \-flag on the ``#!'' line.
|
must be the first \-flag on the ``#!'' line.
|
||||||
Any other optional
|
Any other optional
|
||||||
.B "other_flags"
|
.B "other_flags"
|
||||||
must come after
|
must come after
|
||||||
the
|
the
|
||||||
.BR \-S .
|
.BR \-f .
|
||||||
.sp 1
|
.sp 1
|
||||||
In
|
In
|
||||||
.B "shell script mode"
|
.B "shell script mode"
|
||||||
@@ -625,7 +623,7 @@ the file
|
|||||||
.sp 1
|
.sp 1
|
||||||
.in +5n
|
.in +5n
|
||||||
.nf
|
.nf
|
||||||
\fI#!${BINDIR}/calc\fP\ \fB\-S\fP\ \&\fB\-q\fP
|
\fI#!${BINDIR}/calc\fP\ \fB\-f\fP\ \&\fB\-q\fP
|
||||||
#
|
#
|
||||||
# mersenne - an example of a calc \fBshell script file\fP
|
# mersenne - an example of a calc \fBshell script file\fP
|
||||||
|
|
||||||
@@ -839,7 +837,7 @@ ${LIBDIR}/bindings
|
|||||||
non-GNU-readline command line editor bindings
|
non-GNU-readline command line editor bindings
|
||||||
.sp 1
|
.sp 1
|
||||||
.TP 5
|
.TP 5
|
||||||
${INCDIRCALC}/*.h
|
${CALC_INCDIR}/*.h
|
||||||
include files for C interface use
|
include files for C interface use
|
||||||
.sp 1
|
.sp 1
|
||||||
.TP 5
|
.TP 5
|
||||||
@@ -851,7 +849,7 @@ ${LIBDIR}/libcustcalc.a
|
|||||||
custom binary link library
|
custom binary link library
|
||||||
.sp 1
|
.sp 1
|
||||||
.TP 5
|
.TP 5
|
||||||
${CUSTOMLIBDIR}/*.cal
|
${CUSTOMCALDIR}/*.cal
|
||||||
custom resource files
|
custom resource files
|
||||||
.sp 1
|
.sp 1
|
||||||
.TP 5
|
.TP 5
|
||||||
|
11
cmath.h
11
cmath.h
@@ -17,8 +17,8 @@
|
|||||||
* received a copy with calc; if not, write to Free Software Foundation, Inc.
|
* received a copy with calc; if not, write to Free Software Foundation, Inc.
|
||||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
* 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
||||||
*
|
*
|
||||||
* @(#) $Revision: 29.4 $
|
* @(#) $Revision: 29.6 $
|
||||||
* @(#) $Id: cmath.h,v 29.4 2001/05/29 00:16:53 chongo Exp $
|
* @(#) $Id: cmath.h,v 29.6 2002/03/12 09:38:26 chongo Exp $
|
||||||
* @(#) $Source: /usr/local/src/cmd/calc/RCS/cmath.h,v $
|
* @(#) $Source: /usr/local/src/cmd/calc/RCS/cmath.h,v $
|
||||||
*
|
*
|
||||||
* Under source code control: 1993/07/30 19:42:45
|
* Under source code control: 1993/07/30 19:42:45
|
||||||
@@ -32,7 +32,7 @@
|
|||||||
#define __CMATH_H__
|
#define __CMATH_H__
|
||||||
|
|
||||||
|
|
||||||
#if defined(SRC) /* if we are building from the calc source tree */
|
#if defined(CALC_SRC) /* if we are building from the calc source tree */
|
||||||
# include "qmath.h"
|
# include "qmath.h"
|
||||||
#else
|
#else
|
||||||
# include <calc/qmath.h>
|
# include <calc/qmath.h>
|
||||||
@@ -62,6 +62,7 @@ extern void cprintfr(COMPLEX *c);
|
|||||||
/*
|
/*
|
||||||
* Basic numeric routines.
|
* Basic numeric routines.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
extern COMPLEX *cadd(COMPLEX *c1, COMPLEX *c2);
|
extern COMPLEX *cadd(COMPLEX *c1, COMPLEX *c2);
|
||||||
extern COMPLEX *csub(COMPLEX *c1, COMPLEX *c2);
|
extern COMPLEX *csub(COMPLEX *c1, COMPLEX *c2);
|
||||||
extern COMPLEX *cmul(COMPLEX *c1, COMPLEX *c2);
|
extern COMPLEX *cmul(COMPLEX *c1, COMPLEX *c2);
|
||||||
@@ -74,8 +75,8 @@ extern COMPLEX *cscale(COMPLEX *c, long i);
|
|||||||
extern COMPLEX *cshift(COMPLEX *c, long i);
|
extern COMPLEX *cshift(COMPLEX *c, long i);
|
||||||
extern COMPLEX *csquare(COMPLEX *c);
|
extern COMPLEX *csquare(COMPLEX *c);
|
||||||
extern COMPLEX *cconj(COMPLEX *c);
|
extern COMPLEX *cconj(COMPLEX *c);
|
||||||
extern COMPLEX *creal(COMPLEX *c);
|
extern COMPLEX *c_real(COMPLEX *c);
|
||||||
extern COMPLEX *cimag(COMPLEX *c);
|
extern COMPLEX *c_imag(COMPLEX *c);
|
||||||
extern COMPLEX *cneg(COMPLEX *c);
|
extern COMPLEX *cneg(COMPLEX *c);
|
||||||
extern COMPLEX *cinv(COMPLEX *c);
|
extern COMPLEX *cinv(COMPLEX *c);
|
||||||
extern COMPLEX *cint(COMPLEX *c);
|
extern COMPLEX *cint(COMPLEX *c);
|
||||||
|
@@ -19,8 +19,8 @@
|
|||||||
* received a copy with calc; if not, write to Free Software Foundation, Inc.
|
* received a copy with calc; if not, write to Free Software Foundation, Inc.
|
||||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
* 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
||||||
*
|
*
|
||||||
* @(#) $Revision: 29.6 $
|
* @(#) $Revision: 29.7 $
|
||||||
* @(#) $Id: codegen.c,v 29.6 2001/05/08 06:29:24 chongo Exp $
|
* @(#) $Id: codegen.c,v 29.7 2002/07/10 11:51:51 chongo Exp $
|
||||||
* @(#) $Source: /usr/local/src/cmd/calc/RCS/codegen.c,v $
|
* @(#) $Source: /usr/local/src/cmd/calc/RCS/codegen.c,v $
|
||||||
*
|
*
|
||||||
* Under source code control: 1990/02/15 01:48:13
|
* Under source code control: 1990/02/15 01:48:13
|
||||||
@@ -45,7 +45,7 @@
|
|||||||
#include "func.h"
|
#include "func.h"
|
||||||
#include "conf.h"
|
#include "conf.h"
|
||||||
|
|
||||||
#if defined(_WIN32)
|
#if defined(_WIN32) && !defined(__CYGWIN__)
|
||||||
# include <direct.h>
|
# include <direct.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@@ -17,8 +17,8 @@
|
|||||||
* received a copy with calc; if not, write to Free Software Foundation, Inc.
|
* received a copy with calc; if not, write to Free Software Foundation, Inc.
|
||||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
* 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
||||||
*
|
*
|
||||||
* @(#) $Revision: 29.2 $
|
* @(#) $Revision: 29.3 $
|
||||||
* @(#) $Id: commath.c,v 29.2 2000/06/07 14:02:13 chongo Exp $
|
* @(#) $Id: commath.c,v 29.3 2002/03/12 09:38:26 chongo Exp $
|
||||||
* @(#) $Source: /usr/local/src/cmd/calc/RCS/commath.c,v $
|
* @(#) $Source: /usr/local/src/cmd/calc/RCS/commath.c,v $
|
||||||
*
|
*
|
||||||
* Under source code control: 1990/02/15 01:48:10
|
* Under source code control: 1990/02/15 01:48:10
|
||||||
@@ -381,7 +381,7 @@ cconj(COMPLEX *c)
|
|||||||
* Return the real part of a complex number.
|
* Return the real part of a complex number.
|
||||||
*/
|
*/
|
||||||
COMPLEX *
|
COMPLEX *
|
||||||
creal(COMPLEX *c)
|
c_real(COMPLEX *c)
|
||||||
{
|
{
|
||||||
COMPLEX *r;
|
COMPLEX *r;
|
||||||
|
|
||||||
@@ -400,7 +400,7 @@ creal(COMPLEX *c)
|
|||||||
* Return the imaginary part of a complex number as a real.
|
* Return the imaginary part of a complex number as a real.
|
||||||
*/
|
*/
|
||||||
COMPLEX *
|
COMPLEX *
|
||||||
cimag(COMPLEX *c)
|
c_imag(COMPLEX *c)
|
||||||
{
|
{
|
||||||
COMPLEX *r;
|
COMPLEX *r;
|
||||||
|
|
||||||
|
34
config.c
34
config.c
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* config - configuration routines
|
* config - configuration routines
|
||||||
*
|
*
|
||||||
* Copyright (C) 1999 David I. Bell and Landon Curt Noll
|
* Copyright (C) 1999-2002 David I. Bell and Landon Curt Noll
|
||||||
*
|
*
|
||||||
* Primary author: David I. Bell
|
* Primary author: David I. Bell
|
||||||
*
|
*
|
||||||
@@ -19,8 +19,8 @@
|
|||||||
* received a copy with calc; if not, write to Free Software Foundation, Inc.
|
* received a copy with calc; if not, write to Free Software Foundation, Inc.
|
||||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
* 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
||||||
*
|
*
|
||||||
* @(#) $Revision: 29.7 $
|
* @(#) $Revision: 29.8 $
|
||||||
* @(#) $Id: config.c,v 29.7 2001/04/25 07:15:22 chongo Exp $
|
* @(#) $Id: config.c,v 29.8 2002/12/29 09:20:25 chongo Exp $
|
||||||
* @(#) $Source: /usr/local/src/cmd/calc/RCS/config.c,v $
|
* @(#) $Source: /usr/local/src/cmd/calc/RCS/config.c,v $
|
||||||
*
|
*
|
||||||
* Under source code control: 1991/07/20 00:21:56
|
* Under source code control: 1991/07/20 00:21:56
|
||||||
@@ -51,6 +51,7 @@
|
|||||||
NAMETYPE configs[] = {
|
NAMETYPE configs[] = {
|
||||||
{"all", CONFIG_ALL},
|
{"all", CONFIG_ALL},
|
||||||
{"mode", CONFIG_MODE},
|
{"mode", CONFIG_MODE},
|
||||||
|
{"mode2", CONFIG_MODE2},
|
||||||
{"display", CONFIG_DISPLAY},
|
{"display", CONFIG_DISPLAY},
|
||||||
{"epsilon", CONFIG_EPSILON},
|
{"epsilon", CONFIG_EPSILON},
|
||||||
/*epsilonprec -- tied to epsilon not a configuration type*/
|
/*epsilonprec -- tied to epsilon not a configuration type*/
|
||||||
@@ -101,6 +102,7 @@ NAMETYPE configs[] = {
|
|||||||
*/
|
*/
|
||||||
CONFIG oldstd = { /* backward compatible standard configuration */
|
CONFIG oldstd = { /* backward compatible standard configuration */
|
||||||
MODE_INITIAL, /* current output mode */
|
MODE_INITIAL, /* current output mode */
|
||||||
|
MODE2_INITIAL, /* current secondary output mode */
|
||||||
20, /* current output digits for float or exp */
|
20, /* current output digits for float or exp */
|
||||||
NULL, /* loaded in at startup - default error for real functions */
|
NULL, /* loaded in at startup - default error for real functions */
|
||||||
EPSILONPREC_DEFAULT, /* binary precision of epsilon */
|
EPSILONPREC_DEFAULT, /* binary precision of epsilon */
|
||||||
@@ -146,6 +148,7 @@ CONFIG oldstd = { /* backward compatible standard configuration */
|
|||||||
};
|
};
|
||||||
CONFIG newstd = { /* new non-backward compatible configuration */
|
CONFIG newstd = { /* new non-backward compatible configuration */
|
||||||
MODE_INITIAL, /* current output mode */
|
MODE_INITIAL, /* current output mode */
|
||||||
|
MODE2_INITIAL, /* current output mode */
|
||||||
10, /* current output digits for float or exp */
|
10, /* current output digits for float or exp */
|
||||||
NULL, /* loaded in at startup - default error for real functions */
|
NULL, /* loaded in at startup - default error for real functions */
|
||||||
NEW_EPSILONPREC_DEFAULT, /* binary precision of epsilon */
|
NEW_EPSILONPREC_DEFAULT, /* binary precision of epsilon */
|
||||||
@@ -212,6 +215,7 @@ static NAMETYPE modes[] = {
|
|||||||
{"oct", MODE_OCTAL},
|
{"oct", MODE_OCTAL},
|
||||||
{"binary", MODE_BINARY},
|
{"binary", MODE_BINARY},
|
||||||
{"bin", MODE_BINARY},
|
{"bin", MODE_BINARY},
|
||||||
|
{"off", MODE2_OFF},
|
||||||
{NULL, 0}
|
{NULL, 0}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -467,6 +471,19 @@ setconfig(int type, VALUE *vp)
|
|||||||
math_setmode((int) temp);
|
math_setmode((int) temp);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case CONFIG_MODE2:
|
||||||
|
if (vp->v_type != V_STR) {
|
||||||
|
math_error("Non-string for mode");
|
||||||
|
/*NOTREACHED*/
|
||||||
|
}
|
||||||
|
temp = lookup_long(modes, vp->v_str->s_str);
|
||||||
|
if (temp < 0) {
|
||||||
|
math_error("Unknown mode \"%s\"", vp->v_str);
|
||||||
|
/*NOTREACHED*/
|
||||||
|
}
|
||||||
|
math_setmode2((int) temp);
|
||||||
|
break;
|
||||||
|
|
||||||
case CONFIG_EPSILON:
|
case CONFIG_EPSILON:
|
||||||
if (vp->v_type != V_NUM) {
|
if (vp->v_type != V_NUM) {
|
||||||
math_error("Non-numeric for epsilon");
|
math_error("Non-numeric for epsilon");
|
||||||
@@ -1018,6 +1035,16 @@ config_value(CONFIG *cfg, int type, VALUE *vp)
|
|||||||
vp->v_str = makenewstring(p);
|
vp->v_str = makenewstring(p);
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
case CONFIG_MODE2:
|
||||||
|
vp->v_type = V_STR;
|
||||||
|
p = lookup_name(modes, cfg->outmode2);
|
||||||
|
if (p == NULL) {
|
||||||
|
math_error("invalid secondary output mode: %d", cfg->outmode2);
|
||||||
|
/*NOTREACHED*/
|
||||||
|
}
|
||||||
|
vp->v_str = makenewstring(p);
|
||||||
|
return;
|
||||||
|
|
||||||
case CONFIG_EPSILON:
|
case CONFIG_EPSILON:
|
||||||
vp->v_num = qlink(cfg->epsilon);
|
vp->v_num = qlink(cfg->epsilon);
|
||||||
return;
|
return;
|
||||||
@@ -1267,6 +1294,7 @@ config_cmp(CONFIG *cfg1, CONFIG *cfg2)
|
|||||||
return cfg1->traceflags != cfg2->traceflags ||
|
return cfg1->traceflags != cfg2->traceflags ||
|
||||||
cfg1->outdigits != cfg2->outdigits ||
|
cfg1->outdigits != cfg2->outdigits ||
|
||||||
cfg1->outmode != cfg2->outmode ||
|
cfg1->outmode != cfg2->outmode ||
|
||||||
|
cfg1->outmode2 != cfg2->outmode2 ||
|
||||||
qcmp(cfg1->epsilon, cfg2->epsilon) ||
|
qcmp(cfg1->epsilon, cfg2->epsilon) ||
|
||||||
cfg1->epsilonprec != cfg2->epsilonprec ||
|
cfg1->epsilonprec != cfg2->epsilonprec ||
|
||||||
cfg1->maxprint != cfg2->maxprint ||
|
cfg1->maxprint != cfg2->maxprint ||
|
||||||
|
10
config.h
10
config.h
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* config - configuration routines
|
* config - configuration routines
|
||||||
*
|
*
|
||||||
* Copyright (C) 1999 Landon Curt Noll and David I. Bell
|
* Copyright (C) 1999-2002 Landon Curt Noll and David I. Bell
|
||||||
*
|
*
|
||||||
* Primary author: Landon Curt Noll
|
* Primary author: Landon Curt Noll
|
||||||
*
|
*
|
||||||
@@ -19,8 +19,8 @@
|
|||||||
* received a copy with calc; if not, write to Free Software Foundation, Inc.
|
* received a copy with calc; if not, write to Free Software Foundation, Inc.
|
||||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
* 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
||||||
*
|
*
|
||||||
* @(#) $Revision: 29.10 $
|
* @(#) $Revision: 29.12 $
|
||||||
* @(#) $Id: config.h,v 29.10 2001/05/29 00:16:53 chongo Exp $
|
* @(#) $Id: config.h,v 29.12 2002/12/29 09:20:25 chongo Exp $
|
||||||
* @(#) $Source: /usr/local/src/cmd/calc/RCS/config.h,v $
|
* @(#) $Source: /usr/local/src/cmd/calc/RCS/config.h,v $
|
||||||
*
|
*
|
||||||
* Under source code control: 1995/11/01 22:20:17
|
* Under source code control: 1995/11/01 22:20:17
|
||||||
@@ -35,7 +35,7 @@
|
|||||||
#define __CONFIG_H__
|
#define __CONFIG_H__
|
||||||
|
|
||||||
|
|
||||||
#if defined(SRC) /* if we are building from the calc source tree */
|
#if defined(CALC_SRC) /* if we are building from the calc source tree */
|
||||||
# include "win32dll.h"
|
# include "win32dll.h"
|
||||||
# include "nametype.h"
|
# include "nametype.h"
|
||||||
# include "qmath.h"
|
# include "qmath.h"
|
||||||
@@ -90,6 +90,7 @@
|
|||||||
#define CONFIG_BASENAME 36
|
#define CONFIG_BASENAME 36
|
||||||
#define CONFIG_VERSION 37
|
#define CONFIG_VERSION 37
|
||||||
#define CONFIG_WINDOWS 38
|
#define CONFIG_WINDOWS 38
|
||||||
|
#define CONFIG_MODE2 39
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -118,6 +119,7 @@
|
|||||||
*/
|
*/
|
||||||
struct config {
|
struct config {
|
||||||
int outmode; /* current output mode */
|
int outmode; /* current output mode */
|
||||||
|
int outmode2; /* current secondary output mode */
|
||||||
LEN outdigits; /* current output digits for float or exp */
|
LEN outdigits; /* current output digits for float or exp */
|
||||||
NUMBER *epsilon; /* default error for real functions */
|
NUMBER *epsilon; /* default error for real functions */
|
||||||
long epsilonprec; /* epsilon binary precision (tied to epsilon) */
|
long epsilonprec; /* epsilon binary precision (tied to epsilon) */
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
#!/usr/local/bin/calc -q -s -f
|
#!/usr/local/src/cmd/calc/calc -q -s -f
|
||||||
/*
|
/*
|
||||||
* 4dsphere - determine if 6 points lie on the surface of a sphere in R^4
|
* 4dsphere - determine if 6 points lie on the surface of a sphere in R^4
|
||||||
*
|
*
|
||||||
@@ -26,8 +26,8 @@
|
|||||||
* received a copy with calc; if not, write to Free Software Foundation, Inc.
|
* received a copy with calc; if not, write to Free Software Foundation, Inc.
|
||||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
* 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
||||||
*
|
*
|
||||||
* @(#) $Revision: 1.2 $
|
* @(#) $Revision: 1.3 $
|
||||||
* @(#) $Id: 4dsphere.calc,v 1.2 2001/05/29 00:48:46 chongo Exp $
|
* @(#) $Id: 4dsphere.calc,v 1.3 2001/06/06 09:06:29 chongo Exp $
|
||||||
* @(#) $Source: /usr/local/src/cmd/calc/cscript/RCS/4dsphere.calc,v $
|
* @(#) $Source: /usr/local/src/cmd/calc/cscript/RCS/4dsphere.calc,v $
|
||||||
*
|
*
|
||||||
* Under source code control: 2001/05/03 19:02:03
|
* Under source code control: 2001/05/03 19:02:03
|
||||||
|
248
cscript/Makefile
248
cscript/Makefile
@@ -17,8 +17,8 @@
|
|||||||
# received a copy with calc; if not, write to Free Software Foundation, Inc.
|
# received a copy with calc; if not, write to Free Software Foundation, Inc.
|
||||||
# 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
# 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
||||||
#
|
#
|
||||||
# @(#) $Revision: 29.14 $
|
# @(#) $Revision: 29.23 $
|
||||||
# @(#) $Id: Makefile,v 29.14 2001/05/28 23:08:22 chongo Exp $
|
# @(#) $Id: Makefile,v 29.23 2003/01/14 01:58:18 chongo Exp $
|
||||||
# @(#) $Source: /usr/local/src/cmd/calc/cscript/RCS/Makefile,v $
|
# @(#) $Source: /usr/local/src/cmd/calc/cscript/RCS/Makefile,v $
|
||||||
#
|
#
|
||||||
# Under source code control: 1999/11/29 11:10:26
|
# Under source code control: 1999/11/29 11:10:26
|
||||||
@@ -36,15 +36,121 @@
|
|||||||
SHELL= /bin/sh
|
SHELL= /bin/sh
|
||||||
MAKE_FILE = Makefile
|
MAKE_FILE = Makefile
|
||||||
|
|
||||||
|
####
|
||||||
# Normally, the upper level makefile will set these values. We provide
|
# Normally, the upper level makefile will set these values. We provide
|
||||||
# a default here just in case you want to build from this directory.
|
# a default here just in case you want to build from this directory.
|
||||||
|
####
|
||||||
|
|
||||||
|
# Where the system include (.h) files are kept
|
||||||
|
#
|
||||||
|
# For DJGPP, select:
|
||||||
|
#
|
||||||
|
# INCDIR= /dev/env/DJDIR/include
|
||||||
|
#
|
||||||
|
# If in doubt, set:
|
||||||
|
#
|
||||||
|
# INCDIR= /usr/include
|
||||||
|
#
|
||||||
|
|
||||||
|
#INCDIR= /usr/local/include
|
||||||
|
#INCDIR= /dev/env/DJDIR/include
|
||||||
|
INCDIR= /usr/include
|
||||||
|
|
||||||
|
# where to install calc realted things
|
||||||
|
#
|
||||||
|
# ${BINDIR} where to install calc binary files
|
||||||
|
# ${LIBDIR} where calc link library (*.a) files are installed
|
||||||
|
# ${CALC_SHAREDIR} where to install calc help, .cal, startup, config files
|
||||||
|
#
|
||||||
|
# NOTE: The install rule prepends installation paths with $T, which
|
||||||
|
# by default is empty. If $T is non-empty, then installation
|
||||||
|
# locations will be relative to the $T directory.
|
||||||
|
#
|
||||||
|
# For DJGPP, select:
|
||||||
|
#
|
||||||
|
# BINDIR= /dev/env/DJDIR/bin
|
||||||
|
# LIBDIR= /dev/env/DJDIR/lib
|
||||||
|
# CALC_SHAREDIR= /dev/env/DJDIR/share/calc
|
||||||
|
#
|
||||||
|
# If in doubt, set:
|
||||||
|
#
|
||||||
|
# BINDIR= /usr/bin
|
||||||
|
# LIBDIR= /usr/lib
|
||||||
|
# CALC_SHAREDIR= /usr/share/calc
|
||||||
#
|
#
|
||||||
#BINDIR= /usr/local/bin
|
#BINDIR= /usr/local/bin
|
||||||
|
#BINDIR= /dev/env/DJDIR/bin
|
||||||
BINDIR= /usr/bin
|
BINDIR= /usr/bin
|
||||||
#BINDIR= /usr/contrib/bin
|
|
||||||
|
#LIBDIR= /usr/local/lib
|
||||||
|
#LIBDIR= /dev/env/DJDIR/lib
|
||||||
|
LIBDIR= /usr/lib
|
||||||
|
|
||||||
|
#CALC_SHAREDIR= /usr/local/lib/calc
|
||||||
|
#CALC_SHAREDIR= /dev/env/DJDIR/share/calc
|
||||||
|
CALC_SHAREDIR= /usr/share/calc
|
||||||
|
|
||||||
|
# By default, these values are based CALC_SHAREDIR, INCDIR, BINDIR
|
||||||
|
# ---------------------------------------------------------------
|
||||||
|
# ${HELPDIR} where the help directory is installed
|
||||||
|
# ${CALC_INCDIR} where the calc include files are installed
|
||||||
|
# ${CUSTOMCALDIR} where custom *.cal files are installed
|
||||||
|
# ${CUSTOMHELPDIR} where custom help files are installed
|
||||||
|
# ${CUSTOMINCPDIR} where custom .h files are installed
|
||||||
|
# ${SCRIPTDIR} where calc shell scripts are installed
|
||||||
#
|
#
|
||||||
|
# NOTE: The install rule prepends installation paths with $T, which
|
||||||
|
# by default is empty. If $T is non-empty, then installation
|
||||||
|
# locations will be relative to the $T directory.
|
||||||
|
#
|
||||||
|
# If in doubt, set:
|
||||||
|
#
|
||||||
|
# HELPDIR= ${CALC_SHAREDIR}/help
|
||||||
|
# CALC_INCDIR= ${INCDIR}/calc
|
||||||
|
# CUSTOMCALDIR= ${CALC_SHAREDIR}/custom
|
||||||
|
# CUSTOMHELPDIR= ${CALC_SHAREDIR}/custhelp
|
||||||
|
# CUSTOMINCDIR= ${CALC_INCDIR}/custom
|
||||||
|
# SCRIPTDIR= ${BINDIR}/cscript
|
||||||
|
#
|
||||||
|
HELPDIR= ${CALC_SHAREDIR}/help
|
||||||
|
CALC_INCDIR= ${INCDIR}/calc
|
||||||
|
CUSTOMCALDIR= ${CALC_SHAREDIR}/custom
|
||||||
|
CUSTOMHELPDIR= ${CALC_SHAREDIR}/custhelp
|
||||||
|
CUSTOMINCDIR= ${CALC_INCDIR}/custom
|
||||||
SCRIPTDIR= ${BINDIR}/cscript
|
SCRIPTDIR= ${BINDIR}/cscript
|
||||||
|
|
||||||
|
# T - top level directory under which calc will be installed
|
||||||
|
#
|
||||||
|
# The calc install is performed under $T, the calc build is
|
||||||
|
# performed under /. The purpose for $T is to allow someone
|
||||||
|
# to install calc somewhere other than into the system area.
|
||||||
|
#
|
||||||
|
# For example, if:
|
||||||
|
#
|
||||||
|
# BINDIR= /usr/bin
|
||||||
|
# LIBDIR= /usr/lib
|
||||||
|
# CALC_SHAREDIR= /usr/share/calc
|
||||||
|
#
|
||||||
|
# and if:
|
||||||
|
#
|
||||||
|
# T= /var/tmp/testing
|
||||||
|
#
|
||||||
|
# Then the installation locations will be:
|
||||||
|
#
|
||||||
|
# calc binary files: /var/tmp/testing/usr/bin
|
||||||
|
# calc link library: /var/tmp/testing/usr/lib
|
||||||
|
# calc help, .cal ...: /var/tmp/testing/usr/share/calc
|
||||||
|
# ... etc ... /var/tmp/testing/...
|
||||||
|
#
|
||||||
|
# If $T is empty, calc is installed under /, which is the same
|
||||||
|
# top of tree for which it was built. If $T is non-empty, then
|
||||||
|
# calc is installed under $T, as if one had to chroot under
|
||||||
|
# $T for calc to operate.
|
||||||
|
#
|
||||||
|
# If in doubt, use T=
|
||||||
|
#
|
||||||
|
T=
|
||||||
|
|
||||||
# Makefile debug
|
# Makefile debug
|
||||||
#
|
#
|
||||||
# Q=@ do not echo internal makefile actions (quiet mode)
|
# Q=@ do not echo internal makefile actions (quiet mode)
|
||||||
@@ -77,11 +183,11 @@ CMP= cmp
|
|||||||
#
|
#
|
||||||
# make detaillist
|
# make detaillist
|
||||||
#
|
#
|
||||||
SCRIPT= 4dsphere fproduct mersenne piforever plus powerterm simple \
|
SCRIPT= 4dsphere fproduct mersenne piforever plus powerterm \
|
||||||
square
|
simple square
|
||||||
|
|
||||||
SCRIPT_SRC= 4dsphere.calc fproduct.calc mersenne.calc piforever.calc \
|
SCRIPT_SRC= 4dsphere.calc fproduct.calc mersenne.calc \
|
||||||
plus.calc powerterm.calc simple.calc square.calc
|
piforever.calc plus.calc powerterm.calc simple.calc square.calc
|
||||||
|
|
||||||
# These files are found (but not built) in the distribution
|
# These files are found (but not built) in the distribution
|
||||||
#
|
#
|
||||||
@@ -123,8 +229,10 @@ all: ${TARGETS} .all
|
|||||||
##
|
##
|
||||||
|
|
||||||
distlist: ${DISTLIST}
|
distlist: ${DISTLIST}
|
||||||
${Q}for i in ${DISTLIST}; do \
|
${Q}for i in ${DISTLIST} /dev/null; do \
|
||||||
|
if [ X"$$i" != X"/dev/null" ]; then \
|
||||||
echo cscript/$$i; \
|
echo cscript/$$i; \
|
||||||
|
fi; \
|
||||||
done | LANG=C ${SORT}
|
done | LANG=C ${SORT}
|
||||||
|
|
||||||
distdir:
|
distdir:
|
||||||
@@ -136,23 +244,27 @@ calcliblist:
|
|||||||
#
|
#
|
||||||
detaillist:
|
detaillist:
|
||||||
${Q}-(echo "xxxxxxx"; \
|
${Q}-(echo "xxxxxxx"; \
|
||||||
for i in ${SCRIPT}; do \
|
for i in ${SCRIPT} /dev/null; do \
|
||||||
|
if [ X"$$i" != X"/dev/null" ]; then \
|
||||||
if [ ! -f RCS/$$i.calc,v ]; then \
|
if [ ! -f RCS/$$i.calc,v ]; then \
|
||||||
echo "WARNING: $$i.calc not under RCS control" 1>&2; \
|
echo "WARNING: $$i.calc not under RCS control" 1>&2; \
|
||||||
else \
|
else \
|
||||||
echo $$i; \
|
echo $$i; \
|
||||||
fi; \
|
fi; \
|
||||||
|
fi; \
|
||||||
done | LANG=C ${SORT}) | ${FMT} -70 | \
|
done | LANG=C ${SORT}) | ${FMT} -70 | \
|
||||||
${SED} -e '1s/xxxxxxx/SCRIPT=/' -e '2,$$s/^/ /' \
|
${SED} -e '1s/xxxxxxx/SCRIPT=/' -e '2,$$s/^/ /' \
|
||||||
-e 's/$$/ \\/' -e '$$s/ \\$$//'
|
-e 's/$$/ \\/' -e '$$s/ \\$$//'
|
||||||
${Q}echo
|
${Q}echo
|
||||||
${Q}-(echo "xxxxxxxxxxx"; \
|
${Q}-(echo "xxxxxxxxxxx"; \
|
||||||
for i in ${SCRIPT}; do \
|
for i in ${SCRIPT} /dev/null; do \
|
||||||
|
if [ X"$$i" != X"/dev/null" ]; then \
|
||||||
if [ ! -f RCS/$$i.calc,v ]; then \
|
if [ ! -f RCS/$$i.calc,v ]; then \
|
||||||
echo "WARNING: $$i.calc not under RCS control" 1>&2; \
|
echo "WARNING: $$i.calc not under RCS control" 1>&2; \
|
||||||
else \
|
else \
|
||||||
echo $$i.calc; \
|
echo $$i.calc; \
|
||||||
fi; \
|
fi; \
|
||||||
|
fi; \
|
||||||
done | LANG=C ${SORT}) | ${FMT} -70 | \
|
done | LANG=C ${SORT}) | ${FMT} -70 | \
|
||||||
${SED} -e '1s/xxxxxxxxxxx/SCRIPT_SRC=/' -e '2,$$s/^/ /' \
|
${SED} -e '1s/xxxxxxxxxxx/SCRIPT_SRC=/' -e '2,$$s/^/ /' \
|
||||||
-e 's/$$/ \\/' -e '$$s/ \\$$//'
|
-e 's/$$/ \\/' -e '$$s/ \\$$//'
|
||||||
@@ -181,11 +293,13 @@ depend:
|
|||||||
${Q}echo "# DO NOT DELETE THIS LINE -- make depend depends on it." > \
|
${Q}echo "# DO NOT DELETE THIS LINE -- make depend depends on it." > \
|
||||||
makedep.out
|
makedep.out
|
||||||
${Q}echo "" >> makedep.out
|
${Q}echo "" >> makedep.out
|
||||||
${Q}for i in ${SCRIPT}; do \
|
${Q}for i in ${SCRIPT} /dev/null; do \
|
||||||
|
if [ X"$$i" != X"/dev/null" ]; then \
|
||||||
echo "$$i: $$i.calc"; \
|
echo "$$i: $$i.calc"; \
|
||||||
echo ' rm -f $$@'; \
|
echo ' @rm -f $$@'; \
|
||||||
echo ' $${SED} -e "1s:^#!/usr/local/src/cmd/calc/calc:#!$${BINDIR}/calc:" $$?>$$@'; \
|
echo ' @$${SED} -e "1s:^#!/usr/local/src/cmd/calc/calc:#!$${BINDIR}/calc:" $$?>$$@'; \
|
||||||
echo ' $${CHMOD} +x $$@'; \
|
echo ' @$${CHMOD} +x $$@'; \
|
||||||
|
fi; \
|
||||||
done >> makedep.out
|
done >> makedep.out
|
||||||
${Q}echo sample dependency list formed
|
${Q}echo sample dependency list formed
|
||||||
${Q}echo forming new cscript/Makefile
|
${Q}echo forming new cscript/Makefile
|
||||||
@@ -216,14 +330,13 @@ depend:
|
|||||||
#
|
#
|
||||||
##
|
##
|
||||||
|
|
||||||
echo_SCRIPT: ${MAKE_FILE}
|
echo_inst_files:
|
||||||
@echo ${SCRIPT}
|
${Q}for i in ${SCRIPT} /dev/null; do \
|
||||||
|
if [ X"$$i" != X"/dev/null" ]; then \
|
||||||
|
echo __file__ ${SCRIPTDIR}/$$i; \
|
||||||
echo_install.list: ${MAKE_FILE}
|
fi; \
|
||||||
@for i in ${SCRIPT}; do \
|
|
||||||
echo ${SCRIPTDIR}/$$i; \
|
|
||||||
done
|
done
|
||||||
|
|
||||||
##
|
##
|
||||||
#
|
#
|
||||||
# Utility rules
|
# Utility rules
|
||||||
@@ -237,65 +350,76 @@ clobber:
|
|||||||
-rm -f ${TARGETS}
|
-rm -f ${TARGETS}
|
||||||
|
|
||||||
install: all
|
install: all
|
||||||
-${Q}if [ ! -d ${BINDIR} ]; then \
|
-${Q}if [ ! -d $T${BINDIR} ]; then \
|
||||||
echo mkdir ${BINDIR}; \
|
echo mkdir $T${BINDIR}; \
|
||||||
mkdir ${BINDIR}; \
|
mkdir $T${BINDIR}; \
|
||||||
echo ${CHMOD} 0755 ${BINDIR}; \
|
if [ ! -d "$T${BINDIR}" ]; then \
|
||||||
${CHMOD} 0755 ${BINDIR}; \
|
echo mkdir -p "$T${BINDIR}"; \
|
||||||
|
mkdir -p "$T${BINDIR}"; \
|
||||||
|
fi; \
|
||||||
|
echo ${CHMOD} 0755 $T${BINDIR}; \
|
||||||
|
${CHMOD} 0755 $T${BINDIR}; \
|
||||||
else \
|
else \
|
||||||
true; \
|
true; \
|
||||||
fi
|
fi
|
||||||
-${Q}if [ ! -d ${SCRIPTDIR} ]; then \
|
-${Q}if [ ! -d $T${SCRIPTDIR} ]; then \
|
||||||
echo mkdir ${SCRIPTDIR}; \
|
echo mkdir $T${SCRIPTDIR}; \
|
||||||
mkdir ${SCRIPTDIR}; \
|
mkdir $T${SCRIPTDIR}; \
|
||||||
echo ${CHMOD} 0755 ${SCRIPTDIR}; \
|
if [ ! -d "$T${SCRIPTDIR}" ]; then \
|
||||||
${CHMOD} 0755 ${SCRIPTDIR}; \
|
echo mkdir -p "$T${SCRIPTDIR}"; \
|
||||||
|
mkdir -p "$T${SCRIPTDIR}"; \
|
||||||
|
fi; \
|
||||||
|
echo ${CHMOD} 0755 $T${SCRIPTDIR}; \
|
||||||
|
${CHMOD} 0755 $T${SCRIPTDIR}; \
|
||||||
else \
|
else \
|
||||||
true; \
|
true; \
|
||||||
fi
|
fi
|
||||||
${Q}for i in ${SCRIPT}; do \
|
${Q}for i in ${SCRIPT} /dev/null; do \
|
||||||
if ${CMP} -s $$i ${SCRIPTDIR}/$$i; then \
|
if [ "$$i" = "/dev/null" ]; then \
|
||||||
|
continue; \
|
||||||
|
fi; \
|
||||||
|
if ${CMP} -s $$i $T${SCRIPTDIR}/$$i; then \
|
||||||
true; \
|
true; \
|
||||||
else \
|
else \
|
||||||
rm -f ${SCRIPTDIR}/$$i.new; \
|
rm -f $T${SCRIPTDIR}/$$i.new; \
|
||||||
cp -f $$i ${SCRIPTDIR}/$$i.new; \
|
cp -f $$i $T${SCRIPTDIR}/$$i.new; \
|
||||||
${CHMOD} 0555 ${SCRIPTDIR}/$$i; \
|
${CHMOD} 0555 $T${SCRIPTDIR}/$$i.new; \
|
||||||
mv -f ${SCRIPTDIR}/$$i.new ${SCRIPTDIR}/$$i; \
|
mv -f $T${SCRIPTDIR}/$$i.new $T${SCRIPTDIR}/$$i; \
|
||||||
echo "installed ${SCRIPTDIR}/$$i"; \
|
echo "installed $T${SCRIPTDIR}/$$i"; \
|
||||||
fi; \
|
fi; \
|
||||||
done
|
done
|
||||||
|
|
||||||
# DO NOT DELETE THIS LINE -- make depend depends on it.
|
# DO NOT DELETE THIS LINE -- make depend depends on it.
|
||||||
|
|
||||||
4dsphere: 4dsphere.calc
|
4dsphere: 4dsphere.calc
|
||||||
rm -f $@
|
@rm -f $@
|
||||||
${SED} -e "1s:^#!/usr/local/src/cmd/calc/calc:#!${BINDIR}/calc:" $?>$@
|
@${SED} -e "1s:^#!/usr/local/src/cmd/calc/calc:#!${BINDIR}/calc:" $?>$@
|
||||||
${CHMOD} +x $@
|
@${CHMOD} +x $@
|
||||||
fproduct: fproduct.calc
|
fproduct: fproduct.calc
|
||||||
rm -f $@
|
@rm -f $@
|
||||||
${SED} -e "1s:^#!/usr/local/src/cmd/calc/calc:#!${BINDIR}/calc:" $?>$@
|
@${SED} -e "1s:^#!/usr/local/src/cmd/calc/calc:#!${BINDIR}/calc:" $?>$@
|
||||||
${CHMOD} +x $@
|
@${CHMOD} +x $@
|
||||||
mersenne: mersenne.calc
|
mersenne: mersenne.calc
|
||||||
rm -f $@
|
@rm -f $@
|
||||||
${SED} -e "1s:^#!/usr/local/src/cmd/calc/calc:#!${BINDIR}/calc:" $?>$@
|
@${SED} -e "1s:^#!/usr/local/src/cmd/calc/calc:#!${BINDIR}/calc:" $?>$@
|
||||||
${CHMOD} +x $@
|
@${CHMOD} +x $@
|
||||||
piforever: piforever.calc
|
piforever: piforever.calc
|
||||||
rm -f $@
|
@rm -f $@
|
||||||
${SED} -e "1s:^#!/usr/local/src/cmd/calc/calc:#!${BINDIR}/calc:" $?>$@
|
@${SED} -e "1s:^#!/usr/local/src/cmd/calc/calc:#!${BINDIR}/calc:" $?>$@
|
||||||
${CHMOD} +x $@
|
@${CHMOD} +x $@
|
||||||
plus: plus.calc
|
plus: plus.calc
|
||||||
rm -f $@
|
@rm -f $@
|
||||||
${SED} -e "1s:^#!/usr/local/src/cmd/calc/calc:#!${BINDIR}/calc:" $?>$@
|
@${SED} -e "1s:^#!/usr/local/src/cmd/calc/calc:#!${BINDIR}/calc:" $?>$@
|
||||||
${CHMOD} +x $@
|
@${CHMOD} +x $@
|
||||||
powerterm: powerterm.calc
|
powerterm: powerterm.calc
|
||||||
rm -f $@
|
@rm -f $@
|
||||||
${SED} -e "1s:^#!/usr/local/src/cmd/calc/calc:#!${BINDIR}/calc:" $?>$@
|
@${SED} -e "1s:^#!/usr/local/src/cmd/calc/calc:#!${BINDIR}/calc:" $?>$@
|
||||||
${CHMOD} +x $@
|
@${CHMOD} +x $@
|
||||||
simple: simple.calc
|
simple: simple.calc
|
||||||
rm -f $@
|
@rm -f $@
|
||||||
${SED} -e "1s:^#!/usr/local/src/cmd/calc/calc:#!${BINDIR}/calc:" $?>$@
|
@${SED} -e "1s:^#!/usr/local/src/cmd/calc/calc:#!${BINDIR}/calc:" $?>$@
|
||||||
${CHMOD} +x $@
|
@${CHMOD} +x $@
|
||||||
square: square.calc
|
square: square.calc
|
||||||
rm -f $@
|
@rm -f $@
|
||||||
${SED} -e "1s:^#!/usr/local/src/cmd/calc/calc:#!${BINDIR}/calc:" $?>$@
|
@${SED} -e "1s:^#!/usr/local/src/cmd/calc/calc:#!${BINDIR}/calc:" $?>$@
|
||||||
${CHMOD} +x $@
|
@${CHMOD} +x $@
|
||||||
|
@@ -21,14 +21,14 @@ For more info, see:
|
|||||||
|
|
||||||
4dsphere
|
4dsphere
|
||||||
|
|
||||||
determine if 6 points lie on the surface of a sphere in R^4
|
Determine if 6 points lie on the surface of a 4-dimensional sphere in R^4.
|
||||||
|
|
||||||
usage: 4dsphere x0 y0 z0 w0 x1 y1 z1 w1 ... x5 y5 z5 w5
|
4dsphere x0 y0 z0 w0 x1 y1 z1 w1 ... x5 y5 z5 w5
|
||||||
|
|
||||||
x0 y0 z0 w0 point 0 in R^4
|
x0 y0 z0 w0 point 0 in R^4
|
||||||
x1 y1 z1 w1 point 1 in R^4
|
x1 y1 z1 w1 point 1 in R^4
|
||||||
... ...
|
... ...
|
||||||
x5 y5 z5 w5 point 5 in R^4
|
x5 y5 z5 w5 point 5 in R^4
|
||||||
|
|
||||||
|
|
||||||
fproduct filename term ...
|
fproduct filename term ...
|
||||||
@@ -77,8 +77,8 @@ simple
|
|||||||
## received a copy with calc; if not, write to Free Software Foundation, Inc.
|
## received a copy with calc; if not, write to Free Software Foundation, Inc.
|
||||||
## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
||||||
##
|
##
|
||||||
## @(#) $Revision: 29.7 $
|
## @(#) $Revision: 29.10 $
|
||||||
## @(#) $Id: README,v 29.7 2001/05/28 23:08:22 chongo Exp $
|
## @(#) $Id: README,v 29.10 2001/06/10 19:34:40 chongo Exp $
|
||||||
## @(#) $Source: /usr/local/src/cmd/calc/cscript/RCS/README,v $
|
## @(#) $Source: /usr/local/src/cmd/calc/cscript/RCS/README,v $
|
||||||
##
|
##
|
||||||
## Under source code control: 1999/12/17 10:23:40
|
## Under source code control: 1999/12/17 10:23:40
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
#!/usr/local/bin/calc -q -s -f
|
#!/usr/local/src/cmd/calc/calc -q -s -f
|
||||||
/*
|
/*
|
||||||
* fproduct - write the big Endian product of terms to a file
|
* fproduct - write the big Endian product of terms to a file
|
||||||
*
|
*
|
||||||
@@ -24,8 +24,8 @@
|
|||||||
* received a copy with calc; if not, write to Free Software Foundation, Inc.
|
* received a copy with calc; if not, write to Free Software Foundation, Inc.
|
||||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
* 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
||||||
*
|
*
|
||||||
* @(#) $Revision: 29.1 $
|
* @(#) $Revision: 29.2 $
|
||||||
* @(#) $Id: fproduct.calc,v 29.1 2001/04/08 08:25:15 chongo Exp $
|
* @(#) $Id: fproduct.calc,v 29.2 2001/06/06 09:06:29 chongo Exp $
|
||||||
* @(#) $Source: /usr/local/src/cmd/calc/cscript/RCS/fproduct.calc,v $
|
* @(#) $Source: /usr/local/src/cmd/calc/cscript/RCS/fproduct.calc,v $
|
||||||
*
|
*
|
||||||
* Under source code control: 2001/04/07 20:13:11
|
* Under source code control: 2001/04/07 20:13:11
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
#!/usr/local/bin/calc -q -s -f
|
#!/usr/local/src/cmd/calc/calc -q -s -f
|
||||||
/*
|
/*
|
||||||
* powerterm - print the argument as a sum of powers of integers
|
* powerterm - print the argument as a sum of powers of integers
|
||||||
*
|
*
|
||||||
@@ -24,8 +24,8 @@
|
|||||||
* received a copy with calc; if not, write to Free Software Foundation, Inc.
|
* received a copy with calc; if not, write to Free Software Foundation, Inc.
|
||||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
* 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
||||||
*
|
*
|
||||||
* @(#) $Revision: 29.5 $
|
* @(#) $Revision: 29.6 $
|
||||||
* @(#) $Id: powerterm.calc,v 29.5 2001/04/25 08:41:36 chongo Exp $
|
* @(#) $Id: powerterm.calc,v 29.6 2001/06/06 09:06:29 chongo Exp $
|
||||||
* @(#) $Source: /usr/local/src/cmd/calc/cscript/RCS/powerterm.calc,v $
|
* @(#) $Source: /usr/local/src/cmd/calc/cscript/RCS/powerterm.calc,v $
|
||||||
*
|
*
|
||||||
* Under source code control: 2001/04/24 23:49:11
|
* Under source code control: 2001/04/24 23:49:11
|
||||||
|
358
custom/Makefile
358
custom/Makefile
@@ -18,8 +18,8 @@
|
|||||||
# received a copy with calc; if not, write to Free Software Foundation, Inc.
|
# received a copy with calc; if not, write to Free Software Foundation, Inc.
|
||||||
# 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
# 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
||||||
#
|
#
|
||||||
# @(#) $Revision: 29.13 $
|
# @(#) $Revision: 29.20 $
|
||||||
# @(#) $Id: Makefile,v 29.13 2001/05/28 23:54:53 chongo Exp $
|
# @(#) $Id: Makefile,v 29.20 2003/01/14 02:18:45 chongo Exp $
|
||||||
# @(#) $Source: /usr/local/src/cmd/calc/custom/RCS/Makefile,v $
|
# @(#) $Source: /usr/local/src/cmd/calc/custom/RCS/Makefile,v $
|
||||||
#
|
#
|
||||||
# Under source code control: 1997/03/09 02:28:54
|
# Under source code control: 1997/03/09 02:28:54
|
||||||
@@ -88,33 +88,120 @@ CUSTOM_OBJ= c_argv.o c_devnull.o c_help.o c_sysinfo.o c_pzasusb8.o
|
|||||||
#Q=
|
#Q=
|
||||||
Q=@
|
Q=@
|
||||||
|
|
||||||
|
####
|
||||||
# Normally, the upper level makefile will set these values. We provide
|
# Normally, the upper level makefile will set these values. We provide
|
||||||
# a default here just in case you want to build from this directory.
|
# a default here just in case you want to build from this directory.
|
||||||
|
####
|
||||||
|
|
||||||
|
# Where the system include (.h) files are kept
|
||||||
#
|
#
|
||||||
# where to install things
|
# For DJGPP, select:
|
||||||
#
|
#
|
||||||
# ${SHAREDIR} where most common shared files are kept
|
# INCDIR= /dev/env/DJDIR/include
|
||||||
# ${INCDIR} where most .h files are kept
|
|
||||||
#
|
#
|
||||||
# ${CSHAREDIR} where most common shared calc files are kept
|
# If in doubt, set:
|
||||||
# ${HELPDIR} where the help directory is installed.
|
|
||||||
# ${INCDIRCALC} where the calc include files are installed
|
|
||||||
# ${CUSTOMLIBDIR} where custom *.cal files & libcustcalc.a are installed.
|
|
||||||
# ${CUSTOMHELPDIR} where custom help files are installed.
|
|
||||||
# ${CUSTOMINCPDIR} where custom .h files are installed.
|
|
||||||
#
|
#
|
||||||
#SHAREDIR= /usr/local/lib
|
# INCDIR= /usr/include
|
||||||
SHAREDIR= /usr/share
|
|
||||||
#
|
#
|
||||||
|
|
||||||
#INCDIR= /usr/local/include
|
#INCDIR= /usr/local/include
|
||||||
|
#INCDIR= /dev/env/DJDIR/include
|
||||||
INCDIR= /usr/include
|
INCDIR= /usr/include
|
||||||
|
|
||||||
|
# where to install calc realted things
|
||||||
#
|
#
|
||||||
CSHAREDIR= ${SHAREDIR}/calc
|
# ${BINDIR} where to install calc binary files
|
||||||
HELPDIR= ${CSHAREDIR}/help
|
# ${LIBDIR} where calc link library (*.a) files are installed
|
||||||
INCDIRCALC= ${INCDIR}/calc
|
# ${CALC_SHAREDIR} where to install calc help, .cal, startup, config files
|
||||||
CUSTOMLIBDIR= ${CSHAREDIR}/custom
|
#
|
||||||
CUSTOMHELPDIR= ${CSHAREDIR}/custhelp
|
# NOTE: The install rule prepends installation paths with $T, which
|
||||||
CUSTOMINCDIR= ${INCDIRCALC}/custom
|
# by default is empty. If $T is non-empty, then installation
|
||||||
|
# locations will be relative to the $T directory.
|
||||||
|
#
|
||||||
|
# For DJGPP, select:
|
||||||
|
#
|
||||||
|
# BINDIR= /dev/env/DJDIR/bin
|
||||||
|
# LIBDIR= /dev/env/DJDIR/lib
|
||||||
|
# CALC_SHAREDIR= /dev/env/DJDIR/share/calc
|
||||||
|
#
|
||||||
|
# If in doubt, set:
|
||||||
|
#
|
||||||
|
# BINDIR= /usr/bin
|
||||||
|
# LIBDIR= /usr/lib
|
||||||
|
# CALC_SHAREDIR= /usr/share/calc
|
||||||
|
#
|
||||||
|
#BINDIR= /usr/local/bin
|
||||||
|
#BINDIR= /dev/env/DJDIR/bin
|
||||||
|
BINDIR= /usr/bin
|
||||||
|
|
||||||
|
#LIBDIR= /usr/local/lib
|
||||||
|
#LIBDIR= /dev/env/DJDIR/lib
|
||||||
|
LIBDIR= /usr/lib
|
||||||
|
|
||||||
|
#CALC_SHAREDIR= /usr/local/lib/calc
|
||||||
|
#CALC_SHAREDIR= /dev/env/DJDIR/share/calc
|
||||||
|
CALC_SHAREDIR= /usr/share/calc
|
||||||
|
|
||||||
|
# By default, these values are based CALC_SHAREDIR, INCDIR, BINDIR
|
||||||
|
# ---------------------------------------------------------------
|
||||||
|
# ${HELPDIR} where the help directory is installed
|
||||||
|
# ${CALC_INCDIR} where the calc include files are installed
|
||||||
|
# ${CUSTOMCALDIR} where custom *.cal files are installed
|
||||||
|
# ${CUSTOMHELPDIR} where custom help files are installed
|
||||||
|
# ${CUSTOMINCPDIR} where custom .h files are installed
|
||||||
|
# ${SCRIPTDIR} where calc shell scripts are installed
|
||||||
|
#
|
||||||
|
# NOTE: The install rule prepends installation paths with $T, which
|
||||||
|
# by default is empty. If $T is non-empty, then installation
|
||||||
|
# locations will be relative to the $T directory.
|
||||||
|
#
|
||||||
|
# If in doubt, set:
|
||||||
|
#
|
||||||
|
# HELPDIR= ${CALC_SHAREDIR}/help
|
||||||
|
# CALC_INCDIR= ${INCDIR}/calc
|
||||||
|
# CUSTOMCALDIR= ${CALC_SHAREDIR}/custom
|
||||||
|
# CUSTOMHELPDIR= ${CALC_SHAREDIR}/custhelp
|
||||||
|
# CUSTOMINCDIR= ${CALC_INCDIR}/custom
|
||||||
|
# SCRIPTDIR= ${BINDIR}/cscript
|
||||||
|
#
|
||||||
|
HELPDIR= ${CALC_SHAREDIR}/help
|
||||||
|
CALC_INCDIR= ${INCDIR}/calc
|
||||||
|
CUSTOMCALDIR= ${CALC_SHAREDIR}/custom
|
||||||
|
CUSTOMHELPDIR= ${CALC_SHAREDIR}/custhelp
|
||||||
|
CUSTOMINCDIR= ${CALC_INCDIR}/custom
|
||||||
|
SCRIPTDIR= ${BINDIR}/cscript
|
||||||
|
|
||||||
|
# T - top level directory under which calc will be installed
|
||||||
|
#
|
||||||
|
# The calc install is performed under $T, the calc build is
|
||||||
|
# performed under /. The purpose for $T is to allow someone
|
||||||
|
# to install calc somewhere other than into the system area.
|
||||||
|
#
|
||||||
|
# For example, if:
|
||||||
|
#
|
||||||
|
# BINDIR= /usr/bin
|
||||||
|
# LIBDIR= /usr/lib
|
||||||
|
# CALC_SHAREDIR= /usr/share/calc
|
||||||
|
#
|
||||||
|
# and if:
|
||||||
|
#
|
||||||
|
# T= /var/tmp/testing
|
||||||
|
#
|
||||||
|
# Then the installation locations will be:
|
||||||
|
#
|
||||||
|
# calc binary files: /var/tmp/testing/usr/bin
|
||||||
|
# calc link library: /var/tmp/testing/usr/lib
|
||||||
|
# calc help, .cal ...: /var/tmp/testing/usr/share/calc
|
||||||
|
# ... etc ... /var/tmp/testing/...
|
||||||
|
#
|
||||||
|
# If $T is empty, calc is installed under /, which is the same
|
||||||
|
# top of tree for which it was built. If $T is non-empty, then
|
||||||
|
# calc is installed under $T, as if one had to chroot under
|
||||||
|
# $T for calc to operate.
|
||||||
|
#
|
||||||
|
# If in doubt, use T=
|
||||||
|
#
|
||||||
|
T=
|
||||||
|
|
||||||
# Normally, the upper level makefile will set these values. We provide
|
# Normally, the upper level makefile will set these values. We provide
|
||||||
# a default here just in case you want to build from this directory.
|
# a default here just in case you want to build from this directory.
|
||||||
@@ -263,7 +350,7 @@ REQUIRED_SRC= custtbl.c
|
|||||||
#
|
#
|
||||||
REQUIRED_OBJ= custtbl.o
|
REQUIRED_OBJ= custtbl.o
|
||||||
|
|
||||||
# These .h files are installed under ${CUSTOMLIBDIR} by the install rule.
|
# These .h files are installed under ${CUSTOMCALDIR} by the install rule.
|
||||||
#
|
#
|
||||||
INSTALL_H_SRC= ${CUSTOM_H_SRC}
|
INSTALL_H_SRC= ${CUSTOM_H_SRC}
|
||||||
|
|
||||||
@@ -365,8 +452,10 @@ c_sysinfo.o: c_sysinfo.c ${MAKE_FILE}
|
|||||||
##
|
##
|
||||||
|
|
||||||
distlist: ${DISTLIST}
|
distlist: ${DISTLIST}
|
||||||
${Q}for i in ${DISTLIST}; do \
|
${Q}for i in ${DISTLIST} /dev/null; do \
|
||||||
|
if [ X"$$i" != X"/dev/null" ]; then \
|
||||||
echo custom/$$i; \
|
echo custom/$$i; \
|
||||||
|
fi; \
|
||||||
done
|
done
|
||||||
|
|
||||||
distdir:
|
distdir:
|
||||||
@@ -402,11 +491,13 @@ depend:
|
|||||||
-${Q}rm -rf skel
|
-${Q}rm -rf skel
|
||||||
${Q}mkdir skel
|
${Q}mkdir skel
|
||||||
${Q}mkdir skel/custom
|
${Q}mkdir skel/custom
|
||||||
-${Q}for i in ${C_SRC}; do \
|
-${Q}for i in ${C_SRC} /dev/null; do \
|
||||||
|
if [ X"$$i" != X"/dev/null" ]; then \
|
||||||
${SED} -n '/^#[ ]*include[ ]*"/p' \
|
${SED} -n '/^#[ ]*include[ ]*"/p' \
|
||||||
"$$i" > "skel/custom/$$i"; \
|
"$$i" > "skel/custom/$$i"; \
|
||||||
|
fi; \
|
||||||
done
|
done
|
||||||
-${Q}for i in /dev/null ${H_SRC}; do \
|
-${Q}for i in ${H_SRC} /dev/null; do \
|
||||||
if [ "$$i" = "/dev/null" ]; then \
|
if [ "$$i" = "/dev/null" ]; then \
|
||||||
continue; \
|
continue; \
|
||||||
fi; \
|
fi; \
|
||||||
@@ -421,7 +512,10 @@ depend:
|
|||||||
${Q}for i in `cd ..; ${MAKE} h_list 2>&1 | \
|
${Q}for i in `cd ..; ${MAKE} h_list 2>&1 | \
|
||||||
${SED} -e '/Entering directory/d' \
|
${SED} -e '/Entering directory/d' \
|
||||||
-e '/Nothing to be done/d' \
|
-e '/Nothing to be done/d' \
|
||||||
-e '/Leaving directory/d'`; do \
|
-e '/Leaving directory/d'` /dev/null; do \
|
||||||
|
if [ "$$i" = "/dev/null" ]; then \
|
||||||
|
continue; \
|
||||||
|
fi; \
|
||||||
tag="`echo $$i | ${SED} 's/[\.+,:]/_/g'`"; \
|
tag="`echo $$i | ${SED} 's/[\.+,:]/_/g'`"; \
|
||||||
echo "#if !defined($$tag)" > "skel/$$i"; \
|
echo "#if !defined($$tag)" > "skel/$$i"; \
|
||||||
echo "#define $$tag" >> "skel/$$i"; \
|
echo "#define $$tag" >> "skel/$$i"; \
|
||||||
@@ -435,8 +529,10 @@ depend:
|
|||||||
${Q}echo "# DO NOT DELETE THIS LINE -- make depend depends on it." > \
|
${Q}echo "# DO NOT DELETE THIS LINE -- make depend depends on it." > \
|
||||||
skel/custom/makedep.out
|
skel/custom/makedep.out
|
||||||
${Q}cd skel/custom; ${MAKEDEPEND} -w 1 -f makedep.out ${C_SRC}
|
${Q}cd skel/custom; ${MAKEDEPEND} -w 1 -f makedep.out ${C_SRC}
|
||||||
-${Q}for i in ${C_SRC}; do \
|
-${Q}for i in ${C_SRC} /dev/null; do \
|
||||||
|
if [ X"$$i" != X"/dev/null" ]; then \
|
||||||
echo "$$i" | ${SED} 's/^\(.*\)\.c/\1.o: \1.c/'; \
|
echo "$$i" | ${SED} 's/^\(.*\)\.c/\1.o: \1.c/'; \
|
||||||
|
fi; \
|
||||||
done >> skel/custom/makedep.out
|
done >> skel/custom/makedep.out
|
||||||
${Q}echo custom dependency list formed
|
${Q}echo custom dependency list formed
|
||||||
${Q}echo forming new custom/Makefile
|
${Q}echo forming new custom/Makefile
|
||||||
@@ -468,27 +564,26 @@ depend:
|
|||||||
#
|
#
|
||||||
##
|
##
|
||||||
|
|
||||||
echo_INSTALL_H_SRC: ${MAKE_FILE}
|
echo_inst_files:
|
||||||
@echo ${INSTALL_H_SRC}
|
${Q}for i in ${INSTALL_H_SRC} /dev/null; do \
|
||||||
|
if [ X"$$i" != X"/dev/null" ]; then \
|
||||||
echo_CUSTOM_CALC_FILES: ${MAKE_FILE}
|
echo __file__ ${CUSTOMINCDIR}/$$i; \
|
||||||
@echo ${CUSTOM_CALC_FILES}
|
fi; \
|
||||||
|
|
||||||
echo_CUSTOM_HELP: ${MAKE_FILE}
|
|
||||||
@echo ${CUSTOM_HELP}
|
|
||||||
|
|
||||||
echo_install.list: ${MAKE_FILE}
|
|
||||||
@for i in ${INSTALL_H_SRC}; do \
|
|
||||||
echo ${CUSTOMINCDIR}/$$i; \
|
|
||||||
done
|
done
|
||||||
@for i in ${CUSTOM_HELP}; do \
|
${Q}for i in ${CUSTOM_HELP} /dev/null; do \
|
||||||
echo ${CUSTOMHELPDIR}/$$i; \
|
if [ X"$$i" != X"/dev/null" ]; then \
|
||||||
|
echo __file__ ${CUSTOMHELPDIR}/$$i; \
|
||||||
|
fi; \
|
||||||
done
|
done
|
||||||
@for i in ${CUSTOM_CALC_FILES}; do \
|
${Q}for i in ${CUSTOM_CALC_FILES} /dev/null; do \
|
||||||
echo ${CUSTOMLIBDIR}/$$i; \
|
if [ X"$$i" != X"/dev/null" ]; then \
|
||||||
|
echo __file__ ${CUSTOMCALDIR}/$$i; \
|
||||||
|
fi; \
|
||||||
done
|
done
|
||||||
@for i in ${CALC_LIBCUSTOM}; do \
|
${Q}for i in ${CALC_LIBCUSTOM} /dev/null; do \
|
||||||
echo ${CUSTOMLIBDIR}/$$i; \
|
if [ X"$$i" != X"/dev/null" ]; then \
|
||||||
|
echo __file__ ${CUSTOMCALDIR}/$$i; \
|
||||||
|
fi; \
|
||||||
done
|
done
|
||||||
|
|
||||||
##
|
##
|
||||||
@@ -505,118 +600,144 @@ clobber:
|
|||||||
rm -f .all Makefile.tmp Makefile.bak
|
rm -f .all Makefile.tmp Makefile.bak
|
||||||
|
|
||||||
install: all
|
install: all
|
||||||
-${Q}if [ ! -d ${SHAREDIR} ]; then \
|
-${Q}if [ ! -d $T${INCDIR} ]; then \
|
||||||
echo mkdir ${SHAREDIR}; \
|
echo mkdir $T${INCDIR}; \
|
||||||
mkdir ${SHAREDIR}; \
|
mkdir $T${INCDIR}; \
|
||||||
echo ${CHMOD} 0755 ${SHAREDIR}; \
|
if [ ! -d "$T${INCDIR}" ]; then \
|
||||||
${CHMOD} 0755 ${SHAREDIR}; \
|
echo mkdir -p "$T${INCDIR}"; \
|
||||||
|
mkdir -p "$T${INCDIR}"; \
|
||||||
|
fi; \
|
||||||
|
echo ${CHMOD} 0755 $T${INCDIR}; \
|
||||||
|
${CHMOD} 0755 $T${INCDIR}; \
|
||||||
else \
|
else \
|
||||||
true; \
|
true; \
|
||||||
fi
|
fi
|
||||||
-${Q}if [ ! -d ${INCDIR} ]; then \
|
-${Q}if [ ! -d $T${CALC_SHAREDIR} ]; then \
|
||||||
echo mkdir ${INCDIR}; \
|
echo mkdir $T${CALC_SHAREDIR}; \
|
||||||
mkdir ${INCDIR}; \
|
mkdir $T${CALC_SHAREDIR}; \
|
||||||
echo ${CHMOD} 0755 ${INCDIR}; \
|
if [ ! -d "$T${CALC_SHAREDIR}" ]; then \
|
||||||
${CHMOD} 0755 ${INCDIR}; \
|
echo mkdir -p "$T${CALC_SHAREDIR}"; \
|
||||||
|
mkdir -p "$T${CALC_SHAREDIR}"; \
|
||||||
|
fi; \
|
||||||
|
echo ${CHMOD} 0755 $T${CALC_SHAREDIR}; \
|
||||||
|
${CHMOD} 0755 $T${CALC_SHAREDIR}; \
|
||||||
else \
|
else \
|
||||||
true; \
|
true; \
|
||||||
fi
|
fi
|
||||||
-${Q}if [ ! -d ${CSHAREDIR} ]; then \
|
-${Q}if [ ! -d $T${CALC_INCDIR} ]; then \
|
||||||
echo mkdir ${CSHAREDIR}; \
|
echo mkdir $T${CALC_INCDIR}; \
|
||||||
mkdir ${CSHAREDIR}; \
|
mkdir $T${CALC_INCDIR}; \
|
||||||
echo ${CHMOD} 0755 ${CSHAREDIR}; \
|
if [ ! -d "$T${CALC_INCDIR}" ]; then \
|
||||||
${CHMOD} 0755 ${CSHAREDIR}; \
|
echo mkdir -p "$T${CALC_INCDIR}"; \
|
||||||
|
mkdir -p "$T${CALC_INCDIR}"; \
|
||||||
|
fi; \
|
||||||
|
echo ${CHMOD} 0755 $T${CALC_INCDIR}; \
|
||||||
|
${CHMOD} 0755 $T${CALC_INCDIR}; \
|
||||||
else \
|
else \
|
||||||
true; \
|
true; \
|
||||||
fi
|
fi
|
||||||
-${Q}if [ ! -d ${INCDIRCALC} ]; then \
|
-${Q}if [ ! -d $T${HELPDIR} ]; then \
|
||||||
echo mkdir ${INCDIRCALC}; \
|
echo mkdir $T${HELPDIR}; \
|
||||||
mkdir ${INCDIRCALC}; \
|
mkdir $T${HELPDIR}; \
|
||||||
echo ${CHMOD} 0755 ${INCDIRCALC}; \
|
if [ ! -d "$T${HELPDIR}" ]; then \
|
||||||
${CHMOD} 0755 ${INCDIRCALC}; \
|
echo mkdir -p "$T${HELPDIR}"; \
|
||||||
|
mkdir -p "$T${HELPDIR}"; \
|
||||||
|
fi; \
|
||||||
|
echo ${CHMOD} 0755 $T${HELPDIR}; \
|
||||||
|
${CHMOD} 0755 $T${HELPDIR}; \
|
||||||
else \
|
else \
|
||||||
true; \
|
true; \
|
||||||
fi
|
fi
|
||||||
-${Q}if [ ! -d ${HELPDIR} ]; then \
|
-${Q}if [ ! -d $T${CUSTOMCALDIR} ]; then \
|
||||||
echo mkdir ${HELPDIR}; \
|
echo mkdir $T${CUSTOMCALDIR}; \
|
||||||
mkdir ${HELPDIR}; \
|
mkdir $T${CUSTOMCALDIR}; \
|
||||||
echo ${CHMOD} 0755 ${HELPDIR}; \
|
if [ ! -d "$T${CUSTOMCALDIR}" ]; then \
|
||||||
${CHMOD} 0755 ${HELPDIR}; \
|
echo mkdir -p "$T${CUSTOMCALDIR}"; \
|
||||||
|
mkdir -p "$T${CUSTOMCALDIR}"; \
|
||||||
|
fi; \
|
||||||
|
echo ${CHMOD} 0755 $T${CUSTOMCALDIR}; \
|
||||||
|
${CHMOD} 0755 $T${CUSTOMCALDIR}; \
|
||||||
else \
|
else \
|
||||||
true; \
|
true; \
|
||||||
fi
|
fi
|
||||||
-${Q}if [ ! -d ${CUSTOMLIBDIR} ]; then \
|
-${Q}if [ ! -d $T${CUSTOMHELPDIR} ]; then \
|
||||||
echo mkdir ${CUSTOMLIBDIR}; \
|
echo mkdir $T${CUSTOMHELPDIR}; \
|
||||||
mkdir ${CUSTOMLIBDIR}; \
|
mkdir $T${CUSTOMHELPDIR}; \
|
||||||
echo ${CHMOD} 0755 ${CUSTOMLIBDIR}; \
|
if [ ! -d "$T${CUSTOMHELPDIR}" ]; then \
|
||||||
${CHMOD} 0755 ${CUSTOMLIBDIR}; \
|
echo mkdir -p "$T${CUSTOMHELPDIR}"; \
|
||||||
|
mkdir -p "$T${CUSTOMHELPDIR}"; \
|
||||||
|
fi; \
|
||||||
|
echo ${CHMOD} 0755 $T${CUSTOMHELPDIR}; \
|
||||||
|
${CHMOD} 0755 $T${CUSTOMHELPDIR}; \
|
||||||
else \
|
else \
|
||||||
true; \
|
true; \
|
||||||
fi
|
fi
|
||||||
-${Q}if [ ! -d ${CUSTOMHELPDIR} ]; then \
|
-${Q}if [ ! -d $T${CUSTOMINCDIR} ]; then \
|
||||||
echo mkdir ${CUSTOMHELPDIR}; \
|
echo mkdir $T${CUSTOMINCDIR}; \
|
||||||
mkdir ${CUSTOMHELPDIR}; \
|
mkdir $T${CUSTOMINCDIR}; \
|
||||||
echo ${CHMOD} 0755 ${CUSTOMHELPDIR}; \
|
if [ ! -d "$T${CUSTOMINCDIR}" ]; then \
|
||||||
${CHMOD} 0755 ${CUSTOMHELPDIR}; \
|
echo mkdir -p "$T${CUSTOMINCDIR}"; \
|
||||||
|
mkdir -p "$T${CUSTOMINCDIR}"; \
|
||||||
|
fi; \
|
||||||
|
echo ${CHMOD} 0755 $T${CUSTOMINCDIR}; \
|
||||||
|
${CHMOD} 0755 $T${CUSTOMINCDIR}; \
|
||||||
else \
|
else \
|
||||||
true; \
|
true; \
|
||||||
fi
|
fi
|
||||||
-${Q}if [ ! -d ${CUSTOMINCDIR} ]; then \
|
-${Q}for i in ${INSTALL_H_SRC} /dev/null; do \
|
||||||
echo mkdir ${CUSTOMINCDIR}; \
|
if [ "$$i" = "/dev/null" ]; then \
|
||||||
mkdir ${CUSTOMINCDIR}; \
|
continue; \
|
||||||
echo ${CHMOD} 0755 ${CUSTOMINCDIR}; \
|
fi; \
|
||||||
${CHMOD} 0755 ${CUSTOMINCDIR}; \
|
if ${CMP} -s tmp $T${CUSTOMINCDIR}/$$i; then \
|
||||||
else \
|
|
||||||
true; \
|
|
||||||
fi
|
|
||||||
-${Q}for i in ${INSTALL_H_SRC}; do \
|
|
||||||
rm -f tmp; \
|
|
||||||
${SED} -e 's/^\(#[ ]*include[ ][ ]*\)"/\1"calc\//' $$i > tmp; \
|
|
||||||
if ${CMP} -s tmp ${CUSTOMINCDIR}/$$i; then \
|
|
||||||
true; \
|
true; \
|
||||||
else \
|
else \
|
||||||
rm -f ${CUSTOMINCDIR}/$$i; \
|
rm -f $T${CUSTOMINCDIR}/$$i.new; \
|
||||||
cp -f tmp ${INCDIRCALC}/$$i.new; \
|
cp -f $$i $T${CUSTOMINCDIR}/$$i.new; \
|
||||||
cp -f $$i ${CUSTOMINCDIR}/$$i.new; \
|
${CHMOD} 0444 $T${CUSTOMINCDIR}/$$i.new; \
|
||||||
${CHMOD} 0444 ${CUSTOMINCDIR}/$$i.new; \
|
mv -f $T${CUSTOMINCDIR}/$$i.new $T${CUSTOMINCDIR}/$$i; \
|
||||||
mv -f ${CUSTOMINCDIR}/$$i.new ${CUSTOMINCDIR}/$$i; \
|
echo "installed $T${CUSTOMINCDIR}/$$i"; \
|
||||||
echo "installed ${CUSTOMINCDIR}/$$i"; \
|
|
||||||
fi; \
|
fi; \
|
||||||
done
|
done
|
||||||
-${Q}rm -f tmp
|
-${Q}rm -f tmp
|
||||||
-${Q}for i in ${CUSTOM_CALC_FILES}; do \
|
-${Q}for i in ${CUSTOM_CALC_FILES} /dev/null; do \
|
||||||
if ${CMP} -s $$i ${CUSTOMLIBDIR}/$$i; then \
|
if [ "$$i" = "/dev/null" ]; then \
|
||||||
|
continue; \
|
||||||
|
fi; \
|
||||||
|
if ${CMP} -s $$i $T${CUSTOMCALDIR}/$$i; then \
|
||||||
true; \
|
true; \
|
||||||
else \
|
else \
|
||||||
rm -f ${CUSTOMLIBDIR}/$$i; \
|
rm -f $T${CUSTOMCALDIR}/$$i.new; \
|
||||||
cp -f $$i ${CUSTOMLIBDIR}/$$i; \
|
cp -f $$i $T${CUSTOMCALDIR}/$$i.new; \
|
||||||
${CHMOD} 0444 ${CUSTOMLIBDIR}/$$i.new; \
|
${CHMOD} 0444 $T${CUSTOMCALDIR}/$$i.new; \
|
||||||
mv -f ${CUSTOMLIBDIR}/$$i.new ${CUSTOMLIBDIR}/$$i; \
|
mv -f $T${CUSTOMCALDIR}/$$i.new $T${CUSTOMCALDIR}/$$i; \
|
||||||
echo "installed ${CUSTOMLIBDIR}/$$i"; \
|
echo "installed $T${CUSTOMCALDIR}/$$i"; \
|
||||||
fi; \
|
fi; \
|
||||||
done
|
done
|
||||||
-${Q}for i in ${CUSTOM_HELP}; do \
|
-${Q}for i in ${CUSTOM_HELP} /dev/null; do \
|
||||||
if ${CMP} -s $$i ${CUSTOMHELPDIR}/$$i; then \
|
if [ "$$i" = "/dev/null" ]; then \
|
||||||
|
continue; \
|
||||||
|
fi; \
|
||||||
|
if ${CMP} -s $$i $T${CUSTOMHELPDIR}/$$i; then \
|
||||||
true; \
|
true; \
|
||||||
else \
|
else \
|
||||||
rm -f ${CUSTOMHELPDIR}/$$i; \
|
rm -f $T${CUSTOMHELPDIR}/$$i.new; \
|
||||||
cp -f $$i ${CUSTOMHELPDIR}/$$i.new; \
|
cp -f $$i $T${CUSTOMHELPDIR}/$$i.new; \
|
||||||
${CHMOD} 0444 ${CUSTOMHELPDIR}/$$i.new; \
|
${CHMOD} 0444 $T${CUSTOMHELPDIR}/$$i.new; \
|
||||||
mv -f ${CUSTOMHELPDIR}/$$i.new ${CUSTOMHELPDIR}/$$i; \
|
mv -f $T${CUSTOMHELPDIR}/$$i.new $T${CUSTOMHELPDIR}/$$i; \
|
||||||
echo "installed ${CUSTOMHELPDIR}/$$i"; \
|
echo "installed $T${CUSTOMHELPDIR}/$$i"; \
|
||||||
fi; \
|
fi; \
|
||||||
done
|
done
|
||||||
-${Q}if [ ! -z ${ALLOW_CUSTOM} ]; then \
|
-${Q}if [ ! -z ${ALLOW_CUSTOM} ]; then \
|
||||||
if ${CMP} -s libcustcalc.a ${CUSTOMLIBDIR}/libcustcalc.a; then \
|
if ${CMP} -s libcustcalc.a $T${CUSTOMCALDIR}/libcustcalc.a; then \
|
||||||
true; \
|
true; \
|
||||||
else \
|
else \
|
||||||
rm -f ${CUSTOMLIBDIR}/libcustcalc.a.new; \
|
rm -f $T${CUSTOMCALDIR}/libcustcalc.a.new; \
|
||||||
cp -f libcustcalc.a ${CUSTOMLIBDIR}/libcustcalc.a.new; \
|
cp -f libcustcalc.a $T${CUSTOMCALDIR}/libcustcalc.a.new; \
|
||||||
${CHMOD} 0644 ${CUSTOMLIBDIR}/libcustcalc.a; \
|
${CHMOD} 0644 $T${CUSTOMCALDIR}/libcustcalc.a.new; \
|
||||||
mv -f ${CUSTOMLIBDIR}/libcustcalc.a.new \
|
mv -f $T${CUSTOMCALDIR}/libcustcalc.a.new \
|
||||||
${CUSTOMLIBDIR}/libcustcalc.a; \
|
$T${CUSTOMCALDIR}/libcustcalc.a; \
|
||||||
${RANLIB} ${CUSTOMLIBDIR}/libcustcalc.a; \
|
${RANLIB} $T${CUSTOMCALDIR}/libcustcalc.a; \
|
||||||
echo "installed ${CUSTOMLIBDIR}/libcustcalc.a"; \
|
echo "installed $T${CUSTOMCALDIR}/libcustcalc.a"; \
|
||||||
fi; \
|
fi; \
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -628,7 +749,6 @@ install: all
|
|||||||
|
|
||||||
# DO NOT DELETE THIS LINE
|
# DO NOT DELETE THIS LINE
|
||||||
|
|
||||||
|
|
||||||
c_argv.o: ../alloc.h
|
c_argv.o: ../alloc.h
|
||||||
c_argv.o: ../block.h
|
c_argv.o: ../block.h
|
||||||
c_argv.o: ../byteswap.h
|
c_argv.o: ../byteswap.h
|
||||||
|
9
endian.c
9
endian.c
@@ -17,8 +17,8 @@
|
|||||||
* received a copy with calc; if not, write to Free Software Foundation, Inc.
|
* received a copy with calc; if not, write to Free Software Foundation, Inc.
|
||||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
* 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
||||||
*
|
*
|
||||||
* @(#) $Revision: 29.3 $
|
* @(#) $Revision: 29.4 $
|
||||||
* @(#) $Id: endian.c,v 29.3 2001/03/18 02:59:42 chongo Exp $
|
* @(#) $Id: endian.c,v 29.4 2003/01/14 01:50:01 chongo Exp $
|
||||||
* @(#) $Source: /usr/local/src/cmd/calc/RCS/endian.c,v $
|
* @(#) $Source: /usr/local/src/cmd/calc/RCS/endian.c,v $
|
||||||
*
|
*
|
||||||
* Under source code control: 1993/11/15 04:32:58
|
* Under source code control: 1993/11/15 04:32:58
|
||||||
@@ -36,6 +36,11 @@
|
|||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
|
#include "have_stdlib.h"
|
||||||
|
#if defined(HAVE_STDLIB_H)
|
||||||
|
#include <stdlib.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "have_unistd.h"
|
#include "have_unistd.h"
|
||||||
#if defined(HAVE_UNISTD_H)
|
#if defined(HAVE_UNISTD_H)
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
6
file.h
6
file.h
@@ -19,8 +19,8 @@
|
|||||||
* received a copy with calc; if not, write to Free Software Foundation, Inc.
|
* received a copy with calc; if not, write to Free Software Foundation, Inc.
|
||||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
* 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
||||||
*
|
*
|
||||||
* @(#) $Revision: 29.4 $
|
* @(#) $Revision: 29.5 $
|
||||||
* @(#) $Id: file.h,v 29.4 2001/05/29 00:16:53 chongo Exp $
|
* @(#) $Id: file.h,v 29.5 2001/06/08 21:00:58 chongo Exp $
|
||||||
* @(#) $Source: /usr/local/src/cmd/calc/RCS/file.h,v $
|
* @(#) $Source: /usr/local/src/cmd/calc/RCS/file.h,v $
|
||||||
*
|
*
|
||||||
* Under source code control: 1996/05/24 05:55:58
|
* Under source code control: 1996/05/24 05:55:58
|
||||||
@@ -35,7 +35,7 @@
|
|||||||
#define __FILE_H__
|
#define __FILE_H__
|
||||||
|
|
||||||
|
|
||||||
#if defined(SRC) /* if we are building from the calc source tree */
|
#if defined(CALC_SRC) /* if we are building from the calc source tree */
|
||||||
# include "have_fpos.h"
|
# include "have_fpos.h"
|
||||||
#else
|
#else
|
||||||
# include <calc/have_fpos.h>
|
# include <calc/have_fpos.h>
|
||||||
|
86
func.c
86
func.c
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* func - built-in functions implemented here
|
* func - built-in functions implemented here
|
||||||
*
|
*
|
||||||
* Copyright (C) 1999 David I. Bell, Landon Curt Noll and Ernest Bowen
|
* Copyright (C) 1999-2002 David I. Bell, Landon Curt Noll and Ernest Bowen
|
||||||
*
|
*
|
||||||
* Primary author: David I. Bell
|
* Primary author: David I. Bell
|
||||||
*
|
*
|
||||||
@@ -19,8 +19,8 @@
|
|||||||
* received a copy with calc; if not, write to Free Software Foundation, Inc.
|
* received a copy with calc; if not, write to Free Software Foundation, Inc.
|
||||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
* 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
||||||
*
|
*
|
||||||
* @(#) $Revision: 29.10 $
|
* @(#) $Revision: 29.12 $
|
||||||
* @(#) $Id: func.c,v 29.10 2001/05/29 00:41:22 chongo Exp $
|
* @(#) $Id: func.c,v 29.12 2002/12/29 09:20:25 chongo Exp $
|
||||||
* @(#) $Source: /usr/local/src/cmd/calc/RCS/func.c,v $
|
* @(#) $Source: /usr/local/src/cmd/calc/RCS/func.c,v $
|
||||||
*
|
*
|
||||||
* Under source code control: 1990/02/15 01:48:15
|
* Under source code control: 1990/02/15 01:48:15
|
||||||
@@ -107,7 +107,7 @@
|
|||||||
/*
|
/*
|
||||||
* forward declarations
|
* forward declarations
|
||||||
*/
|
*/
|
||||||
static NUMBER *base_value(long mode);
|
static NUMBER *base_value(long mode, int defval);
|
||||||
static int strscan(char *s, int count, VALUE **vals);
|
static int strscan(char *s, int count, VALUE **vals);
|
||||||
static int filescan(FILEID id, int count, VALUE **vals);
|
static int filescan(FILEID id, int count, VALUE **vals);
|
||||||
static VALUE f_eval(VALUE *vp);
|
static VALUE f_eval(VALUE *vp);
|
||||||
@@ -6910,9 +6910,9 @@ f_system(VALUE *vp)
|
|||||||
printf("%s\n", vp->v_str->s_str);
|
printf("%s\n", vp->v_str->s_str);
|
||||||
}
|
}
|
||||||
#if defined(_WIN32)
|
#if defined(_WIN32)
|
||||||
/* if the execute length is 0 then use NULL in system call */
|
/* if the execute length is 0 then just return 0 */
|
||||||
if (strlen(vp->v_str->s_str) == 0) {
|
if (strlen(vp->v_str->s_str) == 0) {
|
||||||
result.v_num = itoq((long)system(NULL));
|
result.v_num = itoq((long)0);
|
||||||
} else {
|
} else {
|
||||||
result.v_num = itoq((long)system(vp->v_str->s_str));
|
result.v_num = itoq((long)system(vp->v_str->s_str));
|
||||||
}
|
}
|
||||||
@@ -6978,15 +6978,15 @@ f_base(int count, NUMBER **vals)
|
|||||||
|
|
||||||
/* deal with just a query */
|
/* deal with just a query */
|
||||||
if (count != 1) {
|
if (count != 1) {
|
||||||
return base_value(conf->outmode);
|
return base_value(conf->outmode, conf->outmode);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* deal with the specal modes first */
|
/* deal with the specal modes first */
|
||||||
if (qisfrac(vals[0])) {
|
if (qisfrac(vals[0])) {
|
||||||
return base_value(math_setmode(MODE_FRAC));
|
return base_value(math_setmode(MODE_FRAC), conf->outmode);
|
||||||
}
|
}
|
||||||
if (vals[0]->num.len > 64/BASEB) {
|
if (vals[0]->num.len > 64/BASEB) {
|
||||||
return base_value(math_setmode(MODE_EXP));
|
return base_value(math_setmode(MODE_EXP), conf->outmode);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* set the base, if possible */
|
/* set the base, if possible */
|
||||||
@@ -7014,7 +7014,61 @@ f_base(int count, NUMBER **vals)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* return the old base */
|
/* return the old base */
|
||||||
return base_value(oldbase);
|
return base_value(oldbase, conf->outmode);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* set the default secondary output base/mode
|
||||||
|
*/
|
||||||
|
static NUMBER *
|
||||||
|
f_base2(int count, NUMBER **vals)
|
||||||
|
{
|
||||||
|
long base; /* output base/mode */
|
||||||
|
long oldbase=0; /* output base/mode */
|
||||||
|
|
||||||
|
/* deal with just a query */
|
||||||
|
if (count != 1) {
|
||||||
|
return base_value(conf->outmode2, conf->outmode2);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* deal with the specal modes first */
|
||||||
|
if (qisfrac(vals[0])) {
|
||||||
|
return base_value(math_setmode2(MODE_FRAC), conf->outmode2);
|
||||||
|
}
|
||||||
|
if (vals[0]->num.len > 64/BASEB) {
|
||||||
|
return base_value(math_setmode2(MODE_EXP), conf->outmode2);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* set the base, if possible */
|
||||||
|
base = qtoi(vals[0]);
|
||||||
|
switch (base) {
|
||||||
|
case 0:
|
||||||
|
oldbase = math_setmode2(MODE2_OFF);
|
||||||
|
break;
|
||||||
|
case -10:
|
||||||
|
oldbase = math_setmode2(MODE_INT);
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
oldbase = math_setmode2(MODE_BINARY);
|
||||||
|
break;
|
||||||
|
case 8:
|
||||||
|
oldbase = math_setmode2(MODE_OCTAL);
|
||||||
|
break;
|
||||||
|
case 10:
|
||||||
|
oldbase = math_setmode2(MODE_REAL);
|
||||||
|
break;
|
||||||
|
case 16:
|
||||||
|
oldbase = math_setmode2(MODE_HEX);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
math_error("Unsupported base");
|
||||||
|
/*NOTREACHED*/
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* return the old base */
|
||||||
|
return base_value(oldbase, conf->outmode2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -7022,14 +7076,14 @@ f_base(int count, NUMBER **vals)
|
|||||||
* return a numerical 'value' of the mode/base
|
* return a numerical 'value' of the mode/base
|
||||||
*/
|
*/
|
||||||
static NUMBER *
|
static NUMBER *
|
||||||
base_value(long mode)
|
base_value(long mode, int defval)
|
||||||
{
|
{
|
||||||
NUMBER *result;
|
NUMBER *result;
|
||||||
|
|
||||||
/* return the old base */
|
/* return the old base */
|
||||||
switch (mode) {
|
switch (mode) {
|
||||||
case MODE_DEFAULT:
|
case MODE_DEFAULT:
|
||||||
switch (conf->outmode) {
|
switch (defval) {
|
||||||
case MODE_DEFAULT:
|
case MODE_DEFAULT:
|
||||||
result = itoq(10);
|
result = itoq(10);
|
||||||
break;
|
break;
|
||||||
@@ -7056,6 +7110,9 @@ base_value(long mode)
|
|||||||
case MODE_BINARY:
|
case MODE_BINARY:
|
||||||
result = itoq(2);
|
result = itoq(2);
|
||||||
break;
|
break;
|
||||||
|
case MODE2_OFF:
|
||||||
|
result = itoq(0);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
result = itoq(0);
|
result = itoq(0);
|
||||||
break;
|
break;
|
||||||
@@ -7084,6 +7141,9 @@ base_value(long mode)
|
|||||||
case MODE_BINARY:
|
case MODE_BINARY:
|
||||||
result = itoq(2);
|
result = itoq(2);
|
||||||
break;
|
break;
|
||||||
|
case MODE2_OFF:
|
||||||
|
result = itoq(0);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
result = itoq(0);
|
result = itoq(0);
|
||||||
break;
|
break;
|
||||||
@@ -7825,6 +7885,8 @@ static CONST struct builtin builtins[] = {
|
|||||||
"arithmetic mean of values"},
|
"arithmetic mean of values"},
|
||||||
{"base", 0, 1, 0, OP_NOP, f_base, 0,
|
{"base", 0, 1, 0, OP_NOP, f_base, 0,
|
||||||
"set default output base"},
|
"set default output base"},
|
||||||
|
{"base2", 0, 1, 0, OP_NOP, f_base2, 0,
|
||||||
|
"set default secondary output base"},
|
||||||
{"bernoulli", 1, 1, 0, OP_NOP, 0, f_bern,
|
{"bernoulli", 1, 1, 0, OP_NOP, 0, f_bern,
|
||||||
"Bernoulli number for index a"},
|
"Bernoulli number for index a"},
|
||||||
{"bit", 2, 2, 0, OP_BIT, 0, 0,
|
{"bit", 2, 2, 0, OP_BIT, 0, 0,
|
||||||
|
6
func.h
6
func.h
@@ -17,8 +17,8 @@
|
|||||||
* received a copy with calc; if not, write to Free Software Foundation, Inc.
|
* received a copy with calc; if not, write to Free Software Foundation, Inc.
|
||||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
* 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
||||||
*
|
*
|
||||||
* @(#) $Revision: 29.3 $
|
* @(#) $Revision: 29.4 $
|
||||||
* @(#) $Id: func.h,v 29.3 2001/05/29 00:16:53 chongo Exp $
|
* @(#) $Id: func.h,v 29.4 2001/06/08 21:00:58 chongo Exp $
|
||||||
* @(#) $Source: /usr/local/src/cmd/calc/RCS/func.h,v $
|
* @(#) $Source: /usr/local/src/cmd/calc/RCS/func.h,v $
|
||||||
*
|
*
|
||||||
* Under source code control: 1990/02/15 01:48:33
|
* Under source code control: 1990/02/15 01:48:33
|
||||||
@@ -32,7 +32,7 @@
|
|||||||
#define __FUNC_H__
|
#define __FUNC_H__
|
||||||
|
|
||||||
|
|
||||||
#if defined(SRC) /* if we are building from the calc source tree */
|
#if defined(CALC_SRC) /* if we are building from the calc source tree */
|
||||||
# include "calc.h"
|
# include "calc.h"
|
||||||
# include "label.h"
|
# include "label.h"
|
||||||
#else
|
#else
|
||||||
|
7
hash.c
7
hash.c
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* hash - one-way hash routines
|
* hash - one-way hash routines
|
||||||
*
|
*
|
||||||
* Copyright (C) 1999 Landon Curt Noll
|
* Copyright (C) 1999-2002 Landon Curt Noll
|
||||||
*
|
*
|
||||||
* Calc is open software; you can redistribute it and/or modify it under
|
* Calc is open software; you can redistribute it and/or modify it under
|
||||||
* the terms of the version 2.1 of the GNU Lesser General Public License
|
* the terms of the version 2.1 of the GNU Lesser General Public License
|
||||||
@@ -17,8 +17,8 @@
|
|||||||
* received a copy with calc; if not, write to Free Software Foundation, Inc.
|
* received a copy with calc; if not, write to Free Software Foundation, Inc.
|
||||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
* 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
||||||
*
|
*
|
||||||
* @(#) $Revision: 29.4 $
|
* @(#) $Revision: 29.5 $
|
||||||
* @(#) $Id: hash.c,v 29.4 2001/04/14 22:47:21 chongo Exp $
|
* @(#) $Id: hash.c,v 29.5 2002/12/29 09:20:25 chongo Exp $
|
||||||
* @(#) $Source: /usr/local/src/cmd/calc/RCS/hash.c,v $
|
* @(#) $Source: /usr/local/src/cmd/calc/RCS/hash.c,v $
|
||||||
*
|
*
|
||||||
* Under source code control: 1995/11/23 05:13:11
|
* Under source code control: 1995/11/23 05:13:11
|
||||||
@@ -941,6 +941,7 @@ hash_value(int type, void *v, HASH *state)
|
|||||||
|
|
||||||
/* hash the CONFIG state */
|
/* hash the CONFIG state */
|
||||||
state = hash_int(type, value->v_config->outmode, state);
|
state = hash_int(type, value->v_config->outmode, state);
|
||||||
|
state = hash_int(type, value->v_config->outmode2, state);
|
||||||
state = hash_long(type,(long)value->v_config->outdigits, state);
|
state = hash_long(type,(long)value->v_config->outdigits, state);
|
||||||
state = hash_number(type, value->v_config->epsilon, state);
|
state = hash_number(type, value->v_config->epsilon, state);
|
||||||
state = hash_long(type,
|
state = hash_long(type,
|
||||||
|
6
hash.h
6
hash.h
@@ -17,8 +17,8 @@
|
|||||||
* received a copy with calc; if not, write to Free Software Foundation, Inc.
|
* received a copy with calc; if not, write to Free Software Foundation, Inc.
|
||||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
* 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
||||||
*
|
*
|
||||||
* @(#) $Revision: 29.3 $
|
* @(#) $Revision: 29.4 $
|
||||||
* @(#) $Id: hash.h,v 29.3 2001/05/29 00:16:53 chongo Exp $
|
* @(#) $Id: hash.h,v 29.4 2001/06/08 21:00:58 chongo Exp $
|
||||||
* @(#) $Source: /usr/local/src/cmd/calc/RCS/hash.h,v $
|
* @(#) $Source: /usr/local/src/cmd/calc/RCS/hash.h,v $
|
||||||
*
|
*
|
||||||
* Under source code control: 1995/11/14 23:57:45
|
* Under source code control: 1995/11/14 23:57:45
|
||||||
@@ -33,7 +33,7 @@
|
|||||||
#define __HASH_H__
|
#define __HASH_H__
|
||||||
|
|
||||||
|
|
||||||
#if defined(SRC) /* if we are building from the calc source tree */
|
#if defined(CALC_SRC) /* if we are building from the calc source tree */
|
||||||
# include "shs.h"
|
# include "shs.h"
|
||||||
# include "shs1.h"
|
# include "shs1.h"
|
||||||
# include "md5.h"
|
# include "md5.h"
|
||||||
|
253
help/Makefile
253
help/Makefile
@@ -2,7 +2,7 @@
|
|||||||
#
|
#
|
||||||
# help - makefile for calc help files
|
# help - makefile for calc help files
|
||||||
#
|
#
|
||||||
# Copyright (C) 1999 Landon Curt Noll
|
# Copyright (C) 1999-2002 Landon Curt Noll
|
||||||
#
|
#
|
||||||
# Calc is open software; you can redistribute it and/or modify it under
|
# Calc is open software; you can redistribute it and/or modify it under
|
||||||
# the terms of the version 2.1 of the GNU Lesser General Public License
|
# the terms of the version 2.1 of the GNU Lesser General Public License
|
||||||
@@ -18,8 +18,8 @@
|
|||||||
# received a copy with calc; if not, write to Free Software Foundation, Inc.
|
# received a copy with calc; if not, write to Free Software Foundation, Inc.
|
||||||
# 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
# 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
||||||
#
|
#
|
||||||
# @(#) $Revision: 29.13 $
|
# @(#) $Revision: 29.23 $
|
||||||
# @(#) $Id: Makefile,v 29.13 2001/05/29 00:41:11 chongo Exp $
|
# @(#) $Id: Makefile,v 29.23 2003/01/14 02:24:48 chongo Exp $
|
||||||
# @(#) $Source: /usr/local/src/cmd/calc/help/RCS/Makefile,v $
|
# @(#) $Source: /usr/local/src/cmd/calc/help/RCS/Makefile,v $
|
||||||
#
|
#
|
||||||
# Under source code control: 1991/07/23 06:47:57
|
# Under source code control: 1991/07/23 06:47:57
|
||||||
@@ -36,16 +36,120 @@
|
|||||||
SHELL= /bin/sh
|
SHELL= /bin/sh
|
||||||
MAKE_FILE = Makefile
|
MAKE_FILE = Makefile
|
||||||
|
|
||||||
# ${SHAREDIR} where most common shared files are kept
|
####
|
||||||
#
|
# Normally, the upper level makefile will set these values. We provide
|
||||||
# ${CSHAREDIR} where most common shared calc files are kept
|
# a default here just in case you want to build from this directory.
|
||||||
# ${HELPDIR} where the help directory is installed.
|
####
|
||||||
#
|
|
||||||
#SHAREDIR= /usr/local/lib
|
|
||||||
SHAREDIR= /usr/share
|
|
||||||
|
|
||||||
CSHAREDIR= ${SHAREDIR}/calc
|
# Where the system include (.h) files are kept
|
||||||
HELPDIR= ${CSHAREDIR}/help
|
#
|
||||||
|
# For DJGPP, select:
|
||||||
|
#
|
||||||
|
# INCDIR= /dev/env/DJDIR/include
|
||||||
|
#
|
||||||
|
# If in doubt, set:
|
||||||
|
#
|
||||||
|
# INCDIR= /usr/include
|
||||||
|
#
|
||||||
|
|
||||||
|
#INCDIR= /usr/local/include
|
||||||
|
#INCDIR= /dev/env/DJDIR/include
|
||||||
|
INCDIR= /usr/include
|
||||||
|
|
||||||
|
# where to install calc realted things
|
||||||
|
#
|
||||||
|
# ${BINDIR} where to install calc binary files
|
||||||
|
# ${LIBDIR} where calc link library (*.a) files are installed
|
||||||
|
# ${CALC_SHAREDIR} where to install calc help, .cal, startup, config files
|
||||||
|
#
|
||||||
|
# NOTE: The install rule prepends installation paths with $T, which
|
||||||
|
# by default is empty. If $T is non-empty, then installation
|
||||||
|
# locations will be relative to the $T directory.
|
||||||
|
#
|
||||||
|
# For DJGPP, select:
|
||||||
|
#
|
||||||
|
# BINDIR= /dev/env/DJDIR/bin
|
||||||
|
# LIBDIR= /dev/env/DJDIR/lib
|
||||||
|
# CALC_SHAREDIR= /dev/env/DJDIR/share/calc
|
||||||
|
#
|
||||||
|
# If in doubt, set:
|
||||||
|
#
|
||||||
|
# BINDIR= /usr/bin
|
||||||
|
# LIBDIR= /usr/lib
|
||||||
|
# CALC_SHAREDIR= /usr/share/calc
|
||||||
|
#
|
||||||
|
#BINDIR= /usr/local/bin
|
||||||
|
#BINDIR= /dev/env/DJDIR/bin
|
||||||
|
BINDIR= /usr/bin
|
||||||
|
|
||||||
|
#LIBDIR= /usr/local/lib
|
||||||
|
#LIBDIR= /dev/env/DJDIR/lib
|
||||||
|
LIBDIR= /usr/lib
|
||||||
|
|
||||||
|
#CALC_SHAREDIR= /usr/local/lib/calc
|
||||||
|
#CALC_SHAREDIR= /dev/env/DJDIR/share/calc
|
||||||
|
CALC_SHAREDIR= /usr/share/calc
|
||||||
|
|
||||||
|
# By default, these values are based CALC_SHAREDIR, INCDIR, BINDIR
|
||||||
|
# ---------------------------------------------------------------
|
||||||
|
# ${HELPDIR} where the help directory is installed
|
||||||
|
# ${CALC_INCDIR} where the calc include files are installed
|
||||||
|
# ${CUSTOMCALDIR} where custom *.cal files are installed
|
||||||
|
# ${CUSTOMHELPDIR} where custom help files are installed
|
||||||
|
# ${CUSTOMINCPDIR} where custom .h files are installed
|
||||||
|
# ${SCRIPTDIR} where calc shell scripts are installed
|
||||||
|
#
|
||||||
|
# NOTE: The install rule prepends installation paths with $T, which
|
||||||
|
# by default is empty. If $T is non-empty, then installation
|
||||||
|
# locations will be relative to the $T directory.
|
||||||
|
#
|
||||||
|
# If in doubt, set:
|
||||||
|
#
|
||||||
|
# HELPDIR= ${CALC_SHAREDIR}/help
|
||||||
|
# CALC_INCDIR= ${INCDIR}/calc
|
||||||
|
# CUSTOMCALDIR= ${CALC_SHAREDIR}/custom
|
||||||
|
# CUSTOMHELPDIR= ${CALC_SHAREDIR}/custhelp
|
||||||
|
# CUSTOMINCDIR= ${CALC_INCDIR}/custom
|
||||||
|
# SCRIPTDIR= ${BINDIR}/cscript
|
||||||
|
#
|
||||||
|
HELPDIR= ${CALC_SHAREDIR}/help
|
||||||
|
CALC_INCDIR= ${INCDIR}/calc
|
||||||
|
CUSTOMCALDIR= ${CALC_SHAREDIR}/custom
|
||||||
|
CUSTOMHELPDIR= ${CALC_SHAREDIR}/custhelp
|
||||||
|
CUSTOMINCDIR= ${CALC_INCDIR}/custom
|
||||||
|
SCRIPTDIR= ${BINDIR}/cscript
|
||||||
|
|
||||||
|
# T - top level directory under which calc will be installed
|
||||||
|
#
|
||||||
|
# The calc install is performed under $T, the calc build is
|
||||||
|
# performed under /. The purpose for $T is to allow someone
|
||||||
|
# to install calc somewhere other than into the system area.
|
||||||
|
#
|
||||||
|
# For example, if:
|
||||||
|
#
|
||||||
|
# BINDIR= /usr/bin
|
||||||
|
# LIBDIR= /usr/lib
|
||||||
|
# CALC_SHAREDIR= /usr/share/calc
|
||||||
|
#
|
||||||
|
# and if:
|
||||||
|
#
|
||||||
|
# T= /var/tmp/testing
|
||||||
|
#
|
||||||
|
# Then the installation locations will be:
|
||||||
|
#
|
||||||
|
# calc binary files: /var/tmp/testing/usr/bin
|
||||||
|
# calc link library: /var/tmp/testing/usr/lib
|
||||||
|
# calc help, .cal ...: /var/tmp/testing/usr/share/calc
|
||||||
|
# ... etc ... /var/tmp/testing/...
|
||||||
|
#
|
||||||
|
# If $T is empty, calc is installed under /, which is the same
|
||||||
|
# top of tree for which it was built. If $T is non-empty, then
|
||||||
|
# calc is installed under $T, as if one had to chroot under
|
||||||
|
# $T for calc to operate.
|
||||||
|
#
|
||||||
|
# If in doubt, use T=
|
||||||
|
#
|
||||||
|
T=
|
||||||
|
|
||||||
# Makefile debug
|
# Makefile debug
|
||||||
#
|
#
|
||||||
@@ -142,11 +246,11 @@ BLT_HELP_FILES= ${BLT_HELP_FILES_3} ${BLT_HELP_FILES_5} \
|
|||||||
# This list is prodiced by the detaillist rule when no WARNINGS are detected.
|
# This list is prodiced by the detaillist rule when no WARNINGS are detected.
|
||||||
#
|
#
|
||||||
DETAIL_HELP= abs access acos acosh acot acoth acsc acsch address agd append \
|
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 \
|
appr arg argv arrow asec asech asin asinh assign atan atan2 atanh \
|
||||||
base bernoulli bit blk blkcpy blkfree blocks bround btrunc calc_tty \
|
avg base base2 bernoulli bit blk blkcpy blkfree blocks bround btrunc \
|
||||||
calclevel catalan ceil cfappr cfsim char cmdbuf cmp comb conj cos \
|
calc_tty calclevel catalan ceil cfappr cfsim char cmdbuf cmp comb \
|
||||||
cosh cot coth count cp csc csch ctime delete den dereference det \
|
conj cos cosh cot coth count cp csc csch ctime delete den dereference \
|
||||||
digit digits dp epsilon errcount errmax errno error euler eval \
|
det digit digits dp epsilon errcount errmax errno error euler eval \
|
||||||
exp fact factor fclose fcnt feof ferror fflush fgetc fgetfield \
|
exp fact factor fclose fcnt feof ferror fflush fgetc fgetfield \
|
||||||
fgetline fgets fgetstr fib files floor fopen forall fprintf fputc \
|
fgetline fgets fgetstr fib files floor fopen forall fprintf fputc \
|
||||||
fputs fputstr frac free freebernoulli freeeuler freeglobals freeredc \
|
fputs fputstr frac free freebernoulli freeeuler freeglobals freeredc \
|
||||||
@@ -240,7 +344,8 @@ changes: ../CHANGES
|
|||||||
|
|
||||||
libcalc: ../LIBRARY
|
libcalc: ../LIBRARY
|
||||||
rm -f $@
|
rm -f $@
|
||||||
${SED} -e 's:$${LIBDIR}:${LIBDIR}:g' < ../LIBRARY > $@
|
${SED} -e 's:$${LIBDIR}:${LIBDIR}:g' \
|
||||||
|
-e 's:$${CALC_INCDIR}:${CALC_INCDIR}:g' < ../LIBRARY > $@
|
||||||
${CHMOD} 0444 $@
|
${CHMOD} 0444 $@
|
||||||
-@if [ -z "${Q}" ]; then \
|
-@if [ -z "${Q}" ]; then \
|
||||||
echo ''; \
|
echo ''; \
|
||||||
@@ -391,11 +496,13 @@ full: ${FULL_HELP_FILES} ${MAKE_FILE}
|
|||||||
# Singular files are the same files as their plural form.
|
# Singular files are the same files as their plural form.
|
||||||
#
|
#
|
||||||
${SINGULAR_FILES}: ${PLURAL_FILES}
|
${SINGULAR_FILES}: ${PLURAL_FILES}
|
||||||
${Q}for i in ${SINGULAR_FILES}; do \
|
${Q}for i in ${SINGULAR_FILES} /dev/null; do \
|
||||||
echo "rm -f $${i}"; \
|
if [ X"$$i" != X"/dev/null" ]; then \
|
||||||
rm -f $${i}; \
|
echo "rm -f $${i}"; \
|
||||||
echo "cp $${i}s $${i}"; \
|
rm -f $${i}; \
|
||||||
cp $${i}s $${i}; \
|
echo "cp $${i}s $${i}"; \
|
||||||
|
cp $${i}s $${i}; \
|
||||||
|
fi; \
|
||||||
done
|
done
|
||||||
-@if [ -z "${Q}" ]; then \
|
-@if [ -z "${Q}" ]; then \
|
||||||
echo ''; \
|
echo ''; \
|
||||||
@@ -428,7 +535,8 @@ builtin: builtin.top builtin.end ../func.c funclist.sed
|
|||||||
-${Q}rm -f funclist.c
|
-${Q}rm -f funclist.c
|
||||||
${Q}${SED} -n -f funclist.sed ../func.c > funclist.c
|
${Q}${SED} -n -f funclist.sed ../func.c > funclist.c
|
||||||
-${Q}rm -f funclist.o funclist
|
-${Q}rm -f funclist.o funclist
|
||||||
${Q}${LCC} ${ICFLAGS} -DFUNCLIST -I/usr/include -I.. funclist.c -c
|
${Q}${LCC} ${ICFLAGS} -DFUNCLIST -I/usr/include \
|
||||||
|
-I.. funclist.c -c 2>/dev/null
|
||||||
${Q}${LCC} ${ILDFLAGS} funclist.o -o funclist
|
${Q}${LCC} ${ILDFLAGS} funclist.o -o funclist
|
||||||
-${Q}rm -f builtin
|
-${Q}rm -f builtin
|
||||||
${Q}cat builtin.top > builtin
|
${Q}cat builtin.top > builtin
|
||||||
@@ -455,8 +563,10 @@ builtin: builtin.top builtin.end ../func.c funclist.sed
|
|||||||
##
|
##
|
||||||
|
|
||||||
distlist: ${DISTLIST}
|
distlist: ${DISTLIST}
|
||||||
${Q}for i in ${DISTLIST}; do \
|
${Q}for i in ${DISTLIST} /dev/null; do \
|
||||||
|
if [ X"$$i" != X"/dev/null" ]; then \
|
||||||
echo help/$$i; \
|
echo help/$$i; \
|
||||||
|
fi; \
|
||||||
done | LANG=C ${SORT}
|
done | LANG=C ${SORT}
|
||||||
|
|
||||||
distdir:
|
distdir:
|
||||||
@@ -481,12 +591,14 @@ bsdi: all
|
|||||||
#
|
#
|
||||||
detaillist:
|
detaillist:
|
||||||
${Q}-(echo "xxxxx"; \
|
${Q}-(echo "xxxxx"; \
|
||||||
for i in ${DETAIL_HELP}; do \
|
for i in ${DETAIL_HELP} /dev/null; do \
|
||||||
|
if [ X"$$i" != X"/dev/null" ]; then \
|
||||||
if [ ! -f RCS/$$i,v ]; then \
|
if [ ! -f RCS/$$i,v ]; then \
|
||||||
echo "WARNING: $$i not under RCS control" 1>&2; \
|
echo "WARNING: $$i not under RCS control" 1>&2; \
|
||||||
else \
|
else \
|
||||||
echo $$i; \
|
echo $$i; \
|
||||||
fi; \
|
fi; \
|
||||||
|
fi; \
|
||||||
done | LANG=C ${SORT}) | ${FMT} -70 | \
|
done | LANG=C ${SORT}) | ${FMT} -70 | \
|
||||||
${SED} -e '1s/xxxxx/DETAIL_HELP=/' -e '2,$$s/^/ /' \
|
${SED} -e '1s/xxxxx/DETAIL_HELP=/' -e '2,$$s/^/ /' \
|
||||||
-e 's/$$/ \\/' -e '$$s/ \\$$//'
|
-e 's/$$/ \\/' -e '$$s/ \\$$//'
|
||||||
@@ -497,24 +609,14 @@ detaillist:
|
|||||||
#
|
#
|
||||||
##
|
##
|
||||||
|
|
||||||
echo_STD_HELP_FILES: ${MAKE_FILE}
|
echo_inst_files:
|
||||||
@echo ${STD_HELP_FILES}
|
${Q}for i in ${STD_HELP_FILES} full ${BLT_HELP_FILES} \
|
||||||
|
builtin ${DETAIL_HELP} ${SINGULAR_FILES} /dev/null; do \
|
||||||
echo_BLT_HELP_FILES: ${MAKE_FILE}
|
if [ X"$$i" != X"/dev/null" ]; then \
|
||||||
@echo ${BLT_HELP_FILES}
|
echo __file__ ${HELPDIR}/$$i; \
|
||||||
|
fi; \
|
||||||
echo_DETAIL_HELP: ${MAKE_FILE}
|
|
||||||
@echo ${DETAIL_HELP}
|
|
||||||
|
|
||||||
echo_SINGULAR_FILES: ${MAKE_FILE}
|
|
||||||
@echo ${SINGULAR_FILES}
|
|
||||||
|
|
||||||
echo_install.list: ${MAKE_FILE}
|
|
||||||
@for i in ${STD_HELP_FILES} full ${BLT_HELP_FILES} \
|
|
||||||
builtin ${DETAIL_HELP} ${SINGULAR_FILES}; do \
|
|
||||||
echo ${HELPDIR}/$$i; \
|
|
||||||
done
|
done
|
||||||
@echo ${HELPDIR}/obj
|
${Q}echo __file__ ${HELPDIR}/obj
|
||||||
|
|
||||||
##
|
##
|
||||||
#
|
#
|
||||||
@@ -533,48 +635,51 @@ clobber:
|
|||||||
rm -f ${SINGULAR_FILES} ${DETAIL_CLONE}
|
rm -f ${SINGULAR_FILES} ${DETAIL_CLONE}
|
||||||
|
|
||||||
install: all
|
install: all
|
||||||
-${Q}if [ ! -d ${SHAREDIR} ]; then \
|
-${Q}if [ ! -d $T${CALC_SHAREDIR} ]; then \
|
||||||
echo mkdir ${SHAREDIR}; \
|
echo mkdir $T${CALC_SHAREDIR}; \
|
||||||
mkdir ${SHAREDIR}; \
|
mkdir $T${CALC_SHAREDIR}; \
|
||||||
echo ${CHMOD} 0755 ${SHAREDIR}; \
|
if [ ! -d "$T${CALC_SHAREDIR}" ]; then \
|
||||||
${CHMOD} 0755 ${SHAREDIR}; \
|
echo mkdir -p "$T${CALC_SHAREDIR}"; \
|
||||||
|
mkdir -p "$T${CALC_SHAREDIR}"; \
|
||||||
|
fi; \
|
||||||
|
echo ${CHMOD} 0755 $T${CALC_SHAREDIR}; \
|
||||||
|
${CHMOD} 0755 $T${CALC_SHAREDIR}; \
|
||||||
else \
|
else \
|
||||||
true; \
|
true; \
|
||||||
fi
|
fi
|
||||||
-${Q}if [ ! -d ${CSHAREDIR} ]; then \
|
-${Q}if [ ! -d $T${HELPDIR} ]; then \
|
||||||
echo mkdir ${CSHAREDIR}; \
|
echo mkdir $T${HELPDIR}; \
|
||||||
mkdir ${CSHAREDIR}; \
|
mkdir $T${HELPDIR}; \
|
||||||
echo ${CHMOD} 0755 ${CSHAREDIR}; \
|
if [ ! -d "$T${HELPDIR}" ]; then \
|
||||||
${CHMOD} 0755 ${CSHAREDIR}; \
|
echo mkdir -p "$T${HELPDIR}"; \
|
||||||
else \
|
mkdir -p "$T${HELPDIR}"; \
|
||||||
true; \
|
fi; \
|
||||||
fi
|
echo ${CHMOD} 0755 $T${HELPDIR}; \
|
||||||
-${Q}if [ ! -d ${HELPDIR} ]; then \
|
${CHMOD} 0755 $T${HELPDIR}; \
|
||||||
echo mkdir ${HELPDIR}; \
|
|
||||||
mkdir ${HELPDIR}; \
|
|
||||||
echo ${CHMOD} 0755 ${HELPDIR}; \
|
|
||||||
${CHMOD} 0755 ${HELPDIR}; \
|
|
||||||
else \
|
else \
|
||||||
true; \
|
true; \
|
||||||
fi
|
fi
|
||||||
-${Q}for i in ${STD_HELP_FILES} ${BLT_HELP_FILES} builtin \
|
-${Q}for i in ${STD_HELP_FILES} ${BLT_HELP_FILES} builtin \
|
||||||
full ${DETAIL_HELP} ${SINGULAR_FILES}; do \
|
full ${DETAIL_HELP} ${SINGULAR_FILES} /dev/null; do \
|
||||||
if ${CMP} -s $$i ${HELPDIR}/$$i; then \
|
if [ "$$i" = "/dev/null" ]; then \
|
||||||
|
continue; \
|
||||||
|
fi; \
|
||||||
|
if ${CMP} -s $$i $T${HELPDIR}/$$i; then \
|
||||||
true; \
|
true; \
|
||||||
else \
|
else \
|
||||||
rm -f ${HELPDIR}/$$i.new; \
|
rm -f $T${HELPDIR}/$$i.new; \
|
||||||
cp -f $$i ${HELPDIR}/$$i.new; \
|
cp -f $$i $T${HELPDIR}/$$i.new; \
|
||||||
${CHMOD} 0444 ${HELPDIR}/$$i.new; \
|
${CHMOD} 0444 $T${HELPDIR}/$$i.new; \
|
||||||
mv -f ${HELPDIR}/$$i.new ${HELPDIR}/$$i; \
|
mv -f $T${HELPDIR}/$$i.new $T${HELPDIR}/$$i; \
|
||||||
echo "installed ${HELPDIR}/$$i"; \
|
echo "installed $T${HELPDIR}/$$i"; \
|
||||||
fi; \
|
fi; \
|
||||||
done
|
done
|
||||||
-${Q}if ${CMP} -s obj.file ${HELPDIR}/obj; then \
|
-${Q}if ${CMP} -s obj.file $T${HELPDIR}/obj; then \
|
||||||
true; \
|
true; \
|
||||||
else \
|
else \
|
||||||
rm -f ${HELPDIR}/obj.new; \
|
rm -f $T${HELPDIR}/obj.new; \
|
||||||
cp -f obj.file ${HELPDIR}/obj.new; \
|
cp -f obj.file $T${HELPDIR}/obj.new; \
|
||||||
${CHMOD} 0444 ${HELPDIR}/obj.new; \
|
${CHMOD} 0444 $T${HELPDIR}/obj.new; \
|
||||||
mv -f ${HELPDIR}/obj.new ${HELPDIR}/obj; \
|
mv -f $T${HELPDIR}/obj.new $T${HELPDIR}/obj; \
|
||||||
echo "installed ${HELPDIR}/obj"; \
|
echo "installed $T${HELPDIR}/obj"; \
|
||||||
fi
|
fi
|
||||||
|
14
help/address
14
help/address
@@ -23,7 +23,7 @@ DESCRIPTION
|
|||||||
0 <= i < sizeof(B). &B[i] then returns the address at which this
|
0 <= i < sizeof(B). &B[i] then returns the address at which this
|
||||||
octet is located until the block is freed or relocated. Freeing
|
octet is located until the block is freed or relocated. Freeing
|
||||||
of an unnamed block B occurs when a new value is assigned to B or
|
of an unnamed block B occurs when a new value is assigned to B or
|
||||||
when B ceases to exist; a named block B is freed by blkfree(B().
|
when B ceases to exist; a named block B is freed by blkfree(B).
|
||||||
A block is relocated when an operation like copying to B requires
|
A block is relocated when an operation like copying to B requires
|
||||||
a change of sizeof(B).
|
a change of sizeof(B).
|
||||||
|
|
||||||
@@ -70,18 +70,18 @@ DESCRIPTION
|
|||||||
> p = &"abc"
|
> p = &"abc"
|
||||||
> A = "abc"
|
> A = "abc"
|
||||||
|
|
||||||
The address &*A of the value of A will be equal to p.
|
the address &*A of the value of A will be equal to p.
|
||||||
|
|
||||||
Except in cases like strcat(A, "") when *A identified with a literal
|
Except in cases like strcat(A, "") when *A identified with a literal
|
||||||
string as above, definitions of string values using strcat() or substr()
|
string as above, definitions of string values using strcat() or substr()
|
||||||
will copy the relevant strings to newly allocated addresses which will
|
will copy the relevant strings to newly allocated addresses which will
|
||||||
be useable only while the variables retain these defined values.
|
be useable only while the variables retain these defined values.
|
||||||
For example,
|
For example, after
|
||||||
|
|
||||||
> B = C = strcat("a", "bc");
|
> B = C = strcat("a", "bc");
|
||||||
|
|
||||||
&*B and &*C will be different. If p is defined by p = &*B, p should
|
&*B and &*C will be different. If p is defined by p = &*B, p should
|
||||||
not be used after a mew value is assigned to B, or B ceases to exist,
|
not be used after a new value is assigned to B, or B ceases to exist,
|
||||||
etc.
|
etc.
|
||||||
|
|
||||||
When compilation of a function encounters for the first time a particular
|
When compilation of a function encounters for the first time a particular
|
||||||
@@ -117,7 +117,7 @@ DESCRIPTION
|
|||||||
|
|
||||||
> A = B = C = f(2);
|
> A = B = C = f(2);
|
||||||
|
|
||||||
which, not only performs the addition n f() only once, but stores the
|
which, not only performs the addition in f() only once, but stores the
|
||||||
number values for A, B and C at the same address.
|
number values for A, B and C at the same address.
|
||||||
|
|
||||||
Whether a value V is a pointer and if so, its type, is indicated by the
|
Whether a value V is a pointer and if so, its type, is indicated by the
|
||||||
@@ -176,8 +176,8 @@ SEE ALSO
|
|||||||
## received a copy with calc; if not, write to Free Software Foundation, Inc.
|
## received a copy with calc; if not, write to Free Software Foundation, Inc.
|
||||||
## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
||||||
##
|
##
|
||||||
## @(#) $Revision: 29.2 $
|
## @(#) $Revision: 29.3 $
|
||||||
## @(#) $Id: address,v 29.2 2000/06/07 14:02:33 chongo Exp $
|
## @(#) $Id: address,v 29.3 2002/07/10 11:47:04 chongo Exp $
|
||||||
## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/address,v $
|
## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/address,v $
|
||||||
##
|
##
|
||||||
## Under source code control: 1997/09/06 20:03:34
|
## Under source code control: 1997/09/06 20:03:34
|
||||||
|
@@ -13,7 +13,7 @@ TYPES
|
|||||||
DESCRIPTION
|
DESCRIPTION
|
||||||
p->X returns the same as (*p).X. Thus the current value of *p is
|
p->X returns the same as (*p).X. Thus the current value of *p is
|
||||||
to be an object of a type for which X identifies one element.
|
to be an object of a type for which X identifies one element.
|
||||||
p->X then returns the lvalue corresponding to that element of of the
|
p->X then returns the lvalue corresponding to that element of the
|
||||||
value of *p.
|
value of *p.
|
||||||
|
|
||||||
The expression *p.X will cause a runtime error since this is
|
The expression *p.X will cause a runtime error since this is
|
||||||
@@ -66,8 +66,8 @@ SEE ALSO
|
|||||||
## received a copy with calc; if not, write to Free Software Foundation, Inc.
|
## received a copy with calc; if not, write to Free Software Foundation, Inc.
|
||||||
## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
||||||
##
|
##
|
||||||
## @(#) $Revision: 29.2 $
|
## @(#) $Revision: 29.3 $
|
||||||
## @(#) $Id: arrow,v 29.2 2000/06/07 14:02:33 chongo Exp $
|
## @(#) $Id: arrow,v 29.3 2002/07/10 11:47:04 chongo Exp $
|
||||||
## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/arrow,v $
|
## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/arrow,v $
|
||||||
##
|
##
|
||||||
## Under source code control: 1997/09/06 20:03:34
|
## Under source code control: 1997/09/06 20:03:34
|
||||||
|
@@ -14,7 +14,7 @@ DESCRIPTION
|
|||||||
Returns the asin of x to a multiple of eps with error less in
|
Returns the asin of x to a multiple of eps with error less in
|
||||||
absolute value than .75 * eps.
|
absolute value than .75 * eps.
|
||||||
|
|
||||||
v = asin(x) is the number in [-p1/2, pi/2] for which sin(v) = x.
|
v = asin(x) is the number in [-pi/2, pi/2] for which sin(v) = x.
|
||||||
|
|
||||||
EXAMPLE
|
EXAMPLE
|
||||||
> print asin(.5, 1e-5), asin(.5, 1e-10), asin(.5, 1e-15), asin(.5, 1e-20)
|
> print asin(.5, 1e-5), asin(.5, 1e-10), asin(.5, 1e-15), asin(.5, 1e-20)
|
||||||
@@ -45,8 +45,8 @@ SEE ALSO
|
|||||||
## received a copy with calc; if not, write to Free Software Foundation, Inc.
|
## received a copy with calc; if not, write to Free Software Foundation, Inc.
|
||||||
## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
||||||
##
|
##
|
||||||
## @(#) $Revision: 29.2 $
|
## @(#) $Revision: 29.3 $
|
||||||
## @(#) $Id: asin,v 29.2 2000/06/07 14:02:33 chongo Exp $
|
## @(#) $Id: asin,v 29.3 2002/07/10 11:47:04 chongo Exp $
|
||||||
## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/asin,v $
|
## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/asin,v $
|
||||||
##
|
##
|
||||||
## Under source code control: 1994/03/19 01:40:24
|
## Under source code control: 1994/03/19 01:40:24
|
||||||
|
11
help/assoc
11
help/assoc
@@ -32,10 +32,9 @@ DESCRIPTION
|
|||||||
may have different numbers (between 1 and 4 inclusive) of indices,
|
may have different numbers (between 1 and 4 inclusive) of indices,
|
||||||
and these indices need not be integers in specified ranges.
|
and these indices need not be integers in specified ranges.
|
||||||
|
|
||||||
Assignments of a null value
|
Assignment of a null value to an element of an association does not
|
||||||
to an element of an association does not delete the element, but
|
delete the element, but a later reference to that element will return
|
||||||
a later reference to that element will return the null value as if
|
the null value as if the element is undefined.
|
||||||
the element is undefined.
|
|
||||||
|
|
||||||
The elements of an association are stored in a hash table for
|
The elements of an association are stored in a hash table for
|
||||||
quick access. The index values are hashed to select the correct
|
quick access. The index values are hashed to select the correct
|
||||||
@@ -99,8 +98,8 @@ SEE ALSO
|
|||||||
## received a copy with calc; if not, write to Free Software Foundation, Inc.
|
## received a copy with calc; if not, write to Free Software Foundation, Inc.
|
||||||
## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
||||||
##
|
##
|
||||||
## @(#) $Revision: 29.2 $
|
## @(#) $Revision: 29.3 $
|
||||||
## @(#) $Id: assoc,v 29.2 2000/06/07 14:02:33 chongo Exp $
|
## @(#) $Id: assoc,v 29.3 2002/07/10 11:47:04 chongo Exp $
|
||||||
## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/assoc,v $
|
## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/assoc,v $
|
||||||
##
|
##
|
||||||
## Under source code control: 1994/09/25 20:22:31
|
## Under source code control: 1994/09/25 20:22:31
|
||||||
|
@@ -14,7 +14,7 @@ DESCRIPTION
|
|||||||
Returns the atan of x to a multiple of eps with error less in
|
Returns the atan of x to a multiple of eps with error less in
|
||||||
absolute value than .75 * eps.
|
absolute value than .75 * eps.
|
||||||
|
|
||||||
v = atan(x) is the number in (-p1/2, pi/2) for which tan(v) = x.
|
v = atan(x) is the number in (-pi/2, pi/2) for which tan(v) = x.
|
||||||
|
|
||||||
EXAMPLE
|
EXAMPLE
|
||||||
> print atan(2, 1e-5), atan(2, 1e-10), atan(2, 1e-15), atan(2, 1e-20)
|
> print atan(2, 1e-5), atan(2, 1e-10), atan(2, 1e-15), atan(2, 1e-20)
|
||||||
@@ -45,8 +45,8 @@ SEE ALSO
|
|||||||
## received a copy with calc; if not, write to Free Software Foundation, Inc.
|
## received a copy with calc; if not, write to Free Software Foundation, Inc.
|
||||||
## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
||||||
##
|
##
|
||||||
## @(#) $Revision: 29.2 $
|
## @(#) $Revision: 29.3 $
|
||||||
## @(#) $Id: atan,v 29.2 2000/06/07 14:02:33 chongo Exp $
|
## @(#) $Id: atan,v 29.3 2002/07/10 11:47:04 chongo Exp $
|
||||||
## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/atan,v $
|
## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/atan,v $
|
||||||
##
|
##
|
||||||
## Under source code control: 1994/03/19 01:40:25
|
## Under source code control: 1994/03/19 01:40:25
|
||||||
|
@@ -57,7 +57,7 @@ DESCRIPTION
|
|||||||
base(1e20) base(2^64) base(2^8191-1)
|
base(1e20) base(2^64) base(2^8191-1)
|
||||||
|
|
||||||
However the base() function will only return one of the base values
|
However the base() function will only return one of the base values
|
||||||
lised in the table above.
|
listed in the table above.
|
||||||
|
|
||||||
EXAMPLE
|
EXAMPLE
|
||||||
> base()
|
> base()
|
||||||
@@ -79,7 +79,7 @@ LINK LIBRARY
|
|||||||
MODE_REAL, MODE_EXP, MODE_HEX, MODE_OCTAL, MODE_BINARY
|
MODE_REAL, MODE_EXP, MODE_HEX, MODE_OCTAL, MODE_BINARY
|
||||||
|
|
||||||
SEE ALSO
|
SEE ALSO
|
||||||
config
|
base2, config, str
|
||||||
|
|
||||||
## Copyright (C) 1999 Landon Curt Noll
|
## Copyright (C) 1999 Landon Curt Noll
|
||||||
##
|
##
|
||||||
@@ -97,8 +97,8 @@ SEE ALSO
|
|||||||
## received a copy with calc; if not, write to Free Software Foundation, Inc.
|
## received a copy with calc; if not, write to Free Software Foundation, Inc.
|
||||||
## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
||||||
##
|
##
|
||||||
## @(#) $Revision: 29.2 $
|
## @(#) $Revision: 29.5 $
|
||||||
## @(#) $Id: base,v 29.2 2000/06/07 14:02:33 chongo Exp $
|
## @(#) $Id: base,v 29.5 2002/12/29 09:17:54 chongo Exp $
|
||||||
## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/base,v $
|
## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/base,v $
|
||||||
##
|
##
|
||||||
## Under source code control: 1994/09/30 00:09:39
|
## Under source code control: 1994/09/30 00:09:39
|
||||||
|
120
help/base2
Normal file
120
help/base2
Normal file
@@ -0,0 +1,120 @@
|
|||||||
|
NAME
|
||||||
|
base2 - set 2nd output base
|
||||||
|
|
||||||
|
SYNOPSIS
|
||||||
|
base2([mode])
|
||||||
|
|
||||||
|
TYPES
|
||||||
|
mode real
|
||||||
|
|
||||||
|
return real
|
||||||
|
|
||||||
|
DESCRIPTION
|
||||||
|
By default, calc will output values according to the default base
|
||||||
|
as controlled by the base() builtin function.
|
||||||
|
|
||||||
|
The base2() builtin function, if given a non-zero argument, enables
|
||||||
|
double base output mode. In double base output mode, calc values
|
||||||
|
are displayed twice, once according to base() and again according
|
||||||
|
to base2(). In double base output mode, the second time a value is
|
||||||
|
displayed, it is displayed within comments:
|
||||||
|
|
||||||
|
21701 /* 0x54c5 */
|
||||||
|
|
||||||
|
The arguments for base2() are identical to base() with the addition
|
||||||
|
of the 0 value:
|
||||||
|
|
||||||
|
base2 equivalent
|
||||||
|
config("mode2")'s
|
||||||
|
|
||||||
|
2 "binary" base 2 fractions
|
||||||
|
"bin"
|
||||||
|
|
||||||
|
8 "octal" base 8 fractions
|
||||||
|
"oct"
|
||||||
|
|
||||||
|
10 "real" base 10 floating point
|
||||||
|
"float"
|
||||||
|
"default"
|
||||||
|
|
||||||
|
-10 "integer" base 10 integers
|
||||||
|
"int"
|
||||||
|
|
||||||
|
16 "hexadecimal" base 16 fractions
|
||||||
|
"hex"
|
||||||
|
|
||||||
|
1/3 "fraction" base 10 fractions
|
||||||
|
"frac"
|
||||||
|
|
||||||
|
1e20 "scientific" base 10 scientific notation
|
||||||
|
"sci"
|
||||||
|
"exp"
|
||||||
|
|
||||||
|
0 "off" disable double base output
|
||||||
|
|
||||||
|
For convenience, any non-integer non-zero value is assumed to mean
|
||||||
|
base 10 fractions and any integer >= 2^64 is assumed to mean base 10
|
||||||
|
scientific notation.
|
||||||
|
|
||||||
|
These base2() calls have the same meaning as config("mode2", "fraction"):
|
||||||
|
|
||||||
|
base2(1/3) base2(0.1415) base2(16/37)
|
||||||
|
|
||||||
|
These base2() calls have the same meaning as config("mode2", "scientific"):
|
||||||
|
|
||||||
|
base2(1e20) base2(2^64) base2(2^8191-1)
|
||||||
|
|
||||||
|
However the base2() function will only return one of the base values
|
||||||
|
listed in the table above.
|
||||||
|
|
||||||
|
EXAMPLE
|
||||||
|
> base2()
|
||||||
|
0
|
||||||
|
> base2(8)
|
||||||
|
0 /* 0 */
|
||||||
|
> print 10
|
||||||
|
10 /* 012 */
|
||||||
|
> base2(16),
|
||||||
|
> 131072
|
||||||
|
131072 /* 0x20000 */
|
||||||
|
> 2345
|
||||||
|
2345 /* 0x929 */
|
||||||
|
|
||||||
|
LIMITS
|
||||||
|
none
|
||||||
|
|
||||||
|
LINK LIBRARY
|
||||||
|
int math_setmode2(int newmode)
|
||||||
|
|
||||||
|
NOTE: newmode must be one of MODE_DEFAULT, MODE_FRAC, MODE_INT,
|
||||||
|
MODE_REAL, MODE_EXP, MODE_HEX, MODE_OCTAL, MODE_BINARY,
|
||||||
|
MODE2_OFF
|
||||||
|
|
||||||
|
SEE ALSO
|
||||||
|
base, config, str
|
||||||
|
|
||||||
|
## Copyright (C) 2002 Landon Curt Noll
|
||||||
|
##
|
||||||
|
## Calc is open software; you can redistribute it and/or modify it under
|
||||||
|
## the terms of the version 2.1 of the GNU Lesser General Public License
|
||||||
|
## as published by the Free Software Foundation.
|
||||||
|
##
|
||||||
|
## Calc is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||||
|
## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
|
||||||
|
## Public License for more details.
|
||||||
|
##
|
||||||
|
## A copy of version 2.1 of the GNU Lesser General Public License is
|
||||||
|
## distributed with calc under the filename COPYING-LGPL. You should have
|
||||||
|
## received a copy with calc; if not, write to Free Software Foundation, Inc.
|
||||||
|
## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
||||||
|
##
|
||||||
|
## @(#) $Revision: 1.3 $
|
||||||
|
## @(#) $Id: base2,v 1.3 2002/12/29 09:17:54 chongo Exp $
|
||||||
|
## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/base2,v $
|
||||||
|
##
|
||||||
|
## Under source code control: 2002/12/29 00:21:07
|
||||||
|
## File existed as early as: 2002
|
||||||
|
##
|
||||||
|
## chongo <was here> /\oo/\ http://www.isthe.com/chongo/
|
||||||
|
## Share and enjoy! :-) http://www.isthe.com/chongo/tech/comp/calc/
|
@@ -15,7 +15,7 @@ DESCRIPTION
|
|||||||
|
|
||||||
t/(exp(t) - 1) = Sum B_n * t^n/n!
|
t/(exp(t) - 1) = Sum B_n * t^n/n!
|
||||||
|
|
||||||
bernouuli(n) is zero both for n < 0 and for n odd and > 2.
|
bernoulli(n) is zero both for n < 0 and for n odd and > 2.
|
||||||
When bernoulli(n) is computed for positive even n, the values for
|
When bernoulli(n) is computed for positive even n, the values for
|
||||||
n and smaller positive even indices are stored in a table so that
|
n and smaller positive even indices are stored in a table so that
|
||||||
a later call to bernoulli(k) with 0 <= k < n will be executed quickly.
|
a later call to bernoulli(k) with 0 <= k < n will be executed quickly.
|
||||||
@@ -57,8 +57,8 @@ SEE ALSO
|
|||||||
## received a copy with calc; if not, write to Free Software Foundation, Inc.
|
## received a copy with calc; if not, write to Free Software Foundation, Inc.
|
||||||
## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
||||||
##
|
##
|
||||||
## @(#) $Revision: 29.4 $
|
## @(#) $Revision: 29.5 $
|
||||||
## @(#) $Id: bernoulli,v 29.4 2000/12/17 12:27:58 chongo Exp $
|
## @(#) $Id: bernoulli,v 29.5 2002/07/10 11:47:04 chongo Exp $
|
||||||
## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/bernoulli,v $
|
## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/bernoulli,v $
|
||||||
##
|
##
|
||||||
## Under source code control: 2000/07/13 01:33:00
|
## Under source code control: 2000/07/13 01:33:00
|
||||||
|
6
help/blk
6
help/blk
@@ -122,7 +122,7 @@ DESCRIPTION
|
|||||||
Named blocks are assigned index numbers 0, 1, 2, ..., in the order
|
Named blocks are assigned index numbers 0, 1, 2, ..., in the order
|
||||||
of their creation. The block with index id is returned by blocks(id).
|
of their creation. The block with index id is returned by blocks(id).
|
||||||
With no argument, blocks() returns the number of current unfreed
|
With no argument, blocks() returns the number of current unfreed
|
||||||
named blocks. A named block may be used
|
named blocks.
|
||||||
|
|
||||||
The memory allocated to a named block is freed by the blkfree()
|
The memory allocated to a named block is freed by the blkfree()
|
||||||
function with argument the named block, its name, or its id number.
|
function with argument the named block, its name, or its id number.
|
||||||
@@ -234,8 +234,8 @@ SEE ALSO
|
|||||||
## received a copy with calc; if not, write to Free Software Foundation, Inc.
|
## received a copy with calc; if not, write to Free Software Foundation, Inc.
|
||||||
## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
||||||
##
|
##
|
||||||
## @(#) $Revision: 29.2 $
|
## @(#) $Revision: 29.3 $
|
||||||
## @(#) $Id: blk,v 29.2 2000/06/07 14:02:33 chongo Exp $
|
## @(#) $Id: blk,v 29.3 2002/07/10 11:47:04 chongo Exp $
|
||||||
## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/blk,v $
|
## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/blk,v $
|
||||||
##
|
##
|
||||||
## Under source code control: 1997/04/05 13:07:13
|
## Under source code control: 1997/04/05 13:07:13
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
NAME
|
NAME
|
||||||
blocks - return a named file or number of unfreed named blocks
|
blocks - return a named block or number of unfreed named blocks
|
||||||
|
|
||||||
SYNOPSIS
|
SYNOPSIS
|
||||||
blocks([id])
|
blocks([id])
|
||||||
@@ -58,8 +58,8 @@ SEE ALSO
|
|||||||
## received a copy with calc; if not, write to Free Software Foundation, Inc.
|
## received a copy with calc; if not, write to Free Software Foundation, Inc.
|
||||||
## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
||||||
##
|
##
|
||||||
## @(#) $Revision: 29.2 $
|
## @(#) $Revision: 29.3 $
|
||||||
## @(#) $Id: blocks,v 29.2 2000/06/07 14:02:33 chongo Exp $
|
## @(#) $Id: blocks,v 29.3 2002/07/10 11:47:04 chongo Exp $
|
||||||
## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/blocks,v $
|
## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/blocks,v $
|
||||||
##
|
##
|
||||||
## Under source code control: 1997/04/05 13:07:13
|
## Under source code control: 1997/04/05 13:07:13
|
||||||
|
18
help/config
18
help/config
@@ -16,6 +16,7 @@ Configuration parameters
|
|||||||
"epsilon" sets error value for transcendentals.
|
"epsilon" sets error value for transcendentals.
|
||||||
"maxprint" sets maximum number of elements printed.
|
"maxprint" sets maximum number of elements printed.
|
||||||
"mode" sets printout mode.
|
"mode" sets printout mode.
|
||||||
|
"mode2" sets 2nd base printout mode.
|
||||||
"mul2" sets size for alternative multiply.
|
"mul2" sets size for alternative multiply.
|
||||||
"sq2" sets size for alternative squaring.
|
"sq2" sets size for alternative squaring.
|
||||||
"pow2" sets size for alternate powering.
|
"pow2" sets size for alternate powering.
|
||||||
@@ -184,6 +185,7 @@ Detailed config descriptions
|
|||||||
=-=
|
=-=
|
||||||
|
|
||||||
config("mode", "mode_string")
|
config("mode", "mode_string")
|
||||||
|
config("mode2", "mode_string")
|
||||||
|
|
||||||
The "mode" parameter is a string specifying the mode for printing of
|
The "mode" parameter is a string specifying the mode for printing of
|
||||||
numbers by the unformatted print functions, and the default
|
numbers by the unformatted print functions, and the default
|
||||||
@@ -219,7 +221,17 @@ Detailed config descriptions
|
|||||||
Where multiple strings are given, the first string listed is what
|
Where multiple strings are given, the first string listed is what
|
||||||
config("mode") will return.
|
config("mode") will return.
|
||||||
|
|
||||||
The default "mode" is "real".
|
The "mode2" controls the double base output. When set to a value
|
||||||
|
other than "off", calc outputs files in both the "base" mode as
|
||||||
|
well as the "base2" mode. The "mode2" value may be any of the
|
||||||
|
"mode" values with the addition of:
|
||||||
|
|
||||||
|
"off" disable 2nd base output mode base2(0)
|
||||||
|
|
||||||
|
The base() builtin function sets and returns the "mode" value.
|
||||||
|
The base2() builtin function sets and returns the "mode2" value.
|
||||||
|
|
||||||
|
The default "mode" is "real". The default "mode2" is "off".
|
||||||
|
|
||||||
=-=
|
=-=
|
||||||
|
|
||||||
@@ -713,8 +725,8 @@ Detailed config descriptions
|
|||||||
## received a copy with calc; if not, write to Free Software Foundation, Inc.
|
## received a copy with calc; if not, write to Free Software Foundation, Inc.
|
||||||
## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
||||||
##
|
##
|
||||||
## @(#) $Revision: 29.6 $
|
## @(#) $Revision: 29.7 $
|
||||||
## @(#) $Id: config,v 29.6 2001/04/25 07:17:38 chongo Exp $
|
## @(#) $Id: config,v 29.7 2002/12/29 08:32:04 chongo Exp $
|
||||||
## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/config,v $
|
## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/config,v $
|
||||||
##
|
##
|
||||||
## Under source code control: 1991/07/21 04:37:17
|
## Under source code control: 1991/07/21 04:37:17
|
||||||
|
13
help/digits
13
help/digits
@@ -13,12 +13,15 @@ TYPES
|
|||||||
DESCRIPTION
|
DESCRIPTION
|
||||||
Returns the least non-negative integer n for which abs(x) < b^n.
|
Returns the least non-negative integer n for which abs(x) < b^n.
|
||||||
|
|
||||||
digits(x, b) = 0 if and only if abs(x) < 1.
|
digits(x, b) = 0 if and only if abs(x) <= 1.
|
||||||
|
|
||||||
For real x with absolute value >= 1, digits(x, b) is the number
|
For real x with absolute value > 1, digits(x, b) is the number
|
||||||
of digits in the standard base-b "decimal" representation of int(abs(x));
|
of digits in the standard base-b "decimal" representation of int(abs(x));
|
||||||
this is also given by 1 + ilog(x, b).
|
this is also given by 1 + ilog(x, b).
|
||||||
|
|
||||||
|
NOTE: both digits(0) and digits(1) return the value of 1.
|
||||||
|
This is not a bug, it is a feature of the above equation. :-)
|
||||||
|
|
||||||
EXAMPLE
|
EXAMPLE
|
||||||
> print digits(0), digits(0.0123), digits(3.7), digits(-27), digits(-99.7)
|
> print digits(0), digits(0.0123), digits(3.7), digits(-27), digits(-99.7)
|
||||||
0 0 1 2 2
|
0 0 1 2 2
|
||||||
@@ -32,7 +35,7 @@ LINK LIBRARY
|
|||||||
SEE ALSO
|
SEE ALSO
|
||||||
digit, places
|
digit, places
|
||||||
|
|
||||||
## Copyright (C) 1999 Landon Curt Noll
|
## Copyright (C) 1999-2003 Landon Curt Noll
|
||||||
##
|
##
|
||||||
## Calc is open software; you can redistribute it and/or modify it under
|
## Calc is open software; you can redistribute it and/or modify it under
|
||||||
## the terms of the version 2.1 of the GNU Lesser General Public License
|
## the terms of the version 2.1 of the GNU Lesser General Public License
|
||||||
@@ -48,8 +51,8 @@ SEE ALSO
|
|||||||
## received a copy with calc; if not, write to Free Software Foundation, Inc.
|
## received a copy with calc; if not, write to Free Software Foundation, Inc.
|
||||||
## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
||||||
##
|
##
|
||||||
## @(#) $Revision: 29.3 $
|
## @(#) $Revision: 29.4 $
|
||||||
## @(#) $Id: digits,v 29.3 2000/12/14 10:32:24 chongo Exp $
|
## @(#) $Id: digits,v 29.4 2003/01/14 04:09:35 chongo Exp $
|
||||||
## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/digits,v $
|
## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/digits,v $
|
||||||
##
|
##
|
||||||
## Under source code control: 1995/10/03 10:40:01
|
## Under source code control: 1995/10/03 10:40:01
|
||||||
|
6
help/im
6
help/im
@@ -20,7 +20,7 @@ LIMITS
|
|||||||
none
|
none
|
||||||
|
|
||||||
LINK LIBRARY
|
LINK LIBRARY
|
||||||
COMPLEX *cimag(COMPLEX *x)
|
COMPLEX *c_imag(COMPLEX *x)
|
||||||
|
|
||||||
SEE ALSO
|
SEE ALSO
|
||||||
re
|
re
|
||||||
@@ -41,8 +41,8 @@ SEE ALSO
|
|||||||
## received a copy with calc; if not, write to Free Software Foundation, Inc.
|
## received a copy with calc; if not, write to Free Software Foundation, Inc.
|
||||||
## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
||||||
##
|
##
|
||||||
## @(#) $Revision: 29.2 $
|
## @(#) $Revision: 29.3 $
|
||||||
## @(#) $Id: im,v 29.2 2000/06/07 14:02:33 chongo Exp $
|
## @(#) $Id: im,v 29.3 2002/03/12 09:38:26 chongo Exp $
|
||||||
## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/im,v $
|
## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/im,v $
|
||||||
##
|
##
|
||||||
## Under source code control: 1995/10/05 04:52:26
|
## Under source code control: 1995/10/05 04:52:26
|
||||||
|
6
help/re
6
help/re
@@ -20,7 +20,7 @@ LIMITS
|
|||||||
none
|
none
|
||||||
|
|
||||||
LINK LIBRARY
|
LINK LIBRARY
|
||||||
COMPLEX *cimag(COMPLEX *x)
|
COMPLEX *c_imag(COMPLEX *x)
|
||||||
|
|
||||||
SEE ALSO
|
SEE ALSO
|
||||||
im
|
im
|
||||||
@@ -41,8 +41,8 @@ SEE ALSO
|
|||||||
## received a copy with calc; if not, write to Free Software Foundation, Inc.
|
## received a copy with calc; if not, write to Free Software Foundation, Inc.
|
||||||
## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
||||||
##
|
##
|
||||||
## @(#) $Revision: 29.2 $
|
## @(#) $Revision: 29.3 $
|
||||||
## @(#) $Id: re,v 29.2 2000/06/07 14:02:33 chongo Exp $
|
## @(#) $Id: re,v 29.3 2002/03/12 09:38:26 chongo Exp $
|
||||||
## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/re,v $
|
## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/re,v $
|
||||||
##
|
##
|
||||||
## Under source code control: 1995/10/05 04:52:27
|
## Under source code control: 1995/10/05 04:52:27
|
||||||
|
14
help/str
14
help/str
@@ -18,7 +18,7 @@ DESCRIPTION
|
|||||||
|
|
||||||
For real or complex x, str(x) returns the string representing x
|
For real or complex x, str(x) returns the string representing x
|
||||||
in the current printing mode; configuration parameters affecting
|
in the current printing mode; configuration parameters affecting
|
||||||
this are "mode", "display", "outround", "tilde", "leadzero",
|
this are "mode", "mode2", "display", "outround", "tilde", "leadzero",
|
||||||
|
|
||||||
EXAMPLE
|
EXAMPLE
|
||||||
> str("")
|
> str("")
|
||||||
@@ -28,6 +28,10 @@ EXAMPLE
|
|||||||
> print str(123), str("+"), str(4i), str("is the same as"), str(123+4i)
|
> print str(123), str("+"), str(4i), str("is the same as"), str(123+4i)
|
||||||
123 + 4i is the same as 3+4i
|
123 + 4i is the same as 3+4i
|
||||||
|
|
||||||
|
> base2(16),
|
||||||
|
> print str(23209)
|
||||||
|
23209 /* 0x5aa9 */
|
||||||
|
|
||||||
LIMITS
|
LIMITS
|
||||||
none
|
none
|
||||||
|
|
||||||
@@ -41,9 +45,9 @@ LINK LIBRARY
|
|||||||
char *math_getdivertedio();
|
char *math_getdivertedio();
|
||||||
|
|
||||||
SEE ALSO
|
SEE ALSO
|
||||||
XXX - fill in
|
base, base2, config
|
||||||
|
|
||||||
## Copyright (C) 1999 Landon Curt Noll
|
## Copyright (C) 1999-2002 Landon Curt Noll
|
||||||
##
|
##
|
||||||
## Calc is open software; you can redistribute it and/or modify it under
|
## Calc is open software; you can redistribute it and/or modify it under
|
||||||
## the terms of the version 2.1 of the GNU Lesser General Public License
|
## the terms of the version 2.1 of the GNU Lesser General Public License
|
||||||
@@ -59,8 +63,8 @@ SEE ALSO
|
|||||||
## received a copy with calc; if not, write to Free Software Foundation, Inc.
|
## received a copy with calc; if not, write to Free Software Foundation, Inc.
|
||||||
## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
||||||
##
|
##
|
||||||
## @(#) $Revision: 29.2 $
|
## @(#) $Revision: 29.3 $
|
||||||
## @(#) $Id: str,v 29.2 2000/06/07 14:02:33 chongo Exp $
|
## @(#) $Id: str,v 29.3 2002/12/29 09:19:56 chongo Exp $
|
||||||
## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/str,v $
|
## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/str,v $
|
||||||
##
|
##
|
||||||
## Under source code control: 1995/10/05 04:52:27
|
## Under source code control: 1995/10/05 04:52:27
|
||||||
|
11
help/todo
11
help/todo
@@ -59,6 +59,13 @@ Very High priority items:
|
|||||||
* Fix any 'Known bugs' as noted in the BUGS file or as
|
* Fix any 'Known bugs' as noted in the BUGS file or as
|
||||||
displayed by 'calc help bugs'.
|
displayed by 'calc help bugs'.
|
||||||
|
|
||||||
|
* Internationalize calc by converting calc error messages and
|
||||||
|
text strings (e.g., calc startup banner, show output, etc.)
|
||||||
|
into calls to the GNU gettext internationalization facility.
|
||||||
|
If somebody translated these strings into another language,
|
||||||
|
setting $LANG would allow calc to produce error messages
|
||||||
|
and text strings in that language.
|
||||||
|
|
||||||
=-=
|
=-=
|
||||||
|
|
||||||
High priority items:
|
High priority items:
|
||||||
@@ -133,8 +140,8 @@ Medium priority items:
|
|||||||
## received a copy with calc; if not, write to Free Software Foundation, Inc.
|
## received a copy with calc; if not, write to Free Software Foundation, Inc.
|
||||||
## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
||||||
##
|
##
|
||||||
## @(#) $Revision: 29.2 $
|
## @(#) $Revision: 29.4 $
|
||||||
## @(#) $Id: todo,v 29.2 2000/06/07 14:02:33 chongo Exp $
|
## @(#) $Id: todo,v 29.4 2002/07/10 17:30:28 chongo Exp $
|
||||||
## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/todo,v $
|
## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/todo,v $
|
||||||
##
|
##
|
||||||
## Under source code control: 1999/10/20 07:42:55
|
## Under source code control: 1999/10/20 07:42:55
|
||||||
|
@@ -249,8 +249,8 @@ Calc command line
|
|||||||
./myfile.cal
|
./myfile.cal
|
||||||
${LIBDIR}/myfile
|
${LIBDIR}/myfile
|
||||||
${LIBDIR}/myfile.cal
|
${LIBDIR}/myfile.cal
|
||||||
${CUSTOMLIBDIR}/myfile
|
${CUSTOMCALDIR}/myfile
|
||||||
${CUSTOMLIBDIR}/myfile.cal
|
${CUSTOMCALDIR}/myfile.cal
|
||||||
|
|
||||||
If the file is found, the search stops and the commands in
|
If the file is found, the search stops and the commands in
|
||||||
the file are executed. It is an error if no readable file
|
the file are executed. It is an error if no readable file
|
||||||
@@ -353,8 +353,8 @@ For more information use the following calc commands:
|
|||||||
## received a copy with calc; if not, write to Free Software Foundation, Inc.
|
## received a copy with calc; if not, write to Free Software Foundation, Inc.
|
||||||
## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
||||||
##
|
##
|
||||||
## @(#) $Revision: 29.3 $
|
## @(#) $Revision: 29.4 $
|
||||||
## @(#) $Id: usage,v 29.3 2000/06/07 14:02:33 chongo Exp $
|
## @(#) $Id: usage,v 29.4 2002/07/10 11:47:04 chongo Exp $
|
||||||
## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/usage,v $
|
## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/usage,v $
|
||||||
##
|
##
|
||||||
## Under source code control: 1991/07/21 04:37:25
|
## Under source code control: 1991/07/21 04:37:25
|
||||||
|
@@ -12,8 +12,7 @@ DESCRIPTION
|
|||||||
|
|
||||||
Calc version strings can be of the form:
|
Calc version strings can be of the form:
|
||||||
|
|
||||||
x.y.ztw.v
|
x.y.z.w
|
||||||
x.y.ztw
|
|
||||||
x.y.z
|
x.y.z
|
||||||
x.y
|
x.y
|
||||||
|
|
||||||
@@ -22,7 +21,7 @@ DESCRIPTION
|
|||||||
|
|
||||||
EXAMPLE
|
EXAMPLE
|
||||||
> version()
|
> version()
|
||||||
"2.11.5t4.1"
|
"2.11.5.4"
|
||||||
|
|
||||||
LIMITS
|
LIMITS
|
||||||
none
|
none
|
||||||
@@ -49,8 +48,8 @@ SEE ALSO
|
|||||||
## received a copy with calc; if not, write to Free Software Foundation, Inc.
|
## received a copy with calc; if not, write to Free Software Foundation, Inc.
|
||||||
## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
||||||
##
|
##
|
||||||
## @(#) $Revision: 29.2 $
|
## @(#) $Revision: 29.3 $
|
||||||
## @(#) $Id: version,v 29.2 2001/05/29 00:43:54 chongo Exp $
|
## @(#) $Id: version,v 29.3 2001/06/09 23:32:45 chongo Exp $
|
||||||
## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/version,v $
|
## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/version,v $
|
||||||
##
|
##
|
||||||
## Under source code control: 2001/05/28 17:38:01
|
## Under source code control: 2001/05/28 17:38:01
|
||||||
|
8
hist.h
8
hist.h
@@ -17,8 +17,8 @@
|
|||||||
* received a copy with calc; if not, write to Free Software Foundation, Inc.
|
* received a copy with calc; if not, write to Free Software Foundation, Inc.
|
||||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
* 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
||||||
*
|
*
|
||||||
* @(#) $Revision: 29.3 $
|
* @(#) $Revision: 29.4 $
|
||||||
* @(#) $Id: hist.h,v 29.3 2001/03/17 21:31:47 chongo Exp $
|
* @(#) $Id: hist.h,v 29.4 2002/03/12 09:40:57 chongo Exp $
|
||||||
* @(#) $Source: /usr/local/src/cmd/calc/RCS/hist.h,v $
|
* @(#) $Source: /usr/local/src/cmd/calc/RCS/hist.h,v $
|
||||||
*
|
*
|
||||||
* Under source code control: 1993/05/02 20:09:20
|
* Under source code control: 1993/05/02 20:09:20
|
||||||
@@ -50,7 +50,11 @@
|
|||||||
#define HOMECHAR '~' /* char which indicates home directory */
|
#define HOMECHAR '~' /* char which indicates home directory */
|
||||||
#define DOTCHAR '.' /* char which indicates current directory */
|
#define DOTCHAR '.' /* char which indicates current directory */
|
||||||
#define PATHCHAR '/' /* char which separates path components */
|
#define PATHCHAR '/' /* char which separates path components */
|
||||||
|
#if defined(__MSDOS__) || defined(__WIN32)
|
||||||
|
#define LISTCHAR ';' /* char which separates paths in a list */
|
||||||
|
#else
|
||||||
#define LISTCHAR ':' /* char which separates paths in a list */
|
#define LISTCHAR ':' /* char which separates paths in a list */
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
29
input.c
29
input.c
@@ -17,8 +17,8 @@
|
|||||||
* received a copy with calc; if not, write to Free Software Foundation, Inc.
|
* received a copy with calc; if not, write to Free Software Foundation, Inc.
|
||||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
* 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
||||||
*
|
*
|
||||||
* @(#) $Revision: 29.5 $
|
* @(#) $Revision: 29.6 $
|
||||||
* @(#) $Id: input.c,v 29.5 2001/03/17 21:31:47 chongo Exp $
|
* @(#) $Id: input.c,v 29.6 2002/03/12 09:40:57 chongo Exp $
|
||||||
* @(#) $Source: /usr/local/src/cmd/calc/RCS/input.c,v $
|
* @(#) $Source: /usr/local/src/cmd/calc/RCS/input.c,v $
|
||||||
*
|
*
|
||||||
* Under source code control: 1990/02/15 01:48:16
|
* Under source code control: 1990/02/15 01:48:16
|
||||||
@@ -46,6 +46,12 @@
|
|||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined(__MSDOS__)
|
||||||
|
#include <limits.h>
|
||||||
|
#define _fullpath(f,n,s) (_fixpath(n,f),f)
|
||||||
|
#define _MAX_PATH PATH_MAX
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "calc.h"
|
#include "calc.h"
|
||||||
#include "conf.h"
|
#include "conf.h"
|
||||||
#include "hist.h"
|
#include "hist.h"
|
||||||
@@ -816,11 +822,12 @@ runrcfiles(void)
|
|||||||
* given:
|
* given:
|
||||||
* sbuf stat of the inode in question
|
* sbuf stat of the inode in question
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static int
|
static int
|
||||||
isinoderead(struct stat *sbuf)
|
isinoderead(struct stat *sbuf)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
#if defined(_WIN32)
|
#if defined(_WIN32) || defined(__MSDOS__)
|
||||||
char fullpathname[_MAX_PATH];
|
char fullpathname[_MAX_PATH];
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -832,11 +839,11 @@ isinoderead(struct stat *sbuf)
|
|||||||
|
|
||||||
/* scan the entire readset */
|
/* scan the entire readset */
|
||||||
for (i=0; i < maxreadset; ++i) {
|
for (i=0; i < maxreadset; ++i) {
|
||||||
#if defined(_WIN32)
|
#if defined(_WIN32) || defined(__MSDOS__)
|
||||||
if (readset[i].active &&
|
if (readset[i].active &&
|
||||||
strcmp(readset[i].path,
|
strcasecmp(readset[i].path,
|
||||||
_fullpath(fullpathname,cip->i_name,
|
_fullpath(fullpathname,cip->i_name,
|
||||||
_MAX_PATH)) == 0) {
|
_MAX_PATH)) == 0) {
|
||||||
/* found a match */
|
/* found a match */
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
@@ -954,14 +961,18 @@ addreadset(char *name, char *path, struct stat *sbuf)
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
strcpy(readset[ret].name, name);
|
strcpy(readset[ret].name, name);
|
||||||
#if defined(_WIN32)
|
#if defined(_WIN32) || defined(__MSDOS__)
|
||||||
/*
|
/*
|
||||||
* For WIN32, _fullpath expands the path to a fully qualified
|
* For WIN32, _fullpath expands the path to a fully qualified
|
||||||
* path name, which under WIN32 FAT and NTFS is unique, just
|
* path name, which under WIN32 FAT and NTFS is unique, just
|
||||||
* like UNIX inodes. _fullpath also allocated the memory for
|
* like UNIX inodes. _fullpath also allocated the memory for
|
||||||
* this new longer path name.
|
* this new longer path name.
|
||||||
*/
|
*/
|
||||||
readset[ret].path = _fullpath(NULL, path, 0);
|
{
|
||||||
|
char fullpathname[_MAX_PATH];
|
||||||
|
|
||||||
|
readset[ret].path = _fullpath(fullpathname, path, _MAX_PATH);
|
||||||
|
}
|
||||||
#else /* Windoz free systems */
|
#else /* Windoz free systems */
|
||||||
readset[ret].path = (char *)malloc(strlen(path)+1);
|
readset[ret].path = (char *)malloc(strlen(path)+1);
|
||||||
if (readset[ret].path == NULL) {
|
if (readset[ret].path == NULL) {
|
||||||
|
6
jump.h
6
jump.h
@@ -17,8 +17,8 @@
|
|||||||
* received a copy with calc; if not, write to Free Software Foundation, Inc.
|
* received a copy with calc; if not, write to Free Software Foundation, Inc.
|
||||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
* 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
||||||
*
|
*
|
||||||
* @(#) $Revision: 29.3 $
|
* @(#) $Revision: 29.4 $
|
||||||
* @(#) $Id: jump.h,v 29.3 2001/05/29 00:16:53 chongo Exp $
|
* @(#) $Id: jump.h,v 29.4 2001/06/08 21:00:58 chongo Exp $
|
||||||
* @(#) $Source: /usr/local/src/cmd/calc/RCS/jump.h,v $
|
* @(#) $Source: /usr/local/src/cmd/calc/RCS/jump.h,v $
|
||||||
*
|
*
|
||||||
* Under source code control: 1994/06/29 04:03:55
|
* Under source code control: 1994/06/29 04:03:55
|
||||||
@@ -66,7 +66,7 @@
|
|||||||
#define __JUMP_H__
|
#define __JUMP_H__
|
||||||
|
|
||||||
|
|
||||||
#if defined(SRC) /* if we are building from the calc source tree */
|
#if defined(CALC_SRC) /* if we are building from the calc source tree */
|
||||||
# include "have_const.h"
|
# include "have_const.h"
|
||||||
#else
|
#else
|
||||||
# include <calc/have_const.h>
|
# include <calc/have_const.h>
|
||||||
|
6
label.h
6
label.h
@@ -17,8 +17,8 @@
|
|||||||
* received a copy with calc; if not, write to Free Software Foundation, Inc.
|
* received a copy with calc; if not, write to Free Software Foundation, Inc.
|
||||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
* 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
||||||
*
|
*
|
||||||
* @(#) $Revision: 29.3 $
|
* @(#) $Revision: 29.4 $
|
||||||
* @(#) $Id: label.h,v 29.3 2001/05/29 00:16:53 chongo Exp $
|
* @(#) $Id: label.h,v 29.4 2001/06/08 21:00:58 chongo Exp $
|
||||||
* @(#) $Source: /usr/local/src/cmd/calc/RCS/label.h,v $
|
* @(#) $Source: /usr/local/src/cmd/calc/RCS/label.h,v $
|
||||||
*
|
*
|
||||||
* Under source code control: 1990/02/15 01:48:33
|
* Under source code control: 1990/02/15 01:48:33
|
||||||
@@ -32,7 +32,7 @@
|
|||||||
#define __LABEL_H__
|
#define __LABEL_H__
|
||||||
|
|
||||||
|
|
||||||
#if defined(SRC) /* if we are building from the calc source tree */
|
#if defined(CALC_SRC) /* if we are building from the calc source tree */
|
||||||
# include "zmath.h"
|
# include "zmath.h"
|
||||||
#else
|
#else
|
||||||
# include <calc/zmath.h>
|
# include <calc/zmath.h>
|
||||||
|
@@ -17,8 +17,8 @@
|
|||||||
* received a copy with calc; if not, write to Free Software Foundation, Inc.
|
* received a copy with calc; if not, write to Free Software Foundation, Inc.
|
||||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
* 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
||||||
*
|
*
|
||||||
* @(#) $Revision: 29.7 $
|
* @(#) $Revision: 29.8 $
|
||||||
* @(#) $Id: lib_calc.c,v 29.7 2001/04/08 22:05:40 chongo Exp $
|
* @(#) $Id: lib_calc.c,v 29.8 2002/03/12 09:40:57 chongo Exp $
|
||||||
* @(#) $Source: /usr/local/src/cmd/calc/RCS/lib_calc.c,v $
|
* @(#) $Source: /usr/local/src/cmd/calc/RCS/lib_calc.c,v $
|
||||||
*
|
*
|
||||||
* Under source code control: 1996/06/17 18:06:19
|
* Under source code control: 1996/06/17 18:06:19
|
||||||
@@ -217,6 +217,11 @@ libcalc_call_me_first(void)
|
|||||||
*/
|
*/
|
||||||
if (program != NULL) {
|
if (program != NULL) {
|
||||||
p = strrchr(program, '/');
|
p = strrchr(program, '/');
|
||||||
|
#if defined(_WIN32) || defined(__MSDOS__)
|
||||||
|
if (p == NULL) {
|
||||||
|
p = strrchr(program, '\\');
|
||||||
|
}
|
||||||
|
#endif
|
||||||
if (p == NULL) {
|
if (p == NULL) {
|
||||||
base_name = program;
|
base_name = program;
|
||||||
} else {
|
} else {
|
||||||
|
@@ -17,8 +17,8 @@
|
|||||||
* received a copy with calc; if not, write to Free Software Foundation, Inc.
|
* received a copy with calc; if not, write to Free Software Foundation, Inc.
|
||||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
* 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
||||||
*
|
*
|
||||||
* @(#) $Revision: 29.4 $
|
* @(#) $Revision: 29.5 $
|
||||||
* @(#) $Id: math_error.h,v 29.4 2001/05/29 00:16:53 chongo Exp $
|
* @(#) $Id: math_error.h,v 29.5 2001/06/08 21:00:58 chongo Exp $
|
||||||
* @(#) $Source: /usr/local/src/cmd/calc/RCS/math_error.h,v $
|
* @(#) $Source: /usr/local/src/cmd/calc/RCS/math_error.h,v $
|
||||||
*
|
*
|
||||||
* Under source code control: 1997/03/23 18:37:10
|
* Under source code control: 1997/03/23 18:37:10
|
||||||
@@ -33,7 +33,7 @@
|
|||||||
#define __MATH_ERROR_H__
|
#define __MATH_ERROR_H__
|
||||||
|
|
||||||
|
|
||||||
#if defined(SRC) /* if we are building from the calc source tree */
|
#if defined(CALC_SRC) /* if we are building from the calc source tree */
|
||||||
# include "win32dll.h"
|
# include "win32dll.h"
|
||||||
#else
|
#else
|
||||||
# include <calc/win32dll.h>
|
# include <calc/win32dll.h>
|
||||||
|
47
no_implicit.c
Normal file
47
no_implicit.c
Normal file
@@ -0,0 +1,47 @@
|
|||||||
|
/*
|
||||||
|
* no-implicit - Determine if the compiler allows -Wno-implicit
|
||||||
|
*
|
||||||
|
* Copyright (C) 2003 Landon Curt Noll
|
||||||
|
*
|
||||||
|
* Calc is open software; you can redistribute it and/or modify it under
|
||||||
|
* the terms of the version 2.1 of the GNU Lesser General Public License
|
||||||
|
* as published by the Free Software Foundation.
|
||||||
|
*
|
||||||
|
* Calc is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||||
|
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
|
||||||
|
* Public License for more details.
|
||||||
|
*
|
||||||
|
* A copy of version 2.1 of the GNU Lesser General Public License is
|
||||||
|
* distributed with calc under the filename COPYING-LGPL. You should have
|
||||||
|
* received a copy with calc; if not, write to Free Software Foundation, Inc.
|
||||||
|
* 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
||||||
|
*
|
||||||
|
* @(#) $Revision: 29.1 $
|
||||||
|
* @(#) $Id: no_implicit.c,v 29.1 2003/01/14 01:45:19 chongo Exp $
|
||||||
|
* @(#) $Source: /usr/local/src/cmd/calc/RCS/no_implicit.c,v $
|
||||||
|
*
|
||||||
|
* Under source code control: 2003/01/14 01:45:19
|
||||||
|
* File existed as early as: 2003
|
||||||
|
*
|
||||||
|
* chongo <was here> /\oo/\ http://www.isthe.com/chongo/
|
||||||
|
* Share and enjoy! :-) http://www.isthe.com/chongo/tech/comp/calc/
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* If we are able to compile this program, then we the compiler must
|
||||||
|
* allow the -Wno-implicit flag so we output the -Wno-implicit symbol.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
|
int
|
||||||
|
main(void)
|
||||||
|
{
|
||||||
|
/* -Wno-implicit flag is allowed */
|
||||||
|
printf("-Wno-implicit\n");
|
||||||
|
|
||||||
|
/* exit(0); */
|
||||||
|
return 0;
|
||||||
|
}
|
@@ -17,8 +17,8 @@
|
|||||||
* received a copy with calc; if not, write to Free Software Foundation, Inc.
|
* received a copy with calc; if not, write to Free Software Foundation, Inc.
|
||||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
* 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
||||||
*
|
*
|
||||||
* @(#) $Revision: 29.5 $
|
* @(#) $Revision: 29.6 $
|
||||||
* @(#) $Id: opcodes.h,v 29.5 2001/05/29 00:16:53 chongo Exp $
|
* @(#) $Id: opcodes.h,v 29.6 2001/06/08 21:00:58 chongo Exp $
|
||||||
* @(#) $Source: /usr/local/src/cmd/calc/RCS/opcodes.h,v $
|
* @(#) $Source: /usr/local/src/cmd/calc/RCS/opcodes.h,v $
|
||||||
*
|
*
|
||||||
* Under source code control: 1990/02/15 01:48:35
|
* Under source code control: 1990/02/15 01:48:35
|
||||||
@@ -32,7 +32,7 @@
|
|||||||
#define __OPCODES_H__
|
#define __OPCODES_H__
|
||||||
|
|
||||||
|
|
||||||
#if defined(SRC) /* if we are building from the calc source tree */
|
#if defined(CALC_SRC) /* if we are building from the calc source tree */
|
||||||
# include "win32dll.h"
|
# include "win32dll.h"
|
||||||
#else
|
#else
|
||||||
# include <calc/win32dll.h>
|
# include <calc/win32dll.h>
|
||||||
|
6
prime.h
6
prime.h
@@ -17,8 +17,8 @@
|
|||||||
* received a copy with calc; if not, write to Free Software Foundation, Inc.
|
* received a copy with calc; if not, write to Free Software Foundation, Inc.
|
||||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
* 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
||||||
*
|
*
|
||||||
* @(#) $Revision: 29.3 $
|
* @(#) $Revision: 29.4 $
|
||||||
* @(#) $Id: prime.h,v 29.3 2001/05/29 00:16:53 chongo Exp $
|
* @(#) $Id: prime.h,v 29.4 2001/06/08 21:00:58 chongo Exp $
|
||||||
* @(#) $Source: /usr/local/src/cmd/calc/RCS/prime.h,v $
|
* @(#) $Source: /usr/local/src/cmd/calc/RCS/prime.h,v $
|
||||||
*
|
*
|
||||||
* Under source code control: 1994/06/04 03:26:15
|
* Under source code control: 1994/06/04 03:26:15
|
||||||
@@ -33,7 +33,7 @@
|
|||||||
#define __PRIME_H__
|
#define __PRIME_H__
|
||||||
|
|
||||||
|
|
||||||
#if defined(SRC) /* if we are building from the calc source tree */
|
#if defined(CALC_SRC) /* if we are building from the calc source tree */
|
||||||
# include "qmath.h"
|
# include "qmath.h"
|
||||||
# include "have_const.h"
|
# include "have_const.h"
|
||||||
#else
|
#else
|
||||||
|
17
qio.c
17
qio.c
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* qio - scanf and printf routines for arbitrary precision rational numbers
|
* qio - scanf and printf routines for arbitrary precision rational numbers
|
||||||
*
|
*
|
||||||
* Copyright (C) 1999 David I. Bell
|
* Copyright (C) 1999-2002 David I. Bell
|
||||||
*
|
*
|
||||||
* Calc is open software; you can redistribute it and/or modify it under
|
* Calc is open software; you can redistribute it and/or modify it under
|
||||||
* the terms of the version 2.1 of the GNU Lesser General Public License
|
* the terms of the version 2.1 of the GNU Lesser General Public License
|
||||||
@@ -17,8 +17,8 @@
|
|||||||
* received a copy with calc; if not, write to Free Software Foundation, Inc.
|
* received a copy with calc; if not, write to Free Software Foundation, Inc.
|
||||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
* 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
||||||
*
|
*
|
||||||
* @(#) $Revision: 29.3 $
|
* @(#) $Revision: 29.4 $
|
||||||
* @(#) $Id: qio.c,v 29.3 2000/07/17 15:35:49 chongo Exp $
|
* @(#) $Id: qio.c,v 29.4 2002/12/29 09:20:25 chongo Exp $
|
||||||
* @(#) $Source: /usr/local/src/cmd/calc/RCS/qio.c,v $
|
* @(#) $Source: /usr/local/src/cmd/calc/RCS/qio.c,v $
|
||||||
*
|
*
|
||||||
* Under source code control: 1993/07/30 19:42:46
|
* Under source code control: 1993/07/30 19:42:46
|
||||||
@@ -180,9 +180,12 @@ qprintnum(NUMBER *q, int outmode)
|
|||||||
{
|
{
|
||||||
NUMBER tmpval;
|
NUMBER tmpval;
|
||||||
long prec, exp;
|
long prec, exp;
|
||||||
|
int outmode2 = MODE2_OFF;
|
||||||
|
|
||||||
if (outmode == MODE_DEFAULT)
|
if (outmode == MODE_DEFAULT) {
|
||||||
outmode = conf->outmode;
|
outmode = conf->outmode;
|
||||||
|
outmode2 = conf->outmode2;
|
||||||
|
}
|
||||||
switch (outmode) {
|
switch (outmode) {
|
||||||
case MODE_INT:
|
case MODE_INT:
|
||||||
if (conf->tilde_ok && qisfrac(q))
|
if (conf->tilde_ok && qisfrac(q))
|
||||||
@@ -248,6 +251,12 @@ qprintnum(NUMBER *q, int outmode)
|
|||||||
math_error("Bad mode for print");
|
math_error("Bad mode for print");
|
||||||
/*NOTREACHED*/
|
/*NOTREACHED*/
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (outmode2 != MODE2_OFF) {
|
||||||
|
PUTSTR(" /* ");
|
||||||
|
qprintnum(q, outmode2);
|
||||||
|
PUTSTR(" */");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
6
qmath.h
6
qmath.h
@@ -17,8 +17,8 @@
|
|||||||
* received a copy with calc; if not, write to Free Software Foundation, Inc.
|
* received a copy with calc; if not, write to Free Software Foundation, Inc.
|
||||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
* 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
||||||
*
|
*
|
||||||
* @(#) $Revision: 29.4 $
|
* @(#) $Revision: 29.5 $
|
||||||
* @(#) $Id: qmath.h,v 29.4 2001/05/29 00:16:53 chongo Exp $
|
* @(#) $Id: qmath.h,v 29.5 2001/06/08 21:00:58 chongo Exp $
|
||||||
* @(#) $Source: /usr/local/src/cmd/calc/RCS/qmath.h,v $
|
* @(#) $Source: /usr/local/src/cmd/calc/RCS/qmath.h,v $
|
||||||
*
|
*
|
||||||
* Under source code control: 1993/07/30 19:42:47
|
* Under source code control: 1993/07/30 19:42:47
|
||||||
@@ -32,7 +32,7 @@
|
|||||||
#define __QMATH_H__
|
#define __QMATH_H__
|
||||||
|
|
||||||
|
|
||||||
#if defined(SRC) /* if we are building from the calc source tree */
|
#if defined(CALC_SRC) /* if we are building from the calc source tree */
|
||||||
# include "zmath.h"
|
# include "zmath.h"
|
||||||
#else
|
#else
|
||||||
# include <calc/zmath.h>
|
# include <calc/zmath.h>
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* quickhash - quickly hash a calc value using a partial Fowler/Noll/Vo hash
|
* quickhash - quickly hash a calc value using a partial Fowler/Noll/Vo hash
|
||||||
*
|
*
|
||||||
* Copyright (C) 1999 Landon Curt Noll
|
* Copyright (C) 1999-2002 Landon Curt Noll
|
||||||
*
|
*
|
||||||
* Calc is open software; you can redistribute it and/or modify it under
|
* Calc is open software; you can redistribute it and/or modify it under
|
||||||
* the terms of the version 2.1 of the GNU Lesser General Public License
|
* the terms of the version 2.1 of the GNU Lesser General Public License
|
||||||
@@ -17,8 +17,8 @@
|
|||||||
* received a copy with calc; if not, write to Free Software Foundation, Inc.
|
* received a copy with calc; if not, write to Free Software Foundation, Inc.
|
||||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
* 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
||||||
*
|
*
|
||||||
* @(#) $Revision: 29.4 $
|
* @(#) $Revision: 29.5 $
|
||||||
* @(#) $Id: quickhash.c,v 29.4 2001/04/14 22:47:21 chongo Exp $
|
* @(#) $Id: quickhash.c,v 29.5 2002/12/29 09:20:25 chongo Exp $
|
||||||
* @(#) $Source: /usr/local/src/cmd/calc/RCS/quickhash.c,v $
|
* @(#) $Source: /usr/local/src/cmd/calc/RCS/quickhash.c,v $
|
||||||
*
|
*
|
||||||
* Under source code control: 1995/03/04 11:34:23
|
* Under source code control: 1995/03/04 11:34:23
|
||||||
@@ -382,6 +382,7 @@ config_hash(CONFIG *cfg, QCKHASH val)
|
|||||||
*/
|
*/
|
||||||
value = cfg->outmode;
|
value = cfg->outmode;
|
||||||
value = (((value>>5) | (value<<27)) ^ (USB32)cfg->outmode);
|
value = (((value>>5) | (value<<27)) ^ (USB32)cfg->outmode);
|
||||||
|
value = (((value>>5) | (value<<27)) ^ (USB32)cfg->outmode2);
|
||||||
value = (((value>>5) | (value<<27)) ^ (USB32)cfg->outdigits);
|
value = (((value>>5) | (value<<27)) ^ (USB32)cfg->outdigits);
|
||||||
/* epsilon is handeled out of order */
|
/* epsilon is handeled out of order */
|
||||||
value = (((value>>5) | (value<<27)) ^ (USB32)cfg->epsilonprec);
|
value = (((value>>5) | (value<<27)) ^ (USB32)cfg->epsilonprec);
|
||||||
|
145
sample/Makefile
145
sample/Makefile
@@ -17,8 +17,8 @@
|
|||||||
# received a copy with calc; if not, write to Free Software Foundation, Inc.
|
# received a copy with calc; if not, write to Free Software Foundation, Inc.
|
||||||
# 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
# 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
||||||
#
|
#
|
||||||
# @(#) $Revision: 29.11 $
|
# @(#) $Revision: 29.17 $
|
||||||
# @(#) $Id: Makefile,v 29.11 2001/05/28 23:54:53 chongo Exp $
|
# @(#) $Id: Makefile,v 29.17 2003/01/14 02:00:23 chongo Exp $
|
||||||
# @(#) $Source: /usr/local/src/cmd/calc/sample/RCS/Makefile,v $
|
# @(#) $Source: /usr/local/src/cmd/calc/sample/RCS/Makefile,v $
|
||||||
#
|
#
|
||||||
# Under source code control: 1997/04/19 22:46:49
|
# Under source code control: 1997/04/19 22:46:49
|
||||||
@@ -75,34 +75,120 @@ SAMPLE_OBJ= many_random.o test_random.o
|
|||||||
#Q=
|
#Q=
|
||||||
Q=@
|
Q=@
|
||||||
|
|
||||||
|
####
|
||||||
# Normally, the upper level makefile will set these values. We provide
|
# Normally, the upper level makefile will set these values. We provide
|
||||||
# a default here just in case you want to build from this directory.
|
# a default here just in case you want to build from this directory.
|
||||||
|
####
|
||||||
|
|
||||||
|
# Where the system include (.h) files are kept
|
||||||
#
|
#
|
||||||
# where things go
|
# For DJGPP, select:
|
||||||
#
|
#
|
||||||
# ${BINDIR} where to install binary files
|
# INCDIR= /dev/env/DJDIR/include
|
||||||
# ${SHAREDIR} where most common shared files are kept
|
|
||||||
# ${INCDIR} where most .h files are kept
|
|
||||||
# ${LIBDIR} where *.a files are installed
|
|
||||||
#
|
#
|
||||||
# ${CSHAREDIR} where most common shared calc files are kept
|
# If in doubt, set:
|
||||||
# ${HELPDIR} where the help directory is installed.
|
#
|
||||||
|
# INCDIR= /usr/include
|
||||||
|
#
|
||||||
|
|
||||||
|
#INCDIR= /usr/local/include
|
||||||
|
#INCDIR= /dev/env/DJDIR/include
|
||||||
|
INCDIR= /usr/include
|
||||||
|
|
||||||
|
# where to install calc realted things
|
||||||
|
#
|
||||||
|
# ${BINDIR} where to install calc binary files
|
||||||
|
# ${LIBDIR} where calc link library (*.a) files are installed
|
||||||
|
# ${CALC_SHAREDIR} where to install calc help, .cal, startup, config files
|
||||||
|
#
|
||||||
|
# NOTE: The install rule prepends installation paths with $T, which
|
||||||
|
# by default is empty. If $T is non-empty, then installation
|
||||||
|
# locations will be relative to the $T directory.
|
||||||
|
#
|
||||||
|
# For DJGPP, select:
|
||||||
|
#
|
||||||
|
# BINDIR= /dev/env/DJDIR/bin
|
||||||
|
# LIBDIR= /dev/env/DJDIR/lib
|
||||||
|
# CALC_SHAREDIR= /dev/env/DJDIR/share/calc
|
||||||
|
#
|
||||||
|
# If in doubt, set:
|
||||||
|
#
|
||||||
|
# BINDIR= /usr/bin
|
||||||
|
# LIBDIR= /usr/lib
|
||||||
|
# CALC_SHAREDIR= /usr/share/calc
|
||||||
#
|
#
|
||||||
#BINDIR= /usr/local/bin
|
#BINDIR= /usr/local/bin
|
||||||
|
#BINDIR= /dev/env/DJDIR/bin
|
||||||
BINDIR= /usr/bin
|
BINDIR= /usr/bin
|
||||||
#BINDIR= /usr/contrib/bin
|
|
||||||
#
|
|
||||||
#SHAREDIR= /usr/local/lib
|
|
||||||
SHAREDIR= /usr/share
|
|
||||||
#
|
|
||||||
#INCDIR= /usr/local/include
|
|
||||||
INCDIR= /usr/include
|
|
||||||
#
|
|
||||||
#LIBDIR= /usr/local/lib
|
#LIBDIR= /usr/local/lib
|
||||||
|
#LIBDIR= /dev/env/DJDIR/lib
|
||||||
LIBDIR= /usr/lib
|
LIBDIR= /usr/lib
|
||||||
|
|
||||||
CSHAREDIR= ${SHAREDIR}/calc
|
#CALC_SHAREDIR= /usr/local/lib/calc
|
||||||
HELPDIR= ${LIBDIR}/help
|
#CALC_SHAREDIR= /dev/env/DJDIR/share/calc
|
||||||
|
CALC_SHAREDIR= /usr/share/calc
|
||||||
|
|
||||||
|
# By default, these values are based CALC_SHAREDIR, INCDIR, BINDIR
|
||||||
|
# ---------------------------------------------------------------
|
||||||
|
# ${HELPDIR} where the help directory is installed
|
||||||
|
# ${CALC_INCDIR} where the calc include files are installed
|
||||||
|
# ${CUSTOMCALDIR} where custom *.cal files are installed
|
||||||
|
# ${CUSTOMHELPDIR} where custom help files are installed
|
||||||
|
# ${CUSTOMINCPDIR} where custom .h files are installed
|
||||||
|
# ${SCRIPTDIR} where calc shell scripts are installed
|
||||||
|
#
|
||||||
|
# NOTE: The install rule prepends installation paths with $T, which
|
||||||
|
# by default is empty. If $T is non-empty, then installation
|
||||||
|
# locations will be relative to the $T directory.
|
||||||
|
#
|
||||||
|
# If in doubt, set:
|
||||||
|
#
|
||||||
|
# HELPDIR= ${CALC_SHAREDIR}/help
|
||||||
|
# CALC_INCDIR= ${INCDIR}/calc
|
||||||
|
# CUSTOMCALDIR= ${CALC_SHAREDIR}/custom
|
||||||
|
# CUSTOMHELPDIR= ${CALC_SHAREDIR}/custhelp
|
||||||
|
# CUSTOMINCDIR= ${CALC_INCDIR}/custom
|
||||||
|
# SCRIPTDIR= ${BINDIR}/cscript
|
||||||
|
#
|
||||||
|
HELPDIR= ${CALC_SHAREDIR}/help
|
||||||
|
CALC_INCDIR= ${INCDIR}/calc
|
||||||
|
CUSTOMCALDIR= ${CALC_SHAREDIR}/custom
|
||||||
|
CUSTOMHELPDIR= ${CALC_SHAREDIR}/custhelp
|
||||||
|
CUSTOMINCDIR= ${CALC_INCDIR}/custom
|
||||||
|
SCRIPTDIR= ${BINDIR}/cscript
|
||||||
|
|
||||||
|
# T - top level directory under which calc will be installed
|
||||||
|
#
|
||||||
|
# The calc install is performed under $T, the calc build is
|
||||||
|
# performed under /. The purpose for $T is to allow someone
|
||||||
|
# to install calc somewhere other than into the system area.
|
||||||
|
#
|
||||||
|
# For example, if:
|
||||||
|
#
|
||||||
|
# BINDIR= /usr/bin
|
||||||
|
# LIBDIR= /usr/lib
|
||||||
|
# CALC_SHAREDIR= /usr/share/calc
|
||||||
|
#
|
||||||
|
# and if:
|
||||||
|
#
|
||||||
|
# T= /var/tmp/testing
|
||||||
|
#
|
||||||
|
# Then the installation locations will be:
|
||||||
|
#
|
||||||
|
# calc binary files: /var/tmp/testing/usr/bin
|
||||||
|
# calc link library: /var/tmp/testing/usr/lib
|
||||||
|
# calc help, .cal ...: /var/tmp/testing/usr/share/calc
|
||||||
|
# ... etc ... /var/tmp/testing/...
|
||||||
|
#
|
||||||
|
# If $T is empty, calc is installed under /, which is the same
|
||||||
|
# top of tree for which it was built. If $T is non-empty, then
|
||||||
|
# calc is installed under $T, as if one had to chroot under
|
||||||
|
# $T for calc to operate.
|
||||||
|
#
|
||||||
|
# If in doubt, use T=
|
||||||
|
#
|
||||||
|
T=
|
||||||
|
|
||||||
# Normally, the upper level makefile will set these values. We provide
|
# Normally, the upper level makefile will set these values. We provide
|
||||||
# a default here just in case you want to build from this directory.
|
# a default here just in case you want to build from this directory.
|
||||||
@@ -343,8 +429,10 @@ many_random: many_random.o ../libcalc.a
|
|||||||
##
|
##
|
||||||
|
|
||||||
distlist: ${DISTLIST}
|
distlist: ${DISTLIST}
|
||||||
${Q}for i in ${DISTLIST}; do \
|
${Q}for i in ${DISTLIST} /dev/null; do \
|
||||||
|
if [ X"$$i" != X"/dev/null" ]; then \
|
||||||
echo sample/$$i; \
|
echo sample/$$i; \
|
||||||
|
fi; \
|
||||||
done
|
done
|
||||||
|
|
||||||
distdir:
|
distdir:
|
||||||
@@ -380,11 +468,14 @@ depend:
|
|||||||
-${Q}rm -rf skel
|
-${Q}rm -rf skel
|
||||||
${Q}mkdir skel
|
${Q}mkdir skel
|
||||||
${Q}mkdir skel/sample
|
${Q}mkdir skel/sample
|
||||||
-${Q}for i in ${C_SRC}; do \
|
-${Q}for i in ${C_SRC} /dev/null; do \
|
||||||
|
if [ X"$$i" != X"/dev/null" ]; then \
|
||||||
${SED} -n '/^#[ ]*include[ ]*"/p' \
|
${SED} -n '/^#[ ]*include[ ]*"/p' \
|
||||||
"$$i" > "skel/sample/$$i"; \
|
"$$i" > "skel/sample/$$i"; \
|
||||||
|
fi; \
|
||||||
done
|
done
|
||||||
-${Q}for i in ${H_SRC} /dev/null; do \
|
-${Q}for i in ${H_SRC} /dev/null; do \
|
||||||
|
if [ X"$$i" != X"/dev/null" ]; then \
|
||||||
if [ X"$$i" != X"/dev/null" ]; then \
|
if [ X"$$i" != X"/dev/null" ]; then \
|
||||||
tag="`echo $$i | ${SED} 's/[\.+,:]/_/g'`"; \
|
tag="`echo $$i | ${SED} 's/[\.+,:]/_/g'`"; \
|
||||||
echo "#if !defined($$tag)" > "skel/sample/$$i"; \
|
echo "#if !defined($$tag)" > "skel/sample/$$i"; \
|
||||||
@@ -393,18 +484,21 @@ depend:
|
|||||||
>> "skel/sample/$$i"; \
|
>> "skel/sample/$$i"; \
|
||||||
echo '#endif /* '"$$tag"' */' >> "skel/sample/$$i"; \
|
echo '#endif /* '"$$tag"' */' >> "skel/sample/$$i"; \
|
||||||
fi; \
|
fi; \
|
||||||
|
fi; \
|
||||||
done
|
done
|
||||||
${Q}(cd ..; ${MAKE} hsrc)
|
${Q}(cd ..; ${MAKE} hsrc)
|
||||||
${Q}for i in `cd ..; ${MAKE} h_list 2>&1 | \
|
${Q}for i in `cd ..; ${MAKE} h_list 2>&1 | \
|
||||||
${SED} -e '/Entering directory/d' \
|
${SED} -e '/Entering directory/d' \
|
||||||
-e '/Nothing to be done/d' \
|
-e '/Nothing to be done/d' \
|
||||||
-e '/Leaving directory/d'`; do \
|
-e '/Leaving directory/d'` /dev/null; do \
|
||||||
|
if [ X"$$i" != X"/dev/null" ]; then \
|
||||||
tag="`echo $$i | ${SED} 's/[\.+,:]/_/g'`"; \
|
tag="`echo $$i | ${SED} 's/[\.+,:]/_/g'`"; \
|
||||||
echo "#if !defined($$tag)" > "skel/$$i"; \
|
echo "#if !defined($$tag)" > "skel/$$i"; \
|
||||||
echo "#define $$tag" >> "skel/$$i"; \
|
echo "#define $$tag" >> "skel/$$i"; \
|
||||||
${SED} -n '/^#[ ]*include[ ]*"/p' "../$$i" \
|
${SED} -n '/^#[ ]*include[ ]*"/p' "../$$i" \
|
||||||
>> "skel/$$i"; \
|
>> "skel/$$i"; \
|
||||||
echo '#endif /* '"$$tag"' */' >> "skel/$$i"; \
|
echo '#endif /* '"$$tag"' */' >> "skel/$$i"; \
|
||||||
|
fi; \
|
||||||
done
|
done
|
||||||
-${Q}rm -f skel/sample/makedep.out
|
-${Q}rm -f skel/sample/makedep.out
|
||||||
${Q}echo sample/skel formed
|
${Q}echo sample/skel formed
|
||||||
@@ -412,8 +506,10 @@ depend:
|
|||||||
${Q}echo "# DO NOT DELETE THIS LINE -- make depend depends on it." > \
|
${Q}echo "# DO NOT DELETE THIS LINE -- make depend depends on it." > \
|
||||||
skel/sample/makedep.out
|
skel/sample/makedep.out
|
||||||
${Q}cd skel/sample; ${MAKEDEPEND} -w 1 -f makedep.out -I.. ${C_SRC}
|
${Q}cd skel/sample; ${MAKEDEPEND} -w 1 -f makedep.out -I.. ${C_SRC}
|
||||||
-${Q}for i in ${C_SRC}; do \
|
-${Q}for i in ${C_SRC} /dev/null; do \
|
||||||
|
if [ X"$$i" != X"/dev/null" ]; then \
|
||||||
echo "$$i" | ${SED} 's/^\(.*\)\.c/\1.o: \1.c/'; \
|
echo "$$i" | ${SED} 's/^\(.*\)\.c/\1.o: \1.c/'; \
|
||||||
|
fi; \
|
||||||
done >> skel/sample/makedep.out
|
done >> skel/sample/makedep.out
|
||||||
${Q}echo sample dependency list formed
|
${Q}echo sample dependency list formed
|
||||||
${Q}echo forming new sample/Makefile
|
${Q}echo forming new sample/Makefile
|
||||||
@@ -445,7 +541,7 @@ depend:
|
|||||||
#
|
#
|
||||||
##
|
##
|
||||||
|
|
||||||
echo_install.list: Makefile
|
echo_inst_files: Makefile
|
||||||
|
|
||||||
|
|
||||||
##
|
##
|
||||||
@@ -475,7 +571,6 @@ install: all
|
|||||||
|
|
||||||
# DO NOT DELETE THIS LINE
|
# DO NOT DELETE THIS LINE
|
||||||
|
|
||||||
|
|
||||||
many_random.o: ../alloc.h
|
many_random.o: ../alloc.h
|
||||||
many_random.o: ../block.h
|
many_random.o: ../block.h
|
||||||
many_random.o: ../byteswap.h
|
many_random.o: ../byteswap.h
|
||||||
|
9
seed.c
9
seed.c
@@ -17,8 +17,8 @@
|
|||||||
* received a copy with calc; if not, write to Free Software Foundation, Inc.
|
* received a copy with calc; if not, write to Free Software Foundation, Inc.
|
||||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
* 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
||||||
*
|
*
|
||||||
* @(#) $Revision: 29.5 $
|
* @(#) $Revision: 29.6 $
|
||||||
* @(#) $Id: seed.c,v 29.5 2001/05/08 06:44:29 chongo Exp $
|
* @(#) $Id: seed.c,v 29.6 2003/01/14 00:51:53 chongo Exp $
|
||||||
* @(#) $Source: /usr/local/src/cmd/calc/RCS/seed.c,v $
|
* @(#) $Source: /usr/local/src/cmd/calc/RCS/seed.c,v $
|
||||||
*
|
*
|
||||||
* Under source code control: 1999/10/03 10:06:53
|
* Under source code control: 1999/10/03 10:06:53
|
||||||
@@ -41,6 +41,11 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
|
||||||
|
#include "have_stdlib.h"
|
||||||
|
#if defined(HAVE_STDLIB_H)
|
||||||
|
#include <stdlib.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "have_unistd.h"
|
#include "have_unistd.h"
|
||||||
#if defined(HAVE_UNISTD_H)
|
#if defined(HAVE_UNISTD_H)
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
@@ -1,98 +0,0 @@
|
|||||||
Summary: C-style arbitrary precision calculator
|
|
||||||
Name: calc
|
|
||||||
Version: ${VERSION}
|
|
||||||
Release: ${RELEASE}
|
|
||||||
Copyright: LGPL
|
|
||||||
Group: Applications/Engineering
|
|
||||||
Source: http://www.isthe.com/chongo/src/calc/calc-${VER_CALC}.tar.gz
|
|
||||||
BuildRoot: /var/tmp/%{name}-buildroot
|
|
||||||
|
|
||||||
%description
|
|
||||||
Calc is an interactive calculator which provides for easy large numeric
|
|
||||||
calculations, but which also can be easily programmed for difficult or
|
|
||||||
long calculations.
|
|
||||||
|
|
||||||
All numbers are represented as fractions with arbitrarily large numerators
|
|
||||||
and denominators which are always reduced to lowest terms. Real or
|
|
||||||
exponential format numbers are converted to the equivalent fraction.
|
|
||||||
One use enter decinal, hex, octal, binary and complex values.
|
|
||||||
|
|
||||||
Commands are statements in a C-like language, where each input line is
|
|
||||||
treated as the body of a procedure. You can define your own functions
|
|
||||||
by using the 'define' keyword, followed by a function declaration very
|
|
||||||
similar to C. Calc also comes with a rich set of builtin functions
|
|
||||||
and calc shell commands.
|
|
||||||
|
|
||||||
In addition to numeric global, local and static variables, Calc as
|
|
||||||
lists, associated arrays, matrices, byte blocks, dymanic strings and
|
|
||||||
user defined objects.
|
|
||||||
|
|
||||||
%prep
|
|
||||||
%setup -q
|
|
||||||
|
|
||||||
%build
|
|
||||||
make RPM_OPT_FLAGS="$RPM_OPT_FLAGS"
|
|
||||||
|
|
||||||
%install
|
|
||||||
rm -rf $RPM_BUILD_ROOT
|
|
||||||
mkdir -p $RPM_BUILD_ROOT${BINDIR}
|
|
||||||
mkdir -p $RPM_BUILD_ROOT${SHAREDIR}
|
|
||||||
mkdir -p $RPM_BUILD_ROOT${INCDIR}
|
|
||||||
mkdir -p $RPM_BUILD_ROOT${LIBDIR}
|
|
||||||
mkdir -p $RPM_BUILD_ROOT${CSHAREDIR}
|
|
||||||
mkdir -p $RPM_BUILD_ROOT${HELPDIR}
|
|
||||||
mkdir -p $RPM_BUILD_ROOT${INCDIRCALC}
|
|
||||||
mkdir -p $RPM_BUILD_ROOT${CUSTOMLIBDIR}
|
|
||||||
mkdir -p $RPM_BUILD_ROOT${CUSTOMHELPDIR}
|
|
||||||
mkdir -p $RPM_BUILD_ROOT${CUSTOMINCDIR}
|
|
||||||
mkdir -p $RPM_BUILD_ROOT${SCRIPTDIR}
|
|
||||||
mkdir -p $RPM_BUILD_ROOT${MANDIR}
|
|
||||||
|
|
||||||
install -m 0555 calc $RPM_BUILD_ROOT${BINDIR}
|
|
||||||
|
|
||||||
(cd help
|
|
||||||
install -m 0444 ${STD_HELP_FILES} $RPM_BUILD_ROOT${HELPDIR}
|
|
||||||
install -m 0444 ${BLT_HELP_FILES} $RPM_BUILD_ROOT${HELPDIR}
|
|
||||||
install -m 0444 builtin full $RPM_BUILD_ROOT${HELPDIR}
|
|
||||||
install -m 0444 ${DETAIL_HELP} $RPM_BUILD_ROOT${HELPDIR}
|
|
||||||
install -m 0444 ${SINGULAR_FILES} $RPM_BUILD_ROOT${HELPDIR}
|
|
||||||
install -m 0444 obj.file $RPM_BUILD_ROOT${HELPDIR}/obj
|
|
||||||
)
|
|
||||||
|
|
||||||
(cd cal; install -m 0444 ${CALC_FILES} $RPM_BUILD_ROOT${LIBDIR})
|
|
||||||
|
|
||||||
(cd custom
|
|
||||||
if [ ! -z "${INSTALL_H_SRC}" ]; then
|
|
||||||
install -m 0444 ${INSTALL_H_SRC} $RPM_BUILD_ROOT${CUSTOMINCDIR}
|
|
||||||
fi
|
|
||||||
install -m 0444 ${CUSTOM_CALC_FILES} $RPM_BUILD_ROOT${CUSTOMLIBDIR}
|
|
||||||
install -m 0444 ${CUSTOM_HELP} $RPM_BUILD_ROOT${CUSTOMHELPDIR}
|
|
||||||
if [ ! -z "${ALLOW_CUSTOM}" ]; then
|
|
||||||
install -m 0644 libcustcalc.a $RPM_BUILD_ROOT${CUSTOMLIBDIR}
|
|
||||||
${RANLIB} $RPM_BUILD_ROOT${CUSTOMLIBDIR}
|
|
||||||
fi
|
|
||||||
)
|
|
||||||
|
|
||||||
(cd cscript
|
|
||||||
install -m 0555 ${SCRIPT} $RPM_BUILD_ROOT${SCRIPTDIR}
|
|
||||||
)
|
|
||||||
|
|
||||||
install -m 0444 libcalc.a $RPM_BUILD_ROOT${LIBDIR}
|
|
||||||
${RANLIB} $RPM_BUILD_ROOT${LIBDIR}
|
|
||||||
install -m 0444 ${LIB_H_SRC} $RPM_BUILD_ROOT${INCDIRCALC}
|
|
||||||
install -m 0444 ${BUILD_H_SRC} $RPM_BUILD_ROOT${INCDIRCALC}
|
|
||||||
install -m 0444 calc.1 $RPM_BUILD_ROOT${MANDIR}.${MANEXT}
|
|
||||||
|
|
||||||
%clean
|
|
||||||
rm -rf $RPM_BUILD_ROOT
|
|
||||||
|
|
||||||
%files -f install.list
|
|
||||||
%defattr(-,root,root)
|
|
||||||
%doc BUGS README COPYING COPYING-LGPL HOWTO.INSTALL
|
|
||||||
%doc README LIBRARY README.WINDOWS calc.1
|
|
||||||
%doc help/resource help/errorcodes help/custom_cal help/new_custom
|
|
||||||
%doc help/cscript help/full
|
|
||||||
|
|
||||||
%changelog
|
|
||||||
* ${DATE} Landon Curt Noll <http://www.isthe.com/chongo/index.html>
|
|
||||||
- calc version ${VER_CALC}
|
|
6
string.h
6
string.h
@@ -17,8 +17,8 @@
|
|||||||
* received a copy with calc; if not, write to Free Software Foundation, Inc.
|
* received a copy with calc; if not, write to Free Software Foundation, Inc.
|
||||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
* 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
||||||
*
|
*
|
||||||
* @(#) $Revision: 29.3 $
|
* @(#) $Revision: 29.4 $
|
||||||
* @(#) $Id: string.h,v 29.3 2001/05/29 00:16:53 chongo Exp $
|
* @(#) $Id: string.h,v 29.4 2001/06/08 21:00:58 chongo Exp $
|
||||||
* @(#) $Source: /usr/local/src/cmd/calc/RCS/string.h,v $
|
* @(#) $Source: /usr/local/src/cmd/calc/RCS/string.h,v $
|
||||||
*
|
*
|
||||||
* Under source code control: 1990/02/15 01:48:36
|
* Under source code control: 1990/02/15 01:48:36
|
||||||
@@ -32,7 +32,7 @@
|
|||||||
#define __CALCSTRING_H__
|
#define __CALCSTRING_H__
|
||||||
|
|
||||||
|
|
||||||
#if defined(SRC) /* if we are building from the calc source tree */
|
#if defined(CALC_SRC) /* if we are building from the calc source tree */
|
||||||
# include "zmath.h"
|
# include "zmath.h"
|
||||||
#else
|
#else
|
||||||
# include <calc/zmath.h>
|
# include <calc/zmath.h>
|
||||||
|
6
symbol.h
6
symbol.h
@@ -17,8 +17,8 @@
|
|||||||
* received a copy with calc; if not, write to Free Software Foundation, Inc.
|
* received a copy with calc; if not, write to Free Software Foundation, Inc.
|
||||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
* 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
||||||
*
|
*
|
||||||
* @(#) $Revision: 29.3 $
|
* @(#) $Revision: 29.4 $
|
||||||
* @(#) $Id: symbol.h,v 29.3 2001/05/29 00:16:53 chongo Exp $
|
* @(#) $Id: symbol.h,v 29.4 2001/06/08 21:00:58 chongo Exp $
|
||||||
* @(#) $Source: /usr/local/src/cmd/calc/RCS/symbol.h,v $
|
* @(#) $Source: /usr/local/src/cmd/calc/RCS/symbol.h,v $
|
||||||
*
|
*
|
||||||
* Under source code control: 1990/02/15 01:48:37
|
* Under source code control: 1990/02/15 01:48:37
|
||||||
@@ -32,7 +32,7 @@
|
|||||||
#define __SYMBOL_H__
|
#define __SYMBOL_H__
|
||||||
|
|
||||||
|
|
||||||
#if defined(SRC) /* if we are building from the calc source tree */
|
#if defined(CALC_SRC) /* if we are building from the calc source tree */
|
||||||
# include "zmath.h"
|
# include "zmath.h"
|
||||||
#else
|
#else
|
||||||
# include <calc/zmath.h>
|
# include <calc/zmath.h>
|
||||||
|
6
token.h
6
token.h
@@ -17,8 +17,8 @@
|
|||||||
* received a copy with calc; if not, write to Free Software Foundation, Inc.
|
* received a copy with calc; if not, write to Free Software Foundation, Inc.
|
||||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
* 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
||||||
*
|
*
|
||||||
* @(#) $Revision: 29.3 $
|
* @(#) $Revision: 29.4 $
|
||||||
* @(#) $Id: token.h,v 29.3 2001/05/29 00:16:53 chongo Exp $
|
* @(#) $Id: token.h,v 29.4 2001/06/08 21:00:58 chongo Exp $
|
||||||
* @(#) $Source: /usr/local/src/cmd/calc/RCS/token.h,v $
|
* @(#) $Source: /usr/local/src/cmd/calc/RCS/token.h,v $
|
||||||
*
|
*
|
||||||
* Under source code control: 1990/02/15 01:48:37
|
* Under source code control: 1990/02/15 01:48:37
|
||||||
@@ -32,7 +32,7 @@
|
|||||||
#define __TOKEN_H__
|
#define __TOKEN_H__
|
||||||
|
|
||||||
|
|
||||||
#if defined(SRC) /* if we are building from the calc source tree */
|
#if defined(CALC_SRC) /* if we are building from the calc source tree */
|
||||||
# include "zmath.h"
|
# include "zmath.h"
|
||||||
#else
|
#else
|
||||||
# include <calc/zmath.h>
|
# include <calc/zmath.h>
|
||||||
|
6
value.h
6
value.h
@@ -17,8 +17,8 @@
|
|||||||
* received a copy with calc; if not, write to Free Software Foundation, Inc.
|
* received a copy with calc; if not, write to Free Software Foundation, Inc.
|
||||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
* 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
||||||
*
|
*
|
||||||
* @(#) $Revision: 29.6 $
|
* @(#) $Revision: 29.7 $
|
||||||
* @(#) $Id: value.h,v 29.6 2001/05/29 00:16:53 chongo Exp $
|
* @(#) $Id: value.h,v 29.7 2001/06/08 21:00:58 chongo Exp $
|
||||||
* @(#) $Source: /usr/local/src/cmd/calc/RCS/value.h,v $
|
* @(#) $Source: /usr/local/src/cmd/calc/RCS/value.h,v $
|
||||||
*
|
*
|
||||||
* Under source code control: 1993/07/30 19:42:47
|
* Under source code control: 1993/07/30 19:42:47
|
||||||
@@ -32,7 +32,7 @@
|
|||||||
#define __VALUE_H__
|
#define __VALUE_H__
|
||||||
|
|
||||||
|
|
||||||
#if defined(SRC) /* if we are building from the calc source tree */
|
#if defined(CALC_SRC) /* if we are building from the calc source tree */
|
||||||
# include "win32dll.h"
|
# include "win32dll.h"
|
||||||
# include "cmath.h"
|
# include "cmath.h"
|
||||||
# include "config.h"
|
# include "config.h"
|
||||||
|
186
version.c
186
version.c
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* version - determine the version of calc
|
* version - determine the version of calc
|
||||||
*
|
*
|
||||||
* Copyright (C) 1999 David I. Bell and Landon Curt Noll
|
* Copyright (C) 1999-2002 David I. Bell and Landon Curt Noll
|
||||||
*
|
*
|
||||||
* Primary author: David I. Bell
|
* Primary author: David I. Bell
|
||||||
*
|
*
|
||||||
@@ -19,8 +19,8 @@
|
|||||||
* received a copy with calc; if not, write to Free Software Foundation, Inc.
|
* received a copy with calc; if not, write to Free Software Foundation, Inc.
|
||||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
* 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
||||||
*
|
*
|
||||||
* @(#) $Revision: 29.29 $
|
* @(#) $Revision: 29.43 $
|
||||||
* @(#) $Id: version.c,v 29.29 2001/06/01 21:44:44 chongo Exp $
|
* @(#) $Id: version.c,v 29.43 2003/01/14 04:10:16 chongo Exp $
|
||||||
* @(#) $Source: /usr/local/src/cmd/calc/RCS/version.c,v $
|
* @(#) $Source: /usr/local/src/cmd/calc/RCS/version.c,v $
|
||||||
*
|
*
|
||||||
* Under source code control: 1990/05/22 11:00:58
|
* Under source code control: 1990/05/22 11:00:58
|
||||||
@@ -32,6 +32,9 @@
|
|||||||
|
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include <errno.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
#if defined(CALC_VER)
|
#if defined(CALC_VER)
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
@@ -42,8 +45,9 @@ static char *program;
|
|||||||
|
|
||||||
#define MAJOR_VER 2 /* major version */
|
#define MAJOR_VER 2 /* major version */
|
||||||
#define MINOR_VER 11 /* minor version */
|
#define MINOR_VER 11 /* minor version */
|
||||||
#define MAJOR_PATCH 5 /* patch level or 0 if no patch */
|
#define MAJOR_PATCH 6 /* patch level or 0 if no patch */
|
||||||
#define MINOR_PATCH "4.3" /* test number or empty string if no patch */
|
#define MINOR_PATCH 2 /* test number or 0 if no minor patch */
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* calc version constants
|
* calc version constants
|
||||||
@@ -51,7 +55,7 @@ static char *program;
|
|||||||
int calc_major_ver = MAJOR_VER;
|
int calc_major_ver = MAJOR_VER;
|
||||||
int calc_minor_ver = MINOR_VER;
|
int calc_minor_ver = MINOR_VER;
|
||||||
int calc_major_patch = MAJOR_PATCH;
|
int calc_major_patch = MAJOR_PATCH;
|
||||||
char *calc_minor_patch = MINOR_PATCH;
|
int calc_minor_patch = MINOR_PATCH;
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -89,13 +93,29 @@ char *Copyright = "\n"
|
|||||||
"\n";
|
"\n";
|
||||||
|
|
||||||
|
|
||||||
|
#if !defined(HAVE_SNPRINTF)
|
||||||
|
/* Simulate snprintf with vsprintf, hoping that BUFSIZ is large enough. */
|
||||||
|
#include <stdarg.h>
|
||||||
|
int
|
||||||
|
snprintf (char *buf, size_t n, const char *fmt, ...)
|
||||||
|
{
|
||||||
|
int retval;
|
||||||
|
va_list arg;
|
||||||
|
|
||||||
|
va_start (arg, fmt);
|
||||||
|
retval = vsprintf (buf, fmt, arg);
|
||||||
|
va_end (arg);
|
||||||
|
return retval;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* version - return version string
|
* version - return version string
|
||||||
*
|
*
|
||||||
* This function returns a malloced version string. This version
|
* This function returns a malloced version string. This version
|
||||||
* string does not contain the title, just:
|
* string does not contain the title, just:
|
||||||
*
|
*
|
||||||
* x.y.ztw
|
* x.y.z.w
|
||||||
* x.y.z
|
* x.y.z
|
||||||
* x.y
|
* x.y
|
||||||
*/
|
*/
|
||||||
@@ -114,15 +134,17 @@ version(void)
|
|||||||
/*
|
/*
|
||||||
* form the version buffer
|
* form the version buffer
|
||||||
*/
|
*/
|
||||||
if (sizeof(MINOR_PATCH) > 1) {
|
if (MINOR_PATCH > 0) {
|
||||||
sprintf(verbuf,
|
snprintf(verbuf, BUFSIZ,
|
||||||
"%d.%d.%dt%s", calc_major_ver, calc_minor_ver,
|
"%d.%d.%d.%d", calc_major_ver, calc_minor_ver,
|
||||||
calc_major_patch, calc_minor_patch);
|
calc_major_patch, calc_minor_patch);
|
||||||
} else if (MAJOR_PATCH > 0) {
|
} else if (MAJOR_PATCH > 0) {
|
||||||
sprintf(verbuf,
|
snprintf(verbuf, BUFSIZ,
|
||||||
"%d.%d.%d", calc_major_ver, calc_minor_ver, calc_major_patch);
|
"%d.%d.%d", calc_major_ver,
|
||||||
|
calc_minor_ver, calc_major_patch);
|
||||||
} else {
|
} else {
|
||||||
sprintf(verbuf, "%d.%d", calc_major_ver, calc_minor_ver);
|
snprintf(verbuf, BUFSIZ,
|
||||||
|
"%d.%d", calc_major_ver, calc_minor_ver);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -131,7 +153,7 @@ version(void)
|
|||||||
stored_version = (char *)malloc(strlen(verbuf)+1);
|
stored_version = (char *)malloc(strlen(verbuf)+1);
|
||||||
if (stored_version == NULL) {
|
if (stored_version == NULL) {
|
||||||
fprintf(stderr, "%s: version formation value\n", program);
|
fprintf(stderr, "%s: version formation value\n", program);
|
||||||
exit(2);
|
exit(1);
|
||||||
}
|
}
|
||||||
strcpy(stored_version, verbuf);
|
strcpy(stored_version, verbuf);
|
||||||
|
|
||||||
@@ -146,76 +168,123 @@ version(void)
|
|||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* print_rpm_version_release - print the rpm style version-release
|
* print_rpm_version - print just the version string, rpm style
|
||||||
*
|
*
|
||||||
* This function prints a version-release string, rpm style:
|
* This function prints a version string, rpm style:
|
||||||
*
|
*
|
||||||
* x.y.z-w
|
* x.y.z.w-r
|
||||||
* x.y.z-0
|
* x.y.z-r
|
||||||
* x.y-0
|
* x.y-r
|
||||||
|
*
|
||||||
|
* where 'r' comes from the content of the release file.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
print_rpm_version_release(void)
|
print_rpm_version(char *release)
|
||||||
{
|
{
|
||||||
|
FILE *file; /* open file */
|
||||||
|
char buf[BUFSIZ+1]; /* release file buffer */
|
||||||
|
char *p;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* obtain the release
|
||||||
|
*/
|
||||||
|
file = fopen(release, "r");
|
||||||
|
if (file == NULL) {
|
||||||
|
fprintf(stderr, "%s: cannot open %s: %s\n",
|
||||||
|
program, release, strerror(errno));
|
||||||
|
exit(2);
|
||||||
|
}
|
||||||
|
buf[BUFSIZ] = '\0';
|
||||||
|
if (fgets(buf, BUFSIZ, file) == NULL) {
|
||||||
|
fprintf(stderr, "%s: cannot read %s: %s\n",
|
||||||
|
program, release, strerror(errno));
|
||||||
|
exit(3);
|
||||||
|
}
|
||||||
|
p = strchr(buf, '\n');
|
||||||
|
if (p != NULL) {
|
||||||
|
*p = '\0';
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* form the version buffer
|
* form the version buffer
|
||||||
*/
|
*/
|
||||||
if (sizeof(MINOR_PATCH) > 1) {
|
if (MINOR_PATCH > 0) {
|
||||||
printf("%d.%d.%d-%s\n", calc_major_ver, calc_minor_ver,
|
printf("%d.%d.%d.%d-%s\n", calc_major_ver, calc_minor_ver,
|
||||||
calc_major_patch, calc_minor_patch);
|
calc_major_patch, calc_minor_patch, buf);
|
||||||
} else if (MAJOR_PATCH > 0) {
|
} else if (MAJOR_PATCH > 0) {
|
||||||
printf("%d.%d.%d-0\n", calc_major_ver, calc_minor_ver,
|
printf("%d.%d.%d-%s\n", calc_major_ver, calc_minor_ver,
|
||||||
calc_major_patch);
|
calc_major_patch, buf);
|
||||||
} else {
|
} else {
|
||||||
printf("%d.%d-0\n", calc_major_ver, calc_minor_ver);
|
printf("%d.%d-%s\n", calc_major_ver, calc_minor_ver, buf);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* print_rpm_version - print just the version string, rpm style
|
* print_rpm_major - print just the major part version string
|
||||||
*
|
*
|
||||||
* This function prints a version string, rpm style:
|
* This function prints the major part version string:
|
||||||
*
|
*
|
||||||
* x.y.z
|
* x.y.z
|
||||||
* x.y
|
* x.y
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
print_rpm_version(void)
|
print_rpm_major(void)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* form the version buffer
|
* form the version buffer
|
||||||
*/
|
*/
|
||||||
if (MAJOR_PATCH > 0) {
|
if (MAJOR_PATCH > 0) {
|
||||||
printf("%d.%d.%d\n", calc_major_ver, calc_minor_ver,
|
printf("%d.%d.%d\n", calc_major_ver, calc_minor_ver,
|
||||||
calc_major_patch);
|
calc_major_patch);
|
||||||
} else {
|
} else {
|
||||||
printf("%d.%d\n", calc_major_ver, calc_minor_ver);
|
printf("%d.%d\n", calc_major_ver, calc_minor_ver);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* print_rpm_release - print just the release string, rpm style
|
* print_rpm_release - print just the rpm release
|
||||||
*
|
*
|
||||||
* This function prints a release string, rpm style:
|
* This function prints the rpm release:
|
||||||
*
|
*
|
||||||
* w
|
* r
|
||||||
* 0
|
*
|
||||||
|
* where 'r' comes from the content of the release file.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
print_rpm_release(void)
|
print_rpm_release(char *release)
|
||||||
{
|
{
|
||||||
|
FILE *file; /* open file */
|
||||||
|
char buf[BUFSIZ+1]; /* release file buffer */
|
||||||
|
char *p;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* obtain the release
|
||||||
|
*/
|
||||||
|
file = fopen(release, "r");
|
||||||
|
if (file == NULL) {
|
||||||
|
fprintf(stderr, "%s: cannot open %s: %s\n",
|
||||||
|
program, release, strerror(errno));
|
||||||
|
exit(2);
|
||||||
|
}
|
||||||
|
buf[BUFSIZ] = '\0';
|
||||||
|
if (fgets(buf, BUFSIZ, file) == NULL) {
|
||||||
|
fprintf(stderr, "%s: cannot read %s: %s\n",
|
||||||
|
program, release, strerror(errno));
|
||||||
|
exit(3);
|
||||||
|
}
|
||||||
|
p = strchr(buf, '\n');
|
||||||
|
if (p != NULL) {
|
||||||
|
*p = '\0';
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* form the version buffer
|
* form the version buffer
|
||||||
*/
|
*/
|
||||||
if (sizeof(MINOR_PATCH) > 1) {
|
printf("%s\n", buf);
|
||||||
printf("%s\n", calc_minor_patch);
|
|
||||||
} else {
|
|
||||||
printf("0\n");
|
|
||||||
}
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -227,17 +296,26 @@ print_rpm_release(void)
|
|||||||
int
|
int
|
||||||
main(int argc, char *argv[])
|
main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
program = argv[0];
|
program = argv[0];
|
||||||
if (argc == 2 && strcmp(argv[1], "-R") == 0) {
|
if (argc == 3 && strcmp(argv[1], "-r") == 0) {
|
||||||
print_rpm_version_release();
|
print_rpm_version(argv[2]);
|
||||||
} else if (argc == 2 && strcmp(argv[1], "-v") == 0) {
|
|
||||||
print_rpm_version();
|
} else if (argc == 3 && strcmp(argv[1], "-R") == 0) {
|
||||||
} else if (argc == 2 && strcmp(argv[1], "-r") == 0) {
|
print_rpm_release(argv[2]);
|
||||||
print_rpm_release();
|
|
||||||
} else {
|
} else if (argc == 2 && strcmp(argv[1], "-V") == 0) {
|
||||||
printf("%s\n", version());
|
print_rpm_major();
|
||||||
}
|
|
||||||
return 0;
|
} else if (argc == 1) {
|
||||||
|
printf("%s\n", version());
|
||||||
|
|
||||||
|
} else {
|
||||||
|
fprintf(stderr,
|
||||||
|
"usage: %s [-V] [-R release_file] [-r release_file]\n",
|
||||||
|
program);
|
||||||
|
exit(4);
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* CALC_VER */
|
#endif /* CALC_VER */
|
||||||
|
@@ -36,8 +36,8 @@ HAVE_UNISTD_H=NO
|
|||||||
|
|
||||||
LIBDIR=/lib/calc
|
LIBDIR=/lib/calc
|
||||||
HELPDIR=/lib/calc/help
|
HELPDIR=/lib/calc/help
|
||||||
INCDIRCALC=/include/calc
|
CALC_INCDIR=/include/calc
|
||||||
CUSTOMLIBDIR=/lib/calc/custom
|
CUSTOMCALDIR=/lib/calc/custom
|
||||||
CUSTOMHELPDIR=/lib/calc/help/custhelp
|
CUSTOMHELPDIR=/lib/calc/help/custhelp
|
||||||
SCRIPTDIR=/lib/calc/cscript
|
SCRIPTDIR=/lib/calc/cscript
|
||||||
MANDIR=
|
MANDIR=
|
||||||
|
@@ -7,7 +7,7 @@
|
|||||||
#define __HAVE_MALLOC_H__
|
#define __HAVE_MALLOC_H__
|
||||||
|
|
||||||
|
|
||||||
/* do we have /usr/include/malloc.h? */
|
/* do we have <malloc.h>? */
|
||||||
#define HAVE_MALLOC_H /* yes */
|
#define HAVE_MALLOC_H /* yes */
|
||||||
|
|
||||||
|
|
||||||
|
@@ -7,7 +7,7 @@
|
|||||||
#define __HAVE_STDLIB_H__
|
#define __HAVE_STDLIB_H__
|
||||||
|
|
||||||
|
|
||||||
/* do we have /usr/include/stdlib.h? */
|
/* do we have <stdlib.h>? */
|
||||||
#define HAVE_STDLIB_H /* yes */
|
#define HAVE_STDLIB_H /* yes */
|
||||||
|
|
||||||
|
|
||||||
|
@@ -7,7 +7,7 @@
|
|||||||
#define __HAVE_STRING_H__
|
#define __HAVE_STRING_H__
|
||||||
|
|
||||||
|
|
||||||
/* do we have /usr/include/string.h? */
|
/* do we have <string.h>? */
|
||||||
#define HAVE_STRING_H /* yes */
|
#define HAVE_STRING_H /* yes */
|
||||||
|
|
||||||
|
|
||||||
|
@@ -7,7 +7,7 @@
|
|||||||
#define __HAVE_TIMES_H__
|
#define __HAVE_TIMES_H__
|
||||||
|
|
||||||
|
|
||||||
/* do we have /usr/include/times.h? */
|
/* do we have <times.h>? */
|
||||||
#undef HAVE_TIMES_H /* no */
|
#undef HAVE_TIMES_H /* no */
|
||||||
#undef HAVE_SYS_TIMES_H /* no */
|
#undef HAVE_SYS_TIMES_H /* no */
|
||||||
#define HAVE_TIME_H /* yes */
|
#define HAVE_TIME_H /* yes */
|
||||||
|
@@ -7,7 +7,7 @@
|
|||||||
#define __HAVE_UNISTD_H__
|
#define __HAVE_UNISTD_H__
|
||||||
|
|
||||||
|
|
||||||
/* do we have /usr/include/unistd.h? */
|
/* do we have <unistd.h>? */
|
||||||
#undef HAVE_UNISTD_H /* no */
|
#undef HAVE_UNISTD_H /* no */
|
||||||
|
|
||||||
|
|
||||||
|
28
zio.c
28
zio.c
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* zio - scanf and printf routines for arbitrary precision integers
|
* zio - scanf and printf routines for arbitrary precision integers
|
||||||
*
|
*
|
||||||
* Copyright (C) 1999 David I. Bell
|
* Copyright (C) 1999-2002 David I. Bell
|
||||||
*
|
*
|
||||||
* Calc is open software; you can redistribute it and/or modify it under
|
* Calc is open software; you can redistribute it and/or modify it under
|
||||||
* the terms of the version 2.1 of the GNU Lesser General Public License
|
* the terms of the version 2.1 of the GNU Lesser General Public License
|
||||||
@@ -17,8 +17,8 @@
|
|||||||
* received a copy with calc; if not, write to Free Software Foundation, Inc.
|
* received a copy with calc; if not, write to Free Software Foundation, Inc.
|
||||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
* 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
||||||
*
|
*
|
||||||
* @(#) $Revision: 29.3 $
|
* @(#) $Revision: 29.4 $
|
||||||
* @(#) $Id: zio.c,v 29.3 2000/07/17 15:35:49 chongo Exp $
|
* @(#) $Id: zio.c,v 29.4 2002/12/29 09:20:25 chongo Exp $
|
||||||
* @(#) $Source: /usr/local/src/cmd/calc/RCS/zio.c,v $
|
* @(#) $Source: /usr/local/src/cmd/calc/RCS/zio.c,v $
|
||||||
*
|
*
|
||||||
* Under source code control: 1993/07/30 19:42:48
|
* Under source code control: 1993/07/30 19:42:48
|
||||||
@@ -52,6 +52,7 @@ struct iostate {
|
|||||||
IOSTATE *oldiostates; /* previous saved state */
|
IOSTATE *oldiostates; /* previous saved state */
|
||||||
long outdigits; /* digits for output */
|
long outdigits; /* digits for output */
|
||||||
int outmode; /* output mode */
|
int outmode; /* output mode */
|
||||||
|
int outmode2; /* secondary output mode */
|
||||||
FILE *outfp; /* file unit for output (if any) */
|
FILE *outfp; /* file unit for output (if any) */
|
||||||
char *outbuf; /* output string buffer (if any) */
|
char *outbuf; /* output string buffer (if any) */
|
||||||
long outbufsize; /* current size of string buffer */
|
long outbufsize; /* current size of string buffer */
|
||||||
@@ -214,6 +215,7 @@ math_divertio(void)
|
|||||||
sp->oldiostates = oldiostates;
|
sp->oldiostates = oldiostates;
|
||||||
sp->outdigits = conf->outdigits;
|
sp->outdigits = conf->outdigits;
|
||||||
sp->outmode = conf->outmode;
|
sp->outmode = conf->outmode;
|
||||||
|
sp->outmode2 = conf->outmode2;
|
||||||
sp->outfp = outfp;
|
sp->outfp = outfp;
|
||||||
sp->outbuf = outbuf;
|
sp->outbuf = outbuf;
|
||||||
sp->outbufsize = outbufsize;
|
sp->outbufsize = outbufsize;
|
||||||
@@ -254,6 +256,7 @@ math_getdivertedio(void)
|
|||||||
oldiostates = sp->oldiostates;
|
oldiostates = sp->oldiostates;
|
||||||
conf->outdigits = sp->outdigits;
|
conf->outdigits = sp->outdigits;
|
||||||
conf->outmode = sp->outmode;
|
conf->outmode = sp->outmode;
|
||||||
|
conf->outmode2 = sp->outmode2;
|
||||||
outfp = sp->outfp;
|
outfp = sp->outfp;
|
||||||
outbuf = sp->outbuf;
|
outbuf = sp->outbuf;
|
||||||
outbufsize = sp->outbufsize;
|
outbufsize = sp->outbufsize;
|
||||||
@@ -314,6 +317,25 @@ math_setmode(int newmode)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Set the secondary output mode for numeric output.
|
||||||
|
* This also returns the previous mode.
|
||||||
|
*/
|
||||||
|
int
|
||||||
|
math_setmode2(int newmode)
|
||||||
|
{
|
||||||
|
int oldmode;
|
||||||
|
|
||||||
|
if (newmode != MODE2_OFF && ((newmode <= MODE_DEFAULT) || (newmode > MODE_MAX))) {
|
||||||
|
math_error("Setting illegal secondary output mode");
|
||||||
|
/*NOTREACHED*/
|
||||||
|
}
|
||||||
|
oldmode = conf->outmode2;
|
||||||
|
conf->outmode2 = newmode;
|
||||||
|
return oldmode;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Set the number of digits for float or exponential output.
|
* Set the number of digits for float or exponential output.
|
||||||
* This also returns the previous number of digits.
|
* This also returns the previous number of digits.
|
||||||
|
13
zmath.h
13
zmath.h
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* zmath - declarations for extended precision integer arithmetic
|
* zmath - declarations for extended precision integer arithmetic
|
||||||
*
|
*
|
||||||
* Copyright (C) 1999 David I. Bell
|
* Copyright (C) 1999-2002 David I. Bell
|
||||||
*
|
*
|
||||||
* Calc is open software; you can redistribute it and/or modify it under
|
* Calc is open software; you can redistribute it and/or modify it under
|
||||||
* the terms of the version 2.1 of the GNU Lesser General Public License
|
* the terms of the version 2.1 of the GNU Lesser General Public License
|
||||||
@@ -17,8 +17,8 @@
|
|||||||
* received a copy with calc; if not, write to Free Software Foundation, Inc.
|
* received a copy with calc; if not, write to Free Software Foundation, Inc.
|
||||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
* 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
||||||
*
|
*
|
||||||
* @(#) $Revision: 29.6 $
|
* @(#) $Revision: 29.10 $
|
||||||
* @(#) $Id: zmath.h,v 29.6 2001/05/29 00:16:53 chongo Exp $
|
* @(#) $Id: zmath.h,v 29.10 2003/01/14 00:44:39 chongo Exp $
|
||||||
* @(#) $Source: /usr/local/src/cmd/calc/RCS/zmath.h,v $
|
* @(#) $Source: /usr/local/src/cmd/calc/RCS/zmath.h,v $
|
||||||
*
|
*
|
||||||
* Under source code control: 1993/07/30 19:42:48
|
* Under source code control: 1993/07/30 19:42:48
|
||||||
@@ -38,7 +38,7 @@
|
|||||||
#define __ZMATH_H__
|
#define __ZMATH_H__
|
||||||
|
|
||||||
|
|
||||||
#if defined(SRC) /* if we are building from the calc source tree */
|
#if defined(CALC_SRC) /* if we are building from the calc source tree */
|
||||||
# include "win32dll.h"
|
# include "win32dll.h"
|
||||||
# include "alloc.h"
|
# include "alloc.h"
|
||||||
# include "endian_calc.h"
|
# include "endian_calc.h"
|
||||||
@@ -131,7 +131,7 @@ typedef SB32 SFULL; /* signed FULL */
|
|||||||
|
|
||||||
#define TOPFULL ((FULL)1 << (FULL_BITS-1)) /* highest bit in FULL */
|
#define TOPFULL ((FULL)1 << (FULL_BITS-1)) /* highest bit in FULL */
|
||||||
#define MAXFULL (TOPFULL - (FULL)1) /* largest SFULL value */
|
#define MAXFULL (TOPFULL - (FULL)1) /* largest SFULL value */
|
||||||
#define MAXUFULL (MAXFULL | TOPHALF) /* largest FULL value */
|
#define MAXUFULL (MAXFULL | TOPFULL) /* largest FULL value */
|
||||||
|
|
||||||
#define TOPLONG ((unsigned long)1 << (LONG_BITS-1)) /* top long bit */
|
#define TOPLONG ((unsigned long)1 << (LONG_BITS-1)) /* top long bit */
|
||||||
#define MAXLONG ((long) (TOPLONG - (unsigned long)1)) /* largest long val */
|
#define MAXLONG ((long) (TOPLONG - (unsigned long)1)) /* largest long val */
|
||||||
@@ -552,8 +552,10 @@ extern DLL void zredcpower(REDC *rp, ZVALUE z1, ZVALUE z2, ZVALUE *res);
|
|||||||
#define MODE_OCTAL 6
|
#define MODE_OCTAL 6
|
||||||
#define MODE_BINARY 7
|
#define MODE_BINARY 7
|
||||||
#define MODE_MAX 7
|
#define MODE_MAX 7
|
||||||
|
#define MODE2_OFF (MODE_MAX+1)
|
||||||
|
|
||||||
#define MODE_INITIAL MODE_REAL
|
#define MODE_INITIAL MODE_REAL
|
||||||
|
#define MODE2_INITIAL MODE2_OFF
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -567,6 +569,7 @@ extern DLL void math_divertio(void);
|
|||||||
extern DLL void math_cleardiversions(void);
|
extern DLL void math_cleardiversions(void);
|
||||||
extern DLL char *math_getdivertedio(void);
|
extern DLL char *math_getdivertedio(void);
|
||||||
extern DLL int math_setmode(int mode);
|
extern DLL int math_setmode(int mode);
|
||||||
|
extern DLL int math_setmode2(int mode);
|
||||||
extern DLL LEN math_setdigits(LEN digits);
|
extern DLL LEN math_setdigits(LEN digits);
|
||||||
extern DLL void math_fmt(char *, ...);
|
extern DLL void math_fmt(char *, ...);
|
||||||
|
|
||||||
|
5
zrand.c
5
zrand.c
@@ -17,8 +17,8 @@
|
|||||||
* received a copy with calc; if not, write to Free Software Foundation, Inc.
|
* received a copy with calc; if not, write to Free Software Foundation, Inc.
|
||||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
* 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
||||||
*
|
*
|
||||||
* @(#) $Revision: 29.4 $
|
* @(#) $Revision: 29.5 $
|
||||||
* @(#) $Id: zrand.c,v 29.4 2001/05/08 06:44:29 chongo Exp $
|
* @(#) $Id: zrand.c,v 29.5 2003/01/14 00:54:24 chongo Exp $
|
||||||
* @(#) $Source: /usr/local/src/cmd/calc/RCS/zrand.c,v $
|
* @(#) $Source: /usr/local/src/cmd/calc/RCS/zrand.c,v $
|
||||||
*
|
*
|
||||||
* Under source code control: 1995/01/07 09:45:25
|
* Under source code control: 1995/01/07 09:45:25
|
||||||
@@ -353,6 +353,7 @@
|
|||||||
* (used by more than one input seed).
|
* (used by more than one input seed).
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
#include "zrand.h"
|
#include "zrand.h"
|
||||||
#include "have_const.h"
|
#include "have_const.h"
|
||||||
|
6
zrand.h
6
zrand.h
@@ -17,8 +17,8 @@
|
|||||||
* received a copy with calc; if not, write to Free Software Foundation, Inc.
|
* received a copy with calc; if not, write to Free Software Foundation, Inc.
|
||||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
* 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
||||||
*
|
*
|
||||||
* @(#) $Revision: 29.4 $
|
* @(#) $Revision: 29.5 $
|
||||||
* @(#) $Id: zrand.h,v 29.4 2001/05/29 00:16:53 chongo Exp $
|
* @(#) $Id: zrand.h,v 29.5 2001/06/08 21:00:58 chongo Exp $
|
||||||
* @(#) $Source: /usr/local/src/cmd/calc/RCS/zrand.h,v $
|
* @(#) $Source: /usr/local/src/cmd/calc/RCS/zrand.h,v $
|
||||||
*
|
*
|
||||||
* Under source code control: 1995/01/07 09:45:26
|
* Under source code control: 1995/01/07 09:45:26
|
||||||
@@ -37,7 +37,7 @@
|
|||||||
#define __ZRAND_H__
|
#define __ZRAND_H__
|
||||||
|
|
||||||
|
|
||||||
#if defined(SRC) /* if we are building from the calc source tree */
|
#if defined(CALC_SRC) /* if we are building from the calc source tree */
|
||||||
# include "value.h"
|
# include "value.h"
|
||||||
# include "have_const.h"
|
# include "have_const.h"
|
||||||
#else
|
#else
|
||||||
|
@@ -17,8 +17,8 @@
|
|||||||
* received a copy with calc; if not, write to Free Software Foundation, Inc.
|
* received a copy with calc; if not, write to Free Software Foundation, Inc.
|
||||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
* 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
||||||
*
|
*
|
||||||
* @(#) $Revision: 29.3 $
|
* @(#) $Revision: 29.4 $
|
||||||
* @(#) $Id: zrandom.c,v 29.3 2001/05/08 06:44:29 chongo Exp $
|
* @(#) $Id: zrandom.c,v 29.4 2002/12/29 06:35:08 chongo Exp $
|
||||||
* @(#) $Source: /usr/local/src/cmd/calc/RCS/zrandom.c,v $
|
* @(#) $Source: /usr/local/src/cmd/calc/RCS/zrandom.c,v $
|
||||||
*
|
*
|
||||||
* Under source code control: 1997/02/15 04:01:56
|
* Under source code control: 1997/02/15 04:01:56
|
||||||
@@ -2280,7 +2280,7 @@ zrandomrange(CONST ZVALUE low, CONST ZVALUE high, ZVALUE *res)
|
|||||||
zsub(high, low, &range);
|
zsub(high, low, &range);
|
||||||
if (zisone(range)) {
|
if (zisone(range)) {
|
||||||
zfree_random(range);
|
zfree_random(range);
|
||||||
*res = low;
|
zcopy(low, res);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
zsub(range, _one_, &rangem1);
|
zsub(range, _one_, &rangem1);
|
||||||
|
@@ -17,8 +17,8 @@
|
|||||||
* received a copy with calc; if not, write to Free Software Foundation, Inc.
|
* received a copy with calc; if not, write to Free Software Foundation, Inc.
|
||||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
* 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
||||||
*
|
*
|
||||||
* @(#) $Revision: 29.3 $
|
* @(#) $Revision: 29.4 $
|
||||||
* @(#) $Id: zrandom.h,v 29.3 2001/05/29 00:16:53 chongo Exp $
|
* @(#) $Id: zrandom.h,v 29.4 2001/06/08 21:00:58 chongo Exp $
|
||||||
* @(#) $Source: /usr/local/src/cmd/calc/RCS/zrandom.h,v $
|
* @(#) $Source: /usr/local/src/cmd/calc/RCS/zrandom.h,v $
|
||||||
*
|
*
|
||||||
* Under source code control: 1997/02/15 04:01:56
|
* Under source code control: 1997/02/15 04:01:56
|
||||||
@@ -33,7 +33,7 @@
|
|||||||
#define __ZRANDOM_H__
|
#define __ZRANDOM_H__
|
||||||
|
|
||||||
|
|
||||||
#if defined(SRC) /* if we are building from the calc source tree */
|
#if defined(CALC_SRC) /* if we are building from the calc source tree */
|
||||||
# include "value.h"
|
# include "value.h"
|
||||||
# include "have_const.h"
|
# include "have_const.h"
|
||||||
#else
|
#else
|
||||||
|
Reference in New Issue
Block a user