mirror of
https://github.com/lcn2/calc.git
synced 2025-08-19 01:13:27 +03:00
Compare commits
5 Commits
2.11.5t4.3
...
2.11.5.7
Author | SHA1 | Date | |
---|---|---|---|
|
7e40db44e3 | ||
|
a57ee19ca5 | ||
|
a6e226fa80 | ||
|
86e0f98c8f | ||
|
e4dcbf7ecf |
51
BUGS
51
BUGS
@@ -74,6 +74,53 @@ Known bugs:
|
||||
|
||||
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,
|
||||
to fail the regression test. The work-a-round is to compile with -O
|
||||
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.
|
||||
## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
||||
##
|
||||
## @(#) $Revision: 29.12 $
|
||||
## @(#) $Id: BUGS,v 29.12 2001/06/01 11:32:01 chongo Exp $
|
||||
## @(#) $Revision: 29.17 $
|
||||
## @(#) $Id: BUGS,v 29.17 2001/12/31 22:12:35 chongo Exp $
|
||||
## @(#) $Source: /usr/local/src/cmd/calc/RCS/BUGS,v $
|
||||
##
|
||||
## Under source code control: 1994/03/18 14:06:13
|
||||
|
105
CHANGES
105
CHANGES
@@ -1,14 +1,70 @@
|
||||
The following are the changes from calc version 2.11.5t4.1 to date:
|
||||
The following are the changes from calc version 2.11.5.5 to date:
|
||||
|
||||
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 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.
|
||||
|
||||
|
||||
The following are the changes from calc version 2.11.5t4.1 to 2.11.5t4.4:
|
||||
|
||||
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
|
||||
header files if -DSRC. Otherwise they use <calc/foo.h>.
|
||||
The -DSRC symbol is defined by default in calc's Makefile
|
||||
header files if -DCALC_SRC. Otherwise they use <calc/foo.h>.
|
||||
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.
|
||||
If an external non-calc program includes an installed calc
|
||||
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).
|
||||
|
||||
Added calc builtin function: version() which returns the calc
|
||||
@@ -36,6 +92,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
|
||||
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:
|
||||
|
||||
@@ -166,7 +257,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
|
||||
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
|
||||
to calc source. These changes should not effect Windoz
|
||||
free system such as GNU/Linux, Solaris, POSIX-like, etc ...
|
||||
@@ -5320,8 +5411,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.
|
||||
## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
||||
##
|
||||
## @(#) $Revision: 29.35 $
|
||||
## @(#) $Id: CHANGES,v 29.35 2001/06/01 21:44:44 chongo Exp $
|
||||
## @(#) $Revision: 29.46 $
|
||||
## @(#) $Id: CHANGES,v 29.46 2002/03/12 10:58:31 chongo Exp $
|
||||
## @(#) $Source: /usr/local/src/cmd/calc/RCS/CHANGES,v $
|
||||
##
|
||||
## Under source code control: 1993/06/02 18:12:57
|
||||
|
@@ -19,12 +19,28 @@ Installing calc in 4 easy steps:
|
||||
As shipped the Makefile assumes 'more'. On your system
|
||||
you may find 'less' to be a better pager.
|
||||
|
||||
Set TOPDIR to be the place under which help files, calc,
|
||||
include files and calc libs are to be installed. As shipped
|
||||
the Makefile assumes a TOPDIR of /usr/local/lib.
|
||||
Set BINDIR to the directory where calc is installed.
|
||||
As shipped the Makefile assumes BINDIR is /usr/local/bin.
|
||||
|
||||
Set BINDIR to the place where calc is installed. As shipped
|
||||
the Makefile assumes a BINDIR /usr/local/bin.
|
||||
Set SHAREDIR to the place where shared files are kept.
|
||||
As shipped the Makefile assumes that SHAREDIR is /usr/share.
|
||||
Calc places its shared files under ${SHAREDIR}/calc.
|
||||
|
||||
Set INCDIR to the place where .h header files are kept.
|
||||
As shipped the Makefile assumes that INCDIR is /usr/include.
|
||||
Calc places its .h header files under ${INCDIR}/calc.
|
||||
|
||||
Set LIBDIR to be the place under which help files, calc,
|
||||
include files and calc libs are to be installed.
|
||||
As shipped the Makefile assumes a LIBDIR of /usr/lib.
|
||||
The calc library is installed as ${LIBDIR}/libcalc.a.
|
||||
|
||||
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.
|
||||
|
||||
@@ -65,8 +81,8 @@ the calc help subsystem. See the README file for details.
|
||||
## 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.2 $
|
||||
## @(#) $Id: HOWTO.INSTALL,v 29.2 2000/06/07 14:02:13 chongo Exp $
|
||||
## @(#) $Revision: 29.4 $
|
||||
## @(#) $Id: HOWTO.INSTALL,v 29.4 2002/03/12 09:03:17 chongo Exp $
|
||||
## @(#) $Source: /usr/local/src/cmd/calc/RCS/HOWTO.INSTALL,v $
|
||||
##
|
||||
## 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
|
||||
obscure internal routines won't change or disappear in future releases!
|
||||
|
||||
When calc is installed, all of the include files needed to build
|
||||
libcalc.a along with the link library itself are installed into ${LIBDIR}.
|
||||
When calc is installed, all of libraries 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:
|
||||
|
||||
-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
|
||||
@@ -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.
|
||||
## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
||||
##
|
||||
## @(#) $Revision: 29.2 $
|
||||
## @(#) $Id: LIBRARY,v 29.2 2000/06/07 14:02:13 chongo Exp $
|
||||
## @(#) $Revision: 29.5 $
|
||||
## @(#) $Id: LIBRARY,v 29.5 2001/06/08 22:57:35 chongo Exp $
|
||||
## @(#) $Source: /usr/local/src/cmd/calc/RCS/LIBRARY,v $
|
||||
##
|
||||
## 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 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.
|
||||
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
|
||||
@@ -19,7 +10,9 @@ NOTE: The main developers do not have access to a Windoz based platform.
|
||||
Of course you are welcome to send us any patches that fix your
|
||||
Windoz build environment.
|
||||
|
||||
=-=
|
||||
=-=-=-=-=
|
||||
=-=-=-=-=
|
||||
=-=-=-=-=
|
||||
|
||||
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
|
||||
@@ -61,8 +54,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
|
||||
compiler.
|
||||
|
||||
=-=
|
||||
|
||||
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:
|
||||
@@ -88,8 +79,71 @@ was changed to:
|
||||
|
||||
DLL extern int configtype(char*);
|
||||
|
||||
=-=-=-=-=
|
||||
=-=-=-=-=
|
||||
=-=-=-=-=
|
||||
|
||||
## Copyright (C) 2001 Landon Curt Noll and Thomas Jones-Low
|
||||
There is a different approach to the Cygwin approach above
|
||||
----------------------------------------------------------
|
||||
|
||||
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
|
||||
SHAREDIR= /dev/env/DJDIR/share
|
||||
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;${CSHAREDIR};${CUSTOMLIBDIR}
|
||||
CALCRC= ${CSHAREDIR}/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.
|
||||
|
||||
|
||||
## Copyright (C) 2002 Landon Curt Noll and Thomas Jones-Low
|
||||
##
|
||||
## Calc is open software; you can redistribute it and/or modify it under
|
||||
## the terms of the version 2.1 of the GNU Lesser General Public License
|
||||
@@ -105,8 +159,8 @@ was changed to:
|
||||
## 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.6 $
|
||||
## @(#) $Id: README.WINDOWS,v 29.6 2001/04/08 22:13:38 chongo Exp $
|
||||
## @(#) $Revision: 29.7 $
|
||||
## @(#) $Id: README.WINDOWS,v 29.7 2002/03/12 10:50:25 chongo Exp $
|
||||
## @(#) $Source: /usr/local/src/cmd/calc/RCS/README.WINDOWS,v $
|
||||
##
|
||||
## 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.
|
||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
* @(#) $Revision: 29.3 $
|
||||
* @(#) $Id: alloc.h,v 29.3 2001/05/29 00:16:53 chongo Exp $
|
||||
* @(#) $Revision: 29.4 $
|
||||
* @(#) $Id: alloc.h,v 29.4 2001/06/08 21:00:58 chongo Exp $
|
||||
* @(#) $Source: /usr/local/src/cmd/calc/RCS/alloc.h,v $
|
||||
*
|
||||
* Under source code control: 1990/02/15 01:48:29
|
||||
@@ -32,7 +32,7 @@
|
||||
#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_newstr.h"
|
||||
# include "have_string.h"
|
||||
|
@@ -17,8 +17,8 @@
|
||||
* 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: byteswap.h,v 29.3 2001/05/29 00:16:53 chongo Exp $
|
||||
* @(#) $Revision: 29.4 $
|
||||
* @(#) $Id: byteswap.h,v 29.4 2001/06/08 21:00:58 chongo Exp $
|
||||
* @(#) $Source: /usr/local/src/cmd/calc/RCS/byteswap.h,v $
|
||||
*
|
||||
* Under source code control: 1995/10/11 04:44:01
|
||||
@@ -33,7 +33,7 @@
|
||||
#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"
|
||||
#else
|
||||
# include <calc/longbits.h>
|
||||
|
80
cal/Makefile
80
cal/Makefile
@@ -18,8 +18,8 @@
|
||||
# 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.9 $
|
||||
# @(#) $Id: Makefile,v 29.9 2001/05/28 21:56:08 chongo Exp $
|
||||
# @(#) $Revision: 29.13 $
|
||||
# @(#) $Id: Makefile,v 29.13 2002/03/12 08:32:35 chongo Exp $
|
||||
# @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/Makefile,v $
|
||||
#
|
||||
# Under source code control: 1991/07/21 05:00:54
|
||||
@@ -47,6 +47,22 @@ SHAREDIR= /usr/share
|
||||
|
||||
CSHAREDIR= ${SHAREDIR}/calc
|
||||
|
||||
# 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
|
||||
# when forming the calc rpm, the Makefile is called with T=$RPM_BUILD_ROOT.
|
||||
#
|
||||
# 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
|
||||
#
|
||||
# Q=@ do not echo internal makefile actions (quiet mode)
|
||||
@@ -104,8 +120,10 @@ all: ${CALC_FILES} ${MAKE_FILE} .all
|
||||
##
|
||||
|
||||
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; \
|
||||
fi; \
|
||||
done
|
||||
|
||||
distdir:
|
||||
@@ -124,12 +142,11 @@ calcliblist:
|
||||
#
|
||||
##
|
||||
|
||||
echo_CALC_FILES: ${MAKE_FILE}
|
||||
@echo ${CALC_FILES}
|
||||
|
||||
echo_install.list: ${MAKE_FILE}
|
||||
@for i in ${CALC_FILES}; do \
|
||||
echo ${CSHAREDIR}/$$i; \
|
||||
echo_inst_files:
|
||||
${Q}for i in ${CALC_FILES} /dev/null; do \
|
||||
if [ X"$$i" != X"/dev/null" ]; then \
|
||||
echo __file__ ${CSHAREDIR}/$$i; \
|
||||
fi; \
|
||||
done
|
||||
|
||||
##
|
||||
@@ -144,30 +161,41 @@ clobber:
|
||||
rm -f .all
|
||||
|
||||
install: all
|
||||
-${Q}if [ ! -d ${SHAREDIR} ]; then \
|
||||
echo mkdir ${SHAREDIR}; \
|
||||
mkdir ${SHAREDIR}; \
|
||||
echo ${CHMOD} 0755 ${SHAREDIR}; \
|
||||
${CHMOD} 0755 ${SHAREDIR}; \
|
||||
-${Q}if [ ! -d $T${SHAREDIR} ]; then \
|
||||
echo mkdir $T${SHAREDIR}; \
|
||||
mkdir $T${SHAREDIR}; \
|
||||
if [ ! -d "$T${SHAREDIR}" ]; then \
|
||||
echo mkdir -p "$T${SHAREDIR}"; \
|
||||
mkdir -p "$T${SHAREDIR}"; \
|
||||
fi; \
|
||||
echo ${CHMOD} 0755 $T${SHAREDIR}; \
|
||||
${CHMOD} 0755 $T${SHAREDIR}; \
|
||||
else \
|
||||
true; \
|
||||
fi
|
||||
-${Q}if [ ! -d ${CSHAREDIR} ]; then \
|
||||
echo mkdir ${CSHAREDIR}; \
|
||||
mkdir ${CSHAREDIR}; \
|
||||
echo ${CHMOD} 0755 ${CSHAREDIR}; \
|
||||
${CHMOD} 0755 ${CSHAREDIR}; \
|
||||
-${Q}if [ ! -d $T${CSHAREDIR} ]; then \
|
||||
echo mkdir $T${CSHAREDIR}; \
|
||||
mkdir $T${CSHAREDIR}; \
|
||||
if [ ! -d "$T${CSHAREDIR}" ]; then \
|
||||
echo mkdir -p "$T${CSHAREDIR}"; \
|
||||
mkdir -p "$T${CSHAREDIR}"; \
|
||||
fi; \
|
||||
echo ${CHMOD} 0755 $T${CSHAREDIR}; \
|
||||
${CHMOD} 0755 $T${CSHAREDIR}; \
|
||||
else \
|
||||
true; \
|
||||
fi
|
||||
${Q}for i in ${CALC_FILES}; do \
|
||||
if ${CMP} -s $$i ${CSHAREDIR}/$$i; then \
|
||||
${Q}for i in ${CALC_FILES} /dev/null; do \
|
||||
if [ "$$i" = "/dev/null" ]; then \
|
||||
continue; \
|
||||
fi; \
|
||||
if ${CMP} -s $$i $T${CSHAREDIR}/$$i; then \
|
||||
true; \
|
||||
else \
|
||||
rm -f ${CSHAREDIR}/$$i.new; \
|
||||
cp -f $$i ${CSHAREDIR}/$$i.new; \
|
||||
${CHMOD} 0444 ${CSHAREDIR}/$$i.new; \
|
||||
mv -f ${CSHAREDIR}/$$i.new ${CSHAREDIR}/$$i; \
|
||||
echo "installed ${CSHAREDIR}/$$i"; \
|
||||
rm -f $T${CSHAREDIR}/$$i.new; \
|
||||
cp -f $$i $T${CSHAREDIR}/$$i.new; \
|
||||
${CHMOD} 0444 $T${CSHAREDIR}/$$i.new; \
|
||||
mv -f $T${CSHAREDIR}/$$i.new $T${CSHAREDIR}/$$i; \
|
||||
echo "installed $T${CSHAREDIR}/$$i"; \
|
||||
fi; \
|
||||
done
|
||||
|
@@ -17,8 +17,8 @@
|
||||
* 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: lucas.cal,v 29.3 2001/03/31 13:31:34 chongo Exp $
|
||||
* @(#) $Revision: 29.5 $
|
||||
* @(#) $Id: lucas.cal,v 29.5 2001/06/08 20:07:29 chongo Exp $
|
||||
* @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/lucas.cal,v $
|
||||
*
|
||||
* 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/
|
||||
*/
|
||||
|
||||
/*
|
||||
* 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:
|
||||
*
|
||||
@@ -52,12 +62,19 @@
|
||||
*
|
||||
* 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
|
||||
* broken. Rather than update this file each time, I'll just
|
||||
* congratulate the finders and encourage others to try for
|
||||
* 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
|
||||
* numbers of 'sane' size. The Amdahl 6 team used a 'ultra-high speed
|
||||
|
12
calc.h
12
calc.h
@@ -17,8 +17,8 @@
|
||||
* 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.7 $
|
||||
* @(#) $Id: calc.h,v 29.7 2001/05/29 00:16:53 chongo Exp $
|
||||
* @(#) $Revision: 29.10 $
|
||||
* @(#) $Id: calc.h,v 29.10 2002/03/12 09:40:57 chongo Exp $
|
||||
* @(#) $Source: /usr/local/src/cmd/calc/RCS/calc.h,v $
|
||||
*
|
||||
* Under source code control: 1990/02/15 01:48:31
|
||||
@@ -32,7 +32,7 @@
|
||||
#define __CALC_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 "value.h"
|
||||
# include "have_const.h"
|
||||
@@ -60,7 +60,11 @@
|
||||
#define HOMECHAR '~' /* char which indicates home directory */
|
||||
#define DOTCHAR '.' /* char which indicates current directory */
|
||||
#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 */
|
||||
#endif
|
||||
#define MAXCMD 16384 /* maximum length of command invocation */
|
||||
#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_minor_ver;
|
||||
extern int calc_major_patch;
|
||||
extern char *calc_minor_patch;
|
||||
extern int calc_minor_patch;
|
||||
extern char *Copyright;
|
||||
extern DLL char *version(void);
|
||||
|
||||
|
18
calc.man
18
calc.man
@@ -15,8 +15,8 @@
|
||||
.\" 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.7 $
|
||||
.\" @(#) $Id: calc.man,v 29.7 2001/06/01 11:26:53 chongo Exp $
|
||||
.\" @(#) $Revision: 29.8 $
|
||||
.\" @(#) $Id: calc.man,v 29.8 2002/03/12 09:02:58 chongo Exp $
|
||||
.\" @(#) $Source: /usr/local/src/cmd/calc/RCS/calc.man,v $
|
||||
.\"
|
||||
.\" Under source code control: 1991/07/23 05:48:26
|
||||
@@ -54,7 +54,7 @@ calc \- arbitrary precision calculator
|
||||
.RB [ calc_cmd\ \&.\|.\|. ]
|
||||
.in -5n
|
||||
.sp
|
||||
\fI#!${BINDIR}/calc\fP\ \fB\-S\fP\ [other_flags\ \&...]
|
||||
\fI#!${BINDIR}/calc\fP\ \fB\-f\fP\ [other_flags\ \&...]
|
||||
.SH DESCRIPTION
|
||||
\&
|
||||
.br
|
||||
@@ -572,27 +572,25 @@ If first line of an executable file begins
|
||||
followed by the absolute pathname of the
|
||||
.B calc
|
||||
program and the flag
|
||||
.B \-S
|
||||
.B \-f
|
||||
as in:
|
||||
.sp 1
|
||||
.in +5n
|
||||
.nf
|
||||
\fI#!${BINDIR}/calc\fP\ \fB\-S\fP\ [other_flags\ \&...]
|
||||
\fI#!${BINDIR}/calc\fP\ \fB\-f\fP\ [other_flags\ \&...]
|
||||
.fi
|
||||
.in -5n
|
||||
.sp 1
|
||||
the rest of the file will be processed in
|
||||
.BR "shell script mode" .
|
||||
Note that
|
||||
.B \-S
|
||||
(UPPER CASE
|
||||
.BR \-S )
|
||||
.B \-f
|
||||
must be the first \-flag on the ``#!'' line.
|
||||
Any other optional
|
||||
.B "other_flags"
|
||||
must come after
|
||||
the
|
||||
.BR \-S .
|
||||
.BR \-f .
|
||||
.sp 1
|
||||
In
|
||||
.B "shell script mode"
|
||||
@@ -625,7 +623,7 @@ the file
|
||||
.sp 1
|
||||
.in +5n
|
||||
.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
|
||||
|
||||
|
11
cmath.h
11
cmath.h
@@ -17,8 +17,8 @@
|
||||
* 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.4 $
|
||||
* @(#) $Id: cmath.h,v 29.4 2001/05/29 00:16:53 chongo Exp $
|
||||
* @(#) $Revision: 29.6 $
|
||||
* @(#) $Id: cmath.h,v 29.6 2002/03/12 09:38:26 chongo Exp $
|
||||
* @(#) $Source: /usr/local/src/cmd/calc/RCS/cmath.h,v $
|
||||
*
|
||||
* Under source code control: 1993/07/30 19:42:45
|
||||
@@ -32,7 +32,7 @@
|
||||
#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"
|
||||
#else
|
||||
# include <calc/qmath.h>
|
||||
@@ -62,6 +62,7 @@ extern void cprintfr(COMPLEX *c);
|
||||
/*
|
||||
* Basic numeric routines.
|
||||
*/
|
||||
|
||||
extern COMPLEX *cadd(COMPLEX *c1, COMPLEX *c2);
|
||||
extern COMPLEX *csub(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 *csquare(COMPLEX *c);
|
||||
extern COMPLEX *cconj(COMPLEX *c);
|
||||
extern COMPLEX *creal(COMPLEX *c);
|
||||
extern COMPLEX *cimag(COMPLEX *c);
|
||||
extern COMPLEX *c_real(COMPLEX *c);
|
||||
extern COMPLEX *c_imag(COMPLEX *c);
|
||||
extern COMPLEX *cneg(COMPLEX *c);
|
||||
extern COMPLEX *cinv(COMPLEX *c);
|
||||
extern COMPLEX *cint(COMPLEX *c);
|
||||
|
@@ -17,8 +17,8 @@
|
||||
* 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.2 $
|
||||
* @(#) $Id: commath.c,v 29.2 2000/06/07 14:02:13 chongo Exp $
|
||||
* @(#) $Revision: 29.3 $
|
||||
* @(#) $Id: commath.c,v 29.3 2002/03/12 09:38:26 chongo Exp $
|
||||
* @(#) $Source: /usr/local/src/cmd/calc/RCS/commath.c,v $
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
COMPLEX *
|
||||
creal(COMPLEX *c)
|
||||
c_real(COMPLEX *c)
|
||||
{
|
||||
COMPLEX *r;
|
||||
|
||||
@@ -400,7 +400,7 @@ creal(COMPLEX *c)
|
||||
* Return the imaginary part of a complex number as a real.
|
||||
*/
|
||||
COMPLEX *
|
||||
cimag(COMPLEX *c)
|
||||
c_imag(COMPLEX *c)
|
||||
{
|
||||
COMPLEX *r;
|
||||
|
||||
|
6
config.h
6
config.h
@@ -19,8 +19,8 @@
|
||||
* 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.10 $
|
||||
* @(#) $Id: config.h,v 29.10 2001/05/29 00:16:53 chongo Exp $
|
||||
* @(#) $Revision: 29.11 $
|
||||
* @(#) $Id: config.h,v 29.11 2001/06/08 21:00:58 chongo Exp $
|
||||
* @(#) $Source: /usr/local/src/cmd/calc/RCS/config.h,v $
|
||||
*
|
||||
* Under source code control: 1995/11/01 22:20:17
|
||||
@@ -35,7 +35,7 @@
|
||||
#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 "nametype.h"
|
||||
# include "qmath.h"
|
||||
|
@@ -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
|
||||
*
|
||||
@@ -26,8 +26,8 @@
|
||||
* 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.2 $
|
||||
* @(#) $Id: 4dsphere.calc,v 1.2 2001/05/29 00:48:46 chongo Exp $
|
||||
* @(#) $Revision: 1.3 $
|
||||
* @(#) $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 $
|
||||
*
|
||||
* Under source code control: 2001/05/03 19:02:03
|
||||
|
104
cscript/Makefile
104
cscript/Makefile
@@ -17,9 +17,9 @@
|
||||
# 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.14 $
|
||||
# @(#) $Id: Makefile,v 29.14 2001/05/28 23:08:22 chongo Exp $
|
||||
# @(#) $Source: /usr/local/src/cmd/calc/cscript/RCS/Makefile,v $
|
||||
# @(#) $Revision: 29.21 $
|
||||
# @(#) $Id: Makefile,v 29.21 2002/03/12 08:36:11 chongo Exp $
|
||||
# @(#) $Source: /usr/local/src/cmd/calc/cal/../cscript/RCS/Makefile,v $
|
||||
#
|
||||
# Under source code control: 1999/11/29 11:10:26
|
||||
# File existed as early as: 1999
|
||||
@@ -45,6 +45,22 @@ BINDIR= /usr/bin
|
||||
#
|
||||
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
|
||||
# when forming the calc rpm, the Makefile is called with T=$RPM_BUILD_ROOT.
|
||||
#
|
||||
# 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
|
||||
#
|
||||
# Q=@ do not echo internal makefile actions (quiet mode)
|
||||
@@ -77,11 +93,11 @@ CMP= cmp
|
||||
#
|
||||
# make detaillist
|
||||
#
|
||||
SCRIPT= 4dsphere fproduct mersenne piforever plus powerterm simple \
|
||||
square
|
||||
SCRIPT= 4dsphere fproduct mersenne piforever plus powerterm \
|
||||
simple square
|
||||
|
||||
SCRIPT_SRC= 4dsphere.calc fproduct.calc mersenne.calc piforever.calc \
|
||||
plus.calc powerterm.calc simple.calc square.calc
|
||||
SCRIPT_SRC= 4dsphere.calc fproduct.calc mersenne.calc \
|
||||
piforever.calc plus.calc powerterm.calc simple.calc square.calc
|
||||
|
||||
# These files are found (but not built) in the distribution
|
||||
#
|
||||
@@ -123,8 +139,10 @@ all: ${TARGETS} .all
|
||||
##
|
||||
|
||||
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; \
|
||||
fi; \
|
||||
done | LANG=C ${SORT}
|
||||
|
||||
distdir:
|
||||
@@ -136,23 +154,27 @@ calcliblist:
|
||||
#
|
||||
detaillist:
|
||||
${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 \
|
||||
echo "WARNING: $$i.calc not under RCS control" 1>&2; \
|
||||
else \
|
||||
echo $$i; \
|
||||
fi; \
|
||||
fi; \
|
||||
done | LANG=C ${SORT}) | ${FMT} -70 | \
|
||||
${SED} -e '1s/xxxxxxx/SCRIPT=/' -e '2,$$s/^/ /' \
|
||||
-e 's/$$/ \\/' -e '$$s/ \\$$//'
|
||||
${Q}echo
|
||||
${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 \
|
||||
echo "WARNING: $$i.calc not under RCS control" 1>&2; \
|
||||
else \
|
||||
echo $$i.calc; \
|
||||
fi; \
|
||||
fi; \
|
||||
done | LANG=C ${SORT}) | ${FMT} -70 | \
|
||||
${SED} -e '1s/xxxxxxxxxxx/SCRIPT_SRC=/' -e '2,$$s/^/ /' \
|
||||
-e 's/$$/ \\/' -e '$$s/ \\$$//'
|
||||
@@ -181,11 +203,13 @@ depend:
|
||||
${Q}echo "# DO NOT DELETE THIS LINE -- make depend depends on it." > \
|
||||
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 ' rm -f $$@'; \
|
||||
echo ' $${SED} -e "1s:^#!/usr/local/src/cmd/calc/calc:#!$${BINDIR}/calc:" $$?>$$@'; \
|
||||
echo ' $${CHMOD} +x $$@'; \
|
||||
fi; \
|
||||
done >> makedep.out
|
||||
${Q}echo sample dependency list formed
|
||||
${Q}echo forming new cscript/Makefile
|
||||
@@ -216,14 +240,13 @@ depend:
|
||||
#
|
||||
##
|
||||
|
||||
echo_SCRIPT: ${MAKE_FILE}
|
||||
@echo ${SCRIPT}
|
||||
|
||||
|
||||
echo_install.list: ${MAKE_FILE}
|
||||
@for i in ${SCRIPT}; do \
|
||||
echo ${SCRIPTDIR}/$$i; \
|
||||
echo_inst_files:
|
||||
${Q}for i in ${SCRIPT} /dev/null; do \
|
||||
if [ X"$$i" != X"/dev/null" ]; then \
|
||||
echo __file__ ${SCRIPTDIR}/$$i; \
|
||||
fi; \
|
||||
done
|
||||
|
||||
##
|
||||
#
|
||||
# Utility rules
|
||||
@@ -237,31 +260,42 @@ clobber:
|
||||
-rm -f ${TARGETS}
|
||||
|
||||
install: all
|
||||
-${Q}if [ ! -d ${BINDIR} ]; then \
|
||||
echo mkdir ${BINDIR}; \
|
||||
mkdir ${BINDIR}; \
|
||||
echo ${CHMOD} 0755 ${BINDIR}; \
|
||||
${CHMOD} 0755 ${BINDIR}; \
|
||||
-${Q}if [ ! -d $T${BINDIR} ]; then \
|
||||
echo mkdir $T${BINDIR}; \
|
||||
mkdir $T${BINDIR}; \
|
||||
if [ ! -d "$T${BINDIR}" ]; then \
|
||||
echo mkdir -p "$T${BINDIR}"; \
|
||||
mkdir -p "$T${BINDIR}"; \
|
||||
fi; \
|
||||
echo ${CHMOD} 0755 $T${BINDIR}; \
|
||||
${CHMOD} 0755 $T${BINDIR}; \
|
||||
else \
|
||||
true; \
|
||||
fi
|
||||
-${Q}if [ ! -d ${SCRIPTDIR} ]; then \
|
||||
echo mkdir ${SCRIPTDIR}; \
|
||||
mkdir ${SCRIPTDIR}; \
|
||||
echo ${CHMOD} 0755 ${SCRIPTDIR}; \
|
||||
${CHMOD} 0755 ${SCRIPTDIR}; \
|
||||
-${Q}if [ ! -d $T${SCRIPTDIR} ]; then \
|
||||
echo mkdir $T${SCRIPTDIR}; \
|
||||
mkdir $T${SCRIPTDIR}; \
|
||||
if [ ! -d "$T${SCRIPTDIR}" ]; then \
|
||||
echo mkdir -p "$T${SCRIPTDIR}"; \
|
||||
mkdir -p "$T${SCRIPTDIR}"; \
|
||||
fi; \
|
||||
echo ${CHMOD} 0755 $T${SCRIPTDIR}; \
|
||||
${CHMOD} 0755 $T${SCRIPTDIR}; \
|
||||
else \
|
||||
true; \
|
||||
fi
|
||||
${Q}for i in ${SCRIPT}; do \
|
||||
if ${CMP} -s $$i ${SCRIPTDIR}/$$i; then \
|
||||
${Q}for i in ${SCRIPT} /dev/null; do \
|
||||
if [ "$$i" = "/dev/null" ]; then \
|
||||
continue; \
|
||||
fi; \
|
||||
if ${CMP} -s $$i $T${SCRIPTDIR}/$$i; then \
|
||||
true; \
|
||||
else \
|
||||
rm -f ${SCRIPTDIR}/$$i.new; \
|
||||
cp -f $$i ${SCRIPTDIR}/$$i.new; \
|
||||
${CHMOD} 0555 ${SCRIPTDIR}/$$i; \
|
||||
mv -f ${SCRIPTDIR}/$$i.new ${SCRIPTDIR}/$$i; \
|
||||
echo "installed ${SCRIPTDIR}/$$i"; \
|
||||
rm -f $T${SCRIPTDIR}/$$i.new; \
|
||||
cp -f $$i $T${SCRIPTDIR}/$$i.new; \
|
||||
${CHMOD} 0555 $T${SCRIPTDIR}/$$i.new; \
|
||||
mv -f $T${SCRIPTDIR}/$$i.new $T${SCRIPTDIR}/$$i; \
|
||||
echo "installed $T${SCRIPTDIR}/$$i"; \
|
||||
fi; \
|
||||
done
|
||||
|
||||
|
@@ -21,14 +21,14 @@ For more info, see:
|
||||
|
||||
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
|
||||
x1 y1 z1 w1 point 1 in R^4
|
||||
... ...
|
||||
x5 y5 z5 w5 point 5 in R^4
|
||||
x0 y0 z0 w0 point 0 in R^4
|
||||
x1 y1 z1 w1 point 1 in R^4
|
||||
... ...
|
||||
x5 y5 z5 w5 point 5 in R^4
|
||||
|
||||
|
||||
fproduct filename term ...
|
||||
@@ -77,8 +77,8 @@ simple
|
||||
## 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.7 $
|
||||
## @(#) $Id: README,v 29.7 2001/05/28 23:08:22 chongo Exp $
|
||||
## @(#) $Revision: 29.10 $
|
||||
## @(#) $Id: README,v 29.10 2001/06/10 19:34:40 chongo Exp $
|
||||
## @(#) $Source: /usr/local/src/cmd/calc/cscript/RCS/README,v $
|
||||
##
|
||||
## 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
|
||||
*
|
||||
@@ -24,8 +24,8 @@
|
||||
* 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: fproduct.calc,v 29.1 2001/04/08 08:25:15 chongo Exp $
|
||||
* @(#) $Revision: 29.2 $
|
||||
* @(#) $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 $
|
||||
*
|
||||
* 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
|
||||
*
|
||||
@@ -24,8 +24,8 @@
|
||||
* 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.5 $
|
||||
* @(#) $Id: powerterm.calc,v 29.5 2001/04/25 08:41:36 chongo Exp $
|
||||
* @(#) $Revision: 29.6 $
|
||||
* @(#) $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 $
|
||||
*
|
||||
* Under source code control: 2001/04/24 23:49:11
|
||||
|
256
custom/Makefile
256
custom/Makefile
@@ -18,8 +18,8 @@
|
||||
# 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.13 $
|
||||
# @(#) $Id: Makefile,v 29.13 2001/05/28 23:54:53 chongo Exp $
|
||||
# @(#) $Revision: 29.18 $
|
||||
# @(#) $Id: Makefile,v 29.18 2002/03/12 08:30:43 chongo Exp $
|
||||
# @(#) $Source: /usr/local/src/cmd/calc/custom/RCS/Makefile,v $
|
||||
#
|
||||
# Under source code control: 1997/03/09 02:28:54
|
||||
@@ -116,6 +116,22 @@ CUSTOMLIBDIR= ${CSHAREDIR}/custom
|
||||
CUSTOMHELPDIR= ${CSHAREDIR}/custhelp
|
||||
CUSTOMINCDIR= ${INCDIRCALC}/custom
|
||||
|
||||
# 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
|
||||
# when forming the calc rpm, the Makefile is called with T=$RPM_BUILD_ROOT.
|
||||
#
|
||||
# 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
|
||||
# a default here just in case you want to build from this directory.
|
||||
#
|
||||
@@ -365,8 +381,10 @@ c_sysinfo.o: c_sysinfo.c ${MAKE_FILE}
|
||||
##
|
||||
|
||||
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; \
|
||||
fi; \
|
||||
done
|
||||
|
||||
distdir:
|
||||
@@ -402,11 +420,13 @@ depend:
|
||||
-${Q}rm -rf skel
|
||||
${Q}mkdir skel
|
||||
${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' \
|
||||
"$$i" > "skel/custom/$$i"; \
|
||||
fi; \
|
||||
done
|
||||
-${Q}for i in /dev/null ${H_SRC}; do \
|
||||
-${Q}for i in ${H_SRC} /dev/null; do \
|
||||
if [ "$$i" = "/dev/null" ]; then \
|
||||
continue; \
|
||||
fi; \
|
||||
@@ -421,7 +441,10 @@ depend:
|
||||
${Q}for i in `cd ..; ${MAKE} h_list 2>&1 | \
|
||||
${SED} -e '/Entering directory/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'`"; \
|
||||
echo "#if !defined($$tag)" > "skel/$$i"; \
|
||||
echo "#define $$tag" >> "skel/$$i"; \
|
||||
@@ -435,8 +458,10 @@ depend:
|
||||
${Q}echo "# DO NOT DELETE THIS LINE -- make depend depends on it." > \
|
||||
skel/custom/makedep.out
|
||||
${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/'; \
|
||||
fi; \
|
||||
done >> skel/custom/makedep.out
|
||||
${Q}echo custom dependency list formed
|
||||
${Q}echo forming new custom/Makefile
|
||||
@@ -468,27 +493,26 @@ depend:
|
||||
#
|
||||
##
|
||||
|
||||
echo_INSTALL_H_SRC: ${MAKE_FILE}
|
||||
@echo ${INSTALL_H_SRC}
|
||||
|
||||
echo_CUSTOM_CALC_FILES: ${MAKE_FILE}
|
||||
@echo ${CUSTOM_CALC_FILES}
|
||||
|
||||
echo_CUSTOM_HELP: ${MAKE_FILE}
|
||||
@echo ${CUSTOM_HELP}
|
||||
|
||||
echo_install.list: ${MAKE_FILE}
|
||||
@for i in ${INSTALL_H_SRC}; do \
|
||||
echo ${CUSTOMINCDIR}/$$i; \
|
||||
echo_inst_files:
|
||||
${Q}for i in ${INSTALL_H_SRC} /dev/null; do \
|
||||
if [ X"$$i" != X"/dev/null" ]; then \
|
||||
echo __file__ ${CUSTOMINCDIR}/$$i; \
|
||||
fi; \
|
||||
done
|
||||
@for i in ${CUSTOM_HELP}; do \
|
||||
echo ${CUSTOMHELPDIR}/$$i; \
|
||||
${Q}for i in ${CUSTOM_HELP} /dev/null; do \
|
||||
if [ X"$$i" != X"/dev/null" ]; then \
|
||||
echo __file__ ${CUSTOMHELPDIR}/$$i; \
|
||||
fi; \
|
||||
done
|
||||
@for i in ${CUSTOM_CALC_FILES}; do \
|
||||
echo ${CUSTOMLIBDIR}/$$i; \
|
||||
${Q}for i in ${CUSTOM_CALC_FILES} /dev/null; do \
|
||||
if [ X"$$i" != X"/dev/null" ]; then \
|
||||
echo __file__ ${CUSTOMLIBDIR}/$$i; \
|
||||
fi; \
|
||||
done
|
||||
@for i in ${CALC_LIBCUSTOM}; do \
|
||||
echo ${CUSTOMLIBDIR}/$$i; \
|
||||
${Q}for i in ${CALC_LIBCUSTOM} /dev/null; do \
|
||||
if [ X"$$i" != X"/dev/null" ]; then \
|
||||
echo __file__ ${CUSTOMLIBDIR}/$$i; \
|
||||
fi; \
|
||||
done
|
||||
|
||||
##
|
||||
@@ -505,118 +529,156 @@ clobber:
|
||||
rm -f .all Makefile.tmp Makefile.bak
|
||||
|
||||
install: all
|
||||
-${Q}if [ ! -d ${SHAREDIR} ]; then \
|
||||
echo mkdir ${SHAREDIR}; \
|
||||
mkdir ${SHAREDIR}; \
|
||||
echo ${CHMOD} 0755 ${SHAREDIR}; \
|
||||
${CHMOD} 0755 ${SHAREDIR}; \
|
||||
-${Q}if [ ! -d $T${SHAREDIR} ]; then \
|
||||
echo mkdir $T${SHAREDIR}; \
|
||||
mkdir $T${SHAREDIR}; \
|
||||
if [ ! -d "$T${SHAREDIR}" ]; then \
|
||||
echo mkdir -p "$T${SHAREDIR}"; \
|
||||
mkdir -p "$T${SHAREDIR}"; \
|
||||
fi; \
|
||||
echo ${CHMOD} 0755 $T${SHAREDIR}; \
|
||||
${CHMOD} 0755 $T${SHAREDIR}; \
|
||||
else \
|
||||
true; \
|
||||
fi
|
||||
-${Q}if [ ! -d ${INCDIR} ]; then \
|
||||
echo mkdir ${INCDIR}; \
|
||||
mkdir ${INCDIR}; \
|
||||
echo ${CHMOD} 0755 ${INCDIR}; \
|
||||
${CHMOD} 0755 ${INCDIR}; \
|
||||
-${Q}if [ ! -d $T${INCDIR} ]; then \
|
||||
echo mkdir $T${INCDIR}; \
|
||||
mkdir $T${INCDIR}; \
|
||||
if [ ! -d "$T${INCDIR}" ]; then \
|
||||
echo mkdir -p "$T${INCDIR}"; \
|
||||
mkdir -p "$T${INCDIR}"; \
|
||||
fi; \
|
||||
echo ${CHMOD} 0755 $T${INCDIR}; \
|
||||
${CHMOD} 0755 $T${INCDIR}; \
|
||||
else \
|
||||
true; \
|
||||
fi
|
||||
-${Q}if [ ! -d ${CSHAREDIR} ]; then \
|
||||
echo mkdir ${CSHAREDIR}; \
|
||||
mkdir ${CSHAREDIR}; \
|
||||
echo ${CHMOD} 0755 ${CSHAREDIR}; \
|
||||
${CHMOD} 0755 ${CSHAREDIR}; \
|
||||
-${Q}if [ ! -d $T${CSHAREDIR} ]; then \
|
||||
echo mkdir $T${CSHAREDIR}; \
|
||||
mkdir $T${CSHAREDIR}; \
|
||||
if [ ! -d "$T${CSHAREDIR}" ]; then \
|
||||
echo mkdir -p "$T${CSHAREDIR}"; \
|
||||
mkdir -p "$T${CSHAREDIR}"; \
|
||||
fi; \
|
||||
echo ${CHMOD} 0755 $T${CSHAREDIR}; \
|
||||
${CHMOD} 0755 $T${CSHAREDIR}; \
|
||||
else \
|
||||
true; \
|
||||
fi
|
||||
-${Q}if [ ! -d ${INCDIRCALC} ]; then \
|
||||
echo mkdir ${INCDIRCALC}; \
|
||||
mkdir ${INCDIRCALC}; \
|
||||
echo ${CHMOD} 0755 ${INCDIRCALC}; \
|
||||
${CHMOD} 0755 ${INCDIRCALC}; \
|
||||
-${Q}if [ ! -d $T${INCDIRCALC} ]; then \
|
||||
echo mkdir $T${INCDIRCALC}; \
|
||||
mkdir $T${INCDIRCALC}; \
|
||||
if [ ! -d "$T${INCDIRCALC}" ]; then \
|
||||
echo mkdir -p "$T${INCDIRCALC}"; \
|
||||
mkdir -p "$T${INCDIRCALC}"; \
|
||||
fi; \
|
||||
echo ${CHMOD} 0755 $T${INCDIRCALC}; \
|
||||
${CHMOD} 0755 $T${INCDIRCALC}; \
|
||||
else \
|
||||
true; \
|
||||
fi
|
||||
-${Q}if [ ! -d ${HELPDIR} ]; then \
|
||||
echo mkdir ${HELPDIR}; \
|
||||
mkdir ${HELPDIR}; \
|
||||
echo ${CHMOD} 0755 ${HELPDIR}; \
|
||||
${CHMOD} 0755 ${HELPDIR}; \
|
||||
-${Q}if [ ! -d $T${HELPDIR} ]; then \
|
||||
echo mkdir $T${HELPDIR}; \
|
||||
mkdir $T${HELPDIR}; \
|
||||
if [ ! -d "$T${HELPDIR}" ]; then \
|
||||
echo mkdir -p "$T${HELPDIR}"; \
|
||||
mkdir -p "$T${HELPDIR}"; \
|
||||
fi; \
|
||||
echo ${CHMOD} 0755 $T${HELPDIR}; \
|
||||
${CHMOD} 0755 $T${HELPDIR}; \
|
||||
else \
|
||||
true; \
|
||||
fi
|
||||
-${Q}if [ ! -d ${CUSTOMLIBDIR} ]; then \
|
||||
echo mkdir ${CUSTOMLIBDIR}; \
|
||||
mkdir ${CUSTOMLIBDIR}; \
|
||||
echo ${CHMOD} 0755 ${CUSTOMLIBDIR}; \
|
||||
${CHMOD} 0755 ${CUSTOMLIBDIR}; \
|
||||
-${Q}if [ ! -d $T${CUSTOMLIBDIR} ]; then \
|
||||
echo mkdir $T${CUSTOMLIBDIR}; \
|
||||
mkdir $T${CUSTOMLIBDIR}; \
|
||||
if [ ! -d "$T${CUSTOMLIBDIR}" ]; then \
|
||||
echo mkdir -p "$T${CUSTOMLIBDIR}"; \
|
||||
mkdir -p "$T${CUSTOMLIBDIR}"; \
|
||||
fi; \
|
||||
echo ${CHMOD} 0755 $T${CUSTOMLIBDIR}; \
|
||||
${CHMOD} 0755 $T${CUSTOMLIBDIR}; \
|
||||
else \
|
||||
true; \
|
||||
fi
|
||||
-${Q}if [ ! -d ${CUSTOMHELPDIR} ]; then \
|
||||
echo mkdir ${CUSTOMHELPDIR}; \
|
||||
mkdir ${CUSTOMHELPDIR}; \
|
||||
echo ${CHMOD} 0755 ${CUSTOMHELPDIR}; \
|
||||
${CHMOD} 0755 ${CUSTOMHELPDIR}; \
|
||||
-${Q}if [ ! -d $T${CUSTOMHELPDIR} ]; then \
|
||||
echo mkdir $T${CUSTOMHELPDIR}; \
|
||||
mkdir $T${CUSTOMHELPDIR}; \
|
||||
if [ ! -d "$T${CUSTOMHELPDIR}" ]; then \
|
||||
echo mkdir -p "$T${CUSTOMHELPDIR}"; \
|
||||
mkdir -p "$T${CUSTOMHELPDIR}"; \
|
||||
fi; \
|
||||
echo ${CHMOD} 0755 $T${CUSTOMHELPDIR}; \
|
||||
${CHMOD} 0755 $T${CUSTOMHELPDIR}; \
|
||||
else \
|
||||
true; \
|
||||
fi
|
||||
-${Q}if [ ! -d ${CUSTOMINCDIR} ]; then \
|
||||
echo mkdir ${CUSTOMINCDIR}; \
|
||||
mkdir ${CUSTOMINCDIR}; \
|
||||
echo ${CHMOD} 0755 ${CUSTOMINCDIR}; \
|
||||
${CHMOD} 0755 ${CUSTOMINCDIR}; \
|
||||
-${Q}if [ ! -d $T${CUSTOMINCDIR} ]; then \
|
||||
echo mkdir $T${CUSTOMINCDIR}; \
|
||||
mkdir $T${CUSTOMINCDIR}; \
|
||||
if [ ! -d "$T${CUSTOMINCDIR}" ]; then \
|
||||
echo mkdir -p "$T${CUSTOMINCDIR}"; \
|
||||
mkdir -p "$T${CUSTOMINCDIR}"; \
|
||||
fi; \
|
||||
echo ${CHMOD} 0755 $T${CUSTOMINCDIR}; \
|
||||
${CHMOD} 0755 $T${CUSTOMINCDIR}; \
|
||||
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 \
|
||||
-${Q}for i in ${INSTALL_H_SRC} /dev/null; do \
|
||||
if [ "$$i" = "/dev/null" ]; then \
|
||||
continue; \
|
||||
fi; \
|
||||
if ${CMP} -s tmp $T${CUSTOMINCDIR}/$$i; then \
|
||||
true; \
|
||||
else \
|
||||
rm -f ${CUSTOMINCDIR}/$$i; \
|
||||
cp -f tmp ${INCDIRCALC}/$$i.new; \
|
||||
cp -f $$i ${CUSTOMINCDIR}/$$i.new; \
|
||||
${CHMOD} 0444 ${CUSTOMINCDIR}/$$i.new; \
|
||||
mv -f ${CUSTOMINCDIR}/$$i.new ${CUSTOMINCDIR}/$$i; \
|
||||
echo "installed ${CUSTOMINCDIR}/$$i"; \
|
||||
rm -f $T${CUSTOMINCDIR}/$$i.new; \
|
||||
cp -f $$i $T${CUSTOMINCDIR}/$$i.new; \
|
||||
${CHMOD} 0444 $T${CUSTOMINCDIR}/$$i.new; \
|
||||
mv -f $T${CUSTOMINCDIR}/$$i.new $T${CUSTOMINCDIR}/$$i; \
|
||||
echo "installed $T${CUSTOMINCDIR}/$$i"; \
|
||||
fi; \
|
||||
done
|
||||
-${Q}rm -f tmp
|
||||
-${Q}for i in ${CUSTOM_CALC_FILES}; do \
|
||||
if ${CMP} -s $$i ${CUSTOMLIBDIR}/$$i; then \
|
||||
-${Q}for i in ${CUSTOM_CALC_FILES} /dev/null; do \
|
||||
if [ "$$i" = "/dev/null" ]; then \
|
||||
continue; \
|
||||
fi; \
|
||||
if ${CMP} -s $$i $T${CUSTOMLIBDIR}/$$i; then \
|
||||
true; \
|
||||
else \
|
||||
rm -f ${CUSTOMLIBDIR}/$$i; \
|
||||
cp -f $$i ${CUSTOMLIBDIR}/$$i; \
|
||||
${CHMOD} 0444 ${CUSTOMLIBDIR}/$$i.new; \
|
||||
mv -f ${CUSTOMLIBDIR}/$$i.new ${CUSTOMLIBDIR}/$$i; \
|
||||
echo "installed ${CUSTOMLIBDIR}/$$i"; \
|
||||
rm -f $T${CUSTOMLIBDIR}/$$i.new; \
|
||||
cp -f $$i $T${CUSTOMLIBDIR}/$$i.new; \
|
||||
${CHMOD} 0444 $T${CUSTOMLIBDIR}/$$i.new; \
|
||||
mv -f $T${CUSTOMLIBDIR}/$$i.new $T${CUSTOMLIBDIR}/$$i; \
|
||||
echo "installed $T${CUSTOMLIBDIR}/$$i"; \
|
||||
fi; \
|
||||
done
|
||||
-${Q}for i in ${CUSTOM_HELP}; do \
|
||||
if ${CMP} -s $$i ${CUSTOMHELPDIR}/$$i; then \
|
||||
-${Q}for i in ${CUSTOM_HELP} /dev/null; do \
|
||||
if [ "$$i" = "/dev/null" ]; then \
|
||||
continue; \
|
||||
fi; \
|
||||
if ${CMP} -s $$i $T${CUSTOMHELPDIR}/$$i; then \
|
||||
true; \
|
||||
else \
|
||||
rm -f ${CUSTOMHELPDIR}/$$i; \
|
||||
cp -f $$i ${CUSTOMHELPDIR}/$$i.new; \
|
||||
${CHMOD} 0444 ${CUSTOMHELPDIR}/$$i.new; \
|
||||
mv -f ${CUSTOMHELPDIR}/$$i.new ${CUSTOMHELPDIR}/$$i; \
|
||||
echo "installed ${CUSTOMHELPDIR}/$$i"; \
|
||||
rm -f $T${CUSTOMHELPDIR}/$$i.new; \
|
||||
cp -f $$i $T${CUSTOMHELPDIR}/$$i.new; \
|
||||
${CHMOD} 0444 $T${CUSTOMHELPDIR}/$$i.new; \
|
||||
mv -f $T${CUSTOMHELPDIR}/$$i.new $T${CUSTOMHELPDIR}/$$i; \
|
||||
echo "installed $T${CUSTOMHELPDIR}/$$i"; \
|
||||
fi; \
|
||||
done
|
||||
-${Q}if [ ! -z ${ALLOW_CUSTOM} ]; then \
|
||||
if ${CMP} -s libcustcalc.a ${CUSTOMLIBDIR}/libcustcalc.a; then \
|
||||
if ${CMP} -s libcustcalc.a $T${CUSTOMLIBDIR}/libcustcalc.a; then \
|
||||
true; \
|
||||
else \
|
||||
rm -f ${CUSTOMLIBDIR}/libcustcalc.a.new; \
|
||||
cp -f libcustcalc.a ${CUSTOMLIBDIR}/libcustcalc.a.new; \
|
||||
${CHMOD} 0644 ${CUSTOMLIBDIR}/libcustcalc.a; \
|
||||
mv -f ${CUSTOMLIBDIR}/libcustcalc.a.new \
|
||||
${CUSTOMLIBDIR}/libcustcalc.a; \
|
||||
${RANLIB} ${CUSTOMLIBDIR}/libcustcalc.a; \
|
||||
echo "installed ${CUSTOMLIBDIR}/libcustcalc.a"; \
|
||||
rm -f $T${CUSTOMLIBDIR}/libcustcalc.a.new; \
|
||||
cp -f libcustcalc.a $T${CUSTOMLIBDIR}/libcustcalc.a.new; \
|
||||
${CHMOD} 0644 $T${CUSTOMLIBDIR}/libcustcalc.a.new; \
|
||||
mv -f $T${CUSTOMLIBDIR}/libcustcalc.a.new \
|
||||
$T${CUSTOMLIBDIR}/libcustcalc.a; \
|
||||
${RANLIB} $T${CUSTOMLIBDIR}/libcustcalc.a; \
|
||||
echo "installed $T${CUSTOMLIBDIR}/libcustcalc.a"; \
|
||||
fi; \
|
||||
fi
|
||||
|
||||
|
6
file.h
6
file.h
@@ -19,8 +19,8 @@
|
||||
* 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.4 $
|
||||
* @(#) $Id: file.h,v 29.4 2001/05/29 00:16:53 chongo Exp $
|
||||
* @(#) $Revision: 29.5 $
|
||||
* @(#) $Id: file.h,v 29.5 2001/06/08 21:00:58 chongo Exp $
|
||||
* @(#) $Source: /usr/local/src/cmd/calc/RCS/file.h,v $
|
||||
*
|
||||
* Under source code control: 1996/05/24 05:55:58
|
||||
@@ -35,7 +35,7 @@
|
||||
#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"
|
||||
#else
|
||||
# include <calc/have_fpos.h>
|
||||
|
6
func.h
6
func.h
@@ -17,8 +17,8 @@
|
||||
* 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: func.h,v 29.3 2001/05/29 00:16:53 chongo Exp $
|
||||
* @(#) $Revision: 29.4 $
|
||||
* @(#) $Id: func.h,v 29.4 2001/06/08 21:00:58 chongo Exp $
|
||||
* @(#) $Source: /usr/local/src/cmd/calc/RCS/func.h,v $
|
||||
*
|
||||
* Under source code control: 1990/02/15 01:48:33
|
||||
@@ -32,7 +32,7 @@
|
||||
#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 "label.h"
|
||||
#else
|
||||
|
6
hash.h
6
hash.h
@@ -17,8 +17,8 @@
|
||||
* 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: hash.h,v 29.3 2001/05/29 00:16:53 chongo Exp $
|
||||
* @(#) $Revision: 29.4 $
|
||||
* @(#) $Id: hash.h,v 29.4 2001/06/08 21:00:58 chongo Exp $
|
||||
* @(#) $Source: /usr/local/src/cmd/calc/RCS/hash.h,v $
|
||||
*
|
||||
* Under source code control: 1995/11/14 23:57:45
|
||||
@@ -33,7 +33,7 @@
|
||||
#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 "shs1.h"
|
||||
# include "md5.h"
|
||||
|
148
help/Makefile
148
help/Makefile
@@ -18,9 +18,9 @@
|
||||
# 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.13 $
|
||||
# @(#) $Id: Makefile,v 29.13 2001/05/29 00:41:11 chongo Exp $
|
||||
# @(#) $Source: /usr/local/src/cmd/calc/help/RCS/Makefile,v $
|
||||
# @(#) $Revision: 29.19 $
|
||||
# @(#) $Id: Makefile,v 29.19 2002/03/12 08:39:14 chongo Exp $
|
||||
# @(#) $Source: /usr/local/src/cmd/calc/cal/../help/RCS/Makefile,v $
|
||||
#
|
||||
# Under source code control: 1991/07/23 06:47:57
|
||||
# File existed as early as: 1991
|
||||
@@ -37,15 +37,41 @@ SHELL= /bin/sh
|
||||
MAKE_FILE = Makefile
|
||||
|
||||
# ${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
|
||||
# ${HELPDIR} where the help directory is installed.
|
||||
# ${INCDIRCALC} where the calc include files are installed
|
||||
#
|
||||
#SHAREDIR= /usr/local/lib
|
||||
SHAREDIR= /usr/share
|
||||
|
||||
#INCDIR= /usr/local/include
|
||||
INCDIR= /usr/include
|
||||
|
||||
#LIBDIR= /usr/local/lib
|
||||
LIBDIR= /usr/lib
|
||||
|
||||
CSHAREDIR= ${SHAREDIR}/calc
|
||||
HELPDIR= ${CSHAREDIR}/help
|
||||
INCDIRCALC= ${INCDIR}/calc
|
||||
|
||||
# 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
|
||||
# when forming the calc rpm, the Makefile is called with T=$RPM_BUILD_ROOT.
|
||||
#
|
||||
# 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
|
||||
#
|
||||
@@ -240,7 +266,8 @@ changes: ../CHANGES
|
||||
|
||||
libcalc: ../LIBRARY
|
||||
rm -f $@
|
||||
${SED} -e 's:$${LIBDIR}:${LIBDIR}:g' < ../LIBRARY > $@
|
||||
${SED} -e 's:$${LIBDIR}:${LIBDIR}:g' \
|
||||
-e 's:$${INCDIRCALC}:${INCDIRCALC}:g' < ../LIBRARY > $@
|
||||
${CHMOD} 0444 $@
|
||||
-@if [ -z "${Q}" ]; then \
|
||||
echo ''; \
|
||||
@@ -391,11 +418,13 @@ full: ${FULL_HELP_FILES} ${MAKE_FILE}
|
||||
# Singular files are the same files as their plural form.
|
||||
#
|
||||
${SINGULAR_FILES}: ${PLURAL_FILES}
|
||||
${Q}for i in ${SINGULAR_FILES}; do \
|
||||
echo "rm -f $${i}"; \
|
||||
rm -f $${i}; \
|
||||
echo "cp $${i}s $${i}"; \
|
||||
cp $${i}s $${i}; \
|
||||
${Q}for i in ${SINGULAR_FILES} /dev/null; do \
|
||||
if [ X"$$i" != X"/dev/null" ]; then \
|
||||
echo "rm -f $${i}"; \
|
||||
rm -f $${i}; \
|
||||
echo "cp $${i}s $${i}"; \
|
||||
cp $${i}s $${i}; \
|
||||
fi; \
|
||||
done
|
||||
-@if [ -z "${Q}" ]; then \
|
||||
echo ''; \
|
||||
@@ -455,8 +484,10 @@ builtin: builtin.top builtin.end ../func.c funclist.sed
|
||||
##
|
||||
|
||||
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; \
|
||||
fi; \
|
||||
done | LANG=C ${SORT}
|
||||
|
||||
distdir:
|
||||
@@ -481,12 +512,14 @@ bsdi: all
|
||||
#
|
||||
detaillist:
|
||||
${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 \
|
||||
echo "WARNING: $$i not under RCS control" 1>&2; \
|
||||
else \
|
||||
echo $$i; \
|
||||
fi; \
|
||||
fi; \
|
||||
done | LANG=C ${SORT}) | ${FMT} -70 | \
|
||||
${SED} -e '1s/xxxxx/DETAIL_HELP=/' -e '2,$$s/^/ /' \
|
||||
-e 's/$$/ \\/' -e '$$s/ \\$$//'
|
||||
@@ -497,24 +530,14 @@ detaillist:
|
||||
#
|
||||
##
|
||||
|
||||
echo_STD_HELP_FILES: ${MAKE_FILE}
|
||||
@echo ${STD_HELP_FILES}
|
||||
|
||||
echo_BLT_HELP_FILES: ${MAKE_FILE}
|
||||
@echo ${BLT_HELP_FILES}
|
||||
|
||||
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; \
|
||||
echo_inst_files:
|
||||
${Q}for i in ${STD_HELP_FILES} full ${BLT_HELP_FILES} \
|
||||
builtin ${DETAIL_HELP} ${SINGULAR_FILES} /dev/null; do \
|
||||
if [ X"$$i" != X"/dev/null" ]; then \
|
||||
echo __file__ ${HELPDIR}/$$i; \
|
||||
fi; \
|
||||
done
|
||||
@echo ${HELPDIR}/obj
|
||||
${Q}echo __file__ ${HELPDIR}/obj
|
||||
|
||||
##
|
||||
#
|
||||
@@ -534,47 +557,62 @@ clobber:
|
||||
|
||||
install: all
|
||||
-${Q}if [ ! -d ${SHAREDIR} ]; then \
|
||||
echo mkdir ${SHAREDIR}; \
|
||||
mkdir ${SHAREDIR}; \
|
||||
echo ${CHMOD} 0755 ${SHAREDIR}; \
|
||||
${CHMOD} 0755 ${SHAREDIR}; \
|
||||
echo mkdir $T${SHAREDIR}; \
|
||||
mkdir $T${SHAREDIR}; \
|
||||
if [ ! -d "$T${SHAREDIR}" ]; then \
|
||||
echo mkdir -p "$T${SHAREDIR}"; \
|
||||
mkdir -p "$T${SHAREDIR}"; \
|
||||
fi; \
|
||||
echo ${CHMOD} 0755 $T${SHAREDIR}; \
|
||||
${CHMOD} 0755 $T${SHAREDIR}; \
|
||||
else \
|
||||
true; \
|
||||
fi
|
||||
-${Q}if [ ! -d ${CSHAREDIR} ]; then \
|
||||
echo mkdir ${CSHAREDIR}; \
|
||||
mkdir ${CSHAREDIR}; \
|
||||
echo ${CHMOD} 0755 ${CSHAREDIR}; \
|
||||
${CHMOD} 0755 ${CSHAREDIR}; \
|
||||
-${Q}if [ ! -d $T${CSHAREDIR} ]; then \
|
||||
echo mkdir $T${CSHAREDIR}; \
|
||||
mkdir $T${CSHAREDIR}; \
|
||||
if [ ! -d "$T${CSHAREDIR}" ]; then \
|
||||
echo mkdir -p "$T${CSHAREDIR}"; \
|
||||
mkdir -p "$T${CSHAREDIR}"; \
|
||||
fi; \
|
||||
echo ${CHMOD} 0755 $T${CSHAREDIR}; \
|
||||
${CHMOD} 0755 $T${CSHAREDIR}; \
|
||||
else \
|
||||
true; \
|
||||
fi
|
||||
-${Q}if [ ! -d ${HELPDIR} ]; then \
|
||||
echo mkdir ${HELPDIR}; \
|
||||
mkdir ${HELPDIR}; \
|
||||
echo ${CHMOD} 0755 ${HELPDIR}; \
|
||||
${CHMOD} 0755 ${HELPDIR}; \
|
||||
-${Q}if [ ! -d $T${HELPDIR} ]; then \
|
||||
echo mkdir $T${HELPDIR}; \
|
||||
mkdir $T${HELPDIR}; \
|
||||
if [ ! -d "$T${HELPDIR}" ]; then \
|
||||
echo mkdir -p "$T${HELPDIR}"; \
|
||||
mkdir -p "$T${HELPDIR}"; \
|
||||
fi; \
|
||||
echo ${CHMOD} 0755 $T${HELPDIR}; \
|
||||
${CHMOD} 0755 $T${HELPDIR}; \
|
||||
else \
|
||||
true; \
|
||||
fi
|
||||
-${Q}for i in ${STD_HELP_FILES} ${BLT_HELP_FILES} builtin \
|
||||
full ${DETAIL_HELP} ${SINGULAR_FILES}; do \
|
||||
if ${CMP} -s $$i ${HELPDIR}/$$i; then \
|
||||
full ${DETAIL_HELP} ${SINGULAR_FILES} /dev/null; do \
|
||||
if [ "$$i" = "/dev/null" ]; then \
|
||||
continue; \
|
||||
fi; \
|
||||
if ${CMP} -s $$i $T${HELPDIR}/$$i; then \
|
||||
true; \
|
||||
else \
|
||||
rm -f ${HELPDIR}/$$i.new; \
|
||||
cp -f $$i ${HELPDIR}/$$i.new; \
|
||||
${CHMOD} 0444 ${HELPDIR}/$$i.new; \
|
||||
mv -f ${HELPDIR}/$$i.new ${HELPDIR}/$$i; \
|
||||
echo "installed ${HELPDIR}/$$i"; \
|
||||
rm -f $T${HELPDIR}/$$i.new; \
|
||||
cp -f $$i $T${HELPDIR}/$$i.new; \
|
||||
${CHMOD} 0444 $T${HELPDIR}/$$i.new; \
|
||||
mv -f $T${HELPDIR}/$$i.new $T${HELPDIR}/$$i; \
|
||||
echo "installed $T${HELPDIR}/$$i"; \
|
||||
fi; \
|
||||
done
|
||||
-${Q}if ${CMP} -s obj.file ${HELPDIR}/obj; then \
|
||||
-${Q}if ${CMP} -s obj.file $T${HELPDIR}/obj; then \
|
||||
true; \
|
||||
else \
|
||||
rm -f ${HELPDIR}/obj.new; \
|
||||
cp -f obj.file ${HELPDIR}/obj.new; \
|
||||
${CHMOD} 0444 ${HELPDIR}/obj.new; \
|
||||
mv -f ${HELPDIR}/obj.new ${HELPDIR}/obj; \
|
||||
echo "installed ${HELPDIR}/obj"; \
|
||||
rm -f $T${HELPDIR}/obj.new; \
|
||||
cp -f obj.file $T${HELPDIR}/obj.new; \
|
||||
${CHMOD} 0444 $T${HELPDIR}/obj.new; \
|
||||
mv -f $T${HELPDIR}/obj.new $T${HELPDIR}/obj; \
|
||||
echo "installed $T${HELPDIR}/obj"; \
|
||||
fi
|
||||
|
6
help/im
6
help/im
@@ -20,7 +20,7 @@ LIMITS
|
||||
none
|
||||
|
||||
LINK LIBRARY
|
||||
COMPLEX *cimag(COMPLEX *x)
|
||||
COMPLEX *c_imag(COMPLEX *x)
|
||||
|
||||
SEE ALSO
|
||||
re
|
||||
@@ -41,8 +41,8 @@ SEE ALSO
|
||||
## 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.2 $
|
||||
## @(#) $Id: im,v 29.2 2000/06/07 14:02:33 chongo Exp $
|
||||
## @(#) $Revision: 29.3 $
|
||||
## @(#) $Id: im,v 29.3 2002/03/12 09:38:26 chongo Exp $
|
||||
## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/im,v $
|
||||
##
|
||||
## Under source code control: 1995/10/05 04:52:26
|
||||
|
6
help/re
6
help/re
@@ -20,7 +20,7 @@ LIMITS
|
||||
none
|
||||
|
||||
LINK LIBRARY
|
||||
COMPLEX *cimag(COMPLEX *x)
|
||||
COMPLEX *c_imag(COMPLEX *x)
|
||||
|
||||
SEE ALSO
|
||||
im
|
||||
@@ -41,8 +41,8 @@ SEE ALSO
|
||||
## 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.2 $
|
||||
## @(#) $Id: re,v 29.2 2000/06/07 14:02:33 chongo Exp $
|
||||
## @(#) $Revision: 29.3 $
|
||||
## @(#) $Id: re,v 29.3 2002/03/12 09:38:26 chongo Exp $
|
||||
## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/re,v $
|
||||
##
|
||||
## Under source code control: 1995/10/05 04:52:27
|
||||
|
@@ -12,8 +12,7 @@ DESCRIPTION
|
||||
|
||||
Calc version strings can be of the form:
|
||||
|
||||
x.y.ztw.v
|
||||
x.y.ztw
|
||||
x.y.z.w
|
||||
x.y.z
|
||||
x.y
|
||||
|
||||
@@ -22,7 +21,7 @@ DESCRIPTION
|
||||
|
||||
EXAMPLE
|
||||
> version()
|
||||
"2.11.5t4.1"
|
||||
"2.11.5.4"
|
||||
|
||||
LIMITS
|
||||
none
|
||||
@@ -49,8 +48,8 @@ SEE ALSO
|
||||
## 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.2 $
|
||||
## @(#) $Id: version,v 29.2 2001/05/29 00:43:54 chongo Exp $
|
||||
## @(#) $Revision: 29.3 $
|
||||
## @(#) $Id: version,v 29.3 2001/06/09 23:32:45 chongo Exp $
|
||||
## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/version,v $
|
||||
##
|
||||
## 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.
|
||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
* @(#) $Revision: 29.3 $
|
||||
* @(#) $Id: hist.h,v 29.3 2001/03/17 21:31:47 chongo Exp $
|
||||
* @(#) $Revision: 29.4 $
|
||||
* @(#) $Id: hist.h,v 29.4 2002/03/12 09:40:57 chongo Exp $
|
||||
* @(#) $Source: /usr/local/src/cmd/calc/RCS/hist.h,v $
|
||||
*
|
||||
* Under source code control: 1993/05/02 20:09:20
|
||||
@@ -50,7 +50,11 @@
|
||||
#define HOMECHAR '~' /* char which indicates home directory */
|
||||
#define DOTCHAR '.' /* char which indicates current directory */
|
||||
#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 */
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
|
29
input.c
29
input.c
@@ -17,8 +17,8 @@
|
||||
* 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.5 $
|
||||
* @(#) $Id: input.c,v 29.5 2001/03/17 21:31:47 chongo Exp $
|
||||
* @(#) $Revision: 29.6 $
|
||||
* @(#) $Id: input.c,v 29.6 2002/03/12 09:40:57 chongo Exp $
|
||||
* @(#) $Source: /usr/local/src/cmd/calc/RCS/input.c,v $
|
||||
*
|
||||
* Under source code control: 1990/02/15 01:48:16
|
||||
@@ -46,6 +46,12 @@
|
||||
#include <unistd.h>
|
||||
#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 "conf.h"
|
||||
#include "hist.h"
|
||||
@@ -816,11 +822,12 @@ runrcfiles(void)
|
||||
* given:
|
||||
* sbuf stat of the inode in question
|
||||
*/
|
||||
|
||||
static int
|
||||
isinoderead(struct stat *sbuf)
|
||||
{
|
||||
int i;
|
||||
#if defined(_WIN32)
|
||||
#if defined(_WIN32) || defined(__MSDOS__)
|
||||
char fullpathname[_MAX_PATH];
|
||||
#endif
|
||||
|
||||
@@ -832,11 +839,11 @@ isinoderead(struct stat *sbuf)
|
||||
|
||||
/* scan the entire readset */
|
||||
for (i=0; i < maxreadset; ++i) {
|
||||
#if defined(_WIN32)
|
||||
#if defined(_WIN32) || defined(__MSDOS__)
|
||||
if (readset[i].active &&
|
||||
strcmp(readset[i].path,
|
||||
_fullpath(fullpathname,cip->i_name,
|
||||
_MAX_PATH)) == 0) {
|
||||
strcasecmp(readset[i].path,
|
||||
_fullpath(fullpathname,cip->i_name,
|
||||
_MAX_PATH)) == 0) {
|
||||
/* found a match */
|
||||
return i;
|
||||
}
|
||||
@@ -954,14 +961,18 @@ addreadset(char *name, char *path, struct stat *sbuf)
|
||||
return -1;
|
||||
}
|
||||
strcpy(readset[ret].name, name);
|
||||
#if defined(_WIN32)
|
||||
#if defined(_WIN32) || defined(__MSDOS__)
|
||||
/*
|
||||
* For WIN32, _fullpath expands the path to a fully qualified
|
||||
* path name, which under WIN32 FAT and NTFS is unique, just
|
||||
* like UNIX inodes. _fullpath also allocated the memory for
|
||||
* 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 */
|
||||
readset[ret].path = (char *)malloc(strlen(path)+1);
|
||||
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.
|
||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
* @(#) $Revision: 29.3 $
|
||||
* @(#) $Id: jump.h,v 29.3 2001/05/29 00:16:53 chongo Exp $
|
||||
* @(#) $Revision: 29.4 $
|
||||
* @(#) $Id: jump.h,v 29.4 2001/06/08 21:00:58 chongo Exp $
|
||||
* @(#) $Source: /usr/local/src/cmd/calc/RCS/jump.h,v $
|
||||
*
|
||||
* Under source code control: 1994/06/29 04:03:55
|
||||
@@ -66,7 +66,7 @@
|
||||
#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"
|
||||
#else
|
||||
# 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.
|
||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
* @(#) $Revision: 29.3 $
|
||||
* @(#) $Id: label.h,v 29.3 2001/05/29 00:16:53 chongo Exp $
|
||||
* @(#) $Revision: 29.4 $
|
||||
* @(#) $Id: label.h,v 29.4 2001/06/08 21:00:58 chongo Exp $
|
||||
* @(#) $Source: /usr/local/src/cmd/calc/RCS/label.h,v $
|
||||
*
|
||||
* Under source code control: 1990/02/15 01:48:33
|
||||
@@ -32,7 +32,7 @@
|
||||
#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"
|
||||
#else
|
||||
# include <calc/zmath.h>
|
||||
|
@@ -17,8 +17,8 @@
|
||||
* 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.7 $
|
||||
* @(#) $Id: lib_calc.c,v 29.7 2001/04/08 22:05:40 chongo Exp $
|
||||
* @(#) $Revision: 29.8 $
|
||||
* @(#) $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 $
|
||||
*
|
||||
* Under source code control: 1996/06/17 18:06:19
|
||||
@@ -217,6 +217,11 @@ libcalc_call_me_first(void)
|
||||
*/
|
||||
if (program != NULL) {
|
||||
p = strrchr(program, '/');
|
||||
#if defined(_WIN32) || defined(__MSDOS__)
|
||||
if (p == NULL) {
|
||||
p = strrchr(program, '\\');
|
||||
}
|
||||
#endif
|
||||
if (p == NULL) {
|
||||
base_name = program;
|
||||
} else {
|
||||
|
@@ -17,8 +17,8 @@
|
||||
* 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.4 $
|
||||
* @(#) $Id: math_error.h,v 29.4 2001/05/29 00:16:53 chongo Exp $
|
||||
* @(#) $Revision: 29.5 $
|
||||
* @(#) $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 $
|
||||
*
|
||||
* Under source code control: 1997/03/23 18:37:10
|
||||
@@ -33,7 +33,7 @@
|
||||
#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"
|
||||
#else
|
||||
# include <calc/win32dll.h>
|
||||
|
@@ -17,8 +17,8 @@
|
||||
* 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.5 $
|
||||
* @(#) $Id: opcodes.h,v 29.5 2001/05/29 00:16:53 chongo Exp $
|
||||
* @(#) $Revision: 29.6 $
|
||||
* @(#) $Id: opcodes.h,v 29.6 2001/06/08 21:00:58 chongo Exp $
|
||||
* @(#) $Source: /usr/local/src/cmd/calc/RCS/opcodes.h,v $
|
||||
*
|
||||
* Under source code control: 1990/02/15 01:48:35
|
||||
@@ -32,7 +32,7 @@
|
||||
#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"
|
||||
#else
|
||||
# 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.
|
||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
* @(#) $Revision: 29.3 $
|
||||
* @(#) $Id: prime.h,v 29.3 2001/05/29 00:16:53 chongo Exp $
|
||||
* @(#) $Revision: 29.4 $
|
||||
* @(#) $Id: prime.h,v 29.4 2001/06/08 21:00:58 chongo Exp $
|
||||
* @(#) $Source: /usr/local/src/cmd/calc/RCS/prime.h,v $
|
||||
*
|
||||
* Under source code control: 1994/06/04 03:26:15
|
||||
@@ -33,7 +33,7 @@
|
||||
#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 "have_const.h"
|
||||
#else
|
||||
|
6
qmath.h
6
qmath.h
@@ -17,8 +17,8 @@
|
||||
* 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.4 $
|
||||
* @(#) $Id: qmath.h,v 29.4 2001/05/29 00:16:53 chongo Exp $
|
||||
* @(#) $Revision: 29.5 $
|
||||
* @(#) $Id: qmath.h,v 29.5 2001/06/08 21:00:58 chongo Exp $
|
||||
* @(#) $Source: /usr/local/src/cmd/calc/RCS/qmath.h,v $
|
||||
*
|
||||
* Under source code control: 1993/07/30 19:42:47
|
||||
@@ -32,7 +32,7 @@
|
||||
#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"
|
||||
#else
|
||||
# include <calc/zmath.h>
|
||||
|
@@ -17,9 +17,9 @@
|
||||
# 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.11 $
|
||||
# @(#) $Id: Makefile,v 29.11 2001/05/28 23:54:53 chongo Exp $
|
||||
# @(#) $Source: /usr/local/src/cmd/calc/sample/RCS/Makefile,v $
|
||||
# @(#) $Revision: 29.15 $
|
||||
# @(#) $Id: Makefile,v 29.15 2002/03/12 08:41:05 chongo Exp $
|
||||
# @(#) $Source: /usr/local/src/cmd/calc/cal/../sample/RCS/Makefile,v $
|
||||
#
|
||||
# Under source code control: 1997/04/19 22:46:49
|
||||
# File existed as early as: 1997
|
||||
@@ -104,6 +104,22 @@ LIBDIR= /usr/lib
|
||||
CSHAREDIR= ${SHAREDIR}/calc
|
||||
HELPDIR= ${LIBDIR}/help
|
||||
|
||||
# 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
|
||||
# when forming the calc rpm, the Makefile is called with T=$RPM_BUILD_ROOT.
|
||||
#
|
||||
# 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
|
||||
# a default here just in case you want to build from this directory.
|
||||
#
|
||||
@@ -343,8 +359,10 @@ many_random: many_random.o ../libcalc.a
|
||||
##
|
||||
|
||||
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; \
|
||||
fi; \
|
||||
done
|
||||
|
||||
distdir:
|
||||
@@ -380,11 +398,14 @@ depend:
|
||||
-${Q}rm -rf skel
|
||||
${Q}mkdir skel
|
||||
${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' \
|
||||
"$$i" > "skel/sample/$$i"; \
|
||||
fi; \
|
||||
done
|
||||
-${Q}for i in ${H_SRC} /dev/null; do \
|
||||
if [ X"$$i" != X"/dev/null" ]; then \
|
||||
if [ X"$$i" != X"/dev/null" ]; then \
|
||||
tag="`echo $$i | ${SED} 's/[\.+,:]/_/g'`"; \
|
||||
echo "#if !defined($$tag)" > "skel/sample/$$i"; \
|
||||
@@ -393,18 +414,21 @@ depend:
|
||||
>> "skel/sample/$$i"; \
|
||||
echo '#endif /* '"$$tag"' */' >> "skel/sample/$$i"; \
|
||||
fi; \
|
||||
fi; \
|
||||
done
|
||||
${Q}(cd ..; ${MAKE} hsrc)
|
||||
${Q}for i in `cd ..; ${MAKE} h_list 2>&1 | \
|
||||
${SED} -e '/Entering directory/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'`"; \
|
||||
echo "#if !defined($$tag)" > "skel/$$i"; \
|
||||
echo "#define $$tag" >> "skel/$$i"; \
|
||||
${SED} -n '/^#[ ]*include[ ]*"/p' "../$$i" \
|
||||
>> "skel/$$i"; \
|
||||
echo '#endif /* '"$$tag"' */' >> "skel/$$i"; \
|
||||
fi; \
|
||||
done
|
||||
-${Q}rm -f skel/sample/makedep.out
|
||||
${Q}echo sample/skel formed
|
||||
@@ -412,8 +436,10 @@ depend:
|
||||
${Q}echo "# DO NOT DELETE THIS LINE -- make depend depends on it." > \
|
||||
skel/sample/makedep.out
|
||||
${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/'; \
|
||||
fi; \
|
||||
done >> skel/sample/makedep.out
|
||||
${Q}echo sample dependency list formed
|
||||
${Q}echo forming new sample/Makefile
|
||||
@@ -445,7 +471,7 @@ depend:
|
||||
#
|
||||
##
|
||||
|
||||
echo_install.list: Makefile
|
||||
echo_inst_files: Makefile
|
||||
|
||||
|
||||
##
|
||||
|
@@ -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.
|
||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
* @(#) $Revision: 29.3 $
|
||||
* @(#) $Id: string.h,v 29.3 2001/05/29 00:16:53 chongo Exp $
|
||||
* @(#) $Revision: 29.4 $
|
||||
* @(#) $Id: string.h,v 29.4 2001/06/08 21:00:58 chongo Exp $
|
||||
* @(#) $Source: /usr/local/src/cmd/calc/RCS/string.h,v $
|
||||
*
|
||||
* Under source code control: 1990/02/15 01:48:36
|
||||
@@ -32,7 +32,7 @@
|
||||
#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"
|
||||
#else
|
||||
# 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.
|
||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
* @(#) $Revision: 29.3 $
|
||||
* @(#) $Id: symbol.h,v 29.3 2001/05/29 00:16:53 chongo Exp $
|
||||
* @(#) $Revision: 29.4 $
|
||||
* @(#) $Id: symbol.h,v 29.4 2001/06/08 21:00:58 chongo Exp $
|
||||
* @(#) $Source: /usr/local/src/cmd/calc/RCS/symbol.h,v $
|
||||
*
|
||||
* Under source code control: 1990/02/15 01:48:37
|
||||
@@ -32,7 +32,7 @@
|
||||
#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"
|
||||
#else
|
||||
# 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.
|
||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
* @(#) $Revision: 29.3 $
|
||||
* @(#) $Id: token.h,v 29.3 2001/05/29 00:16:53 chongo Exp $
|
||||
* @(#) $Revision: 29.4 $
|
||||
* @(#) $Id: token.h,v 29.4 2001/06/08 21:00:58 chongo Exp $
|
||||
* @(#) $Source: /usr/local/src/cmd/calc/RCS/token.h,v $
|
||||
*
|
||||
* Under source code control: 1990/02/15 01:48:37
|
||||
@@ -32,7 +32,7 @@
|
||||
#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"
|
||||
#else
|
||||
# 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.
|
||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
* @(#) $Revision: 29.6 $
|
||||
* @(#) $Id: value.h,v 29.6 2001/05/29 00:16:53 chongo Exp $
|
||||
* @(#) $Revision: 29.7 $
|
||||
* @(#) $Id: value.h,v 29.7 2001/06/08 21:00:58 chongo Exp $
|
||||
* @(#) $Source: /usr/local/src/cmd/calc/RCS/value.h,v $
|
||||
*
|
||||
* Under source code control: 1993/07/30 19:42:47
|
||||
@@ -32,7 +32,7 @@
|
||||
#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 "cmath.h"
|
||||
# include "config.h"
|
||||
|
182
version.c
182
version.c
@@ -19,8 +19,8 @@
|
||||
* 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.29 $
|
||||
* @(#) $Id: version.c,v 29.29 2001/06/01 21:44:44 chongo Exp $
|
||||
* @(#) $Revision: 29.38 $
|
||||
* @(#) $Id: version.c,v 29.38 2002/03/12 11:00:08 chongo Exp $
|
||||
* @(#) $Source: /usr/local/src/cmd/calc/RCS/version.c,v $
|
||||
*
|
||||
* Under source code control: 1990/05/22 11:00:58
|
||||
@@ -32,6 +32,9 @@
|
||||
|
||||
|
||||
#include <stdio.h>
|
||||
#include <errno.h>
|
||||
#include <string.h>
|
||||
|
||||
#if defined(CALC_VER)
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
@@ -43,7 +46,8 @@ static char *program;
|
||||
#define MAJOR_VER 2 /* major version */
|
||||
#define MINOR_VER 11 /* minor version */
|
||||
#define MAJOR_PATCH 5 /* patch level or 0 if no patch */
|
||||
#define MINOR_PATCH "4.3" /* test number or empty string if no patch */
|
||||
#define MINOR_PATCH 7 /* test number or 0 if no minor patch */
|
||||
|
||||
|
||||
/*
|
||||
* calc version constants
|
||||
@@ -51,7 +55,7 @@ static char *program;
|
||||
int calc_major_ver = MAJOR_VER;
|
||||
int calc_minor_ver = MINOR_VER;
|
||||
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";
|
||||
|
||||
|
||||
#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
|
||||
*
|
||||
* This function returns a malloced version string. This version
|
||||
* string does not contain the title, just:
|
||||
*
|
||||
* x.y.ztw
|
||||
* x.y.z.w
|
||||
* x.y.z
|
||||
* x.y
|
||||
*/
|
||||
@@ -114,15 +134,17 @@ version(void)
|
||||
/*
|
||||
* form the version buffer
|
||||
*/
|
||||
if (sizeof(MINOR_PATCH) > 1) {
|
||||
sprintf(verbuf,
|
||||
"%d.%d.%dt%s", calc_major_ver, calc_minor_ver,
|
||||
calc_major_patch, calc_minor_patch);
|
||||
if (MINOR_PATCH > 0) {
|
||||
snprintf(verbuf, BUFSIZ,
|
||||
"%d.%d.%d.%d", calc_major_ver, calc_minor_ver,
|
||||
calc_major_patch, calc_minor_patch);
|
||||
} else if (MAJOR_PATCH > 0) {
|
||||
sprintf(verbuf,
|
||||
"%d.%d.%d", calc_major_ver, calc_minor_ver, calc_major_patch);
|
||||
snprintf(verbuf, BUFSIZ,
|
||||
"%d.%d.%d", calc_major_ver,
|
||||
calc_minor_ver, calc_major_patch);
|
||||
} 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);
|
||||
if (stored_version == NULL) {
|
||||
fprintf(stderr, "%s: version formation value\n", program);
|
||||
exit(2);
|
||||
exit(1);
|
||||
}
|
||||
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-0
|
||||
* x.y-0
|
||||
* x.y.z.w-r
|
||||
* x.y.z-r
|
||||
* x.y-r
|
||||
*
|
||||
* where 'r' comes from the content of the release file.
|
||||
*/
|
||||
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
|
||||
*/
|
||||
if (sizeof(MINOR_PATCH) > 1) {
|
||||
printf("%d.%d.%d-%s\n", calc_major_ver, calc_minor_ver,
|
||||
calc_major_patch, calc_minor_patch);
|
||||
if (MINOR_PATCH > 0) {
|
||||
printf("%d.%d.%d.%d-%s\n", calc_major_ver, calc_minor_ver,
|
||||
calc_major_patch, calc_minor_patch, buf);
|
||||
} else if (MAJOR_PATCH > 0) {
|
||||
printf("%d.%d.%d-0\n", calc_major_ver, calc_minor_ver,
|
||||
calc_major_patch);
|
||||
printf("%d.%d.%d-%s\n", calc_major_ver, calc_minor_ver,
|
||||
calc_major_patch, buf);
|
||||
} 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;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 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
|
||||
*/
|
||||
void
|
||||
print_rpm_version(void)
|
||||
print_rpm_major(void)
|
||||
{
|
||||
/*
|
||||
* form the version buffer
|
||||
*/
|
||||
if (MAJOR_PATCH > 0) {
|
||||
printf("%d.%d.%d\n", calc_major_ver, calc_minor_ver,
|
||||
calc_major_patch);
|
||||
printf("%d.%d.%d\n", calc_major_ver, calc_minor_ver,
|
||||
calc_major_patch);
|
||||
} else {
|
||||
printf("%d.%d\n", calc_major_ver, calc_minor_ver);
|
||||
printf("%d.%d\n", calc_major_ver, calc_minor_ver);
|
||||
}
|
||||
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
|
||||
* 0
|
||||
* r
|
||||
*
|
||||
* where 'r' comes from the content of the release file.
|
||||
*/
|
||||
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
|
||||
*/
|
||||
if (sizeof(MINOR_PATCH) > 1) {
|
||||
printf("%s\n", calc_minor_patch);
|
||||
} else {
|
||||
printf("0\n");
|
||||
}
|
||||
printf("%s\n", buf);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -227,17 +296,26 @@ print_rpm_release(void)
|
||||
int
|
||||
main(int argc, char *argv[])
|
||||
{
|
||||
program = argv[0];
|
||||
if (argc == 2 && strcmp(argv[1], "-R") == 0) {
|
||||
print_rpm_version_release();
|
||||
} else if (argc == 2 && strcmp(argv[1], "-v") == 0) {
|
||||
print_rpm_version();
|
||||
} else if (argc == 2 && strcmp(argv[1], "-r") == 0) {
|
||||
print_rpm_release();
|
||||
} else {
|
||||
printf("%s\n", version());
|
||||
}
|
||||
return 0;
|
||||
program = argv[0];
|
||||
if (argc == 3 && strcmp(argv[1], "-r") == 0) {
|
||||
print_rpm_version(argv[2]);
|
||||
|
||||
} else if (argc == 3 && strcmp(argv[1], "-R") == 0) {
|
||||
print_rpm_release(argv[2]);
|
||||
|
||||
} else if (argc == 2 && strcmp(argv[1], "-V") == 0) {
|
||||
print_rpm_major();
|
||||
|
||||
} 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 */
|
||||
|
6
zmath.h
6
zmath.h
@@ -17,8 +17,8 @@
|
||||
* 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.6 $
|
||||
* @(#) $Id: zmath.h,v 29.6 2001/05/29 00:16:53 chongo Exp $
|
||||
* @(#) $Revision: 29.7 $
|
||||
* @(#) $Id: zmath.h,v 29.7 2001/06/08 21:00:58 chongo Exp $
|
||||
* @(#) $Source: /usr/local/src/cmd/calc/RCS/zmath.h,v $
|
||||
*
|
||||
* Under source code control: 1993/07/30 19:42:48
|
||||
@@ -38,7 +38,7 @@
|
||||
#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 "alloc.h"
|
||||
# include "endian_calc.h"
|
||||
|
6
zrand.h
6
zrand.h
@@ -17,8 +17,8 @@
|
||||
* 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.4 $
|
||||
* @(#) $Id: zrand.h,v 29.4 2001/05/29 00:16:53 chongo Exp $
|
||||
* @(#) $Revision: 29.5 $
|
||||
* @(#) $Id: zrand.h,v 29.5 2001/06/08 21:00:58 chongo Exp $
|
||||
* @(#) $Source: /usr/local/src/cmd/calc/RCS/zrand.h,v $
|
||||
*
|
||||
* Under source code control: 1995/01/07 09:45:26
|
||||
@@ -37,7 +37,7 @@
|
||||
#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 "have_const.h"
|
||||
#else
|
||||
|
@@ -17,8 +17,8 @@
|
||||
* 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: zrandom.h,v 29.3 2001/05/29 00:16:53 chongo Exp $
|
||||
* @(#) $Revision: 29.4 $
|
||||
* @(#) $Id: zrandom.h,v 29.4 2001/06/08 21:00:58 chongo Exp $
|
||||
* @(#) $Source: /usr/local/src/cmd/calc/RCS/zrandom.h,v $
|
||||
*
|
||||
* Under source code control: 1997/02/15 04:01:56
|
||||
@@ -33,7 +33,7 @@
|
||||
#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 "have_const.h"
|
||||
#else
|
||||
|
Reference in New Issue
Block a user