From 0514dc0de91075b03c4d68285c295173c677f952 Mon Sep 17 00:00:00 2001 From: Landon Curt Noll Date: Tue, 14 Dec 1999 12:23:24 -0800 Subject: [PATCH] Release calc version 2.11.0t10.5.1 --- BUGS | 85 +++--- CHANGES | 207 +------------- COPYING | 192 ------------- COPYING-LGPL | 504 ---------------------------------- HOWTO.INSTALL | 26 -- LIBRARY | 55 +--- Makefile | 382 +++++++++++++------------- README | 31 +-- addop.c | 46 +--- align32.c | 36 +-- alloc.h | 29 +- assocfunc.c | 32 +-- blkcpy.c | 33 +-- blkcpy.h | 31 +-- block.c | 45 +-- block.h | 45 +-- byteswap.c | 41 ++- byteswap.h | 40 ++- cal/beer.cal | 50 ---- cal/bigprime.cal | 49 ---- cal/bindings | 75 ----- cal/hello.cal | 36 --- cal/mersenne.cal | 61 ---- cal/pell.cal | 94 ------- cal/pix.cal | 71 ----- cal/pollard.cal | 52 ---- cal/psqrt.cal | 74 ----- cal/qtime.cal | 68 ----- cal/solve.cal | 69 ----- cal/sumsq.cal | 65 ----- cal/test1700.cal | 32 --- cal/test3100.cal | 40 --- cal/test5100.cal | 71 ----- cal/test5200.cal | 53 ---- cal/test8400.cal | 48 ---- cal/unitfrac.cal | 55 ---- cal/varargs.cal | 54 ---- calc.c | 237 +++++++--------- calc.h | 42 +-- calc.man | 379 ++++--------------------- calcerr.tbl | 37 --- calcerr_c.awk | 30 -- calcerr_c.sed | 30 -- calcerr_h.awk | 30 -- calcerr_h.sed | 30 -- check.awk | 150 ++++------ cmath.h | 29 +- codegen.c | 222 ++++----------- comfunc.c | 64 +---- commath.c | 32 +-- config.c | 169 +++--------- config.h | 72 +++-- const.c | 30 +- cscript/Makefile | 247 ----------------- cscript/mersenne.calc | 47 ---- cscript/piforever.calc | 37 --- cscript/plus.calc | 53 ---- cscript/simple.calc | 35 --- custom.c | 43 +-- custom.h | 46 ++-- custom/CUSTOM_CAL | 58 ++-- custom/HOW_TO_ADD | 31 +-- custom/Makefile | 78 +++--- custom/argv | 26 -- custom/argv.cal | 46 +--- custom/c_argv.c | 38 +-- custom/c_devnull.c | 38 +-- custom/c_help.c | 38 +-- custom/c_pzasusb8.c | 32 +-- custom/c_sysinfo.c | 90 +++--- custom/custtbl.c | 42 +-- custom/devnull | 26 -- custom/halflen.cal | 46 +--- custom/help | 26 -- custom/pzasusb8 | 26 -- custom/pzasusb8.cal | 32 +-- custom/sysinfo | 26 -- endian.c | 54 ++-- file.c | 33 +-- file.h | 32 +-- fposval.c | 52 ++-- func.c | 194 ++++--------- func.h | 29 +- hash.c | 46 ++-- hash.h | 40 ++- have_const.c | 52 ++-- have_fpos.c | 52 ++-- have_getpgid.c | 53 ++-- have_getprid.c | 54 ++-- have_getsid.c | 54 ++-- have_gettime.c | 54 ++-- have_memmv.c | 54 ++-- have_newstr.c | 52 ++-- have_offscl.c | 54 ++-- have_posscl.c | 55 ++-- have_rusage.c | 54 ++-- have_stdvs.c | 52 ++-- have_strdup.c | 54 ++-- have_uid_t.c | 52 ++-- have_ustat.c | 54 ++-- have_varvs.c | 52 ++-- help.c | 201 ++------------ help/Makefile | 158 ++++------- help/abs | 28 +- help/access | 28 +- help/acos | 28 +- help/acosh | 28 +- help/acot | 28 +- help/acoth | 28 +- help/acsc | 28 +- help/acsch | 28 +- help/address | 28 +- help/agd | 28 +- help/append | 28 +- help/appr | 28 +- help/archive | 26 -- help/arg | 28 +- help/argv | 80 ------ help/arrow | 28 +- help/asec | 28 +- help/asech | 28 +- help/asin | 28 +- help/asinh | 28 +- help/assign | 28 +- help/assoc | 28 +- help/atan | 28 +- help/atan2 | 28 +- help/atanh | 28 +- help/avg | 28 +- help/base | 28 +- help/bit | 28 +- help/blk | 28 +- help/blkcpy | 28 +- help/blkfree | 28 +- help/blocks | 28 +- help/bround | 28 +- help/btrunc | 28 +- help/builtin.end | 26 -- help/builtin.top | 25 -- help/calclevel | 28 +- help/ceil | 28 +- help/cfappr | 28 +- help/cfsim | 28 +- help/char | 28 +- help/cmdbuf | 28 +- help/cmp | 28 +- help/comb | 28 +- help/command | 66 ++--- help/config | 94 +------ help/conj | 28 +- help/contrib | 29 +- help/cos | 30 +- help/cosh | 28 +- help/cot | 28 +- help/coth | 28 +- help/count | 28 +- help/cp | 28 +- help/credit | 71 +---- help/csc | 28 +- help/csch | 28 +- help/ctime | 28 +- help/custom | 30 +- help/define | 26 -- help/delete | 28 +- help/den | 28 +- help/dereference | 28 +- help/det | 28 +- help/digit | 28 +- help/digits | 28 +- help/dp | 28 +- help/environment | 31 +-- help/epsilon | 28 +- help/errcount | 28 +- help/errmax | 28 +- help/errno | 28 +- help/error | 28 +- help/errorcodes.hdr | 25 -- help/errorcodes.sed | 26 -- help/eval | 28 +- help/exp | 28 +- help/expression | 26 -- help/fact | 28 +- help/factor | 28 +- help/fclose | 28 +- help/fcnt | 28 +- help/feof | 28 +- help/ferror | 28 +- help/fflush | 28 +- help/fgetc | 28 +- help/fgetfield | 28 +- help/fgetline | 28 +- help/fgets | 28 +- help/fgetstr | 28 +- help/fib | 28 +- help/file | 26 -- help/files | 28 +- help/floor | 28 +- help/fopen | 28 +- help/forall | 28 +- help/fprintf | 28 +- help/fputc | 28 +- help/fputs | 28 +- help/fputstr | 28 +- help/frac | 28 +- help/free | 28 +- help/freeglobals | 28 +- help/freeredc | 28 +- help/freestatics | 28 +- help/frem | 28 +- help/freopen | 28 +- help/fscan | 28 +- help/fscanf | 28 +- help/fseek | 28 +- help/fsize | 28 +- help/ftell | 28 +- help/funclist.sed | 26 -- help/gcd | 28 +- help/gcdrem | 28 +- help/gd | 28 +- help/getenv | 28 +- help/hash | 28 +- help/head | 28 +- help/help | 38 +-- help/highbit | 28 +- help/history | 26 -- help/hmean | 28 +- help/hnrmod | 28 +- help/hypot | 28 +- help/ilog | 28 +- help/ilog10 | 28 +- help/ilog2 | 28 +- help/im | 28 +- help/indices | 30 +- help/inputlevel | 28 +- help/insert | 28 +- help/int | 28 +- help/interrupt | 26 -- help/intro | 26 -- help/inverse | 28 +- help/iroot | 28 +- help/isassoc | 28 +- help/isatty | 28 +- help/isblk | 28 +- help/isconfig | 28 +- help/isdefined | 28 +- help/iserror | 28 +- help/iseven | 28 +- help/isfile | 28 +- help/ishash | 28 +- help/isident | 28 +- help/isint | 28 +- help/islist | 28 +- help/ismat | 28 +- help/ismult | 28 +- help/isnull | 28 +- help/isnum | 28 +- help/isobj | 28 +- help/isobjtype | 28 +- help/isodd | 28 +- help/isprime | 28 +- help/isptr | 28 +- help/isqrt | 28 +- help/isrand | 28 +- help/israndom | 28 +- help/isreal | 28 +- help/isrel | 28 +- help/issimple | 28 +- help/issq | 28 +- help/isstr | 28 +- help/istype | 28 +- help/jacobi | 28 +- help/join | 28 +- help/lcm | 28 +- help/lcmfact | 28 +- help/lfactor | 28 +- help/list | 28 +- help/ln | 28 +- help/lowbit | 28 +- help/ltol | 28 +- help/makelist | 28 +- help/mat | 76 ++--- help/matdim | 28 +- help/matfill | 28 +- help/matmax | 28 +- help/matmin | 28 +- help/matsum | 28 +- help/mattrace | 28 +- help/mattrans | 28 +- help/max | 28 +- help/md5 | 28 +- help/memsize | 28 +- help/meq | 28 +- help/min | 28 +- help/minv | 28 +- help/mmin | 28 +- help/mne | 28 +- help/mod | 28 +- help/modify | 28 +- help/name | 28 +- help/near | 28 +- help/newerror | 28 +- help/nextcand | 28 +- help/nextprime | 28 +- help/norm | 28 +- help/null | 28 +- help/num | 28 +- help/obj.file | 28 +- help/oldvalue | 28 +- help/operator | 26 -- help/ord | 28 +- help/overview | 34 +-- help/param | 54 +--- help/perm | 28 +- help/pfact | 28 +- help/pi | 28 +- help/pix | 28 +- help/places | 28 +- help/pmod | 28 +- help/polar | 28 +- help/poly | 28 +- help/pop | 28 +- help/popcnt | 28 +- help/power | 28 +- help/prevcand | 28 +- help/prevprime | 28 +- help/printf | 28 +- help/prompt | 28 +- help/protect | 28 +- help/ptest | 28 +- help/push | 28 +- help/putenv | 28 +- help/quo | 28 +- help/quomod | 28 +- help/rand | 28 +- help/randbit | 28 +- help/random | 28 +- help/randombit | 28 +- help/randperm | 28 +- help/rcin | 28 +- help/rcmul | 28 +- help/rcout | 28 +- help/rcpow | 28 +- help/rcsq | 28 +- help/re | 28 +- help/remove | 28 +- help/reverse | 28 +- help/rewind | 28 +- help/rm | 28 +- help/root | 28 +- help/round | 28 +- help/rsearch | 28 +- help/runtime | 28 +- help/saveval | 28 +- help/scale | 28 +- help/scan | 28 +- help/scanf | 28 +- help/script | 90 ------ help/search | 28 +- help/sec | 28 +- help/sech | 28 +- help/seed | 28 +- help/segment | 28 +- help/select | 28 +- help/sgn | 28 +- help/sha | 28 +- help/sha1 | 28 +- help/sin | 28 +- help/sinh | 28 +- help/size | 28 +- help/sizeof | 28 +- help/sort | 28 +- help/sqrt | 28 +- help/srand | 28 +- help/srandom | 50 +--- help/ssq | 28 +- help/statement | 26 -- help/str | 28 +- help/strcat | 28 +- help/strerror | 28 +- help/strlen | 28 +- help/strpos | 28 +- help/strprintf | 28 +- help/strscan | 28 +- help/strscanf | 28 +- help/substr | 28 +- help/sum | 28 +- help/swap | 28 +- help/system | 28 +- help/tail | 28 +- help/tan | 28 +- help/tanh | 28 +- help/test | 28 +- help/time | 28 +- help/todo | 45 ++- help/trunc | 28 +- help/types | 26 -- help/unexpected | 33 --- help/usage | 382 +++++++++----------------- help/variable | 26 -- help/wishlist | 28 +- help/xor | 28 +- hist.c | 155 ++++++++--- hist.h | 29 +- input.c | 32 +-- jump.c | 52 ++-- jump.h | 52 ++-- label.c | 30 +- label.h | 29 +- {cal => lib}/Makefile | 53 +--- {cal => lib}/README | 113 +++----- lib/beer.cal | 22 ++ {cal => lib}/bernoulli.cal | 34 +-- lib/bigprime.cal | 27 ++ lib/bindings | 49 ++++ {cal => lib}/chrem.cal | 37 +-- {cal => lib}/deg.cal | 32 +-- {cal => lib}/ellip.cal | 32 +-- lib/hello.cal | 8 + {cal => lib}/lucas.cal | 57 ++-- {cal => lib}/lucas_chk.cal | 45 ++- {cal => lib}/lucas_tbl.cal | 45 ++- lib/mersenne.cal | 33 +++ {cal => lib}/mfactor.cal | 44 ++- {cal => lib}/mod.cal | 33 +-- {cal => lib}/natnumset.cal | 30 +- lib/pell.cal | 68 +++++ {cal => lib}/pi.cal | 32 +-- lib/pix.cal | 40 +++ lib/pollard.cal | 30 ++ {cal => lib}/poly.cal | 32 +-- {cal => lib}/prompt.cal | 31 +-- lib/psqrt.cal | 50 ++++ lib/qtime.cal | 60 ++++ {cal => lib}/quat.cal | 34 +-- {cal => lib}/randbitrun.cal | 50 ++-- {cal => lib}/randmprime.cal | 40 ++- {cal => lib}/randombitrun.cal | 50 ++-- {cal => lib}/randomrun.cal | 50 ++-- {cal => lib}/randrun.cal | 51 ++-- {cal => lib}/regress.cal | 98 +++---- {cal => lib}/seedrandom.cal | 56 ++-- lib/solve.cal | 43 +++ lib/sumsq.cal | 39 +++ {cal => lib}/surd.cal | 32 +-- lib/test1700.cal | 14 + {cal => lib}/test2300.cal | 31 +-- {cal => lib}/test2600.cal | 34 +-- {cal => lib}/test2700.cal | 39 +-- lib/test3100.cal | 19 ++ {cal => lib}/test3300.cal | 33 +-- {cal => lib}/test3400.cal | 34 +-- {cal => lib}/test3500.cal | 34 +-- {cal => lib}/test4000.cal | 34 +-- {cal => lib}/test4100.cal | 34 +-- {cal => lib}/test4600.cal | 32 +-- lib/test5100.cal | 50 ++++ lib/test5200.cal | 32 +++ lib/test8400.cal | 30 ++ {cal => lib}/test8500.cal | 34 +-- lib/unitfrac.cal | 29 ++ lib/varargs.cal | 28 ++ {cal => lib}/xx_print.cal | 32 +-- lib_calc.c | 421 ++-------------------------- lib_util.c | 50 ++-- lib_util.h | 52 ++-- lint.sed | 37 +++ listfunc.c | 32 +-- longbits.c | 213 +++++++------- longlong.c | 90 ++---- matfunc.c | 31 +-- math_error.c | 50 ++-- math_error.h | 43 +-- md5.c | 7 +- md5.h | 7 +- nametype.h | 46 ++-- obj.c | 31 +-- opcodes.c | 32 +-- opcodes.h | 29 +- pix.c | 41 ++- poly.c | 37 +-- prime.c | 43 ++- prime.h | 40 ++- qfunc.c | 32 +-- qio.c | 30 +- qmath.c | 36 +-- qmath.h | 29 +- qmod.c | 33 +-- qtrans.c | 127 ++------- quickhash.c | 58 ++-- sample/Makefile | 58 ++-- sample/README_SAMPLE | 29 -- sample/many_random.c | 52 ++-- sample/test_random.c | 52 ++-- seed.c | 58 ++-- shs.c | 6 - shs.h | 6 - shs1.c | 9 +- shs1.h | 8 +- size.c | 29 +- string.c | 32 +-- string.h | 29 +- symbol.c | 32 +-- symbol.h | 29 +- token.c | 96 ++----- token.h | 33 +-- value.c | 113 +++----- value.h | 31 +-- version.c | 66 +---- zfunc.c | 32 +-- zio.c | 30 +- zmath.c | 32 +-- zmath.h | 31 +-- zmod.c | 37 +-- zmul.c | 33 +-- zprime.c | 41 ++- zrand.c | 48 ++-- zrand.h | 47 ++-- zrandom.c | 72 ++--- zrandom.h | 49 ++-- 519 files changed, 4194 insertions(+), 17762 deletions(-) delete mode 100644 COPYING delete mode 100644 COPYING-LGPL delete mode 100644 cal/beer.cal delete mode 100644 cal/bigprime.cal delete mode 100644 cal/bindings delete mode 100644 cal/hello.cal delete mode 100644 cal/mersenne.cal delete mode 100644 cal/pell.cal delete mode 100644 cal/pix.cal delete mode 100644 cal/pollard.cal delete mode 100644 cal/psqrt.cal delete mode 100644 cal/qtime.cal delete mode 100644 cal/solve.cal delete mode 100644 cal/sumsq.cal delete mode 100644 cal/test1700.cal delete mode 100644 cal/test3100.cal delete mode 100644 cal/test5100.cal delete mode 100644 cal/test5200.cal delete mode 100644 cal/test8400.cal delete mode 100644 cal/unitfrac.cal delete mode 100644 cal/varargs.cal delete mode 100644 cscript/Makefile delete mode 100644 cscript/mersenne.calc delete mode 100644 cscript/piforever.calc delete mode 100644 cscript/plus.calc delete mode 100644 cscript/simple.calc delete mode 100644 help/argv delete mode 100644 help/script rename {cal => lib}/Makefile (62%) rename {cal => lib}/README (79%) create mode 100644 lib/beer.cal rename {cal => lib}/bernoulli.cal (54%) create mode 100644 lib/bigprime.cal create mode 100644 lib/bindings rename {cal => lib}/chrem.cal (76%) rename {cal => lib}/deg.cal (55%) rename {cal => lib}/ellip.cal (80%) create mode 100644 lib/hello.cal rename {cal => lib}/lucas.cal (95%) rename {cal => lib}/lucas_chk.cal (91%) rename {cal => lib}/lucas_tbl.cal (83%) create mode 100644 lib/mersenne.cal rename {cal => lib}/mfactor.cal (86%) rename {cal => lib}/mod.cal (65%) rename {cal => lib}/natnumset.cal (90%) create mode 100644 lib/pell.cal rename {cal => lib}/pi.cal (66%) create mode 100644 lib/pix.cal create mode 100644 lib/pollard.cal rename {cal => lib}/poly.cal (93%) rename {cal => lib}/prompt.cal (69%) create mode 100644 lib/psqrt.cal create mode 100644 lib/qtime.cal rename {cal => lib}/quat.cal (65%) rename {cal => lib}/randbitrun.cal (66%) rename {cal => lib}/randmprime.cal (70%) rename {cal => lib}/randombitrun.cal (66%) rename {cal => lib}/randomrun.cal (70%) rename {cal => lib}/randrun.cal (71%) rename {cal => lib}/regress.cal (98%) rename {cal => lib}/seedrandom.cal (71%) create mode 100644 lib/solve.cal create mode 100644 lib/sumsq.cal rename {cal => lib}/surd.cal (73%) create mode 100644 lib/test1700.cal rename {cal => lib}/test2300.cal (52%) rename {cal => lib}/test2600.cal (89%) rename {cal => lib}/test2700.cal (82%) create mode 100644 lib/test3100.cal rename {cal => lib}/test3300.cal (63%) rename {cal => lib}/test3400.cal (83%) rename {cal => lib}/test3500.cal (81%) rename {cal => lib}/test4000.cal (88%) rename {cal => lib}/test4100.cal (89%) rename {cal => lib}/test4600.cal (81%) create mode 100644 lib/test5100.cal create mode 100644 lib/test5200.cal create mode 100644 lib/test8400.cal rename {cal => lib}/test8500.cal (80%) create mode 100644 lib/unitfrac.cal create mode 100644 lib/varargs.cal rename {cal => lib}/xx_print.cal (79%) create mode 100644 lint.sed diff --git a/BUGS b/BUGS index dfbb5d1..a4c01d1 100644 --- a/BUGS +++ b/BUGS @@ -69,15 +69,42 @@ not currently a member of the calc-tester mailing list. Known bugs: - * On AlphaLinux with gcc-2.96, calc 2.11.1 with patches to compile - correctly dies in the regression: + * Calc does not support the #! exec method. For example of the + following is placed in an executable file (assume the path to + calc is correct) called /tmp/xyzzy: - 4408: Q == (mat[2]={5+3i,17+4i}) - 4409: R = {M2,M3} - 4410: norm(R) == M4 - "": line 78: Function "surd_sqrt" is undefined - Error in commands - make: *** [chk] Error 1 + #!/usr/local/bin/calc + /* + * comment + */ + print 2+3; + + Will result in '"tmp" is undefined' and '"xyzzy" is undefined' + error messages because calc considers $0 as an expression to + evaluate. + + * The following file: + + /* this is bugdemo.cal */ + x = eval(prompt(">>> ")); + print x; + + when executed as: + + calc read bugdemo.cal + + will obtain a prompt from the terminal, print the value but leave + the terminal in a 'bad' state, as if stty -icanon -echo -echoe + had been executed. + + * Use of 'fmt' in the 2nd arg of printf() calls in c_sysinfo.c + cause some compilers to issue warnings. + + * The builtin function exp(x) will return 0 when x is a large value + in certain cases such as exp(2^32). + + * The builtin function power(x,y) will return 0 in certain cases + such as power(pi(),2^32). We are sure some more bugs exist. When you find them, please let us know! See the above for details on how to report and were to @@ -145,8 +172,8 @@ Problems with known work-a-rounds: DEBUG= -g * There are problems compiling calc on the sparcv9 under 64 bit - Solaris. On that platform, gcc-2.96 is able to compile calc, but - calc dumps core very early on in startup. It is said that sparcv9 + Solaris. On that platform, gcc-2.96 is able to compile calc, but + calc dumps core very early on in startup. It is said that sparcv9 support in gcc-2.96 is very unofficial and thus there is no work-a-round for gcc-2-96. @@ -158,41 +185,3 @@ Problems with known work-a-rounds: LCC="cc -xarch=v9" CCWARN="-DFORCE_STDC -w" DEBUG="-fast -xarch=v9" - - * Under BSDI v4, the warnings of the form: - - /usr/include/ctype.h:147: warning: `__runetype' defined but not used - /usr/include/ctype.h:161: warning: `__isctype' defined but not used - /usr/include/ctype.h:170: warning: `toupper' defined but not used - /usr/include/ctype.h:177: warning: `tolower' defined but not used - - are seen. These warnings are the result of mis-features in BSDI - include files. They do not have an impact on the operation - or performance. The work-a-round is to ignore these warnings - under BSDI. - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.3 $ -## @(#) $Id: BUGS,v 29.3 1999/12/14 19:41:07 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/RCS/BUGS,v $ -## -## Under source code control: 1994/03/18 14:06:13 -## File existed as early as: 1994 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/CHANGES b/CHANGES index ac214ae..ddac1cb 100644 --- a/CHANGES +++ b/CHANGES @@ -1,53 +1,6 @@ -The following are the changes from calc version 2.11.1 to date: +The following are the changes from calc version 2.11.0t10 to date: - Placed calc under version 2.1 of the GNU Lesser General Public License. - - The calc commands: - - help copyright - help copying - help copying-lgpl - - should display the generic calc copyright as well as the contents - of the COPYING and COPYING-LGPL files. - - Those files contain information about the calc's GNU Lesser General - Public License, and in particular the conditions under which you - are allowed to change it and/or distribute copies of it. - - Removed the lint facility from the Makefile. Eliminated Makefile - variables: ${LCFLAGS}, ${LINT}, ${LINTLIB} and ${LINTFLAGS}. - Removed the lint.sed file. - - Cleaned up help display system. Help file lines that begin with - '##' are not displayed. - - Calc source and documentation now uses the the these terms: - - *.cal files calc resource file - *.a files calc binary link library - #! files calc shell script - - Renamed 'help stdlib' to 'help resource'. The 'help stdlib' is - aliased to 'help resource' for ard compatibility. - - Renamed config("lib_debug") to config("resource_debug"). - The config("lib_debug") will have the same effect as - config("resource_debug") for backward compatibility. - - Renamed the source sub-directory lib to cal. The default $CALCPATH - now uses ./cal:~/cal (instead of ./lib:~/lib). Changed LIB_PASSDOWN - Makefile variable to CAL_PASSDOWN. - - Fixed misc compile warnings and bugs. - - Fixed problem of incorrect paths in the formation of installed - calc shell scripts. - - -The following are the changes from calc version 2.11.0t10 to 2.11.0t11: - - Misc code cleanup. Removed dead code. Removed trailing whitespace. + Misc code cleanup. Removed dead code. Removed trailing whitespace. Fixed whitespace to make the best use of 8 character tabs. Fixed some bugs relaing to '// and %' in combination with some @@ -72,7 +25,7 @@ The following are the changes from calc version 2.11.0t10 to 2.11.0t11: Added zero dimensional matrices. A zero dimensional matrix is defined as: - mat A[] or A = mat[] + mat A[] or A = mat[] Updated the help/mat file to reflect the current status of matrices including zero dimensional matrices. @@ -117,7 +70,7 @@ The following are the changes from calc version 2.11.0t10 to 2.11.0t11: config("ctrl_d", "empty_eof") - The ^D always exits calc if typed on an empty line. This + The ^D always exits calc if typed on an empty line. This condition occurs when ^D either the first character typed, or when all other characters on the line have been removed (say by deleting them). @@ -130,7 +83,7 @@ The following are the changes from calc version 2.11.0t10 to 2.11.0t11: then those char(s) will have this functionality. Updated help/config and help/mode, improved the readability and - fixed a few typos. Documented modes, block formats and block bases + fixed a few typos. Documented modes, block formats and block bases ("mode", "blkfmt" & "blkbase") that were previously left off out of the documentation. @@ -138,6 +91,14 @@ The following are the changes from calc version 2.11.0t10 to 2.11.0t11: instead of returning integers. One cannot use integers to set these values, so returning integers was useless. + The following config values return "on" or "off" strings: + + tilde tab leadzero fullzero blkverbose verbose_quit + + These config values can still be set with same boolean strings + ("on", "off", "true", "false", "t", ...) as well as via the + numerical values 0 (for "off") and non-0 (for "on"), however. + Applied the dangling name fix from Ernest Bowen . Show func prints function on order of their indices, and with @@ -165,9 +126,9 @@ The following are the changes from calc version 2.11.0t10 to 2.11.0t11: supported. Under GNU-readline, it acts the same way as config("ctrl_d", "empty_eof"). Emacs users may find this objectionable as ``hi^A^D^D^D'' will cause calc to exit due to - the issuing of one too many ^D's. + the issuing of one too many ^D's. - Emacs users may want to put: + Emacs users may want to put: config("ctrl_d", "never_eof"),; @@ -177,118 +138,6 @@ The following are the changes from calc version 2.11.0t10 to 2.11.0t11: Fixed the make depend rule. - Applied Ernest Bowen's complex function - power(), exp() and transcendental function patch: - - Calc will return a "too-large argument" error-value for exp(x, - epsilon) if re(x) >= 2^30 or if an estimate indicates that the - result will have absolute value greater than 2^2^30 * epsilon. - Otherwise the evaluation will be attempted but may fail due to - shortage of memory or may require a long runtime if the result - will be very large. - - The power(a, b, epsilon) builtin will return a "too-large result" - if an estimate indicates that the result will have absolute value - > 2^2^30 * epsilon. Otherwise the evaluation will be attempted - but may fail due to shortage of memory or may require a long - runtime if the result will be very large. - - Changes have been made to the algorithms used for some special - functions sinh(), cosh(), tanh(), sin(), cos(), etc., that make - use of exp(). In particular tanh(x) is now much faster and - doesn't run out of memory when x is very large - the value to - be returned is then 1 to a high degree of accuracy. - - When the true value of a transcendental function is 1, as is - cos(x) for x == 0, calc's version of the function will now return - 1 rather than the nearest multiple of epsilon. E.g. cos(0, 3/8) - no longer returns 9/8. - - The restriction of abs(n) < 1000000 on scale(x, n) has been - removed. The only condition n now has to satisfy for calc to - attempt the operation is n < 2^31, the same as for calc to - attempt x << n and x^n. - - Changed root(x,n) so that when x is negative and n is odd it - returns the principal complex n-th root of x rather than -1, e.g. - root(-1,3) now returns -.5+.8660...i. - - Changed power(a,b) to permit a to be negative when b is real. - E.g. power(-2,3) will now return 8 rather than cause a "negative - base" error. - - Fixed several improper free and link problems in the comfunc.c code. - - Removed BOOL_B64 symbol from Makefile. - - The following config values return "true" or "false" strings: - - tilde tab leadzero fullzero blkverbose verbose_quit - - These config values can still be set with same boolean strings - ("on", "off", "true", "false", "t", ...) as well as via the - numerical values 0 (for "false") and non-0 (for "true"), however. - - Added -s to the calc command line. The -s flag will cause unused - args (args after all of the -options on the command line) to remain - as unevaluated strings. - - If calc is called with -s, then the new function argv() will return - the number of strings on the command line. Also argv(n) will return - the n-th such string or null is no such string exists. - - Calc now handles calc shell scripts. A calc shell script is an - executable file that starts with: - - #!/usr/local/bin/calc -S - - Where ``/usr/local/bin/calc'' is the path to the calc binary. - Additional -options may be added to the line, but it MUST - start with -S. For example, the the executable file ``plus'' - contain the following: - - #!/usr/local/bin/calc -S -e - /* - * This is a simple calc shell script to add two values - */ - print eval(argv(0)) + eval(argv(1)); - - then the following command: - - ./plus 23 'pi(1e-5)' - - will print: - - 26.14159 - - If calc is called with -S as the first arg, then calc will assume that - it is being called from a #! calc shell script file. The -S implies - the -s flag. If -i is not given, -S also implies -d and -p. - - Fixed the problem with non-literal string type checking for the - C printf-like functions. Able to determine if "%ld" or "%lld" - is appropriate for printing of 64 bit long longs by way of the C - symbol L64_FORMAT in the longlong.h header file. - - The following lines are treated as comments by calc: - - #! this is a comment - # this is a comment - # this is a comment - # - # The lone # above was also a comment - - Improved how calc makes changes to file descriptor interactive state. - Moved state changing code to calc_tty() and orig_tty() in lib_calc.c. - The libcalc_call_me_last() function will restore all changed descriptor - states that have not already been restored. - - Added the following read-only config values: - - config("program") path to calc program or calc shell script - config("basename") basename of config("program") - config("version") calc version string - The following are the changes from calc version 2.11.0t8.9.1 to 2.11.0t9.4.5: @@ -4691,29 +4540,3 @@ Following is a list of visible changes to calc from version 1.24.7 to 1.26.1: was fixed. A small bug in the library file regress.cal was fixed. - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.2 $ -## @(#) $Id: CHANGES,v 29.2 1999/12/14 19:40:18 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/RCS/CHANGES,v $ -## -## Under source code control: 1993/06/02 18:12:57 -## File existed as early as: 1989 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/COPYING b/COPYING deleted file mode 100644 index b5ffc77..0000000 --- a/COPYING +++ /dev/null @@ -1,192 +0,0 @@ - calc - arbitrary precision calculator - - -This file is Copyrighted ------------------------- - - This file is covered under the following Copyright: - - Copyright (C) 1999 Landon Curt Noll - All rights reserved. - - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - # @(#) $Revision: 29.1 $ - # @(#) $Id: COPYING,v 29.1 1999/12/14 09:15:29 chongo Exp $ - # @(#) $Source: /usr/local/src/cmd/calc/RCS/COPYING,v $ - -=-= - -Calc is covered by the GNU Lesser General Public License --------------------------------------------------------- - - Calc is open software; you can redistribute it and/or modify it under - the terms of the GNU Lesser General Public License as published by - the Free Software Foundation version 2.1 of the License. - - Calc is several binary link libraries, several modules, associated - interface definition files and scripts used to control its compilation - and installation. - - Calc is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General - Public License for more details. - - A copy of the GNU Lesser General Public License is distributed with - calc under the filename: - - COPYING-LGPL - - You may display this file by the calc command: help copying - - You may display the GNU Lesser General - Public License by the calc command: help copying-lgpl - - You should have received a copy of the version 2.1 GNU Lesser General - Public License with calc; if not, write to: - - Free Software Foundation, Inc. - 59 Temple Place - Suite 330 - Boston, MA 02111-1307 - USA - - The contact addresses for calc is as follows: - - Web: http://reality.sgi.com/chongo/tech/comp/calc/index.html - http://www.isthe.com/chongo/tech/comp/calc/index.html - - EMail: calc-tester at postofc dot corp dot sgi dot com - calc-tester at isthe dot com - - [[ Replace 'at' with @, 'dot' is with . and remove spaces ]] - - The 2nd address set is provided in case the 1st address set no - longer functions. - -=-= - -Calc's relationship to the GNU Lesser General Public License ------------------------------------------------------------- - - In section 0 of the GNU Lesser General Public License, one finds - the following definition: - - The "Library", below, refers to any such software library or - work which has been distributed under these terms. - - Calc is distributed under the terms of the GNU Lesser - General Public License. - - In the same section 0, one also find the following: - - For a library, complete source code means all the source code - for all modules it contains, plus any associated interface - definition files, plus the scripts used to control compilation - and installation of the library. - - There are at least two calc binary link libraries found in calc: - - libcalc.a libcustcalc.a - - Clearly all files that go into the creation of those binary link - libraries are covered under the License. - - The ``scripts used to control compilation and installation of the - of the library'' include: - - * Makefiles - * source files created by the Makefiles - * source code used in the creation of intermediate source files - - All of those files are covered under the License. - - The ``associated interface definition files'' are those files that: - - * show how the calc binary link libraries are used - * test the validity of the binary link libraries - * document routines found in the binary link libraries - * show how one can interactively use the binary link libraries - - Calc provides an extensive set of files that perform the above - functions. - - * files under the sample sub-directory - * files under the help sub-directory - * files under the lib sub-directory - * the main calc.c file - - The ``complete source code'' includes ALL files shipped with calc, - except for the exception files explicitly listed in the ``Calc - copyrights and exception files'' section below. - -=-= - -Calc copyrights and exception files ------------------------------------ - - With the exception of the files listed below, Calc is covered under - the following Copyrights: - - Copyright (C) year David I. Bell - Copyright (C) year David I. Bell and Landon Curt Noll - Copyright (C) year David I. Bell and Ernest Bowen - Copyright (C) year David I. Bell, Landon Curt Noll and Ernest Bowen - Copyright (C) year Landon Curt Noll - Copyright (C) year Ernest Bowen and Landon Curt Noll - Copyright (C) year Ernest Bowen - - A few files are not covered under the GNU Lesser General Public - License. The source files not covered are: - - shs1.c shs1.h shs.c shs.h - md5.c md5.h lib/qtime.cal COPYING - COPYING-LGPL - - The file COPYING-LGPL, which contains a copy of the version 2.1 - GNU Lesser General Public License, is itself Copyrighted by the - Free Software Foundation, Inc. Please note that the Free Software - Foundation, Inc. does NOT have a copyright over calc, only the - COPYING-LGPL that is supplied with calc. - - This file, COPYING, is distributed under the Copyright found at the - top of this file. It is important to note that you may distribute - verbatim copies of this file but you may not modify this file. - -=-= - -General Copyleft and License info ---------------------------------- - - For general information on Copylefts, see: - - http://www.gnu.org/copyleft/ - - For information on GNU Lesser General Public Licenses, see: - - http://www.gnu.org/copyleft/lesser.html - http://www.gnu.org/copyleft/lesser.txt - -=-= - -Why calc did not use the GNU General Public License ---------------------------------------------------- - - It has been suggested that one should consider using the GNU General - Public License instead of the GNU Lesser General Public License: - - http://www.gnu.org/philosophy/why-not-lgpl.html - - As you can read in the above URL, there are times where a library - cannot give free software any particular advantage. One of those - times is when there is significantly similar versions available - that are not covered under a Copyleft such as the GNU General Public - License. - - The reason why calc was placed under the GNU Lesser General Public - License is because for many years (1984 thru 1999), calc was offered - without any form of Copyleft. At the time calc was placed under - the GNU Lesser General Public License, a number of systems and - distributions distributed calc without a Copyleft. diff --git a/COPYING-LGPL b/COPYING-LGPL deleted file mode 100644 index 223ede7..0000000 --- a/COPYING-LGPL +++ /dev/null @@ -1,504 +0,0 @@ - GNU LESSER GENERAL PUBLIC LICENSE - Version 2.1, February 1999 - - Copyright (C) 1991, 1999 Free Software Foundation, Inc. - 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - -[This is the first released version of the Lesser GPL. It also counts - as the successor of the GNU Library Public License, version 2, hence - the version number 2.1.] - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -Licenses are intended to guarantee your freedom to share and change -free software--to make sure the software is free for all its users. - - This license, the Lesser General Public License, applies to some -specially designated software packages--typically libraries--of the -Free Software Foundation and other authors who decide to use it. You -can use it too, but we suggest you first think carefully about whether -this license or the ordinary General Public License is the better -strategy to use in any particular case, based on the explanations below. - - When we speak of free software, we are referring to freedom of use, -not price. Our General Public Licenses are designed to make sure that -you have the freedom to distribute copies of free software (and charge -for this service if you wish); that you receive source code or can get -it if you want it; that you can change the software and use pieces of -it in new free programs; and that you are informed that you can do -these things. - - To protect your rights, we need to make restrictions that forbid -distributors to deny you these rights or to ask you to surrender these -rights. These restrictions translate to certain responsibilities for -you if you distribute copies of the library or if you modify it. - - For example, if you distribute copies of the library, whether gratis -or for a fee, you must give the recipients all the rights that we gave -you. You must make sure that they, too, receive or can get the source -code. If you link other code with the library, you must provide -complete object files to the recipients, so that they can relink them -with the library after making changes to the library and recompiling -it. And you must show them these terms so they know their rights. - - We protect your rights with a two-step method: (1) we copyright the -library, and (2) we offer you this license, which gives you legal -permission to copy, distribute and/or modify the library. - - To protect each distributor, we want to make it very clear that -there is no warranty for the free library. Also, if the library is -modified by someone else and passed on, the recipients should know -that what they have is not the original version, so that the original -author's reputation will not be affected by problems that might be -introduced by others. - - Finally, software patents pose a constant threat to the existence of -any free program. We wish to make sure that a company cannot -effectively restrict the users of a free program by obtaining a -restrictive license from a patent holder. Therefore, we insist that -any patent license obtained for a version of the library must be -consistent with the full freedom of use specified in this license. - - Most GNU software, including some libraries, is covered by the -ordinary GNU General Public License. This license, the GNU Lesser -General Public License, applies to certain designated libraries, and -is quite different from the ordinary General Public License. We use -this license for certain libraries in order to permit linking those -libraries into non-free programs. - - When a program is linked with a library, whether statically or using -a shared library, the combination of the two is legally speaking a -combined work, a derivative of the original library. The ordinary -General Public License therefore permits such linking only if the -entire combination fits its criteria of freedom. The Lesser General -Public License permits more lax criteria for linking other code with -the library. - - We call this license the "Lesser" General Public License because it -does Less to protect the user's freedom than the ordinary General -Public License. It also provides other free software developers Less -of an advantage over competing non-free programs. These disadvantages -are the reason we use the ordinary General Public License for many -libraries. However, the Lesser license provides advantages in certain -special circumstances. - - For example, on rare occasions, there may be a special need to -encourage the widest possible use of a certain library, so that it becomes -a de-facto standard. To achieve this, non-free programs must be -allowed to use the library. A more frequent case is that a free -library does the same job as widely used non-free libraries. In this -case, there is little to gain by limiting the free library to free -software only, so we use the Lesser General Public License. - - In other cases, permission to use a particular library in non-free -programs enables a greater number of people to use a large body of -free software. For example, permission to use the GNU C Library in -non-free programs enables many more people to use the whole GNU -operating system, as well as its variant, the GNU/Linux operating -system. - - Although the Lesser General Public License is Less protective of the -users' freedom, it does ensure that the user of a program that is -linked with the Library has the freedom and the wherewithal to run -that program using a modified version of the Library. - - The precise terms and conditions for copying, distribution and -modification follow. Pay close attention to the difference between a -"work based on the library" and a "work that uses the library". The -former contains code derived from the library, whereas the latter must -be combined with the library in order to run. - - GNU LESSER GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License Agreement applies to any software library or other -program which contains a notice placed by the copyright holder or -other authorized party saying it may be distributed under the terms of -this Lesser General Public License (also called "this License"). -Each licensee is addressed as "you". - - A "library" means a collection of software functions and/or data -prepared so as to be conveniently linked with application programs -(which use some of those functions and data) to form executables. - - The "Library", below, refers to any such software library or work -which has been distributed under these terms. A "work based on the -Library" means either the Library or any derivative work under -copyright law: that is to say, a work containing the Library or a -portion of it, either verbatim or with modifications and/or translated -straightforwardly into another language. (Hereinafter, translation is -included without limitation in the term "modification".) - - "Source code" for a work means the preferred form of the work for -making modifications to it. For a library, complete source code means -all the source code for all modules it contains, plus any associated -interface definition files, plus the scripts used to control compilation -and installation of the library. - - Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running a program using the Library is not restricted, and output from -such a program is covered only if its contents constitute a work based -on the Library (independent of the use of the Library in a tool for -writing it). Whether that is true depends on what the Library does -and what the program that uses the Library does. - - 1. You may copy and distribute verbatim copies of the Library's -complete source code as you receive it, in any medium, provided that -you conspicuously and appropriately publish on each copy an -appropriate copyright notice and disclaimer of warranty; keep intact -all the notices that refer to this License and to the absence of any -warranty; and distribute a copy of this License along with the -Library. - - You may charge a fee for the physical act of transferring a copy, -and you may at your option offer warranty protection in exchange for a -fee. - - 2. You may modify your copy or copies of the Library or any portion -of it, thus forming a work based on the Library, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) The modified work must itself be a software library. - - b) You must cause the files modified to carry prominent notices - stating that you changed the files and the date of any change. - - c) You must cause the whole of the work to be licensed at no - charge to all third parties under the terms of this License. - - d) If a facility in the modified Library refers to a function or a - table of data to be supplied by an application program that uses - the facility, other than as an argument passed when the facility - is invoked, then you must make a good faith effort to ensure that, - in the event an application does not supply such function or - table, the facility still operates, and performs whatever part of - its purpose remains meaningful. - - (For example, a function in a library to compute square roots has - a purpose that is entirely well-defined independent of the - application. Therefore, Subsection 2d requires that any - application-supplied function or table used by this function must - be optional: if the application does not supply it, the square - root function must still compute square roots.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Library, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Library, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote -it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Library. - -In addition, mere aggregation of another work not based on the Library -with the Library (or with a work based on the Library) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may opt to apply the terms of the ordinary GNU General Public -License instead of this License to a given copy of the Library. To do -this, you must alter all the notices that refer to this License, so -that they refer to the ordinary GNU General Public License, version 2, -instead of to this License. (If a newer version than version 2 of the -ordinary GNU General Public License has appeared, then you can specify -that version instead if you wish.) Do not make any other change in -these notices. - - Once this change is made in a given copy, it is irreversible for -that copy, so the ordinary GNU General Public License applies to all -subsequent copies and derivative works made from that copy. - - This option is useful when you wish to copy part of the code of -the Library into a program that is not a library. - - 4. You may copy and distribute the Library (or a portion or -derivative of it, under Section 2) in object code or executable form -under the terms of Sections 1 and 2 above provided that you accompany -it with the complete corresponding machine-readable source code, which -must be distributed under the terms of Sections 1 and 2 above on a -medium customarily used for software interchange. - - If distribution of object code is made by offering access to copy -from a designated place, then offering equivalent access to copy the -source code from the same place satisfies the requirement to -distribute the source code, even though third parties are not -compelled to copy the source along with the object code. - - 5. A program that contains no derivative of any portion of the -Library, but is designed to work with the Library by being compiled or -linked with it, is called a "work that uses the Library". Such a -work, in isolation, is not a derivative work of the Library, and -therefore falls outside the scope of this License. - - However, linking a "work that uses the Library" with the Library -creates an executable that is a derivative of the Library (because it -contains portions of the Library), rather than a "work that uses the -library". The executable is therefore covered by this License. -Section 6 states terms for distribution of such executables. - - When a "work that uses the Library" uses material from a header file -that is part of the Library, the object code for the work may be a -derivative work of the Library even though the source code is not. -Whether this is true is especially significant if the work can be -linked without the Library, or if the work is itself a library. The -threshold for this to be true is not precisely defined by law. - - If such an object file uses only numerical parameters, data -structure layouts and accessors, and small macros and small inline -functions (ten lines or less in length), then the use of the object -file is unrestricted, regardless of whether it is legally a derivative -work. (Executables containing this object code plus portions of the -Library will still fall under Section 6.) - - Otherwise, if the work is a derivative of the Library, you may -distribute the object code for the work under the terms of Section 6. -Any executables containing that work also fall under Section 6, -whether or not they are linked directly with the Library itself. - - 6. As an exception to the Sections above, you may also combine or -link a "work that uses the Library" with the Library to produce a -work containing portions of the Library, and distribute that work -under terms of your choice, provided that the terms permit -modification of the work for the customer's own use and reverse -engineering for debugging such modifications. - - You must give prominent notice with each copy of the work that the -Library is used in it and that the Library and its use are covered by -this License. You must supply a copy of this License. If the work -during execution displays copyright notices, you must include the -copyright notice for the Library among them, as well as a reference -directing the user to the copy of this License. Also, you must do one -of these things: - - a) Accompany the work with the complete corresponding - machine-readable source code for the Library including whatever - changes were used in the work (which must be distributed under - Sections 1 and 2 above); and, if the work is an executable linked - with the Library, with the complete machine-readable "work that - uses the Library", as object code and/or source code, so that the - user can modify the Library and then relink to produce a modified - executable containing the modified Library. (It is understood - that the user who changes the contents of definitions files in the - Library will not necessarily be able to recompile the application - to use the modified definitions.) - - b) Use a suitable shared library mechanism for linking with the - Library. A suitable mechanism is one that (1) uses at run time a - copy of the library already present on the user's computer system, - rather than copying library functions into the executable, and (2) - will operate properly with a modified version of the library, if - the user installs one, as long as the modified version is - interface-compatible with the version that the work was made with. - - c) Accompany the work with a written offer, valid for at - least three years, to give the same user the materials - specified in Subsection 6a, above, for a charge no more - than the cost of performing this distribution. - - d) If distribution of the work is made by offering access to copy - from a designated place, offer equivalent access to copy the above - specified materials from the same place. - - e) Verify that the user has already received a copy of these - materials or that you have already sent this user a copy. - - For an executable, the required form of the "work that uses the -Library" must include any data and utility programs needed for -reproducing the executable from it. However, as a special exception, -the materials to be distributed need not include anything that is -normally distributed (in either source or binary form) with the major -components (compiler, kernel, and so on) of the operating system on -which the executable runs, unless that component itself accompanies -the executable. - - It may happen that this requirement contradicts the license -restrictions of other proprietary libraries that do not normally -accompany the operating system. Such a contradiction means you cannot -use both them and the Library together in an executable that you -distribute. - - 7. You may place library facilities that are a work based on the -Library side-by-side in a single library together with other library -facilities not covered by this License, and distribute such a combined -library, provided that the separate distribution of the work based on -the Library and of the other library facilities is otherwise -permitted, and provided that you do these two things: - - a) Accompany the combined library with a copy of the same work - based on the Library, uncombined with any other library - facilities. This must be distributed under the terms of the - Sections above. - - b) Give prominent notice with the combined library of the fact - that part of it is a work based on the Library, and explaining - where to find the accompanying uncombined form of the same work. - - 8. You may not copy, modify, sublicense, link with, or distribute -the Library except as expressly provided under this License. Any -attempt otherwise to copy, modify, sublicense, link with, or -distribute the Library is void, and will automatically terminate your -rights under this License. However, parties who have received copies, -or rights, from you under this License will not have their licenses -terminated so long as such parties remain in full compliance. - - 9. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Library or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Library (or any work based on the -Library), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Library or works based on it. - - 10. Each time you redistribute the Library (or any work based on the -Library), the recipient automatically receives a license from the -original licensor to copy, distribute, link with or modify the Library -subject to these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties with -this License. - - 11. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Library at all. For example, if a patent -license would not permit royalty-free redistribution of the Library by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Library. - -If any portion of this section is held invalid or unenforceable under any -particular circumstance, the balance of the section is intended to apply, -and the section as a whole is intended to apply in other circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 12. If the distribution and/or use of the Library is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Library under this License may add -an explicit geographical distribution limitation excluding those countries, -so that distribution is permitted only in or among countries not thus -excluded. In such case, this License incorporates the limitation as if -written in the body of this License. - - 13. The Free Software Foundation may publish revised and/or new -versions of the Lesser General Public License from time to time. -Such new versions will be similar in spirit to the present version, -but may differ in detail to address new problems or concerns. - -Each version is given a distinguishing version number. If the Library -specifies a version number of this License which applies to it and -"any later version", you have the option of following the terms and -conditions either of that version or of any later version published by -the Free Software Foundation. If the Library does not specify a -license version number, you may choose any version ever published by -the Free Software Foundation. - - 14. If you wish to incorporate parts of the Library into other free -programs whose distribution conditions are incompatible with these, -write to the author to ask for permission. For software which is -copyrighted by the Free Software Foundation, write to the Free -Software Foundation; we sometimes make exceptions for this. Our -decision will be guided by the two goals of preserving the free status -of all derivatives of our free software and of promoting the sharing -and reuse of software generally. - - NO WARRANTY - - 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO -WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. -EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR -OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY -KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE -LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME -THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN -WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY -AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU -FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR -CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE -LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING -RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A -FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF -SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Libraries - - If you develop a new library, and you want it to be of the greatest -possible use to the public, we recommend making it free software that -everyone can redistribute and change. You can do so by permitting -redistribution under these terms (or, alternatively, under the terms of the -ordinary General Public License). - - To apply these terms, attach the following notices to the library. It is -safest to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least the -"copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -Also add information on how to contact you by electronic and paper mail. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the library, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the - library `Frob' (a library for tweaking knobs) written by James Random Hacker. - - , 1 April 1990 - Ty Coon, President of Vice - -That's all there is to it! - - diff --git a/HOWTO.INSTALL b/HOWTO.INSTALL index e56fe52..cb1c471 100644 --- a/HOWTO.INSTALL +++ b/HOWTO.INSTALL @@ -48,29 +48,3 @@ Installing calc in 4 easy steps: We suggest that you might want to read the README file and look at the calc help subsystem. See the README file for details. - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: HOWTO.INSTALL,v 29.1 1999/12/14 09:15:29 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/RCS/HOWTO.INSTALL,v $ -## -## Under source code control: 1999/09/27 20:48:44 -## File existed as early as: 1999 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/LIBRARY b/LIBRARY index 6bbf4e6..61718db 100644 --- a/LIBRARY +++ b/LIBRARY @@ -1,11 +1,11 @@ USING THE ARBITRARY PRECISION ROUTINES IN A C PROGRAM -Part of the calc release consists of an arbitrary precision math link library. -This link library is used by the calc program to perform its own calculations. +Part of the calc release consists of an arbitrary precision math library. +This library is used by the calc program to perform its own calculations. If you wish, you can ignore the calc program entirely and call the arbitrary precision math routines from your own C programs. -The link library is called libcalc.a, and provides routines to handle arbitrary +The library is called libcalc.a, and provides routines to handle arbitrary precision arithmetic with integers, rational numbers, or complex numbers. There are also many numeric functions such as factorial and gcd, along with some transcendental functions such as sin and exp. @@ -49,7 +49,8 @@ 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}. +libcalc.a along with the library itself (and the lint library +llib-lcalc.ln, if made) are installed into ${LIBDIR}. External programs may want to compile with: @@ -76,9 +77,9 @@ level in your program, and use longjmp in the math_error routine to return to that level and so recover from the error. This is what the calc program does. -For convenience, the link library libcalc.a contains a math_error routine. +For convenience, the library libcalc.a contains a math_error routine. By default, this routine simply prints a message to stderr and then exits. -By simply linking in this link library, any calc errors will result in a +By simply linking in this library, any calc errors will result in a error message on stderr followed by an exit. External programs that wish to use this math_error may want to compile with: @@ -116,7 +117,7 @@ For example: OUTPUT ROUTINES --------------- -The output from the routines in the link library normally goes to stdout. You +The output from the routines in the library normally goes to stdout. You can divert that output to either another FILE handle, or else to a string. Read the routines in zio.c to see what is available. Diversions can be nested. @@ -327,13 +328,13 @@ Examples of these are qnum to return the numerator, qden to return the denominator, qint to return the integer part of, qfrac to return the fractional part of, and qinv to invert a fraction. -There are some transcendental functions in the link library, such as sin -and cos. These cannot be evaluated exactly as fractions. Therefore, -they accept another argument which tells how accurate you want the result. -This is an "epsilon" value, and the returned value will be within that -quantity of the correct value. This is usually an absolute difference, -but for some functions (such as exp), this is a relative difference. -For example, to calculate sin(0.5) to 100 decimal places, you could do: +There are some transcendental functions in the library, such as sin and cos. +These cannot be evaluated exactly as fractions. Therefore, they accept +another argument which tells how accurate you want the result. This is an +"epsilon" value, and the returned value will be within that quantity of +the correct value. This is usually an absolute difference, but for some +functions (such as exp), this is a relative difference. For example, to +calculate sin(0.5) to 100 decimal places, you could do: NUMBER *q, *ans, *epsilon; @@ -454,29 +455,3 @@ call. This is not required, but is does bring things to a closure. The function libcalc_call_me_last() takes no args and returns void. You need call libcalc_call_me_last() only once. - -## Copyright (C) 1999 David I. Bell and Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: LIBRARY,v 29.1 1999/12/14 09:15:29 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/RCS/LIBRARY,v $ -## -## Under source code control: 1993/07/30 19:44:49 -## File existed as early as: 1993 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/Makefile b/Makefile index c348304..7387321 100644 --- a/Makefile +++ b/Makefile @@ -1,39 +1,16 @@ #!/bin/make # -# calc - arbitrary precision calculator -# # (Generic calc makefile) # -# Copyright (C) 1999 Landon Curt Noll +# Copyright (c) 1995 David I. Bell and Landon Curt Noll +# Permission is granted to use, distribute, or modify this source, +# provided that this copyright notice remains intact. # -# Calc is open software; you can redistribute it and/or modify it under -# the terms of the version 2.1 of the GNU Lesser General Public License -# as published by the Free Software Foundation. -# -# Calc is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -# Public License for more details. -# -# A copy of version 2.1 of the GNU Lesser General Public License is -# distributed with calc under the filename COPYING-LGPL. You should have -# received a copy with calc; if not, write to Free Software Foundation, Inc. -# 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -# -# @(#) $Revision: 29.1 $ -# @(#) $Id: Makefile.ship,v 29.1 1999/12/14 09:14:53 chongo Exp $ -# @(#) $Source: /usr/local/src/cmd/calc/RCS/Makefile.ship,v $ -# -# Under source code control: 1990/02/15 01:48:41 -# File existed as early as: before 1990 -# -# chongo /\oo/\ http://reality.sgi.com/chongo/ -# Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ +# Arbitrary precision calculator. # # calculator by David I. Bell with help/mods from others # Makefile by Landon Curt Noll - ############################################################################## #-=-=-=-=-=-=-=-=- You may want to change some values below -=-=-=-=-=-=-=-=-# ############################################################################## @@ -325,21 +302,21 @@ HAVE_STRDUP= ALIGN32= -DMUST_ALIGN32 #ALIGN32= -UMUST_ALIGN32 -# where to install the *.cal, *.h and *.a files -# -# ${BINDIR} where to install binary files -# ${TOPDIR} the directory under which the calc directory will be placed. -# ${LIBDIR} where the *.cal, *.a, bindings and help dir are installed. -# ${INCDIR} where the locally installed include files are found. -# ${INCDIRCALC} where the calc include files are installed. -# ${HELPDIR} where the help directory is installed. -# ${CUSTOMLIBDIR} where custom *.cal files are installed. -# ${CUSTOMHELPDIR} where custom help files are installed. -# ${SCRIPTDIR} where calc shell scripts are installed. +# where to install binary files # BINDIR= /usr/local/bin #BINDIR= /usr/bin #BINDIR= /usr/contrib/bin + +# where to install the *.cal, *.h and *.a files +# +# ${TOPDIR} is the directory under which the calc directory will be placed. +# ${LIBDIR} is where the *.cal, *.a, bindings and help dir are installed. +# ${INCDIR} is where the locally installed include files are found. +# ${INCDIRCALC} is where the calc include files are installed. +# ${HELPDIR} is where the help directory is installed. +# ${CUSTOMLIBDIR} is where custom lib files are installed. +# ${CUSTOMHELPDIR} is where custom help files are installed. # TOPDIR= /usr/local/lib #TOPDIR= /usr/lib @@ -352,7 +329,6 @@ INCDIR= /usr/local/include INCDIRCALC= ${INCDIR}/calc CUSTOMLIBDIR= ${LIBDIR}/custom CUSTOMHELPDIR= ${HELPDIR}/custhelp -SCRIPTDIR= ${BINDIR}/cscript # where man pages are installed # @@ -417,12 +393,12 @@ MANMAKE= /usr/local/bin/manmake #MANMAKE= manmake # If the $CALCPATH environment variable is not defined, then the following -# path will be search for calc resource file routines. +# path will be search for calc lib routines. # -CALCPATH= .:./cal:~/cal:${LIBDIR}:${CUSTOMLIBDIR} +CALCPATH= .:./lib:~/lib:${LIBDIR}:${CUSTOMLIBDIR} # If the $CALCRC environment variable is not defined, then the following -# path will be search for calc resource files. +# path will be search for calc lib routines. # CALCRC= ${LIBDIR}/startup:~/.calcrc @@ -435,11 +411,11 @@ CALCRC= ${LIBDIR}/startup:~/.calcrc # NOTE: If you select the 'USE_READLINE= -DUSE_READLINE' mode, you must set: # # READLINE_LIB The flags needed to link in the readline -# and history link libraries +# and history libs # READLINE_INCLUDE Where the readline include files reside # # NOTE: The GNU-readline code is not shipped with calc. You must have -# the appropriate headers and link libs installed on your system in +# the appropriate headers and libs installed on your system in # order to use it. # # If in doubt, set USE_READLINE, READLINE_LIB and READLINE_INCLUDE to nothing. @@ -465,35 +441,30 @@ CALCPAGER= more # Debug/Optimize options for ${CC} and ${LCC} # -#DEBUG= -# #DEBUG= -O #DEBUG= -O -g #DEBUG= -O -g3 -# #DEBUG= -O1 #DEBUG= -O1 -g #DEBUG= -O1 -g3 -# #DEBUG= -O2 #DEBUG= -O2 -g DEBUG= -O2 -g3 #DEBUG= -O2 -ipa #DEBUG= -O2 -g3 -ipa -# #DEBUG= -O3 #DEBUG= -O3 -g #DEBUG= -O3 -g3 #DEBUG= -O3 -ipa #DEBUG= -O3 -g3 -ipa -# #DEBUG= -g #DEBUG= -g3 #DEBUG= -gx #DEBUG= -WM,-g +#DEBUG= -# On systems that have dynamic shared link libs, you may want want to disable -# them for faster calc startup. +# On systems that have dynamic shared libs, you may want want to disable them +# for faster calc startup. # # System type NO_SHARED recommendation # @@ -508,7 +479,7 @@ NO_SHARED= #NO_SHARED= -dn #NO_SHARED= -non_shared -# On some systems where you are disabling dynamic shared link libs, you may +# On some systems where you are disabling dynamic shared libs, you may # need to pass a special flag to ${CC} and ${LCC} during linking stage. # # System type NO_SHARED recommendation @@ -523,12 +494,41 @@ LD_NO_SHARED= #LD_NO_SHARED= -Wl,-rdata_shared # Some systems require one to use ranlib to add a symbol table to -# a *.a link library. Set RANLIB to the utility that performs this -# action. Set RANLIB to : if your system does not need such a utility. +# a *.a library. Set RANLIB to the utility that performs this action. +# Set RANLIB to : if your system does not need such a utility. # RANLIB=ranlib #RANLIB=: +# Some systems are able to form lint libs. How it is formed depends +# on your system. If you do not care about lint, use : as the +# LINTLIB value. +# +# System type LINTLIB recommendation +# +# BSD ${LINT} ${LCFLAGS} ${LINTFLAGS} -u -Ccalc +# SYSV ${LINT} ${LCFLAGS} ${LINTFLAGS} -u -o calc +# disable : +# +# If in doubt and you don't care about lint, use LINTLIB= : +# +#LINTLIB= ${LINT} ${LCFLAGS} ${LINTFLAGS} -u -Ccalc +#LINTLIB= ${LINT} ${LCFLAGS} ${LINTFLAGS} -u -o calc +LINTLIB= : + +# The lint flags vary from system to system. Some systems have the +# opposite meaning for the flags below. Other systems change flag +# meaning altogether. +# +# System LINTFLAGS recommendation +# +# SunOs -a -h -v -z +# +# If in doubt and you don't care about lint, set LINTFLAGS to empty. +# +#LINTFLAGS= -a -h -v -z +LINTFLAGS= + # Normally certain files depend on the Makefile. If the Makefile is # changed, then certain steps should be redone. If MAKE_FILE is # set to Makefile, then these files will depend on Makefile. If @@ -548,9 +548,9 @@ MAKE_FILE= Makefile #PURIFY= purify -logfile=pure.out #PURIFY= purify -m71-engine -logfile=pure.out -# If you want to use a debugging link library such as a malloc debug link -# library, or need to add special ld flags after the calc link libraries -# are included, set ${LD_DEBUG} below. +# If you want to use a debugging library such as a malloc debug library, +# or need to add special ld flags after the calc libraries are included, +# set ${LD_DEBUG} below. # # If in doubt, set LD_DEBUG to empty. # @@ -564,18 +564,18 @@ LD_DEBUG= # make debug # # the ${CALC_ENV} is used to supply the proper environment variables -# to calc. Most people will simply need 'CALCPATH=./cal' to ensure -# that these debug rules will only use calc resource files under the +# to calc. Most people will simply need 'CALCPATH=./lib' to ensure +# that these debug rules will only use calc lib files under the # local source directory. The longer lines (with MALLOC_VERBOSE=1 ...) # are useful for SGI IRIX people who have 'WorkShop Performance Tools' # and who also set 'LD_DEBUG= -lmalloc_cv' above. # -# If in doubt, use CALC_ENV= CALCPATH=./cal. +# If in doubt, use CALC_ENV= CALCPATH=./lib. # -CALC_ENV= CALCPATH=./cal -#CALC_ENV= CALCPATH=./cal MALLOC_VERBOSE=1 MALLOC_TRACING=1 \ +CALC_ENV= CALCPATH=./lib +#CALC_ENV= CALCPATH=./lib MALLOC_VERBOSE=1 MALLOC_TRACING=1 \ # MALLOC_FASTCHK=1 MALLOC_FULLWARN=1 -#CALC_ENV= CALCPATH=./cal MALLOC_VERBOSE=1 MALLOC_TRACING=1 \ +#CALC_ENV= CALCPATH=./lib MALLOC_VERBOSE=1 MALLOC_TRACING=1 \ # MALLOC_FASTCHK=1 MALLOC_FULLWARN=1 MALLOC_CLEAR_FREE=1 \ # MALLOC_CLEAR_MALLOC=1 @@ -603,6 +603,7 @@ ALLOW_CUSTOM= -DCUSTOM # CFLAGS are all flags given to ${CC} [[often includes CCOPT, CCWARN, CCMISC]] # ICFLAGS are given to ${CC} for intermediate progs # +# LCFLAGS are CC-style flags for ${LINT} # LDFLAGS are flags given to ${CC} for linking .o files # ILDFLAGS are flags given to ${CC} for linking .o files for intermediate progs # @@ -615,8 +616,8 @@ ALLOW_CUSTOM= -DCUSTOM # # Tested on Red Hat 6.0 Linux but should run on almost any Linux release. # -# For better performance, set the following above: DEBUG= -O2 -g3 -# You might even try: DEBUG= -O3 -g3 +# for better performance, set the following above: +# DEBUG= -O2 # CCWARN= -Wall -Wno-implicit -Wno-comment CCOPT= ${DEBUG} ${NO_SHARED} @@ -625,6 +626,7 @@ CCMISC= CFLAGS= ${CCWARN} ${CCOPT} ${CCMISC} ICFLAGS= ${CCWARN} ${CCMISC} # +LCFLAGS= LDFLAGS= ${NO_SHARED} ${LD_NO_SHARED} ILDFLAGS= # @@ -635,8 +637,8 @@ CC= ${PURIFY} ${LCC} # # gcc set (some call it gcc2, some call it gcc) # -# For better performance, set the following above: DEBUG= -O2 -g3 -# You might even try: DEBUG= -O3 -g3 +# for better performance, set the following above: +# DEBUG= -O2 # #CCWARN= -Wall -Wno-implicit -Wno-comment #CCOPT= ${DEBUG} ${NO_SHARED} @@ -645,6 +647,7 @@ CC= ${PURIFY} ${LCC} #CFLAGS= ${CCWARN} ${CCOPT} ${CCMISC} #ICFLAGS= ${CCWARN} ${CCMISC} # +#LCFLAGS= #LDFLAGS= ${NO_SHARED} ${LD_NO_SHARED} #ILDFLAGS= # @@ -656,9 +659,6 @@ CC= ${PURIFY} ${LCC} # # common cc set # -# For better performance, set the following above: DEBUG= -O2 -g3 -# Or if -O2 -g3 are not supported try: DEBUG= -O -g -# #CCWARN= #CCOPT= ${DEBUG} ${NO_SHARED} #CCMISC= @@ -666,6 +666,7 @@ CC= ${PURIFY} ${LCC} #CFLAGS= ${CCWARN} ${CCOPT} ${CCMISC} #ICFLAGS= ${CCWARN} ${CCMISC} # +#LCFLAGS= #LDFLAGS= ${NO_SHARED} ${LD_NO_SHARED} #ILDFLAGS= # @@ -676,9 +677,11 @@ CC= ${PURIFY} ${LCC} # # SGI IRIX6.2 (or later) -n32 (v7.1 or later) Compiler # -# You must set above: RANLIB=: +# You must set above: +# RANLIB=: # -# For better performance, set the following above: DEBUG= -O2 -g3 +# for better performance, set the following above: +# DEBUG= -O2 -g3 # # If you have the directory /usr/lib32/nonshared, then set the following above: # NO_SHARED= -non_shared @@ -693,6 +696,7 @@ CC= ${PURIFY} ${LCC} #CFLAGS= ${CCWARN} ${CCOPT} ${CCMISC} #ICFLAGS= ${CCWARN} ${CCMISC} # +#LCFLAGS= #LDFLAGS= ${NO_SHARED} ${LD_NO_SHARED} #ILDFLAGS= # @@ -703,10 +707,11 @@ CC= ${PURIFY} ${LCC} # # HP-UX set # -# For better performance, set the following above: DEBUG= -O -g +# for better performance, try set the following above: +# DEBUG= -O # -# Warning: Some HP-UX optimizers are brain-damaged. -# If 'make check' fails use: DEBUG= -g +# Warning: Some HP-UX optimizers are brain-damaged. If 'make check' fails use: +# DEBUG= -g # #CCWARN= #CCOPT= ${DEBUG} ${NO_SHARED} @@ -715,6 +720,7 @@ CC= ${PURIFY} ${LCC} #CFLAGS= ${CCWARN} ${CCOPT} ${CCMISC} #ICFLAGS= ${CCWARN} ${CCMISC} # +#LCFLAGS= #LDFLAGS= ${NO_SHARED} ${LD_NO_SHARED} #ILDFLAGS= # @@ -732,6 +738,7 @@ CC= ${PURIFY} ${LCC} #CFLAGS= ${CCWARN} ${CCOPT} ${CCMISC} #ICFLAGS= ${CCWARN} ${CCMISC} # +#LCFLAGS= #LDFLAGS= ${NO_SHARED} ${LD_NO_SHARED} #ILDFLAGS= # @@ -742,7 +749,8 @@ CC= ${PURIFY} ${LCC} # # Solaris Sun cc compiler set # -# For better performance, set the following above: DEBUG= -O -g +# for better performance, set the following above: +# DEBUG= -O # # We need -DFORCE_STDC to make use of ANSI-C like features and # to avoid the use of -Xc (which as a lose performance wise). @@ -754,6 +762,7 @@ CC= ${PURIFY} ${LCC} #CFLAGS= ${CCWARN} ${CCOPT} ${CCMISC} #ICFLAGS= ${CCWARN} ${CCMISC} # +#LCFLAGS= #LDFLAGS= ${NO_SHARED} ${LD_NO_SHARED} #ILDFLAGS= # @@ -764,8 +773,8 @@ CC= ${PURIFY} ${LCC} # # BSDI's BSD/OS 4.0 (or later) set # -# For better performance, set the following above: DEBUG= -O2 -g3 -# You might even try: DEBUG= -O3 -g3 +# for better performance, set the following above: +# DEBUG= -O2 # #CCWARN= -Wall -Wno-implicit -Wno-comment #CCOPT= ${DEBUG} ${NO_SHARED} @@ -774,6 +783,7 @@ CC= ${PURIFY} ${LCC} #CFLAGS= ${CCWARN} ${CCOPT} ${CCMISC} #ICFLAGS= ${CCWARN} ${CCMISC} -Wno-unused # +#LCFLAGS= #LDFLAGS= ${NO_SHARED} ${LD_NO_SHARED} #ILDFLAGS= # @@ -784,7 +794,8 @@ CC= ${PURIFY} ${LCC} # # Dec Alpha / Compaq Tru64 cc (non-gnu) compiler set # -# For better performance, set the following above: DEBUG= -O2 -g3 +# for better performance, set the following above: +# DEBUG= -O2 # #CCWARN= #CCOPT= ${DEBUG} ${NO_SHARED} @@ -793,6 +804,7 @@ CC= ${PURIFY} ${LCC} #CFLAGS= ${CCWARN} ${CCOPT} ${CCMISC} #ICFLAGS= ${CCWARN} ${CCMISC} -Wno-unused # +#LCFLAGS= #LDFLAGS= ${NO_SHARED} ${LD_NO_SHARED} #ILDFLAGS= # @@ -811,8 +823,8 @@ AWK= awk SED= sed SORT= sort TEE= tee +LINT= lint CTAGS= ctags -CHMOD= chmod FMT= fmt # assume the X11 makedepend tool for the depend rule MAKEDEPEND= makedepend @@ -832,7 +844,7 @@ Q=@ V=@: #V=@ -# the source files which are built into a math link library +# the source files which are built into a math library # # There MUST be a .o for every .c in LIBOBJS # @@ -845,7 +857,7 @@ LIBSRC= addop.c assocfunc.c blkcpy.c block.c byteswap.c \ string.c symbol.c token.c value.c version.c zfunc.c zio.c \ zmath.c zmod.c zmul.c zprime.c zrand.c zrandom.c -# the object files which are built into a math link library +# the object files which are built into a math library # # There MUST be a .o for every .c in LIBSRC plus calcerr.o # which is built via this Makefile. @@ -951,13 +963,13 @@ CUSTOM_PASSDOWN= Q="${Q}" \ CCMISC="${CCMISC}" \ CFLAGS="${CFLAGS} ${ALLOW_CUSTOM}" \ ICFLAGS="${ICFLAGS}" \ + LCFLAGS="${LCFLAGS}" \ LDFLAGS="${LDFLAGS}" \ ILDFLAGS="${ILDFLAGS}" \ LCC="${LCC}" \ CC="${CC}" \ MAKE_FILE=${MAKE_FILE} \ SED=${SED} \ - CHMOD=${CHMOD} \ MAKEDEPEND=${MAKEDEPEND} \ SORT=${SORT} @@ -977,6 +989,7 @@ SAMPLE_PASSDOWN= Q="${Q}" \ CCMISC="${CCMISC}" \ CFLAGS="${CFLAGS} ${ALLOW_CUSTOM}" \ ICFLAGS="${ICFLAGS}" \ + LCFLAGS="${LCFLAGS}" \ LDFLAGS="${LDFLAGS}" \ ILDFLAGS="${ILDFLAGS}" \ CALC_LIBS="../libcalc.a ../custom/libcustcalc.a ${READLINE_LIB}" \ @@ -985,7 +998,6 @@ SAMPLE_PASSDOWN= Q="${Q}" \ MAKE_FILE=${MAKE_FILE} \ SED=${SED} \ MAKEDEPEND=${MAKEDEPEND} \ - CHMOD=${CHMOD} \ SORT=${SORT} # The compelte list of makefile vars passed down to help/Makefile. @@ -994,31 +1006,23 @@ HELP_PASSDOWN= Q="${Q}" \ TOPDIR="${TOPDIR}" \ LIBDIR="${LIBDIR}" \ HELPDIR="${HELPDIR}" \ + CFLAGS="${CFLAGS} ${ALLOW_CUSTOM}" \ ICFLAGS="${ICFLAGS}" \ ILDFLAGS="${ILDFLAGS}" \ LCC="${LCC}" \ MAKE_FILE=${MAKE_FILE} \ SED=${SED} \ - CHMOD=${CHMOD} \ FMT=${FMT} -# The compelte list of makefile vars passed down to cal/Makefile. +# The compelte list of makefile vars passed down to lib/Makefile. # -CAL_PASSDOWN= Q="${Q}" \ +LIB_PASSDOWN= Q="${Q}" \ TOPDIR="${TOPDIR}" \ LIBDIR="${LIBDIR}" \ + HELPDIR="${HELPDIR}" \ MAKE_FILE=${MAKE_FILE} \ - CHMOD=${CHMOD} - -# The compelte list of makefile vars passed down to cscript/Makefile. -# -CSCRIPT_PASSDOWN= Q="${Q}" \ - BINDIR="${BINDIR}" \ - SCRIPTDIR="${SCRIPTDIR}" \ - MAKE_FILE=${MAKE_FILE} \ - CHMOD=${CHMOD} \ SED=${SED} \ - FMT=${FMT} \ + MAKEDEPEND=${MAKEDEPEND} \ SORT=${SORT} # complete list of .h files found (but not built) in the distribution @@ -1029,16 +1033,12 @@ H_SRC= ${LIB_H_SRC} # C_SRC= ${LIBSRC} ${CALCSRC} ${UTIL_C_SRC} -# The list of files that describe calc's GNU Lesser General Public License -# -LICENSE= COPYING COPYING-LGPL - # These files are found (but not built) in the distribution # DISTLIST= ${C_SRC} ${H_SRC} ${MAKE_FILE} BUGS CHANGES LIBRARY README \ - calc.man HOWTO.INSTALL ${UTIL_MISC_SRC} ${LICENSE} + calc.man lint.sed HOWTO.INSTALL ${UTIL_MISC_SRC} -# These files are used to make (but not built) a calc .a link library +# These files are used to make (but not built) a calc .a library # CALCLIBLIST= ${LIBSRC} ${UTIL_C_SRC} ${LIB_H_SRC} ${MAKE_FILE} \ ${UTIL_MISC_SRC} BUGS CHANGES LIBRARY @@ -1057,8 +1057,8 @@ PROGS= calc ${UTIL_PROGS} # complete list of targets # -TARGETS= ${LICENSE} ${CALC_LIBS} custom/.all calc sample/sample \ - cal/.all help/.all help/builtin cscript/.all calc.1 +TARGETS= ${CALC_LIBS} custom/.all calc sample/sample \ + lib/.all help/.all help/builtin calc.1 ### @@ -1076,17 +1076,12 @@ libcalc.a: ${LIBOBJS} ${MAKE_FILE} -rm -f libcalc.a ar qc libcalc.a ${LIBOBJS} ${RANLIB} libcalc.a - ${CHMOD} 0644 libcalc.a + chmod 0644 libcalc.a calc.1: calc.man ${MAKE_FILE} -rm -f calc.1 ${SED} -e 's:$${LIBDIR}:${LIBDIR}:g' \ - -e 's,$${BINDIR},${BINDIR},g' \ -e 's,$${CALCPATH},${CALCPATH},g' \ - -e 's,$${SCRIPTDIR},${SCRIPTDIR},g' \ - -e 's,$${INCDIRCALC},${INCDIRCALC},g' \ - -e 's,$${CUSTOMLIBDIR},${CUSTOMLIBDIR},g' \ - -e 's,$${CUSTOMHELPDIR},${CUSTOMHELPDIR},g' \ -e 's,$${CALCRC},${CALCRC},g' < calc.man > calc.1 ## @@ -1142,34 +1137,34 @@ conf.h: ${MAKE_FILE} ${Q}echo '' >> conf.h ${Q}echo '' >> conf.h ${Q}echo '/* the default :-separated search path */' >> conf.h - ${Q}echo '#if !defined(DEFAULTCALCPATH)' >> conf.h + ${Q}echo '#ifndef DEFAULTCALCPATH' >> conf.h ${Q}echo '#define DEFAULTCALCPATH "${CALCPATH}"' >> conf.h ${Q}echo '#endif /* DEFAULTCALCPATH */' >> conf.h ${Q}echo '' >> conf.h ${Q}echo '/* the default :-separated startup file list */' >> conf.h - ${Q}echo '#if !defined(DEFAULTCALCRC)' >> conf.h + ${Q}echo '#ifndef DEFAULTCALCRC' >> conf.h ${Q}echo '#define DEFAULTCALCRC "${CALCRC}"' >> conf.h ${Q}echo '#endif /* DEFAULTCALCRC */' >> conf.h ${Q}echo '' >> conf.h ${Q}echo '/* the location of the help directory */' >> conf.h - ${Q}echo '#if !defined(HELPDIR)' >> conf.h + ${Q}echo '#ifndef HELPDIR' >> conf.h ${Q}echo '#define HELPDIR "${HELPDIR}"' >> conf.h ${Q}echo '#endif /* HELPDIR */' >> conf.h ${Q}echo '' >> conf.h ${Q}echo '/* the location of the custom help directory */' >> conf.h - ${Q}echo '#if !defined(CUSTOMHELPDIR)' >> conf.h + ${Q}echo '#ifndef CUSTOMHELPDIR' >> conf.h ${Q}echo '#define CUSTOMHELPDIR "${CUSTOMHELPDIR}"' >> conf.h ${Q}echo '#endif /* CUSTOMHELPDIR */' >> conf.h ${Q}echo '' >> conf.h ${Q}echo '/* the default pager to use */' >> conf.h - ${Q}echo '#if !defined(DEFAULTCALCPAGER)' >> conf.h + ${Q}echo '#ifndef DEFAULTCALCPAGER' >> conf.h ${Q}echo '#define DEFAULTCALCPAGER "${CALCPAGER}"' >> conf.h ${Q}echo '#endif /* DEFAULTCALCPAGER */' >> conf.h ${Q}echo '' >> conf.h ${Q}echo '/* where the echo command is located */' >> conf.h - ${Q}echo '#if !defined(ECHO_PROG)' >> conf.h - ${Q}echo '#define ECHO_PROG "${ECHO}"' >> conf.h - ${Q}echo '#endif /* ECHO_PROG */' >> conf.h + ${Q}echo '#ifndef ECHO' >> conf.h + ${Q}echo '#define ECHO "${ECHO}"' >> conf.h + ${Q}echo '#endif /* ECHO */' >> conf.h ${Q}echo '' >> conf.h ${Q}echo '' >> conf.h ${Q}echo '#endif /* !__CONF_H__ */' >> conf.h @@ -1496,10 +1491,10 @@ longlong.h: longlong.c have_stdlib.h have_string.h ${MAKE_FILE} -${Q}if [ -s ll_tmp ]; then \ cat ll_tmp >> longlong.h; \ else \ - echo '/* no long long type */'; \ echo '#undef HAVE_LONGLONG' >> longlong.h; \ echo '#define LONGLONG_BITS 0 /* no */' >> longlong.h; \ - echo '#undef L64_FORMAT' >> longlong.h; \ + echo '#undef LL_FORMAT' >> longlong.h; \ + echo '#undef L_FORMAT' >> longlong.h; \ fi ${Q}echo '' >> longlong.h ${Q}echo '' >> longlong.h @@ -2314,10 +2309,10 @@ longbits: longbits.o # ## -cal/.all: +lib/.all: ${V} echo '=-=-=-=-= start of $@ rule =-=-=-=-=' - ${V} echo '=-=-=-=-= Invoking all rule for cal =-=-=-=-=' - cd cal; ${MAKE} -f Makefile ${CAL_PASSDOWN} all + ${V} echo '=-=-=-=-= Invoking all rule for lib =-=-=-=-=' + cd lib; ${MAKE} -f Makefile ${LIB_PASSDOWN} all ${V} echo '=-=-=-=-= Back to the main Makefile for $@ rule =-=-=-=-=' ${V} echo '=-=-=-=-= end of $@ rule =-=-=-=-=' @@ -2335,13 +2330,6 @@ help/builtin: func.c help/builtin.top help/builtin.end help/funclist.sed ${V} echo '=-=-=-=-= Back to the main Makefile for $@ rule =-=-=-=-=' ${V} echo '=-=-=-=-= end of $@ rule =-=-=-=-=' -cscript/.all: - ${V} echo '=-=-=-=-= start of $@ rule =-=-=-=-=' - ${V} echo '=-=-=-=-= Invoking all rule for cscript =-=-=-=-=' - cd cscript; ${MAKE} -f Makefile ${CSCRIPT_PASSDOWN} all - ${V} echo '=-=-=-=-= Back to the main Makefile for $@ rule =-=-=-=-=' - ${V} echo '=-=-=-=-= end of $@ rule =-=-=-=-=' - # This is a special rule that first tries to determine of a lower level # make is needed, and it so a make will be performed. Because it is # triggered as the first dependent of the all rule, it will ensure @@ -2435,12 +2423,29 @@ bsdi: ${LIB_H_SRC} ${BUILD_H_SRC} calc.1 rm -f gen_h/$$i; \ echo cp $$i gen_h; \ cp $$i gen_h; \ - echo ${CHMOD} 0444 gen_h/$$i; \ - ${CHMOD} 0444 gen_h/$$i; \ + echo chmod 0444 gen_h/$$i; \ + chmod 0444 gen_h/$$i; \ done cd help; ${MAKE} -f Makefile ${HELP_PASSDOWN} bsdi ${V} echo '=-=-=-=-= end of $@ rule =-=-=-=-=' +## +# +# These rules help with linting. Adjust ${LINT}, ${LINTLIB}, ${LINTFLAGS} +# and the lint.sed file as needed for your system. +# +## + +llib-lcalc.ln: ${BUILD_H_SRC} ${LIBSRC} ${MAKE_FILE} + -rm -f llib-lcalc.ln llib.out + -touch llib-lcalc.ln + ${LINTLIB} ${LIBSRC} 2>&1 | ${SED} -f lint.sed | ${TEE} llib.out + +lint: ${BUILD_H_SRC} ${CALCSRC} llib-lcalc.ln lint.sed ${MAKE_FILE} + -rm -f lint.out + ${LINT} ${LINTFLAGS} ${LCFLAGS} llib-lcalc.ln ${CALCSRC} 2>&1 | \ + ${SED} -f lint.sed | ${TEE} lint.out + ## # # Home grown make dependency rules. Your system make not support @@ -2533,17 +2538,15 @@ distlist: ${DISTLIST} echo $$i; \ done; \ (cd help; ${MAKE} ${HELP_PASSDOWN} $@); \ - (cd cal; ${MAKE} ${CAL_PASSDOWN} $@); \ + (cd lib; ${MAKE} ${LIB_PASSDOWN} $@); \ (cd custom; ${MAKE} ${CUSTOM_PASSDOWN} $@); \ - (cd cscript; ${MAKE} ${CSCRIPT_PASSDOWN} $@); \ (cd sample; ${MAKE} ${SAMPLE_PASSDOWN} $@)) | ${SORT} distdir: ${Q}(echo .; \ (cd help; ${MAKE} ${HELP_PASSDOWN} $@); \ - (cd cal; ${MAKE} ${CAL_PASSDOWN} $@); \ + (cd lib; ${MAKE} ${LIB_PASSDOWN} $@); \ (cd custom; ${MAKE} ${CUSTOM_PASSDOWN} $@); \ - (cd cscript; ${MAKE} ${CSCRIPT_PASSDOWN} $@); \ (cd sample; ${MAKE} ${SAMPLE_PASSDOWN} $@)) | ${SORT} calcliblist: @@ -2551,9 +2554,8 @@ calcliblist: echo $$i; \ done; \ (cd help; ${MAKE} ${HELP_PASSDOWN} $@); \ - (cd cal; ${MAKE} ${CAL_PASSDOWN} $@); \ + (cd lib; ${MAKE} ${LIB_PASSDOWN} $@); \ (cd custom; ${MAKE} ${CUSTOM_PASSDOWN} $@); \ - (cd cscript; ${MAKE} ${CSCRIPT_PASSDOWN} $@); \ (cd sample; ${MAKE} ${SAMPLE_PASSDOWN} $@)) | ${SORT} calcliblistfmt: @@ -2571,10 +2573,10 @@ calcliblistfmt: # ## -check: all ./cal/regress.cal +check: all ./lib/regress.cal ${CALC_ENV} ./calc -d -q read regress -chk: ./cal/regress.cal +chk: ./lib/regress.cal ${V} echo '=-=-=-=-= start of $@ rule =-=-=-=-=' ${CALC_ENV} ./calc -d -q read regress 2>&1 | ${AWK} -f check.awk ${V} echo '=-=-=-=-= end of $@ rule =-=-=-=-=' @@ -2623,7 +2625,6 @@ env: @echo "HELPDIR=${HELPDIR}"; echo "" @echo "CUSTOMLIBDIR=${CUSTOMLIBDIR}"; echo "" @echo "CUSTOMHELPDIR=${CUSTOMHELPDIR}"; echo "" - @echo "SCRIPTDIR=${SCRIPTDIR}"; echo "" @echo "MANDIR=${MANDIR}"; echo "" @echo "CATDIR=${CATDIR}"; echo "" @echo "MANEXT=${MANEXT}"; echo "" @@ -2638,6 +2639,8 @@ env: @echo "NO_SHARED=${NO_SHARED}"; echo "" @echo "LD_NO_SHARED=${LD_NO_SHARED}"; echo "" @echo "RANLIB=${RANLIB}"; echo "" + @echo "LINTLIB=${LINTLIB}"; echo "" + @echo "LINTFLAGS=${LINTFLAGS}"; echo "" @echo "MAKE_FILE=${MAKE_FILE}"; echo "" @echo "PURIFY=${PURIFY}"; echo "" @echo "LD_DEBUG=${LD_DEBUG}"; echo "" @@ -2648,6 +2651,7 @@ env: @echo "CCMISC=${CCMISC}"; echo "" @echo "CFLAGS=${CFLAGS}"; echo "" @echo "ICFLAGS=${ICFLAGS}"; echo "" + @echo "LCFLAGS=${LCFLAGS}"; echo "" @echo "LDFLAGS=${LDFLAGS}"; echo "" @echo "ILDFLAGS=${ILDFLAGS}"; echo "" @echo "LCC=${LCC}"; echo "" @@ -2658,6 +2662,7 @@ env: @echo "SED=${SED}"; echo "" @echo "SORT=${SORT}"; echo "" @echo "TEE=${TEE}"; echo "" + @echo "LINT=${LINT}"; echo "" @echo "CTAGS=${CTAGS}"; echo "" @echo "MAKEDEPEND=${MAKEDEPEND}"; echo "" @echo "Q=${Q}"; echo "" @@ -2677,8 +2682,7 @@ env: @echo "CUSTOM_PASSDOWN=${CUSTOM_PASSDOWN}"; echo "" @echo "SAMPLE_PASSDOWN=${SAMPLE_PASSDOWN}"; echo "" @echo "HELP_PASSDOWN=${HELP_PASSDOWN}"; echo "" - @echo "CAL_PASSDOWN=${CAL_PASSDOWN}"; echo "" - @echo "CSCRIPT_PASSDOWN=${CSCRIPT_PASSDOWN}"; echo "" + @echo "LIB_PASSDOWN=${LIB_PASSDOWN}"; echo "" @echo "H_SRC=${H_SRC}"; echo "" @echo "C_SRC=${C_SRC}"; echo "" @echo "DISTLIST=${DISTLIST}"; echo "" @@ -2764,6 +2768,9 @@ tags: ${CALCSRC} ${LIBSRC} ${H_SRC} ${BUILD_H_SRC} ${MAKE_FILE} -${CTAGS} ${CALCSRC} ${LIBSRC} ${H_SRC} ${BUILD_H_SRC} 2>&1 | \ egrep -v 'Duplicate entry|Second entry ignored' +lintclean: + -rm -f llib-lcalc.ln llib.out lint.out + clean: ${V} echo '=-=-=-=-= start of $@ rule =-=-=-=-=' -rm -f ${LIBOBJS} @@ -2775,8 +2782,8 @@ clean: ${Q}echo '=-=-=-=-= Invoking $@ rule for help =-=-=-=-=' -cd help; ${MAKE} -f Makefile ${HELP_PASSDOWN} clean ${Q}echo '=-=-=-=-= Back to the main Makefile for $@ rule =-=-=-=-=' - ${Q}echo '=-=-=-=-= Invoking $@ rule for cal =-=-=-=-=' - -cd cal; ${MAKE} -f Makefile ${CAL_PASSDOWN} clean + ${Q}echo '=-=-=-=-= Invoking $@ rule for lib =-=-=-=-=' + -cd lib; ${MAKE} -f Makefile ${LIB_PASSDOWN} clean ${Q}echo '=-=-=-=-= Back to the main Makefile for $@ rule =-=-=-=-=' ${V} echo '=-=-=-=-= Invoking $@ rule for custom =-=-=-=-=' cd custom; ${MAKE} -f Makefile ${CUSTOM_PASSDOWN} clean @@ -2784,16 +2791,12 @@ clean: ${V} echo '=-=-=-=-= Invoking $@ rule for sample =-=-=-=-=' cd sample; ${MAKE} -f Makefile ${SAMPLE_PASSDOWN} clean ${V} echo '=-=-=-=-= Back to the main Makefile for $@ rule =-=-=-=-=' - ${V} echo '=-=-=-=-= Invoking $@ rule for cscript =-=-=-=-=' - cd cscript; ${MAKE} -f Makefile ${CSCRIPT_PASSDOWN} clean - ${V} echo '=-=-=-=-= Back to the main Makefile for $@ rule =-=-=-=-=' ${Q}echo remove files that are obsolete - -rm -rf lib - -rm -f endian.h stdarg.h libcalcerr.a cal/obj help/obj + -rm -f endian.h stdarg.h libcalcerr.a lib/obj help/obj -rm -f have_vs.c std_arg.h try_stdarg.c fnvhash.c ${V} echo '=-=-=-=-= end of $@ rule =-=-=-=-=' -clobber: +clobber: lintclean ${V} echo '=-=-=-=-= start of $@ rule =-=-=-=-=' -rm -f ${LIBOBJS} -rm -f ${CALCOBJS} @@ -2812,8 +2815,8 @@ clobber: ${V} echo '=-=-=-=-= Invoking $@ rule for help =-=-=-=-=' -cd help; ${MAKE} -f Makefile ${HELP_PASSDOWN} clobber ${V} echo '=-=-=-=-= Back to the main Makefile for $@ rule =-=-=-=-=' - ${V} echo '=-=-=-=-= Invoking $@ rule for cal =-=-=-=-=' - -cd cal; ${MAKE} -f Makefile ${CAL_PASSDOWN} clobber + ${V} echo '=-=-=-=-= Invoking $@ rule for lib =-=-=-=-=' + -cd lib; ${MAKE} -f Makefile ${LIB_PASSDOWN} clobber ${V} echo '=-=-=-=-= Back to the main Makefile for $@ rule =-=-=-=-=' ${V} echo '=-=-=-=-= Invoking $@ rule for custom =-=-=-=-=' cd custom; ${MAKE} -f Makefile ${CUSTOM_PASSDOWN} clobber @@ -2821,12 +2824,8 @@ clobber: ${V} echo '=-=-=-=-= Invoking $@ rule for sample =-=-=-=-=' cd sample; ${MAKE} -f Makefile ${SAMPLE_PASSDOWN} clobber ${V} echo '=-=-=-=-= Back to the main Makefile for $@ rule =-=-=-=-=' - ${V} echo '=-=-=-=-= Invoking $@ rule for cscript =-=-=-=-=' - cd cscript; ${MAKE} -f Makefile ${CSCRIPT_PASSDOWN} clobber - ${V} echo '=-=-=-=-= Back to the main Makefile for $@ rule =-=-=-=-=' ${V} echo remove files that are obsolete - -rm -rf lib - -rm -f endian.h stdarg.h libcalcerr.a cal/obj help/obj + -rm -f endian.h stdarg.h libcalcerr.a lib/obj help/obj -rm -f have_vs.c std_arg.h try_stdarg.c fnvhash.c ${V} echo '=-=-=-=-= end of $@ rule =-=-=-=-=' @@ -2838,57 +2837,50 @@ install: calc libcalc.a ${LIB_H_SRC} ${BUILD_H_SRC} calc.1 else \ true; \ fi - -${CHMOD} 0755 ${TOPDIR} + -chmod 0755 ${TOPDIR} -${Q}if [ ! -d ${LIBDIR} ]; then \ echo mkdir ${LIBDIR}; \ mkdir ${LIBDIR}; \ else \ true; \ fi - -${CHMOD} 0755 ${LIBDIR} + -chmod 0755 ${LIBDIR} -${Q}if [ ! -d ${HELPDIR} ]; then \ echo mkdir ${HELPDIR}; \ mkdir ${HELPDIR}; \ else \ true; \ fi - -${CHMOD} 0755 ${HELPDIR} - -${Q}if [ ! -d ${SCRIPTDIR} ]; then \ - echo mkdir ${SCRIPTDIR}; \ - mkdir ${SCRIPTDIR}; \ - else \ - true; \ - fi - -${CHMOD} 0755 ${SCRIPTDIR} + -chmod 0755 ${HELPDIR} -${Q}if [ ! -d ${INCDIR} ]; then \ echo mkdir ${INCDIR}; \ mkdir ${INCDIR}; \ else \ true; \ fi - -${CHMOD} 0755 ${INCDIR} + -chmod 0755 ${INCDIR} -${Q}if [ ! -d ${INCDIRCALC} ]; then \ echo mkdir ${INCDIRCALC}; \ mkdir ${INCDIRCALC}; \ else \ true; \ fi - -${CHMOD} 0755 ${INCDIRCALC} + -chmod 0755 ${INCDIRCALC} -${Q}if [ ! -d ${BINDIR} ]; then \ echo mkdir ${BINDIR}; \ mkdir ${BINDIR}; \ else \ true; \ fi - -${CHMOD} 0755 ${BINDIR} + -chmod 0755 ${BINDIR} -rm -f ${BINDIR}/calc cp calc ${BINDIR} - -${CHMOD} 0555 ${BINDIR}/calc + -chmod 0555 ${BINDIR}/calc ${V} echo '=-=-=-=-= Invoking $@ rule for help =-=-=-=-=' cd help; ${MAKE} -f Makefile ${HELP_PASSDOWN} install ${V} echo '=-=-=-=-= Back to the main Makefile for $@ rule =-=-=-=-=' - ${V} echo '=-=-=-=-= Invoking $@ rule for cal =-=-=-=-=' - cd cal; ${MAKE} -f Makefile ${CAL_PASSDOWN} install + ${V} echo '=-=-=-=-= Invoking $@ rule for lib =-=-=-=-=' + cd lib; ${MAKE} -f Makefile ${LIB_PASSDOWN} install ${V} echo '=-=-=-=-= Back to the main Makefile for $@ rule =-=-=-=-=' ${V} echo '=-=-=-=-= Invoking $@ rule for custom =-=-=-=-=' cd custom; ${MAKE} -f Makefile ${CUSTOM_PASSDOWN} install @@ -2896,13 +2888,10 @@ install: calc libcalc.a ${LIB_H_SRC} ${BUILD_H_SRC} calc.1 ${V} echo '=-=-=-=-= Invoking $@ rule for sample =-=-=-=-=' cd sample; ${MAKE} -f Makefile ${SAMPLE_PASSDOWN} install ${V} echo '=-=-=-=-= Back to the main Makefile for $@ rule =-=-=-=-=' - ${V} echo '=-=-=-=-= Invoking $@ rule for cscript =-=-=-=-=' - cd cscript; ${MAKE} -f Makefile ${CSCRIPT_PASSDOWN} install - ${V} echo '=-=-=-=-= Back to the main Makefile for $@ rule =-=-=-=-=' -rm -f ${LIBDIR}/libcalc.a cp -f libcalc.a ${LIBDIR}/libcalc.a ${RANLIB} ${LIBDIR}/libcalc.a - -${CHMOD} 0444 ${LIBDIR}/libcalc.a + -chmod 0644 ${LIBDIR}/libcalc.a -${Q}for i in ${LIB_H_SRC} ${BUILD_H_SRC}; do \ echo rm -f ${LIBDIR}/$$i; \ rm -f ${LIBDIR}/$$i; \ @@ -2910,9 +2899,20 @@ install: calc libcalc.a ${LIB_H_SRC} ${BUILD_H_SRC} calc.1 rm -f ${INCDIRCALC}/$$i; \ echo cp $$i ${INCDIRCALC}; \ cp $$i ${INCDIRCALC}; \ - echo ${CHMOD} 0444 ${INCDIRCALC}/$$i; \ - ${CHMOD} 0444 ${INCDIRCALC}/$$i; \ + echo chmod 0444 ${INCDIRCALC}/$$i; \ + chmod 0444 ${INCDIRCALC}/$$i; \ done + ${Q}: If lint was made, install the lint library. + -${Q}if [ -f llib-lcalc.ln ]; then \ + echo rm -f ${LIBDIR}/llib-lcalc.ln; \ + rm -f ${LIBDIR}/llib-lcalc.ln; \ + echo cp llib-lcalc.ln ${LIBDIR}; \ + cp llib-lcalc.ln ${LIBDIR}; \ + echo chmod 0444 ${LIBDIR}/llib-lcalc.ln; \ + chmod 0444 ${LIBDIR}/llib-lcalc.ln; \ + else \ + true; \ + fi -${Q}if [ -z "${MANDIR}" ]; then \ echo '$${MANDIR} is empty, calc man page will not be installed'; \ else \ @@ -2920,8 +2920,8 @@ install: calc libcalc.a ${LIB_H_SRC} ${BUILD_H_SRC} calc.1 rm -f ${MANDIR}/calc.${MANEXT}; \ echo "cp calc.1 ${MANDIR}/calc.${MANEXT}"; \ cp calc.1 ${MANDIR}/calc.${MANEXT}; \ - echo "${CHMOD} 0444 ${MANDIR}/calc.${MANEXT}"; \ - ${CHMOD} 0444 ${MANDIR}/calc.${MANEXT}; \ + echo "chmod 0444 ${MANDIR}/calc.${MANEXT}"; \ + chmod 0444 ${MANDIR}/calc.${MANEXT}; \ fi -${Q}if [ -z "${CATDIR}" ]; then \ echo '$${CATDIR} is empty, calc cat page will not be installed'; \ @@ -2934,8 +2934,8 @@ install: calc libcalc.a ${LIB_H_SRC} ${BUILD_H_SRC} calc.1 rm -f ${CATDIR}/calc.${CATEXT}; \ echo "${NROFF} ${NROFF_ARG} calc.1 > ${CATDIR}/calc.${CATEXT}";\ ${NROFF} ${NROFF_ARG} calc.1 > ${CATDIR}/calc.${CATEXT}; \ - echo "${CHMOD} ${MANMODE} ${MANDIR}/calc.${MANEXT}"; \ - ${CHMOD} ${MANMODE} ${MANDIR}/calc.${MANEXT}; \ + echo "chmod ${MANMODE} ${MANDIR}/calc.${MANEXT}"; \ + chmod ${MANMODE} ${MANDIR}/calc.${MANEXT}; \ fi; \ fi ${Q}echo remove files that are obsolete @@ -2944,11 +2944,8 @@ install: calc libcalc.a ${LIB_H_SRC} ${BUILD_H_SRC} calc.1 -rm -f ${LIBDIR}/prototype.h prototype.h -rm -f ${LIBDIR}/libcalcerr.a libcalcerr.a -rm -f ${LIBDIR}/calc_errno.h calc_errno.h ${INCDIRCALC}/calc_errno.h - -rm -f calc_errno.c calc_errno.o calc_errno lint.sed - -rm -f alloc.c alloc.o have_vs.c have_vs.o have_vs io.c io.o - -rm -f std_arg.h try_stdarg.c try_stdarg.o try_stdarg - -rm -f ${LIBDIR}/altbind ${HELPDIR}/altbind cal/altbind - -rm -f ${LIBDIR}/llib-lcalc.ln + -rm -f calc_errno.c calc_errno.o calc_errno + -rm -f ${LIBDIR}/altbind ${HELPDIR}/altbind ${V} echo '=-=-=-=-= end of $@ rule =-=-=-=-=' ## @@ -3195,7 +3192,6 @@ config.o: have_malloc.h config.o: have_memmv.h config.o: have_newstr.h config.o: have_stdlib.h -config.o: have_strdup.h config.o: have_string.h config.o: longbits.h config.o: md5.h @@ -3434,6 +3430,7 @@ hist.o: qmath.h hist.o: shs.h hist.o: shs1.h hist.o: string.h +hist.o: terminal.h hist.o: value.h hist.o: zmath.h input.o: alloc.h @@ -3525,7 +3522,6 @@ lib_calc.o: shs.h lib_calc.o: shs1.h lib_calc.o: string.h lib_calc.o: symbol.h -lib_calc.o: terminal.h lib_calc.o: token.h lib_calc.o: value.h lib_calc.o: zmath.h diff --git a/README b/README index 4533f0a..93ead49 100644 --- a/README +++ b/README @@ -52,10 +52,9 @@ C programmers should note some unexpected differences in the calc syntax: > help unexpected -Calc is shipped with a standard collection of calc resource files. -For a list of calc standard resource files see: +Calc is shipped with a library of calc scripts. For a list see: - > help resource + > help stdlib =-= @@ -99,29 +98,3 @@ but see the BUGS file first. The calc web site is located at: http://reality.sgi.com/chongo/tech/comp/calc/ - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: README,v 29.1 1999/12/14 09:15:29 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/RCS/README,v $ -## -## Under source code control: 1995/10/25 05:27:59 -## File existed as early as: 1995 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/addop.c b/addop.c index 0629648..456adf7 100644 --- a/addop.c +++ b/addop.c @@ -1,35 +1,11 @@ /* - * addop - add opcodes to a function being compiled + * Copyright (c) 1997 David I. Bell + * Permission is granted to use, distribute, or modify this source, + * provided that this copyright notice remains intact. * - * Copyright (C) 1999 David I. Bell and Ernest Bowen - * - * Primary author: David I. Bell - * - * Calc is open software; you can redistribute it and/or modify it under - * the terms of the version 2.1 of the GNU Lesser General Public License - * as published by the Free Software Foundation. - * - * Calc is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General - * Public License for more details. - * - * A copy of version 2.1 of the GNU Lesser General Public License is - * distributed with calc under the filename COPYING-LGPL. You should have - * received a copy with calc; if not, write to Free Software Foundation, Inc. - * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. - * - * @(#) $Revision: 29.1 $ - * @(#) $Id: addop.c,v 29.1 1999/12/14 09:15:29 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/addop.c,v $ - * - * Under source code control: 1990/02/15 01:48:10 - * File existed as early as: before 1990 - * - * Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ + * Add opcodes to a function being compiled. */ - #include #include "calc.h" #include "opcodes.h" @@ -92,7 +68,7 @@ showfunctions(void) count = 0; if (funccount > 0) { - if (conf->resource_debug & RSCDBG_FUNC_INFO) + if (conf->lib_debug & LIBDBG_FUNC_INFO) math_str("Index\tName \tArgs\tOpcodes\n" "-----\t------ \t---- \t------\n"); else @@ -100,7 +76,7 @@ showfunctions(void) "----\t---------\n"); for (index = 0; index < funccount; index++) { fp = functions[index]; - if (conf->resource_debug & RSCDBG_FUNC_INFO) { + if (conf->lib_debug & LIBDBG_FUNC_INFO) { math_fmt("%5ld\t%-12s\t", index, namestr(&funcnames,index)); @@ -120,7 +96,7 @@ showfunctions(void) } } } - if (conf->resource_debug & RSCDBG_FUNC_INFO) { + if (conf->lib_debug & LIBDBG_FUNC_INFO) { math_fmt("\nNumber non-null: %ld\n", count); math_fmt("Number null: %ld\n", funccount - count); math_fmt("Total number: %ld\n", funccount); @@ -215,8 +191,8 @@ endfunc(void) size += dumpop(&fp->f_opcodes[size]); } } - if ((inputisterminal() && conf->resource_debug & RSCDBG_STDIN_FUNC) || - (!inputisterminal() && conf->resource_debug & RSCDBG_FILE_FUNC)) { + if ((inputisterminal() && conf->lib_debug & LIBDBG_STDIN_FUNC) || + (!inputisterminal() && conf->lib_debug & LIBDBG_FILE_FUNC)) { printf("%s(", newname); for (index = 0; index < fp->f_paramcount; index++) { if (index) @@ -288,8 +264,8 @@ rmuserfunc(char *name) return; freenumbers(functions[index]); free(functions[index]); - if ((inputisterminal() && conf->resource_debug & RSCDBG_STDIN_FUNC) || - (!inputisterminal() && conf->resource_debug & RSCDBG_FILE_FUNC)) + if ((inputisterminal() && conf->lib_debug & LIBDBG_STDIN_FUNC) || + (!inputisterminal() && conf->lib_debug & LIBDBG_FILE_FUNC)) printf("%s() undefined\n", name); functions[index] = NULL; } diff --git a/align32.c b/align32.c index 5bf6dad..e48b392 100644 --- a/align32.c +++ b/align32.c @@ -1,34 +1,26 @@ /* * align32 - determine if 32 bit accesses must be aligned * - * Copyright (C) 1999 Landon Curt Noll + * This file was written by: * - * Calc is open software; you can redistribute it and/or modify it under - * the terms of the version 2.1 of the GNU Lesser General Public License - * as published by the Free Software Foundation. + * Landon Curt Noll + * http://reality.sgi.com/chongo/ * - * Calc is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General - * Public License for more details. + * chongo /\../\ * - * A copy of version 2.1 of the GNU Lesser General Public License is - * distributed with calc under the filename COPYING-LGPL. You should have - * received a copy with calc; if not, write to Free Software Foundation, Inc. - * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. + * This code has been placed in the public domain. Please do not + * copyright this code. * - * @(#) $Revision: 29.1 $ - * @(#) $Id: align32.c,v 29.1 1999/12/14 09:15:29 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/align32.c,v $ - * - * Under source code control: 1995/11/23 05:18:06 - * File existed as early as: 1995 - * - * chongo /\oo/\ http://reality.sgi.com/chongo/ - * Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ + * LANDON CURT NOLL DISCLAIMS ALL WARRANTIES WITH REGARD TO + * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MER- + * CHANTABILITY AND FITNESS. IN NO EVENT SHALL LANDON CURT + * NOLL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL + * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF + * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, + * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ - #include #include #include "longbits.h" diff --git a/alloc.h b/alloc.h index bbc3545..509e518 100644 --- a/alloc.h +++ b/alloc.h @@ -1,30 +1,7 @@ /* - * alloc - storage allocation and storage debug macros - * - * Copyright (C) 1999 David I. Bell - * - * Calc is open software; you can redistribute it and/or modify it under - * the terms of the version 2.1 of the GNU Lesser General Public License - * as published by the Free Software Foundation. - * - * Calc is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General - * Public License for more details. - * - * A copy of version 2.1 of the GNU Lesser General Public License is - * distributed with calc under the filename COPYING-LGPL. You should have - * received a copy with calc; if not, write to Free Software Foundation, Inc. - * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. - * - * @(#) $Revision: 29.1 $ - * @(#) $Id: alloc.h,v 29.1 1999/12/14 09:15:29 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/alloc.h,v $ - * - * Under source code control: 1990/02/15 01:48:29 - * File existed as early as: before 1990 - * - * Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ + * Copyright (c) 1997 David I. Bell + * Permission is granted to use, distribute, or modify this source, + * provided that this copyright notice remains intact. */ diff --git a/assocfunc.c b/assocfunc.c index 3d8692f..caa2da3 100644 --- a/assocfunc.c +++ b/assocfunc.c @@ -1,33 +1,8 @@ /* - * assocfunc - association table routines + * Copyright (c) 1995 David I. Bell + * Permission is granted to use, distribute, or modify this source, + * provided that this copyright notice remains intact. * - * Copyright (C) 1999 David I. Bell - * - * Calc is open software; you can redistribute it and/or modify it under - * the terms of the version 2.1 of the GNU Lesser General Public License - * as published by the Free Software Foundation. - * - * Calc is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General - * Public License for more details. - * - * A copy of version 2.1 of the GNU Lesser General Public License is - * distributed with calc under the filename COPYING-LGPL. You should have - * received a copy with calc; if not, write to Free Software Foundation, Inc. - * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. - * - * @(#) $Revision: 29.1 $ - * @(#) $Id: assocfunc.c,v 29.1 1999/12/14 09:15:29 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/assocfunc.c,v $ - * - * Under source code control: 1993/07/20 23:04:27 - * File existed as early as: 1993 - * - * Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ - */ - -/* * Association table routines. * An association table is a type of value which can be "indexed" by * one or more arbitrary values. Each element in the table is thus an @@ -36,7 +11,6 @@ * quick access. */ - #include "value.h" diff --git a/blkcpy.c b/blkcpy.c index 5e01554..8005af6 100644 --- a/blkcpy.c +++ b/blkcpy.c @@ -1,35 +1,12 @@ /* - * blkcpy - general values and related routines used by the calculator + * Copyright (c) 1997 Ernest Bowen and Landon Curt Noll + * Permission is granted to use, distribute, or modify this source, + * provided that this copyright notice remains intact. * - * Copyright (C) 1999 Landon Curt Noll and Ernest Bowen - * - * Primary author: Landon Curt Noll - * - * Calc is open software; you can redistribute it and/or modify it under - * the terms of the version 2.1 of the GNU Lesser General Public License - * as published by the Free Software Foundation. - * - * Calc is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General - * Public License for more details. - * - * A copy of version 2.1 of the GNU Lesser General Public License is - * distributed with calc under the filename COPYING-LGPL. You should have - * received a copy with calc; if not, write to Free Software Foundation, Inc. - * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. - * - * @(#) $Revision: 29.1 $ - * @(#) $Id: blkcpy.c,v 29.1 1999/12/14 09:15:29 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/blkcpy.c,v $ - * - * Under source code control: 1997/04/18 20:41:26 - * File existed as early as: 1997 - * - * Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ + * By: Ernest Bowen and Landon Curt Noll + * ernie@neumann.une.edu.au and http://reality.sgi.com/chongo/ */ - #include #include #include "calc.h" diff --git a/blkcpy.h b/blkcpy.h index bbb9833..6f4acab 100644 --- a/blkcpy.h +++ b/blkcpy.h @@ -1,32 +1,9 @@ /* - * blkcpy - general values and related routines used by the calculator + * Copyright (c) 1997 David I. Bell + * Permission is granted to use, distribute, or modify this source, + * provided that this copyright notice remains intact. * - * Copyright (C) 1999 Landon Curt Noll and Ernest Bowen - * - * Primary author: Landon Curt Noll - * - * Calc is open software; you can redistribute it and/or modify it under - * the terms of the version 2.1 of the GNU Lesser General Public License - * as published by the Free Software Foundation. - * - * Calc is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General - * Public License for more details. - * - * A copy of version 2.1 of the GNU Lesser General Public License is - * distributed with calc under the filename COPYING-LGPL. You should have - * received a copy with calc; if not, write to Free Software Foundation, Inc. - * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. - * - * @(#) $Revision: 29.1 $ - * @(#) $Id: blkcpy.h,v 29.1 1999/12/14 09:15:29 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/blkcpy.h,v $ - * - * Under source code control: 1997/04/18 20:41:25 - * File existed as early as: 1997 - * - * Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ + * Definitions of general values and related routines used by the calculator. */ diff --git a/block.c b/block.c index dd54e47..010b487 100644 --- a/block.c +++ b/block.c @@ -1,33 +1,36 @@ /* * block - fixed, dynamic, fifo and circular memory blocks + */ +/* + * Copyright (c) 1997 by Landon Curt Noll. All Rights Reserved. * - * Copyright (C) 1999 Landon Curt Noll and Ernest Bowen + * Permission to use, copy, modify, and distribute this software and + * its documentation for any purpose and without fee is hereby granted, + * provided that the above copyright, this permission notice and text + * this comment, and the disclaimer below appear in all of the following: * - * Primary author: Landon Curt Noll + * supporting documentation + * source copies + * source works derived from this source + * binaries derived from this source or from derived source * - * Calc is open software; you can redistribute it and/or modify it under - * the terms of the version 2.1 of the GNU Lesser General Public License - * as published by the Free Software Foundation. + * LANDON CURT NOLL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO + * EVENT SHALL LANDON CURT NOLL BE LIABLE FOR ANY SPECIAL, INDIRECT OR + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF + * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR + * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. * - * Calc is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General - * Public License for more details. + * Comments, suggestions, bug fixes and questions about these routines + * are welcome. Send EMail to the address given below. * - * A copy of version 2.1 of the GNU Lesser General Public License is - * distributed with calc under the filename COPYING-LGPL. You should have - * received a copy with calc; if not, write to Free Software Foundation, Inc. - * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. + * Happy bit twiddling, * - * @(#) $Revision: 29.1 $ - * @(#) $Id: block.c,v 29.1 1999/12/14 09:15:29 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/block.c,v $ + * Landon Curt Noll + * http://reality.sgi.com/chongo/ * - * Under source code control: 1997/02/27 00:29:40 - * File existed as early as: 1997 - * - * chongo /\oo/\ http://reality.sgi.com/chongo/ - * Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ + * chongo /\../\ */ diff --git a/block.h b/block.h index 294c61b..b5dcc7f 100644 --- a/block.h +++ b/block.h @@ -1,33 +1,36 @@ /* * block - fixed, dynamic, fifo and circular memory blocks + */ +/* + * Copyright (c) 1997 by Landon Curt Noll. All Rights Reserved. * - * Copyright (C) 1999 Landon Curt Noll and Ernest Bowen + * Permission to use, copy, modify, and distribute this software and + * its documentation for any purpose and without fee is hereby granted, + * provided that the above copyright, this permission notice and text + * this comment, and the disclaimer below appear in all of the following: * - * Primary author: Landon Curt Noll + * supporting documentation + * source copies + * source works derived from this source + * binaries derived from this source or from derived source * - * Calc is open software; you can redistribute it and/or modify it under - * the terms of the version 2.1 of the GNU Lesser General Public License - * as published by the Free Software Foundation. + * LANDON CURT NOLL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO + * EVENT SHALL LANDON CURT NOLL BE LIABLE FOR ANY SPECIAL, INDIRECT OR + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF + * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR + * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. * - * Calc is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General - * Public License for more details. + * Comments, suggestions, bug fixes and questions about these routines + * are welcome. Send EMail to the address given below. * - * A copy of version 2.1 of the GNU Lesser General Public License is - * distributed with calc under the filename COPYING-LGPL. You should have - * received a copy with calc; if not, write to Free Software Foundation, Inc. - * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. + * Happy bit twiddling, * - * @(#) $Revision: 29.1 $ - * @(#) $Id: block.h,v 29.1 1999/12/14 09:15:30 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/block.h,v $ + * Landon Curt Noll + * http://reality.sgi.com/chongo/ * - * Under source code control: 1997/02/21 05:03:39 - * File existed as early as: 1997 - * - * chongo /\oo/\ http://reality.sgi.com/chongo/ - * Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ + * chongo /\../\ */ diff --git a/byteswap.c b/byteswap.c index d48b6d9..011ee30 100644 --- a/byteswap.c +++ b/byteswap.c @@ -1,34 +1,25 @@ /* - * byteswap - byte swapping routines + * Copyright (c) 1995 by Landon Curt Noll. All Rights Reserved. * - * Copyright (C) 1999 Landon Curt Noll + * Permission to use, copy, modify, and distribute this software and + * its documentation for any purpose and without fee is hereby granted, + * provided that the above copyright, this permission notice and text + * this comment, and the disclaimer below appear in all of the following: * - * Calc is open software; you can redistribute it and/or modify it under - * the terms of the version 2.1 of the GNU Lesser General Public License - * as published by the Free Software Foundation. + * supporting documentation + * source copies + * source works derived from this source + * binaries derived from this source or from derived source * - * Calc is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General - * Public License for more details. - * - * A copy of version 2.1 of the GNU Lesser General Public License is - * distributed with calc under the filename COPYING-LGPL. You should have - * received a copy with calc; if not, write to Free Software Foundation, Inc. - * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. - * - * @(#) $Revision: 29.1 $ - * @(#) $Id: byteswap.c,v 29.1 1999/12/14 09:15:30 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/byteswap.c,v $ - * - * Under source code control: 1995/10/11 04:44:01 - * File existed as early as: 1995 - * - * chongo /\oo/\ http://reality.sgi.com/chongo/ - * Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ + * LANDON CURT NOLL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO + * EVENT SHALL LANDON CURT NOLL BE LIABLE FOR ANY SPECIAL, INDIRECT OR + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF + * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR + * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. */ - #include "cmath.h" #include "byteswap.h" diff --git a/byteswap.h b/byteswap.h index 7b31163..dd52d79 100644 --- a/byteswap.h +++ b/byteswap.h @@ -1,31 +1,23 @@ /* - * byteswap - byte swapping macros + * Copyright (c) 1997 by Landon Curt Noll. All Rights Reserved. * - * Copyright (C) 1999 Landon Curt Noll + * Permission to use, copy, modify, and distribute this software and + * its documentation for any purpose and without fee is hereby granted, + * provided that the above copyright, this permission notice and text + * this comment, and the disclaimer below appear in all of the following: * - * Calc is open software; you can redistribute it and/or modify it under - * the terms of the version 2.1 of the GNU Lesser General Public License - * as published by the Free Software Foundation. + * supporting documentation + * source copies + * source works derived from this source + * binaries derived from this source or from derived source * - * Calc is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General - * Public License for more details. - * - * A copy of version 2.1 of the GNU Lesser General Public License is - * distributed with calc under the filename COPYING-LGPL. You should have - * received a copy with calc; if not, write to Free Software Foundation, Inc. - * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. - * - * @(#) $Revision: 29.1 $ - * @(#) $Id: byteswap.h,v 29.1 1999/12/14 09:15:30 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/byteswap.h,v $ - * - * Under source code control: 1995/10/11 04:44:01 - * File existed as early as: 1995 - * - * chongo /\oo/\ http://reality.sgi.com/chongo/ - * Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ + * LANDON CURT NOLL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO + * EVENT SHALL LANDON CURT NOLL BE LIABLE FOR ANY SPECIAL, INDIRECT OR + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF + * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR + * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. */ diff --git a/cal/beer.cal b/cal/beer.cal deleted file mode 100644 index 9384bf0..0000000 --- a/cal/beer.cal +++ /dev/null @@ -1,50 +0,0 @@ -/* - * beer - 99 bottles of beer - * - * Copyright (C) 1999 Landon Curt Noll - * - * Calc is open software; you can redistribute it and/or modify it under - * the terms of the version 2.1 of the GNU Lesser General Public License - * as published by the Free Software Foundation. - * - * Calc is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General - * Public License for more details. - * - * A copy of version 2.1 of the GNU Lesser General Public License is - * distributed with calc under the filename COPYING-LGPL. You should have - * received a copy with calc; if not, write to Free Software Foundation, Inc. - * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. - * - * @(#) $Revision: 29.1 $ - * @(#) $Id: beer.cal,v 29.1 1999/12/14 09:15:30 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/beer.cal,v $ - * - * Under source code control: 1996/11/13 13:21:05 - * File existed as early as: 1996 - * - * chongo /\oo/\ http://reality.sgi.com/chongo/ - * Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ - */ - -/* - * See: http://www.ionet.net/~timtroyr/funhouse/beer.html#calc - */ - - -for (i=99; i > 0;) { - /* current wall state */ - some_bottles = (i != 1) ? "bottles" : "bottle"; - print i, some_bottles, "of beer on the wall,",; - print i, some_bottles, "of beer!"; - - /* glug, glug */ - --i; - print "Take one down and pass it around,",; - - /* new wall state */ - less = (i > 0) ? i : "no"; - bottles = (i!=1) ? "bottles" : "bottle"; - print less, bottles, "of beer on the wall!\n"; -} diff --git a/cal/bigprime.cal b/cal/bigprime.cal deleted file mode 100644 index 3c3e6b7..0000000 --- a/cal/bigprime.cal +++ /dev/null @@ -1,49 +0,0 @@ -/* - * bigprime - a prime test, base a, on p*2^x+1 for even x>m - * - * Copyright (C) 1999 David I. Bell - * - * Calc is open software; you can redistribute it and/or modify it under - * the terms of the version 2.1 of the GNU Lesser General Public License - * as published by the Free Software Foundation. - * - * Calc is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General - * Public License for more details. - * - * A copy of version 2.1 of the GNU Lesser General Public License is - * distributed with calc under the filename COPYING-LGPL. You should have - * received a copy with calc; if not, write to Free Software Foundation, Inc. - * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. - * - * @(#) $Revision: 29.1 $ - * @(#) $Id: bigprime.cal,v 29.1 1999/12/14 09:15:30 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/bigprime.cal,v $ - * - * Under source code control: 1991/05/22 21:56:32 - * File existed as early as: 1991 - * - * Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ - */ - - -define bigprime(a, m, p) -{ - local n1, n; - - n1 = 2^m * p; - for (;;) { - m++; - n1 += n1; - n = n1 + 1; - if (isodd(m)) - continue; - print m; - if (pmod(a, n1 / 2, n) != n1) - continue; - if (pmod(a, n1 / p, n) == 1) - continue; - print " " : n; - } -} diff --git a/cal/bindings b/cal/bindings deleted file mode 100644 index 9aec111..0000000 --- a/cal/bindings +++ /dev/null @@ -1,75 +0,0 @@ -# bindings - default key bindings for calc line editing functions -# -# Copyright (C) 1999 David I. Bell -# -# Calc is open software; you can redistribute it and/or modify it under -# the terms of the version 2.1 of the GNU Lesser General Public License -# as published by the Free Software Foundation. -# -# Calc is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -# Public License for more details. -# -# A copy of version 2.1 of the GNU Lesser General Public License is -# distributed with calc under the filename COPYING-LGPL. You should have -# received a copy with calc; if not, write to Free Software Foundation, Inc. -# 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -# -# @(#) $Revision: 29.1 $ -# @(#) $Id: bindings,v 29.1 1999/12/14 09:15:30 chongo Exp $ -# @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/bindings,v $ -# -# Under source code control: 1993/05/02 20:09:19 -# File existed as early as: 1993 -# -# Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ - -# NOTE: This facility is ignored if calc was compiled with GNU-readline. -# In that case, the standard readline mechanisms (see readline(3)) -# are used in place of those found below. - - -map base-map -default insert-char -^@ set-mark -^A start-of-line -^B backward-char -^D delete-char -^E end-of-line -^F forward-char -^H backward-kill-char -^J new-line -^K kill-line -^L refresh-line -^M new-line -^N forward-history -^O save-line -^P backward-history -^R reverse-search -^T swap-chars -^U flush-input -^V quote-char -^W kill-region -^Y yank -^? backward-kill-char -^[ ignore-char esc-map - -map esc-map -default ignore-char base-map -G start-of-line -H backward-history -P forward-history -K backward-char -M forward-char -O end-of-line -S delete-char -g goto-line -s backward-word -t forward-word -d forward-kill-word -u uppercase-word -l lowercase-word -h list-history -^[ flush-input -[ arrow-key diff --git a/cal/hello.cal b/cal/hello.cal deleted file mode 100644 index 7f62891..0000000 --- a/cal/hello.cal +++ /dev/null @@ -1,36 +0,0 @@ -/* - * hello - print Hello World! forever - * - * Copyright (C) 1999 Landon Curt Noll - * - * Calc is open software; you can redistribute it and/or modify it under - * the terms of the version 2.1 of the GNU Lesser General Public License - * as published by the Free Software Foundation. - * - * Calc is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General - * Public License for more details. - * - * A copy of version 2.1 of the GNU Lesser General Public License is - * distributed with calc under the filename COPYING-LGPL. You should have - * received a copy with calc; if not, write to Free Software Foundation, Inc. - * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. - * - * @(#) $Revision: 29.1 $ - * @(#) $Id: hello.cal,v 29.1 1999/12/14 09:15:31 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/hello.cal,v $ - * - * Under source code control: 1996/11/13 13:25:43 - * File existed as early as: 1996 - * - * chongo /\oo/\ http://reality.sgi.com/chongo/ - * Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ - */ - -/* - * See: http://www.latech.edu/~acm/helloworld/calc.html - */ - - -while(1) print "Hello World!"; diff --git a/cal/mersenne.cal b/cal/mersenne.cal deleted file mode 100644 index 4a0199c..0000000 --- a/cal/mersenne.cal +++ /dev/null @@ -1,61 +0,0 @@ -/* - * mersenne - perform a primality test of 2^p-1, for prime p>1 - * - * Copyright (C) 1999 David I. Bell and Landon Curt Noll - * - * Primary author: David I. Bell - * - * Calc is open software; you can redistribute it and/or modify it under - * the terms of the version 2.1 of the GNU Lesser General Public License - * as published by the Free Software Foundation. - * - * Calc is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General - * Public License for more details. - * - * A copy of version 2.1 of the GNU Lesser General Public License is - * distributed with calc under the filename COPYING-LGPL. You should have - * received a copy with calc; if not, write to Free Software Foundation, Inc. - * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. - * - * @(#) $Revision: 29.1 $ - * @(#) $Id: mersenne.cal,v 29.1 1999/12/14 09:15:31 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/mersenne.cal,v $ - * - * Under source code control: 1991/05/22 21:56:36 - * File existed as early as: 1991 - * - * Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ - */ - -/* - * NOTE: See lucas.cal for a more general routine. - */ - - -define mersenne(p) -{ - local u, i, p_mask; - - /* firewall */ - if (! isint(p)) - quit "p is not an integer"; - - /* two is a special case */ - if (p == 2) - return 1; - - /* if p is not prime, then 2^p-1 is not prime */ - if (! ptest(p,1)) - return 0; - - /* lltest: u(i+1) = u(i)^2 - 2 mod 2^p-1 */ - u = 4; - for (i = 2; i < p; ++i) { - u = hnrmod(u^2 - 2, 1, p, -1); - } - - /* 2^p-1 is prime iff u(p) = 0 mod 2^p-1 */ - return (u == 0); -} diff --git a/cal/pell.cal b/cal/pell.cal deleted file mode 100644 index e3f0e63..0000000 --- a/cal/pell.cal +++ /dev/null @@ -1,94 +0,0 @@ -/* - * pell - solve Pell's equation - * - * Copyright (C) 1999 David I. Bell - * - * Calc is open software; you can redistribute it and/or modify it under - * the terms of the version 2.1 of the GNU Lesser General Public License - * as published by the Free Software Foundation. - * - * Calc is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General - * Public License for more details. - * - * A copy of version 2.1 of the GNU Lesser General Public License is - * distributed with calc under the filename COPYING-LGPL. You should have - * received a copy with calc; if not, write to Free Software Foundation, Inc. - * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. - * - * @(#) $Revision: 29.1 $ - * @(#) $Id: pell.cal,v 29.1 1999/12/14 09:15:31 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/pell.cal,v $ - * - * Under source code control: 1990/02/15 01:50:34 - * File existed as early as: before 1990 - * - * Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ - */ - -/* - * Solve Pell's equation; Returns the solution X to: X^2 - D * Y^2 = 1. - * Type the solution to pells equation for a particular D. - */ - - -define pell(D) -{ - local X, Y; - - X = pellx(D); - if (isnull(X)) { - print "D=":D:" is square"; - return; - } - Y = isqrt((X^2 - 1) / D); - print X : "^2 - " : D : "*" : Y : "^2 = " : X^2 - D*Y^2; -} - - -/* - * Function to solve Pell's equation - * Returns the solution X to: - * X^2 - D * Y^2 = 1 - */ -define pellx(D) -{ - local R, Rp, U, Up, V, Vp, A, T, Q1, Q2, n; - local mat ans[2,2]; - local mat tmp[2,2]; - - R = isqrt(D); - Vp = D - R^2; - if (Vp == 0) - return; - Rp = R + R; - U = Rp; - Up = U; - V = 1; - A = 0; - n = 0; - ans[0,0] = 1; - ans[1,1] = 1; - tmp[0,1] = 1; - tmp[1,0] = 1; - do { - T = V; - V = A * (Up - U) + Vp; - Vp = T; - A = U // V; - Up = U; - U = Rp - U % V; - tmp[0,0] = A; - ans *= tmp; - n++; - } while (A != Rp); - Q2 = ans[[1]]; - Q1 = isqrt(Q2^2 * D + 1); - if (isodd(n)) { - T = Q1^2 + D * Q2^2; - Q2 = Q1 * Q2 * 2; - Q1 = T; - } - return Q1; -} diff --git a/cal/pix.cal b/cal/pix.cal deleted file mode 100644 index da9da9e..0000000 --- a/cal/pix.cal +++ /dev/null @@ -1,71 +0,0 @@ -/* - * pix - iterative method of finding the number of primes less than x - * - * Copyright (C) 1999 Landon Curt Noll - * - * Calc is open software; you can redistribute it and/or modify it under - * the terms of the version 2.1 of the GNU Lesser General Public License - * as published by the Free Software Foundation. - * - * Calc is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General - * Public License for more details. - * - * A copy of version 2.1 of the GNU Lesser General Public License is - * distributed with calc under the filename COPYING-LGPL. You should have - * received a copy with calc; if not, write to Free Software Foundation, Inc. - * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. - * - * @(#) $Revision: 29.1 $ - * @(#) $Id: pix.cal,v 29.1 1999/12/14 09:15:31 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/pix.cal,v $ - * - * Under source code control: 1996/07/09 03:14:14 - * File existed as early as: 1996 - * - * chongo /\oo/\ http://reality.sgi.com/chongo/ - * Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ - */ - -/* - * Here is an iterative method of finding the number of primes less than - * or equal to a given number. This method is from "Computer Recreations" - * June 1996 issue of Scientific American. - * - * NOTE: For reasonable values of x, the builtin function pix(x) is - * much faster. This code is provided because the method - * is interesting. - */ - - -define pi_of_x(x) -{ - local An; /* A(n) */ - local An1; /* A(n-1) */ - local An2; /* A(n-2) */ - local An3; /* A(n-3) */ - local primes; /* number of primes found */ - local n; /* loop counter */ - - /* - * setup - */ - An1 = 2; - An2 = 0; - An3 = 3; - primes = 1; - - /* - * main A(n+1)=A(n-1)+A(n-2) sequence loop - */ - for (n = 3; n < x; ++n) { - An = An2 + An3; - An3 = An2; - An2 = An1; - An1 = An; - if (An % n == 0) - ++primes; - } - return primes; -} diff --git a/cal/pollard.cal b/cal/pollard.cal deleted file mode 100644 index c808bf2..0000000 --- a/cal/pollard.cal +++ /dev/null @@ -1,52 +0,0 @@ -/* - * pollard - factor using Pollard's p-1 method - * - * Copyright (C) 1999 David I. Bell - * - * Calc is open software; you can redistribute it and/or modify it under - * the terms of the version 2.1 of the GNU Lesser General Public License - * as published by the Free Software Foundation. - * - * Calc is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General - * Public License for more details. - * - * A copy of version 2.1 of the GNU Lesser General Public License is - * distributed with calc under the filename COPYING-LGPL. You should have - * received a copy with calc; if not, write to Free Software Foundation, Inc. - * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. - * - * @(#) $Revision: 29.1 $ - * @(#) $Id: pollard.cal,v 29.1 1999/12/14 09:15:31 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/pollard.cal,v $ - * - * Under source code control: 1991/05/22 21:56:37 - * File existed as early as: 1991 - * - * Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ - */ - - -define pfactor(N, B, ai, af) -{ - local a, k, i, d; - - if (isnull(B)) - B = 1000; - if (isnull(ai)) - ai = 2; - if (isnull(af)) - af = ai + 20; - k = lcmfact(B); - d = lfactor(N, B); - if (d > 1) - return d; - for (a = ai; a <= af; a++) { - i = pmod(a, k, N); - d = gcd(i - 1, N); - if ((d > 1) && (d != N)) - return d; - } - return 1; -} diff --git a/cal/psqrt.cal b/cal/psqrt.cal deleted file mode 100644 index 640f66d..0000000 --- a/cal/psqrt.cal +++ /dev/null @@ -1,74 +0,0 @@ -/* - * psqrt - calculate square roots modulo a prime - * - * Copyright (C) 1999 David I. Bell - * - * Calc is open software; you can redistribute it and/or modify it under - * the terms of the version 2.1 of the GNU Lesser General Public License - * as published by the Free Software Foundation. - * - * Calc is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General - * Public License for more details. - * - * A copy of version 2.1 of the GNU Lesser General Public License is - * distributed with calc under the filename COPYING-LGPL. You should have - * received a copy with calc; if not, write to Free Software Foundation, Inc. - * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. - * - * @(#) $Revision: 29.1 $ - * @(#) $Id: psqrt.cal,v 29.1 1999/12/14 09:15:32 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/psqrt.cal,v $ - * - * Under source code control: 1990/02/15 01:50:35 - * File existed as early as: before 1990 - * - * Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ - */ - -/* - * Returns null if number is not prime or if there is no square root. - * The smaller square root is always returned. - */ - - -define psqrt(u, p) -{ - local p1, q, n, y, r, v, w, t, k; - - p1 = p - 1; - r = lowbit(p1); - q = p >> r; - t = 1 << (r - 1); - for (n = 2; ; n++) { - if (ptest(n, 1) == 0) - continue; - y = pmod(n, q, p); - k = pmod(y, t, p); - if (k == 1) - continue; - if (k != p1) - return; - break; - } - t = pmod(u, (q - 1) / 2, p); - v = (t * u) % p; - w = (t^2 * u) % p; - while (w != 1) { - k = 0; - t = w; - do { - k++; - t = t^2 % p; - } while (t != 1); - if (k == r) - return; - t = pmod(y, 1 << (r - k - 1), p); - y = t^2 % p; - v = (v * t) % p; - w = (w * y) % p; - r = k; - } - return min(v, p - v); -} diff --git a/cal/qtime.cal b/cal/qtime.cal deleted file mode 100644 index 45e0fe0..0000000 --- a/cal/qtime.cal +++ /dev/null @@ -1,68 +0,0 @@ -/* - * qtime - Display time as English sentence - * - * usage: - * qtime(utc_hr_offset) - * - * utc_hr_offset Offset from UTC in hours. - * - * Written by: Klaus Alexander Seistrup - * With minor mods by: Landon Curt Noll - * - * See: - * http://www.magnetic-ink.dk/download/qtime.html - * - * for examples of qtime() written on other languages. - * - * @(#) $Revision: 29.1 $ - * @(#) $Id: qtime.cal,v 29.1 1999/12/14 09:15:32 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/qtime.cal,v $ - * - * This file is not covered under version 2.1 of the GNU LGPL. - */ - - -/* - * qtime - Display time as English sentence - */ -define qtime(utc_hr_offset) -{ - static mat hr[12] = { - "twelve", "one", "two", "three", "four", "five", - "six", "seven", "eight", "nine", "ten", "eleven" - }; - static mat mn[7] = { - "", "five ", "ten ", "a quarter ", "twenty ", "twenty-five ", "half " - }; - static mat ny[5] = { - "nearly ", "almost ", "", "just after ", "after " - }; - static mat up[3] = { - "to ", "", "past " - }; - local adj_mins = (((time() + utc_hr_offset*3600) % 86400) + 30)//60+27; - local hours = (adj_mins // 60) % 12; - local minutes = adj_mins % 60; - local almost = minutes % 5; - local divisions = (minutes // 5) - 5; - local to_past_idx = divisions > 0 ? 1 : 0; - - if (divisions < 0) { - divisions = -divisions; - to_past_idx = -1; - } - ++to_past_idx; - - /* - * Print the English sentence - * - * We avoid forward and back quotes just to show that the char() - * builtin function can be used in conjunction with a printf. - */ - printf("It%cs %s%s%s%s", - char(0x27), ny[almost], mn[divisions], - up[to_past_idx], hr[hours]); - if (divisions == 0) - printf(" o%cclock", char(0x27)); - print "."; -} diff --git a/cal/solve.cal b/cal/solve.cal deleted file mode 100644 index 0da71bd..0000000 --- a/cal/solve.cal +++ /dev/null @@ -1,69 +0,0 @@ -/* - * solve - solve f(x) = 0 to within the desired error value for x - * - * Copyright (C) 1999 David I. Bell - * - * Calc is open software; you can redistribute it and/or modify it under - * the terms of the version 2.1 of the GNU Lesser General Public License - * as published by the Free Software Foundation. - * - * Calc is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General - * Public License for more details. - * - * A copy of version 2.1 of the GNU Lesser General Public License is - * distributed with calc under the filename COPYING-LGPL. You should have - * received a copy with calc; if not, write to Free Software Foundation, Inc. - * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. - * - * @(#) $Revision: 29.1 $ - * @(#) $Id: solve.cal,v 29.1 1999/12/14 09:15:33 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/solve.cal,v $ - * - * Under source code control: 1990/02/15 01:50:37 - * File existed as early as: before 1990 - * - * Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ - */ - -/* - * Solve the equation f(x) = 0 to within the desired error value for x. - * The function 'f' must be defined outside of this routine, and the low - * and high values are guesses which must produce values with opposite signs. - */ - - -define solve(low, high, epsilon) -{ - local flow, fhigh, fmid, mid, places; - - if (isnull(epsilon)) - epsilon = epsilon(); - if (epsilon <= 0) - quit "Non-positive epsilon value"; - places = highbit(1 + int(1/epsilon)) + 1; - flow = f(low); - if (abs(flow) < epsilon) - return low; - fhigh = f(high); - if (abs(flow) < epsilon) - return high; - if (sgn(flow) == sgn(fhigh)) - quit "Non-opposite signs"; - while (1) { - mid = bround(high - fhigh * (high - low) / (fhigh - flow), places); - if ((mid == low) || (mid == high)) - places++; - fmid = f(mid); - if (abs(fmid) < epsilon) - return mid; - if (sgn(fmid) == sgn(flow)) { - low = mid; - flow = fmid; - } else { - high = mid; - fhigh = fmid; - } - } -} diff --git a/cal/sumsq.cal b/cal/sumsq.cal deleted file mode 100644 index 5a67ce3..0000000 --- a/cal/sumsq.cal +++ /dev/null @@ -1,65 +0,0 @@ -/* - * sumsq - find unique two positive integers whose squares sum to a given prime - * - * Copyright (C) 1999 David I. Bell - * - * Calc is open software; you can redistribute it and/or modify it under - * the terms of the version 2.1 of the GNU Lesser General Public License - * as published by the Free Software Foundation. - * - * Calc is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General - * Public License for more details. - * - * A copy of version 2.1 of the GNU Lesser General Public License is - * distributed with calc under the filename COPYING-LGPL. You should have - * received a copy with calc; if not, write to Free Software Foundation, Inc. - * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. - * - * @(#) $Revision: 29.1 $ - * @(#) $Id: sumsq.cal,v 29.1 1999/12/14 09:15:33 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/sumsq.cal,v $ - * - * Under source code control: 1990/02/15 01:50:37 - * File existed as early as: before 1990 - * - * Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ - */ - -/* - * Determine the unique two positive integers whose squares sum to the - * specified prime. This is always possible for all primes of the form - * 4N+1, and always impossible for primes of the form 4N-1. - */ - - -define ss(p) -{ - local a, b, i, p4; - - if (p == 2) { - print "1^2 + 1^2 = 2"; - return; - } - if ((p % 4) != 1) { - print p, "is not of the form 4N+1"; - return; - } - if (!ptest(p, min(p-2, 10))) { - print p, "is not a prime"; - return; - } - p4 = (p - 1) / 4; - i = 2; - do { - a = pmod(i++, p4, p); - } while ((a^2 % p) == 1); - b = p; - while (b^2 > p) { - i = b % a; - b = a; - a = i; - } - print a : "^2 +" , b : "^2 =" , a^2 + b^2; -} diff --git a/cal/test1700.cal b/cal/test1700.cal deleted file mode 100644 index 954b240..0000000 --- a/cal/test1700.cal +++ /dev/null @@ -1,32 +0,0 @@ -/* - * test1700 - 1700 series of the regress.cal test suite - * - * Copyright (C) 1999 Landon Curt Noll - * - * Calc is open software; you can redistribute it and/or modify it under - * the terms of the version 2.1 of the GNU Lesser General Public License - * as published by the Free Software Foundation. - * - * Calc is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General - * Public License for more details. - * - * A copy of version 2.1 of the GNU Lesser General Public License is - * distributed with calc under the filename COPYING-LGPL. You should have - * received a copy with calc; if not, write to Free Software Foundation, Inc. - * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. - * - * @(#) $Revision: 29.1 $ - * @(#) $Id: test1700.cal,v 29.1 1999/12/14 09:15:33 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/test1700.cal,v $ - * - * Under source code control: 1994/03/14 23:12:51 - * File existed as early as: 1994 - * - * chongo /\oo/\ http://reality.sgi.com/chongo/ - * Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ - */ - - -++value; diff --git a/cal/test3100.cal b/cal/test3100.cal deleted file mode 100644 index 4827641..0000000 --- a/cal/test3100.cal +++ /dev/null @@ -1,40 +0,0 @@ -/* - * test3100 - 3100 series of the regress.cal test suite - * - * Copyright (C) 1999 Ernest Bowen and Landon Curt Noll - * - * Primary author: Ernest Bowen - * - * Calc is open software; you can redistribute it and/or modify it under - * the terms of the version 2.1 of the GNU Lesser General Public License - * as published by the Free Software Foundation. - * - * Calc is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General - * Public License for more details. - * - * A copy of version 2.1 of the GNU Lesser General Public License is - * distributed with calc under the filename COPYING-LGPL. You should have - * received a copy with calc; if not, write to Free Software Foundation, Inc. - * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. - * - * @(#) $Revision: 29.1 $ - * @(#) $Id: test3100.cal,v 29.1 1999/12/14 09:15:33 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/test3100.cal,v $ - * - * Under source code control: 1995/11/28 11:56:57 - * File existed as early as: 1995 - * - * Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ - */ - - -obj res {r}; -global md; -define res_test(a) = !ismult(a.r, md); -define res_sub(a,b) {local obj res v = {(a.r - b.r) % md}; return v;}; -define res_mul(a,b) {local obj res v = {(a.r * b.r) % md}; return v;}; -define res_neg(a) {local obj res v = {(-a.r) % md}; return v;}; -define res_inv(a) {local obj res v = {minv(a.r, md)}; return v;}; -define res(x) {local obj res v = {x % md}; return v;}; diff --git a/cal/test5100.cal b/cal/test5100.cal deleted file mode 100644 index a05f6e6..0000000 --- a/cal/test5100.cal +++ /dev/null @@ -1,71 +0,0 @@ -/* - * test5100 - 5100 series of the regress.cal test suite - * - * Copyright (C) 1999 Ernest Bowen and Landon Curt Noll - * - * Primary author: Ernest Bowen - * - * Calc is open software; you can redistribute it and/or modify it under - * the terms of the version 2.1 of the GNU Lesser General Public License - * as published by the Free Software Foundation. - * - * Calc is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General - * Public License for more details. - * - * A copy of version 2.1 of the GNU Lesser General Public License is - * distributed with calc under the filename COPYING-LGPL. You should have - * received a copy with calc; if not, write to Free Software Foundation, Inc. - * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. - * - * @(#) $Revision: 29.1 $ - * @(#) $Id: test5100.cal,v 29.1 1999/12/14 09:15:34 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/test5100.cal,v $ - * - * Under source code control: 1996/12/02 23:57:10 - * File existed as early as: 1996 - * - * Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ - */ - - -global defaultverbose = 1; /* default verbose value */ -global err; - -/* - * We test the new code generator declaration scope and order. - * - * In this function two static variables a5100 and b5100 are created, - * with zero value, when the definition is read. - * - * The variable a5100 is initialized with the value x if and when this - * function is first called with a positive even x. The varable b5100 - * is similarly initialized if and when this function is first called positive - * odd x. - * - * Each time this function is called with positive integer x, a5100 or - * b5100 is incremented. - * - * Finally the values of the static variables are assigned to the global - * variables a5100 and b5100. - * - * Immediately after the last of several calls to this function - * a5100 = 0 if none of the x's have been positive even, otherwise - * a5100 = the first positive even x + the number of positive even x's, - * and b5100 = 0 if none of the x's have been positive odd, otherwise - * b5100 = the first positive odd x + the number of positive odd x's. - */ -define test5100(x) -{ - if (isint(x) && x > 0) { - if (iseven(x)) { - static a5100 = x; - a5100++; - } else { - static b5100 = x; - b5100++; - } - } - global a5100 = a5100, b5100 = b5100; -} diff --git a/cal/test5200.cal b/cal/test5200.cal deleted file mode 100644 index 281f2d3..0000000 --- a/cal/test5200.cal +++ /dev/null @@ -1,53 +0,0 @@ -/* - * test5200 - 5200 series of the regress.cal test suite - * - * Copyright (C) 1999 Ernest Bowen and Landon Curt Noll - * - * Primary author: Ernest Bowen - * - * Calc is open software; you can redistribute it and/or modify it under - * the terms of the version 2.1 of the GNU Lesser General Public License - * as published by the Free Software Foundation. - * - * Calc is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General - * Public License for more details. - * - * A copy of version 2.1 of the GNU Lesser General Public License is - * distributed with calc under the filename COPYING-LGPL. You should have - * received a copy with calc; if not, write to Free Software Foundation, Inc. - * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. - * - * @(#) $Revision: 29.1 $ - * @(#) $Id: test5200.cal,v 29.1 1999/12/14 09:15:34 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/test5200.cal,v $ - * - * Under source code control: 1997/02/07 02:48:10 - * File existed as early as: 1997 - * - * Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ - */ - - -global defaultverbose = 1; /* default verbose value */ -global err; - -/* - * test the fix of a global/static bug - * - * Given the following: - * - * global a = 10; - * static a = 20; - * define f(x) = a + x; - * define g(x) {global a = 30; return a + x;} - * define h(x) = a + x; - * - * Older versions of - */ -global a5200 = 10; -static a5200 = 20; -define f5200(x) = a5200 + x; -define g5200(x) {global a5200 = 30; return a5200 + x;} -define h5200(x) = a5200 + x; diff --git a/cal/test8400.cal b/cal/test8400.cal deleted file mode 100644 index 5a73141..0000000 --- a/cal/test8400.cal +++ /dev/null @@ -1,48 +0,0 @@ -/* - * test8400 - 8400 series of the regress.cal test suite - * - * Copyright (C) 1999 Landon Curt Noll - * - * Calc is open software; you can redistribute it and/or modify it under - * the terms of the version 2.1 of the GNU Lesser General Public License - * as published by the Free Software Foundation. - * - * Calc is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General - * Public License for more details. - * - * A copy of version 2.1 of the GNU Lesser General Public License is - * distributed with calc under the filename COPYING-LGPL. You should have - * received a copy with calc; if not, write to Free Software Foundation, Inc. - * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. - * - * @(#) $Revision: 29.1 $ - * @(#) $Id: test8400.cal,v 29.1 1999/12/14 09:15:34 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/test8400.cal,v $ - * - * Under source code control: 1999/10/31 01:00:03 - * File existed as early as: 1999 - * - * chongo /\oo/\ http://reality.sgi.com/chongo/ - * Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ - */ - - -print "8401: in test8400.cal"; - -/* - * test8400 - dummy function to allow a check of quit-based memory leaks - */ -define test8400() -{ - local x8401 = 19937; /* watch for lost memory */ - static s8401 = 44497; /* watch for lost memory */ - - return x8401+s8401; -} -print "8402: parsed test8400()"; -vrfy(test8400() == 64434, '8403: test8400() == 64434'); - -quit; -prob('quit did not end test8400.cal'); diff --git a/cal/unitfrac.cal b/cal/unitfrac.cal deleted file mode 100644 index 8613b2c..0000000 --- a/cal/unitfrac.cal +++ /dev/null @@ -1,55 +0,0 @@ -/* - * unixfrac - represent a fraction as a sum of distince unit fractions - * - * Copyright (C) 1999 David I. Bell - * - * Calc is open software; you can redistribute it and/or modify it under - * the terms of the version 2.1 of the GNU Lesser General Public License - * as published by the Free Software Foundation. - * - * Calc is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General - * Public License for more details. - * - * A copy of version 2.1 of the GNU Lesser General Public License is - * distributed with calc under the filename COPYING-LGPL. You should have - * received a copy with calc; if not, write to Free Software Foundation, Inc. - * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. - * - * @(#) $Revision: 29.1 $ - * @(#) $Id: unitfrac.cal,v 29.1 1999/12/14 09:15:34 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/unitfrac.cal,v $ - * - * Under source code control: 1990/02/15 01:50:38 - * File existed as early as: before 1990 - * - * Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ - */ - -/* - * Represent a fraction as sum of distinct unit fractions. - * The output is the unit fractions themselves, and in square brackets, - * the number of digits in the numerator and denominator of the value left - * to be found. Numbers larger than 3.5 become very difficult to calculate. - */ - - -define unitfrac(x) -{ - local d, di, n; - - if (x <= 0) - quit "Non-positive argument"; - d = 2; - do { - n = int(1 / x) + 1; - if (n > d) - d = n; - di = 1/d; - print ' [': digits(num(x)): '/': digits(den(x)): ']',, di; - x -= di; - d++; - } while ((num(x) > 1) || (x == di) || (x == 1)); - print ' [1/1]',, x; -} diff --git a/cal/varargs.cal b/cal/varargs.cal deleted file mode 100644 index 52f8cc2..0000000 --- a/cal/varargs.cal +++ /dev/null @@ -1,54 +0,0 @@ -/* - * varargs - example of a varargs-like use - * - * Copyright (C) 1999 David I. Bell - * - * Calc is open software; you can redistribute it and/or modify it under - * the terms of the version 2.1 of the GNU Lesser General Public License - * as published by the Free Software Foundation. - * - * Calc is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General - * Public License for more details. - * - * A copy of version 2.1 of the GNU Lesser General Public License is - * distributed with calc under the filename COPYING-LGPL. You should have - * received a copy with calc; if not, write to Free Software Foundation, Inc. - * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. - * - * @(#) $Revision: 29.1 $ - * @(#) $Id: varargs.cal,v 29.1 1999/12/14 09:15:34 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/varargs.cal,v $ - * - * Under source code control: 1991/05/22 21:56:34 - * File existed as early as: 1991 - * - * Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ - */ - -/* - * Example program to use 'varargs'. - * - * Program to sum the cubes of all the specified numbers. - */ - - -define sc() -{ - local s, i; - - s = 0; - for (i = 1; i <= param(0); i++) { - if (!isnum(param(i))) { - print "parameter",i,"is not a number"; - continue; - } - s += param(i)^3; - } - return s; -} - -if (config("resource_debug") & 3) { - print "sc(a, b, ...) defined"; -} diff --git a/calc.c b/calc.c index 982d00b..7c9a04b 100644 --- a/calc.c +++ b/calc.c @@ -1,35 +1,11 @@ /* - * calc - arbitrary precision calculator + * Copyright (c) 1997 David I. Bell + * Permission is granted to use, distribute, or modify this source, + * provided that this copyright notice remains intact. * - * Copyright (C) 1999 David I. Bell, Landon Curt Noll and Ernest Bowen - * - * Primary author: David I. Bell - * - * Calc is open software; you can redistribute it and/or modify it under - * the terms of the version 2.1 of the GNU Lesser General Public License - * as published by the Free Software Foundation. - * - * Calc is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General - * Public License for more details. - * - * A copy of version 2.1 of the GNU Lesser General Public License is - * distributed with calc under the filename COPYING-LGPL. You should have - * received a copy with calc; if not, write to Free Software Foundation, Inc. - * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. - * - * @(#) $Revision: 29.1 $ - * @(#) $Id: calc.c,v 29.1 1999/12/14 09:15:34 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/calc.c,v $ - * - * Under source code control: 1990/02/15 01:48:11 - * File existed as early as: before 1990 - * - * Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ + * Arbitrary precision calculator. */ - #include #include #include @@ -70,7 +46,7 @@ * static definitions and functions */ static void intint(int arg); /* interrupt routine */ -static int script_args(int argc,char ***argv,char **shellfile,char **program); +static void script_args(int *argc, char ***argv, char **shellfile); /* @@ -81,7 +57,7 @@ main(int argc, char **argv) { int want_defhelp = 0; /* 1=> we only want the default help */ int cmdlen; /* length of the command string */ - char *shellfile = NULL; /* != NULL ==> name of calc shell script */ + char *shellfile = NULL; /* =!NULL ==> name of calc shell script */ extern char *optarg; /* option argument */ extern int optind; /* option index */ int c; /* option */ @@ -92,12 +68,10 @@ main(int argc, char **argv) * parse args */ program = argv[0]; - /* catch the case of a leading -S option */ - if (argc > 2 && strncmp(argv[1], "-S", 2) == 0) { + /* catch the case of a leading -s option */ + if (argc > 2 && strncmp(argv[1], "-s", 2) == 0) { /* convert the calc shell options into command line options */ - argc = script_args(argc, &argv, &shellfile, &program); - /* -S implies -s */ - s_flag = TRUE; + script_args(&argc, &argv, &shellfile); } /* process command line options */ while ((c = getopt(argc, argv, "Cehim:npquvcdD:s")) != -1) { @@ -170,15 +144,15 @@ main(int argc, char **argv) * parse the -D optarg * * Could be calc_debug - * or calc_debug:resource_debug - * or calc_debug:resource_debug:user_debug + * or calc_debug:lib_debug + * or calc_debug:lib_debug:user_debug */ calc_debug = optarg; p = strchr(optarg, ':'); if (p != NULL) { *p = '\0'; - resource_debug = p+1; - p = strchr(resource_debug, ':'); + lib_debug = p+1; + p = strchr(lib_debug, ':'); if (p != NULL) { *p = '\0'; user_debug = p+1; @@ -186,10 +160,14 @@ main(int argc, char **argv) } break; case 's': - s_flag = TRUE; - break; - case 'S': - /*FALLTHRU*/ + /* + * we are too early in processing to call + * libcalc_call_me_last() - nothing to cleanup + */ + fprintf(stderr, + "%s: -s may only be used in a calc shell script\n", + program); + exit(1); default: /* * we are too early in processing to call @@ -197,69 +175,47 @@ main(int argc, char **argv) */ fprintf(stderr, "usage: %s [-c] [-C] [-d] [-e] [-h] [-i] [-m mode]\n" - "\t[-D calc_debug[:resource_debug:[user_debug]]]\n" - "\t[-n] [-p] [-q] [-s] [-u] [-v] " - "[[--] calc_cmd ...]\n", + "\t[-D calc_debug[:lib_debug:[user_debug]]]\n" + "\t[-n] [-p] [-q] [-u] [-v] [[--] calc_cmd ...]\n", program); exit(1); } } - - /* - * If -S was given via a calc shell script, imply -p and -d - * unless -i was also given. - */ - if (shellfile != NULL && !i_flag) { - p_flag = TRUE; - d_flag = TRUE; - } + havecommands = (optind < argc); /* * look at the length of any trailing command args * * We make room for the trailing '\0\n' as well as an extra guard byte. - * - * However, if -S is in effect, we will pretend that we have no - * command args and allow the argv() builtin access to the strings. + */ + for (cmdlen=0, i=optind; i < argc; ++i) { + /* argument + space separator */ + cmdlen += strlen(argv[i]) + 1; + } + if (i > MAXCMD) { + /* + * we are too early in processing to call + * libcalc_call_me_last() - nothing to cleanup + */ + fprintf(stderr, + "%s: command in arg list is too long\n", program); + exit(1); + } + + /* + * We will form a command the remaining args separated by spaces. */ cmdbuf[0] = '\0'; - if (s_flag) { - havecommands = FALSE; - argc_value = argc - optind; - argv_value = argv + optind; - } else { - havecommands = (optind < argc); - for (cmdlen=0, i=optind; i < argc; ++i) { - /* argument + space separator */ - cmdlen += strlen(argv[i]) + 1; + if (optind < argc) { + strcpy(cmdbuf, argv[optind]); + cmdlen = strlen(argv[optind]); + for (i=optind+1; i < argc; ++i) { + cmdbuf[cmdlen++] = ' '; + strcpy(cmdbuf+cmdlen, argv[i]); + cmdlen += strlen(argv[i]); } - if (i > MAXCMD) { - /* - * we are too early in processing to call - * libcalc_call_me_last() - nothing to cleanup - */ - fprintf(stderr, - "%s: command in arg list is too long\n", - program); - exit(1); - } - - /* - * Form a command the remaining args separated by spaces. - */ - if (optind < argc) { - strcpy(cmdbuf, argv[optind]); - cmdlen = strlen(argv[optind]); - for (i=optind+1; i < argc; ++i) { - cmdbuf[cmdlen++] = ' '; - strcpy(cmdbuf+cmdlen, argv[i]); - cmdlen += strlen(argv[i]); - } - cmdbuf[cmdlen++] = '\n'; - cmdbuf[cmdlen] = '\0'; - } - argc_value = 0; - argv_value = argv+argc; + cmdbuf[cmdlen++] = '\n'; + cmdbuf[cmdlen] = '\0'; } /* @@ -276,7 +232,7 @@ main(int argc, char **argv) libcalc_call_me_first(); stdin_tty = isatty(0); /* assume stdin is on fd 0 */ if (conf->calc_debug & CALCDBG_TTY) - printf("main: stdin_tty is %d\n", stdin_tty); + printf("DEBUG: stdin_tty is %d\n", stdin_tty); if (want_defhelp) { givehelp(DEFAULTCALCHELP); libcalc_call_me_last(); @@ -289,8 +245,6 @@ main(int argc, char **argv) if (!havecommands && stdin_tty) { if (!d_flag) { printf("%s (version %s)\n", CALC_TITLE, version()); - printf("Calc is open software. For license details " - "type: help copyright\n"); printf("[%s]\n\n", "Type \"exit\" to exit, or \"help\" for help."); } @@ -334,14 +288,14 @@ main(int argc, char **argv) if (run_state == RUN_BEGIN) { if (!q_flag && allow_read) { if (conf->calc_debug & CALCDBG_RUNSTATE) - printf("main: run_state from %s to %s\n", + printf("DEBUG: run_state from %s to %s\n", run_state_name(run_state), run_state_name(RUN_RCFILES)); run_state = RUN_RCFILES; runrcfiles(); } if (conf->calc_debug & CALCDBG_RUNSTATE) - printf("main: run_state from %s to %s\n", + printf("DEBUG: run_state from %s to %s\n", run_state_name(run_state), run_state_name(RUN_PRE_CMD_ARGS)); run_state = RUN_PRE_CMD_ARGS; @@ -355,7 +309,7 @@ main(int argc, char **argv) closeinput(); runrcfiles(); if (conf->calc_debug & CALCDBG_RUNSTATE) - printf("main: run_state from %s to %s\n", + printf("DEBUG: run_state from %s to %s\n", run_state_name(run_state), run_state_name(RUN_PRE_CMD_ARGS)); run_state = RUN_PRE_CMD_ARGS; @@ -365,13 +319,13 @@ main(int argc, char **argv) } else { if ((havecommands && !i_flag) || !stdin_tty) { if (conf->calc_debug & CALCDBG_RUNSTATE) - printf("main: run_state from %s to %s\n", + printf("DEBUG: run_state from %s to %s\n", run_state_name(run_state), run_state_name(RUN_EXIT_WITH_ERROR)); run_state = RUN_EXIT_WITH_ERROR; } else { if (conf->calc_debug & CALCDBG_RUNSTATE) - printf("main: run_state from %s to %s\n", + printf("DEBUG: run_state from %s to %s\n", run_state_name(run_state), run_state_name(RUN_PRE_CMD_ARGS)); run_state = RUN_PRE_CMD_ARGS; @@ -379,27 +333,21 @@ main(int argc, char **argv) } } + /* XXX - if shellfile != NULL process shellfile here */ + if (run_state == RUN_PRE_CMD_ARGS) { if (havecommands) { if (conf->calc_debug & CALCDBG_RUNSTATE) - printf("main: run_state from %s to %s\n", + printf("DEBUG: run_state from %s to %s\n", run_state_name(run_state), run_state_name(RUN_CMD_ARGS)); run_state = RUN_CMD_ARGS; (void) openstring(cmdbuf, (long) strlen(cmdbuf)); getcommands(FALSE); closeinput(); - } else if (shellfile != NULL) { - /* XXX - shellfile stuff needs it own run_state name */ - if (conf->calc_debug & CALCDBG_RUNSTATE) - printf("main: run_state from %s to %s\n", - run_state_name(run_state), - run_state_name(RUN_CMD_ARGS)); - run_state = RUN_CMD_ARGS; - getshellfile(shellfile); } if (conf->calc_debug & CALCDBG_RUNSTATE) - printf("main: run_state from %s to %s\n", + printf("DEBUG: run_state from %s to %s\n", run_state_name(run_state), run_state_name(RUN_PRE_TOP_LEVEL)); run_state = RUN_PRE_TOP_LEVEL; @@ -411,7 +359,7 @@ main(int argc, char **argv) getcommands(FALSE); if (inputlevel() == 0) if (conf->calc_debug & CALCDBG_RUNSTATE) - printf("main: run_state from %s to %s\n", + printf("DEBUG: run_state from %s to %s\n", run_state_name(run_state), run_state_name(RUN_PRE_TOP_LEVEL)); run_state = RUN_PRE_TOP_LEVEL; @@ -420,13 +368,13 @@ main(int argc, char **argv) closeinput(); if (!stdin_tty || !i_flag || p_flag) { if (conf->calc_debug & CALCDBG_RUNSTATE) - printf("main: run_state from %s to %s\n", + printf("DEBUG: run_state from %s to %s\n", run_state_name(run_state), run_state_name(RUN_EXIT_WITH_ERROR)); run_state = RUN_EXIT_WITH_ERROR; } else { if (conf->calc_debug & CALCDBG_RUNSTATE) - printf("main: run_state from %s to %s\n", + printf("DEBUG: run_state from %s to %s\n", run_state_name(run_state), run_state_name(RUN_PRE_TOP_LEVEL)); run_state = RUN_PRE_TOP_LEVEL; @@ -435,10 +383,9 @@ main(int argc, char **argv) } if (run_state == RUN_PRE_TOP_LEVEL) { - if (stdin_tty && - (((havecommands || shellfile) && !i_flag) || p_flag)) { + if (stdin_tty && ((havecommands && !i_flag) || p_flag)) { if (conf->calc_debug & CALCDBG_RUNSTATE) - printf("main: run_state from %s to %s\n", + printf("DEBUG: run_state from %s to %s\n", run_state_name(run_state), run_state_name(RUN_EXIT)); run_state = RUN_EXIT; @@ -450,7 +397,7 @@ main(int argc, char **argv) openterminal(); } if (conf->calc_debug & CALCDBG_RUNSTATE) - printf("main: run_state from %s to %s\n", + printf("DEBUG: run_state from %s to %s\n", run_state_name(run_state), run_state_name(RUN_TOP_LEVEL)); run_state = RUN_TOP_LEVEL; @@ -469,7 +416,7 @@ main(int argc, char **argv) getcommands(TRUE); } else { if (conf->calc_debug & CALCDBG_RUNSTATE) - printf("main: run_state from %s to %s\n", + printf("DEBUG: run_state from %s to %s\n", run_state_name(run_state), run_state_name(RUN_EXIT_WITH_ERROR)); run_state = RUN_EXIT_WITH_ERROR; @@ -545,9 +492,9 @@ math_error(char *fmt, ...) * script_args - concert shell script options into command line form * * When a calc shell script is executed, the args are presented to calc - * in a different form. Consider the a calc shell script called /tmp/calcit: + * in a different form. Consider the a calc shell script called /tmp/calcit: * - * #!/usr/local/bin/calc -S -q -p + * #!/usr/local/bin/calc -s -q -p * a=eval(prompt("Enter a: ")); * b=eval(prompt("Enter b: ")); * print a+b; @@ -560,20 +507,20 @@ math_error(char *fmt, ...) * * argc: 5 * argv[0]: "/usr/local/bin/calc" - * argv[1]: "-S -q -p -e" + * argv[1]: "-s -q -p -e" * argv[2]: "/tmp/calcit" * argv[3]: "-D" * argv[4]: "31" * argv[5]: NULL * - * NOTE: The user MUST put -S as the first characters on the calc shell + * NOTE: The user MUST put -s as the first characters on the calc shell * script #! line, right after the calc binary path. * * NOTE: The arg supplied on the #! calc shell script line are returned * as a single string. All tabs are converted into spaces. * * We must remember the calc script filename, break apart the #! args - * and remove the -S argument. In the above case we would return: + * and remove the -s argument. In the above case we would return: * * argc: 6 * argv[0]: "/usr/local/bin/calc" @@ -585,12 +532,12 @@ math_error(char *fmt, ...) * argv[6]: NULL * * shellfile: "/tmp/calcit" - * s_flag: TRUE */ -static int -script_args(int argc, char ***argv_p, char **shellfile_p, char **program_p) +static void +script_args(int *argc_p, char ***argv_p, char **shellfile_p) { - char **argv; /* new argv to return */ + int argc; /* argc to return */ + char **argv; /* argv to return */ char *shellfile; /* shell file pathname to return */ int delta; /* the change needed in argc */ int i; @@ -599,10 +546,11 @@ script_args(int argc, char ***argv_p, char **shellfile_p, char **program_p) char *q; /* - * must have at least 3 args and the 2nd must start with -S + * must have at least 3 args and the 2nd must start with -s */ + argc = *argc_p; argv = *argv_p; - if (argc < 3 || strncmp(argv[1], "-S", 2) != 0) { + if (argc < 3 || strncmp(argv[1], "-s", 2) != 0) { /* * we are too early in processing to call * libcalc_call_me_last() - nothing to cleanup @@ -614,18 +562,18 @@ script_args(int argc, char ***argv_p, char **shellfile_p, char **program_p) shellfile = argv[2]; /* - * count the additional args beyond the -S + * count the additional args beyond the -s */ if (argv[1][2] == ' ') { /* - * process args beyond -S on the #!/usr/local/bin line + * process args beyond -s on the #!/usr/local/bin line */ p = argv[1]+3 + strspn(argv[1]+3," "); q = p; if (q == '\0') { - /* only trailing spaces after -S, ignore them */ + /* only trailing spaces after -s, ignore them */ for (i = 3; i <= argc; ++i) { argv[i-2] = argv[i]; } @@ -633,7 +581,7 @@ script_args(int argc, char ***argv_p, char **shellfile_p, char **program_p) } else { - /* count the space separated strings that follow -S */ + /* count the space separated strings that follow -s */ for (delta = -1; p != NULL && *p; p = strchr(p+1,' '), ++delta) { /* skip multiple spaces in a row */ @@ -649,7 +597,7 @@ script_args(int argc, char ***argv_p, char **shellfile_p, char **program_p) */ fprintf(stderr, "%s: failed to malloc %d pointers\n", - shellfile, argc+delta); + program, argc+delta); exit(1); } @@ -665,7 +613,7 @@ script_args(int argc, char ***argv_p, char **shellfile_p, char **program_p) */ fprintf(stderr, "%s: failed to duplicate 1st arg\n", - shellfile); + program); exit(1); } @@ -686,7 +634,7 @@ script_args(int argc, char ***argv_p, char **shellfile_p, char **program_p) } /* - * catch the case of #!/usr/local/bin -Stuff_not_extra_args + * catch the case of #!/usr/local/bin -stuff_not_extra_args */ } else if (argv[1][2] != '\0') { @@ -695,13 +643,13 @@ script_args(int argc, char ***argv_p, char **shellfile_p, char **program_p) * libcalc_call_me_last() - nothing to cleanup */ fprintf(stderr, - "%s: malformed #! line, -S must be " + "%s: malformed #! line, -s must be " "followed by space or newline\n", - shellfile); + program); exit(1); /* - * Only -S was given in the #!/usr/local/bin line, so we just + * Only -s was given in the #!/usr/local/bin line, so we just * toss the 2nd and 3rd args */ } else { @@ -712,11 +660,10 @@ script_args(int argc, char ***argv_p, char **shellfile_p, char **program_p) } /* - * return and set the argc, argv, shellfile_p and s_flag values + * return and set the argc, argv, shellfile_p values */ + *argc_p = argc; *argv_p = argv; *shellfile_p = shellfile; - *program_p = shellfile; - s_flag = TRUE; - return argc; + return; } diff --git a/calc.h b/calc.h index 0fb6f54..2b1e44f 100644 --- a/calc.h +++ b/calc.h @@ -1,30 +1,9 @@ /* - * calc - definitions for calculator program + * Copyright (c) 1997 David I. Bell + * Permission is granted to use, distribute, or modify this source, + * provided that this copyright notice remains intact. * - * Copyright (C) 1999 David I. Bell - * - * Calc is open software; you can redistribute it and/or modify it under - * the terms of the version 2.1 of the GNU Lesser General Public License - * as published by the Free Software Foundation. - * - * Calc is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General - * Public License for more details. - * - * A copy of version 2.1 of the GNU Lesser General Public License is - * distributed with calc under the filename COPYING-LGPL. You should have - * received a copy with calc; if not, write to Free Software Foundation, Inc. - * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. - * - * @(#) $Revision: 29.2 $ - * @(#) $Id: calc.h,v 29.2 1999/12/14 19:37:46 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/calc.h,v $ - * - * Under source code control: 1990/02/15 01:48:31 - * File existed as early as: before 1990 - * - * Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ + * Definitions for calculator program. */ @@ -163,11 +142,8 @@ extern void getcommands(BOOL toplevel); extern void givehelp(char *type); extern void libcalc_call_me_first(void); extern void libcalc_call_me_last(void); -extern BOOL calc_tty(int fd); -extern BOOL orig_tty(int fd); extern void showerrors(void); extern char *calc_strdup(CONST char *); -extern void getshellfile(char *shellfile); /* * Initialization @@ -188,21 +164,16 @@ extern jmp_buf jmpbuf; /* for errors */ extern int p_flag; /* TRUE => pipe mode */ extern int q_flag; /* TRUE => don't execute rc files */ extern int u_flag; /* TRUE => unbuffer stdin and stdout */ -extern int d_flag; /* TRUE => disable heading, resource_debug */ +extern int d_flag; /* TRUE => disable heading, lib_debug == 0 */ extern int c_flag; /* TRUE => continue after error if permitted */ extern int i_flag; /* TRUE => try to go interactive after error */ -extern int s_flag; /* TRUE => keep args as strings for argv() */ extern int stoponerror; /* >0 => stop, <0 => continue, ==0 => use -c */ extern BOOL abort_now; /* TRUE => try to go interactive */ -extern int argc_value; /* count of argv[] strings for argv() builtin */ -extern char **argv_value; /* argv[] strings for argv() builtin */ - extern char *pager; /* $PAGER or default */ extern int stdin_tty; /* TRUE if stdin is a tty */ extern int havecommands; /* TRUE if have cmd args) */ extern char *program; /* our name */ -extern char *base_name; /* basename of our name */ extern char cmdbuf[]; /* command line expression */ extern int abortlevel; /* current level of aborts */ @@ -250,8 +221,7 @@ extern int calc_major_ver; extern int calc_minor_ver; extern int calc_major_patch; extern char *calc_minor_patch; -extern char *Copyright; -extern char *version(void); +extern char *version(void); /* return version string */ #endif /* !__CALC_H__ */ diff --git a/calc.man b/calc.man index 28cbe1b..9909680 100644 --- a/calc.man +++ b/calc.man @@ -1,34 +1,13 @@ .\" -.\" Copyright (C) 1999 Landon Curt Noll -.\" -.\" Calc is open software; you can redistribute it and/or modify it under -.\" the terms of the version 2.1 of the GNU Lesser General Public License -.\" as published by the Free Software Foundation. -.\" -.\" Calc is distributed in the hope that it will be useful, but WITHOUT -.\" ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -.\" or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -.\" Public License for more details. -.\" -.\" A copy of version 2.1 of the GNU Lesser General Public License is -.\" distributed with calc under the filename COPYING-LGPL. You should have -.\" received a copy with calc; if not, write to Free Software Foundation, Inc. -.\" 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -.\" -.\" @(#) $Revision: 29.1 $ -.\" @(#) $Id: calc.man,v 29.1 1999/12/14 09:15:35 chongo Exp $ -.\" @(#) $Source: /usr/local/src/cmd/calc/RCS/calc.man,v $ -.\" -.\" Under source code control: 1991/07/23 05:48:26 -.\" File existed as early as: 1991 -.\" -.\" chongo /\oo/\ http://reality.sgi.com/chongo/ -.\" Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ +.\" Copyright (c) 1993 David I. Bell and Landon Curt Noll +.\" Original man page dated 15nov93 +.\" Copyright (c) 1999 David I. Bell and Landon Curt Noll +.\" Permission is granted to use, distribute, or modify this source, +.\" provided that this copyright notice remains intact. .\" .\" calculator by David I. Bell .\" man page by Landon Noll -.\" -.TH calc 1 "^..^" "1999-11-30" +.TH calc 1 "^..^" "15Oct1999" .SH NAME calc \- arbitrary precision calculator .SH SYNOPSIS @@ -36,7 +15,7 @@ calc \- arbitrary precision calculator .RB [ \-c ] .RB [ \-C ] .RB [ \-d ] -.RB [ -D\ \&calc_debug[:resource_debug:[user_debug]] ] +.RB [ -D\ \&calc_debug[:lib_debug:[user_debug]] ] .br .in +5n .RB [ \-e ] @@ -46,18 +25,15 @@ calc \- arbitrary precision calculator .RB [ \-n ] .RB [ \-p ] .RB [ \-q ] -.RB [ \-s ] .RB [ \-u ] .RB [ \-v ] .br .RB [ calc_cmd\ \&.\|.\|. ] .in -5n -.sp -\fI#!${BINDIR}/calc\fP\ \fB\-S\fP\ [\-other_flags\ \&...] .SH DESCRIPTION \& .br -CALC OPTIONS +CALC COMMAND LINE .PP .TP @@ -89,17 +65,16 @@ cause to try to process each line being read despite the errors that it encounters. .sp 1 -By default, calc startup resource files ($CALCRC) are silently +By default, calc startup scripts ($CALCRC) are silently ignored if not found. This flag will report missing -startup resource files unless +startup scripts unless .B \-d is also given. .TP .B \-C -Permit the execution of custom builtin functions. -Without +Permit the execution of custom builtin functions. Without this flag, calling the custom() builtin function will simply generate an error. .sp 1 @@ -112,8 +87,8 @@ functions are disabled by default for this reason. .TP .B \-d Disable the printing of the opening title. The printing -of resource file debug and informational messages is also disabled -as if \fBconfig("resource_debug", 0)\fP had been executed. +of library debug and informational messages is also disabled +as if \fBconfig("lib_debug", 0)\fP had been executed. .sp 1 For example: .sp 1 @@ -147,12 +122,12 @@ It's nearly ten past six. .in -5n .sp 1 This flag disables the reporting of missing calc -startup resource files ($CALCRC). +startup scripts ($CALCRC). .TP -.BR -D " calc_debug[:resource_debug:[user_debug]]" +.BR -D " calc_debug[:lib_debug:[user_debug]]" Force the initial value of config("calc_debug"), -config("resource_debug") and config("user_debug"). +config("lib_debug") and config("user_debug"). .sp 1 The : separated strings are interpreted as signed 32 bit values. After an optional leading sign a leading zero indicates octal @@ -162,9 +137,9 @@ conversion. Otherwise, decimal conversion is assumed. By default, .I calc_debug is 0, -.I resource_debug +.I lib_debug is 3 and -.I user_debug +.I lib_debug is 0. .sp 1 For more information use the following @@ -294,7 +269,7 @@ unknown mode. will attempt to read or write them if directed. .sp 1 If the mode disables opening of files for reading, then -the startup resource files are disabled as of +the startup library scripts are disabled as of .B \-q was given. The reading of key bindings is also disabled @@ -330,15 +305,7 @@ flag overrides .TP .B \-q -Disable the use of the $CALCRC startup resource files. - -.TP -.B \-s -By default, all -.I calc_cmd -args are evaluated and executed. -This flag will disable their evaluation and instead make -them available as strings for the argv() builtin function. +Disable the use of the $CALCRC startup scripts. .TP .B \-u @@ -350,23 +317,15 @@ Print the .B calc version number and exit. .PP - -\& -.br -CALC COMMAND LINE -.PP Without .IR calc_cmd , .B calc operates interactively. If one or more .I calc_cmd -are given on the command line and -.B \-s -is NOT given, then +are given on the command line, .B calc -will evaluate and execute them and then exit. -.sp +will execute them and exit. If .B \-i is given, @@ -375,28 +334,19 @@ will attempt to become interactive even of one or more .I calc_cmd are given on the command line. -.sp -If -.B \-s -is given, -.B calc -will not evaluate any -.I calc_cmd -arguments but instead make them available -as strings to the argv() builtin function. .PP Normally on startup, .B calc attempts to execute a collection of -startup resource files. +library scripts. The environment variable $CALCRC (if non-existent then a compiled in value) contains a : separated list of startup -resource files. +library scripts. No error conditions are produced if these startup -resource files are not found. +library scripts are not found. .PP If the mode disables opening of files for reading, then the startup -resource files are disabled as of +library scripts are disabled as of .B \-q was given and $CALCRC as well as the default compiled in value are ignored. @@ -442,129 +392,6 @@ help config .in -5n .sp 1 .PP - -\& -.br -SHELL SCRIPT MODE -.PP -If an executable file begins with: -.sp 1 -.in +5n -.nf -\fI#!${BINDIR}/calc\fP\ \fB\-S\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 ) -must be the first \-flag on the ``#!'' line. -Any other optional ``\-other_flags'' must come after -the -.BR \-S . -.sp 1 -In -.B "shell script mode" -the contents of the file -are evaluated and executed as if they were processed -by the -.B read -command. -Any optional ``\-other_flags'' will by parsed first -followed by any arguments given shell script itself. -.sp 1 -In -.BR "shell script mode" , -.B \-s -(lower case -.BR \-s ) -is always assumed. -In addition, -.B \-d -and -.B \-p -are automatically set if -.B \-i -is not given. -.sp 1 -For example, if -the file -.BR /tmp/mersenne : -.sp 1 -.in +5n -.nf -\fI#!${BINDIR}/calc\fP\ \fB\-S\fP\ \&\fB\-q\fP -# -# mersenne - an example of a calc \fBshell script file\fP - -/* parse args */ -if (argv() != 1) { - fprintf(files(2), "usage: %s exp\\n", config("program")); - abort "must give one exponent arg"; -} - -/* print the mersenne number */ -print "2^": argv(0) : "-1 =", 2^eval(argv(0))-1; -.fi -.in -5n -.sp 1 -is made an executable file by: -.sp 1 -.in +5n -.nf -chmod +x /tmp/mersenne -.fi -.in -5n -.sp 1 -then the command line: -.sp 1 -.in +5n -.nf -/tmp/mersenne 127 -.fi -.in -5n -.sp 1 -will print: -.sp 1 -.in +5n -.nf -2^127-1 = 170141183460469231731687303715884105727 -.fi -.in -5n -.sp 1 -Note that because -.B \-s -is assumed in -.B "shell script mode" -and non-dashed args are made available as -strings via the -.BR argv () -builtin function. -Therefore: -.sp 1 -.in +5n -.nf -2^eval(argv(0))-1 -.fi -.in -5n -.sp 1 -will print the decimal value of 2^n-1 -but -.sp 1 -.in +5n -.nf -2^argv(0)-1 -.fi -.in -5n -.sp 1 -will not. -.PP - -\& -.br DATA TYPES .PP Fundamental builtin data types include integers, real numbers, @@ -590,9 +417,6 @@ help obj show objfuncs .in -1.0i .PP - -\& -.br VARIABLES .PP Variables in \fIcalc\fP are typeless. @@ -618,9 +442,6 @@ help list show globals .in -1.0i .PP - -\& -.br INPUT/OUTPUT .PP A leading ``0x'' implies a hexadecimal value, @@ -653,9 +474,6 @@ command: help file .in -1.0i .PP - -\& -.br CALC LANGUAGE .PP The \fIcalc\fP language is a C-like language. @@ -666,7 +484,7 @@ These commands are very similar to their counterparts in C. The language also include a number of commands particular to \fIcalc\fP itself. These include commands such as function definition, help, -reading in resource files, dump files to a file, error notification, +reading in library scripts, dump files to a file, error notification, configuration control and status. .PP For more information use the following @@ -689,54 +507,29 @@ help config \& .br .PD 0 -.TP 5 -${BINDIR}/calc -calc binary -.sp 1 -.TP 5 -${SCRIPTDIR}/* -calc shell scripts -.sp 1 -.TP 5 +.TP 20 ${LIBDIR}/*.cal -calc standard resource files -.sp 1 -.TP 5 +library scripts shipped with +.B calc +.br +.sp +.TP 20 ${LIBDIR}/help/* help files -.sp 1 -.TP 5 +.br +.sp +.TP 20 ${LIBDIR}/bindings -non-GNU-readline command line editor bindings -.sp 1 -.TP 5 -${INCDIRCALC}/*.h -include files for C interface use -.sp 1 -.TP 5 -${LIBDIR}/libcalc.a -calc binary link library -.sp 1 -.TP 5 -${LIBDIR}/libcustcalc.a -custom binary link library -.sp 1 -.TP 5 -${CUSTOMLIBDIR}/*.cal -custom resource files -.sp 1 -.TP 5 -${CUSTOMHELPDIR}/* -custom help files -.sp 1 +command line editor bindings +.sp .SH ENVIRONMENT \& .br .PD 0 .TP 5 CALCPATH -A :-separated list of directories used to search for calc -resource filenames that do not begin with /, ./ or ~. +A :-separated list of directories used to search for +scripts filenames that do not begin with /, ./ or ~. .br .sp Default value: ${CALCPATH} @@ -773,13 +566,12 @@ In that case, the standard readline mechanisms (see readline(3)) are used. .SH CREDIT \& .br -The main chunk of +The majority of .B calc was written by David I. Bell. .sp -The -.B calc -primary mirror, calc mailing list and calc bug report +.B Calc +The Calc primary mirror, calc mailing list and calc bug report processing is performed by Landon Curt Noll. .sp Landon Curt Noll maintains the master reference source, performs @@ -798,83 +590,28 @@ Ernest also supplied the original text for many of the help files. .sp Portions of this program are derived from an earlier set of public domain arbitrarily precision routines which was posted -to the net around 1984. -By now, there is almost no recognizable +to the net around 1984. By now, there is almost no recognizable code left from that original source. .sp -.SH "COPYING / CALC GNU LESSER GENERAL PUBLIC LICENSE" -\& -.sp -Calc is open software, and is -covered under version 2.1 of the GNU Lesser General Public License. -You are -welcome to change it and/or distribute copies of it under certain -conditions. -The calc commands: +Most of this source and binary has one of the following copyrights: .sp .in +0.5i -.nf -help copyright -help copying -help copying-lgpl -.fi -.in -0.5i -.sp -should display the contents of the COPYING and COPYING-LGPL files. -Those files contain information about the calc's GNU Lesser General -Public License, and in particular the conditions under which you -are allowed to change it and/or distribute copies of it. -.sp -You should have received a copy of the version 2.1 of the GNU Lesser General -Public License. -If you do not have these files, write to: -.sp -.in +0.5i -.nf -Free Software Foundation, Inc. -59 Temple Place -Suite 330 -Boston, MA 02111-1307 -USA -.fi -.in -0.5i -.sp -Calc is copyrighted in several different ways. -These ways include: -.sp -.in +0.5i -.nf -Copyright (C) year David I. Bell -Copyright (C) year David I. Bell and Landon Curt Noll -Copyright (C) year David I. Bell and Ernest Bowen -Copyright (C) year David I. Bell, Landon Curt Noll and Ernest Bowen -Copyright (C) year Landon Curt Noll -Copyright (C) year Ernest Bowen and Landon Curt Noll -Copyright (C) year Ernest Bowen -.fi -.in -0.5i -.sp -This man page is: -.sp -.in +0.5i -.nf -Copyright (C) 1999 Landon Curt Noll -.fi -.in -0.5i -.sp -and is covered under version 2.1 GNU Lesser General -Public License. -.sp -.SH "BUG REPORTS / BUG FIXES / ENHANCEMENTS" -\& +Copyright (c) 19xx David I. Bell .br +Copyright (c) 19xx David I. Bell and Landon Curt Noll +.br +Copyright (c) 19xx Landon Curt Noll +.br +Copyright (c) 19xx Ernest Bowen and Landon Curt Noll +.in -0.5i +.sp +Permission is granted to use, distribute, or modify this source, +provided that this copyright notice remains intact. .sp Send comments, suggestions, bug fixes, enhancements and interesting .B calc -resource files, -.B calc -shell scripts that you would like you see included +scripts that you would like you see included in future distributions to: .sp .in +0.5i @@ -886,7 +623,6 @@ calc-tester at postofc dot corp dot sgi dot com .in -0.5i .sp Bug reports are sent to: -.sp .in +0.5i .nf calc-bugs at postofc dot corp dot sgi dot com @@ -909,9 +645,6 @@ help bugs .sp for more information about bug reporting. .sp -.SH "CALC WEB SITE / MAILING LIST" -\& -.br Landon Noll maintains the the .B calc web site is located at: diff --git a/calcerr.tbl b/calcerr.tbl index fd11b8e..b1fcf77 100644 --- a/calcerr.tbl +++ b/calcerr.tbl @@ -1,31 +1,3 @@ -# -# calcerr - error codes and messages -# -# Copyright (C) 1999 Ernest Bowen -# -# Calc is open software; you can redistribute it and/or modify it under -# the terms of the version 2.1 of the GNU Lesser General Public License -# as published by the Free Software Foundation. -# -# Calc is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -# Public License for more details. -# -# A copy of version 2.1 of the GNU Lesser General Public License is -# distributed with calc under the filename COPYING-LGPL. You should have -# received a copy with calc; if not, write to Free Software Foundation, Inc. -# 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -# -# @(#) $Revision: 29.1 $ -# @(#) $Id: calcerr.tbl,v 29.1 1999/12/14 09:15:35 chongo Exp $ -# @(#) $Source: /usr/local/src/cmd/calc/RCS/calcerr.tbl,v $ -# -# Under source code control: 1996/05/23 17:38:44 -# File existed as early as: 1996 -# -# Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ - # This file is used to build calcerr.h include file. # # Lines should be of the form: @@ -366,12 +338,3 @@ E_BACKSLASH Bad argument type for unary backslash E_SETMINUS Bad argument type for setminus E_INDICES1 Bad first argument type for indices E_INDICES2 Bad second argument for indices -E_EXP3 Too-large re(argument) for exp -E_SINH3 Too-large re(argument) for sinh -E_COSH3 Too-large re(argument) for cosh -E_SIN3 Too-large im(argument) for sin -E_COS3 Too-large im(argument) for cos -E_GD3 Infinite or too-large result for gd -E_AGD3 Infinite or too-large result for agd -E_POWER4 Too-large value for power -E_ROOT4 Too-large value for root diff --git a/calcerr_c.awk b/calcerr_c.awk index 622cc8e..c2e5490 100644 --- a/calcerr_c.awk +++ b/calcerr_c.awk @@ -1,33 +1,3 @@ -#!/usr/bin/sed -# -# calcerr_c - help produce calcerr.c from calcerr.tbl -# -# Copyright (C) 1999 Landon Curt Noll -# -# Calc is open software; you can redistribute it and/or modify it under -# the terms of the version 2.1 of the GNU Lesser General Public License -# as published by the Free Software Foundation. -# -# Calc is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -# Public License for more details. -# -# A copy of version 2.1 of the GNU Lesser General Public License is -# distributed with calc under the filename COPYING-LGPL. You should have -# received a copy with calc; if not, write to Free Software Foundation, Inc. -# 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -# -# @(#) $Revision: 29.1 $ -# @(#) $Id: calcerr_c.awk,v 29.1 1999/12/14 09:15:35 chongo Exp $ -# @(#) $Source: /usr/local/src/cmd/calc/RCS/calcerr_c.awk,v $ -# -# Under source code control: 1996/05/24 03:15:35 -# File existed as early as: 1996 -# -# chongo /\oo/\ http://reality.sgi.com/chongo/ -# Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ -# BEGIN { printf("#include \n"); printf("#include \"calcerr.h\"\n\n"); diff --git a/calcerr_c.sed b/calcerr_c.sed index a391a5a..1894e15 100644 --- a/calcerr_c.sed +++ b/calcerr_c.sed @@ -1,33 +1,3 @@ -#!/usr/bin/sed -# -# calcerr_c - help produce calcerr.c from calcerr.tbl -# -# Copyright (C) 1999 Landon Curt Noll -# -# Calc is open software; you can redistribute it and/or modify it under -# the terms of the version 2.1 of the GNU Lesser General Public License -# as published by the Free Software Foundation. -# -# Calc is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -# Public License for more details. -# -# A copy of version 2.1 of the GNU Lesser General Public License is -# distributed with calc under the filename COPYING-LGPL. You should have -# received a copy with calc; if not, write to Free Software Foundation, Inc. -# 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -# -# @(#) $Revision: 29.1 $ -# @(#) $Id: calcerr_c.sed,v 29.1 1999/12/14 09:15:35 chongo Exp $ -# @(#) $Source: /usr/local/src/cmd/calc/RCS/calcerr_c.sed,v $ -# -# Under source code control: 1996/05/24 03:15:35 -# File existed as early as: 1996 -# -# chongo /\oo/\ http://reality.sgi.com/chongo/ -# Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ -# s/#.*// s/[ ][ ]*$// /^$/d diff --git a/calcerr_h.awk b/calcerr_h.awk index d50f9a9..88f8e5e 100644 --- a/calcerr_h.awk +++ b/calcerr_h.awk @@ -1,33 +1,3 @@ -#!/usr/bin/awk -# -# calcerr_h - help produce calcerr.h from calcerr.tbl -# -# Copyright (C) 1999 Landon Curt Noll -# -# Calc is open software; you can redistribute it and/or modify it under -# the terms of the version 2.1 of the GNU Lesser General Public License -# as published by the Free Software Foundation. -# -# Calc is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -# Public License for more details. -# -# A copy of version 2.1 of the GNU Lesser General Public License is -# distributed with calc under the filename COPYING-LGPL. You should have -# received a copy with calc; if not, write to Free Software Foundation, Inc. -# 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -# -# @(#) $Revision: 29.1 $ -# @(#) $Id: calcerr_h.awk,v 29.1 1999/12/14 09:15:35 chongo Exp $ -# @(#) $Source: /usr/local/src/cmd/calc/RCS/calcerr_h.awk,v $ -# -# Under source code control: 1996/05/23 17:38:44 -# File existed as early as: 1996 -# -# chongo /\oo/\ http://reality.sgi.com/chongo/ -# Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ -# BEGIN { ebase = 10000; printf("#define E__BASE %d\t/* calc errors start above here */\n\n", ebase); diff --git a/calcerr_h.sed b/calcerr_h.sed index 1aefd55..58054f0 100644 --- a/calcerr_h.sed +++ b/calcerr_h.sed @@ -1,33 +1,3 @@ -#!/usr/bin/sed -# -# calcerr_h - help produce calcerr.h from calcerr.tbl -# -# Copyright (C) 1999 Landon Curt Noll -# -# Calc is open software; you can redistribute it and/or modify it under -# the terms of the version 2.1 of the GNU Lesser General Public License -# as published by the Free Software Foundation. -# -# Calc is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -# Public License for more details. -# -# A copy of version 2.1 of the GNU Lesser General Public License is -# distributed with calc under the filename COPYING-LGPL. You should have -# received a copy with calc; if not, write to Free Software Foundation, Inc. -# 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -# -# @(#) $Revision: 29.1 $ -# @(#) $Id: calcerr_h.sed,v 29.1 1999/12/14 09:15:35 chongo Exp $ -# @(#) $Source: /usr/local/src/cmd/calc/RCS/calcerr_h.sed,v $ -# -# Under source code control: 1996/05/23 17:38:44 -# File existed as early as: 1996 -# -# chongo /\oo/\ http://reality.sgi.com/chongo/ -# Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ -# s/#.*// s/[ ][ ]*$// /^$/d diff --git a/check.awk b/check.awk index fafa6c3..1fc42bf 100644 --- a/check.awk +++ b/check.awk @@ -1,114 +1,84 @@ -#!/usr/bin/awk -# -# check - check the regression output for problems -# -# Copyright (C) 1999 Landon Curt Noll -# -# Calc is open software; you can redistribute it and/or modify it under -# the terms of the version 2.1 of the GNU Lesser General Public License -# as published by the Free Software Foundation. -# -# Calc is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -# Public License for more details. -# -# A copy of version 2.1 of the GNU Lesser General Public License is -# distributed with calc under the filename COPYING-LGPL. You should have -# received a copy with calc; if not, write to Free Software Foundation, Inc. -# 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -# -# @(#) $Revision: 29.1 $ -# @(#) $Id: check.awk,v 29.1 1999/12/14 09:15:35 chongo Exp $ -# @(#) $Source: /usr/local/src/cmd/calc/RCS/check.awk,v $ -# -# Under source code control: 1996/05/25 22:07:58 -# File existed as early as: 1996 -# -# chongo /\oo/\ http://reality.sgi.com/chongo/ -# Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ -# # This awk script will print 3 lines before and after any non-blank line that # does not begin with a number. This allows the 'make debug' rule to remove # all non-interest lines the the 'make check' regression output while providing # 3 lines of context around unexpected output. # BEGIN { - havebuf0=0; - buf0=0; - havebuf1=0; - buf1=0; - havebuf2=0; - buf2=0; - error = 0; - end_seen = 0; + havebuf0=0; + buf0=0; + havebuf1=0; + buf1=0; + havebuf2=0; + buf2=0; + error = 0; + end_seen = 0; } NF == 0 { - if (error > 0) { - if (havebuf2) { - print buf2; - } - --error; + if (error > 0) { + if (havebuf2) { + print buf2; } - buf2 = buf1; - havebuf2 = havebuf1; - buf1 = buf0; - havebuf1 = havebuf0; - buf0 = $0; - havebuf0 = 1; - next; + --error; + } + buf2 = buf1; + havebuf2 = havebuf1; + buf1 = buf0; + havebuf1 = havebuf0; + buf0 = $0; + havebuf0 = 1; + next; } /: Ending regression tests$/ { - end_seen = 1; + end_seen = 1; } $1 ~ /^[0-9]+:/ { - if (error > 0) { - if (havebuf2) { - print buf2; - } - --error; + if (error > 0) { + if (havebuf2) { + print buf2; } - buf2 = buf1; - havebuf2 = havebuf1; - buf1 = buf0; - havebuf1 = havebuf0; - buf0 = $0; - havebuf0 = 1; - next; + --error; + } + buf2 = buf1; + havebuf2 = havebuf1; + buf1 = buf0; + havebuf1 = havebuf0; + buf0 = $0; + havebuf0 = 1; + next; } { - error = 6; - if (havebuf2) { - print buf2; - } - buf2 = buf1; - havebuf2 = havebuf1; - buf1 = buf0; - havebuf1 = havebuf0; - buf0 = $0; - havebuf0 = 1; - next; + error = 6; + if (havebuf2) { + print buf2; + } + buf2 = buf1; + havebuf2 = havebuf1; + buf1 = buf0; + havebuf1 = havebuf0; + buf0 = $0; + havebuf0 = 1; + next; } END { - if (error > 0 && havebuf2) { - print buf2; - --error; - } - if (error > 0 && havebuf1) { - print buf1; - --error; - } - if (error > 0 && havebuf0) { - print buf0; - } - if (error > 0 || !end_seen) { - exit(1); - } else { - exit(0); - } + if (error > 0 && havebuf2) { + print buf2; + --error; + } + if (error > 0 && havebuf1) { + print buf1; + --error; + } + if (error > 0 && havebuf0) { + print buf0; + } + if (error > 0 || !end_seen) { + exit(1); + } else { + exit(0); + } } diff --git a/cmath.h b/cmath.h index 10d77c6..5fe9afb 100644 --- a/cmath.h +++ b/cmath.h @@ -1,30 +1,9 @@ /* - * cmath - data structures for extended precision complex arithmetic + * Copyright (c) 1997 David I. Bell + * Permission is granted to use, distribute, or modify this source, + * provided that this copyright notice remains intact. * - * Copyright (C) 1999 David I. Bell - * - * Calc is open software; you can redistribute it and/or modify it under - * the terms of the version 2.1 of the GNU Lesser General Public License - * as published by the Free Software Foundation. - * - * Calc is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General - * Public License for more details. - * - * A copy of version 2.1 of the GNU Lesser General Public License is - * distributed with calc under the filename COPYING-LGPL. You should have - * received a copy with calc; if not, write to Free Software Foundation, Inc. - * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. - * - * @(#) $Revision: 29.1 $ - * @(#) $Id: cmath.h,v 29.1 1999/12/14 09:15:35 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/cmath.h,v $ - * - * Under source code control: 1993/07/30 19:42:45 - * File existed as early as: 1993 - * - * Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ + * Data structure declarations for extended precision complex arithmetic. */ diff --git a/codegen.c b/codegen.c index c0ae3be..26cc121 100644 --- a/codegen.c +++ b/codegen.c @@ -1,35 +1,11 @@ /* - * codegen - module to generate opcodes from the input tokens + * Copyright (c) 1997 David I. Bell + * Permission is granted to use, distribute, or modify this source, + * provided that this copyright notice remains intact. * - * Copyright (C) 1999 David I. Bell and Ernest Bowen - * - * Primary author: David I. Bell - * - * Calc is open software; you can redistribute it and/or modify it under - * the terms of the version 2.1 of the GNU Lesser General Public License - * as published by the Free Software Foundation. - * - * Calc is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General - * Public License for more details. - * - * A copy of version 2.1 of the GNU Lesser General Public License is - * distributed with calc under the filename COPYING-LGPL. You should have - * received a copy with calc; if not, write to Free Software Foundation, Inc. - * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. - * - * @(#) $Revision: 29.1 $ - * @(#) $Id: codegen.c,v 29.1 1999/12/14 09:15:35 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/codegen.c,v $ - * - * Under source code control: 1990/02/15 01:48:13 - * File existed as early as: before 1990 - * - * Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ + * Module to generate opcodes from the input tokens. */ - #include #include "have_unistd.h" #if defined(HAVE_UNISTD_H) @@ -156,8 +132,7 @@ getcommands(BOOL toplevel) /* previously read and -once was given */ break; case -2: - scanerror(T_NULL, - "Maximum input depth reached"); + scanerror(T_NULL, "Maximum input depth reached"); break; default: scanerror(T_NULL, "Cannot open \"%s\"\n", name); @@ -174,8 +149,7 @@ getcommands(BOOL toplevel) break; } if (writeglobals(name)) - scanerror(T_NULL, - "Error writing \"%s\"\n", name); + scanerror(T_NULL, "Error writing \"%s\"\n", name); break; case T_CD: @@ -183,8 +157,6 @@ getcommands(BOOL toplevel) break; case T_NEWLINE: case T_SEMICOLON: - case T_POUNDBANG: - case T_POUNDCOMMENT: break; default: @@ -346,9 +318,7 @@ getfunction(void) index = addparam(name); break; default: - scanerror(T_NULL, - "Parameter \"%s\" is already defined", - name); + scanerror(T_NULL, "Parameter \"%s\" is already defined", name); } type = gettoken(); if (type == T_ASSIGN) { @@ -378,8 +348,7 @@ getfunction(void) break; default: scanerror(T_NULL, - "Left brace or equals sign " - "expected for function"); + "Left brace or equals sign expected for function"); return; } endfunc(); @@ -424,8 +393,7 @@ getbody(LABEL *contlabel, LABEL *breaklabel, LABEL *nextcaselabel, LABEL *defaul default: rescantoken(); - getstatement(contlabel, breaklabel, - nextcaselabel, defaultlabel); + getstatement(contlabel, breaklabel, nextcaselabel, defaultlabel); } } } @@ -474,8 +442,7 @@ getdeclarations(int symtype) break; default: - scanerror(T_SEMICOLON, - "Bad syntax in declaration statement"); + scanerror(T_SEMICOLON, "Bad syntax in declaration statement"); return res; } } @@ -607,8 +574,7 @@ getstatement(LABEL *contlabel, LABEL *breaklabel, LABEL *nextcaselabel, LABEL *d case T_CONTINUE: if (contlabel == NULL_LABEL) { - scanerror(T_SEMICOLON, - "CONTINUE not within FOR, WHILE, or DO"); + scanerror(T_SEMICOLON, "CONTINUE not within FOR, WHILE, or DO"); return; } addoplabel(OP_JUMP, contlabel); @@ -616,8 +582,7 @@ getstatement(LABEL *contlabel, LABEL *breaklabel, LABEL *nextcaselabel, LABEL *d case T_BREAK: if (breaklabel == NULL_LABEL) { - scanerror(T_SEMICOLON, - "BREAK not within FOR, WHILE, or DO"); + scanerror(T_SEMICOLON, "BREAK not within FOR, WHILE, or DO"); return; } addoplabel(OP_JUMP, breaklabel); @@ -659,26 +624,21 @@ getstatement(LABEL *contlabel, LABEL *breaklabel, LABEL *nextcaselabel, LABEL *d switch(gettoken()) { case T_CONTINUE: if (contlabel == NULL_LABEL) { - scanerror(T_SEMICOLON, - "CONTINUE not within FOR, " - "WHILE, or DO"); + scanerror(T_SEMICOLON, "CONTINUE not within FOR, WHILE, or DO"); return; } addoplabel(OP_JUMPNZ, contlabel); break; case T_BREAK: if (breaklabel == NULL_LABEL) { - scanerror(T_SEMICOLON, - "BREAK not within FOR, " - "WHILE, or DO"); + scanerror(T_SEMICOLON, "BREAK not within FOR, WHILE, or DO"); return; } addoplabel(OP_JUMPNZ, breaklabel); break; case T_GOTO: if (gettoken() != T_SYMBOL) { - scanerror(T_SEMICOLON, - "Missing label in goto"); + scanerror(T_SEMICOLON, "Missing label in goto"); return; } addop(OP_JUMPNZ); @@ -687,8 +647,7 @@ getstatement(LABEL *contlabel, LABEL *breaklabel, LABEL *nextcaselabel, LABEL *d default: addoplabel(OP_JUMPZ, &label1); rescantoken(); - getstatement(contlabel, breaklabel, - NULL_LABEL, NULL_LABEL); + getstatement(contlabel, breaklabel, NULL_LABEL, NULL_LABEL); if (gettoken() != T_ELSE) { setlabel(&label1); rescantoken(); @@ -696,8 +655,7 @@ getstatement(LABEL *contlabel, LABEL *breaklabel, LABEL *nextcaselabel, LABEL *d } addoplabel(OP_JUMP, &label2); setlabel(&label1); - getstatement(contlabel, breaklabel, - NULL_LABEL, NULL_LABEL); + getstatement(contlabel, breaklabel, NULL_LABEL, NULL_LABEL); setlabel(&label2); return; } @@ -758,8 +716,7 @@ getstatement(LABEL *contlabel, LABEL *breaklabel, LABEL *nextcaselabel, LABEL *d addoplabel(OP_JUMP, &label1); if (gettoken() != T_RIGHTPAREN) { (void) tokenmode(oldmode); - scanerror(T_SEMICOLON, - "Right parenthesis expected"); + scanerror(T_SEMICOLON, "Right parenthesis expected"); return; } } @@ -804,8 +761,7 @@ getstatement(LABEL *contlabel, LABEL *breaklabel, LABEL *nextcaselabel, LABEL *d getstatement(contlabel, breaklabel, NULL_LABEL, NULL_LABEL); if (gettoken() != T_WHILE) { (void) tokenmode(oldmode); - scanerror(T_SEMICOLON, - "WHILE keyword expected for DO statement"); + scanerror(T_SEMICOLON, "WHILE keyword expected for DO statement"); return; } setlabel(contlabel); @@ -826,14 +782,12 @@ getstatement(LABEL *contlabel, LABEL *breaklabel, LABEL *nextcaselabel, LABEL *d getcondition(); if (gettoken() != T_LEFTBRACE) { (void) tokenmode(oldmode); - scanerror(T_SEMICOLON, - "Missing left brace for switch statement"); + scanerror(T_SEMICOLON, "Missing left brace for switch statement"); return; } addoplabel(OP_JUMP, nextcaselabel); rescantoken(); - getstatement(contlabel, breaklabel, - nextcaselabel, defaultlabel); + getstatement(contlabel, breaklabel, nextcaselabel, defaultlabel); addoplabel(OP_JUMP, breaklabel); setlabel(nextcaselabel); if (defaultlabel->l_offset > 0) @@ -846,8 +800,7 @@ getstatement(LABEL *contlabel, LABEL *breaklabel, LABEL *nextcaselabel, LABEL *d case T_CASE: if (nextcaselabel == NULL_LABEL) { - scanerror(T_SEMICOLON, - "CASE not within SWITCH statement"); + scanerror(T_SEMICOLON, "CASE not within SWITCH statement"); return; } clearlabel(&label1); @@ -856,30 +809,25 @@ getstatement(LABEL *contlabel, LABEL *breaklabel, LABEL *nextcaselabel, LABEL *d clearlabel(nextcaselabel); (void) getexprlist(); if (gettoken() != T_COLON) { - scanerror(T_SEMICOLON, - "Colon expected after CASE expression"); + scanerror(T_SEMICOLON, "Colon expected after CASE expression"); return; } addoplabel(OP_CASEJUMP, nextcaselabel); setlabel(&label1); - getstatement(contlabel, breaklabel, - nextcaselabel, defaultlabel); + getstatement(contlabel, breaklabel, nextcaselabel, defaultlabel); return; case T_DEFAULT: if (gettoken() != T_COLON) { - scanerror(T_SEMICOLON, - "Colon expected after DEFAULT keyword"); + scanerror(T_SEMICOLON, "Colon expected after DEFAULT keyword"); return; } if (defaultlabel == NULL_LABEL) { - scanerror(T_SEMICOLON, - "DEFAULT not within SWITCH statement"); + scanerror(T_SEMICOLON, "DEFAULT not within SWITCH statement"); return; } if (defaultlabel->l_offset > 0) { - scanerror(T_SEMICOLON, - "Multiple DEFAULT clauses in SWITCH"); + scanerror(T_SEMICOLON, "Multiple DEFAULT clauses in SWITCH"); return; } clearlabel(&label1); @@ -887,8 +835,7 @@ getstatement(LABEL *contlabel, LABEL *breaklabel, LABEL *nextcaselabel, LABEL *d setlabel(defaultlabel); addop(OP_POP); setlabel(&label1); - getstatement(contlabel, breaklabel, - nextcaselabel, defaultlabel); + getstatement(contlabel, breaklabel, nextcaselabel, defaultlabel); return; case T_ELSE: @@ -1043,18 +990,14 @@ getobjdeclaration(int symtype) switch (gettoken()) { case T_SYMBOL: if (count == MAXINDICES) { - scanerror(T_SEMICOLON, - "Too many elements in OBJ " - "statement"); + scanerror(T_SEMICOLON, "Too many elements in OBJ statement"); (void) tokenmode(oldmode); return; } index = addelement(tokensymbol()); for (i = 0; i < count; i++) { if (indices[i] == index) { - scanerror(T_SEMICOLON, - "Duplicate element name " - "\"%s\"", tokensymbol()); + scanerror(T_SEMICOLON, "Duplicate element name \"%s\"", tokensymbol()); (void) tokenmode(oldmode); return; } @@ -1064,8 +1007,7 @@ getobjdeclaration(int symtype) continue; rescantoken(); if (gettoken() != T_RIGHTBRACE) { - scanerror(T_SEMICOLON, - "Bad object type definition"); + scanerror(T_SEMICOLON, "Bad object type definition"); (void) tokenmode(oldmode); return; } @@ -1082,8 +1024,7 @@ getobjdeclaration(int symtype) case T_NEWLINE: continue; default: - scanerror(T_SEMICOLON, - "Bad object type definition"); + scanerror(T_SEMICOLON, "Bad object type definition"); (void) tokenmode(oldmode); return; } @@ -1132,8 +1073,7 @@ getobjvars(char *name, int symtype) index = checkobject(name); if (index < 0) { - scanerror(T_SEMICOLON, - "Object %s has not been defined yet", name); + scanerror(T_SEMICOLON, "Object %s has not been defined yet", name); return; } for (;;) { @@ -1286,8 +1226,7 @@ creatematrix(void) } rescantoken(); if (++dim > MAXDIM) { - scanerror(T_SEMICOLON, - "Only %ld dimensions allowed", MAXDIM); + scanerror(T_SEMICOLON, "Only %ld dimensions allowed", MAXDIM); return; } (void) getopassignment(); @@ -1310,8 +1249,7 @@ creatematrix(void) /*FALLTHRU*/ default: rescantoken(); - scanerror(T_SEMICOLON, - "Illegal matrix definition"); + scanerror(T_SEMICOLON, "Illegal matrix definition"); return; } } @@ -1366,8 +1304,7 @@ getinitlist(void) return index; default: - scanerror(T_SEMICOLON, - "Bad initialization list"); + scanerror(T_SEMICOLON, "Bad initialization list"); (void) tokenmode(oldmode); return -1; } @@ -1383,14 +1320,12 @@ static void getcondition(void) { if (gettoken() != T_LEFTPAREN) { - scanerror(T_SEMICOLON, - "Missing left parenthesis for condition"); + scanerror(T_SEMICOLON, "Missing left parenthesis for condition"); return; } (void) getexprlist(); if (gettoken() != T_RIGHTPAREN) { - scanerror(T_SEMICOLON, - "Missing right parenthesis for condition"); + scanerror(T_SEMICOLON, "Missing right parenthesis for condition"); return; } } @@ -1599,8 +1534,7 @@ getaltcond(void) addoplabel(OP_JUMPZ, &altlab); type = getaltcond(); if (gettoken() != T_COLON) { - scanerror(T_SEMICOLON, - "Missing colon for conditional expression"); + scanerror(T_SEMICOLON, "Missing colon for conditional expression"); return EXPR_RVALUE; } addoplabel(OP_JUMP, &donelab); @@ -2011,8 +1945,7 @@ getterm(void) oldmode = tokenmode(TM_DEFAULT); type = getexprlist(); if (gettoken() != T_RIGHTPAREN) - scanerror(T_SEMICOLON, - "Missing right parenthesis"); + scanerror(T_SEMICOLON, "Missing right parenthesis"); (void) tokenmode(oldmode); break; @@ -2041,8 +1974,7 @@ getterm(void) default: if (iskeyword(type)) { - scanerror(T_NULL, - "Expression contains reserved keyword"); + scanerror(T_NULL, "Expression contains reserved keyword"); break; } rescantoken(); @@ -2061,9 +1993,7 @@ getterm(void) type = 0; break; case T_LEFTPAREN: - scanerror(T_NULL, - "Function calls not allowed " - "as expressions"); + scanerror(T_NULL, "Function calls not allowed as expressions"); default: rescantoken(); return type; @@ -2125,9 +2055,7 @@ getidexpr(BOOL okmat, BOOL autodef) type = 0; break; case T_LEFTPAREN: - scanerror(T_NULL, - "Function calls not allowed " - "as expressions"); + scanerror(T_NULL, "Function calls not allowed as expressions"); default: rescantoken(); return type; @@ -2225,31 +2153,11 @@ getshowstatement(void) case T_SYMBOL: strncpy(name, tokensymbol(), 4); name[4] = '\0'; - /* Yuck! */ - arg = stringindex("buil\000" - "real\000" - "func\000" - "objf\000" - "conf\000" - "objt\000" - "file\000" - "size\000" - "erro\000" - "cust\000" - "bloc\000" - "cons\000" - "glob\000" - "stat\000" - "numb\000" - "redc\000" - "stri\000" - "lite\000" - "opco\000", name); + arg = stringindex("buil\000real\000func\000objf\000conf\000objt\000file\000size\000erro\000cust\000bloc\000cons\000glob\000stat\000numb\000redc\000stri\000lite\000opco\000", name); if (arg == 19) { if (gettoken() != T_SYMBOL) { rescantoken(); - scanerror(T_SEMICOLON, - "Function name expected"); + scanerror(T_SEMICOLON, "Function name expected"); return; } index = adduserfunc(tokensymbol()); @@ -2266,11 +2174,9 @@ getshowstatement(void) printf("four letters of one of:\n"); printf("\tblocks, builtin, config, constants, "); printf("custom, errors, files, functions,\n"); - printf("\tglobaltypes, objfunctions, objtypes, " - "opcodes, sizes, "); + printf("\tglobaltypes, objfunctions, objtypes, opcodes, sizes, "); printf("realglobals,\n"); - printf("\tstatics, numbers, redcdata, " - "strings, literals\n"); + printf("\tstatics, numbers, redcdata, strings, literals\n"); rescantoken(); return; @@ -2331,9 +2237,7 @@ getmatargs(void) break; default: rescantoken(); - scanerror(T_NULL, - "Missing right bracket in " - "array reference"); + scanerror(T_NULL, "Missing right bracket in array reference"); return; } } @@ -2417,8 +2321,7 @@ definesymbol(char *name, int symtype) return; /*FALLTHRU*/ case SYM_PARAM: - scanerror(T_COMMA, - "Variable \"%s\" is already defined", name); + scanerror(T_COMMA, "Variable \"%s\" is already defined", name); return; } @@ -2528,9 +2431,7 @@ getcallargs(char *name) case T_COMMA: break; default: - scanerror(T_SEMICOLON, - "Missing right parenthesis " - "in function call"); + scanerror(T_SEMICOLON, "Missing right parenthesis in function call"); return; } } @@ -2574,25 +2475,4 @@ do_changedir(void) } -/* - * getshellfile - process the contents of a shellfile - */ -void -getshellfile(char *shellfile) -{ - /* - * treat the calc shell script as if we were reading it - */ - if (!allow_read) { - scanerror(T_NULL, - "reading of calc shell script \"%s\" " - "dislloaed by -m mode\n", shellfile); - } else if (opensearchfile(shellfile, NULL, NULL, FALSE) == 0) { - getcommands(FALSE); - closeinput(); - } else { - scanerror(T_NULL, - "Cannot open calc shell script \"%s\"\n", shellfile); - } - return; -} +/* END CODE */ diff --git a/comfunc.c b/comfunc.c index f7576e6..fa951aa 100644 --- a/comfunc.c +++ b/comfunc.c @@ -1,35 +1,11 @@ /* - * comfunc - extended precision complex arithmetic non-primitive routines + * Copyright (c) 1993 David I. Bell + * Permission is granted to use, distribute, or modify this source, + * provided that this copyright notice remains intact. * - * Copyright (C) 1999 David I. Bell and Ernest Bowen - * - * Primary author: David I. Bell - * - * Calc is open software; you can redistribute it and/or modify it under - * the terms of the version 2.1 of the GNU Lesser General Public License - * as published by the Free Software Foundation. - * - * Calc is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General - * Public License for more details. - * - * A copy of version 2.1 of the GNU Lesser General Public License is - * distributed with calc under the filename COPYING-LGPL. You should have - * received a copy with calc; if not, write to Free Software Foundation, Inc. - * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. - * - * @(#) $Revision: 29.1 $ - * @(#) $Id: comfunc.c,v 29.1 1999/12/14 09:15:35 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/comfunc.c,v $ - * - * Under source code control: 1990/02/15 01:48:13 - * File existed as early as: before 1990 - * - * Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ + * Extended precision complex arithmetic non-primitive routines */ - #include "config.h" #include "cmath.h" @@ -378,12 +354,9 @@ croot(COMPLEX *c, NUMBER *q, NUMBER *epsilon) if (qistwo(q)) return csqrt(c, epsilon, 24L); if (cisreal(c) && !qisneg(c->real)) { - tmp1 = qroot(c->real, q, epsilon); - if (tmp1 == NULL) - return NULL; r = comalloc(); qfree(r->real); - r->real = tmp1; + r->real = qroot(c->real, q, epsilon); return r; } /* @@ -402,14 +375,12 @@ croot(COMPLEX *c, NUMBER *q, NUMBER *epsilon) root = qroot(a2pb2, tmp1, epsilon2); qfree(a2pb2); qfree(tmp1); - qfree(epsilon2); - if (root == NULL) - return NULL; m = qilog2(root); if (m < n) { qfree(root); return clink(&_czero_); } + qfree(epsilon2); epsilon2 = qbitvalue(n - m - 4); tmp1 = qatan2(c->imag, c->real, epsilon2); qfree(epsilon2); @@ -439,9 +410,6 @@ cexp(COMPLEX *c, NUMBER *epsilon) /*NOTREACHED*/ } if (cisreal(c)) { - tmp1 = qexp(c->real, epsilon); - if (tmp1 == NULL) - return NULL; r = comalloc(); qfree(r->real); r->real = qexp(c->real, epsilon); @@ -451,8 +419,6 @@ cexp(COMPLEX *c, NUMBER *epsilon) epsilon1 = qbitvalue(n - 2); tmp1 = qexp(c->real, epsilon1); qfree(epsilon1); - if (tmp1 == NULL) - return NULL; if (qiszero(tmp1)) { qfree(tmp1); return clink(&_czero_); @@ -548,8 +514,6 @@ ccos(COMPLEX *c, NUMBER *epsilon) ctmp2 = cexp(ctmp1, epsilon1); comfree(ctmp1); qfree(epsilon1); - if (ctmp2 == NULL) - return NULL; if (ciszero(ctmp2)) { comfree(ctmp2); return clink(&_czero_); @@ -600,8 +564,6 @@ csin(COMPLEX *c, NUMBER *epsilon) ctmp2 = cexp(ctmp1, epsilon1); comfree(ctmp1); qfree(epsilon1); - if (ctmp2 == NULL) - return NULL; if (ciszero(ctmp2)) { comfree(ctmp2); return clink(&_czero_); @@ -632,13 +594,9 @@ ccosh(COMPLEX *c, NUMBER *epsilon) COMPLEX *tmp1, *tmp2, *tmp3; tmp1 = cexp(c, epsilon); - if (tmp1 == NULL) - return NULL; tmp2 = cneg(c); tmp3 = cexp(tmp2, epsilon); comfree(tmp2); - if (tmp3 == NULL) - return NULL; tmp2 = cadd(tmp1, tmp3); comfree(tmp1); comfree(tmp3); @@ -654,13 +612,9 @@ csinh(COMPLEX *c, NUMBER *epsilon) COMPLEX *tmp1, *tmp2, *tmp3; tmp1 = cexp(c, epsilon); - if (tmp1 == NULL) - return NULL; tmp2 = cneg(c); tmp3 = cexp(tmp2, epsilon); comfree(tmp2); - if (tmp3 == NULL) - return NULL; tmp2 = csub(tmp1, tmp3); comfree(tmp1); comfree(tmp3); @@ -950,8 +904,6 @@ cgd(COMPLEX *c, NUMBER *epsilon) tmp1 = neg ? cneg(c) : clink(c); tmp2 = cexp(tmp1, epsilon); comfree(tmp1); - if (tmp2 == NULL) - return NULL; tmp1 = cmul(&_conei_, tmp2); tmp3 = cadd(&_conei_, tmp2); comfree(tmp2); @@ -1011,11 +963,11 @@ cpolar(NUMBER *q1, NUMBER *q2, NUMBER *epsilon) /*NOTREACHED*/ } if (qiszero(q1)) - return clink(&_czero_); + return qlink(&_czero_); m = qilog2(q1) + 1; n = qilog2(epsilon); if (m < n) - return clink(&_czero_); + return qlink(&_czero_); r = comalloc(); if (qiszero(q2)) { qfree(r->real); diff --git a/commath.c b/commath.c index 187890c..0e6adfb 100644 --- a/commath.c +++ b/commath.c @@ -1,33 +1,11 @@ /* - * commath - extended precision complex arithmetic primitive routines + * Copyright (c) 1993 David I. Bell + * Permission is granted to use, distribute, or modify this source, + * provided that this copyright notice remains intact. * - * Copyright (C) 1999 David I. Bell - * - * Calc is open software; you can redistribute it and/or modify it under - * the terms of the version 2.1 of the GNU Lesser General Public License - * as published by the Free Software Foundation. - * - * Calc is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General - * Public License for more details. - * - * A copy of version 2.1 of the GNU Lesser General Public License is - * distributed with calc under the filename COPYING-LGPL. You should have - * received a copy with calc; if not, write to Free Software Foundation, Inc. - * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. - * - * @(#) $Revision: 29.1 $ - * @(#) $Id: commath.c,v 29.1 1999/12/14 09:15:35 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/commath.c,v $ - * - * Under source code control: 1990/02/15 01:48:10 - * File existed as early as: before 1990 - * - * Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ + * Extended precision complex arithmetic primitive routines */ - #include "cmath.h" @@ -627,3 +605,5 @@ comfree(COMPLEX *c) qfree(c->imag); free(c); } + +/* END CODE */ diff --git a/config.c b/config.c index 99953d5..a847c74 100644 --- a/config.c +++ b/config.c @@ -1,35 +1,11 @@ /* - * config - configuration routines + * Copyright (c) 1997 David I. Bell + * Permission is granted to use, distribute, or modify this source, + * provided that this copyright notice remains intact. * - * Copyright (C) 1999 David I. Bell and Landon Curt Noll - * - * Primary author: David I. Bell - * - * Calc is open software; you can redistribute it and/or modify it under - * the terms of the version 2.1 of the GNU Lesser General Public License - * as published by the Free Software Foundation. - * - * Calc is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General - * Public License for more details. - * - * A copy of version 2.1 of the GNU Lesser General Public License is - * distributed with calc under the filename COPYING-LGPL. You should have - * received a copy with calc; if not, write to Free Software Foundation, Inc. - * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. - * - * @(#) $Revision: 29.2 $ - * @(#) $Id: config.c,v 29.2 1999/12/14 19:37:46 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/config.c,v $ - * - * Under source code control: 1991/07/20 00:21:56 - * File existed as early as: 1991 - * - * Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ + * Configuration routines. */ - #include #include "calc.h" #include "token.h" @@ -39,11 +15,6 @@ #include "config.h" #include "string.h" -#include "have_strdup.h" -#if !defined(HAVE_STRDUP) -# define strdup(x) calc_strdup((CONST char *)(x)) -#endif /* HAVE_STRDUP */ - /* * Table of configuration types that can be set or read. @@ -81,16 +52,12 @@ NAMETYPE configs[] = { {"blkverbose", CONFIG_BLKVERBOSE}, {"blkbase", CONFIG_BLKBASE}, {"blkfmt", CONFIG_BLKFMT}, - {"resource_debug", CONFIG_RESOURCE_DEBUG}, - {"lib_debug", CONFIG_RESOURCE_DEBUG}, + {"lib_debug", CONFIG_LIB_DEBUG}, {"calc_debug", CONFIG_CALC_DEBUG}, {"user_debug", CONFIG_USER_DEBUG}, {"verbose_quit",CONFIG_VERBOSE_QUIT}, {"ctrl_d", CONFIG_CTRL_D}, {"ctrl-d", CONFIG_CTRL_D}, /* alias for ctrl_d */ - {"program", CONFIG_PROGRAM}, - {"basename", CONFIG_BASENAME}, - {"version", CONFIG_VERSION}, {NULL, 0} }; @@ -130,13 +97,10 @@ CONFIG oldstd = { /* backward compatible standard configuration */ BLK_BASE_HEX, /* block octet print base */ BLK_FMT_HD_STYLE, /* block output format */ 0, /* internal calc debug level */ - 3, /* calc resource file debug level */ + 3, /* calc library debug level */ 0, /* user defined debug level */ TRUE, /* print Quit or abort executed messages */ - CTRL_D_VIRGIN_EOF, /* ^D only exits on virgin lines */ - NULL, /* our name */ - NULL, /* basename of our name */ - NULL /* version */ + CTRL_D_VIRGIN_EOF /* ^D only exits on virgin lines */ }; CONFIG newstd = { /* new non-backward compatible configuration */ MODE_INITIAL, /* current output mode */ @@ -170,13 +134,10 @@ CONFIG newstd = { /* new non-backward compatible configuration */ BLK_BASE_HEX, /* block octet print base */ BLK_FMT_HD_STYLE, /* block output format */ 0, /* internal calc debug level */ - 3, /* calc resource file debug level */ + 3, /* calc library debug level */ 0, /* user defined debug level */ TRUE, /* print Quit or abort executed messages */ - CTRL_D_VIRGIN_EOF, /* ^D only exits on virgin lines */ - NULL, /* our name */ - NULL, /* basename of our name */ - NULL /* version */ + CTRL_D_VIRGIN_EOF /* ^D only exits on virgin lines */ }; CONFIG *conf = NULL; /* loaded in at startup - current configuration */ @@ -265,19 +226,19 @@ static NAMETYPE ctrl_d[] = { /* * Possible binary config state values */ -#define TRUE_STRING "true" -#define FALSE_STRING "false" +#define TRUE_STRING "on" +#define FALSE_STRING "off" static NAMETYPE truth[] = { {TRUE_STRING, TRUE}, + {"true", TRUE}, {"t", TRUE}, - {"on", TRUE}, {"yes", TRUE}, {"y", TRUE}, {"set", TRUE}, {"1", TRUE}, {FALSE_STRING, FALSE}, + {"false", FALSE}, {"f", FALSE}, - {"off", FALSE}, {"no", FALSE}, {"n", FALSE}, {"unset", FALSE}, @@ -836,18 +797,18 @@ setconfig(int type, VALUE *vp) conf->calc_debug = temp; break; - case CONFIG_RESOURCE_DEBUG: + case CONFIG_LIB_DEBUG: if (vp->v_type != V_NUM) { - math_error("Non numeric for resource_debug"); + math_error("Non numeric for lib_debug"); /*NOTREACHED*/ } q = vp->v_num; temp = qtoi(q); if (qisfrac(q) || !zistiny(q->num)) { - math_error("Illegal resource_debug parameter value"); + math_error("Illegal lib_debug parameter value"); /*NOTREACHED*/ } - conf->resource_debug = temp; + conf->lib_debug = temp; break; case CONFIG_USER_DEBUG: @@ -893,18 +854,6 @@ setconfig(int type, VALUE *vp) conf->ctrl_d = temp; break; - case CONFIG_PROGRAM: - math_error("The program config parameter is read-only"); - /*NOTREACHED*/ - - case CONFIG_BASENAME: - math_error("The program config parameter is read-only"); - /*NOTREACHED*/ - - case CONFIG_VERSION: - math_error("The program config parameter is read-only"); - /*NOTREACHED*/ - default: math_error("Setting illegal config parameter"); /*NOTREACHED*/ @@ -953,23 +902,18 @@ config_copy(CONFIG *src) * clone the pointer values */ dest->epsilon = qlink(src->epsilon); - dest->prompt1 = strdup(src->prompt1); - dest->prompt2 = strdup(src->prompt2); - if (src->program == NULL) { - dest->program = strdup(program); - } else { - dest->program = strdup(src->program); + dest->prompt1 = (char *)malloc(strlen(src->prompt1)+1); + if (dest->prompt1 == NULL) { + math_error("cannot dup prompt1 for new CONFIG value"); + /*NOTREACHED*/ } - if (src->base_name == NULL) { - dest->base_name = strdup(base_name); - } else { - dest->base_name = strdup(src->base_name); - } - if (src->version == NULL) { - dest->version = strdup(version()); - } else { - dest->version = strdup(src->version); + strcpy(dest->prompt1, src->prompt1); + dest->prompt2 = (char *)malloc(strlen(src->prompt2)+1); + if (dest->prompt2 == NULL) { + math_error("cannot dup prompt2 for new CONFIG value"); + /*NOTREACHED*/ } + strcpy(dest->prompt2, src->prompt2); /* * return the new value @@ -1006,15 +950,6 @@ config_free(CONFIG *cfg) if (cfg->prompt2 != NULL) { free(cfg->prompt2); } - if (cfg->program != NULL) { - free(cfg->program); - } - if (cfg->base_name != NULL) { - free(cfg->base_name); - } - if (cfg->version != NULL) { - free(cfg->version); - } /* * free the CONFIG value itself @@ -1226,8 +1161,8 @@ config_value(CONFIG *cfg, int type, VALUE *vp) i = cfg->calc_debug; break; - case CONFIG_RESOURCE_DEBUG: - i = cfg->resource_debug; + case CONFIG_LIB_DEBUG: + i = cfg->lib_debug; break; case CONFIG_USER_DEBUG: @@ -1253,33 +1188,6 @@ config_value(CONFIG *cfg, int type, VALUE *vp) vp->v_str = makenewstring(p); return; - case CONFIG_PROGRAM: - vp->v_type = V_STR; - if (cfg->base_name == NULL) { - vp->v_str = makestring(strdup(program)); - } else { - vp->v_str = makenewstring(cfg->program); - } - return; - - case CONFIG_BASENAME: - vp->v_type = V_STR; - if (cfg->base_name == NULL) { - vp->v_str = makestring(strdup(base_name)); - } else { - vp->v_str = makenewstring(cfg->base_name); - } - return; - - case CONFIG_VERSION: - vp->v_type = V_STR; - if (cfg->version == NULL) { - vp->v_str = makestring(strdup(version())); - } else { - vp->v_str = makenewstring(cfg->version); - } - return; - default: math_error("Getting illegal CONFIG element"); /*NOTREACHED*/ @@ -1354,23 +1262,8 @@ config_cmp(CONFIG *cfg1, CONFIG *cfg2) cfg1->blkbase != cfg2->blkbase || cfg1->blkfmt != cfg2->blkfmt || cfg1->calc_debug != cfg2->calc_debug || - cfg1->resource_debug != cfg2->resource_debug || + cfg1->lib_debug != cfg2->lib_debug || cfg1->user_debug != cfg2->user_debug || cfg1->verbose_quit != cfg2->verbose_quit || - cfg1->ctrl_d != cfg2->ctrl_d || - - (cfg1->program == NULL && cfg2->program != NULL) || - (cfg1->program != NULL && cfg2->program == NULL) || - (cfg1->program != NULL && cfg2->program != NULL && - strcmp(cfg1->program, cfg2->program) != 0) || - - (cfg1->base_name == NULL && cfg2->base_name != NULL) || - (cfg1->base_name != NULL && cfg2->base_name == NULL) || - (cfg1->base_name != NULL && cfg2->base_name != NULL && - strcmp(cfg1->base_name, cfg2->base_name) != 0) || - - (cfg1->version == NULL && cfg2->version != NULL) || - (cfg1->version != NULL && cfg2->version == NULL) || - (cfg1->version != NULL && cfg2->version != NULL && - strcmp(cfg1->version, cfg2->version) != 0); + cfg1->ctrl_d != cfg2->ctrl_d; } diff --git a/config.h b/config.h index 95de92a..d0f5457 100644 --- a/config.h +++ b/config.h @@ -1,33 +1,37 @@ /* - * config - configuration routines + * Copyright (c) 1997 by Landon Curt Noll. All Rights Reserved. * - * Copyright (C) 1999 Landon Curt Noll and David I. Bell + * Permission to use, copy, modify, and distribute this software and + * its documentation for any purpose and without fee is hereby granted, + * provided that the above copyright, this permission notice and text + * this comment, and the disclaimer below appear in all of the following: * - * Primary author: Landon Curt Noll + * supporting documentation + * source copies + * source works derived from this source + * binaries derived from this source or from derived source * - * Calc is open software; you can redistribute it and/or modify it under - * the terms of the version 2.1 of the GNU Lesser General Public License - * as published by the Free Software Foundation. + * LANDON CURT NOLL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO + * EVENT SHALL LANDON CURT NOLL BE LIABLE FOR ANY SPECIAL, INDIRECT OR + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF + * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR + * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. * - * Calc is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General - * Public License for more details. + * Prior to calc 2.9.3t9, these routines existed as a calc library called + * cryrand.cal. They have been rewritten in C for performance as well + * as to make them available directly from libcalc.a. * - * A copy of version 2.1 of the GNU Lesser General Public License is - * distributed with calc under the filename COPYING-LGPL. You should have - * received a copy with calc; if not, write to Free Software Foundation, Inc. - * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. + * Comments, suggestions, bug fixes and questions about these routines + * are welcome. Send EMail to the address given below. * - * @(#) $Revision: 29.2 $ - * @(#) $Id: config.h,v 29.2 1999/12/14 19:37:46 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/config.h,v $ + * Happy bit twiddling, * - * Under source code control: 1995/11/01 22:20:17 - * File existed as early as: 1995 + * Landon Curt Noll + * http://reality.sgi.com/chongo/ * - * chongo /\oo/\ http://reality.sgi.com/chongo/ - * Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ + * chongo /\../\ */ @@ -73,15 +77,11 @@ #define CONFIG_BLKVERBOSE 27 #define CONFIG_BLKBASE 28 #define CONFIG_BLKFMT 29 -#define CONFIG_RESOURCE_DEBUG 30 -#define CONFIG_LIB_DEBUG CONFIG_RESOURCE_DEBUG +#define CONFIG_LIB_DEBUG 30 #define CONFIG_CALC_DEBUG 31 #define CONFIG_USER_DEBUG 32 #define CONFIG_VERBOSE_QUIT 33 #define CONFIG_CTRL_D 34 -#define CONFIG_PROGRAM 35 -#define CONFIG_BASENAME 36 -#define CONFIG_VERSION 37 /* @@ -104,8 +104,7 @@ * quickhash.c - config_hash() * hash.c - hash_value() * config.c - configs[], oldstd, newstd, setconfig(), - * config_value(), config_cmp(), - * and perhaps config_copy(), config_free() + * config_value(), config_cmp() * config.h - CONFIG_XYZ_SYMBOL (see above) */ struct config { @@ -140,24 +139,21 @@ struct config { int blkbase; /* block output base */ int blkfmt; /* block output style */ long calc_debug; /* internal debug, see CALC_DEBUG_XXX below */ - long resource_debug; /* resource debug, see RSCDBG_XXX below */ + long lib_debug; /* library debug, see LIB_DEBUG_XXX below */ long user_debug; /* user defined debug value: 0 default */ BOOL verbose_quit; /* TRUE => print Quit or abort executed msg */ int ctrl_d; /* see CTRL_D_xyz below */ - char *program; /* our name */ - char *base_name; /* basename of our name */ - char *version; /* calc version string */ }; typedef struct config CONFIG; /* - * resource_debug bit masks + * lib_debug bit masks */ -#define RSCDBG_STDIN_FUNC (0x00000001) /* interactive func define debug */ -#define RSCDBG_FILE_FUNC (0x00000002) /* file read func define debug */ -#define RSCDBG_FUNC_INFO (0x00000004) /* print extra info for show func */ -#define RSCDBG_MASK (0x00000007) +#define LIBDBG_STDIN_FUNC (0x00000001) /* interactive func define debug */ +#define LIBDBG_FILE_FUNC (0x00000002) /* file read func define debug */ +#define LIBDBG_FUNC_INFO (0x00000004) /* print extra info for show func */ +#define LIBDBG_MASK (0x00000007) /* @@ -186,7 +182,7 @@ extern CONFIG *conf; /* current configuration */ extern CONFIG oldstd; /* backward compatible standard configuration */ extern CONFIG newstd; /* new non-backward compatible configuration */ extern char *calc_debug; /* !=NULL => value of config("calc_debug") */ -extern char *resource_debug; /* !=NULL => config("resource_debug") value */ +extern char *lib_debug; /* !=NULL => value of config("lib_debug") */ extern char *user_debug; /* !=NULL => value of config("user_debug") */ diff --git a/const.c b/const.c index ad47faf..263a24f 100644 --- a/const.c +++ b/const.c @@ -1,33 +1,11 @@ /* - * const - constant number storage module + * Copyright (c) 1997 David I. Bell + * Permission is granted to use, distribute, or modify this source, + * provided that this copyright notice remains intact. * - * Copyright (C) 1999 David I. Bell - * - * Calc is open software; you can redistribute it and/or modify it under - * the terms of the version 2.1 of the GNU Lesser General Public License - * as published by the Free Software Foundation. - * - * Calc is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General - * Public License for more details. - * - * A copy of version 2.1 of the GNU Lesser General Public License is - * distributed with calc under the filename COPYING-LGPL. You should have - * received a copy with calc; if not, write to Free Software Foundation, Inc. - * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. - * - * @(#) $Revision: 29.1 $ - * @(#) $Id: const.c,v 29.1 1999/12/14 09:15:35 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/const.c,v $ - * - * Under source code control: 1990/02/15 01:48:14 - * File existed as early as: before 1990 - * - * Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ + * Constant number storage module. */ - #include #include "calc.h" #include "qmath.h" diff --git a/cscript/Makefile b/cscript/Makefile deleted file mode 100644 index d68a0aa..0000000 --- a/cscript/Makefile +++ /dev/null @@ -1,247 +0,0 @@ -# -# cscript - makefile for calc shell script files -# -# Copyright (C) 1999 Landon Curt Noll -# -# Calc is open software; you can redistribute it and/or modify it under -# the terms of the version 2.1 of the GNU Lesser General Public License -# as published by the Free Software Foundation. -# -# Calc is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -# Public License for more details. -# -# A copy of version 2.1 of the GNU Lesser General Public License is -# distributed with calc under the filename COPYING-LGPL. You should have -# received a copy with calc; if not, write to Free Software Foundation, Inc. -# 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -# -# @(#) $Revision: 29.3 $ -# @(#) $Id: Makefile,v 29.3 1999/12/14 19:30:19 chongo Exp $ -# @(#) $Source: /usr/local/src/cmd/calc/cscript/RCS/Makefile,v $ -# -# Under source code control: 1999/11/29 11:10:26 -# File existed as early as: 1999 -# -# chongo /\oo/\ http://reality.sgi.com/chongo/ -# Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ -# -# calculator by David I. Bell with help/mods from others -# Makefile by Landon Curt Noll - - -# required vars -# -SHELL= /bin/sh -MAKE_FILE = Makefile - -# Normally, the upper level makefile will set these values. We provide -# a default here just in case you want to build from this directory. -# -BINDIR= /usr/local/bin -#BINDIR= /usr/bin -#BINDIR= /usr/contrib/bin -# -SCRIPTDIR= ${BINDIR}/cscript - -# Makefile debug -# -# Q=@ do not echo internal makefile actions (quiet mode) -# Q= echo internal makefile actions (debug / verbose mode) -# -#Q= -Q=@ - -# standard tools -# -CHMOD= chmod -SED= sed -SORT= sort -FMT= fmt - -# The ${SCRIPT} list is the list of calc shell script files (without the .calc -# extension) which will be installed. -# -# The ${SCRIPT_SRC} is built from ${SCRIPT} and has the .calc extensions. -# -# This list is prodiced by the detaillist rule when no WARNINGS are detected. -# To add a script: -# -# 1) Name the file with a .calc filename extension -# 2) Place that file under RCS control -# 3) Add the name, without the .calc extension to the ${SCRIPT} below -# 4) Write out this Makefile -# 5) Replace the ${SCRIPT} and ${SCRIPT_SRC} lines with the output of: -# -# make detaillist -# -SCRIPT= mersenne piforever plus simple - -SCRIPT_SRC= mersenne.calc piforever.calc plus.calc simple.calc - -# These files are found (but not built) in the distribution -# -DISTLIST= ${SCRIPT_SRC} ${MAKE_FILE} - -# These files are used to make (but not built) a calc .a library -# -CALCLIBLIST= - -# The reason for this Makefile -# -all: ${SCRIPT} ${SCRIPT_SRC} .all - -# used by the upper level Makefile to determine of we have done all -# -# NOTE: Due to bogus shells found on one common system we must have -# an non-emoty else clause for every if condition. *sigh* -# -.all: - rm -f .all - touch .all - -## -# -# File list generation. You can ignore this section. -# -# -# We will form the names of source files as if they were in a -# sub-directory called calc/cscript. -# -## - -distlist: ${DISTLIST} - ${Q}for i in ${DISTLIST}; do \ - echo cscript/$$i; \ - done | ${SORT} - -distdir: - ${Q}echo cscript - -calcliblist: - -# These next rule help me form the ${DETAIL_HELP} makefile variables above. -# -detaillist: - ${Q}-(echo "xxxxxxx"; \ - for i in ${SCRIPT}; do \ - if [ ! -f RCS/$$i.calc,v ]; then \ - echo "WARNING: $$i.calc not under RCS control" 1>&2; \ - else \ - echo $$i; \ - fi; \ - done | ${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 \ - if [ ! -f RCS/$$i.calc,v ]; then \ - echo "WARNING: $$i.calc not under RCS control" 1>&2; \ - else \ - echo $$i.calc; \ - fi; \ - done | ${SORT}) | ${FMT} -70 | \ - ${SED} -e '1s/xxxxxxxxxxx/SCRIPT_SRC=/' -e '2,$$s/^/ /' \ - -e 's/$$/ \\/' -e '$$s/ \\$$//' - -## -# -# Home grown make dependency rules. Your system make not support -# or have the needed tools. You can ignore this section. -# -# We will form a skelaton tree of *.c files containing only #include "foo.h" -# lines and .h files containing the same lines surrounded by multiple include -# prevention lines. This allows us to build a static depend list that will -# satisfy all possible cpp symbol definition combinations. -# -## - -depend: - ${Q}if [ -f Makefile.bak ]; then \ - echo "Makefile.bak exists, remove or move it out of the way"; \ - exit 1; \ - else \ - true; \ - fi - -${Q}rm -f makedep.out - ${Q}echo forming cscript dependency list - ${Q}echo "# DO NOT DELETE THIS LINE -- make depend depends on it." > \ - makedep.out - ${Q}echo "" >> makedep.out - ${Q}for i in ${SCRIPT}; do \ - echo "$$i: $$i.calc"; \ - echo ' rm -f $$@'; \ - echo ' $${SED} -e "1s:^#!/usr/local/src/cmd/calc/calc:#!$${BINDIR}/calc:" $$?>$$@'; \ - echo ' $${CHMOD} +x $$@'; \ - done >> makedep.out - ${Q}echo sample dependency list formed - ${Q}echo forming new cscript/Makefile - -${Q}rm -f Makefile.bak - ${Q}mv Makefile Makefile.bak - ${Q}${SED} -n '1,/^# DO NOT DELETE THIS LINE/p' Makefile.bak > Makefile - ${Q}echo "" >> Makefile - ${Q}${SED} -n '3,$$p' makedep.out >> Makefile - -${Q}rm -f makedep.out - -${Q}if cmp -s Makefile.bak Makefile; then \ - echo 'sample Makefile was already up to date'; \ - mv -f Makefile.bak Makefile; \ - else \ - rm -f Makefile.tmp; \ - mv Makefile Makefile.tmp; \ - if [ -d RCS ]; then \ - co -l Makefile; \ - fi; \ - mv Makefile.tmp Makefile; \ - if [ -d RCS ]; then \ - echo new sample Makefile formed, you need to check it in; \ - fi; \ - fi - -clean: - -rm -f makedep.out - -clobber: - -rm -f ${SCRIPT} - -install: all - -${Q}if [ ! -d ${BINDIR} ]; then \ - echo mkdir ${BINDIR}; \ - mkdir ${BINDIR}; \ - else \ - true; \ - fi - -${Q}if [ ! -d ${SCRIPTDIR} ]; then \ - echo mkdir ${SCRIPTDIR}; \ - mkdir ${SCRIPTDIR}; \ - else \ - true; \ - fi - ${Q}for i in ${SCRIPT}; do \ - echo rm -f ${SCRIPTDIR}/$$i; \ - rm -f ${SCRIPTDIR}/$$i; \ - echo cp $$i ${SCRIPTDIR}; \ - cp $$i ${SCRIPTDIR}; \ - echo ${CHMOD} 0555 ${SCRIPTDIR}/$$i; \ - ${CHMOD} 0555 ${SCRIPTDIR}/$$i; \ - done - -# DO NOT DELETE THIS LINE -- make depend depends on it. - -mersenne: mersenne.calc - rm -f $@ - ${SED} -e "1s:^#!/usr/local/src/cmd/calc/calc:#!${BINDIR}/calc:" $?>$@ - ${CHMOD} +x $@ -piforever: piforever.calc - rm -f $@ - ${SED} -e "1s:^#!/usr/local/src/cmd/calc/calc:#!${BINDIR}/calc:" $?>$@ - ${CHMOD} +x $@ -plus: plus.calc - rm -f $@ - ${SED} -e "1s:^#!/usr/local/src/cmd/calc/calc:#!${BINDIR}/calc:" $?>$@ - ${CHMOD} +x $@ -simple: simple.calc - rm -f $@ - ${SED} -e "1s:^#!/usr/local/src/cmd/calc/calc:#!${BINDIR}/calc:" $?>$@ - ${CHMOD} +x $@ diff --git a/cscript/mersenne.calc b/cscript/mersenne.calc deleted file mode 100644 index 21dfac9..0000000 --- a/cscript/mersenne.calc +++ /dev/null @@ -1,47 +0,0 @@ -#!/usr/local/src/cmd/calc/calc -S -# -# mersenne - print the value of a mersenne number -# -# Copyright (C) 1999 Landon Curt Noll -# -# Calc is open software; you can redistribute it and/or modify it under -# the terms of the version 2.1 of the GNU Lesser General Public License -# as published by the Free Software Foundation. -# -# Calc is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -# Public License for more details. -# -# A copy of version 2.1 of the GNU Lesser General Public License is -# distributed with calc under the filename COPYING-LGPL. You should have -# received a copy with calc; if not, write to Free Software Foundation, Inc. -# 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -# -# @(#) $Revision: 29.1 $ -# @(#) $Id: mersenne.calc,v 29.1 1999/12/14 09:15:35 chongo Exp $ -# @(#) $Source: /usr/local/src/cmd/calc/cscript/RCS/mersenne.calc,v $ -# -# Under source code control: 1999/11/30 00:09:01; -# File existed as early as: 1999 -# -# chongo /\oo/\ http://reality.sgi.com/chongo/ -# Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ - -# usage: -# mersenne exp - - -/* - * parse args - */ -if (argv() != 1) { - /* we include the name of this script in the error message */ - fprintf(files(2), "usage: %s exp\n", config("program")); - abort "wrong number of args"; -} - -/* - * print the decimal value of 2^n-1 - */ -print "2^": argv(0) : "-1 =", 2^eval(argv(0))-1; diff --git a/cscript/piforever.calc b/cscript/piforever.calc deleted file mode 100644 index 5cc848c..0000000 --- a/cscript/piforever.calc +++ /dev/null @@ -1,37 +0,0 @@ -#!/usr/local/src/cmd/calc/calc -S -# -# piforever - print digits of pi forever (or as long as your mem/cpu allow) -# -# Copyright (C) 1999 Landon Curt Noll -# -# Calc is open software; you can redistribute it and/or modify it under -# the terms of the version 2.1 of the GNU Lesser General Public License -# as published by the Free Software Foundation. -# -# Calc is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -# Public License for more details. -# -# A copy of version 2.1 of the GNU Lesser General Public License is -# distributed with calc under the filename COPYING-LGPL. You should have -# received a copy with calc; if not, write to Free Software Foundation, Inc. -# 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -# -# @(#) $Revision: 29.1 $ -# @(#) $Id: piforever.calc,v 29.1 1999/12/14 09:15:36 chongo Exp $ -# @(#) $Source: /usr/local/src/cmd/calc/cscript/RCS/piforever.calc,v $ -# -# Under source code control: 1999/11/30 00:11:36 -# File existed as early as: 1999 -# -# chongo /\oo/\ http://reality.sgi.com/chongo/ -# Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ - -# usage: -# piforever - - -read -once pi.cal -print "pi ~= ":; -piforever(); diff --git a/cscript/plus.calc b/cscript/plus.calc deleted file mode 100644 index efa3319..0000000 --- a/cscript/plus.calc +++ /dev/null @@ -1,53 +0,0 @@ -#!/usr/local/src/cmd/calc/calc -S -# -# plus - add two or more arguments together -# -# Copyright (C) 1999 Landon Curt Noll -# -# Calc is open software; you can redistribute it and/or modify it under -# the terms of the version 2.1 of the GNU Lesser General Public License -# as published by the Free Software Foundation. -# -# Calc is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -# Public License for more details. -# -# A copy of version 2.1 of the GNU Lesser General Public License is -# distributed with calc under the filename COPYING-LGPL. You should have -# received a copy with calc; if not, write to Free Software Foundation, Inc. -# 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -# -# @(#) $Revision: 29.1 $ -# @(#) $Id: plus.calc,v 29.1 1999/12/14 09:15:36 chongo Exp $ -# @(#) $Source: /usr/local/src/cmd/calc/cscript/RCS/plus.calc,v $ -# -# Under source code control: 1999/11/29 10:22:37 -# File existed as early as: 1999 -# -# chongo /\oo/\ http://reality.sgi.com/chongo/ -# Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ - -# usage: -# plus val ... - - -/* - * parse args - */ -if (argv() < 1) { - /* we include the name of this script in the error message */ - fprintf(files(2), "usage: %s value ...\n", config("program")); - abort "not enough args"; -} - -/* - * print the sum of the 2 args - * - * Since args are strings, we must eval them before using them numerically. - */ -sum = 0; -for (i=0; i < argv(); ++i) { - sum += eval(argv(i)); -} -print sum; diff --git a/cscript/simple.calc b/cscript/simple.calc deleted file mode 100644 index 61d975f..0000000 --- a/cscript/simple.calc +++ /dev/null @@ -1,35 +0,0 @@ -#!/usr/local/src/cmd/calc/calc -S -# -# simple - an example of a simple calc shell script -# -# Copyright (C) 1999 Landon Curt Noll -# -# Calc is open software; you can redistribute it and/or modify it under -# the terms of the version 2.1 of the GNU Lesser General Public License -# as published by the Free Software Foundation. -# -# Calc is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -# Public License for more details. -# -# A copy of version 2.1 of the GNU Lesser General Public License is -# distributed with calc under the filename COPYING-LGPL. You should have -# received a copy with calc; if not, write to Free Software Foundation, Inc. -# 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -# -# @(#) $Revision: 29.1 $ -# @(#) $Id: simple.calc,v 29.1 1999/12/14 09:15:36 chongo Exp $ -# @(#) $Source: /usr/local/src/cmd/calc/cscript/RCS/simple.calc,v $ -# -# Under source code control: 1999/11/29 10:22:37 -# File existed as early as: 1999 -# -# chongo /\oo/\ http://reality.sgi.com/chongo/ -# Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ - - -/* - * This is an example of a simple calc shell script. - */ -print "The simple calc shell script works!" diff --git a/custom.c b/custom.c index 7aa887c..49b51d3 100644 --- a/custom.c +++ b/custom.c @@ -1,34 +1,35 @@ /* - * custom - interface for custom software and hardware interfaces + * Copyright (c) 1997 by Landon Curt Noll. All Rights Reserved. * - * Copyright (C) 1999 Landon Curt Noll + * Permission to use, copy, modify, and distribute this software and + * its documentation for any purpose and without fee is hereby granted, + * provided that the above copyright, this permission notice and text + * this comment, and the disclaimer below appear in all of the following: * - * Calc is open software; you can redistribute it and/or modify it under - * the terms of the version 2.1 of the GNU Lesser General Public License - * as published by the Free Software Foundation. + * supporting documentation + * source copies + * source works derived from this source + * binaries derived from this source or from derived source * - * Calc is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General - * Public License for more details. + * LANDON CURT NOLL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO + * EVENT SHALL LANDON CURT NOLL BE LIABLE FOR ANY SPECIAL, INDIRECT OR + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF + * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR + * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. * - * A copy of version 2.1 of the GNU Lesser General Public License is - * distributed with calc under the filename COPYING-LGPL. You should have - * received a copy with calc; if not, write to Free Software Foundation, Inc. - * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. + * Comments, suggestions, bug fixes and questions about these routines + * are welcome. Send EMail to the address given below. * - * @(#) $Revision: 29.1 $ - * @(#) $Id: custom.c,v 29.1 1999/12/14 09:15:36 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/custom.c,v $ + * Happy bit twiddling, * - * Under source code control: 1997/03/03 04:53:08 - * File existed as early as: 1997 + * Landon Curt Noll + * http://reality.sgi.com/chongo/ * - * chongo /\oo/\ http://reality.sgi.com/chongo/ - * Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ + * chongo /\../\ */ - /* these include files are needed regardless of CUSTOM */ #include "have_const.h" #include "value.h" diff --git a/custom.h b/custom.h index 390e318..b76173c 100644 --- a/custom.h +++ b/custom.h @@ -1,31 +1,37 @@ /* - * custom - interface for custom software and hardware interfaces + * Copyright (c) 1997 by Landon Curt Noll. All Rights Reserved. * - * Copyright (C) 1999 Landon Curt Noll + * Permission to use, copy, modify, and distribute this software and + * its documentation for any purpose and without fee is hereby granted, + * provided that the above copyright, this permission notice and text + * this comment, and the disclaimer below appear in all of the following: * - * Calc is open software; you can redistribute it and/or modify it under - * the terms of the version 2.1 of the GNU Lesser General Public License - * as published by the Free Software Foundation. + * supporting documentation + * source copies + * source works derived from this source + * binaries derived from this source or from derived source * - * Calc is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General - * Public License for more details. + * LANDON CURT NOLL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO + * EVENT SHALL LANDON CURT NOLL BE LIABLE FOR ANY SPECIAL, INDIRECT OR + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF + * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR + * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. * - * A copy of version 2.1 of the GNU Lesser General Public License is - * distributed with calc under the filename COPYING-LGPL. You should have - * received a copy with calc; if not, write to Free Software Foundation, Inc. - * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. + * Prior to calc 2.9.3t9, these routines existed as a calc library called + * cryrand.cal. They have been rewritten in C for performance as well + * as to make them available directly from libcalc.a. * - * @(#) $Revision: 29.1 $ - * @(#) $Id: custom.h,v 29.1 1999/12/14 09:15:36 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/custom.h,v $ + * Comments, suggestions, bug fixes and questions about these routines + * are welcome. Send EMail to the address given below. * - * Under source code control: 1997/03/03 04:53:08 - * File existed as early as: 1997 + * Happy bit twiddling, * - * chongo /\oo/\ http://reality.sgi.com/chongo/ - * Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ + * Landon Curt Noll + * http://reality.sgi.com/chongo/ + * + * chongo /\../\ */ /* diff --git a/custom/CUSTOM_CAL b/custom/CUSTOM_CAL index e89b06a..aba52ce 100644 --- a/custom/CUSTOM_CAL +++ b/custom/CUSTOM_CAL @@ -1,11 +1,31 @@ -Custom calc resource files --------------------------- +# +# Copyright (c) 1999 Landon Curt Noll +# +# Permission to use, copy, modify, and distribute this software and +# its documentation for any purpose and without fee is hereby granted, +# provided that the above copyright, this permission notice and text +# this comment, and the disclaimer below appear in all of the following: +# +# supporting documentation +# source copies +# source works derived from this source +# binaries derived from this source or from derived source +# +# LANDON CURT NOLL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, +# INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO +# EVENT SHALL LANDON CURT NOLL BE LIABLE FOR ANY SPECIAL, INDIRECT OR +# CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF +# USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +# OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +# PERFORMANCE OF THIS SOFTWARE. +# +# chongo was here /\../\ http://reality.sgi.com/chongo/ -The following custom calc resource files are provided because they serve +The following custom calc library files are provided because they serve as examples of how use the custom interface. The custom interface allows for machine dependent and/or non-portable code to be added as builtins to the calc program. A few example custom functions and -resource files are shipped with calc to provide you with examples. +library files are shipped with calc to provide you with examples. By default, the custom builtin returns an error. Calc have been built with: @@ -19,8 +39,8 @@ must be invoked with a -C argument: when it is run. -See the ../cal/README or "help resource" for information about -calc resource standards and guidelines. +See the ../lib/README or "help stdlib" for information about +calc library standards and guidelines. =-= @@ -40,29 +60,3 @@ pzasusb8.cal Run custom("pzasusb8") on a standard set of data, print Endian related information and print value size information. - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: CUSTOM_CAL,v 29.1 1999/12/14 09:15:36 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/custom/RCS/CUSTOM_CAL,v $ -## -## Under source code control: 1997/03/08 20:51:32 -## File existed as early as: 1997 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/custom/HOW_TO_ADD b/custom/HOW_TO_ADD index 4b3ecc0..2781f58 100644 --- a/custom/HOW_TO_ADD +++ b/custom/HOW_TO_ADD @@ -1,5 +1,4 @@ Guidelines for adding custom functions --------------------------------------- Step 0: Determine if is should it be done? @@ -18,9 +17,9 @@ Step 0: Determine if is should it be done? So before you go to step 1, ask yourself: - + Can I implement this as a calc resource file or calc shell script? + + Can I implement this as a calc library script? - If Yes, write the shell script or resource file and be done with it. + If Yes, write the script and be done with it. If No, continue to the next question ... + Does it require the use of non-portable features, @@ -618,29 +617,3 @@ Step 12: Contribute and consider submitting your custom function for possible inclusion in later versions of calc. - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: HOW_TO_ADD,v 29.1 1999/12/14 09:15:36 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/custom/RCS/HOW_TO_ADD,v $ -## -## Under source code control: 1997/03/10 03:03:21 -## File existed as early as: 1997 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/custom/Makefile b/custom/Makefile index f277ec8..16dab8d 100644 --- a/custom/Makefile +++ b/custom/Makefile @@ -1,44 +1,43 @@ -#!/bin/make # # custom - makefile for calc custom routines # -# Copyright (C) 1999 Landon Curt Noll +# Copyright (c) 1997 Landon Curt Noll # -# Calc is open software; you can redistribute it and/or modify it under -# the terms of the version 2.1 of the GNU Lesser General Public License -# as published by the Free Software Foundation. +# Permission to use, copy, modify, and distribute this software and +# its documentation for any purpose and without fee is hereby granted, +# provided that the above copyright, this permission notice and text +# this comment, and the disclaimer below appear in all of the following: # -# Calc is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -# Public License for more details. +# supporting documentation +# source copies +# source works derived from this source +# binaries derived from this source or from derived source # -# A copy of version 2.1 of the GNU Lesser General Public License is -# distributed with calc under the filename COPYING-LGPL. You should have -# received a copy with calc; if not, write to Free Software Foundation, Inc. -# 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. +# LANDON CURT NOLL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, +# INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO +# EVENT SHALL LANDON CURT NOLL BE LIABLE FOR ANY SPECIAL, INDIRECT OR +# CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF +# USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +# OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +# PERFORMANCE OF THIS SOFTWARE. # -# @(#) $Revision: 29.1 $ -# @(#) $Id: Makefile,v 29.1 1999/12/14 09:15:36 chongo Exp $ -# @(#) $Source: /usr/local/src/cmd/calc/custom/RCS/Makefile,v $ +# Comments, suggestions, bug fixes and questions about these routines +# are welcome. Send EMail to the address given below. # -# Under source code control: 1997/03/09 02:28:54 -# File existed as early as: 1997 +# Happy bit twiddling, # -# chongo /\oo/\ http://reality.sgi.com/chongo/ -# Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ +# Landon Curt Noll +# http://reality.sgi.com/chongo/ # -# calculator by David I. Bell with help/mods from others -# Makefile by Landon Curt Noll - +# chongo /\../\ ############################################################################## #-=-=-=-=-=-=-=-=- You may want to change some values below -=-=-=-=-=-=-=-=-# ############################################################################## -# The custom calc resource files to install +# The custom calc library files to install # -# Put your custom calc resource files here. +# Put your custom calc library files here. # CUSTOM_CALC_FILES= argv.cal halflen.cal pzasusb8.cal @@ -159,7 +158,7 @@ NO_SHARED= # a default here just in case you want to build from this directory. # # Some systems require one to use ranlib to add a symbol table to -# a *.a link library. Set RANLIB to the utility that performs this action. +# a *.a library. Set RANLIB to the utility that performs this action. # Set RANLIB to : if your system does not need such a utility. # #RANLIB=ranlib @@ -218,6 +217,7 @@ ALLOW_CUSTOM= -DCUSTOM # CFLAGS are all flags given to ${CC} [[often includes CCOPT, CCWARN, CCMISC]] # ICFLAGS are given to ${CC} for intermediate progs # +# LCFLAGS are CC-style flags for ${LINT} # LDFLAGS are flags given to ${CC} for linking .o files # ILDFLAGS are flags given to ${CC} for linking .o files for intermediate progs # @@ -234,6 +234,7 @@ CCMISC= CFLAGS= ${CCWARN} ${CCOPT} ${CCMISC} ${ALLOW_CUSTOM} ICFLAGS= ${CCWARN} ${CCMISC} # +LCFLAGS= LDFLAGS= ${NO_SHARED} ${LD_NO_SHARED} ILDFLAGS= # @@ -284,7 +285,7 @@ H_SRC= ${CUSTOM_H_SRC} DISTLIST= ${CUSTCALC_SRC} ${CUSTOM_CALC_FILES} ${CUSTOM_HELP} \ ${INSTALL_H_SRC} CUSTOM_CAL HOW_TO_ADD ${MAKE_FILE} -# These files are used to make (but not built) a calc .a link library +# These files are used to make (but not built) a calc .a library # CALCLIBLIST= ${CUSTCALC_SRC} ${INSTALL_H_SRC} ${MAKE_FILE} HOW_TO_ADD @@ -294,14 +295,9 @@ TARGETS= libcustcalc.a ${CUSTCALC_OBJ} # required vars # -SHELL= /bin/sh -MAKE_FILE= Makefile - -# standard tools -# +SHELL = /bin/sh SED= sed MAKEDEPEND= makedepend -CHMOD= chmod SORT= sort ## @@ -496,32 +492,32 @@ install: all rm -f ${CUSTOMLIBDIR}/$$i; \ echo cp $$i ${CUSTOMLIBDIR}; \ cp $$i ${CUSTOMLIBDIR}; \ - echo ${CHMOD} 0444 ${CUSTOMLIBDIR}/$$i; \ - ${CHMOD} 0444 ${CUSTOMLIBDIR}/$$i; \ + echo chmod 0444 ${CUSTOMLIBDIR}/$$i; \ + chmod 0444 ${CUSTOMLIBDIR}/$$i; \ done ${Q}for i in ${CUSTOM_CALC_FILES}; do \ echo rm -f ${CUSTOMLIBDIR}/$$i; \ rm -f ${CUSTOMLIBDIR}/$$i; \ echo cp $$i ${CUSTOMLIBDIR}; \ cp $$i ${CUSTOMLIBDIR}; \ - echo ${CHMOD} 0444 ${CUSTOMLIBDIR}/$$i; \ - ${CHMOD} 0444 ${CUSTOMLIBDIR}/$$i; \ + echo chmod 0444 ${CUSTOMLIBDIR}/$$i; \ + chmod 0444 ${CUSTOMLIBDIR}/$$i; \ done ${Q}for i in ${CUSTOM_HELP}; do \ echo rm -f ${CUSTOMHELPDIR}/$$i; \ rm -f ${CUSTOMHELPDIR}/$$i; \ echo cp $$i ${CUSTOMHELPDIR}; \ cp $$i ${CUSTOMHELPDIR}; \ - echo ${CHMOD} 0444 ${CUSTOMHELPDIR}/$$i; \ - ${CHMOD} 0444 ${CUSTOMHELPDIR}/$$i; \ + echo chmod 0444 ${CUSTOMHELPDIR}/$$i; \ + chmod 0444 ${CUSTOMHELPDIR}/$$i; \ done -${Q}if [ ! -z ${ALLOW_CUSTOM} ]; then \ echo "rm -f ${CUSTOMLIBDIR}/libcustcalc.a"; \ rm -f ${CUSTOMLIBDIR}/libcustcalc.a; \ echo "cp libcustcalc.a ${CUSTOMLIBDIR}/libcustcalc.a"; \ cp libcustcalc.a ${CUSTOMLIBDIR}/libcustcalc.a; \ - echo "${CHMOD} 0644 ${CUSTOMLIBDIR}/libcustcalc.a"; \ - ${CHMOD} 0644 ${CUSTOMLIBDIR}/libcustcalc.a; \ + echo "chmod 0644 ${CUSTOMLIBDIR}/libcustcalc.a"; \ + chmod 0644 ${CUSTOMLIBDIR}/libcustcalc.a; \ echo "${RANLIB} ${CUSTOMLIBDIR}/libcustcalc.a"; \ ${RANLIB} ${CUSTOMLIBDIR}/libcustcalc.a; \ fi diff --git a/custom/argv b/custom/argv index 1ed89ae..677cfb0 100644 --- a/custom/argv +++ b/custom/argv @@ -39,29 +39,3 @@ LIBRARY SEE ALSO custom - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: argv,v 29.1 1999/12/14 09:15:36 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/custom/RCS/argv,v $ -## -## Under source code control: 1997/03/09 20:28:01 -## File existed as early as: 1997 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/custom/argv.cal b/custom/argv.cal index 18d3742..48c0e85 100644 --- a/custom/argv.cal +++ b/custom/argv.cal @@ -1,41 +1,25 @@ +/* + * Permission to use, copy, modify, and distribute this software and + * its documentation for any purpose and without fee is hereby granted. + * + * LANDON CURT NOLL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO + * EVENT SHALL LANDON CURT NOLL BE LIABLE FOR ANY SPECIAL, INDIRECT OR + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF + * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR + * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. + * + * chongo was here /\../\ http://reality.sgi.com/chongo/ + */ /* * argv - print information about various args * - * Copyright (C) 1999 Landon Curt Noll - * - * Calc is open software; you can redistribute it and/or modify it under - * the terms of the version 2.1 of the GNU Lesser General Public License - * as published by the Free Software Foundation. - * - * Calc is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General - * Public License for more details. - * - * A copy of version 2.1 of the GNU Lesser General Public License is - * distributed with calc under the filename COPYING-LGPL. You should have - * received a copy with calc; if not, write to Free Software Foundation, Inc. - * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. - * - * @(#) $Revision: 29.1 $ - * @(#) $Id: argv.cal,v 29.1 1999/12/14 09:15:36 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/custom/RCS/argv.cal,v $ - * - * Under source code control: 1997/03/10 00:27:17 - * File existed as early as: 1997 - * - * chongo /\oo/\ http://reality.sgi.com/chongo/ - * Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ - */ - -/* * This file is part of the custom sample calc files. * * NOTE: You must use a calc that was compiled with ALLOW_CUSTOM= -DCUSTOM * and run with a -C arg. */ - - define argv() { local i; /* arg number */ @@ -55,6 +39,6 @@ define argv() return i-1; } -if (config("resource_debug") >= 0) { +if (config("lib_debug") >= 0) { print "argv(var, ...) defined"; } diff --git a/custom/c_argv.c b/custom/c_argv.c index 7ece59a..754c73d 100644 --- a/custom/c_argv.c +++ b/custom/c_argv.c @@ -1,34 +1,26 @@ /* - * c_argv - a custom function display info about its args + * Permission to use, copy, modify, and distribute this software and + * its documentation for any purpose and without fee is hereby granted. * - * Copyright (C) 1999 Landon Curt Noll + * LANDON CURT NOLL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO + * EVENT SHALL LANDON CURT NOLL BE LIABLE FOR ANY SPECIAL, INDIRECT OR + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF + * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR + * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. * - * Calc is open software; you can redistribute it and/or modify it under - * the terms of the version 2.1 of the GNU Lesser General Public License - * as published by the Free Software Foundation. + * Comments, suggestions, bug fixes and questions about these routines + * are welcome. Send EMail to the address given below. * - * Calc is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General - * Public License for more details. + * Happy bit twiddling, * - * A copy of version 2.1 of the GNU Lesser General Public License is - * distributed with calc under the filename COPYING-LGPL. You should have - * received a copy with calc; if not, write to Free Software Foundation, Inc. - * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. + * Landon Curt Noll + * http://reality.sgi.com/chongo/ * - * @(#) $Revision: 29.1 $ - * @(#) $Id: c_argv.c,v 29.1 1999/12/14 09:15:36 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/custom/RCS/c_argv.c,v $ - * - * Under source code control: 1997/03/09 20:27:37 - * File existed as early as: 1997 - * - * chongo /\oo/\ http://reality.sgi.com/chongo/ - * Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ + * chongo /\../\ */ - #if defined(CUSTOM) #include diff --git a/custom/c_devnull.c b/custom/c_devnull.c index e84776d..22188b8 100644 --- a/custom/c_devnull.c +++ b/custom/c_devnull.c @@ -1,34 +1,26 @@ /* - * c_devnull - a custom function that does nothing + * Permission to use, copy, modify, and distribute this software and + * its documentation for any purpose and without fee is hereby granted. * - * Copyright (C) 1999 Landon Curt Noll + * LANDON CURT NOLL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO + * EVENT SHALL LANDON CURT NOLL BE LIABLE FOR ANY SPECIAL, INDIRECT OR + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF + * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR + * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. * - * Calc is open software; you can redistribute it and/or modify it under - * the terms of the version 2.1 of the GNU Lesser General Public License - * as published by the Free Software Foundation. + * Comments, suggestions, bug fixes and questions about these routines + * are welcome. Send EMail to the address given below. * - * Calc is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General - * Public License for more details. + * Happy bit twiddling, * - * A copy of version 2.1 of the GNU Lesser General Public License is - * distributed with calc under the filename COPYING-LGPL. You should have - * received a copy with calc; if not, write to Free Software Foundation, Inc. - * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. + * Landon Curt Noll + * http://reality.sgi.com/chongo/ * - * @(#) $Revision: 29.1 $ - * @(#) $Id: c_devnull.c,v 29.1 1999/12/14 09:15:37 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/custom/RCS/c_devnull.c,v $ - * - * Under source code control: 1997/03/09 17:49:12 - * File existed as early as: 1997 - * - * chongo /\oo/\ http://reality.sgi.com/chongo/ - * Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ + * chongo /\../\ */ - #if defined(CUSTOM) diff --git a/custom/c_help.c b/custom/c_help.c index f402021..094ec72 100644 --- a/custom/c_help.c +++ b/custom/c_help.c @@ -1,34 +1,26 @@ /* - * c_help - custom help function + * Permission to use, copy, modify, and distribute this software and + * its documentation for any purpose and without fee is hereby granted. * - * Copyright (C) 1999 Landon Curt Noll + * LANDON CURT NOLL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO + * EVENT SHALL LANDON CURT NOLL BE LIABLE FOR ANY SPECIAL, INDIRECT OR + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF + * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR + * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. * - * Calc is open software; you can redistribute it and/or modify it under - * the terms of the version 2.1 of the GNU Lesser General Public License - * as published by the Free Software Foundation. + * Comments, suggestions, bug fixes and questions about these routines + * are welcome. Send EMail to the address given below. * - * Calc is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General - * Public License for more details. + * Happy bit twiddling, * - * A copy of version 2.1 of the GNU Lesser General Public License is - * distributed with calc under the filename COPYING-LGPL. You should have - * received a copy with calc; if not, write to Free Software Foundation, Inc. - * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. + * Landon Curt Noll + * http://reality.sgi.com/chongo/ * - * @(#) $Revision: 29.1 $ - * @(#) $Id: c_help.c,v 29.1 1999/12/14 09:15:37 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/custom/RCS/c_help.c,v $ - * - * Under source code control: 1997/03/09 05:25:41 - * File existed as early as: 1997 - * - * chongo /\oo/\ http://reality.sgi.com/chongo/ - * Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ + * chongo /\../\ */ - #if defined(CUSTOM) diff --git a/custom/c_pzasusb8.c b/custom/c_pzasusb8.c index 383e081..29c9eba 100644 --- a/custom/c_pzasusb8.c +++ b/custom/c_pzasusb8.c @@ -1,33 +1,10 @@ /* - * c_pzasusb8 - print numereator as a string of USB8s + * Permission to use, copy, modify, and distribute this software and + * its documentation for any purpose and without fee is hereby granted. * - * Copyright (C) 1999 Ernest Bowen - * - * Calc is open software; you can redistribute it and/or modify it under - * the terms of the version 2.1 of the GNU Lesser General Public License - * as published by the Free Software Foundation. - * - * Calc is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General - * Public License for more details. - * - * A copy of version 2.1 of the GNU Lesser General Public License is - * distributed with calc under the filename COPYING-LGPL. You should have - * received a copy with calc; if not, write to Free Software Foundation, Inc. - * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. - * - * @(#) $Revision: 29.1 $ - * @(#) $Id: c_pzasusb8.c,v 29.1 1999/12/14 09:15:37 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/custom/RCS/c_pzasusb8.c,v $ - * - * Under source code control: 1999/10/06 03:12:25 - * File existed as early as: 1999 - * - * Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ + * Ernest Bowen, following Landon Curt Noll */ - #if defined(CUSTOM) #include @@ -38,7 +15,8 @@ #include "../zmath.h" /* - * c_pzasusb8 - print numereator as a string of USB8s + * c_pzasusb8 - print numereator of real as if its array of HALFs were + * a string of USB8s * * given: * count = 1; diff --git a/custom/c_sysinfo.c b/custom/c_sysinfo.c index 8cb5491..ec39512 100644 --- a/custom/c_sysinfo.c +++ b/custom/c_sysinfo.c @@ -1,34 +1,26 @@ /* - * c_sysinfo - names and values of selected #defines + * Permission to use, copy, modify, and distribute this software and + * its documentation for any purpose and without fee is hereby granted. * - * Copyright (C) 1999 Landon Curt Noll + * LANDON CURT NOLL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO + * EVENT SHALL LANDON CURT NOLL BE LIABLE FOR ANY SPECIAL, INDIRECT OR + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF + * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR + * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. * - * Calc is open software; you can redistribute it and/or modify it under - * the terms of the version 2.1 of the GNU Lesser General Public License - * as published by the Free Software Foundation. + * Comments, suggestions, bug fixes and questions about these routines + * are welcome. Send EMail to the address given below. * - * Calc is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General - * Public License for more details. + * Happy bit twiddling, * - * A copy of version 2.1 of the GNU Lesser General Public License is - * distributed with calc under the filename COPYING-LGPL. You should have - * received a copy with calc; if not, write to Free Software Foundation, Inc. - * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. + * Landon Curt Noll + * http://reality.sgi.com/chongo/ * - * @(#) $Revision: 29.1 $ - * @(#) $Id: c_sysinfo.c,v 29.1 1999/12/14 09:15:37 chongo Exp chongo $ - * @(#) $Source: /usr/local/src/cmd/calc/custom/RCS/c_sysinfo.c,v $ - * - * Under source code control: 1997/03/09 23:14:40 - * File existed as early as: 1997 - * - * chongo /\oo/\ http://reality.sgi.com/chongo/ - * Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ + * chongo /\../\ */ - #if defined(CUSTOM) #include @@ -73,6 +65,7 @@ static struct infoname sys_info[] = { {"BLK_CHUNKSIZE", "default allocation chunk size for blocks", NULL, (FULL)BLK_CHUNKSIZE}, {"BLK_DEF_MAXPRINT", "default block octets to print", NULL, (FULL)BLK_DEF_MAXPRINT}, {"BLUM_PREGEN", "non-default predefined Blum generators", NULL, (FULL)BLUM_PREGEN}, + {"BOOL_B64", "if we have 64 bit type (TRUE or FALSE)", NULL, (FULL)BOOL_B64}, {"CALCEXT", "extension for files read in", CALCEXT, (FULL)0}, {"CALC_BYTE_ORDER", "Byte order (LITTLE_ENDIAN or BIG_ENDIAN)", NULL, (FULL)CALC_BYTE_ORDER}, {"CUSTOMHELPDIR", "location of the custom help directory", CUSTOMHELPDIR, (FULL)0}, @@ -84,7 +77,7 @@ static struct infoname sys_info[] = { {"DEFAULTSHELL", "default shell to use", DEFAULTSHELL, (FULL)0}, {"DEV_BITS", "device number size in bits", NULL, (FULL)DEV_BITS}, {"DISPLAY_DEFAULT", "default digits for float display", NULL, (FULL)DISPLAY_DEFAULT}, - {"ECHO_PROG", "where the echo command is located", ECHO_PROG, (FULL)0}, + {"ECHO", "where the echo command is located", ECHO, (FULL)0}, {"EPSILONPREC_DEFAULT", "2^-EPSILON_DEFAULT <= EPSILON_DEFAULT", NULL, (FULL)EPSILONPREC_DEFAULT}, {"EPSILON_DEFAULT", "allowed error for float calculations", EPSILON_DEFAULT, (FULL)0}, {"ERRMAX", "default errmax value", NULL, (FULL)ERRMAX}, @@ -314,12 +307,14 @@ static void dump_name_value(void) { struct infoname *p; /* current infoname */ + char *fmt; /* printf value format */ /* dump the entire table */ for (p = sys_info; p->name != NULL; ++p) { if (p->str == NULL) { #if LONG_BITS == FULL_BITS || FULL_BITS == 32 || !defined(HAVE_LONGLONG) - printf("%s%-23s\t%-8lu\t(0x%lx)\n", + fmt = "%s%-23s\t%-8lu\t(0x%lx)\n"; + printf(fmt, (conf->tab_ok ? "\t" : ""), p->name, (unsigned long)p->nmbr, (unsigned long)p->nmbr); @@ -331,17 +326,17 @@ dump_name_value(void) * a 64 bit value do not support the %lld type. * So we will only try %lld if %ld does not work. */ -# if defined(L64_FORMAT) - printf("%s%-23s\t%-8lu\t(0x%lx)\n", + if (l_format < 0) { + /* %ld prints lower 32 bits only, use %lld */ + fmt = "%s%-23s\t%-8llu\t(0x%llx)\n"; + } else { + /* %ld prints all 64 bits, use %ld */ + fmt = "%s%-23s\t%-8lu\t(0x%lx)\n"; + } + printf(fmt, (conf->tab_ok ? "\t" : ""), p->name, (unsigned long long)p->nmbr, (unsigned long long)p->nmbr); -# else /* L64_FORMAT */ - printf("%s%-23s\t%-8llu\t(0x%llx)\n", - (conf->tab_ok ? "\t" : ""), p->name, - (unsigned long long)p->nmbr, - (unsigned long long)p->nmbr); -# endif /* L64_FORMAT */ #endif } else { printf("%s%-23s\t\"%s\"\n", @@ -359,29 +354,36 @@ static void dump_mening_value(void) { struct infoname *p; /* current infoname */ + char *fmt; /* printf value format */ /* dump the entire table */ for (p = sys_info; p->name != NULL; ++p) { if (p->str == NULL) { #if LONG_BITS == FULL_BITS || FULL_BITS == 32 || !defined(HAVE_LONGLONG) - printf("%s%-36.36s\t%-8lu\t(0x%lx)\n", + fmt = "%s%-36.36s\t%-8lu\t(0x%lx)\n"; + printf(fmt, (conf->tab_ok ? "\t" : ""), p->meaning, (unsigned long)p->nmbr, (unsigned long)p->nmbr); #else -# if defined(L64_FORMAT) - /* %ld prints all 64 bits, use %ld */ - printf("%s%-36.36s\t%-8lu\t(0x%lx)\n", + /* + * Determine of %ld can print a 64 bit long long. + * + * Some systems that can make use of %ld to print a + * a 64 bit value do not support the %lld type. + * So we will only try %lld if %ld does not work. + */ + if (l_format < 0) { + /* %ld prints lower 32 bits only, use %lld */ + fmt = "%s%-36.36s\t%-8llu\t(0x%llx)\n"; + } else { + /* %ld prints all 64 bits, use %ld */ + fmt = "%s%-36.36s\t%-8lu\t(0x%lx)\n"; + } + printf(fmt, (conf->tab_ok ? "\t" : ""), p->meaning, (unsigned long long)p->nmbr, (unsigned long long)p->nmbr); -# else /* L64_FORMAT */ - /* %ld prints lower 32 bits only, use %lld */ - printf("%s%-36.36s\t%-8llu\t(0x%llx)\n", - (conf->tab_ok ? "\t" : ""), p->meaning, - (unsigned long long)p->nmbr, - (unsigned long long)p->nmbr); -# endif /* L64_FORMAT */ #endif } else { printf("%s%-36.36s\t\"%s\"\n", diff --git a/custom/custtbl.c b/custom/custtbl.c index 3c57fa4..ff878d2 100644 --- a/custom/custtbl.c +++ b/custom/custtbl.c @@ -1,31 +1,33 @@ /* - * custtbl - custom interface table + * Copyright (c) 1997 by Landon Curt Noll. All Rights Reserved. * - * Copyright (C) 1999 Landon Curt Noll + * Permission to use, copy, modify, and distribute this software and + * its documentation for any purpose and without fee is hereby granted, + * provided that the above copyright, this permission notice and text + * this comment, and the disclaimer below appear in all of the following: * - * Calc is open software; you can redistribute it and/or modify it under - * the terms of the version 2.1 of the GNU Lesser General Public License - * as published by the Free Software Foundation. + * supporting documentation + * source copies + * source works derived from this source + * binaries derived from this source or from derived source * - * Calc is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General - * Public License for more details. + * LANDON CURT NOLL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO + * EVENT SHALL LANDON CURT NOLL BE LIABLE FOR ANY SPECIAL, INDIRECT OR + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF + * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR + * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. * - * A copy of version 2.1 of the GNU Lesser General Public License is - * distributed with calc under the filename COPYING-LGPL. You should have - * received a copy with calc; if not, write to Free Software Foundation, Inc. - * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. + * Comments, suggestions, bug fixes and questions about these routines + * are welcome. Send EMail to the address given below. * - * @(#) $Revision: 29.1 $ - * @(#) $Id: custtbl.c,v 29.1 1999/12/14 09:15:37 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/custom/RCS/custtbl.c,v $ + * Happy bit twiddling, * - * Under source code control: 1997/03/09 02:28:54 - * File existed as early as: 1997 + * Landon Curt Noll + * http://reality.sgi.com/chongo/ * - * chongo /\oo/\ http://reality.sgi.com/chongo/ - * Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ + * chongo /\../\ */ diff --git a/custom/devnull b/custom/devnull index c413acf..e18eb47 100644 --- a/custom/devnull +++ b/custom/devnull @@ -25,29 +25,3 @@ LIBRARY SEE ALSO custom - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: devnull,v 29.1 1999/12/14 09:15:37 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/custom/RCS/devnull,v $ -## -## Under source code control: 1997/03/09 17:49:12 -## File existed as early as: 1997 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/custom/halflen.cal b/custom/halflen.cal index d917be5..e70822e 100644 --- a/custom/halflen.cal +++ b/custom/halflen.cal @@ -1,41 +1,25 @@ +/* + * Permission to use, copy, modify, and distribute this software and + * its documentation for any purpose and without fee is hereby granted. + * + * LANDON CURT NOLL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO + * EVENT SHALL LANDON CURT NOLL BE LIABLE FOR ANY SPECIAL, INDIRECT OR + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF + * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR + * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. + * + * chongo was here /\../\ http://reality.sgi.com/chongo/ + */ /* * halflen - determine the length of numeric value in HALFs * - * Copyright (C) 1999 Landon Curt Noll - * - * Calc is open software; you can redistribute it and/or modify it under - * the terms of the version 2.1 of the GNU Lesser General Public License - * as published by the Free Software Foundation. - * - * Calc is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General - * Public License for more details. - * - * A copy of version 2.1 of the GNU Lesser General Public License is - * distributed with calc under the filename COPYING-LGPL. You should have - * received a copy with calc; if not, write to Free Software Foundation, Inc. - * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. - * - * @(#) $Revision: 29.1 $ - * @(#) $Id: halflen.cal,v 29.1 1999/12/14 09:15:37 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/custom/RCS/halflen.cal,v $ - * - * Under source code control: 1997/03/08 20:51:32 - * File existed as early as: 1997 - * - * chongo /\oo/\ http://reality.sgi.com/chongo/ - * Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ - */ - -/* * This file is part of the custom sample calc files. * * NOTE: You must use a calc that was compiled with ALLOW_CUSTOM= -DCUSTOM * and run with a -C arg. */ - - define halflen(num) { local baseb = custom("sysinfo","BASEB"); /* bit len of a HALF */ @@ -64,6 +48,6 @@ define halflen(num) } } -if (config("resource_debug") >= 0) { +if (config("lib_debug") >= 0) { print "halflen(num) defined"; } diff --git a/custom/help b/custom/help index 621cf37..4be92de 100644 --- a/custom/help +++ b/custom/help @@ -26,29 +26,3 @@ LIBRARY SEE ALSO custom - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: help,v 29.1 1999/12/14 09:15:37 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/custom/RCS/help,v $ -## -## Under source code control: 1997/03/09 06:03:58 -## File existed as early as: 1997 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/custom/pzasusb8 b/custom/pzasusb8 index 5fb260c..f1f4565 100644 --- a/custom/pzasusb8 +++ b/custom/pzasusb8 @@ -48,29 +48,3 @@ LIBRARY SEE ALSO custom - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: pzasusb8,v 29.1 1999/12/14 09:15:37 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/custom/RCS/pzasusb8,v $ -## -## Under source code control: 1999/10/06 04:05:43 -## File existed as early as: 1999 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/custom/pzasusb8.cal b/custom/pzasusb8.cal index 99a5893..8057458 100644 --- a/custom/pzasusb8.cal +++ b/custom/pzasusb8.cal @@ -1,36 +1,10 @@ /* - * pzasusb8 - print numereator as a string of USB8s + * Permission to use, copy, modify, and distribute this software and + * its documentation for any purpose and without fee is hereby granted. * - * Copyright (C) 1999 Ernest Bowen and Landon Curt Noll - * - * Primary author: Ernest Bowen - * - * Calc is open software; you can redistribute it and/or modify it under - * the terms of the version 2.1 of the GNU Lesser General Public License - * as published by the Free Software Foundation. - * - * Calc is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General - * Public License for more details. - * - * A copy of version 2.1 of the GNU Lesser General Public License is - * distributed with calc under the filename COPYING-LGPL. You should have - * received a copy with calc; if not, write to Free Software Foundation, Inc. - * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. - * - * @(#) $Revision: 29.1 $ - * @(#) $Id: pzasusb8.cal,v 29.1 1999/12/14 09:15:37 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/custom/RCS/pzasusb8.cal,v $ - * - * Under source code control: 1999/10/06 03:11:12 - * File existed as early as: 1998 - * - * chongo /\oo/\ http://reality.sgi.com/chongo/ - * Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ + * Ernest Bowen, following Landon Curt Noll */ - print "p(n) prints array in which numerator of n is stored as a"; print "sequence of 2-hex-digits representing unsigned characters."; print "h(n) printx n in hex notation. This should be the same as"; diff --git a/custom/sysinfo b/custom/sysinfo index de10f48..17560ff 100644 --- a/custom/sysinfo +++ b/custom/sysinfo @@ -52,29 +52,3 @@ LIBRARY SEE ALSO custom - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: sysinfo,v 29.1 1999/12/14 09:15:37 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/custom/RCS/sysinfo,v $ -## -## Under source code control: 1997/03/09 23:14:40 -## File existed as early as: 1997 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/endian.c b/endian.c index f930713..8669026 100644 --- a/endian.c +++ b/endian.c @@ -1,38 +1,32 @@ /* - * endian - determine the byte order of a long on your machine + * endian - Determine the byte order of a long on your machine. * - * Copyright (C) 1999 Landon Curt Noll - * - * Calc is open software; you can redistribute it and/or modify it under - * the terms of the version 2.1 of the GNU Lesser General Public License - * as published by the Free Software Foundation. - * - * Calc is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General - * Public License for more details. - * - * A copy of version 2.1 of the GNU Lesser General Public License is - * distributed with calc under the filename COPYING-LGPL. You should have - * received a copy with calc; if not, write to Free Software Foundation, Inc. - * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. - * - * @(#) $Revision: 29.1 $ - * @(#) $Id: endian.c,v 29.1 1999/12/14 09:15:37 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/endian.c,v $ - * - * Under source code control: 1993/11/15 04:32:58 - * File existed as early as: 1993 - * - * chongo /\oo/\ http://reality.sgi.com/chongo/ - * Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ - */ - -/* * Big Endian: Amdahl, 68k, Pyramid, Mips, Sparc, ... * Little Endian: Vax, 32k, Spim (Dec Mips), i386, i486, ... */ - +/* + * Copyright (c) 1993 by Landon Curt Noll. All Rights Reserved. + * + * Permission to use, copy, modify, and distribute this software and + * its documentation for any purpose and without fee is hereby granted, + * provided that the above copyright, this permission notice and text + * this comment, and the disclaimer below appear in all of the following: + * + * supporting documentation + * source copies + * source works derived from this source + * binaries derived from this source or from derived source + * + * LANDON CURT NOLL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO + * EVENT SHALL LANDON CURT NOLL BE LIABLE FOR ANY SPECIAL, INDIRECT OR + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF + * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR + * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. + * + * chongo was here /\../\ + */ #include diff --git a/file.c b/file.c index 5d78cf3..d78f364 100644 --- a/file.c +++ b/file.c @@ -1,36 +1,11 @@ /* - * file - file I/O routines callable by users + * Copyright (c) 1997 David I. Bell + * Permission is granted to use, distribute, or modify this source, + * provided that this copyright notice remains intact. * - * Copyright (C) 1999 David I. Bell and Landon Curt Noll - * - * Primary author: David I. Bell - * - * Calc is open software; you can redistribute it and/or modify it under - * the terms of the version 2.1 of the GNU Lesser General Public License - * as published by the Free Software Foundation. - * - * Calc is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General - * Public License for more details. - * - * A copy of version 2.1 of the GNU Lesser General Public License is - * distributed with calc under the filename COPYING-LGPL. You should have - * received a copy with calc; if not, write to Free Software Foundation, Inc. - * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. - * - * @(#) $Revision: 29.1 $ - * @(#) $Id: file.c,v 29.1 1999/12/14 09:15:37 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/file.c,v $ - * - * Under source code control: 1991/07/20 00:21:56 - * File existed as early as: 1991 - * - * chongo /\oo/\ http://reality.sgi.com/chongo/ - * Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ + * File I/O routines callable by users. */ - #include #include #include diff --git a/file.h b/file.h index c4f9c37..79e3c10 100644 --- a/file.h +++ b/file.h @@ -1,33 +1,9 @@ /* - * file - file I/O routines callable by users + * Copyright (c) 1997 David I. Bell + * Permission is granted to use, distribute, or modify this source, + * provided that this copyright notice remains intact. * - * Copyright (C) 1999 David I. Bell and Landon Curt Noll - * - * Primary author: David I. Bell - * - * Calc is open software; you can redistribute it and/or modify it under - * the terms of the version 2.1 of the GNU Lesser General Public License - * as published by the Free Software Foundation. - * - * Calc is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General - * Public License for more details. - * - * A copy of version 2.1 of the GNU Lesser General Public License is - * distributed with calc under the filename COPYING-LGPL. You should have - * received a copy with calc; if not, write to Free Software Foundation, Inc. - * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. - * - * @(#) $Revision: 29.1 $ - * @(#) $Id: file.h,v 29.1 1999/12/14 09:15:37 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/file.h,v $ - * - * Under source code control: 1996/05/24 05:55:58 - * File existed as early as: 1996 - * - * chongo /\oo/\ http://reality.sgi.com/chongo/ - * Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ + * File I/O routines callable by users. */ diff --git a/fposval.c b/fposval.c index 30b1297..c6ea292 100644 --- a/fposval.c +++ b/fposval.c @@ -1,34 +1,6 @@ /* * fposval - Determine information about the file position type * - * Copyright (C) 1999 Landon Curt Noll - * - * Calc is open software; you can redistribute it and/or modify it under - * the terms of the version 2.1 of the GNU Lesser General Public License - * as published by the Free Software Foundation. - * - * Calc is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General - * Public License for more details. - * - * A copy of version 2.1 of the GNU Lesser General Public License is - * distributed with calc under the filename COPYING-LGPL. You should have - * received a copy with calc; if not, write to Free Software Foundation, Inc. - * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. - * - * @(#) $Revision: 29.1 $ - * @(#) $Id: fposval.c,v 29.1 1999/12/14 09:15:38 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/fposval.c,v $ - * - * Under source code control: 1994/11/05 03:19:52 - * File existed as early as: 1994 - * - * chongo /\oo/\ http://reality.sgi.com/chongo/ - * Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ - */ - -/* * The include file have_pos.h, as built during the make process will * define the type FILEPOS as the type used to describe file positions. * We will print information regarding the size and byte order @@ -53,7 +25,29 @@ * will either be a copy or a copy with HALFs swapped depending on the * Endian order of the hardware. */ - +/* + * Copyright (c) 1996 by Landon Curt Noll. All Rights Reserved. + * + * Permission to use, copy, modify, and distribute this software and + * its documentation for any purpose and without fee is hereby granted, + * provided that the above copyright, this permission notice and text + * this comment, and the disclaimer below appear in all of the following: + * + * supporting documentation + * source copies + * source works derived from this source + * binaries derived from this source or from derived source + * + * LANDON CURT NOLL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO + * EVENT SHALL LANDON CURT NOLL BE LIABLE FOR ANY SPECIAL, INDIRECT OR + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF + * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR + * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. + * + * chongo was here /\../\ + */ #include #include diff --git a/func.c b/func.c index 59f7400..c10a42e 100644 --- a/func.c +++ b/func.c @@ -1,32 +1,9 @@ /* - * func - built-in functions implemented here + * Copyright (c) 1997 David I. Bell + * Permission is granted to use, distribute, or modify this source, + * provided that this copyright notice remains intact. * - * Copyright (C) 1999 David I. Bell, Landon Curt Noll and Ernest Bowen - * - * Primary author: David I. Bell - * - * Calc is open software; you can redistribute it and/or modify it under - * the terms of the version 2.1 of the GNU Lesser General Public License - * as published by the Free Software Foundation. - * - * Calc is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General - * Public License for more details. - * - * A copy of version 2.1 of the GNU Lesser General Public License is - * distributed with calc under the filename COPYING-LGPL. You should have - * received a copy with calc; if not, write to Free Software Foundation, Inc. - * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. - * - * @(#) $Revision: 29.1 $ - * @(#) $Id: func.c,v 29.1 1999/12/14 09:15:38 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/func.c,v $ - * - * Under source code control: 1990/02/15 01:48:15 - * File existed as early as: before 1990 - * - * Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ + * Built-in functions implemented here */ @@ -286,7 +263,7 @@ f_display(int count, VALUE **vals) if (vals[0]->v_type != V_NUM || qisfrac(vals[0]->v_num) || qisneg(vals[0]->v_num) || zge31b(vals[0]->v_num->num)) fprintf(stderr, - "Out-of-range arg for display ignored\n"); + "Out-of-range arg for display ignored\n"); else conf->outdigits = qtoi(vals[0]->v_num); } @@ -1900,31 +1877,25 @@ static VALUE f_exp(int count, VALUE **vals) { VALUE result; - NUMBER *eps; - NUMBER *q; + NUMBER *err; COMPLEX *c; /* initialize VALUE */ result.v_subtype = V_NOSUBTYPE; - eps = conf->epsilon; + err = conf->epsilon; if (count == 2) { if (vals[1]->v_type != V_NUM || qiszero(vals[1]->v_num)) return error_value(E_EXP1); - eps = vals[1]->v_num; + err = vals[1]->v_num; } switch (vals[0]->v_type) { case V_NUM: - q = qexp(vals[0]->v_num, eps); - if (q == NULL) - return error_value(E_EXP3); - result.v_num = q; + result.v_num = qexp(vals[0]->v_num, err); result.v_type = V_NUM; break; case V_COM: - c = cexp(vals[0]->v_com, eps); - if (c == NULL) - return error_value(E_EXP3); + c = cexp(vals[0]->v_com, err); result.v_com = c; result.v_type = V_COM; if (cisreal(c)) { @@ -1990,26 +1961,24 @@ f_cos(int count, VALUE **vals) { VALUE result; COMPLEX *c; - NUMBER *eps; + NUMBER *err; /* initialize VALUE */ result.v_subtype = V_NOSUBTYPE; - eps = conf->epsilon; + err = conf->epsilon; if (count == 2) { if (vals[1]->v_type != V_NUM || qiszero(vals[1]->v_num)) return error_value(E_COS1); - eps = vals[1]->v_num; + err = vals[1]->v_num; } switch (vals[0]->v_type) { case V_NUM: - result.v_num = qcos(vals[0]->v_num, eps); + result.v_num = qcos(vals[0]->v_num, err); result.v_type = V_NUM; break; case V_COM: - c = ccos(vals[0]->v_com, eps); - if (c == NULL) - return error_value(E_COS3); + c = ccos(vals[0]->v_com, err); result.v_com = c; result.v_type = V_COM; if (cisreal(c)) { @@ -2030,26 +1999,24 @@ f_sin(int count, VALUE **vals) { VALUE result; COMPLEX *c; - NUMBER *eps; + NUMBER *err; /* initialize VALUE */ result.v_subtype = V_NOSUBTYPE; - eps = conf->epsilon; + err = conf->epsilon; if (count == 2) { if (vals[1]->v_type != V_NUM || qiszero(vals[1]->v_num)) - return error_value(E_SIN1); - eps = vals[1]->v_num; + return error_value(E_COS1); + err = vals[1]->v_num; } switch (vals[0]->v_type) { case V_NUM: - result.v_num = qsin(vals[0]->v_num, eps); + result.v_num = qsin(vals[0]->v_num, err); result.v_type = V_NUM; break; case V_COM: - c = csin(vals[0]->v_com, eps); - if (c == NULL) - return error_value(E_SIN3); + c = csin(vals[0]->v_com, err); result.v_com = c; result.v_type = V_COM; if (cisreal(c)) { @@ -2059,7 +2026,7 @@ f_sin(int count, VALUE **vals) } break; default: - return error_value(E_SIN2); + return error_value(E_COS2); } return result; } @@ -2219,36 +2186,30 @@ static VALUE f_sinh(int count, VALUE **vals) { VALUE result; - NUMBER *eps; + NUMBER *err; NUMBER *q; - COMPLEX *c; /* initialize VALUE */ result.v_subtype = V_NOSUBTYPE; - eps = conf->epsilon; + err = conf->epsilon; if (count == 2) { if (vals[1]->v_type != V_NUM || qiszero(vals[1]->v_num)) return error_value(E_SINH1); - eps = vals[1]->v_num; + err = vals[1]->v_num; } switch (vals[0]->v_type) { case V_NUM: - q = qsinh(vals[0]->v_num, eps); - if (q == NULL) - return error_value(E_SINH3); - result.v_num = q; + result.v_num = qsinh(vals[0]->v_num, err); result.v_type = V_NUM; break; case V_COM: - c = csinh(vals[0]->v_com, eps); - if (c == NULL) - return error_value(E_SINH3); - result.v_com = c; + result.v_com = csinh(vals[0]->v_com, err); result.v_type = V_COM; - if (cisreal(c)) { - result.v_num = qlink(c->real); - comfree(c); + if (cisreal(result.v_com)) { + q = qlink(result.v_com->real); + comfree(result.v_com); + result.v_num = q; result.v_type = V_NUM; } break; @@ -2262,36 +2223,30 @@ static VALUE f_cosh(int count, VALUE **vals) { VALUE result; - NUMBER *eps; + NUMBER *err; NUMBER *q; - COMPLEX *c; /* initialize VALUE */ result.v_subtype = V_NOSUBTYPE; - eps = conf->epsilon; + err = conf->epsilon; if (count == 2) { if (vals[1]->v_type != V_NUM || qiszero(vals[1]->v_num)) return error_value(E_COSH1); - eps = vals[1]->v_num; + err = vals[1]->v_num; } switch (vals[0]->v_type) { case V_NUM: - q = qcosh(vals[0]->v_num, eps); - if (q == NULL) - return error_value(E_COSH3); - result.v_num = q; + result.v_num = qcosh(vals[0]->v_num, err); result.v_type = V_NUM; break; case V_COM: - c = ccosh(vals[0]->v_com, eps); - if (c == NULL) - return error_value(E_COSH3); - result.v_com = c; + result.v_com = ccosh(vals[0]->v_com, err); result.v_type = V_COM; - if (cisreal(c)) { - result.v_num = qlink(c->real); - comfree(c); + if (cisreal(result.v_com)) { + q = qlink(result.v_com->real); + comfree(result.v_com); + result.v_num = q; result.v_type = V_NUM; } break; @@ -3029,18 +2984,18 @@ static VALUE f_gd(int count, VALUE **vals) { VALUE result; - NUMBER *eps; + NUMBER *err; NUMBER *q; COMPLEX *tmp; /* initialize VALUE */ result.v_subtype = V_NOSUBTYPE; - eps = conf->epsilon; + err = conf->epsilon; if (count == 2) { if (vals[1]->v_type != V_NUM || qiszero(vals[1]->v_num)) return error_value(E_GD1); - eps = vals[1]->v_num; + err = vals[1]->v_num; } result.v_type = V_COM; switch (vals[0]->v_type) { @@ -3053,17 +3008,17 @@ f_gd(int count, VALUE **vals) tmp = comalloc(); qfree(tmp->real); tmp->real = qlink(vals[0]->v_num); - result.v_com = cgd(tmp, eps); + result.v_com = cgd(tmp, err); comfree(tmp); break; case V_COM: - result.v_com = cgd(vals[0]->v_com, eps); + result.v_com = cgd(vals[0]->v_com, err); break; default: return error_value(E_GD2); } if (result.v_com == NULL) - return error_value(E_GD3); + return error_value(E_LOGINF); if (cisreal(result.v_com)) { q = qlink(result.v_com->real); comfree(result.v_com); @@ -3078,18 +3033,18 @@ static VALUE f_agd(int count, VALUE **vals) { VALUE result; - NUMBER *eps; + NUMBER *err; NUMBER *q; COMPLEX *tmp; /* initialize VALUE */ result.v_subtype = V_NOSUBTYPE; - eps = conf->epsilon; + err = conf->epsilon; if (count == 2) { if (vals[1]->v_type != V_NUM || qiszero(vals[1]->v_num)) return error_value(E_AGD1); - eps = vals[1]->v_num; + err = vals[1]->v_num; } result.v_type = V_COM; switch (vals[0]->v_type) { @@ -3102,17 +3057,17 @@ f_agd(int count, VALUE **vals) tmp = comalloc(); qfree(tmp->real); tmp->real = qlink(vals[0]->v_num); - result.v_com = cagd(tmp, eps); + result.v_com = cagd(tmp, err); comfree(tmp); break; case V_COM: - result.v_com = cagd(vals[0]->v_com, eps); + result.v_com = cagd(vals[0]->v_com, err); break; default: return error_value(E_AGD2); } if (result.v_com == NULL) - return error_value(E_AGD3); + return error_value(E_LOGINF); if (cisreal(result.v_com)) { q = qlink(result.v_com->real); comfree(result.v_com); @@ -7359,49 +7314,6 @@ f_md5(int count, VALUE **vals) } -static VALUE -f_argv(int count, VALUE **vals) -{ - int arg; /* the argv_value string index */ - VALUE result; - - /* initialize VALUE */ - result.v_subtype = V_NOSUBTYPE; - - /* - * arg check - */ - if (count == 0) { - - /* return the argc count */ - result.v_type = V_NUM; - result.v_num = itoq((long) argc_value); - - } else { - - /* firewall */ - if (vals[0]->v_type != V_NUM || qisfrac(vals[0]->v_num) || - qisneg(vals[0]->v_num) || zge31b(vals[0]->v_num->num)) { - - math_error("argv argument must be a integer [0,2^31)"); - /*NOTREACHED*/ - } - - /* return the n-th argv string */ - arg = qtoi(vals[0]->v_num); - if (arg < argc_value && argv_value[arg] != NULL) { - result.v_type = V_STR; - result.v_str = makestring(strdup(argv_value[arg])); - } else { - result.v_type = V_NULL; - } - } - - /* return the result */ - return result; -} - - #endif /* !FUNCLIST */ @@ -7466,8 +7378,6 @@ static CONST struct builtin builtins[] = { "approximate a by multiple of b using rounding c"}, {"arg", 1, 2, 0, OP_NOP, 0, f_arg, "argument (the angle) of complex number"}, - {"argv", 0, 1, 0, OP_NOP, 0, f_argv, - "calc argc or argv string"}, {"asec", 1, 2, 0, OP_NOP, 0, f_asec, "arcsecant of a within accuracy b"}, {"asech", 1, 2, 0, OP_NOP, 0, f_asech, diff --git a/func.h b/func.h index 45b2d30..b06403a 100644 --- a/func.h +++ b/func.h @@ -1,30 +1,7 @@ /* - * func - built-in function interface definitions - * - * Copyright (C) 1999 David I. Bell - * - * Calc is open software; you can redistribute it and/or modify it under - * the terms of the version 2.1 of the GNU Lesser General Public License - * as published by the Free Software Foundation. - * - * Calc is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General - * Public License for more details. - * - * A copy of version 2.1 of the GNU Lesser General Public License is - * distributed with calc under the filename COPYING-LGPL. You should have - * received a copy with calc; if not, write to Free Software Foundation, Inc. - * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. - * - * @(#) $Revision: 29.1 $ - * @(#) $Id: func.h,v 29.1 1999/12/14 09:15:38 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/func.h,v $ - * - * Under source code control: 1990/02/15 01:48:33 - * File existed as early as: before 1990 - * - * Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ + * Copyright (c) 1997 David I. Bell + * Permission is granted to use, distribute, or modify this source, + * provided that this copyright notice remains intact. */ diff --git a/hash.c b/hash.c index 9b6cb93..13b243f 100644 --- a/hash.c +++ b/hash.c @@ -1,34 +1,25 @@ /* - * hash - one-way hash routines + * Copyright (c) 1997 by Landon Curt Noll. All Rights Reserved. * - * Copyright (C) 1999 Landon Curt Noll + * Permission to use, copy, modify, and distribute this software and + * its documentation for any purpose and without fee is hereby granted, + * provided that the above copyright, this permission notice and text + * this comment, and the disclaimer below appear in all of the following: * - * Calc is open software; you can redistribute it and/or modify it under - * the terms of the version 2.1 of the GNU Lesser General Public License - * as published by the Free Software Foundation. + * supporting documentation + * source copies + * source works derived from this source + * binaries derived from this source or from derived source * - * Calc is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General - * Public License for more details. - * - * A copy of version 2.1 of the GNU Lesser General Public License is - * distributed with calc under the filename COPYING-LGPL. You should have - * received a copy with calc; if not, write to Free Software Foundation, Inc. - * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. - * - * @(#) $Revision: 29.2 $ - * @(#) $Id: hash.c,v 29.2 1999/12/14 19:37:46 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/hash.c,v $ - * - * Under source code control: 1995/11/23 05:13:11 - * File existed as early as: 1995 - * - * chongo /\oo/\ http://reality.sgi.com/chongo/ - * Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ + * LANDON CURT NOLL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO + * EVENT SHALL LANDON CURT NOLL BE LIABLE FOR ANY SPECIAL, INDIRECT OR + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF + * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR + * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. */ - #include #include #include @@ -974,16 +965,13 @@ hash_value(int type, void *v, HASH *state) state = hash_int(type, value->v_config->blkbase, state); state = hash_int(type, value->v_config->blkfmt, state); state = hash_long(type, - (long)value->v_config->resource_debug, state); + (long)value->v_config->lib_debug, state); state = hash_long(type, (long)value->v_config->calc_debug, state); state = hash_long(type, (long)value->v_config->user_debug, state); state = hash_bool(type, value->v_config->verbose_quit, state); state = hash_int(type, value->v_config->ctrl_d, state); - state = hash_str(type, value->v_config->program, state); - state = hash_str(type, value->v_config->base_name, state); - state = hash_str(type, value->v_config->version, state); break; case V_HASH: diff --git a/hash.h b/hash.h index ce16861..0ca4ae3 100644 --- a/hash.h +++ b/hash.h @@ -1,31 +1,23 @@ /* - * hash - one-way hash routines + * Copyright (c) 1997 by Landon Curt Noll. All Rights Reserved. * - * Copyright (C) 1999 Landon Curt Noll + * Permission to use, copy, modify, and distribute this software and + * its documentation for any purpose and without fee is hereby granted, + * provided that the above copyright, this permission notice and text + * this comment, and the disclaimer below appear in all of the following: * - * Calc is open software; you can redistribute it and/or modify it under - * the terms of the version 2.1 of the GNU Lesser General Public License - * as published by the Free Software Foundation. + * supporting documentation + * source copies + * source works derived from this source + * binaries derived from this source or from derived source * - * Calc is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General - * Public License for more details. - * - * A copy of version 2.1 of the GNU Lesser General Public License is - * distributed with calc under the filename COPYING-LGPL. You should have - * received a copy with calc; if not, write to Free Software Foundation, Inc. - * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. - * - * @(#) $Revision: 29.1 $ - * @(#) $Id: hash.h,v 29.1 1999/12/14 09:15:38 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/hash.h,v $ - * - * Under source code control: 1995/11/14 23:57:45 - * File existed as early as: 1995 - * - * chongo /\oo/\ http://reality.sgi.com/chongo/ - * Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ + * LANDON CURT NOLL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO + * EVENT SHALL LANDON CURT NOLL BE LIABLE FOR ANY SPECIAL, INDIRECT OR + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF + * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR + * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. */ diff --git a/have_const.c b/have_const.c index b7f898e..777f766 100644 --- a/have_const.c +++ b/have_const.c @@ -1,34 +1,6 @@ /* * have_const - Determine if we want or can support ansi const * - * Copyright (C) 1999 Landon Curt Noll - * - * Calc is open software; you can redistribute it and/or modify it under - * the terms of the version 2.1 of the GNU Lesser General Public License - * as published by the Free Software Foundation. - * - * Calc is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General - * Public License for more details. - * - * A copy of version 2.1 of the GNU Lesser General Public License is - * distributed with calc under the filename COPYING-LGPL. You should have - * received a copy with calc; if not, write to Free Software Foundation, Inc. - * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. - * - * @(#) $Revision: 29.1 $ - * @(#) $Id: have_const.c,v 29.1 1999/12/14 09:15:38 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/have_const.c,v $ - * - * Under source code control: 1995/04/22 13:18:44 - * File existed as early as: 1995 - * - * chongo /\oo/\ http://reality.sgi.com/chongo/ - * Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ - */ - -/* * usage: * have_const * @@ -44,7 +16,29 @@ * const ==> use const * (nothing) ==> const not used */ - +/* + * Copyright (c) 1995 by Landon Curt Noll. All Rights Reserved. + * + * Permission to use, copy, modify, and distribute this software and + * its documentation for any purpose and without fee is hereby granted, + * provided that the above copyright, this permission notice and text + * this comment, and the disclaimer below appear in all of the following: + * + * supporting documentation + * source copies + * source works derived from this source + * binaries derived from this source or from derived source + * + * LANDON CURT NOLL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO + * EVENT SHALL LANDON CURT NOLL BE LIABLE FOR ANY SPECIAL, INDIRECT OR + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF + * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR + * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. + * + * chongo was here /\../\ + */ #include diff --git a/have_fpos.c b/have_fpos.c index 5ba0f6d..08f5a0f 100644 --- a/have_fpos.c +++ b/have_fpos.c @@ -1,40 +1,34 @@ /* * have_fpos - Determine if have fgetpos and fsetpos functions * - * Copyright (C) 1999 Landon Curt Noll - * - * Calc is open software; you can redistribute it and/or modify it under - * the terms of the version 2.1 of the GNU Lesser General Public License - * as published by the Free Software Foundation. - * - * Calc is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General - * Public License for more details. - * - * A copy of version 2.1 of the GNU Lesser General Public License is - * distributed with calc under the filename COPYING-LGPL. You should have - * received a copy with calc; if not, write to Free Software Foundation, Inc. - * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. - * - * @(#) $Revision: 29.1 $ - * @(#) $Id: have_fpos.c,v 29.1 1999/12/14 09:15:38 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/have_fpos.c,v $ - * - * Under source code control: 1994/11/05 03:19:52 - * File existed as early as: 1994 - * - * chongo /\oo/\ http://reality.sgi.com/chongo/ - * Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ - */ - -/* * If the symbol HAVE_NO_FPOS is defined, we will output nothing. * If we are able to compile this program, then we must have the * fgetpos and fsetpos functions and we will output the * appropriate have_fpos.h file body. */ - +/* + * Copyright (c) 1995 by Landon Curt Noll. All Rights Reserved. + * + * Permission to use, copy, modify, and distribute this software and + * its documentation for any purpose and without fee is hereby granted, + * provided that the above copyright, this permission notice and text + * this comment, and the disclaimer below appear in all of the following: + * + * supporting documentation + * source copies + * source works derived from this source + * binaries derived from this source or from derived source + * + * LANDON CURT NOLL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO + * EVENT SHALL LANDON CURT NOLL BE LIABLE FOR ANY SPECIAL, INDIRECT OR + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF + * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR + * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. + * + * chongo was here /\../\ + */ #include diff --git a/have_getpgid.c b/have_getpgid.c index 97a681a..01fa6db 100644 --- a/have_getpgid.c +++ b/have_getpgid.c @@ -1,34 +1,6 @@ /* - * have_getpgid - determine if we have getpgid() + * have_getpgid - Determine if we getpgid() * - * Copyright (C) 1999 Landon Curt Noll - * - * Calc is open software; you can redistribute it and/or modify it under - * the terms of the version 2.1 of the GNU Lesser General Public License - * as published by the Free Software Foundation. - * - * Calc is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General - * Public License for more details. - * - * A copy of version 2.1 of the GNU Lesser General Public License is - * distributed with calc under the filename COPYING-LGPL. You should have - * received a copy with calc; if not, write to Free Software Foundation, Inc. - * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. - * - * @(#) $Revision: 29.1 $ - * @(#) $Id: have_getpgid.c,v 29.1 1999/12/14 09:15:39 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/have_getpgid.c,v $ - * - * Under source code control: 1999/10/20 22:51:13 - * File existed as early as: 1999 - * - * chongo /\oo/\ http://reality.sgi.com/chongo/ - * Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ - */ - -/* * usage: * have_getpgid * @@ -41,6 +13,29 @@ * defined ==> use getpgid() * undefined ==> do not or cannot call getpgid() */ +/* + * Copyright (c) 1999 by Landon Curt Noll. All Rights Reserved. + * + * Permission to use, copy, modify, and distribute this software and + * its documentation for any purpose and without fee is hereby granted, + * provided that the above copyright, this permission notice and text + * this comment, and the disclaimer below appear in all of the following: + * + * supporting documentation + * source copies + * source works derived from this source + * binaries derived from this source or from derived source + * + * LANDON CURT NOLL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO + * EVENT SHALL LANDON CURT NOLL BE LIABLE FOR ANY SPECIAL, INDIRECT OR + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF + * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR + * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. + * + * chongo was here /\../\ + */ #include #include diff --git a/have_getprid.c b/have_getprid.c index e4703e0..9d433f6 100644 --- a/have_getprid.c +++ b/have_getprid.c @@ -1,34 +1,6 @@ /* - * have_getprid - determine if we have getprid() + * have_getprid - Determine if we getprid() * - * Copyright (C) 1999 Landon Curt Noll - * - * Calc is open software; you can redistribute it and/or modify it under - * the terms of the version 2.1 of the GNU Lesser General Public License - * as published by the Free Software Foundation. - * - * Calc is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General - * Public License for more details. - * - * A copy of version 2.1 of the GNU Lesser General Public License is - * distributed with calc under the filename COPYING-LGPL. You should have - * received a copy with calc; if not, write to Free Software Foundation, Inc. - * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. - * - * @(#) $Revision: 29.1 $ - * @(#) $Id: have_getprid.c,v 29.1 1999/12/14 09:15:39 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/have_getprid.c,v $ - * - * Under source code control: 1999/10/20 23:43:42 - * File existed as early as: 1999 - * - * chongo /\oo/\ http://reality.sgi.com/chongo/ - * Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ - */ - -/* * usage: * have_getprid * @@ -41,7 +13,29 @@ * defined ==> use getprid() * undefined ==> do not or cannot call getprid() */ - +/* + * Copyright (c) 1999 by Landon Curt Noll. All Rights Reserved. + * + * Permission to use, copy, modify, and distribute this software and + * its documentation for any purpose and without fee is hereby granted, + * provided that the above copyright, this permission notice and text + * this comment, and the disclaimer below appear in all of the following: + * + * supporting documentation + * source copies + * source works derived from this source + * binaries derived from this source or from derived source + * + * LANDON CURT NOLL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO + * EVENT SHALL LANDON CURT NOLL BE LIABLE FOR ANY SPECIAL, INDIRECT OR + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF + * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR + * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. + * + * chongo was here /\../\ + */ #include #include diff --git a/have_getsid.c b/have_getsid.c index 845a011..96c904c 100644 --- a/have_getsid.c +++ b/have_getsid.c @@ -1,34 +1,6 @@ /* - * have_getsid - determine if we have getsid() + * have_getsid - Determine if we getsid() * - * Copyright (C) 1999 Landon Curt Noll - * - * Calc is open software; you can redistribute it and/or modify it under - * the terms of the version 2.1 of the GNU Lesser General Public License - * as published by the Free Software Foundation. - * - * Calc is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General - * Public License for more details. - * - * A copy of version 2.1 of the GNU Lesser General Public License is - * distributed with calc under the filename COPYING-LGPL. You should have - * received a copy with calc; if not, write to Free Software Foundation, Inc. - * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. - * - * @(#) $Revision: 29.1 $ - * @(#) $Id: have_getsid.c,v 29.1 1999/12/14 09:15:39 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/have_getsid.c,v $ - * - * Under source code control: 1999/10/20 22:51:13 - * File existed as early as: 1999 - * - * chongo /\oo/\ http://reality.sgi.com/chongo/ - * Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ - */ - -/* * usage: * have_getsid * @@ -41,7 +13,29 @@ * defined ==> use getsid() * undefined ==> do not call or cannot call getsid() */ - +/* + * Copyright (c) 1999 by Landon Curt Noll. All Rights Reserved. + * + * Permission to use, copy, modify, and distribute this software and + * its documentation for any purpose and without fee is hereby granted, + * provided that the above copyright, this permission notice and text + * this comment, and the disclaimer below appear in all of the following: + * + * supporting documentation + * source copies + * source works derived from this source + * binaries derived from this source or from derived source + * + * LANDON CURT NOLL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO + * EVENT SHALL LANDON CURT NOLL BE LIABLE FOR ANY SPECIAL, INDIRECT OR + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF + * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR + * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. + * + * chongo was here /\../\ + */ #include diff --git a/have_gettime.c b/have_gettime.c index adc7a14..5144ea7 100644 --- a/have_gettime.c +++ b/have_gettime.c @@ -1,34 +1,6 @@ /* - * have_gettime - determine if we have clock_gettime() + * have_gettime - Determine if we clock_gettime() * - * Copyright (C) 1999 Landon Curt Noll - * - * Calc is open software; you can redistribute it and/or modify it under - * the terms of the version 2.1 of the GNU Lesser General Public License - * as published by the Free Software Foundation. - * - * Calc is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General - * Public License for more details. - * - * A copy of version 2.1 of the GNU Lesser General Public License is - * distributed with calc under the filename COPYING-LGPL. You should have - * received a copy with calc; if not, write to Free Software Foundation, Inc. - * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. - * - * @(#) $Revision: 29.1 $ - * @(#) $Id: have_gettime.c,v 29.1 1999/12/14 09:15:39 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/have_gettime.c,v $ - * - * Under source code control: 1999/10/20 23:43:42 - * File existed as early as: 1999 - * - * chongo /\oo/\ http://reality.sgi.com/chongo/ - * Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ - */ - -/* * usage: * have_gettime * @@ -43,7 +15,29 @@ * undefined ==> clock_gettime() is not available for both * CLOCK_SGI_CYCLE and CLOCK_REALTIME */ - +/* + * Copyright (c) 1999 by Landon Curt Noll. All Rights Reserved. + * + * Permission to use, copy, modify, and distribute this software and + * its documentation for any purpose and without fee is hereby granted, + * provided that the above copyright, this permission notice and text + * this comment, and the disclaimer below appear in all of the following: + * + * supporting documentation + * source copies + * source works derived from this source + * binaries derived from this source or from derived source + * + * LANDON CURT NOLL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO + * EVENT SHALL LANDON CURT NOLL BE LIABLE FOR ANY SPECIAL, INDIRECT OR + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF + * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR + * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. + * + * chongo was here /\../\ + */ #include diff --git a/have_memmv.c b/have_memmv.c index 3e8f665..a9d3354 100644 --- a/have_memmv.c +++ b/have_memmv.c @@ -1,34 +1,6 @@ /* - * have_memmv - Determine if we have memmove() + * have_memmv - Determine if we memmove() * - * Copyright (C) 1999 Landon Curt Noll - * - * Calc is open software; you can redistribute it and/or modify it under - * the terms of the version 2.1 of the GNU Lesser General Public License - * as published by the Free Software Foundation. - * - * Calc is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General - * Public License for more details. - * - * A copy of version 2.1 of the GNU Lesser General Public License is - * distributed with calc under the filename COPYING-LGPL. You should have - * received a copy with calc; if not, write to Free Software Foundation, Inc. - * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. - * - * @(#) $Revision: 29.1 $ - * @(#) $Id: have_memmv.c,v 29.1 1999/12/14 09:15:39 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/have_memmv.c,v $ - * - * Under source code control: 1997/04/16 02:02:34 - * File existed as early as: 1997 - * - * chongo /\oo/\ http://reality.sgi.com/chongo/ - * Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ - */ - -/* * usage: * have_memmv * @@ -41,7 +13,29 @@ * defined ==> use memmove() * undefined ==> use internal slow memmove() instead */ - +/* + * Copyright (c) 1997 by Landon Curt Noll. All Rights Reserved. + * + * Permission to use, copy, modify, and distribute this software and + * its documentation for any purpose and without fee is hereby granted, + * provided that the above copyright, this permission notice and text + * this comment, and the disclaimer below appear in all of the following: + * + * supporting documentation + * source copies + * source works derived from this source + * binaries derived from this source or from derived source + * + * LANDON CURT NOLL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO + * EVENT SHALL LANDON CURT NOLL BE LIABLE FOR ANY SPECIAL, INDIRECT OR + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF + * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR + * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. + * + * chongo was here /\../\ + */ #include diff --git a/have_newstr.c b/have_newstr.c index f93f8e6..0d49c6b 100644 --- a/have_newstr.c +++ b/have_newstr.c @@ -1,34 +1,6 @@ /* * have_newstr - Determine if we have a system without ANSI C string functions * - * Copyright (C) 1999 Landon Curt Noll - * - * Calc is open software; you can redistribute it and/or modify it under - * the terms of the version 2.1 of the GNU Lesser General Public License - * as published by the Free Software Foundation. - * - * Calc is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General - * Public License for more details. - * - * A copy of version 2.1 of the GNU Lesser General Public License is - * distributed with calc under the filename COPYING-LGPL. You should have - * received a copy with calc; if not, write to Free Software Foundation, Inc. - * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. - * - * @(#) $Revision: 29.1 $ - * @(#) $Id: have_newstr.c,v 29.1 1999/12/14 09:15:39 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/have_newstr.c,v $ - * - * Under source code control: 1995/05/02 03:55:08 - * File existed as early as: 1995 - * - * chongo /\oo/\ http://reality.sgi.com/chongo/ - * Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ - */ - -/* * usage: * have_newstr * @@ -43,7 +15,29 @@ * use bfill() instead of memset(), * use index() instead of strchr() */ - +/* + * Copyright (c) 1995 by Landon Curt Noll. All Rights Reserved. + * + * Permission to use, copy, modify, and distribute this software and + * its documentation for any purpose and without fee is hereby granted, + * provided that the above copyright, this permission notice and text + * this comment, and the disclaimer below appear in all of the following: + * + * supporting documentation + * source copies + * source works derived from this source + * binaries derived from this source or from derived source + * + * LANDON CURT NOLL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO + * EVENT SHALL LANDON CURT NOLL BE LIABLE FOR ANY SPECIAL, INDIRECT OR + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF + * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR + * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. + * + * chongo was here /\../\ + */ #include diff --git a/have_offscl.c b/have_offscl.c index f836548..4b665a2 100644 --- a/have_offscl.c +++ b/have_offscl.c @@ -1,34 +1,6 @@ /* - * have_offscl - determine if we have a scalar off_t element + * have_offscl - determine if have a scalar off_t element * - * Copyright (C) 1999 Landon Curt Noll - * - * Calc is open software; you can redistribute it and/or modify it under - * the terms of the version 2.1 of the GNU Lesser General Public License - * as published by the Free Software Foundation. - * - * Calc is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General - * Public License for more details. - * - * A copy of version 2.1 of the GNU Lesser General Public License is - * distributed with calc under the filename COPYING-LGPL. You should have - * received a copy with calc; if not, write to Free Software Foundation, Inc. - * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. - * - * @(#) $Revision: 29.1 $ - * @(#) $Id: have_offscl.c,v 29.1 1999/12/14 09:15:39 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/have_offscl.c,v $ - * - * Under source code control: 1996/07/13 12:57:22 - * File existed as early as: 1996 - * - * chongo /\oo/\ http://reality.sgi.com/chongo/ - * Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ - */ - -/* * usage: * have_offscl * @@ -45,7 +17,29 @@ * defined ==> ok to perform arithmetic ops, = and comparisons * undefined ==> convert to ZVALUE first */ - +/* + * Copyright (c) 1996 by Landon Curt Noll. All Rights Reserved. + * + * Permission to use, copy, modify, and distribute this software and + * its documentation for any purpose and without fee is hereby granted, + * provided that the above copyright, this permission notice and text + * this comment, and the disclaimer below appear in all of the following: + * + * supporting documentation + * source copies + * source works derived from this source + * binaries derived from this source or from derived source + * + * LANDON CURT NOLL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO + * EVENT SHALL LANDON CURT NOLL BE LIABLE FOR ANY SPECIAL, INDIRECT OR + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF + * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR + * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. + * + * chongo was here /\../\ + */ #include #include diff --git a/have_posscl.c b/have_posscl.c index 388d1c4..38ada31 100644 --- a/have_posscl.c +++ b/have_posscl.c @@ -1,34 +1,6 @@ /* - * have_posscl - determine if we have a scalar FILEPOS element + * have_posscl - determine if have a scalar FILEPOS element * - * Copyright (C) 1999 Landon Curt Noll - * - * Calc is open software; you can redistribute it and/or modify it under - * the terms of the version 2.1 of the GNU Lesser General Public License - * as published by the Free Software Foundation. - * - * Calc is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General - * Public License for more details. - * - * A copy of version 2.1 of the GNU Lesser General Public License is - * distributed with calc under the filename COPYING-LGPL. You should have - * received a copy with calc; if not, write to Free Software Foundation, Inc. - * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. - * - * @(#) $Revision: 29.1 $ - * @(#) $Id: have_posscl.c,v 29.1 1999/12/14 09:15:39 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/have_posscl.c,v $ - * - * Under source code control: 1996/07/13 12:57:22 - * File existed as early as: 1996 - * - * chongo /\oo/\ http://reality.sgi.com/chongo/ - * Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ - */ - -/* * usage: * have_posscl * @@ -38,13 +10,36 @@ * a ZVALUE in order to perform arithmetic operations, assignments and * comparisons. * + * * This prog outputs several defines: * * HAVE_FILEPOS_SCALAR * defined ==> ok to perform arithmetic ops, = and comparisons * undefined ==> convert to ZVALUE first */ - +/* + * Copyright (c) 1996 by Landon Curt Noll. All Rights Reserved. + * + * Permission to use, copy, modify, and distribute this software and + * its documentation for any purpose and without fee is hereby granted, + * provided that the above copyright, this permission notice and text + * this comment, and the disclaimer below appear in all of the following: + * + * supporting documentation + * source copies + * source works derived from this source + * binaries derived from this source or from derived source + * + * LANDON CURT NOLL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO + * EVENT SHALL LANDON CURT NOLL BE LIABLE FOR ANY SPECIAL, INDIRECT OR + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF + * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR + * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. + * + * chongo was here /\../\ + */ #include #include diff --git a/have_rusage.c b/have_rusage.c index 19551db..f3cc8fa 100644 --- a/have_rusage.c +++ b/have_rusage.c @@ -1,34 +1,6 @@ /* - * have_rusage - Determine if we have getrusage() + * have_rusage - Determine if we getrusage() * - * Copyright (C) 1999 Landon Curt Noll - * - * Calc is open software; you can redistribute it and/or modify it under - * the terms of the version 2.1 of the GNU Lesser General Public License - * as published by the Free Software Foundation. - * - * Calc is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General - * Public License for more details. - * - * A copy of version 2.1 of the GNU Lesser General Public License is - * distributed with calc under the filename COPYING-LGPL. You should have - * received a copy with calc; if not, write to Free Software Foundation, Inc. - * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. - * - * @(#) $Revision: 29.1 $ - * @(#) $Id: have_rusage.c,v 29.1 1999/12/14 09:15:39 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/have_rusage.c,v $ - * - * Under source code control: 1999/11/05 11:28:15 - * File existed as early as: 1999 - * - * chongo /\oo/\ http://reality.sgi.com/chongo/ - * Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ - */ - -/* * usage: * have_rusage * @@ -41,7 +13,29 @@ * defined ==> use getrusage() * undefined ==> do not call or cannot call getrusage() */ - +/* + * Copyright (c) 1999 by Landon Curt Noll. All Rights Reserved. + * + * Permission to use, copy, modify, and distribute this software and + * its documentation for any purpose and without fee is hereby granted, + * provided that the above copyright, this permission notice and text + * this comment, and the disclaimer below appear in all of the following: + * + * supporting documentation + * source copies + * source works derived from this source + * binaries derived from this source or from derived source + * + * LANDON CURT NOLL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO + * EVENT SHALL LANDON CURT NOLL BE LIABLE FOR ANY SPECIAL, INDIRECT OR + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF + * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR + * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. + * + * chongo was here /\../\ + */ #include #include diff --git a/have_stdvs.c b/have_stdvs.c index 11086ea..def9e1d 100644 --- a/have_stdvs.c +++ b/have_stdvs.c @@ -1,34 +1,6 @@ /* * have_stdvs - try to see if it really works with vsprintf() * - * Copyright (C) 1999 Landon Curt Noll - * - * Calc is open software; you can redistribute it and/or modify it under - * the terms of the version 2.1 of the GNU Lesser General Public License - * as published by the Free Software Foundation. - * - * Calc is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General - * Public License for more details. - * - * A copy of version 2.1 of the GNU Lesser General Public License is - * distributed with calc under the filename COPYING-LGPL. You should have - * received a copy with calc; if not, write to Free Software Foundation, Inc. - * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. - * - * @(#) $Revision: 29.1 $ - * @(#) $Id: have_stdvs.c,v 29.1 1999/12/14 09:15:39 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/have_stdvs.c,v $ - * - * Under source code control: 1995/09/09 22:41:10 - * File existed as early as: 1995 - * - * chongo /\oo/\ http://reality.sgi.com/chongo/ - * Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ - */ - -/* * On some systems that have both and , vsprintf() * does not work well under one type of include file. * @@ -41,7 +13,29 @@ * (or sprintf()) produces unexpected results while using the * include file. */ - +/* + * Copyright (c) 1995 by Landon Curt Noll. All Rights Reserved. + * + * Permission to use, copy, modify, and distribute this software and + * its documentation for any purpose and without fee is hereby granted, + * provided that the above copyright, this permission notice and text + * this comment, and the disclaimer below appear in all of the following: + * + * supporting documentation + * source copies + * source works derived from this source + * binaries derived from this source or from derived source + * + * LANDON CURT NOLL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO + * EVENT SHALL LANDON CURT NOLL BE LIABLE FOR ANY SPECIAL, INDIRECT OR + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF + * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR + * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. + * + * chongo was here /\../\ + */ #include diff --git a/have_strdup.c b/have_strdup.c index 093f9eb..87f5053 100644 --- a/have_strdup.c +++ b/have_strdup.c @@ -1,34 +1,6 @@ /* - * have_strdup - determine if we have strdup() + * have_strdup - Determine if we strdup() * - * Copyright (C) 1999 Landon Curt Noll - * - * Calc is open software; you can redistribute it and/or modify it under - * the terms of the version 2.1 of the GNU Lesser General Public License - * as published by the Free Software Foundation. - * - * Calc is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General - * Public License for more details. - * - * A copy of version 2.1 of the GNU Lesser General Public License is - * distributed with calc under the filename COPYING-LGPL. You should have - * received a copy with calc; if not, write to Free Software Foundation, Inc. - * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. - * - * @(#) $Revision: 29.1 $ - * @(#) $Id: have_strdup.c,v 29.1 1999/12/14 09:15:39 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/have_strdup.c,v $ - * - * Under source code control: 1999/11/09 12:46:54 - * File existed as early as: 1999 - * - * chongo /\oo/\ http://reality.sgi.com/chongo/ - * Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ - */ - -/* * usage: * have_strdup * @@ -41,7 +13,29 @@ * defined ==> use strdup() * undefined ==> do not call or cannot call strdup() */ - +/* + * Copyright (c) 1999 by Landon Curt Noll. All Rights Reserved. + * + * Permission to use, copy, modify, and distribute this software and + * its documentation for any purpose and without fee is hereby granted, + * provided that the above copyright, this permission notice and text + * this comment, and the disclaimer below appear in all of the following: + * + * supporting documentation + * source copies + * source works derived from this source + * binaries derived from this source or from derived source + * + * LANDON CURT NOLL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO + * EVENT SHALL LANDON CURT NOLL BE LIABLE FOR ANY SPECIAL, INDIRECT OR + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF + * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR + * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. + * + * chongo was here /\../\ + */ #include diff --git a/have_uid_t.c b/have_uid_t.c index 6f579ac..6e70263 100644 --- a/have_uid_t.c +++ b/have_uid_t.c @@ -1,34 +1,6 @@ /* * have_uid_t - Determine if we want or can support uid_t * - * Copyright (C) 1999 Landon Curt Noll - * - * Calc is open software; you can redistribute it and/or modify it under - * the terms of the version 2.1 of the GNU Lesser General Public License - * as published by the Free Software Foundation. - * - * Calc is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General - * Public License for more details. - * - * A copy of version 2.1 of the GNU Lesser General Public License is - * distributed with calc under the filename COPYING-LGPL. You should have - * received a copy with calc; if not, write to Free Software Foundation, Inc. - * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. - * - * @(#) $Revision: 29.1 $ - * @(#) $Id: have_uid_t.c,v 29.1 1999/12/14 09:15:39 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/have_uid_t.c,v $ - * - * Under source code control: 1995/05/02 03:03:24 - * File existed as early as: 1995 - * - * chongo /\oo/\ http://reality.sgi.com/chongo/ - * Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ - */ - -/* * usage: * have_uid_t * @@ -40,7 +12,29 @@ * defined ==> ok to use uid_t * undefined ==> do not use uid_t */ - +/* + * Copyright (c) 1995 by Landon Curt Noll. All Rights Reserved. + * + * Permission to use, copy, modify, and distribute this software and + * its documentation for any purpose and without fee is hereby granted, + * provided that the above copyright, this permission notice and text + * this comment, and the disclaimer below appear in all of the following: + * + * supporting documentation + * source copies + * source works derived from this source + * binaries derived from this source or from derived source + * + * LANDON CURT NOLL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO + * EVENT SHALL LANDON CURT NOLL BE LIABLE FOR ANY SPECIAL, INDIRECT OR + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF + * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR + * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. + * + * chongo was here /\../\ + */ #include diff --git a/have_ustat.c b/have_ustat.c index 6425d00..0750749 100644 --- a/have_ustat.c +++ b/have_ustat.c @@ -1,34 +1,6 @@ /* - * have_ustat - Determine if we have ustat() + * have_ustat - Determine if we ustat() * - * Copyright (C) 1999 Landon Curt Noll - * - * Calc is open software; you can redistribute it and/or modify it under - * the terms of the version 2.1 of the GNU Lesser General Public License - * as published by the Free Software Foundation. - * - * Calc is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General - * Public License for more details. - * - * A copy of version 2.1 of the GNU Lesser General Public License is - * distributed with calc under the filename COPYING-LGPL. You should have - * received a copy with calc; if not, write to Free Software Foundation, Inc. - * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. - * - * @(#) $Revision: 29.1 $ - * @(#) $Id: have_ustat.c,v 29.1 1999/12/14 09:15:40 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/have_ustat.c,v $ - * - * Under source code control: 1999/10/20 22:51:13 - * File existed as early as: 1999 - * - * chongo /\oo/\ http://reality.sgi.com/chongo/ - * Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ - */ - -/* * usage: * have_ustat * @@ -41,7 +13,29 @@ * defined ==> use ustat() * undefined ==> do not call or cannot call ustat() */ - +/* + * Copyright (c) 1999 by Landon Curt Noll. All Rights Reserved. + * + * Permission to use, copy, modify, and distribute this software and + * its documentation for any purpose and without fee is hereby granted, + * provided that the above copyright, this permission notice and text + * this comment, and the disclaimer below appear in all of the following: + * + * supporting documentation + * source copies + * source works derived from this source + * binaries derived from this source or from derived source + * + * LANDON CURT NOLL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO + * EVENT SHALL LANDON CURT NOLL BE LIABLE FOR ANY SPECIAL, INDIRECT OR + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF + * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR + * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. + * + * chongo was here /\../\ + */ #include #include diff --git a/have_varvs.c b/have_varvs.c index 2fe1dc4..6dcfea3 100644 --- a/have_varvs.c +++ b/have_varvs.c @@ -1,34 +1,6 @@ /* * have_varvs - try to see if it really works with vsprintf() * - * Copyright (C) 1999 Landon Curt Noll - * - * Calc is open software; you can redistribute it and/or modify it under - * the terms of the version 2.1 of the GNU Lesser General Public License - * as published by the Free Software Foundation. - * - * Calc is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General - * Public License for more details. - * - * A copy of version 2.1 of the GNU Lesser General Public License is - * distributed with calc under the filename COPYING-LGPL. You should have - * received a copy with calc; if not, write to Free Software Foundation, Inc. - * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. - * - * @(#) $Revision: 29.1 $ - * @(#) $Id: have_varvs.c,v 29.1 1999/12/14 09:15:40 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/have_varvs.c,v $ - * - * Under source code control: 1995/09/09 22:41:10 - * File existed as early as: 1995 - * - * chongo /\oo/\ http://reality.sgi.com/chongo/ - * Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ - */ - -/* * Some systems have bugs in the implementation that show up in * vsprintf(), so we may have to try to use sprintf() as if it were vsprintf() * and hope for the best. @@ -38,7 +10,29 @@ * (or sprintf()) produces unexpected results while using the * include file. */ - +/* + * Copyright (c) 1995 by Landon Curt Noll. All Rights Reserved. + * + * Permission to use, copy, modify, and distribute this software and + * its documentation for any purpose and without fee is hereby granted, + * provided that the above copyright, this permission notice and text + * this comment, and the disclaimer below appear in all of the following: + * + * supporting documentation + * source copies + * source works derived from this source + * binaries derived from this source or from derived source + * + * LANDON CURT NOLL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO + * EVENT SHALL LANDON CURT NOLL BE LIABLE FOR ANY SPECIAL, INDIRECT OR + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF + * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR + * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. + * + * chongo was here /\../\ + */ #include diff --git a/help.c b/help.c index fb63dab..ae986c8 100644 --- a/help.c +++ b/help.c @@ -1,38 +1,13 @@ /* - * help - display help for calc + * Copyright (c) 1997 David I. Bell + * Permission is granted to use, distribute, or modify this source, + * provided that this copyright notice remains intact. * - * Copyright (C) 1999 Landon Curt Noll - * - * Calc is open software; you can redistribute it and/or modify it under - * the terms of the version 2.1 of the GNU Lesser General Public License - * as published by the Free Software Foundation. - * - * Calc is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General - * Public License for more details. - * - * A copy of version 2.1 of the GNU Lesser General Public License is - * distributed with calc under the filename COPYING-LGPL. You should have - * received a copy with calc; if not, write to Free Software Foundation, Inc. - * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. - * - * @(#) $Revision: 29.1 $ - * @(#) $Id: help.c,v 29.1 1999/12/14 09:15:40 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/help.c,v $ - * - * Under source code control: 1997/09/14 10:58:30 - * File existed as early as: 1997 - * - * chongo /\oo/\ http://reality.sgi.com/chongo/ - * Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ + * Arbitrary precision calculator. */ - #include #include -#include -#include #include "calc.h" #include "conf.h" @@ -57,15 +32,6 @@ static struct help_alias { {".", "oldvalue"}, {"%", "mod"}, {"//", "quo"}, - {"copying", "COPYING"}, - {"copying-lgpl", "COPYING-LGPL"}, - {"copying_lgpl", "COPYING-LGPL"}, - {"COPYING_LGPL", "COPYING-LGPL"}, - {"Copyright", "copyright"}, - {"COPYRIGHT", "copyright"}, - {"Copyleft", "copyright"}, - {"COPYLEFT", "copyright"}, - {"stdlib", "resource"}, {NULL, NULL} }; @@ -76,80 +42,6 @@ static struct help_alias { extern char *pager; /* $PAGER or default */ -/* - * page_file - output an open file thru a pager - * - * The popen() below is fairly safe. The $PAGER environment variable - * (supplied by the user) is the command we need to run without args. - * True, the user could set $PAGER is a bogus prog ... but if -m is - * 5 or 7 (read and exec allowed), then the calc is given ``permission'' - * to open the help file for reading as well as to exec the pager! - * - * given: - * stream open file stream of the file to send to the pager - */ -static void -page_file(FILE *stream) -{ - FILE *cmd; /* pager command */ - char buf[BUFSIZ+1]; /* I/O buffer */ - char *fgets_ret; /* fgets() return value */ - - /* - * flush any pending I/O - */ - fflush(stderr); - fflush(stdout); - fflush(stdin); - - /* - * form a write pipe to a pager - */ - cmd = popen(pager, "w"); - if (cmd == NULL) { - fprintf(stderr, "unable form pipe to pager: %s", pager); - return; - } - - /* - * read the help file and send non-## lines to the pager - * until EOF or error - */ - buf[BUFSIZ] = '\0'; - do { - - /* - * read the next line that does not begin with ## - */ - buf[0] = '\0'; - while ((fgets_ret = fgets(buf, BUFSIZ, stream)) != NULL && - buf[0] == '#' && buf[1] == '#') { - } - - /* - * stop reading when we reach EOF (or error) on help file - */ - if (fgets_ret == NULL) { - fflush(cmd); - break; - } - - /* - * write the line to pager, if possible - */ - } while(fputs(buf, cmd) > 0); - - /* - * all done, EOF or error, so just clean up - */ - (void) pclose(cmd); - fflush(stderr); - fflush(stdout); - fflush(stdin); - return; -} - - /* * givehelp - display a help file * @@ -160,8 +52,7 @@ void givehelp(char *type) { struct help_alias *p; /* help alias being considered */ - FILE *stream; /* help file stream */ - char *helppath; /* path to the help file */ + char *helpcmd; /* what to execute to print help */ char *c; /* @@ -213,65 +104,29 @@ givehelp(char *type) } } - /* - * special case for Copyright and Copyleft - */ - if (strcmp(type, "copyright") == 0) { - fputs(Copyright, stdout); - fflush(stdout); - return; + + /* form the help command name */ + helpcmd = (char *)malloc( + sizeof("if [ ! -r \"")+sizeof(HELPDIR)+1+strlen(type)+ + sizeof("\" ];then ")+ + strlen(pager)+1+1+sizeof(HELPDIR)+1+strlen(type)+1+1+ + sizeof("elif [ ! -r \"")+sizeof(CUSTOMHELPDIR)+1+strlen(type)+ + sizeof("\" ];then ")+ + strlen(pager)+1+1+sizeof(CUSTOMHELPDIR)+1+strlen(type)+1+1+ + sizeof(";else ")+sizeof(ECHO)+ + sizeof("echo no such help, try: help help;fi")+1); + sprintf(helpcmd, + "if [ -r \"%s/%s\" ];then %s \"%s/%s\";" + "elif [ -r \"%s/%s\" ];then %s \"%s/%s\";" + "else %s no such help, try: help help;fi", + HELPDIR, type, pager, HELPDIR, type, + CUSTOMHELPDIR, type, pager, CUSTOMHELPDIR, type, ECHO); + if (conf->calc_debug & CALCDBG_SYSTEM) { + printf("%s\n", helpcmd); } - /* - * open the helpfile (looking in HELPDIR first) - */ - if (sizeof(CUSTOMHELPDIR) > sizeof(HELPDIR)) { - helppath = (char *)malloc(sizeof(CUSTOMHELPDIR)+1+strlen(type)); - } else { - helppath = (char *)malloc(sizeof(HELPDIR)+1+strlen(type)); - } - if (helppath == NULL) { - fprintf(stderr, "malloc failure in givehelp()\n"); - return; - } - sprintf(helppath, "%s/%s", HELPDIR, type); - stream = fopen(helppath, "r"); - if (stream != NULL) { - - /* - * we have the help file open, now display it - */ - page_file(stream); - (void) fclose(stream); - - /* - * open the the helpfile (looking in CUSTOMHELPDIR last) - */ - } else { - - sprintf(helppath, "%s/%s", CUSTOMHELPDIR, type); - stream = fopen(helppath, "r"); - if (stream == NULL) { - - /* - * we have the help file open, now display it - */ - page_file(stream); - (void) fclose(stream); - - /* - * no such help file - */ - } else { - fprintf(stderr, - "%s: no such help file, try: help help\n", - type); - } - } - - /* - * cleanup - */ - free(helppath); - return; + /* execute the help command */ + system(helpcmd); + free(helpcmd); } + diff --git a/help/Makefile b/help/Makefile index 098d2ce..e0a91af 100644 --- a/help/Makefile +++ b/help/Makefile @@ -1,35 +1,14 @@ -#!/bin/make # # help - makefile for calc help files # -# Copyright (C) 1999 Landon Curt Noll +# Copyright (c) 1994 David I. Bell and Landon Curt Noll +# Permission is granted to use, distribute, or modify this source, +# provided that this copyright notice remains intact. # -# Calc is open software; you can redistribute it and/or modify it under -# the terms of the version 2.1 of the GNU Lesser General Public License -# as published by the Free Software Foundation. +# Arbitrary precision calculator. # -# Calc is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -# Public License for more details. -# -# A copy of version 2.1 of the GNU Lesser General Public License is -# distributed with calc under the filename COPYING-LGPL. You should have -# received a copy with calc; if not, write to Free Software Foundation, Inc. -# 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -# -# @(#) $Revision: 29.1 $ -# @(#) $Id: Makefile,v 29.1 1999/12/14 09:16:34 chongo Exp $ -# @(#) $Source: /usr/local/src/cmd/calc/help/RCS/Makefile,v $ -# -# Under source code control: 1991/07/23 06:47:57 -# File existed as early as: 1991 -# -# chongo /\oo/\ http://reality.sgi.com/chongo/ -# Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ -# -# calculator by David I. Bell with help/mods from others -# Makefile by Landon Curt Noll +# calculator by David I. Bell +# makefile by Landon Curt Noll # required vars # @@ -59,7 +38,6 @@ Q=@ LCC= cc ICFLAGS= ILDFLAGS= -CHMOD= chmod SED= sed SORT= sort FMT= fmt @@ -85,21 +63,17 @@ SPECIAL_HELP_7= obj.file STD_HELP_FILES_8= operator statement -BLT_HELP_FILES_9= resource +BLT_HELP_FILES_9= stdlib -STD_HELP_FILES_10= types usage script unexpected variable +STD_HELP_FILES_10= types usage unexpected variable -BLT_HELP_FILES_11= bindings custom_cal libcalc new_custom resource +BLT_HELP_FILES_11= bindings custom_cal libcalc new_custom stdlib STD_HELP_FILES_12= archive BLT_HELP_FILES_13= bugs changes -STD_HELP_FILES_14= contrib credit - -BLT_HELP_FILES_14= COPYING COPYING-LGPL - -STD_HELP_FILES_15= wishlist todo +STD_HELP_FILES_14= contrib credit wishlist todo # These files are used in the following order to construct full # @@ -109,16 +83,14 @@ FULL_HELP_FILES= ${STD_HELP_FILES_1} ${STD_HELP_FILES_2} \ ${SPECIAL_HELP_7} ${STD_HELP_FILES_8} \ ${BLT_HELP_FILES_9} ${STD_HELP_FILES_10} \ ${BLT_HELP_FILES_11} ${STD_HELP_FILES_12} \ - ${BLT_HELP_FILES_13} ${STD_HELP_FILES_14} \ - ${BLT_HELP_FILES_14} ${STD_HELP_FILES_15} + ${BLT_HELP_FILES_13} ${STD_HELP_FILES_14} # These full files are those who are not built or constrcuted # STD_HELP_FILES= ${STD_HELP_FILES_1} ${STD_HELP_FILES_2} \ ${STD_HELP_FILES_4} ${STD_HELP_FILES_6} \ ${STD_HELP_FILES_8} ${STD_HELP_FILES_10} \ - ${STD_HELP_FILES_12} ${STD_HELP_FILES_14} \ - ${STD_HELP_FILES_15} + ${STD_HELP_FILES_12} ${STD_HELP_FILES_14} # These full files are those who are built by this Makefile # @@ -127,30 +99,29 @@ STD_HELP_FILES= ${STD_HELP_FILES_1} ${STD_HELP_FILES_2} \ # BLT_HELP_FILES= ${BLT_HELP_FILES_3} ${BLT_HELP_FILES_5} \ ${BLT_HELP_FILES_9} \ - ${BLT_HELP_FILES_11} ${BLT_HELP_FILES_13} \ - ${BLT_HELP_FILES_14} + ${BLT_HELP_FILES_11} ${BLT_HELP_FILES_13} # This list is prodiced by the detaillist rule when no WARNINGS are detected. # DETAIL_HELP= abs access acos acosh acot acoth acsc acsch address agd append \ - appr arg argv arrow asec asech asin asinh assign atan atan2 atanh \ - avg base bit blk blkcpy blkfree blocks bround btrunc calclevel ceil \ - cfappr cfsim char cmdbuf cmp comb conj cos cosh cot coth count cp \ - csc csch ctime delete den dereference det digit digits dp epsilon \ - errcount errmax errno error eval exp fact factor fclose fcnt feof \ - ferror fflush fgetc fgetfield fgetline fgets fgetstr fib files floor \ - fopen forall fprintf fputc fputs fputstr frac free freeglobals \ - freeredc freestatics frem freopen fscan fscanf fseek fsize ftell \ - gcd gcdrem gd getenv hash head highbit hmean hnrmod hypot ilog \ - ilog10 ilog2 im indices inputlevel insert int inverse iroot isassoc \ - isatty isblk isconfig isdefined iserror iseven isfile ishash isident \ - isint islist ismat ismult isnull isnum isobj isobjtype isodd isprime \ - isptr isqrt isrand israndom isreal isrel issimple issq isstr istype \ - jacobi join lcm lcmfact lfactor ln lowbit ltol makelist matdim \ - matfill matmax matmin matsum mattrace mattrans max md5 memsize meq \ - min minv mmin mne mod modify name near newerror nextcand nextprime \ - norm null num oldvalue ord param perm pfact pi pix places pmod polar \ - poly pop popcnt power prevcand prevprime printf prompt protect ptest \ + appr arg arrow asec asech asin asinh assign atan atan2 atanh avg base \ + bit blk blkcpy blkfree blocks bround btrunc calclevel ceil cfappr \ + cfsim char cmdbuf cmp comb conj cos cosh cot coth count cp csc csch \ + ctime delete den dereference det digit digits dp epsilon errcount \ + errmax errno error eval exp fact factor fclose fcnt feof ferror \ + fflush fgetc fgetfield fgetline fgets fgetstr fib files floor fopen \ + forall fprintf fputc fputs fputstr frac free freeglobals freeredc \ + freestatics frem freopen fscan fscanf fseek fsize ftell gcd gcdrem \ + gd getenv hash head highbit hmean hnrmod hypot ilog ilog10 ilog2 \ + im indices inputlevel insert int inverse iroot isassoc isatty isblk \ + isconfig isdefined iserror iseven isfile ishash isident isint islist \ + ismat ismult isnull isnum isobj isobjtype isodd isprime isptr isqrt \ + isrand israndom isreal isrel issimple issq isstr istype jacobi join \ + lcm lcmfact lfactor ln lowbit ltol makelist matdim matfill matmax \ + matmin matsum mattrace mattrans max md5 memsize meq min minv mmin \ + mne mod modify name near newerror nextcand nextprime norm null \ + num oldvalue ord param perm pfact pi pix places pmod polar poly \ + pop popcnt power prevcand prevprime printf prompt protect ptest \ push putenv quo quomod rand randbit random randombit randperm rcin \ rcmul rcout rcpow rcsq re remove reverse rewind rm root round rsearch \ runtime saveval scale scan scanf search sec sech seed segment select \ @@ -176,7 +147,7 @@ DISTLIST= ${STD_HELP_FILES} ${DETAIL_HELP} ${MAKE_FILE} \ obj.file builtin.top builtin.end funclist.sed \ errorcodes.hdr errorcodes.sed -# These files are used to make (but not built) a calc .a link library +# These files are used to make (but not built) a calc .a library # CALCLIBLIST= @@ -192,10 +163,10 @@ all: ${FULL_HELP_FILES} full ${DETAIL_HELP} ${DETAIL_CLONE} \ rm -f .all touch .all -bindings: ../cal/bindings +bindings: ../lib/bindings rm -f $@ - cp ../cal/bindings $@ - ${CHMOD} 0444 $@ + cp ../lib/bindings $@ + chmod 0444 $@ -@if [ -z "${Q}" ]; then \ echo ''; \ echo '=-=-= skipping the cat of help/$@ =-=-='; \ @@ -204,10 +175,10 @@ bindings: ../cal/bindings true; \ fi -resource: ../cal/README +stdlib: ../lib/README rm -f $@ - cp ../cal/README $@ - ${CHMOD} 0444 $@ + cp ../lib/README $@ + chmod 0444 $@ -@if [ -z "${Q}" ]; then \ echo ''; \ echo '=-=-= skipping the cat of help/$@ =-=-='; \ @@ -219,7 +190,7 @@ resource: ../cal/README changes: ../CHANGES rm -f $@ cp ../CHANGES $@ - ${CHMOD} 0444 $@ + chmod 0444 $@ -@if [ -z "${Q}" ]; then \ echo ''; \ echo '=-=-= skipping the cat of help/$@ =-=-='; \ @@ -231,7 +202,7 @@ changes: ../CHANGES libcalc: ../LIBRARY rm -f $@ ${SED} -e 's:$${LIBDIR}:${LIBDIR}:g' < ../LIBRARY > $@ - ${CHMOD} 0444 $@ + chmod 0444 $@ -@if [ -z "${Q}" ]; then \ echo ''; \ echo '=-=-= skipping the cat of help/$@ =-=-='; \ @@ -243,7 +214,7 @@ libcalc: ../LIBRARY bugs: ../BUGS rm -f $@ cp ../BUGS $@ - ${CHMOD} 0444 $@ + chmod 0444 $@ -@if [ -z "${Q}" ]; then \ echo ''; \ echo '=-=-= skipping the cat of help/$@ =-=-='; \ @@ -256,7 +227,7 @@ errorcodes: ../calcerr.h errorcodes.hdr errorcodes.sed rm -f $@ cat errorcodes.hdr > $@ ${SED} -n -f errorcodes.sed < ../calcerr.h >> $@ - ${CHMOD} 0444 $@ + chmod 0444 $@ -@if [ -z "${Q}" ]; then \ echo ''; \ echo '=-=-= skipping the cat of help/$@ =-=-='; \ @@ -268,7 +239,7 @@ errorcodes: ../calcerr.h errorcodes.hdr errorcodes.sed calc: usage rm -f $@ cp usage $@ - ${CHMOD} 0444 $@ + chmod 0444 $@ -@if [ -z "${Q}" ]; then \ echo ''; \ echo '=-=-= skipping the cat of help/$@ =-=-='; \ @@ -280,7 +251,7 @@ calc: usage custom_cal: ../custom/CUSTOM_CAL rm -f $@ cp ../custom/CUSTOM_CAL $@ - ${CHMOD} 0444 $@ + chmod 0444 $@ -@if [ -z "${Q}" ]; then \ echo ''; \ echo '=-=-= skipping the cat of help/$@ =-=-='; \ @@ -292,7 +263,7 @@ custom_cal: ../custom/CUSTOM_CAL new_custom: ../custom/HOW_TO_ADD rm -f $@ cp ../custom/HOW_TO_ADD $@ - ${CHMOD} 0444 $@ + chmod 0444 $@ -@if [ -z "${Q}" ]; then \ echo ''; \ echo '=-=-= skipping the cat of help/$@ =-=-='; \ @@ -304,31 +275,7 @@ new_custom: ../custom/HOW_TO_ADD copy: blkcpy rm -f $@ cp blkcpy $@ - ${CHMOD} 0444 $@ - -@if [ -z "${Q}" ]; then \ - echo ''; \ - echo '=-=-= skipping the cat of help/$@ =-=-='; \ - echo ''; \ - else \ - true; \ - fi - -COPYING: ../COPYING - rm -f $@ - cp ../COPYING $@ - ${CHMOD} 0444 $@ - -@if [ -z "${Q}" ]; then \ - echo ''; \ - echo '=-=-= skipping the cat of help/$@ =-=-='; \ - echo ''; \ - else \ - true; \ - fi - -COPYING-LGPL: ../COPYING-LGPL - rm -f $@ - cp ../COPYING-LGPL $@ - ${CHMOD} 0444 $@ + chmod 0444 $@ -@if [ -z "${Q}" ]; then \ echo ''; \ echo '=-=-= skipping the cat of help/$@ =-=-='; \ @@ -471,12 +418,10 @@ detaillist: clean: rm -f obj mkbuiltin funclist.c funclist.o funclist - rm -f COPYING COPYING-LGPL clobber: rm -f ${BLT_HELP_FILES} full .all calc rm -f obj mkbuiltin funclist.c funclist.o funclist - rm -f COPYING COPYING-LGPL rm -f ${SINGULAR_FILES} ${DETAIL_CLONE} install: all @@ -504,12 +449,11 @@ install: all rm -f ${HELPDIR}/$$i; \ echo cp $$i ${HELPDIR}; \ cp $$i ${HELPDIR}; \ - echo ${CHMOD} 0444 ${HELPDIR}/$$i; \ - ${CHMOD} 0444 ${HELPDIR}/$$i; \ + echo chmod 0444 ${HELPDIR}/$$i; \ + chmod 0444 ${HELPDIR}/$$i; \ done rm -f ${HELPDIR}/obj cp obj.file ${HELPDIR}/obj - ${CHMOD} 0444 ${HELPDIR}/obj - ${Q}echo remove files that are obsolete - -rm -f rmblk block stdlib - -rm -f ${HELPDIR}/rmblk ${HELPDIR}/block ${HELPDIR}/stdlib + chmod 0444 ${HELPDIR}/obj + # remove dead files + -@rm -f rmblk block diff --git a/help/abs b/help/abs index 63831ae..9b55ba5 100644 --- a/help/abs +++ b/help/abs @@ -38,34 +38,8 @@ EXAMPLE LIMITS none -LINK LIBRARY +LIBRARY NUMBER *qqabs(NUMBER *x) SEE ALSO cmp, epsilon, hypot, norm, near, obj - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: abs,v 29.1 1999/12/14 09:15:40 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/abs,v $ -## -## Under source code control: 1994/03/19 01:40:22 -## File existed as early as: 1994 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/access b/help/access index ea0d8d3..4f34901 100644 --- a/help/access +++ b/help/access @@ -42,34 +42,8 @@ LIMITS There may be implementation-dependent limits inherited from the system call "access" used by this function. -LINK LIBRARY +LIBRARY none SEE ALSO fopen, fclose, isfile, files - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: access,v 29.1 1999/12/14 09:15:40 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/access,v $ -## -## Under source code control: 1996/04/30 03:36:20 -## File existed as early as: 1996 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/acos b/help/acos index 5c5a4ff..79e9316 100644 --- a/help/acos +++ b/help/acos @@ -23,34 +23,8 @@ EXAMPLE LIMITS none -LINK LIBRARY +LIBRARY NUMBER *qacos(NUMBER *x, NUMBER *eps) SEE ALSO asin, atan, asec, acsc, acot, epsilon - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: acos,v 29.1 1999/12/14 09:15:40 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/acos,v $ -## -## Under source code control: 1994/03/19 01:40:23 -## File existed as early as: 1994 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/acosh b/help/acosh index 85a630d..2d51694 100644 --- a/help/acosh +++ b/help/acosh @@ -26,34 +26,8 @@ EXAMPLE LIMITS none -LINK LIBRARY +LIBRARY NUMBER *qacosh(NUMBER *x, NUMBER *eps) SEE ALSO asinh, atanh, asech, acsch, acoth, epsilon - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: acosh,v 29.1 1999/12/14 09:15:40 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/acosh,v $ -## -## Under source code control: 1994/03/19 01:40:24 -## File existed as early as: 1994 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/acot b/help/acot index 5bf9952..9c2ff90 100644 --- a/help/acot +++ b/help/acot @@ -23,34 +23,8 @@ EXAMPLE LIMITS none -LINK LIBRARY +LIBRARY NUMBER *qacot(NUMBER *x, NUMBER *eps) SEE ALSO asin, acos, atan, asec, acsc, epsilon - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: acot,v 29.1 1999/12/14 09:15:40 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/acot,v $ -## -## Under source code control: 1995/11/13 03:49:00 -## File existed as early as: 1995 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/acoth b/help/acoth index d956d98..3657858 100644 --- a/help/acoth +++ b/help/acoth @@ -25,34 +25,8 @@ EXAMPLE LIMITS none -LINK LIBRARY +LIBRARY NUMBER *qacoth(NUMBER *x, NUMBER *eps) SEE ALSO asinh, acosh, atanh, asech, acsch, epsilon - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: acoth,v 29.1 1999/12/14 09:15:40 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/acoth,v $ -## -## Under source code control: 1995/11/13 03:49:01 -## File existed as early as: 1995 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/acsc b/help/acsc index a4d47ca..cd1d3e0 100644 --- a/help/acsc +++ b/help/acsc @@ -23,34 +23,8 @@ EXAMPLE LIMITS none -LINK LIBRARY +LIBRARY NUMBER *qacsc(NUMBER *x, NUMBER *eps) SEE ALSO asin, acos, atan, asec, acot, epsilon - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: acsc,v 29.1 1999/12/14 09:15:40 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/acsc,v $ -## -## Under source code control: 1995/11/13 03:49:00 -## File existed as early as: 1995 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/acsch b/help/acsch index 8b0c039..0e8f0d3 100644 --- a/help/acsch +++ b/help/acsch @@ -26,34 +26,8 @@ EXAMPLE LIMITS none -LINK LIBRARY +LIBRARY NUMBER *qacsch(NUMBER *x, NUMBER *eps) SEE ALSO asinh, acosh, atanh, asech, acoth, epsilon - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: acsch,v 29.1 1999/12/14 09:15:41 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/acsch,v $ -## -## Under source code control: 1995/11/13 03:49:01 -## File existed as early as: 1995 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/address b/help/address index d66c2a2..90539fe 100644 --- a/help/address +++ b/help/address @@ -154,34 +154,8 @@ EXAMPLE LIMITS none -LINK LIBRARY +LIBRARY none SEE ALSO dereference, isptr - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: address,v 29.1 1999/12/14 09:15:41 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/address,v $ -## -## Under source code control: 1997/09/06 20:03:34 -## File existed as early as: 1997 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/agd b/help/agd index c5f12f7..dd74620 100644 --- a/help/agd +++ b/help/agd @@ -50,34 +50,8 @@ EXAMPLE LIMITS none -LINK LIBRARY +LIBRARY COMPLEX *cagd(COMPLEX *x, NUMBER *eps) SEE ALSO gd, exp, ln, sin, sinh, etc. - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: agd,v 29.1 1999/12/14 09:15:41 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/agd,v $ -## -## Under source code control: 1997/09/06 20:03:34 -## File existed as early as: 1997 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/append b/help/append index bdcb833..23b6827 100644 --- a/help/append +++ b/help/append @@ -53,34 +53,8 @@ EXAMPLE LIMITS append() can have at most 100 arguments -LINK LIBRARY +LIBRARY none SEE ALSO delete, insert, islist, list, pop, push, remove, rsearch, search, size - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: append,v 29.1 1999/12/14 09:15:41 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/append,v $ -## -## Under source code control: 1994/03/19 03:13:17 -## File existed as early as: 1994 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/appr b/help/appr index 14f8d79..232b1aa 100644 --- a/help/appr +++ b/help/appr @@ -143,36 +143,10 @@ EXAMPLES LIMITS none -LINK LIBRARY +LIBRARY NUMBER *qmappr(NUMBER *q, NUMBER *e, long R); LIST *listappr(LIST *oldlp, VALUE *v2, VALUE *v3); MATRIX *matappr(MATRIX *m, VALUE *v2, VALUE *v3); SEE ALSO round, bround, cfappr, cfsim - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: appr,v 29.1 1999/12/14 09:15:41 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/appr,v $ -## -## Under source code control: 1994/09/25 17:18:21 -## File existed as early as: 1994 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/archive b/help/archive index 1bc03d0..7c41431 100644 --- a/help/archive +++ b/help/archive @@ -14,29 +14,3 @@ Landon Curt Noll http://reality.sgi.com/chongo/ chongo /\../\ - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: archive,v 29.1 1999/12/14 09:15:41 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/archive,v $ -## -## Under source code control: 1996/06/13 02:51:48 -## File existed as early as: 1996 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/arg b/help/arg index d09ea76..6de8fcc 100644 --- a/help/arg +++ b/help/arg @@ -26,34 +26,8 @@ EXAMPLE LIMITS none -LINK LIBRARY +LIBRARY none SEE ALSO conj, im, polar, re - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: arg,v 29.1 1999/12/14 09:15:41 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/arg,v $ -## -## Under source code control: 1994/09/25 20:22:31 -## File existed as early as: 1994 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/argv b/help/argv deleted file mode 100644 index 2d6892b..0000000 --- a/help/argv +++ /dev/null @@ -1,80 +0,0 @@ -NAME - argv - count or value of a calc command line supplied argument - -SYNOPSIS - argv([n]) - -TYPES - n nonnegative integer - - return any - -DESCRIPTION - Without args, this builtin returns the number of calc command line - strings available. - - If the numeric arg is supplied, then the corresponding command line - string is return, if it exists. Otherwise a nul() value is returned. - - In keeping with the argc/argv convention of C, argv(0) will refer - to the 1st argv string, and argv(argv()-1) will refer to the last. - This differs from the way the param() builtin works. - - By default, calc will evaluate all of its command line arguments. - However, if calc is invoked with -s, all non-dashed options will - be left as unevaluated strings. Thus: - - calc -i 2+2 - - will cause calc to print 4 and enter interactive mode. In this case - argv() will return 0. - - On the other hand: - - calc -i -s 2+2 - - will cause calc to interactive mode. The argv() builtin will return 1 - and argv(0) will return the string "2+2". - -EXAMPLE - $ calc -s a bb ccc - > argc = argv(); - > for (i = 0; i < argc; i++) print "argv[": i : '] = "': argv(i) : '"'; - argv[0] = "a" - argv[1] = "bb" - argv[2] = "ccc" - -LIMITS - 0 <= n < 2^31 - -LINK LIBRARY - none - -SEE ALSO - param, usage - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: argv,v 29.1 1999/12/14 09:15:41 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/argv,v $ -## -## Under source code control: 1999/11/23 19:45:05 -## File existed as early as: 1999 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/arrow b/help/arrow index f953bd4..319e43d 100644 --- a/help/arrow +++ b/help/arrow @@ -44,34 +44,8 @@ EXAMPLES LIMITS none -LINK LIBRARY +LIBRARY none SEE ALSO address, dereference, isptr, dot - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: arrow,v 29.1 1999/12/14 09:15:41 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/arrow,v $ -## -## Under source code control: 1997/09/06 20:03:34 -## File existed as early as: 1997 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/asec b/help/asec index 38dcea8..570ead8 100644 --- a/help/asec +++ b/help/asec @@ -23,34 +23,8 @@ EXAMPLE LIMITS none -LINK LIBRARY +LIBRARY NUMBER *qasec(NUMBER *x, NUMBER *eps) SEE ALSO asin, acos, atan, acsc, acot, epsilon - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: asec,v 29.1 1999/12/14 09:15:41 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/asec,v $ -## -## Under source code control: 1995/11/13 03:49:00 -## File existed as early as: 1995 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/asech b/help/asech index 45ce688..143b73a 100644 --- a/help/asech +++ b/help/asech @@ -25,34 +25,8 @@ EXAMPLE LIMITS none -LINK LIBRARY +LIBRARY NUMBER *qasech(NUMBER *x, NUMBER *eps) SEE ALSO asinh, acosh, atanh, acsch, acoth, epsilon - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: asech,v 29.1 1999/12/14 09:15:41 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/asech,v $ -## -## Under source code control: 1995/11/13 03:49:00 -## File existed as early as: 1995 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/asin b/help/asin index 303666b..28976bc 100644 --- a/help/asin +++ b/help/asin @@ -23,34 +23,8 @@ EXAMPLE LIMITS none -LINK LIBRARY +LIBRARY NUMBER *qasin(NUMBER *q, NUMBER *epsilon) SEE ALSO acos, atan, asec, acsc, acot, epsilon - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: asin,v 29.1 1999/12/14 09:15:42 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/asin,v $ -## -## Under source code control: 1994/03/19 01:40:24 -## File existed as early as: 1994 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/asinh b/help/asinh index b840ef1..4c28b60 100644 --- a/help/asinh +++ b/help/asinh @@ -25,34 +25,8 @@ EXAMPLE LIMITS none -LINK LIBRARY +LIBRARY NUMBER *qasinh(NUMBER *x, NUMBER *eps) SEE ALSO acosh, atanh, asech, acsch, acoth, epsilon - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: asinh,v 29.1 1999/12/14 09:15:42 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/asinh,v $ -## -## Under source code control: 1994/03/19 01:40:25 -## File existed as early as: 1994 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/assign b/help/assign index d43291b..6bc5d49 100644 --- a/help/assign +++ b/help/assign @@ -111,34 +111,8 @@ EXAMPLE LIMITS none -LINK LIBRARY +LIBRARY none SEE ALSO swap, quomod - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: assign,v 29.1 1999/12/14 09:15:42 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/assign,v $ -## -## Under source code control: 1995/05/11 21:03:23 -## File existed as early as: 1995 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/assoc b/help/assoc index c0567df..0971765 100644 --- a/help/assoc +++ b/help/assoc @@ -77,34 +77,8 @@ EXAMPLE LIMITS none -LINK LIBRARY +LIBRARY none SEE ALSO isassoc, rsearch, search, size - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: assoc,v 29.1 1999/12/14 09:15:42 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/assoc,v $ -## -## Under source code control: 1994/09/25 20:22:31 -## File existed as early as: 1994 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/atan b/help/atan index 9b08915..de9e50d 100644 --- a/help/atan +++ b/help/atan @@ -23,34 +23,8 @@ EXAMPLE LIMITS none -LINK LIBRARY +LIBRARY NUMBER *qatan(NUMBER *x, NUMBER *eps) SEE ALSO asin, acos, asec, acsc, acot, epsilon - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: atan,v 29.1 1999/12/14 09:15:42 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/atan,v $ -## -## Under source code control: 1994/03/19 01:40:25 -## File existed as early as: 1994 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/atan2 b/help/atan2 index 825e556..2ce6cea 100644 --- a/help/atan2 +++ b/help/atan2 @@ -30,34 +30,8 @@ EXAMPLE LIMITS none -LINK LIBRARY +LIBRARY NUMBER *qatan2(NUMBER *y, *x, *acc) SEE ALSO acos, asin, atan, cos, epsilon, sin, tan - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: atan2,v 29.1 1999/12/14 09:15:42 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/atan2,v $ -## -## Under source code control: 1994/03/19 01:40:26 -## File existed as early as: 1994 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/atanh b/help/atanh index 5a23633..f1dbb3e 100644 --- a/help/atanh +++ b/help/atanh @@ -25,34 +25,8 @@ EXAMPLE LIMITS none -LINK LIBRARY +LIBRARY NUMBER *qatanh(NUMBER *x, NUMBER *eps) SEE ALSO asinh, acosh, asech, acsch, acoth, epsilon - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: atanh,v 29.1 1999/12/14 09:15:42 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/atanh,v $ -## -## Under source code control: 1994/03/19 01:40:27 -## File existed as early as: 1994 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/avg b/help/avg index 6c8faac..9af5c50 100644 --- a/help/avg +++ b/help/avg @@ -43,34 +43,8 @@ EXAMPLE LIMITS The number of arguments is not to exceed 100. -LINK LIBRARY +LIBRARY none SEE ALSO hmean - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: avg,v 29.1 1999/12/14 09:15:42 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/avg,v $ -## -## Under source code control: 1994/09/25 20:22:31 -## File existed as early as: 1994 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/base b/help/base index a14a84b..88166ab 100644 --- a/help/base +++ b/help/base @@ -72,7 +72,7 @@ EXAMPLE LIMITS none -LINK LIBRARY +LIBRARY int math_setmode(int newmode) NOTE: newmode must be one of MODE_DEFAULT, MODE_FRAC, MODE_INT, @@ -80,29 +80,3 @@ LINK LIBRARY SEE ALSO config - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: base,v 29.1 1999/12/14 09:15:42 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/base,v $ -## -## Under source code control: 1994/09/30 00:09:39 -## File existed as early as: 1994 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/bit b/help/bit index ebe4470..b1b5fb1 100644 --- a/help/bit +++ b/help/bit @@ -36,34 +36,8 @@ EXAMPLE LIMITS -2^31 < y < 2^31 -LINK LIBRARY +LIBRARY BOOL qbit(NUMBER *x, long y) SEE ALSO highbit, lowbit, digit - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: bit,v 29.1 1999/12/14 09:15:42 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/bit,v $ -## -## Under source code control: 1994/10/21 02:21:30 -## File existed as early as: 1994 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/blk b/help/blk index 9951257..47bd3e8 100644 --- a/help/blk +++ b/help/blk @@ -212,34 +212,8 @@ LIMITS 1 <= chunk < 2^31 -LINK LIBRARY +LIBRARY XXX SEE ALSO blocks, blkfree - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: blk,v 29.1 1999/12/14 09:15:42 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/blk,v $ -## -## Under source code control: 1997/04/05 13:07:13 -## File existed as early as: 1997 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/blkcpy b/help/blkcpy index 119a2e9..f94c002 100644 --- a/help/blkcpy +++ b/help/blkcpy @@ -185,34 +185,8 @@ EXAMPLE LIMITS none -LINK LIBRARY +LIBRARY none SEE ALSO blk, mat, file, list, str - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: blkcpy,v 29.1 1999/12/14 09:15:42 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/blkcpy,v $ -## -## Under source code control: 1997/04/05 14:08:50 -## File existed as early as: 1997 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/blkfree b/help/blkfree index 3b6edc8..7dfcf47 100644 --- a/help/blkfree +++ b/help/blkfree @@ -51,34 +51,8 @@ EXAMPLE LIMITS none -LINK LIBRARY +LIBRARY none SEE ALSO blk, blocks - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: blkfree,v 29.1 1999/12/14 09:15:43 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/blkfree,v $ -## -## Under source code control: 1997/04/05 13:07:13 -## File existed as early as: 1997 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/blocks b/help/blocks index 846ee6a..dff2682 100644 --- a/help/blocks +++ b/help/blocks @@ -36,34 +36,8 @@ EXAMPLE LIMITS none -LINK LIBRARY +LIBRARY none SEE ALSO blk, blkfree - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: blocks,v 29.1 1999/12/14 09:15:43 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/blocks,v $ -## -## Under source code control: 1997/04/05 13:07:13 -## File existed as early as: 1997 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/bround b/help/bround index 3cc8908..06cdc08 100644 --- a/help/bround +++ b/help/bround @@ -113,7 +113,7 @@ LIMITS 0 <= abs(plcs) < 2^31 0 <= abs(rnd) < 2^31 -LINK LIBRARY +LIBRARY void broundvalue(VALUE *x, VALUE *plcs, VALUE *rnd, VALUE *result) MATRIX *matbround(MATRIX *m, VALUE *plcs, VALUE *rnd); LIST *listbround(LIST *m, VALUE *plcs, VALUE *rnd); @@ -121,29 +121,3 @@ LINK LIBRARY SEE ALSO round, trunc, btrunc, int, appr - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: bround,v 29.1 1999/12/14 09:15:43 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/bround,v $ -## -## Under source code control: 1994/09/30 00:22:35 -## File existed as early as: 1994 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/btrunc b/help/btrunc index a79414f..7326e81 100644 --- a/help/btrunc +++ b/help/btrunc @@ -37,34 +37,8 @@ EXAMPLE LIMITS abs(j) < 2^31 -LINK LIBRARY +LIBRARY NUMBER *qbtrunc(NUMBER *x, *j) SEE ALSO bround, int, round, trunc - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: btrunc,v 29.1 1999/12/14 09:15:43 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/btrunc,v $ -## -## Under source code control: 1994/09/30 00:44:27 -## File existed as early as: 1994 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/builtin.end b/help/builtin.end index a3039b3..9cff0ab 100644 --- a/help/builtin.end +++ b/help/builtin.end @@ -198,29 +198,3 @@ For convenience, any non-integer value is assumed to mean "frac", and any integer >= 2^64 is assumed to mean "exp". - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: builtin.end,v 29.1 1999/12/14 09:15:43 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/builtin.end,v $ -## -## Under source code control: 1995/07/10 01:17:53 -## File existed as early as: 1995 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/builtin.top b/help/builtin.top index f05fa87..d4ec0c5 100644 --- a/help/builtin.top +++ b/help/builtin.top @@ -7,28 +7,3 @@ Builtin functions description refers to values or numbers. This display is generated by the 'show builtin' command. -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: builtin.top,v 29.1 1999/12/14 09:15:44 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/builtin.top,v $ -## -## Under source code control: 1995/07/10 01:17:53 -## File existed as early as: 1995 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/calclevel b/help/calclevel index d157e5d..82641d8 100644 --- a/help/calclevel +++ b/help/calclevel @@ -28,34 +28,8 @@ EXAMPLE LIMITS none -LINK LIBRARY +LIBRARY none SEE ALSO eval, read, quit, abort, inputlevel - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: calclevel,v 29.1 1999/12/14 09:15:44 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/calclevel,v $ -## -## Under source code control: 1999/10/31 06:01:21 -## File existed as early as: 1999 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/ceil b/help/ceil index 5b07e79..8647ed9 100644 --- a/help/ceil +++ b/help/ceil @@ -26,34 +26,8 @@ EXAMPLE LIMITS none -LINK LIBRARY +LIBRARY none SEE ALSO floor, int - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: ceil,v 29.1 1999/12/14 09:15:44 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/ceil,v $ -## -## Under source code control: 1994/09/30 01:12:01 -## File existed as early as: 1994 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/cfappr b/help/cfappr index 82b95ac..262f6a7 100644 --- a/help/cfappr +++ b/help/cfappr @@ -82,34 +82,8 @@ EXAMPLE LIMITS none -LINK LIBRARY +LIBRARY NUMBER *qcfappr(NUMBER *q, NUMBER *epsilon, long R) SEE ALSO appr, cfsim - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: cfappr,v 29.1 1999/12/14 09:15:44 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/cfappr,v $ -## -## Under source code control: 1994/09/30 01:23:59 -## File existed as early as: 1994 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/cfsim b/help/cfsim index e83c414..4a405ae 100644 --- a/help/cfsim +++ b/help/cfsim @@ -107,34 +107,8 @@ EXAMPLE LIMITS none -LINK LIBRARY +LIBRARY NUMBER *qcfsim(NUMBER *x, long rnd) SEE ALSO cfappr - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: cfsim,v 29.1 1999/12/14 09:15:44 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/cfsim,v $ -## -## Under source code control: 1994/09/30 01:29:45 -## File existed as early as: 1994 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/char b/help/char index 50e311d..0d7e71d 100644 --- a/help/char +++ b/help/char @@ -20,34 +20,8 @@ EXAMPLE LIMITS none -LINK LIBRARY +LIBRARY none SEE ALSO ord - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: char,v 29.1 1999/12/14 09:15:44 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/char,v $ -## -## Under source code control: 1994/09/30 01:45:45 -## File existed as early as: 1994 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/cmdbuf b/help/cmdbuf index b19451e..aacdf11 100644 --- a/help/cmdbuf +++ b/help/cmdbuf @@ -22,34 +22,8 @@ EXAMPLE LIMITS none -LINK LIBRARY +LIBRARY none SEE ALSO XXX - fill in - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: cmdbuf,v 29.1 1999/12/14 09:15:44 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/cmdbuf,v $ -## -## Under source code control: 1995/07/09 04:05:58 -## File existed as early as: 1995 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/cmp b/help/cmp index e43b8ae..2a3f3a4 100644 --- a/help/cmp +++ b/help/cmp @@ -107,35 +107,9 @@ EXAMPLE LIMITS none -LINK LIBRARY +LIBRARY FLAG qrel(NUMBER *q1, NUMBER *q2) FLAG zrel(ZVALUE z1, ZVALUE z2) SEE ALSO sgn, test, operator - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: cmp,v 29.1 1999/12/14 09:15:44 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/cmp,v $ -## -## Under source code control: 1994/10/20 02:52:30 -## File existed as early as: 1994 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/comb b/help/comb index 7bbe9c9..062e428 100644 --- a/help/comb +++ b/help/comb @@ -32,34 +32,8 @@ LIMITS y < 2^24 x-y < 2^24 -LINK LIBRARY +LIBRARY void zcomb(ZVALUE x, ZVALUE y, ZVALUE *res) SEE ALSO fact, perm - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: comb,v 29.1 1999/12/14 09:15:44 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/comb,v $ -## -## Under source code control: 1994/10/20 04:03:02 -## File existed as early as: 1994 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/command b/help/command index 32820d5..de2760a 100644 --- a/help/command +++ b/help/command @@ -44,31 +44,31 @@ Command sequence ------------------ read filename read -once filename - This reads definitions from the specified calc resource filename. - - The name can be quoted if desired. The calculator uses the - CALCPATH environment variable to search through the specified - directories for the filename, similarly to the use of the - PATH environment variable. If CALCPATH is not defined, - then a default path which is usually ":/usr/local/lib/calc" - is used. - - The ".cal" extension is defaulted for input files, so that - if "filename" is not found, then "filename.cal" is then - searched for. The contents of the filename are command - sequences which can consist of expressions to evaluate or - functions to define, just like at the top level command level. + This reads definitions from the specified filename. + The name can be quoted if desired. The calculator + uses the CALCPATH environment variable to search + through the specified directories for the filename, + similarly to the use of the PATH environment variable. + If CALCPATH is not defined, then a default path which is + usually ":/usr/local/lib/calc" is used (that is, the current + directory followed by a general calc library directory). + The ".cal" extension is defaulted for input files, so + that if "filename" is not found, then "filename.cal" is + then searched for. The contents of the filename are + command sequences which can consist of expressions to + evaluate or functions to define, just like at the top + level command level. When -once is given, the read command acts like the regular read expect that it will ignore filename if is has been previously read. - The read -once form is particularly useful in a resource - file that needs to read a 2nd resource file. By using the - READ -once command, one will not reread that 2nd resource - file, nor will once risk entering into a infinite READ loop - (where that 2nd resource file directly or indirectly does - a READ of the first resource file). + The read -once form is particularly useful in a library that + needs to read a 2nd library. By using the READ -once + command, one will not reread that 2nd library, nor will + once risk entering into a infinite READ loop (where + that 2nd library directly or indirectly does a READ of + the first library). If the -m mode disallows opening of files for reading, this command will be disabled. @@ -306,29 +306,3 @@ Command sequence statement flow control and declaration statements usage how to invoke the calc command and calc -options - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: command,v 29.1 1999/12/14 09:15:44 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/command,v $ -## -## Under source code control: 1991/07/21 04:37:17 -## File existed as early as: 1991 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/config b/help/config index 15ae4ee..2eed795 100644 --- a/help/config +++ b/help/config @@ -41,13 +41,10 @@ Configuration parameters "blkbase" block output base "blkfmt" block output format "calc_debug" controls internal calc debug information - "resource_debug" controls resource file debug information + "lib_debug" controls library script debug information "user_debug" for user defined debug information "verbose_quit" TRUE=>print message on empty quit or abort "ctrl_d" The interactive meaning of ^D (Control D) - "program" Read-only calc program or shell script path - "basename" Read-only basename of the program value - "version" Read-only calc version The "all" config value allows one to save/restore the configuration set of values. The return of: @@ -139,8 +136,7 @@ Detailed config descriptions 8: the opcodes for a new functions are displayed when the function is successfully defined. - See also resource_debug, calc_debug and user_debug below for more - debug levels. + See also lib_debug, calc_debug and user_debug below for more debug levels. =-= @@ -483,9 +479,9 @@ Detailed config descriptions that test its operation, or collect or display information that might be useful for debug purposes. Much of the output from these will make sense only to calc wizards. Zero value (the default for - both oldstd and newstd) of config("resource_debug") corresponds to - switching off all these routines. For nonzero value, particular - bits currently have the following meanings: + both oldstd and newstd) of config("lib_calc") corresponds to switching + off all these routines. For nonzero value, particular bits + currently have the following meanings: n Meaning of bit n of config("calc_debug") @@ -516,17 +512,16 @@ Detailed config descriptions =-= - config("resource_debug", bitflag) config("lib_debug", bitflag) - The "resource_debug" parameter is intended for controlling the possible + The "lib_debug" parameter is intended for controlling the possible display of special information relating to functions, objects, and other structures created by instructions in calc scripts. - Zero value of config("resource_debug") means that no such information + Zero value of config("lib_debug") means that no such information is displayed. For other values, the non-zero bits which currently have meanings are as follows: - n Meaning of bit n of config("resource_debug") + n Meaning of bit n of config("lib_debug") 0 When a function is defined, redefined or undefined at interactive level, a message saying what has been done @@ -539,16 +534,13 @@ Detailed config descriptions 2 Show func will display more information about a functions arguments as well as more argument sdummary information. - The value for config("resource_debug") in both oldstd and newstd is 3, + The value for config("lib_debug") in both oldstd and newstd is 3, but if calc is invoked with the -d flag, its initial value is zero. - Thus, if calc is started without the -d flag, until config("resource_debug") + Thus, if calc is started without the -d flag, until config("lib_debug") is changed, a message will be output when a function is defined either interactively or during the reading of a file. - The name config("lib_debug") is equivalent to config("resource_debug") - and is included for backward compatibility. - - By default, "resource_debug" is 3. The -d flag changes this default to 0. + By default, "lib_debug" is 3. The -d flag changes this default to 0. The initial value may be overridden by the -D command line option. =-= @@ -557,7 +549,7 @@ Detailed config descriptions The "user_debug" is provided for use by users. Calc ignores this value other than to set it to 0 by default (for both "oldstd" and "newstd"). - No calc code or standard resource should change this value. Users + No calc code or shipped library should change this value. Users should feel free to use it in any way. In particular they may use particular bits for special purposes as with "calc_debug", or they may use it to indicate a debug level with larger values @@ -645,65 +637,3 @@ Detailed config descriptions config("ctrl_d", "never_eof"),; to their ~/.calcrc startup file to prevent ^D from causing calc to exit. - - =-= - - config("program") <== NOTE: This is a read-only config value - - The full path to the calc program, or the calc shell script can be - obtained by: - - config("program") - - This config parameter is read-only and cannot be set. - - =-= - - config("basename") <== NOTE: This is a read-only config value - - The calc program, or the calc shell script basename can be obtained by: - - config("basename") - - The config("basename") is the config("program") without any leading - path. If config("program") has a / in it, config("basename") is - everything after the last /, otherwise config("basename") is the - same as config("program"). - - This config parameter is read-only and cannot be set. - - =-= - - config("version") <== NOTE: This is a read-only config value - - The version string of the calc program can be obtained by: - - config("version") - - This config parameter is read-only and cannot be set. - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: config,v 29.1 1999/12/14 09:15:44 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/config,v $ -## -## Under source code control: 1991/07/21 04:37:17 -## File existed as early as: 1991 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/conj b/help/conj index 231e3b5..8056ad8 100644 --- a/help/conj +++ b/help/conj @@ -34,34 +34,8 @@ EXAMPLE LIMITS none -LINK LIBRARY +LIBRARY void conjvalue(VALUE *x, *res) SEE ALSO norm, abs, arg - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: conj,v 29.1 1999/12/14 09:15:45 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/conj,v $ -## -## Under source code control: 1995/10/03 10:40:01 -## File existed as early as: 1995 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/contrib b/help/contrib index a45d68e..5c20b26 100644 --- a/help/contrib +++ b/help/contrib @@ -1,7 +1,6 @@ We welcome and encourage you to send us: - * calc resource files - * calc shell scripts + * calc scripts * any builtin functions that you have modified or written * custom functions that you have modified or written * any other source code modifications @@ -78,29 +77,3 @@ Landon Curt Noll http://reality.sgi.com/chongo/ chongo /\../\ - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: contrib,v 29.1 1999/12/14 09:15:45 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/contrib,v $ -## -## Under source code control: 1997/03/09 16:33:22 -## File existed as early as: 1997 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/cos b/help/cos index 8eaa497..518faae 100644 --- a/help/cos +++ b/help/cos @@ -18,7 +18,7 @@ EXAMPLE > print cos(1, 1e-5), cos(1, 1e-10), cos(1, 1e-15), cos(1, 1e-20) .5403 .5403023059 .54030230586814 .5403023058681397174 - > print cos(2 + 3i, 1e-5), cos(2 + 3i, 1e-10) + > print cos(2 +3i, 1e-5), cos(2 + 3i, 1e-10) -4.18963-9.10923i -4.189625691-9.1092278938i > pi = pi(1e-20) @@ -28,35 +28,9 @@ EXAMPLE LIMITS none -LINK LIBRARY +LIBRARY NUMBER *qcos(NUMBER *x, NUMBER *eps) COMPLEX *ccos(COMPLEX *x, NUMBER *eps) SEE ALSO sin, tan, sec, csc, cot, epsilon - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: cos,v 29.1 1999/12/14 09:15:45 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/cos,v $ -## -## Under source code control: 1994/03/19 01:40:27 -## File existed as early as: 1994 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/cosh b/help/cosh index 14875d9..cf2fba4 100644 --- a/help/cosh +++ b/help/cosh @@ -23,34 +23,8 @@ EXAMPLE LIMITS none -LINK LIBRARY +LIBRARY NUMBER *qcosh(NUMBER *x, NUMBER *eps) SEE ALSO sinh, tanh, sech, csch, coth, epsilon - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: cosh,v 29.1 1999/12/14 09:15:45 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/cosh,v $ -## -## Under source code control: 1994/03/19 01:40:28 -## File existed as early as: 1994 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/cot b/help/cot index 77481cf..d7ad156 100644 --- a/help/cot +++ b/help/cot @@ -21,34 +21,8 @@ EXAMPLE LIMITS none -LINK LIBRARY +LIBRARY NUMBER *qcot(NUMBER *x, NUMBER *eps) SEE ALSO sin, cos, tan, sec, csc, epsilon - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: cot,v 29.1 1999/12/14 09:15:45 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/cot,v $ -## -## Under source code control: 1995/11/13 03:49:00 -## File existed as early as: 1995 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/coth b/help/coth index 7dce301..6e90458 100644 --- a/help/coth +++ b/help/coth @@ -23,34 +23,8 @@ EXAMPLE LIMITS none -LINK LIBRARY +LIBRARY NUMBER *qcoth(NUMBER *x, NUMBER *eps) SEE ALSO sinh, cosh, tanh, sech, csch, epsilon - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: coth,v 29.1 1999/12/14 09:15:45 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/coth,v $ -## -## Under source code control: 1995/11/13 03:49:00 -## File existed as early as: 1995 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/count b/help/count index 3f21cf2..5b73ff6 100644 --- a/help/count +++ b/help/count @@ -24,34 +24,8 @@ EXAMPLE LIMITS none -LINK LIBRARY +LIBRARY none SEE ALSO select, modify - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: count,v 29.1 1999/12/14 09:15:46 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/count,v $ -## -## Under source code control: 1995/07/10 02:09:31 -## File existed as early as: 1995 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/cp b/help/cp index b8266a8..35031fe 100644 --- a/help/cp +++ b/help/cp @@ -30,34 +30,8 @@ LIMITS The components of the matrices are to be of types for which the required algebraic operations have been defined. -LINK LIBRARY +LIBRARY MATRIX *matcross(MATRIX *x, MATRIX *y) SEE ALSO dp - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: cp,v 29.1 1999/12/14 09:15:46 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/cp,v $ -## -## Under source code control: 1995/10/05 04:52:26 -## File existed as early as: 1995 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/credit b/help/credit index 406d2e3..d3483a3 100644 --- a/help/credit +++ b/help/credit @@ -9,7 +9,7 @@ Credits release control functions as well as other calc maintenance functions. Thanks for suggestions and encouragement from Peter Miller, - Neil Justusson, Ernest W. Bowen and Landon Noll. + Neil Justusson, and Landon Noll. Thanks to Stephen Rothwell for writing the original version of hist.c which is used to do the command line editing. @@ -26,67 +26,10 @@ Credits Most of this source and binary has one of the following copyrights: - Copyright (C) year David I. Bell - Copyright (C) year David I. Bell and Landon Curt Noll - Copyright (C) year David I. Bell and Ernest Bowen - Copyright (C) year David I. Bell, Landon Curt Noll and Ernest Bowen - Copyright (C) year Landon Curt Noll - Copyright (C) year Ernest Bowen and Landon Curt Noll - Copyright (C) year Ernest Bowen + Copyright (c) year David I. Bell + Copyright (c) year David I. Bell and Landon Curt Noll + Copyright (c) year Landon Curt Noll + Copyright (c) year Ernest Bowen and Landon Curt Noll - -Copying / Calc GNU Lesser General Public License - - Calc is open software, and is covered under version 2.1 of the GNU - Lesser General Public License. You are welcome to change it and/or - distribute copies of it under certain conditions. The calc commands: - - help copying - help copying-lgpl - - should display the contents of the COPYING and COPYING-LGPL files. - Those files contain information about the calc's GNU Lesser General - Public License, and in particular the conditions under which you - are allowed to change it and/or distribute copies of it. - - You should have received a copy of the version 2.1 GNU - Lesser General Public License. If you do not have these - files, write to: - - Free Software Foundation, Inc. - 59 Temple Place - Suite 330 - Boston, MA 02111-1307 - USA - -See also: - - help copyright - help copying - help copying-lgpl - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: credit,v 29.1 1999/12/14 09:15:46 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/credit,v $ -## -## Under source code control: 1991/07/23 05:47:24 -## File existed as early as: 1991 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ + Permission is granted to use, distribute, or modify this source, + provided that this copyright notice remains intact. diff --git a/help/csc b/help/csc index 66943b3..3fbadd0 100644 --- a/help/csc +++ b/help/csc @@ -21,34 +21,8 @@ EXAMPLE LIMITS none -LINK LIBRARY +LIBRARY NUMBER *qcsc(NUMBER *x, NUMBER *eps) SEE ALSO sin, cos, tan, sec, cot, epsilon - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: csc,v 29.1 1999/12/14 09:15:46 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/csc,v $ -## -## Under source code control: 1995/11/13 03:49:00 -## File existed as early as: 1995 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/csch b/help/csch index 920840d..e898a64 100644 --- a/help/csch +++ b/help/csch @@ -23,34 +23,8 @@ EXAMPLE LIMITS none -LINK LIBRARY +LIBRARY NUMBER *qcsch(NUMBER *x, NUMBER *eps) SEE ALSO sinh, cosh, tanh, sech, coth, epsilon - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: csch,v 29.1 1999/12/14 09:15:46 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/csch,v $ -## -## Under source code control: 1995/11/13 03:49:00 -## File existed as early as: 1995 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/ctime b/help/ctime index e68d68a..e2f9d5a 100644 --- a/help/ctime +++ b/help/ctime @@ -22,34 +22,8 @@ EXAMPLE LIMITS none -LINK LIBRARY +LIBRARY none SEE ALSO runtime, time - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: ctime,v 29.1 1999/12/14 09:15:46 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/ctime,v $ -## -## Under source code control: 1996/04/30 03:05:18 -## File existed as early as: 1996 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/custom b/help/custom index 6aa0820..98e02c2 100644 --- a/help/custom +++ b/help/custom @@ -59,7 +59,7 @@ DESCRIPTION custom() - A few resource files that uses these function are also provided + A few library script that uses these function are also provided to serve as usage examples. We welcome submissions for new custom functions. For information @@ -88,34 +88,8 @@ EXAMPLE LIMITS By default, custom is limited to 100 args. -LINK LIBRARY +LIBRARY none SEE ALSO custom_cal, new_custom, contrib - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: custom,v 29.1 1999/12/14 09:15:47 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/custom,v $ -## -## Under source code control: 1997/03/09 16:33:22 -## File existed as early as: 1997 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/define b/help/define index f93c672..06883fd 100644 --- a/help/define +++ b/help/define @@ -114,29 +114,3 @@ Function definitions 7: ADD 8: RETURN - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: define,v 29.1 1999/12/14 09:15:47 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/define,v $ -## -## Under source code control: 1991/07/21 04:37:18 -## File existed as early as: 1991 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/delete b/help/delete index e9a4a48..8561857 100644 --- a/help/delete +++ b/help/delete @@ -35,34 +35,8 @@ EXAMPLE LIMITS none -LINK LIBRARY +LIBRARY none SEE ALSO append, insert, pop, push, remove, size - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: delete,v 29.1 1999/12/14 09:15:47 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/delete,v $ -## -## Under source code control: 1994/03/19 03:13:18 -## File existed as early as: 1994 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/den b/help/den index 94d0f34..413b1b4 100644 --- a/help/den +++ b/help/den @@ -32,34 +32,8 @@ EXAMPLE LIMITS none -LINK LIBRARY +LIBRARY NUMBER *qden(NUMBER *x) SEE ALSO num - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: den,v 29.1 1999/12/14 09:15:47 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/den,v $ -## -## Under source code control: 1995/10/05 04:52:26 -## File existed as early as: 1995 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/dereference b/help/dereference index c9959a5..6bce97b 100644 --- a/help/dereference +++ b/help/dereference @@ -75,34 +75,8 @@ EXAMPLE LIMITS none -LINK LIBRARY +LIBRARY none SEE ALSO address, isptr - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: dereference,v 29.1 1999/12/14 09:15:47 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/dereference,v $ -## -## Under source code control: 1997/09/06 20:03:34 -## File existed as early as: 1997 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/det b/help/det index 6e490ba..9a5e10f 100644 --- a/help/det +++ b/help/det @@ -67,34 +67,8 @@ EXAMPLE LIMITS none -LINK LIBRARY +LIBRARY VALUE matdet(MATRIX *m) SEE ALSO matdim, matmax, matmin, inverse - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: det,v 29.1 1999/12/14 09:15:47 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/det,v $ -## -## Under source code control: 1995/11/28 11:17:47 -## File existed as early as: 1995 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/digit b/help/digit index 4aac6df..3fb0e6f 100644 --- a/help/digit +++ b/help/digit @@ -31,34 +31,8 @@ EXAMPLE LIMITS If x is not an integer, y > -2^31 -LINK LIBRARY +LIBRARY long qdigit(NUMBER *x, long y) SEE ALSO bit - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: digit,v 29.1 1999/12/14 09:15:47 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/digit,v $ -## -## Under source code control: 1995/10/03 10:40:01 -## File existed as early as: 1995 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/digits b/help/digits index 8711ecb..90ad245 100644 --- a/help/digits +++ b/help/digits @@ -20,34 +20,8 @@ EXAMPLE LIMITS none -LINK LIBRARY +LIBRARY long qdigits(NUMBER *x) SEE ALSO places - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: digits,v 29.1 1999/12/14 09:15:47 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/digits,v $ -## -## Under source code control: 1995/10/03 10:40:01 -## File existed as early as: 1995 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/dp b/help/dp index a822363..017f899 100644 --- a/help/dp +++ b/help/dp @@ -30,34 +30,8 @@ EXAMPLE LIMITS none -LINK LIBRARY +LIBRARY VALUE matdot(MATRIX *x, MATRIX *y) SEE ALSO cp - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: dp,v 29.1 1999/12/14 09:15:47 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/dp,v $ -## -## Under source code control: 1995/10/05 04:52:26 -## File existed as early as: 1995 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/environment b/help/environment index 28a7fea..a04ba99 100644 --- a/help/environment +++ b/help/environment @@ -3,13 +3,12 @@ Environment variables CALCPATH A :-separated list of directories used to search for - resource filenames (*.cal files) that do not begin with - /, ./ or ~. + scripts filenames that do not begin with /, ./ or ~. If this variable does not exist, a compiled value is used. Typically compiled in value is: - .:./cal:~/cal:${LIBDIR}/calc:${LIBDIR}/custom + .:./lib:~/lib:${LIBDIR}/calc:${LIBDIR}/custom where ${LIBDIR} is usually: @@ -87,29 +86,3 @@ Environment variables If this variable does not exist, a compiled value is used. Typically compiled in value is something such as 'sh' is used. - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: environment,v 29.1 1999/12/14 09:15:47 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/environment,v $ -## -## Under source code control: 1991/07/23 05:47:25 -## File existed as early as: 1991 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/epsilon b/help/epsilon index 83c7e5b..ce1993d 100644 --- a/help/epsilon +++ b/help/epsilon @@ -26,35 +26,9 @@ EXAMPLE LIMITS none -LINK LIBRARY +LIBRARY void setepsilon(NUMBER *eps) NUMBER *_epsilon_ SEE ALSO config - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: epsilon,v 29.1 1999/12/14 09:15:47 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/epsilon,v $ -## -## Under source code control: 1995/10/05 04:52:26 -## File existed as early as: 1995 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/errcount b/help/errcount index 4a9b3e5..11b9f01 100644 --- a/help/errcount +++ b/help/errcount @@ -39,34 +39,8 @@ EXAMPLE LIMITS 0 <= num < 2^32 -LINK LIBRARY +LIBRARY none SEE ALSO errmax, error, strerror, iserror, errno, newerror, errorcodes - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: errcount,v 29.1 1999/12/14 09:15:47 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/errcount,v $ -## -## Under source code control: 1997/03/08 08:51:14 -## File existed as early as: 1997 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/errmax b/help/errmax index 79637c5..5c32ae2 100644 --- a/help/errmax +++ b/help/errmax @@ -33,34 +33,8 @@ EXAMPLE LIMITS 0 <= num < 2^32 -LINK LIBRARY +LIBRARY none SEE ALSO errcount, error, strerror, iserror, errno, newerror, errorcodes - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: errmax,v 29.1 1999/12/14 09:15:47 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/errmax,v $ -## -## Under source code control: 1997/03/08 08:51:14 -## File existed as early as: 1997 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/errno b/help/errno index c3f6018..df4928a 100644 --- a/help/errno +++ b/help/errno @@ -47,34 +47,8 @@ EXAMPLE LIMITS none -LINK LIBRARY +LIBRARY none SEE ALSO errmax, errcount, error, strerror, iserror, newerror, errorcodes - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: errno,v 29.1 1999/12/14 09:15:47 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/errno,v $ -## -## Under source code control: 1994/10/27 03:05:08 -## File existed as early as: 1994 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/error b/help/error index 26feb76..c4e5a8f 100644 --- a/help/error +++ b/help/error @@ -34,34 +34,8 @@ EXAMPLE LIMITS none -LINK LIBRARY +LIBRARY none SEE ALSO errcount, errmax, errorcodes, iserror, errno, strerror, newerror - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: error,v 29.1 1999/12/14 09:15:47 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/error,v $ -## -## Under source code control: 1995/12/18 03:30:59 -## File existed as early as: 1995 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/errorcodes.hdr b/help/errorcodes.hdr index fb08099..83f2db0 100644 --- a/help/errorcodes.hdr +++ b/help/errorcodes.hdr @@ -1,27 +1,2 @@ Calc generated error codes (see the error help file): -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: errorcodes.hdr,v 29.1 1999/12/14 09:15:48 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/errorcodes.hdr,v $ -## -## Under source code control: 1995/12/18 03:19:11 -## File existed as early as: 1995 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/errorcodes.sed b/help/errorcodes.sed index 8baa4c9..79fca55 100644 --- a/help/errorcodes.sed +++ b/help/errorcodes.sed @@ -1,27 +1 @@ /^#define E_[^_].*[ ][1-9][0-9]*[ ]\/\* .* \*\//s/#define E_.*[ ]\([1-9][0-9]*\)[ ]*\/\* \(.*\)[ ][ ]*\*\// \1 \2/p - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: errorcodes.sed,v 29.1 1999/12/14 09:15:48 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/errorcodes.sed,v $ -## -## Under source code control: 1995/12/18 03:19:11 -## File existed as early as: 1995 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/eval b/help/eval index 3b785ba..28135cf 100644 --- a/help/eval +++ b/help/eval @@ -54,34 +54,8 @@ LIMITS Similarly, if str1 = "2 + eval(str2)", str2 should not include a call to eval(str1), etc. -LINK LIBRARY +LIBRARY none SEE ALSO command, expression, define, prompt - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: eval,v 29.1 1999/12/14 09:15:48 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/eval,v $ -## -## Under source code control: 1995/12/18 03:30:59 -## File existed as early as: 1995 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/exp b/help/exp index 4182796..64e9e43 100644 --- a/help/exp +++ b/help/exp @@ -33,35 +33,9 @@ EXAMPLE LIMITS x < 693093 -LINK LIBRARY +LIBRARY NUMBER *qexp(NUMBER *x, NUMBER *eps) COMPLEX *cexp(COMPLEX *x, NUMBER *eps) SEE ALSO ln, cosh, sinh, tanh - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: exp,v 29.1 1999/12/14 09:15:48 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/exp,v $ -## -## Under source code control: 1995/10/11 04:41:26 -## File existed as early as: 1995 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/expression b/help/expression index 4b3e356..52a6d8e 100644 --- a/help/expression +++ b/help/expression @@ -33,29 +33,3 @@ Expression sequences If a return statement is executed in an expression sequence, then the result of the expression sequence is the returned value. In this case, '.' is set to the value, but nothing is printed. - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: expression,v 29.1 1999/12/14 09:15:48 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/expression,v $ -## -## Under source code control: 1991/07/21 04:37:18 -## File existed as early as: 1991 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/fact b/help/fact index a4840b2..d1dff95 100644 --- a/help/fact +++ b/help/fact @@ -26,34 +26,8 @@ LIMITS 2^24 > x >= 0 y < 2^24 -LINK LIBRARY +LIBRARY void zfact(NUMBER x, *ret) SEE ALSO comb, perm - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: fact,v 29.1 1999/12/14 09:15:48 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/fact,v $ -## -## Under source code control: 1994/10/20 04:03:02 -## File existed as early as: 1994 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/factor b/help/factor index 6f9b1a6..9f83677 100644 --- a/help/factor +++ b/help/factor @@ -34,34 +34,8 @@ EXAMPLE LIMITS none -LINK LIBRARY +LIBRARY FLAG zfactor(ZVALUE n, ZVALUE limit, ZVALUE *res) SEE ALSO lfactor - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: factor,v 29.1 1999/12/14 09:15:48 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/factor,v $ -## -## Under source code control: 1995/12/18 12:34:57 -## File existed as early as: 1995 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/fclose b/help/fclose index d43c6e1..177201f 100644 --- a/help/fclose +++ b/help/fclose @@ -44,35 +44,9 @@ EXAMPLE LIMITS fd != files(0) && fd != files(1) && fd != files(2) -LINK LIBRARY +LIBRARY none SEE ALSO errno, fclose, feof, ferror, fflush, fgetc, fgetline, fgets, files, fopen, fprintf, fputc, fputs, fseek, fsize, ftell, isfile, printf, prompt - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: fclose,v 29.1 1999/12/14 09:15:48 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/fclose,v $ -## -## Under source code control: 1994/10/27 03:04:16 -## File existed as early as: 1994 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/fcnt b/help/fcnt index a3c02b8..4040666 100644 --- a/help/fcnt +++ b/help/fcnt @@ -24,34 +24,8 @@ EXAMPLE LIMITS none -LINK LIBRARY +LIBRARY long zfacrem(ZVALUE x, ZVALUE y, ZVALUE *rem) SEE ALSO frem, gcdrem - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: fcnt,v 29.1 1999/12/14 09:15:48 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/fcnt,v $ -## -## Under source code control: 1995/12/18 12:03:02 -## File existed as early as: 1995 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/feof b/help/feof index 84fc755..8d5893d 100644 --- a/help/feof +++ b/help/feof @@ -35,36 +35,10 @@ EXAMPLE LIMITS none -LINK LIBRARY +LIBRARY none SEE ALSO errno, fclose, feof, ferror, fflush, fgetc, fgetline, fgets, files, fopen, fprintf, fputc, fputs, fseek, fsize, ftell, isfile, printf, prompt - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: feof,v 29.1 1999/12/14 09:15:49 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/feof,v $ -## -## Under source code control: 1994/10/27 03:04:17 -## File existed as early as: 1994 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/ferror b/help/ferror index 248e919..32b5d05 100644 --- a/help/ferror +++ b/help/ferror @@ -25,35 +25,9 @@ EXAMPLE LIMITS fd must be associated with an open file -LINK LIBRARY +LIBRARY none SEE ALSO errno, fclose, feof, ferror, fflush, fgetc, fgetline, fgets, files, fopen, fprintf, fputc, fputs, fseek, fsize, ftell, isfile, printf, prompt - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: ferror,v 29.1 1999/12/14 09:15:49 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/ferror,v $ -## -## Under source code control: 1994/10/27 03:04:17 -## File existed as early as: 1994 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/fflush b/help/fflush index 791aae0..cebc04f 100644 --- a/help/fflush +++ b/help/fflush @@ -20,35 +20,9 @@ EXAMPLE LIMITS fd must be associated with an open file -LINK LIBRARY +LIBRARY none SEE ALSO errno, fclose, feof, ferror, fflush, fgetc, fgetline, fgets, files, fopen, fprintf, fputc, fputs, fseek, fsize, ftell, isfile, printf, prompt - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: fflush,v 29.1 1999/12/14 09:15:49 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/fflush,v $ -## -## Under source code control: 1994/10/27 03:04:17 -## File existed as early as: 1994 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/fgetc b/help/fgetc index 6e40c7a..cad480a 100644 --- a/help/fgetc +++ b/help/fgetc @@ -27,35 +27,9 @@ EXAMPLE LIMITS fd must be associated with an open file -LINK LIBRARY +LIBRARY none SEE ALSO errno, fclose, feof, ferror, fflush, fgetc, fgetline, fgets, files, fopen, fprintf, fputc, fputs, fseek, fsize, ftell, isfile, printf, prompt - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: fgetc,v 29.1 1999/12/14 09:15:49 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/fgetc,v $ -## -## Under source code control: 1995/03/04 11:33:19 -## File existed as early as: 1995 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/fgetfield b/help/fgetfield index d70eb74..e7aa4df 100644 --- a/help/fgetfield +++ b/help/fgetfield @@ -45,34 +45,8 @@ EXAMPLE LIMITS none - XXX - is this correct? -LINK LIBRARY +LIBRARY none - XXX - is this correct? SEE ALSO fgetstr, fputstr, fgets, fputs, fopen, files, fprintf - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: fgetfield,v 29.1 1999/12/14 09:15:49 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/fgetfield,v $ -## -## Under source code control: 1996/04/30 03:05:17 -## File existed as early as: 1996 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/fgetline b/help/fgetline index 058a45a..9eac634 100644 --- a/help/fgetline +++ b/help/fgetline @@ -43,35 +43,9 @@ EXAMPLE LIMITS fd must be associated with an open file -LINK LIBRARY +LIBRARY none SEE ALSO errno, fclose, feof, ferror, fflush, fgetc, fgetline, fgets, files, fopen, fprintf, fputc, fputs, fseek, fsize, ftell, isfile, printf, prompt - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: fgetline,v 29.1 1999/12/14 09:15:49 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/fgetline,v $ -## -## Under source code control: 1995/03/04 11:33:19 -## File existed as early as: 1995 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/fgets b/help/fgets index 0e38151..938547a 100644 --- a/help/fgets +++ b/help/fgets @@ -32,35 +32,9 @@ EXAMPLE LIMITS fd must be associated with an open file -LINK LIBRARY +LIBRARY none SEE ALSO errno, fclose, feof, ferror, fflush, fgetc, fgetline, fgets, files, fopen, fprintf, fputc, fputs, fseek, fsize, ftell, isfile, printf, prompt - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: fgets,v 29.1 1999/12/14 09:15:49 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/fgets,v $ -## -## Under source code control: 1995/03/04 11:33:19 -## File existed as early as: 1995 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/fgetstr b/help/fgetstr index 4c54c32..2d3ed58 100644 --- a/help/fgetstr +++ b/help/fgetstr @@ -41,34 +41,8 @@ EXAMPLE LIMITS none - XXX - is this correct? -LINK LIBRARY +LIBRARY none - XXX - is this correct? SEE ALSO fputstr, fgetword, fgets, fputs, fopen, files, fprintf - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: fgetstr,v 29.1 1999/12/14 09:15:49 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/fgetstr,v $ -## -## Under source code control: 1996/04/30 03:05:17 -## File existed as early as: 1996 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/fib b/help/fib index 3e96118..8fb25c6 100644 --- a/help/fib +++ b/help/fib @@ -21,34 +21,8 @@ EXAMPLE LIMITS none -LINK LIBRARY +LIBRARY NUMBER *qfib(NUMBER *n) SEE ALSO XXX - fill in - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: fib,v 29.1 1999/12/14 09:15:49 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/fib,v $ -## -## Under source code control: 1995/10/25 04:03:45 -## File existed as early as: 1995 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/file b/help/file index 05cf4d4..c555159 100644 --- a/help/file +++ b/help/file @@ -165,29 +165,3 @@ Using files The 'strprintf' function formats output similarly to 'printf', but the output is returned as a string value instead of being printed. - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: file,v 29.1 1999/12/14 09:15:49 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/file,v $ -## -## Under source code control: 1991/07/21 04:37:19 -## File existed as early as: 1991 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/files b/help/files index 14cc149..86066ae 100644 --- a/help/files +++ b/help/files @@ -61,35 +61,9 @@ EXAMPLE LIMITS none -LINK LIBRARY +LIBRARY none SEE ALSO errno, fclose, feof, ferror, fflush, fgetc, fgetline, fgets, files, fopen, fprintf, fputc, fputs, fseek, fsize, ftell, isfile, printf, prompt - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: files,v 29.1 1999/12/14 09:15:50 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/files,v $ -## -## Under source code control: 1995/03/04 11:33:19 -## File existed as early as: 1995 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/floor b/help/floor index 9bb3bd7..0b54e11 100644 --- a/help/floor +++ b/help/floor @@ -26,34 +26,8 @@ EXAMPLE LIMITS none -LINK LIBRARY +LIBRARY none SEE ALSO ceil, int - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: floor,v 29.1 1999/12/14 09:15:50 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/floor,v $ -## -## Under source code control: 1994/09/30 01:12:01 -## File existed as early as: 1994 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/fopen b/help/fopen index 6ef6e70..a60fb57 100644 --- a/help/fopen +++ b/help/fopen @@ -67,35 +67,9 @@ EXAMPLE LIMITS none -LINK LIBRARY +LIBRARY none SEE ALSO errno, fclose, feof, ferror, fflush, fgetc, fgetline, fgets, files, fopen, fprintf, fputc, fputs, fseek, fsize, ftell, isfile, printf, prompt - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: fopen,v 29.1 1999/12/14 09:15:50 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/fopen,v $ -## -## Under source code control: 1994/10/27 03:04:17 -## File existed as early as: 1994 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/forall b/help/forall index a5a530c..15f2c98 100644 --- a/help/forall +++ b/help/forall @@ -31,34 +31,8 @@ EXAMPLE LIMITS none -LINK LIBRARY +LIBRARY none SEE ALSO modify - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: forall,v 29.1 1999/12/14 09:15:50 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/forall,v $ -## -## Under source code control: 1995/07/10 02:09:31 -## File existed as early as: 1995 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/fprintf b/help/fprintf index 88630ab..5aec583 100644 --- a/help/fprintf +++ b/help/fprintf @@ -48,34 +48,8 @@ EXAMPLE LIMITS The number of arguments of fprintf() is not to exceed 100. -LINK LIBRARY +LIBRARY none SEE ALSO printf, strprintf, print - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: fprintf,v 29.1 1999/12/14 09:15:50 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/fprintf,v $ -## -## Under source code control: 1996/03/12 22:50:41 -## File existed as early as: 1996 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/fputc b/help/fputc index 51543a2..e64dfd9 100644 --- a/help/fputc +++ b/help/fputc @@ -24,35 +24,9 @@ EXAMPLE LIMITS fd must be associated with an open file -LINK LIBRARY +LIBRARY none SEE ALSO errno, fclose, feof, ferror, fflush, fgetc, fgetline, fgets, files, fopen, fprintf, fputc, fputs, fseek, fsize, ftell, isfile, printf, prompt - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: fputc,v 29.1 1999/12/14 09:15:50 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/fputc,v $ -## -## Under source code control: 1995/03/04 11:33:20 -## File existed as early as: 1995 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/fputs b/help/fputs index 5a67cb3..e2ae8bd 100644 --- a/help/fputs +++ b/help/fputs @@ -24,35 +24,9 @@ EXAMPLE LIMITS fd must be associated with an open file -LINK LIBRARY +LIBRARY none SEE ALSO errno, fclose, feof, ferror, fflush, fgetc, fgetline, fgets, files, fopen, fprintf, fputc, fputs, fseek, fsize, ftell, isfile, printf, prompt - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: fputs,v 29.1 1999/12/14 09:15:50 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/fputs,v $ -## -## Under source code control: 1995/03/04 11:33:20 -## File existed as early as: 1995 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/fputstr b/help/fputstr index e380284..4110d9f 100644 --- a/help/fputstr +++ b/help/fputstr @@ -33,34 +33,8 @@ EXAMPLE LIMITS none - XXX - is this correct? -LINK LIBRARY +LIBRARY none - XXX - is this correct? SEE ALSO fgetstr, fgetfield, fgets, fputs, fopen, files, fprintf - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: fputstr,v 29.1 1999/12/14 09:15:50 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/fputstr,v $ -## -## Under source code control: 1996/04/30 03:05:18 -## File existed as early as: 1996 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/frac b/help/frac index 2ab3723..ceffe4c 100644 --- a/help/frac +++ b/help/frac @@ -33,36 +33,10 @@ EXAMPLE LIMITS none -LINK LIBRARY +LIBRARY NUMBER *qfrac(NUMBER *x) COMPLEX *cfrac(COMPLEX *x) MATRIX *matfrac(MATRIX *x) SEE ALSO int, ceil, floor - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: frac,v 29.1 1999/12/14 09:15:50 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/frac,v $ -## -## Under source code control: 1995/12/18 03:30:59 -## File existed as early as: 1995 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/free b/help/free index 88a57da..2038edb 100644 --- a/help/free +++ b/help/free @@ -29,34 +29,8 @@ EXAMPLE LIMITS none -LINK LIBRARY +LIBRARY none SEE ALSO freeglobals, freestatics, freeredc - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: free,v 29.1 1999/12/14 09:15:50 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/free,v $ -## -## Under source code control: 1997/09/06 20:03:35 -## File existed as early as: 1997 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/freeglobals b/help/freeglobals index e7adbb5..514811d 100644 --- a/help/freeglobals +++ b/help/freeglobals @@ -40,34 +40,8 @@ EXAMPLE LIMITS none -LINK LIBRARY +LIBRARY none SEE ALSO free, freestatics, freeredc - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: freeglobals,v 29.1 1999/12/14 09:15:51 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/freeglobals,v $ -## -## Under source code control: 1997/09/06 20:03:35 -## File existed as early as: 1997 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/freeredc b/help/freeredc index 02c5714..ba51ccb 100644 --- a/help/freeredc +++ b/help/freeredc @@ -24,34 +24,8 @@ EXAMPLE LIMITS none -LINK LIBRARY +LIBRARY none SEE ALSO free, freeglobals, freestatics - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: freeredc,v 29.1 1999/12/14 09:15:51 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/freeredc,v $ -## -## Under source code control: 1997/09/06 20:03:35 -## File existed as early as: 1997 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/freestatics b/help/freestatics index a474fee..3f8dd34 100644 --- a/help/freestatics +++ b/help/freestatics @@ -38,34 +38,8 @@ EXAMPLE LIMITS none -LINK LIBRARY +LIBRARY none SEE ALSO free, freeglobals, freeredc - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: freestatics,v 29.1 1999/12/14 09:15:51 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/freestatics,v $ -## -## Under source code control: 1997/09/06 20:03:35 -## File existed as early as: 1997 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/frem b/help/frem index e4b44fa..23585f8 100644 --- a/help/frem +++ b/help/frem @@ -30,34 +30,8 @@ EXAMPLE LIMITS none -LINK LIBRARY +LIBRARY NUMBER *qfacrem(NUMBER *x, NUMBER *y); SEE ALSO fcnt, gcdrem - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: frem,v 29.1 1999/12/14 09:15:51 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/frem,v $ -## -## Under source code control: 1995/12/18 12:03:02 -## File existed as early as: 1995 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/freopen b/help/freopen index 3f9eee1..b4b7953 100644 --- a/help/freopen +++ b/help/freopen @@ -34,35 +34,9 @@ EXAMPLE LIMITS none - XXX - is this correct? -LINK LIBRARY +LIBRARY none - XXX - is this correct? SEE ALSO errno, fclose, feof, ferror, fflush, fgetc, fgetline, fgets, files, fopen, fprintf, fputc, fputs, fseek, fsize, ftell, isfile, printf, prompt - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: freopen,v 29.1 1999/12/14 09:15:51 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/freopen,v $ -## -## Under source code control: 1996/04/30 03:05:18 -## File existed as early as: 1996 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/fscan b/help/fscan index 5aef4b5..d16125c 100644 --- a/help/fscan +++ b/help/fscan @@ -32,34 +32,8 @@ EXAMPLE LIMITS none - XXX - is this correct? -LINK LIBRARY +LIBRARY none - XXX - is this correct? SEE ALSO scan, strscan, fscanf, scanf, strscanf, printf, fprintf, strprintf - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: fscan,v 29.1 1999/12/14 09:15:51 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/fscan,v $ -## -## Under source code control: 1996/04/30 03:05:18 -## File existed as early as: 1996 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/fscanf b/help/fscanf index 8666ac9..9b4f56b 100644 --- a/help/fscanf +++ b/help/fscanf @@ -123,34 +123,8 @@ EXAMPLE LIMITS none - XXX - is this correct? -LINK LIBRARY +LIBRARY none - XXX - is this correct? SEE ALSO scanf, strscanf, printf, fprintf, strprintf, fscan, scan, strscan - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: fscanf,v 29.1 1999/12/14 09:15:51 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/fscanf,v $ -## -## Under source code control: 1996/04/30 03:05:18 -## File existed as early as: 1996 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/fseek b/help/fseek index 5331d9c..94528a9 100644 --- a/help/fseek +++ b/help/fseek @@ -60,34 +60,8 @@ LIMITS Some details of the operation of this function may be implementation- dependent, particularly for older systems. -LINK LIBRARY +LIBRARY none SEE ALSO ftell, fgetpos, fsetpos, rewind, strerror - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: fseek,v 29.1 1999/12/14 09:15:51 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/fseek,v $ -## -## Under source code control: 1995/03/04 11:33:20 -## File existed as early as: 1995 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/fsize b/help/fsize index 7c8d10e..e500f31 100644 --- a/help/fsize +++ b/help/fsize @@ -22,35 +22,9 @@ EXAMPLE LIMITS fd must be associated with an open file -LINK LIBRARY +LIBRARY none SEE ALSO errno, fclose, feof, ferror, fflush, fgetc, fgetline, fgets, files, fopen, fprintf, fputc, fputs, fseek, fsize, ftell, isfile, printf, prompt - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: fsize,v 29.1 1999/12/14 09:15:51 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/fsize,v $ -## -## Under source code control: 1995/03/04 11:33:20 -## File existed as early as: 1995 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/ftell b/help/ftell index e30bd83..08bfcc9 100644 --- a/help/ftell +++ b/help/ftell @@ -40,34 +40,8 @@ EXAMPLE LIMITS none -LINK LIBRARY +LIBRARY none SEE ALSO fseek, fgetpos, fsetpos, rewind, strerror - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: ftell,v 29.1 1999/12/14 09:15:52 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/ftell,v $ -## -## Under source code control: 1995/03/04 11:33:21 -## File existed as early as: 1995 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/funclist.sed b/help/funclist.sed index f9d5090..e5eff58 100644 --- a/help/funclist.sed +++ b/help/funclist.sed @@ -5,29 +5,3 @@ s/STRINGHEAD/int/ s/\(".*",.*,.*\),.*,.*,.*,.*,/\1, 0, 0, 0, 0,/ s/[ ][ ]*$// p - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: funclist.sed,v 29.1 1999/12/14 09:15:52 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/funclist.sed,v $ -## -## Under source code control: 1995/07/10 01:33:06 -## File existed as early as: 1995 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/gcd b/help/gcd index 71d06ac..0499158 100644 --- a/help/gcd +++ b/help/gcd @@ -21,34 +21,8 @@ EXAMPLE LIMITS The number of arguments may not to exceed 100. -LINK LIBRARY +LIBRARY NUMBER *qgcd(NUMBER *x1, NUMBER *x2) SEE ALSO lcm - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: gcd,v 29.1 1999/12/14 09:15:52 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/gcd,v $ -## -## Under source code control: 1995/10/05 04:52:26 -## File existed as early as: 1995 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/gcdrem b/help/gcdrem index 2c17c60..c38da66 100644 --- a/help/gcdrem +++ b/help/gcdrem @@ -47,34 +47,8 @@ EXAMPLE LIMITS none -LINK LIBRARY +LIBRARY NUMBER *qgcdrem(NUMBER *x, NUMBER *y) SEE ALSO gcd, frem, isrel - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: gcdrem,v 29.1 1999/12/14 09:15:52 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/gcdrem,v $ -## -## Under source code control: 1995/12/18 12:03:02 -## File existed as early as: 1995 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/gd b/help/gd index 2a780cb..fad927f 100644 --- a/help/gd +++ b/help/gd @@ -44,34 +44,8 @@ EXAMPLE LIMITS none -LINK LIBRARY +LIBRARY COMPLEX *cgd(COMPLEX *x, NUMBER *eps) SEE ALSO agd, exp, ln, sin, sinh, etc. - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: gd,v 29.1 1999/12/14 09:15:52 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/gd,v $ -## -## Under source code control: 1997/09/06 20:03:35 -## File existed as early as: 1997 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/getenv b/help/getenv index 832d179..17243d4 100644 --- a/help/getenv +++ b/help/getenv @@ -28,34 +28,8 @@ EXAMPLE LIMITS none -LINK LIBRARY +LIBRARY none SEE ALSO putenv - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: getenv,v 29.1 1999/12/14 09:15:52 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/getenv,v $ -## -## Under source code control: 1995/07/09 03:48:57 -## File existed as early as: 1995 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/hash b/help/hash index 5d91004..a3b5537 100644 --- a/help/hash +++ b/help/hash @@ -42,34 +42,8 @@ EXAMPLE LIMITS The number of arguments is not to exceed 100. -LINK LIBRARY +LIBRARY none SEE ALSO sha, sha1, md5 - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: hash,v 29.1 1999/12/14 09:15:52 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/hash,v $ -## -## Under source code control: 1996/03/12 23:10:01 -## File existed as early as: 1996 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/head b/help/head index 2228dec..70f4e00 100644 --- a/help/head +++ b/help/head @@ -42,34 +42,8 @@ EXAMPLE LIMITS none -LINK LIBRARY +LIBRARY none SEE ALSO tail, segment - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: head,v 29.1 1999/12/14 09:15:52 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/head,v $ -## -## Under source code control: 1995/07/10 02:09:30 -## File existed as early as: 1995 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/help b/help/help index 5bbc1af..03318e3 100644 --- a/help/help +++ b/help/help @@ -24,30 +24,26 @@ following topics: obj user defined data types operator math, relational, logic and variable access operators statement flow control and declaration statements + stdlib description of some lib files shipped with calc types builtin data types unexpected unexpected syntax/usage surprises for C programmers usage how to invoke the calc command variable variables and variable declarations bindings input & history character bindings - custom_cal information about custom calc resource files + custom_cal information about custom calc library files libcalc using the arbitrary precision routines in a C program new_custom information about how to add new custom functions - resource standard calc resource files - script using calc shell scripts + stdlib standard calc library files and standards archive where to get the latest versions of calc bugs known bugs and mis-features changes recent changes to calc contrib how to contribute scripts, code or custom functions + credit who wrote calc and who helped todo list of priority action items for calc wishlist wish list of future enhancements of calc - credit who wrote calc and who helped - copyright calc copyright and the GNU LGPL - copying details on the Calc GNU Lesser General Public License - copying-lgpl calc GNU Lesser General Public License text - full all of the above (in the above order) You can also ask for help on a particular function name. For example, @@ -101,29 +97,3 @@ As a hack, the following: as the same effect as: custom("help", "anything"); - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: help,v 29.1 1999/12/14 09:15:52 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/help,v $ -## -## Under source code control: 1991/07/21 04:37:20 -## File existed as early as: 1991 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/highbit b/help/highbit index acef4d2..b1e4bb5 100644 --- a/help/highbit +++ b/help/highbit @@ -22,34 +22,8 @@ EXAMPLE LIMITS none -LINK LIBRARY +LIBRARY LEN zhighbit(ZVALUE x); SEE ALSO lowbit, digits - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: highbit,v 29.1 1999/12/14 09:15:52 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/highbit,v $ -## -## Under source code control: 1995/10/03 10:40:02 -## File existed as early as: 1995 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/history b/help/history index 2397eb9..292f056 100644 --- a/help/history +++ b/help/history @@ -59,29 +59,3 @@ Command history A shell command can be executed by typing '!cmd', where cmd is the command to execute. If cmd is not given, then a shell command level is started. - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: history,v 29.1 1999/12/14 09:15:53 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/history,v $ -## -## Under source code control: 1991/07/21 04:37:20 -## File existed as early as: 1991 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/hmean b/help/hmean index 6179e53..11f730a 100644 --- a/help/hmean +++ b/help/hmean @@ -31,34 +31,8 @@ EXAMPLE LIMITS The number of arguments is not to exceed 100. -LINK LIBRARY +LIBRARY none SEE ALSO avg - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: hmean,v 29.1 1999/12/14 09:15:53 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/hmean,v $ -## -## Under source code control: 1995/12/18 03:30:59 -## File existed as early as: 1995 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/hnrmod b/help/hnrmod index db7cf4c..3d8f6d1 100644 --- a/help/hnrmod +++ b/help/hnrmod @@ -36,34 +36,8 @@ LIMITS 2^31 > n > 0 r == -1, 0 or 1 -LINK LIBRARY +LIBRARY void zhnrmod(ZVALUE v, ZVALUE h, ZVALUE zn, ZVALUE zr, ZVALUE *res) SEE ALSO mod - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: hnrmod,v 29.1 1999/12/14 09:15:53 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/hnrmod,v $ -## -## Under source code control: 1997/07/02 07:10:43 -## File existed as early as: 1997 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/hypot b/help/hypot index 189b1b7..398e64b 100644 --- a/help/hypot +++ b/help/hypot @@ -21,34 +21,8 @@ EXAMPLE LIMITS none -LINK LIBRARY +LIBRARY NUMBER *qhypot(NUMBER *q1, *q2, *epsilon) SEE ALSO ltol - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: hypot,v 29.1 1999/12/14 09:15:53 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/hypot,v $ -## -## Under source code control: 1995/10/05 04:52:26 -## File existed as early as: 1995 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/ilog b/help/ilog index 17a39c9..4885e78 100644 --- a/help/ilog +++ b/help/ilog @@ -21,34 +21,8 @@ LIMITS x > 0 b > 1 -LINK LIBRARY +LIBRARY long zlog(ZVALUE x, ZVALUE b) SEE ALSO ilog2, ilog10 - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: ilog,v 29.1 1999/12/14 09:15:53 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/ilog,v $ -## -## Under source code control: 1995/10/25 04:03:45 -## File existed as early as: 1995 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/ilog10 b/help/ilog10 index 4674cc2..cc52e21 100644 --- a/help/ilog10 +++ b/help/ilog10 @@ -19,34 +19,8 @@ EXAMPLE LIMITS none -LINK LIBRARY +LIBRARY long qilog10(NUMBER *q) SEE ALSO ilog2, ilog - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: ilog10,v 29.1 1999/12/14 09:15:53 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/ilog10,v $ -## -## Under source code control: 1995/10/03 10:40:02 -## File existed as early as: 1995 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/ilog2 b/help/ilog2 index f1d1c5a..6f4af4f 100644 --- a/help/ilog2 +++ b/help/ilog2 @@ -19,34 +19,8 @@ EXAMPLE LIMITS none -LINK LIBRARY +LIBRARY long qilog2(NUMBER *q) SEE ALSO ilog10, ilog - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: ilog2,v 29.1 1999/12/14 09:15:53 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/ilog2,v $ -## -## Under source code control: 1995/10/03 10:40:02 -## File existed as early as: 1995 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/im b/help/im index 5fffdac..c220207 100644 --- a/help/im +++ b/help/im @@ -19,34 +19,8 @@ EXAMPLE LIMITS none -LINK LIBRARY +LIBRARY COMPLEX *cimag(COMPLEX *x) SEE ALSO re - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: im,v 29.1 1999/12/14 09:15:53 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/im,v $ -## -## Under source code control: 1995/10/05 04:52:26 -## File existed as early as: 1995 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/indices b/help/indices index 295b0b1..ed7acb6 100644 --- a/help/indices +++ b/help/indices @@ -17,7 +17,7 @@ DESCRIPTION For other values of index, a null value is returned. This function can be useful for determining those elements for which - the indices satisfy some condition. This is particularly so for + the indices satisfy some condition. This is particularly so for associations since these have no simple relation between the double-bracket index and the single-bracket indices, which may be non-integer numbers or strings or other types of value. The @@ -50,35 +50,9 @@ EXAMPLE LIMITS abs(index) < 2^31 -LINK LIBRARY +LIBRARY LIST* associndices(ASSOC *ap, long index) LIST* matindices(MATRIX *mp, long index) SEE ALSO assoc, mat - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: indices,v 29.1 1999/12/14 09:15:53 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/indices,v $ -## -## Under source code control: 1999/11/16 08:02:03 -## File existed as early as: 1999 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/inputlevel b/help/inputlevel index 6462017..d940ca4 100644 --- a/help/inputlevel +++ b/help/inputlevel @@ -29,34 +29,8 @@ EXAMPLE LIMITS none -LINK LIBRARY +LIBRARY none SEE ALSO read, eval, quit, abort, calclevel - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: inputlevel,v 29.1 1999/12/14 09:15:53 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/inputlevel,v $ -## -## Under source code control: 1999/10/31 06:01:21 -## File existed as early as: 1999 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/insert b/help/insert index 5dcc56a..35f0ea3 100644 --- a/help/insert +++ b/help/insert @@ -52,34 +52,8 @@ LIMITS insert() can have at most 100 arguments o <= y <= size(x) -LINK LIBRARY +LIBRARY none SEE ALSO append, delete, islist, list, pop, push, remove, rsearch, search, size - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: insert,v 29.1 1999/12/14 09:15:54 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/insert,v $ -## -## Under source code control: 1994/03/19 03:13:18 -## File existed as early as: 1994 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/int b/help/int index 907e3aa..d8cd3d7 100644 --- a/help/int +++ b/help/int @@ -32,36 +32,10 @@ EXAMPLE LIMITS none -LINK LIBRARY +LIBRARY NUMBER *qint(NUMBER *x) COMPLEX *cint(COMPLEX *x) MATRIX *matint(MATRIX *x) SEE ALSO frac, ceil, floor, quo - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: int,v 29.1 1999/12/14 09:15:54 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/int,v $ -## -## Under source code control: 1994/09/30 00:57:18 -## File existed as early as: 1994 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/interrupt b/help/interrupt index 859b777..67f129b 100644 --- a/help/interrupt +++ b/help/interrupt @@ -26,29 +26,3 @@ Interrupts structures and unpredictable future behavior, and so should only be done as a last resort. You are advised to quit the calculator after this has been done. - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: interrupt,v 29.1 1999/12/14 09:15:54 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/interrupt,v $ -## -## Under source code control: 1991/07/21 04:37:21 -## File existed as early as: 1991 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/intro b/help/intro index 559ee32..0bdac59 100644 --- a/help/intro +++ b/help/intro @@ -57,29 +57,3 @@ Quick introduction For more information about the calc lauguage and features, try: help overview - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: intro,v 29.1 1999/12/14 09:15:54 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/intro,v $ -## -## Under source code control: 1991/07/21 04:37:21 -## File existed as early as: 1991 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/inverse b/help/inverse index e2fc8e5..0d7b9b3 100644 --- a/help/inverse +++ b/help/inverse @@ -39,36 +39,10 @@ EXAMPLE LIMITS none -LINK LIBRARY +LIBRARY void invertvalue(VALUE *x, VALUE *vres) NUMBER *qinv(NUMBER *x) COMPLEX *cinv(COMPLEX *x) MATRIX *matinv(MATRIX *x) SEE ALSO - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: inverse,v 29.1 1999/12/14 09:15:54 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/inverse,v $ -## -## Under source code control: 1996/03/12 23:10:01 -## File existed as early as: 1996 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/iroot b/help/iroot index 61a9688..85a0c93 100644 --- a/help/iroot +++ b/help/iroot @@ -20,34 +20,8 @@ EXAMPLE LIMITS n > 0 -LINK LIBRARY +LIBRARY NUMBER *qiroot(NUMBER *x, NUMBER* n) SEE ALSO isqrt, sqrt - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: iroot,v 29.1 1999/12/14 09:15:54 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/iroot,v $ -## -## Under source code control: 1995/10/25 04:03:45 -## File existed as early as: 1995 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/isassoc b/help/isassoc index 7b932c7..8fbb8cf 100644 --- a/help/isassoc +++ b/help/isassoc @@ -21,7 +21,7 @@ EXAMPLE LIMITS none -LINK LIBRARY +LIBRARY none SEE ALSO @@ -30,29 +30,3 @@ SEE ALSO ishash, isident, isint, islist, ismat, ismult, isnull, isnum, isobj, isobjtype, isodd, isprime, isrand, israndom, isreal, isrel, issimple, issq, isstr, istype - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: isassoc,v 29.1 1999/12/14 09:15:54 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/isassoc,v $ -## -## Under source code control: 1994/10/21 02:21:27 -## File existed as early as: 1994 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/isatty b/help/isatty index 3933e4f..8596943 100644 --- a/help/isatty +++ b/help/isatty @@ -23,7 +23,7 @@ EXAMPLE LIMITS none -LINK LIBRARY +LIBRARY none SEE ALSO @@ -33,29 +33,3 @@ SEE ALSO ishash, isident, isint, islist, ismat, ismult, isnull, isnum, isobj, isobjtype, isodd, isprime, isrand, israndom, isreal, isrel, issimple, issq, isstr, istype - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: isatty,v 29.1 1999/12/14 09:15:54 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/isatty,v $ -## -## Under source code control: 1995/07/09 03:49:34 -## File existed as early as: 1995 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/isblk b/help/isblk index fa96c59..a22206d 100644 --- a/help/isblk +++ b/help/isblk @@ -33,7 +33,7 @@ EXAMPLE LIMITS none -LINK LIBRARY +LIBRARY none - XXX ??? SEE ALSO @@ -42,29 +42,3 @@ SEE ALSO ishash, isident, isint, islist, ismat, ismult, isnull, isnum, isobj, isobjtype, isodd, isprime, isrand, israndom, isreal, isrel, issimple, issq, isstr, istype - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: isblk,v 29.1 1999/12/14 09:15:54 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/isblk,v $ -## -## Under source code control: 1997/04/06 03:03:23 -## File existed as early as: 1997 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/isconfig b/help/isconfig index 8bf9ed7..a4f9a1c 100644 --- a/help/isconfig +++ b/help/isconfig @@ -21,7 +21,7 @@ EXAMPLE LIMITS none -LINK LIBRARY +LIBRARY none SEE ALSO @@ -30,29 +30,3 @@ SEE ALSO ishash, isident, isint, islist, ismat, ismult, isnull, isnum, isobj, isobjtype, isodd, isprime, isrand, israndom, isreal, isrel, issimple, issq, isstr, istype - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: isconfig,v 29.1 1999/12/14 09:15:54 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/isconfig,v $ -## -## Under source code control: 1995/11/11 05:09:41 -## File existed as early as: 1995 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/isdefined b/help/isdefined index 61a60b4..3c4c2aa 100644 --- a/help/isdefined +++ b/help/isdefined @@ -33,7 +33,7 @@ EXAMPLE LIMITS none -LINK LIBRARY +LIBRARY none - XXX ? SEE ALSO @@ -42,29 +42,3 @@ SEE ALSO ishash, isident, isint, islist, ismat, ismult, isnull, isnum, isobj, isobjtype, isodd, isprime, isrand, israndom, isreal, isrel, issimple, issq, isstr, istype - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: isdefined,v 29.1 1999/12/14 09:15:55 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/isdefined,v $ -## -## Under source code control: 1997/04/05 14:10:17 -## File existed as early as: 1997 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/iserror b/help/iserror index b011d44..488e9c5 100644 --- a/help/iserror +++ b/help/iserror @@ -21,7 +21,7 @@ EXAMPLE LIMITS none -LINK LIBRARY +LIBRARY none SEE ALSO @@ -30,29 +30,3 @@ SEE ALSO ishash, isident, isint, islist, ismat, ismult, isnull, isnum, isobj, isobjtype, isodd, isprime, isrand, israndom, isreal, isrel, issimple, issq, isstr, istype - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: iserror,v 29.1 1999/12/14 09:15:55 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/iserror,v $ -## -## Under source code control: 1995/12/18 03:30:59 -## File existed as early as: 1995 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/iseven b/help/iseven index fd875db..f939d18 100644 --- a/help/iseven +++ b/help/iseven @@ -23,7 +23,7 @@ EXAMPLE LIMITS none -LINK LIBRARY +LIBRARY none SEE ALSO @@ -31,29 +31,3 @@ SEE ALSO ishash, isident, isint, islist, ismat, ismult, isnull, isnum, isobj, isobjtype, isodd, isprime, isrand, israndom, isreal, isrel, issimple, issq, isstr, istype - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: iseven,v 29.1 1999/12/14 09:15:55 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/iseven,v $ -## -## Under source code control: 1994/10/21 02:21:27 -## File existed as early as: 1994 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/isfile b/help/isfile index 8159eda..2c0cbf5 100644 --- a/help/isfile +++ b/help/isfile @@ -21,7 +21,7 @@ EXAMPLE LIMITS none -LINK LIBRARY +LIBRARY none SEE ALSO @@ -29,29 +29,3 @@ SEE ALSO ishash, isident, isint, islist, ismat, ismult, isnull, isnum, isobj, isobjtype, isodd, isprime, isrand, israndom, isreal, isrel, issimple, issq, isstr, istype - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: isfile,v 29.1 1999/12/14 09:15:55 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/isfile,v $ -## -## Under source code control: 1994/10/21 02:21:27 -## File existed as early as: 1994 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/ishash b/help/ishash index 9017ff2..0ad076e 100644 --- a/help/ishash +++ b/help/ishash @@ -25,7 +25,7 @@ EXAMPLE LIMITS none -LINK LIBRARY +LIBRARY none SEE ALSO @@ -34,29 +34,3 @@ SEE ALSO isident, isint, islist, ismat, ismult, isnull, isnum, isobj, isobjtype, isodd, isprime, isrand, israndom, isreal, isrel, issimple, issq, isstr, istype - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: ishash,v 29.1 1999/12/14 09:15:55 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/ishash,v $ -## -## Under source code control: 1995/11/11 05:09:41 -## File existed as early as: 1995 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/isident b/help/isident index 7181797..79b9152 100644 --- a/help/isident +++ b/help/isident @@ -21,7 +21,7 @@ EXAMPLE LIMITS none -LINK LIBRARY +LIBRARY none SEE ALSO @@ -30,29 +30,3 @@ SEE ALSO ishash, isint, islist, ismat, ismult, isnull, isnum, isobj, isobjtype, isodd, isprime, isrand, israndom, isreal, isrel, issimple, issq, isstr, istype - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: isident,v 29.1 1999/12/14 09:15:55 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/isident,v $ -## -## Under source code control: 1995/07/09 18:25:36 -## File existed as early as: 1995 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/isint b/help/isint index c007276..7937694 100644 --- a/help/isint +++ b/help/isint @@ -23,7 +23,7 @@ EXAMPLE LIMITS none -LINK LIBRARY +LIBRARY none SEE ALSO @@ -32,29 +32,3 @@ SEE ALSO ishash, isident, islist, ismat, ismult, isnull, isnum, isobj, isobjtype, isodd, isprime, isrand, israndom, isreal, isrel, issimple, issq, isstr, istype - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: isint,v 29.1 1999/12/14 09:15:55 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/isint,v $ -## -## Under source code control: 1994/10/21 02:21:27 -## File existed as early as: 1994 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/islist b/help/islist index 0e91209..2cf50ae 100644 --- a/help/islist +++ b/help/islist @@ -21,7 +21,7 @@ EXAMPLE LIMITS none -LINK LIBRARY +LIBRARY none SEE ALSO @@ -31,29 +31,3 @@ SEE ALSO ishash, isident, isint, ismat, ismult, isnull, isnum, isobj, isobjtype, isodd, isprime, isrand, israndom, isreal, isrel, issimple, issq, isstr, istype - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: islist,v 29.1 1999/12/14 09:15:55 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/islist,v $ -## -## Under source code control: 1994/03/19 03:13:19 -## File existed as early as: 1994 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/ismat b/help/ismat index c02b88a..f369345 100644 --- a/help/ismat +++ b/help/ismat @@ -21,7 +21,7 @@ EXAMPLE LIMITS none -LINK LIBRARY +LIBRARY none SEE ALSO @@ -30,29 +30,3 @@ SEE ALSO ishash, isident, isint, islist, ismult, isnull, isnum, isobj, isobjtype, isodd, isprime, isrand, israndom, isreal, isrel, issimple, issq, isstr, istype - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: ismat,v 29.1 1999/12/14 09:15:55 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/ismat,v $ -## -## Under source code control: 1994/10/21 02:21:28 -## File existed as early as: 1994 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/ismult b/help/ismult index 860d03b..040e7d0 100644 --- a/help/ismult +++ b/help/ismult @@ -28,7 +28,7 @@ EXAMPLE LIMITS none -LINK LIBRARY +LIBRARY BOOL qdivides(NUMBER *x, *y) BOOL zdivides(ZVALUE x, y) @@ -37,29 +37,3 @@ SEE ALSO ishash, isident, isint, islist, ismat, isnull, isnum, isobj, isobjtype, isodd, isprime, isrand, israndom, isreal, isrel, issimple, issq, isstr, istype - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: ismult,v 29.1 1999/12/14 09:15:55 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/ismult,v $ -## -## Under source code control: 1994/10/21 02:21:28 -## File existed as early as: 1994 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/isnull b/help/isnull index 600eaca..c62ccfa 100644 --- a/help/isnull +++ b/help/isnull @@ -21,7 +21,7 @@ EXAMPLE LIMITS none -LINK LIBRARY +LIBRARY none SEE ALSO @@ -29,29 +29,3 @@ SEE ALSO ishash, isident, isint, islist, ismat, ismult, isnum, isobj, isobjtype, isodd, isprime, isrand, israndom, isreal, isrel, issimple, issq, isstr, istype - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: isnull,v 29.1 1999/12/14 09:15:56 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/isnull,v $ -## -## Under source code control: 1994/10/21 02:21:28 -## File existed as early as: 1994 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/isnum b/help/isnum index 97f9a02..fd24a1b 100644 --- a/help/isnum +++ b/help/isnum @@ -23,7 +23,7 @@ EXAMPLE LIMITS none -LINK LIBRARY +LIBRARY none SEE ALSO @@ -31,29 +31,3 @@ SEE ALSO ishash, isident, isint, islist, ismat, ismult, isnull, isobj, isobjtype, isodd, isprime, isrand, israndom, isreal, isrel, issimple, issq, isstr, istype - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: isnum,v 29.1 1999/12/14 09:15:56 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/isnum,v $ -## -## Under source code control: 1994/10/21 02:21:28 -## File existed as early as: 1994 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/isobj b/help/isobj index 72b9a99..e399c71 100644 --- a/help/isobj +++ b/help/isobj @@ -21,7 +21,7 @@ EXAMPLE LIMITS none -LINK LIBRARY +LIBRARY none SEE ALSO @@ -30,29 +30,3 @@ SEE ALSO ishash, isident, isint, islist, ismat, ismult, isnull, isnum, isobjtype, isodd, isprime, isrand, israndom, isreal, isrel, issimple, issq, isstr, istype - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: isobj,v 29.1 1999/12/14 09:15:56 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/isobj,v $ -## -## Under source code control: 1994/10/21 02:21:29 -## File existed as early as: 1994 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/isobjtype b/help/isobjtype index 09bb876..8c70e7e 100644 --- a/help/isobjtype +++ b/help/isobjtype @@ -24,7 +24,7 @@ EXAMPLE LIMITS none -LINK LIBRARY +LIBRARY none - XXX ??? SEE ALSO @@ -33,29 +33,3 @@ SEE ALSO ishash, isident, isint, islist, ismat, ismult, isnull, isnum, isobj, isodd, isprime, isrand, israndom, isreal, isrel, issimple, issq, isstr, istype - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: isobjtype,v 29.1 1999/12/14 09:15:56 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/isobjtype,v $ -## -## Under source code control: 1997/04/05 14:10:17 -## File existed as early as: 1997 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/isodd b/help/isodd index 7c68113..5c08a7d 100644 --- a/help/isodd +++ b/help/isodd @@ -23,7 +23,7 @@ EXAMPLE LIMITS none -LINK LIBRARY +LIBRARY none SEE ALSO @@ -31,29 +31,3 @@ SEE ALSO ishash, isident, isint, islist, ismat, ismult, isnull, isnum, isobj, isobjtype, isprime, isrand, israndom, isreal, isrel, issimple, issq, isstr, istype - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: isodd,v 29.1 1999/12/14 09:15:56 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/isodd,v $ -## -## Under source code control: 1994/10/21 02:21:29 -## File existed as early as: 1994 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/isprime b/help/isprime index afb65a0..f4ee5ea 100644 --- a/help/isprime +++ b/help/isprime @@ -41,7 +41,7 @@ EXAMPLE LIMITS err not given and (y is even or y < 2^32) -LINK LIBRARY +LIBRARY FLAG zisprime(ZVALUE x) (return 1 if prime, 0 not prime, -1 if >= 2^32) SEE ALSO @@ -50,29 +50,3 @@ SEE ALSO ishash, isident, isint, islist, ismat, ismult, isnull, isnum, isobj, isobjtype, isodd, isrand, israndom, isreal, isrel, issimple, issq, isstr, istype - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: isprime,v 29.1 1999/12/14 09:15:56 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/isprime,v $ -## -## Under source code control: 1994/10/21 02:21:29 -## File existed as early as: 1994 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/isptr b/help/isptr index 03343af..b9dbb2c 100644 --- a/help/isptr +++ b/help/isptr @@ -34,34 +34,8 @@ EXAMPLE LIMITS none -LINK LIBRARY +LIBRARY none SEE ALSO isnum, isstr, isblk, isoctet - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: isptr,v 29.1 1999/12/14 09:15:56 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/isptr,v $ -## -## Under source code control: 1997/09/06 20:03:35 -## File existed as early as: 1997 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/isqrt b/help/isqrt index ff2d9f0..014c88c 100644 --- a/help/isqrt +++ b/help/isqrt @@ -19,34 +19,8 @@ EXAMPLE LIMITS x > 0 -LINK LIBRARY +LIBRARY NUMBER *qisqrt(NUMBER *x) SEE ALSO sqrt, iroot - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: isqrt,v 29.1 1999/12/14 09:15:56 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/isqrt,v $ -## -## Under source code control: 1995/10/25 04:03:45 -## File existed as early as: 1995 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/isrand b/help/isrand index ea1239e..9f798a1 100644 --- a/help/isrand +++ b/help/isrand @@ -21,7 +21,7 @@ EXAMPLE LIMITS none -LINK LIBRARY +LIBRARY none SEE ALSO @@ -30,29 +30,3 @@ SEE ALSO ishash, isident, isint, islist, ismat, ismult, isnull, isnum, isobj, isobjtype, isodd, isprime, israndom, isreal, isrel, issimple, issq, isstr, istype - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: isrand,v 29.1 1999/12/14 09:15:56 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/isrand,v $ -## -## Under source code control: 1995/11/11 05:09:41 -## File existed as early as: 1995 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/israndom b/help/israndom index 8ad067e..f6da8d2 100644 --- a/help/israndom +++ b/help/israndom @@ -23,7 +23,7 @@ EXAMPLE LIMITS none -LINK LIBRARY +LIBRARY none SEE ALSO @@ -32,29 +32,3 @@ SEE ALSO ishash, isident, isint, islist, ismat, ismult, isnull, isnum, isobj, isobjtype, isodd, isprime, isrand, isreal, isrel, issimple, issq, isstr, istype - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: israndom,v 29.1 1999/12/14 09:15:56 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/israndom,v $ -## -## Under source code control: 1995/11/11 05:09:41 -## File existed as early as: 1995 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/isreal b/help/isreal index 472236c..7be1354 100644 --- a/help/isreal +++ b/help/isreal @@ -23,7 +23,7 @@ EXAMPLE LIMITS none -LINK LIBRARY +LIBRARY none SEE ALSO @@ -31,29 +31,3 @@ SEE ALSO ishash, isident, isint, islist, ismat, ismult, isnull, isnum, isobj, isobjtype, isodd, isprime, isrand, israndom, isrel, issimple, issq, isstr, istype - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: isreal,v 29.1 1999/12/14 09:15:57 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/isreal,v $ -## -## Under source code control: 1994/10/21 02:21:30 -## File existed as early as: 1994 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/isrel b/help/isrel index 2025262..9ba5a46 100644 --- a/help/isrel +++ b/help/isrel @@ -24,7 +24,7 @@ EXAMPLE LIMITS none -LINK LIBRARY +LIBRARY BOOL zrelprime(ZVALUE x, y) SEE ALSO @@ -33,29 +33,3 @@ SEE ALSO ishash, isident, isint, islist, ismat, ismult, isnull, isnum, isobj, isobjtype, isodd, isprime, isrand, israndom, isreal, issimple, issq, isstr, istype - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: isrel,v 29.1 1999/12/14 09:15:57 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/isrel,v $ -## -## Under source code control: 1994/10/21 02:21:30 -## File existed as early as: 1994 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/issimple b/help/issimple index 47a9858..fc122d4 100644 --- a/help/issimple +++ b/help/issimple @@ -31,7 +31,7 @@ EXAMPLE LIMITS none -LINK LIBRARY +LIBRARY none SEE ALSO @@ -39,29 +39,3 @@ SEE ALSO ishash, isident, isint, islist, ismat, ismult, isnull, isnum, isobj, isobjtype, isodd, isprime, isrand, israndom, isreal, isrel, issq, isstr, istype - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: issimple,v 29.1 1999/12/14 09:15:57 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/issimple,v $ -## -## Under source code control: 1994/10/21 02:21:30 -## File existed as early as: 1994 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/issq b/help/issq index 33f9d2c..7cb689b 100644 --- a/help/issq +++ b/help/issq @@ -26,7 +26,7 @@ EXAMPLE LIMITS none -LINK LIBRARY +LIBRARY BOOL qissquare(NUMBER *x) BOOL zissquare(ZVALUE x) @@ -35,29 +35,3 @@ SEE ALSO ishash, isident, isint, islist, ismat, ismult, isnull, isnum, isobj, isobjtype, isodd, isprime, isrand, israndom, isreal, isrel, issimple, isstr, istype - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: issq,v 29.1 1999/12/14 09:15:57 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/issq,v $ -## -## Under source code control: 1994/10/21 02:21:31 -## File existed as early as: 1994 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/isstr b/help/isstr index ad1c71e..0121e4c 100644 --- a/help/isstr +++ b/help/isstr @@ -20,7 +20,7 @@ EXAMPLE LIMITS none -LINK LIBRARY +LIBRARY none SEE ALSO @@ -28,29 +28,3 @@ SEE ALSO ishash, isident, isint, islist, ismat, ismult, isnull, isnum, isobj, isobjtype, isodd, isprime, isrand, israndom, isreal, isrel, issimple, issq, istype - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: isstr,v 29.1 1999/12/14 09:15:57 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/isstr,v $ -## -## Under source code control: 1994/10/21 02:21:31 -## File existed as early as: 1994 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/istype b/help/istype index 6da3fc9..1a3d157 100644 --- a/help/istype +++ b/help/istype @@ -31,7 +31,7 @@ EXAMPLE LIMITS none -LINK LIBRARY +LIBRARY none SEE ALSO @@ -39,29 +39,3 @@ SEE ALSO ishash, isident, isint, islist, ismat, ismult, isnull, isnum, isobj, isobjtype, isodd, isprime, isrand, israndom, isreal, isrel, issimple, issq, isstr - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: istype,v 29.1 1999/12/14 09:15:57 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/istype,v $ -## -## Under source code control: 1994/10/21 02:21:31 -## File existed as early as: 1994 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/jacobi b/help/jacobi index 547c1c1..daee482 100644 --- a/help/jacobi +++ b/help/jacobi @@ -55,34 +55,8 @@ EXAMPLE LIMITS none -LINK LIBRARY +LIBRARY NUMBER *qjacobi(NUMBER *x, NUMBER *y) FLAG zjacobi(ZVALUE z1, ZVALUE z2) SEE ALSO - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: jacobi,v 29.1 1999/12/14 09:15:57 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/jacobi,v $ -## -## Under source code control: 1995/12/18 12:34:57 -## File existed as early as: 1995 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/join b/help/join index 452032a..466e52b 100644 --- a/help/join +++ b/help/join @@ -32,34 +32,8 @@ EXAMPLE LIMITS none -LINK LIBRARY +LIBRARY none SEE ALSO reverse, sort - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: join,v 29.1 1999/12/14 09:15:57 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/join,v $ -## -## Under source code control: 1995/07/09 19:41:40 -## File existed as early as: 1995 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/lcm b/help/lcm index 4649301..7fc8fb9 100644 --- a/help/lcm +++ b/help/lcm @@ -23,34 +23,8 @@ EXAMPLE LIMITS none -LINK LIBRARY +LIBRARY NUMBER *qlcm(NUMBER *x1, NUMBER *x2) SEE ALSO gcd - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: lcm,v 29.1 1999/12/14 09:15:57 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/lcm,v $ -## -## Under source code control: 1995/10/05 04:52:26 -## File existed as early as: 1995 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/lcmfact b/help/lcmfact index 30c994d..428cd18 100644 --- a/help/lcmfact +++ b/help/lcmfact @@ -19,35 +19,9 @@ EXAMPLE LIMITS n < 2^24 -LINK LIBRARY +LIBRARY NUMBER *qlcmfact(NUMBER *n) void zlcmfact(ZVALUE z, ZVALUE *dest) SEE ALSO lcm, fact - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: lcmfact,v 29.1 1999/12/14 09:15:57 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/lcmfact,v $ -## -## Under source code control: 1995/12/18 12:34:57 -## File existed as early as: 1995 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/lfactor b/help/lfactor index e4d029b..6058021 100644 --- a/help/lfactor +++ b/help/lfactor @@ -26,35 +26,9 @@ EXAMPLE LIMITS none -LINK LIBRARY +LIBRARY NUMBER *qlowfactor(NUMBER *n, NUMBER *count) FULL zlowfactor(ZVALUE z, long count) SEE ALSO factor - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: lfactor,v 29.1 1999/12/14 09:15:57 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/lfactor,v $ -## -## Under source code control: 1995/12/18 12:34:57 -## File existed as early as: 1995 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/list b/help/list index 5022efc..c38860f 100644 --- a/help/list +++ b/help/list @@ -70,34 +70,8 @@ EXAMPLE LIMITS none -LINK LIBRARY +LIBRARY none SEE ALSO append, delete, insert, islist, pop, push, remove, rsearch, search, size - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: list,v 29.1 1999/12/14 09:15:57 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/list,v $ -## -## Under source code control: 1994/03/19 03:13:19 -## File existed as early as: 1994 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/ln b/help/ln index 50cb383..c85a3bb 100644 --- a/help/ln +++ b/help/ln @@ -27,35 +27,9 @@ LIMITS x != 0 eps > 0 -LINK LIBRARY +LIBRARY NUMBER *qln(NUMBER *x, NUMBER *eps) COMPLEX *cln(COMPLEX *x, NUMBER *eps) SEE ALSO exp, acosh, asinh, atanh - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: ln,v 29.1 1999/12/14 09:15:57 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/ln,v $ -## -## Under source code control: 1995/10/11 04:41:26 -## File existed as early as: 1995 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/lowbit b/help/lowbit index ab6a4de..da90818 100644 --- a/help/lowbit +++ b/help/lowbit @@ -22,34 +22,8 @@ EXAMPLE LIMITS none -LINK LIBRARY +LIBRARY long zlowbit(ZVALUE x); SEE ALSO highbit, digits - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: lowbit,v 29.1 1999/12/14 09:15:57 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/lowbit,v $ -## -## Under source code control: 1995/10/03 10:40:02 -## File existed as early as: 1995 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/ltol b/help/ltol index 4f83d69..605ddae 100644 --- a/help/ltol +++ b/help/ltol @@ -22,34 +22,8 @@ EXAMPLE LIMITS abs(x) <= 1 -LINK LIBRARY +LIBRARY NUMBER *qlegtoleg(NUMBER *q1, *epsilon, BOOL wantneg) SEE ALSO hypot - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: ltol,v 29.1 1999/12/14 09:15:57 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/ltol,v $ -## -## Under source code control: 1995/10/05 04:52:27 -## File existed as early as: 1995 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/makelist b/help/makelist index 7b7557f..02bd24e 100644 --- a/help/makelist +++ b/help/makelist @@ -26,34 +26,8 @@ EXAMPLE LIMITS 0 <= x < 2^31 -LINK LIBRARY +LIBRARY none SEE ALSO modify - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: makelist,v 29.1 1999/12/14 09:15:58 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/makelist,v $ -## -## Under source code control: 1995/07/10 02:09:31 -## File existed as early as: 1995 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/mat b/help/mat index c7c2205..df252ef 100644 --- a/help/mat +++ b/help/mat @@ -14,7 +14,7 @@ SYNOPSIS TYPES index-range-list range_1 [, range_2, ...] up to 4 ranges range_1, ... integer, or integer_1 : integer_2 - value, value_1, ... any + value, value_1, ... any variable_1 ... lvalue decl declarator = global, static or local id_1, ... identifier @@ -32,7 +32,7 @@ DESCRIPTION If a variable is specified by an expression that is not a symbol with possibly object element specifiers, the expression should be enclosed in parentheses. For example, parentheses are required in - mat (A[2]) [3] and mat (*p) [3] but mat P.x [3] is acceptable. + mat (A[2]) [3] and mat (*p) [3] but mat P.x [3] is acceptable. When an index-range is specified as integer_1 : integer_2, where integer_1 and integer_2 are expressions which evaluate to integers, @@ -64,18 +64,18 @@ DESCRIPTION is p + i as long as A exists and a new value is not assigned to A. When a matrix is created, each element is initially assigned the - value zero. Other values may be assigned then or later using the + value zero. Other values may be assigned then or later using the "= {...}" assignment operation. Thus A = {value_0, value_1, ...} assigns the values value_0, value_1, ... to the elements A[[0]], - A[[1]], ... Any blank "value" is passed over. For example, + A[[1]], ... Any blank "value" is passed over. For example, A = {1, , 2} will assign the value 1 to A[[0]], 2 to A[[2]] and leave all other - elements unchanged. Values may also be assigned to elements by + elements unchanged. Values may also be assigned to elements by simple assignments, as in A[0,0] = 1, A[0,2] = 2; If the index-range is left blank but an initializer list is specified @@ -87,16 +87,16 @@ DESCRIPTION the matrix created is one-dimensional. If the list contains a positive number n of values or blanks, the result is as if the range were specified by [n], i.e. the range of indices is from - 0 to n - 1. In the above examples, A is of size 2 with A[0] = 1 + 0 to n - 1. In the above examples, A is of size 2 with A[0] = 1 and A[1] = 2; B is of size 4 with B[0] = 1, B[1] = B[3] = 0, B[2] = 3. The specification mat[] = { } creates the same as mat[1]. If the index-range is left blank and no initializer list is specified, as in mat C[] or C = mat[], the matrix assigned to C has zero - dimension; this has one element C[]. To assign a value using "= { ...}" + dimension; this has one element C[]. To assign a value using "= { ...}" at the same time as creating C, parentheses are required as in - (mat[]) = {value} or (mat C[]) = {value}. Later a value may be - assigned to C[] by C[] = value or C = {value}. + (mat[]) = {value} or (mat C[]) = {value}. Later a value may be + assigned to C[] by C[] = value or C = {value}. The value assigned at any time to any element of a matrix can be of any type - number, string, list, matrix, object of previously specified @@ -106,7 +106,7 @@ DESCRIPTION If an element of a matrix is a structure for which indices or an object element specifier is required, an element of that structure is referred to by appropriate uses of [ ] or ., and so on if an element - of that element is required. For example, one may have an expressions + of that element is required. For example, one may have an expressions like A[1,2][3].alpha[2]; @@ -116,14 +116,14 @@ DESCRIPTION type mat[4] and A is a mat[2,3] matrix. When an element of a matrix is a matrix and the total number of indices does not exceed 4, the indices can be combined into one list, e.g. the A[1,2][3] in the - above example can be shortened to A[1,2,3]. (Unlike C, A[1,2] cannot + above example can be shortened to A[1,2,3]. (Unlike C, A[1,2] cannot be expressed as A[1][2].) The function ismat(V) returns 1 if V is a matrix, 0 otherwise. isident(V) returns 1 if V is a square matrix with diagonal elements 1, off-diagonal elements zero, or a zero- or one-dimensional matrix with - every element 1; otherwise zero is returned. Thus isident(V) = 1 + every element 1; otherwise zero is returned. Thus isident(V) = 1 indicates that for V * A and A * V where A is any matrix of for which either product is defined and the elements of A are real or complex numbers, that product will equal A. @@ -166,7 +166,7 @@ DESCRIPTION matrices as determined by the later index-range-lists. For example mat[2][3] is a 2-element matrix, each of whose elements has as its value a 3-element matrix. Values may be assigned to the - elements of the innermost matrices by nested = {...} operations as in + elements of the innermost matrices by nested = {...} operations as in mat [2][3] = {{1,2,3},{4,5,6}} @@ -187,7 +187,7 @@ DESCRIPTION matmax(A,i) - matmin(A,i) == matmax(B,i) - matmin(B,i), One consequence of being the same shape is that the matrices will - have the same size. Elements "correspond" if they have the same + have the same size. Elements "correspond" if they have the same double-bracket indices; thus A == B implies that A[[i]] == B[[i]] for 0 <= i < size(A) == size(B). @@ -195,7 +195,7 @@ DESCRIPTION A - B These are defined A and B have the same shape, the element with double-bracket index j being evaluated by A[[j]] + B[[j]] and - A[[j]] - B[[j]], respectively. The index-ranges for the results + A[[j]] - B[[j]], respectively. The index-ranges for the results are those for the matrix A. A[i,j] @@ -208,7 +208,7 @@ DESCRIPTION A * B Multiplication is defined provided certain conditions by the - dimensions and shapes of A and B are satisfied. If both have + dimensions and shapes of A and B are satisfied. If both have dimension 2 and the column-index-list for A is the same as the row-index-list for B, C = A * B is defined in the usual way so that for i in the row-index-list of A and j in the @@ -243,7 +243,7 @@ DESCRIPTION on the left by the corresponding element of A. If A is of dimension 2 and B is of dimension 1, A * B is defined - if number of columns in A is the same as the size of A. The + if number of columns in A is the same as the size of A. The result has the same index-lists as A; each column of A is multiplied on the right by the corresponding element of B. @@ -251,7 +251,7 @@ DESCRIPTION and two-dimensional matrices is particularly simple when all the elements are real or complex numbers and all the index-lists are the same, as occurs, for example, if for some positive integer n, - all the matrices start as mat [n] or mat [n,n]. + all the matrices start as mat [n] or mat [n,n]. det(A) If A is a square, det(A) is evaluated by an algorithm that returns @@ -265,7 +265,7 @@ DESCRIPTION The following functions are defined to return matrices with the same index-ranges as A and the specified operations performed on all - elements of A. Here num is an arbitrary complex number (nonzero + elements of A. Here num is an arbitrary complex number (nonzero when it is a divisor), int an integer, rnd a rounding-type specifier integer, real a real number. @@ -276,8 +276,8 @@ DESCRIPTION conj(A) A << int, A >> int scale(A, int) - round(A, int, rnd) - bround(A, int, rnd) + round(A, int, rnd) + bround(A, int, rnd) appr(A, real, rnd) int(A) frac(A) @@ -290,7 +290,7 @@ DESCRIPTION elements. If A and B are one-dimension and of size 3, cp(A, B) returns their - cross-product. + cross-product. randperm(A) returns a matrix indexed the same as A in which the elements of A have been randomly permuted. @@ -300,7 +300,7 @@ DESCRIPTION If A is an lvalue whose current value is a matrix, matfill(A, v) assigns the value v to every element of A, and if also, A is - square, matfill(A, v1, v2) assigns v1 to the off-diagonal elements, + square, matfill(A, v1, v2) assigns v1 to the off-diagonal elements, v2 to the diagonal elements. To create and assign to A the unit n * n matrix, one may use matfill(mat A[n,n], 0, 1). @@ -310,7 +310,7 @@ DESCRIPTION For a two-dimensional matrix A, mattrans(A) returns the transpose of A, i.e. if A is mat[m,n], it returns a mat[n,m] matrix with - [i,j] element equal to A[j,i]. For zero- or one-dimensional A, + [i,j] element equal to A[j,i]. For zero- or one-dimensional A, mattrace(A) returns a matrix with the same value as A. The functions search(A, value, start, end]) and @@ -388,36 +388,10 @@ LIMITS second to invert a 10 * 10 matrix, it will probably take about 1000 times as long to invert a 100 * 100 matrix. -LINK LIBRARY +LIBRARY n/a SEE ALSO ismat, matdim, matmax, matmin, mattrans, mattrace, matsum, det, inverse, isident, test, config, search, rsearch, reverse, copy, blkcpy, dp, cp, randperm, sort - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: mat,v 29.1 1999/12/14 09:15:58 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/mat,v $ -## -## Under source code control: 1991/07/21 04:37:22 -## File existed as early as: 1991 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/matdim b/help/matdim index ceb12ea..063f67c 100644 --- a/help/matdim +++ b/help/matdim @@ -20,34 +20,8 @@ EXAMPLE LIMITS none -LINK LIBRARY +LIBRARY none SEE ALSO XXX - fill in - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: matdim,v 29.1 1999/12/14 09:15:58 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/matdim,v $ -## -## Under source code control: 1995/10/25 04:03:45 -## File existed as early as: 1995 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/matfill b/help/matfill index ddbefef..a4c8700 100644 --- a/help/matfill +++ b/help/matfill @@ -33,34 +33,8 @@ EXAMPLE LIMITS none -LINK LIBRARY +LIBRARY none SEE ALSO XXX - fill in - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: matfill,v 29.1 1999/12/14 09:15:58 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/matfill,v $ -## -## Under source code control: 1995/10/25 04:03:45 -## File existed as early as: 1995 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/matmax b/help/matmax index 5bf37c2..94055ac 100644 --- a/help/matmax +++ b/help/matmax @@ -22,34 +22,8 @@ EXAMPLE LIMITS i < matdim(m) -LINK LIBRARY +LIBRARY none SEE ALSO XXX - fill in - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: matmax,v 29.1 1999/12/14 09:15:58 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/matmax,v $ -## -## Under source code control: 1995/10/25 04:03:45 -## File existed as early as: 1995 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/matmin b/help/matmin index 9ce1b14..bb35b98 100644 --- a/help/matmin +++ b/help/matmin @@ -22,34 +22,8 @@ EXAMPLE LIMITS i < matdim(m) -LINK LIBRARY +LIBRARY none SEE ALSO XXX - fill in - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: matmin,v 29.1 1999/12/14 09:15:59 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/matmin,v $ -## -## Under source code control: 1995/10/25 04:03:45 -## File existed as early as: 1995 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/matsum b/help/matsum index da30c87..91f6fc6 100644 --- a/help/matsum +++ b/help/matsum @@ -21,34 +21,8 @@ EXAMPLE LIMITS none -LINK LIBRARY +LIBRARY void matsum(MATRIX *m, VALUE *vres); SEE ALSO XXX - fill in - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: matsum,v 29.1 1999/12/14 09:15:59 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/matsum,v $ -## -## Under source code control: 1995/10/25 04:03:46 -## File existed as early as: 1995 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/mattrace b/help/mattrace index 1c864ad..d64d3a3 100644 --- a/help/mattrace +++ b/help/mattrace @@ -24,34 +24,8 @@ EXAMPLE LIMITS none -LINK LIBRARY +LIBRARY none SEE ALSO mat, mattrans - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: mattrace,v 29.1 1999/12/14 09:15:59 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/mattrace,v $ -## -## Under source code control: 1997/09/06 20:03:35 -## File existed as early as: 1997 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/mattrans b/help/mattrans index bd7cd2a..d50a4c8 100644 --- a/help/mattrans +++ b/help/mattrans @@ -27,34 +27,8 @@ EXAMPLE LIMITS none -LINK LIBRARY +LIBRARY MATRIX *mattrans(MATRIX *m) SEE ALSO XXX - fill in - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: mattrans,v 29.1 1999/12/14 09:15:59 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/mattrans,v $ -## -## Under source code control: 1995/10/25 04:03:46 -## File existed as early as: 1995 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/max b/help/max index 20fd1da..38ab847 100644 --- a/help/max +++ b/help/max @@ -64,34 +64,8 @@ EXAMPLE LIMITS The number of arguments is not to exceed 100. -LINK LIBRARY +LIBRARY NUMBER *qmax(NUMBER *x1, NUMBER *x2) SEE ALSO max, obj - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: max,v 29.1 1999/12/14 09:15:59 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/max,v $ -## -## Under source code control: 1995/10/05 04:52:27 -## File existed as early as: 1995 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/md5 b/help/md5 index 12901a5..2346703 100644 --- a/help/md5 +++ b/help/md5 @@ -83,7 +83,7 @@ EXAMPLE LIMITS none -LINK LIBRARY +LIBRARY HASH* hash_init(int, HASH*); void hash_free(HASH*); HASH* hash_copy(HASH*); @@ -100,29 +100,3 @@ LINK LIBRARY SEE ALSO ishash, sha, sha1 - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: md5,v 29.1 1999/12/14 09:15:59 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/md5,v $ -## -## Under source code control: 1997/04/06 19:45:54 -## File existed as early as: 1997 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/memsize b/help/memsize index 927638b..450af6f 100644 --- a/help/memsize +++ b/help/memsize @@ -84,34 +84,8 @@ EXAMPLES LIMITS It is assumed memsize(x) will fit into a system long integer. -LINK LIBRARY +LIBRARY none SEE ALSO size, sizeof, fsize, strlen, digits - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: memsize,v 29.1 1999/12/14 09:15:59 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/memsize,v $ -## -## Under source code control: 1997/03/23 20:28:02 -## File existed as early as: 1997 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/meq b/help/meq index 7c59296..29457e4 100644 --- a/help/meq +++ b/help/meq @@ -26,34 +26,8 @@ EXAMPLE LIMITS none -LINK LIBRARY +LIBRARY none SEE ALSO mne, ismult - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: meq,v 29.1 1999/12/14 09:15:59 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/meq,v $ -## -## Under source code control: 1995/11/09 03:27:51 -## File existed as early as: 1995 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/min b/help/min index dc2ee98..653b25f 100644 --- a/help/min +++ b/help/min @@ -64,34 +64,8 @@ EXAMPLE LIMITS The number of arguments is not to exceed 100. -LINK LIBRARY +LIBRARY NUMBER *qmin(NUMBER *x1, NUMBER *x2) SEE ALSO max, obj - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: min,v 29.1 1999/12/14 09:15:59 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/min,v $ -## -## Under source code control: 1995/10/05 04:52:27 -## File existed as early as: 1995 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/minv b/help/minv index b09df2a..8a62393 100644 --- a/help/minv +++ b/help/minv @@ -40,34 +40,8 @@ EXAMPLE LIMITS none -LINK LIBRARY +LIBRARY NUMBER *qminv(NUMBER *x, NUMBER *md) SEE ALSO mod, pmod - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: minv,v 29.1 1999/12/14 09:15:59 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/minv,v $ -## -## Under source code control: 1995/11/09 03:27:51 -## File existed as early as: 1995 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/mmin b/help/mmin index 4a4c1cf..6447dbf 100644 --- a/help/mmin +++ b/help/mmin @@ -30,34 +30,8 @@ EXAMPLE LIMITS none -LINK LIBRARY +LIBRARY none SEE ALSO mod - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: mmin,v 29.1 1999/12/14 09:15:59 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/mmin,v $ -## -## Under source code control: 1995/12/18 03:30:59 -## File existed as early as: 1995 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/mne b/help/mne index a7166a3..a4f9eca 100644 --- a/help/mne +++ b/help/mne @@ -22,34 +22,8 @@ EXAMPLE LIMITS none -LINK LIBRARY +LIBRARY none SEE ALSO meq - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: mne,v 29.1 1999/12/14 09:16:00 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/mne,v $ -## -## Under source code control: 1995/11/09 03:27:51 -## File existed as early as: 1995 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/mod b/help/mod index 5de907d..a8d22e8 100644 --- a/help/mod +++ b/help/mod @@ -104,35 +104,9 @@ EXAMPLE LIMITS none -LINK LIBRARY +LIBRARY void modvalue(VALUE *x, VALUE *y, VALUE *rnd, VALUE *result) NUMBER *qmod(NUMBER *y, NUMBER *y, long rnd) SEE ALSO quo, quomod, //, % - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: mod,v 29.1 1999/12/14 09:16:00 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/mod,v $ -## -## Under source code control: 1995/09/18 02:09:31 -## File existed as early as: 1995 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/modify b/help/modify index d9699fe..c00f980 100644 --- a/help/modify +++ b/help/modify @@ -34,34 +34,8 @@ EXAMPLE LIMITS none -LINK LIBRARY +LIBRARY none SEE ALSO makelist - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: modify,v 29.1 1999/12/14 09:16:00 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/modify,v $ -## -## Under source code control: 1995/07/10 02:09:31 -## File existed as early as: 1995 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/name b/help/name index 6d0cb44..0afd223 100644 --- a/help/name +++ b/help/name @@ -32,34 +32,8 @@ EXAMPLE LIMITS none -LINK LIBRARY +LIBRARY none - XXX ??? SEE ALSO blk, fopen - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: name,v 29.1 1999/12/14 09:16:00 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/name,v $ -## -## Under source code control: 1997/04/05 14:12:44 -## File existed as early as: 1997 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/near b/help/near index 8b5b259..ef4faa0 100644 --- a/help/near +++ b/help/near @@ -24,34 +24,8 @@ EXAMPLE LIMITS eps >= 0 -LINK LIBRARY +LIBRARY FLAG qnear(NUMBER *x, NUMBER *y, NUMBER *eps) SEE ALSO epsilon, abs - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: near,v 29.1 1999/12/14 09:16:00 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/near,v $ -## -## Under source code control: 1995/10/25 04:03:46 -## File existed as early as: 1995 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/newerror b/help/newerror index 54efc7e..1d8962e 100644 --- a/help/newerror +++ b/help/newerror @@ -63,34 +63,8 @@ EXAMPLE LIMITS The number of new described error-values is not to exceed 12767. -LINK LIBRARY +LIBRARY none SEE ALSO errmax, errcount, error, strerror, iserror, errno, errorcodes - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: newerror,v 29.1 1999/12/14 09:16:00 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/newerror,v $ -## -## Under source code control: 1996/04/30 03:39:56 -## File existed as early as: 1996 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/nextcand b/help/nextcand index a8523e7..94b10be 100644 --- a/help/nextcand +++ b/help/nextcand @@ -69,35 +69,9 @@ EXAMPLE LIMITS none -LINK LIBRARY +LIBRARY int znextcand(ZVALUE n, long count, long skip, ZVALUE res, ZVALUE mod, ZVALUE *cand) SEE ALSO prevcand, ptest - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: nextcand,v 29.1 1999/12/14 09:16:00 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/nextcand,v $ -## -## Under source code control: 1996/02/25 00:27:43 -## File existed as early as: 1996 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/nextprime b/help/nextprime index a7472c9..5e8c2fb 100644 --- a/help/nextprime +++ b/help/nextprime @@ -29,34 +29,8 @@ EXAMPLE LIMITS n <= 2^32 -LINK LIBRARY +LIBRARY FULL znprime(ZVALUE z) SEE ALSO prevprime - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: nextprime,v 29.1 1999/12/14 09:16:00 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/nextprime,v $ -## -## Under source code control: 1995/12/18 12:34:57 -## File existed as early as: 1995 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/norm b/help/norm index 5af16ae..f82d2a8 100644 --- a/help/norm +++ b/help/norm @@ -30,34 +30,8 @@ EXAMPLE LIMITS none -LINK LIBRARY +LIBRARY void normvalue(VALUE *x, VALUE *result) SEE ALSO cmp, epsilon, hypot, abs, near, obj - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: norm,v 29.1 1999/12/14 09:16:00 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/norm,v $ -## -## Under source code control: 1995/10/25 04:03:46 -## File existed as early as: 1995 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/null b/help/null index 12bc84a..ee9fb63 100644 --- a/help/null +++ b/help/null @@ -68,34 +68,8 @@ EXAMPLE LIMITS The number of arguments is not to exceed 100. -LINK LIBRARY +LIBRARY none SEE ALSO isnull, test - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: null,v 29.1 1999/12/14 09:16:00 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/null,v $ -## -## Under source code control: 1996/03/12 23:10:01 -## File existed as early as: 1996 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/num b/help/num index c231a7e..1c5d887 100644 --- a/help/num +++ b/help/num @@ -31,34 +31,8 @@ EXAMPLE LIMITS none -LINK LIBRARY +LIBRARY NUMBER *qnum(NUMBER *x) SEE ALSO den - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: num,v 29.1 1999/12/14 09:16:00 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/num,v $ -## -## Under source code control: 1995/10/05 04:52:27 -## File existed as early as: 1995 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/obj.file b/help/obj.file index c67f708..17c2402 100644 --- a/help/obj.file +++ b/help/obj.file @@ -171,36 +171,10 @@ Using objects xx_fact 1 factorial - Also see the standard resource files: + Also see the library files: dms.cal mod.cal poly.cal quat.cal surd.cal - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: obj.file,v 29.1 1999/12/14 09:16:01 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/obj.file,v $ -## -## Under source code control: 1991/07/21 04:37:22 -## File existed as early as: 1991 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/oldvalue b/help/oldvalue index f7da402..f917a49 100644 --- a/help/oldvalue +++ b/help/oldvalue @@ -47,34 +47,8 @@ EXAMPLE LIMITS none -LINK LIBRARY +LIBRARY none SEE ALSO saveval - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: oldvalue,v 29.1 1999/12/14 09:16:01 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/oldvalue,v $ -## -## Under source code control: 1997/09/06 20:03:35 -## File existed as early as: 1997 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/operator b/help/operator index ef35db7..7d6ee73 100644 --- a/help/operator +++ b/help/operator @@ -208,29 +208,3 @@ operators See the 'unexpected' help file for a list of unexpected surprises in calc syntax/usage. Persons familiar with C should read the 'unexpected' help file to avoid confusion. - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: operator,v 29.1 1999/12/14 09:16:01 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/operator,v $ -## -## Under source code control: 1991/07/21 04:37:23 -## File existed as early as: 1991 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/ord b/help/ord index 6e40e77..74e741f 100644 --- a/help/ord +++ b/help/ord @@ -19,34 +19,8 @@ EXAMPLE LIMITS none -LINK LIBRARY +LIBRARY none SEE ALSO char - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: ord,v 29.1 1999/12/14 09:16:01 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/ord,v $ -## -## Under source code control: 1994/09/30 01:45:46 -## File existed as early as: 1994 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/overview b/help/overview index 63f8b34..0f775e0 100644 --- a/help/overview +++ b/help/overview @@ -67,18 +67,14 @@ It contains information about differences between C and calc that may surprize you. - To learn about calc standard resource files, try: + To learn about calc library files that are shipped with calc, try: - help resource + help stdlib To learn how to invoke the calc command and about calc -flags, try: help usage - To learn about calc shell scripts, try: - - help script - A full and extensive overview of calc may be obtained by: help full @@ -168,29 +164,3 @@ These can contain both functions to be defined, and expressions to be calculated. Global variables which are numbers can be saved to a file by using the 'write filename' command. - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: overview,v 29.1 1999/12/14 09:16:01 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/overview,v $ -## -## Under source code control: 1991/07/21 04:37:23 -## File existed as early as: 1991 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/param b/help/param index b7f3253..ea90997 100644 --- a/help/param +++ b/help/param @@ -2,7 +2,7 @@ NAME param - value of argument in a user-function call SYNOPSIS - param([n]) + param(n) TYPES n nonnegative integer @@ -11,24 +11,12 @@ TYPES DESCRIPTION The function param(n) can be used only within the body of the - definition of a function. - - If that function is f() - - [[ which may have been defined with named arguments as in f(x,y,z)) - - and either the number of arguments or the value of an argument + definition of a function. If that function is f() (which may + have been defined with named arguments as in f(x,y,z)) and + either the number of arguments or the value of an argument in an anticipated call to f() is to be used, the number of - arguments in that call will then be returned by: - - param(0) - - and the value of the n-th argument by: - - param(n) - - Note that unlike the argv() builtin, param(1) is the 1st parameter - and param(param(0) is the last. + arguments in that call will then be returned by param(0), and + the value of the n-th argument by param(n). EXAMPLE > define f() { @@ -44,34 +32,8 @@ EXAMPLE LIMITS none -LINK LIBRARY +LIBRARY none SEE ALSO - argv, command - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: param,v 29.1 1999/12/14 09:16:02 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/param,v $ -## -## Under source code control: 1996/03/12 23:10:01 -## File existed as early as: 1996 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ + XXX - missing diff --git a/help/perm b/help/perm index d741b0a..e6fe4fe 100644 --- a/help/perm +++ b/help/perm @@ -31,34 +31,8 @@ LIMITS x >= y >= 0 y < 2^24 -LINK LIBRARY +LIBRARY void zperm(NUMBER x, y, *ret) SEE ALSO comb, fact - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: perm,v 29.1 1999/12/14 09:16:02 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/perm,v $ -## -## Under source code control: 1994/10/20 04:03:02 -## File existed as early as: 1994 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/pfact b/help/pfact index 9c22f97..e8ca912 100644 --- a/help/pfact +++ b/help/pfact @@ -19,35 +19,9 @@ EXAMPLE LIMITS n < 2^24 -LINK LIBRARY +LIBRARY NUMBER *qpfact(NUMBER *n) void zpfact(ZVALUE z, ZVALUE *dest) SEE ALSO fact, lcmfact - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: pfact,v 29.1 1999/12/14 09:16:02 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/pfact,v $ -## -## Under source code control: 1995/12/18 12:34:57 -## File existed as early as: 1995 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/pi b/help/pi index 3014ddd..d5f9cb1 100644 --- a/help/pi +++ b/help/pi @@ -20,34 +20,8 @@ EXAMPLE LIMITS eps > 0 -LINK LIBRARY +LIBRARY NUMBER *qpi(NUMBER *eps) SEE ALSO XXX - fill in - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: pi,v 29.1 1999/12/14 09:16:02 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/pi,v $ -## -## Under source code control: 1995/10/25 04:03:46 -## File existed as early as: 1995 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/pix b/help/pix index bfbca93..2d68058 100644 --- a/help/pix +++ b/help/pix @@ -30,35 +30,9 @@ EXAMPLE LIMITS none -LINK LIBRARY +LIBRARY long zpix(ZVALUE z) FULL pix(FULL x) SEE ALSO XXX - fill in - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: pix,v 29.1 1999/12/14 09:16:02 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/pix,v $ -## -## Under source code control: 1995/12/18 12:34:58 -## File existed as early as: 1995 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/places b/help/places index f533db2..8a63385 100644 --- a/help/places +++ b/help/places @@ -24,34 +24,8 @@ EXAMPLE LIMITS none -LINK LIBRARY +LIBRARY long qplaces(NUMBER *x) SEE ALSO digits - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: places,v 29.1 1999/12/14 09:16:02 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/places,v $ -## -## Under source code control: 1995/10/03 10:40:02 -## File existed as early as: 1995 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/pmod b/help/pmod index e5d2ecf..1133fbb 100644 --- a/help/pmod +++ b/help/pmod @@ -43,34 +43,8 @@ EXAMPLE LIMITS none -LINK LIBRARY +LIBRARY NUMBER *qpowermod(NUMBER *x, NUMBER *n, NUMBER *md) SEE ALSO mod, minv - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: pmod,v 29.1 1999/12/14 09:16:02 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/pmod,v $ -## -## Under source code control: 1995/11/09 03:27:51 -## File existed as early as: 1995 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/polar b/help/polar index 4ebfd59..85bb4fa 100644 --- a/help/polar +++ b/help/polar @@ -28,34 +28,8 @@ EXAMPLE LIMITS none -LINK LIBRARY +LIBRARY COMPLEX * cpolar(NUMBER *r, NUMBER *t, NUMBER *eps); SEE ALSO abs, arg, re, im - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: polar,v 29.1 1999/12/14 09:16:02 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/polar,v $ -## -## Under source code control: 1995/10/25 04:03:46 -## File existed as early as: 1995 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/poly b/help/poly index bb8fc6c..b0dc962 100644 --- a/help/poly +++ b/help/poly @@ -130,34 +130,8 @@ EXAMPLE LIMITS The number of arguments is not to exceed 100 -LINK LIBRARY +LIBRARY BOOL evalpoly(LIST *clist, LISTELEM *x, VALUE *result); SEE ALSO XXX - fill in - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: poly,v 29.1 1999/12/14 09:16:02 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/poly,v $ -## -## Under source code control: 1995/12/02 02:40:43 -## File existed as early as: 1995 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/pop b/help/pop index deb87c1..16d1f20 100644 --- a/help/pop +++ b/help/pop @@ -39,34 +39,8 @@ EXAMPLE LIMITS none -LINK LIBRARY +LIBRARY none SEE ALSO append, delete, insert, islist, list, push, remove, rsearch, search, size - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: pop,v 29.1 1999/12/14 09:16:02 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/pop,v $ -## -## Under source code control: 1994/03/19 03:13:20 -## File existed as early as: 1994 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/popcnt b/help/popcnt index 598c1ab..df1a440 100644 --- a/help/popcnt +++ b/help/popcnt @@ -26,34 +26,8 @@ EXAMPLE LIMITS none -LINK LIBRARY +LIBRARY long zpopcnt(ZVALUE z, int bitval) SEE ALSO none - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: popcnt,v 29.1 1999/12/14 09:16:02 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/popcnt,v $ -## -## Under source code control: 1997/09/11 04:20:02 -## File existed as early as: 1997 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/power b/help/power index c5b1c71..fdbb141 100644 --- a/help/power +++ b/help/power @@ -47,36 +47,10 @@ LIMITS eps > 0 -LINK LIBRARY +LIBRARY void powervalue(VALUE *x, VALUE *y, VALUE *eps, VALUE *result) NUMBER *qpower(NUMBER *x, NUMBER *y, NUMBER *eps) COMPLEX *cpower(COMPLEX *x, COMPLEX *y, NUMBER *eps) SEE ALSO root - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: power,v 29.1 1999/12/14 09:16:02 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/power,v $ -## -## Under source code control: 1995/10/25 04:03:46 -## File existed as early as: 1995 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/prevcand b/help/prevcand index e5789ea..fc7a7eb 100644 --- a/help/prevcand +++ b/help/prevcand @@ -77,35 +77,9 @@ EXAMPLE LIMITS none -LINK LIBRARY +LIBRARY int zprevcand(ZVALUE n, long count, long skip, ZVALUE res, ZVALUE mod, ZVALUE *cand) SEE ALSO nextcand, ptest - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: prevcand,v 29.1 1999/12/14 09:16:03 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/prevcand,v $ -## -## Under source code control: 1996/02/25 00:27:43 -## File existed as early as: 1996 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/prevprime b/help/prevprime index c677e0c..22b0f93 100644 --- a/help/prevprime +++ b/help/prevprime @@ -32,34 +32,8 @@ EXAMPLE LIMITS 2 < n < 2^32 -LINK LIBRARY +LIBRARY FULL zpprime(ZVALUE z) SEE ALSO nextprime - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: prevprime,v 29.1 1999/12/14 09:16:03 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/prevprime,v $ -## -## Under source code control: 1995/12/18 12:34:58 -## File existed as early as: 1995 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/printf b/help/printf index dca3e26..0f41217 100644 --- a/help/printf +++ b/help/printf @@ -120,34 +120,8 @@ EXAMPLE LIMITS The number of arguments of printf() is not to exceed 100. -LINK LIBRARY +LIBRARY none SEE ALSO fprintf, strprintf, print - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: printf,v 29.1 1999/12/14 09:16:03 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/printf,v $ -## -## Under source code control: 1996/03/12 22:50:41 -## File existed as early as: 1996 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/prompt b/help/prompt index ca7099d..cb5de4c 100644 --- a/help/prompt +++ b/help/prompt @@ -32,34 +32,8 @@ EXAMPLE LIMITS none -LINK LIBRARY +LIBRARY none SEE ALSO XXX - fill in - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: prompt,v 29.1 1999/12/14 09:16:03 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/prompt,v $ -## -## Under source code control: 1995/12/18 12:34:58 -## File existed as early as: 1995 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/protect b/help/protect index d1c8b1d..628c980 100644 --- a/help/protect +++ b/help/protect @@ -181,34 +181,8 @@ EXAMPLE LIMITS none -LINK LIBRARY +LIBRARY none SEE ALSO assign, copy, blk - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: protect,v 29.1 1999/12/14 09:16:03 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/protect,v $ -## -## Under source code control: 1997/07/10 22:38:44 -## File existed as early as: 1997 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/ptest b/help/ptest index db89d07..9466aff 100644 --- a/help/ptest +++ b/help/ptest @@ -121,35 +121,9 @@ EXAMPLE LIMITS none -LINK LIBRARY +LIBRARY BOOL qprimetest(NUMBER *n, NUMBER *count, NUMBER *skip) BOOL zprimetest(ZVALUE n, long count, long skip) SEE ALSO isprime, prevcand, nextcand - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: ptest,v 29.1 1999/12/14 09:16:03 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/ptest,v $ -## -## Under source code control: 1996/02/25 00:27:43 -## File existed as early as: 1996 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/push b/help/push index a788fab..e065e22 100644 --- a/help/push +++ b/help/push @@ -48,34 +48,8 @@ EXAMPLE LIMITS push() can have at most 100 arguments -LINK LIBRARY +LIBRARY none SEE ALSO append, delete, insert, islist, list, pop, remove, rsearch, search, size - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: push,v 29.1 1999/12/14 09:16:03 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/push,v $ -## -## Under source code control: 1994/03/19 03:13:20 -## File existed as early as: 1994 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/putenv b/help/putenv index 0ecf7e8..e8c9843 100644 --- a/help/putenv +++ b/help/putenv @@ -41,34 +41,8 @@ EXAMPLE LIMITS With 1 arg, env must contain at least 1 '=' character. -LINK LIBRARY +LIBRARY none SEE ALSO getenv - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: putenv,v 29.1 1999/12/14 09:16:03 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/putenv,v $ -## -## Under source code control: 1995/07/09 03:48:57 -## File existed as early as: 1995 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/quo b/help/quo index b157e4f..92bcc5f 100644 --- a/help/quo +++ b/help/quo @@ -70,35 +70,9 @@ EXAMPLE LIMITS none -LINK LIBRARY +LIBRARY void quovalue(VALUE *x, VALUE *y, VALUE *rnd, VALUE *result) NUMBER *qquo(NUMBER *x, NUMBER *y, long rnd) SEE ALSO mod, quomod, //, % - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: quo,v 29.1 1999/12/14 09:16:03 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/quo,v $ -## -## Under source code control: 1995/09/18 04:01:44 -## File existed as early as: 1995 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/quomod b/help/quomod index 637ada8..14e3cc2 100644 --- a/help/quomod +++ b/help/quomod @@ -35,34 +35,8 @@ EXAMPLE LIMITS y > 0 -LINK LIBRARY +LIBRARY BOOL qquomod(NUMBER *q1, NUMBER *q2, NUMBER **retqdiv, NUMBER **retqmod) SEE ALSO //, % - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: quomod,v 29.1 1999/12/14 09:16:03 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/quomod,v $ -## -## Under source code control: 1995/05/07 03:17:03 -## File existed as early as: 1995 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/rand b/help/rand index 6dc14da..779e507 100644 --- a/help/rand +++ b/help/rand @@ -224,36 +224,10 @@ EXAMPLE LIMITS min < max -LINK LIBRARY +LIBRARY void zrand(long cnt, ZVALUE *res) void zrandrange(ZVALUE low, ZVALUE high, ZVALUE *res) long irand(long max) SEE ALSO seed, srand, randbit, isrand, random, srandom, israndom - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: rand,v 29.1 1999/12/14 09:16:03 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/rand,v $ -## -## Under source code control: 1996/01/01 02:16:09 -## File existed as early as: 1996 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/randbit b/help/randbit index 545943f..eb09ce3 100644 --- a/help/randbit +++ b/help/randbit @@ -36,34 +36,8 @@ EXAMPLE LIMITS x != 0 -LINK LIBRARY +LIBRARY void zrand(long cnt, ZVALUE *res) SEE ALSO seed, srand, randbit, isrand, random, srandom, israndom - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: randbit,v 29.1 1999/12/14 09:16:04 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/randbit,v $ -## -## Under source code control: 1996/01/01 03:17:22 -## File existed as early as: 1996 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/random b/help/random index 302db17..5eb8fb1 100644 --- a/help/random +++ b/help/random @@ -148,36 +148,10 @@ EXAMPLE LIMITS min < max -LINK LIBRARY +LIBRARY void zrandom(long cnt, ZVALUE *res) void zrandomrange(ZVALUE low, ZVALUE high, ZVALUE *res) long irandom(long max) SEE ALSO seed, srand, randbit, isrand, rand, srandom, israndom - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: random,v 29.1 1999/12/14 09:16:04 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/random,v $ -## -## Under source code control: 1997/02/17 01:18:22 -## File existed as early as: 1997 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/randombit b/help/randombit index f5d8962..024ed5b 100644 --- a/help/randombit +++ b/help/randombit @@ -35,34 +35,8 @@ EXAMPLE LIMITS x != 0 -LINK LIBRARY +LIBRARY void zrandom(long cnt, ZVALUE *res) SEE ALSO seed, srand, randbit, isrand, rand, srandom, israndom - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: randombit,v 29.1 1999/12/14 09:16:04 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/randombit,v $ -## -## Under source code control: 1997/02/17 01:18:22 -## File existed as early as: 1997 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/randperm b/help/randperm index 99d7f32..0ebc4dc 100644 --- a/help/randperm +++ b/help/randperm @@ -37,34 +37,8 @@ EXAMPLE LIMITS none -LINK LIBRARY +LIBRARY none SEE ALSO XXX - fill in - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: randperm,v 29.1 1999/12/14 09:16:04 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/randperm,v $ -## -## Under source code control: 1995/07/10 02:09:31 -## File existed as early as: 1995 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/rcin b/help/rcin index ad9dbf9..0aee90a 100644 --- a/help/rcin +++ b/help/rcin @@ -66,34 +66,8 @@ EXAMPLE LIMITS none -LINK LIBRARY +LIBRARY void zredcencode(REDC *rp, ZVALUE z1, ZVALUE *res) SEE ALSO rcout, rcmul, rcsq, rcpow - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: rcin,v 29.1 1999/12/14 09:16:04 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/rcin,v $ -## -## Under source code control: 1996/02/25 02:22:21 -## File existed as early as: 1996 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/rcmul b/help/rcmul index da1e806..3a593d6 100644 --- a/help/rcmul +++ b/help/rcmul @@ -55,34 +55,8 @@ EXAMPLE LIMITS none -LINK LIBRARY +LIBRARY void zredcmul(REDC *rp, ZVALUE z1, ZVALUE z2, ZVALUE *res) SEE ALSO rcin, rcout, rcsq, rcpow - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: rcmul,v 29.1 1999/12/14 09:16:04 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/rcmul,v $ -## -## Under source code control: 1996/02/25 02:22:21 -## File existed as early as: 1996 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/rcout b/help/rcout index 872dfc4..eb9f538 100644 --- a/help/rcout +++ b/help/rcout @@ -57,34 +57,8 @@ EXAMPLE LIMITS none -LINK LIBRARY +LIBRARY void zredcdecode(REDC *rp, ZVALUE z1, ZVALUE *res) SEE ALSO rcout, rcmul, rcsq, rcpow - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: rcout,v 29.1 1999/12/14 09:16:04 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/rcout,v $ -## -## Under source code control: 1996/02/25 02:22:21 -## File existed as early as: 1996 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/rcpow b/help/rcpow index be5dfdc..1364c05 100644 --- a/help/rcpow +++ b/help/rcpow @@ -66,34 +66,8 @@ EXAMPLE LIMITS none -LINK LIBRARY +LIBRARY void zredcpower(REDC *rp, ZVALUE z1, ZVALUE z2, ZVALUE *res) SEE ALSO rcin, rcout, rcmul, rcsq - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: rcpow,v 29.1 1999/12/14 09:16:04 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/rcpow,v $ -## -## Under source code control: 1996/02/25 02:22:21 -## File existed as early as: 1996 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/rcsq b/help/rcsq index 7cb72c7..866f9c0 100644 --- a/help/rcsq +++ b/help/rcsq @@ -60,34 +60,8 @@ EXAMPLE LIMITS none -LINK LIBRARY +LIBRARY void zredcsquare(REDC *rp, ZVALUE z1, ZVALUE *res) SEE ALSO rcin, rcout, rcmul, rcpow - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: rcsq,v 29.1 1999/12/14 09:16:04 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/rcsq,v $ -## -## Under source code control: 1996/02/25 02:22:21 -## File existed as early as: 1996 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/re b/help/re index fad9f3f..a379c4d 100644 --- a/help/re +++ b/help/re @@ -19,34 +19,8 @@ EXAMPLE LIMITS none -LINK LIBRARY +LIBRARY COMPLEX *cimag(COMPLEX *x) SEE ALSO im - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: re,v 29.1 1999/12/14 09:16:04 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/re,v $ -## -## Under source code control: 1995/10/05 04:52:27 -## File existed as early as: 1995 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/remove b/help/remove index b5de7e1..3a5bdcf 100644 --- a/help/remove +++ b/help/remove @@ -43,34 +43,8 @@ EXAMPLE LIMITS none -LINK LIBRARY +LIBRARY none SEE ALSO append, delete, insert, islist, list, push, pop, rsearch, search, size - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: remove,v 29.1 1999/12/14 09:16:04 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/remove,v $ -## -## Under source code control: 1996/03/12 23:10:01 -## File existed as early as: 1996 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/reverse b/help/reverse index 25775ca..77180a4 100644 --- a/help/reverse +++ b/help/reverse @@ -43,34 +43,8 @@ EXAMPLE LIMITS none -LINK LIBRARY +LIBRARY none SEE ALSO join, sort - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: reverse,v 29.1 1999/12/14 09:16:05 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/reverse,v $ -## -## Under source code control: 1995/07/09 19:41:26 -## File existed as early as: 1995 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/rewind b/help/rewind index 6535d00..b775b2f 100644 --- a/help/rewind +++ b/help/rewind @@ -25,35 +25,9 @@ EXAMPLE LIMITS none - XXX - is this correct? -LINK LIBRARY +LIBRARY none - XXX - is this correct? SEE ALSO errno, fclose, feof, ferror, fflush, fgetc, fgetline, fgets, files, fopen, fprintf, fputc, fputs, fseek, fsize, ftell, isfile, printf, prompt - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: rewind,v 29.1 1999/12/14 09:16:05 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/rewind,v $ -## -## Under source code control: 1996/04/30 03:05:18 -## File existed as early as: 1996 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/rm b/help/rm index b27b912..55da461 100644 --- a/help/rm +++ b/help/rm @@ -20,34 +20,8 @@ EXAMPLE LIMITS name must be a non-zero length string -LINK LIBRARY +LIBRARY none SEE ALSO rmdir - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: rm,v 29.1 1999/12/14 09:16:05 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/rm,v $ -## -## Under source code control: 1996/06/30 22:02:58 -## File existed as early as: 1996 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/root b/help/root index 219bf33..ce0b67c 100644 --- a/help/root +++ b/help/root @@ -44,36 +44,10 @@ LIMITS n >= 0 eps > 0 -LINK LIBRARY +LIBRARY void rootvalue(VALUE *x, VALUE *n, VALUE *eps, VALUE *result) NUMBER *qroot(NUMBER *x, NUMBER *n, NUMBER *eps) COMPLEX *qroot(COMPLEX *x, NUMBER *n, NUMBER *eps) SEE ALSO power - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: root,v 29.1 1999/12/14 09:16:05 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/root,v $ -## -## Under source code control: 1995/10/25 04:03:46 -## File existed as early as: 1995 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/round b/help/round index 194593b..3c55c75 100644 --- a/help/round +++ b/help/round @@ -113,7 +113,7 @@ LIMITS 0 <= abs(plcs) < 2^31 0 <= abs(rnd) < 2^31 -LINK LIBRARY +LIBRARY void roundvalue(VALUE *x, VALUE *plcs, VALUE *rnd, VALUE *result) MATRIX *matround(MATRIX *m, VALUE *plcs, VALUE *rnd); LIST *listround(LIST *m, VALUE *plcs, VALUE *rnd); @@ -121,29 +121,3 @@ LINK LIBRARY SEE ALSO bround, btrunc, trunc, int, appr - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: round,v 29.1 1999/12/14 09:16:05 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/round,v $ -## -## Under source code control: 1994/09/30 00:52:38 -## File existed as early as: 1994 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/rsearch b/help/rsearch index df7676b..ff177cd 100644 --- a/help/rsearch +++ b/help/rsearch @@ -100,34 +100,8 @@ EXAMPLE LIMITS none -LINK LIBRARY +LIBRARY none SEE ALSO assoc, list, mat, search - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: rsearch,v 29.1 1999/12/14 09:16:05 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/rsearch,v $ -## -## Under source code control: 1994/03/19 03:13:21 -## File existed as early as: 1994 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/runtime b/help/runtime index 4982346..44afae3 100644 --- a/help/runtime +++ b/help/runtime @@ -24,34 +24,8 @@ EXAMPLE LIMITS none -LINK LIBRARY +LIBRARY none SEE ALSO ctime - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: runtime,v 29.1 1999/12/14 09:16:05 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/runtime,v $ -## -## Under source code control: 1996/03/12 23:10:01 -## File existed as early as: 1996 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/saveval b/help/saveval index c1a7e19..2845da0 100644 --- a/help/saveval +++ b/help/saveval @@ -41,34 +41,8 @@ EXAMPLE LIMITS none -LINK LIBRARY +LIBRARY none SEE ALSO oldvalue, eval - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: saveval,v 29.1 1999/12/14 09:16:05 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/saveval,v $ -## -## Under source code control: 1997/09/06 20:03:35 -## File existed as early as: 1997 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/scale b/help/scale index 583a86f..1d0690a 100644 --- a/help/scale +++ b/help/scale @@ -29,36 +29,10 @@ EXAMPLE LIMITS For non-object x, abs(n) < 2^31 -LINK LIBRARY +LIBRARY NUMBER *qscale(NUMBER *x, long n) COMPLEX *cscale(COMPLEX *x, long n) MATRIX *matscale(MATRIX *x, long n) SEE ALSO XXX - fill in - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: scale,v 29.1 1999/12/14 09:16:05 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/scale,v $ -## -## Under source code control: 1995/12/18 12:34:58 -## File existed as early as: 1995 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/scan b/help/scan index c667b4f..48ba3e8 100644 --- a/help/scan +++ b/help/scan @@ -27,34 +27,8 @@ EXAMPLE LIMITS none - XXX - is this correct? -LINK LIBRARY +LIBRARY none - XXX - is this correct? SEE ALSO fscan, strscan, fscanf, strscanf, scanf, printf, fprintf - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: scan,v 29.1 1999/12/14 09:16:05 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/scan,v $ -## -## Under source code control: 1996/04/30 03:05:18 -## File existed as early as: 1996 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/scanf b/help/scanf index b5c2ed1..4204936 100644 --- a/help/scanf +++ b/help/scanf @@ -24,34 +24,8 @@ EXAMPLE LIMITS none - XXX - is this correct? -LINK LIBRARY +LIBRARY none - XXX - is this correct? SEE ALSO scan, strscan, fscanf, strscanf, scanf, printf, fprintf - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: scanf,v 29.1 1999/12/14 09:16:06 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/scanf,v $ -## -## Under source code control: 1996/04/30 03:05:18 -## File existed as early as: 1996 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/script b/help/script deleted file mode 100644 index e050d81..0000000 --- a/help/script +++ /dev/null @@ -1,90 +0,0 @@ -Calc shell scripts - - If an executable file begins with: - - #!/usr/local/bin/calc -S [-other_flags ...] - - the rest of the file will be processed in shell script mode. - Note that -S (UPPER CASE -S) must be the first -flag on the - ``#!'' line. Any other optional ``-other_flags'' must come - after the -S. - - In shell script mode the contents of the file are evaluated - and executed as if they were processed by the read command. - Any optional ``-other_flags'' will by parsed first followed - by any arguments given shell script itself. - - In shell script mode, -s (lower case -s) is always assumed. - In addition, -d and -p are automatically set if -i is not - given. - - For example, if the file /tmp/mersenne: - - #!/usr/local/bin/calc -S -q - # - # mersenne - an example of a calc shell script file - - /* parse args */ - if (argv() != 1) { - fprintf(files(2), "usage: %s exp\n", config("program")); - abort "must give one exponent arg"; - } - - /* print the mersenne number */ - print "2^": argv(0) : "-1 =", 2^eval(argv(0))-1; - - is made an executable file by: - - chmod +x /tmp/mersenne - - then the command line: - - /tmp/mersenne 127 - - will print: - - 2^127-1 = 170141183460469231731687303715884105727 - - Note that because -s is assumed in shell script mode and - non-dashed args are made available as strings via the argv() - builtin function. Therefore: - - 2^eval(argv(0))-1 - - will print the decimal value of 2^n-1 but - - 2^argv(0)-1 - - will not. - -For more information use the following calc commands: - - help usage - help argv - help config - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: script,v 29.1 1999/12/14 09:16:06 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/script,v $ -## -## Under source code control: 1999/11/30 05:29:48 -## File existed as early as: 1999 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/search b/help/search index bde04eb..80800f9 100644 --- a/help/search +++ b/help/search @@ -116,35 +116,9 @@ EXAMPLE LIMITS none -LINK LIBRARY +LIBRARY none SEE ALSO assoc, list, mat, rsearch - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: search,v 29.1 1999/12/14 09:16:06 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/search,v $ -## -## Under source code control: 1994/03/19 03:13:21 -## File existed as early as: 1994 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/sec b/help/sec index d251fbc..3fda9be 100644 --- a/help/sec +++ b/help/sec @@ -22,34 +22,8 @@ LIMITS unlike sin and cos, x must be real eps > 0 -LINK LIBRARY +LIBRARY NUMBER *qsec(NUMBER *x, NUMBER *eps) SEE ALSO sin, cos, tan, csc, cot, epsilon - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: sec,v 29.1 1999/12/14 09:16:06 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/sec,v $ -## -## Under source code control: 1995/11/13 03:49:00 -## File existed as early as: 1995 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/sech b/help/sech index 68bfb3e..c2eb65c 100644 --- a/help/sech +++ b/help/sech @@ -24,34 +24,8 @@ LIMITS unlike sin and cos, x must be real eps > 0 -LINK LIBRARY +LIBRARY NUMBER *qsech(NUMBER *x, NUMBER *eps) SEE ALSO sinh, cosh, tanh, csch, coth, epsilon - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: sech,v 29.1 1999/12/14 09:16:06 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/sech,v $ -## -## Under source code control: 1995/11/13 03:49:00 -## File existed as early as: 1995 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/seed b/help/seed index d0f469b..c175666 100644 --- a/help/seed +++ b/help/seed @@ -45,34 +45,8 @@ EXAMPLE LIMITS none -LINK LIBRARY +LIBRARY NUMBER *pseudo_seed(void) SEE ALSO seed, srand, randbit, isrand, rand, random, srandom, israndom - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: seed,v 29.1 1999/12/14 09:16:06 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/seed,v $ -## -## Under source code control: 1999/10/03 10:04:29 -## File existed as early as: 1999 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/segment b/help/segment index 6455be3..8653d37 100644 --- a/help/segment +++ b/help/segment @@ -39,34 +39,8 @@ LIMITS 0 <= y < size(x) 0 <= z < size(x) -LINK LIBRARY +LIBRARY none SEE ALSO head, tail - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: segment,v 29.1 1999/12/14 09:16:06 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/segment,v $ -## -## Under source code control: 1995/07/10 02:09:31 -## File existed as early as: 1995 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/select b/help/select index b060984..855fe43 100644 --- a/help/select +++ b/help/select @@ -31,34 +31,8 @@ EXAMPLE LIMITS none -LINK LIBRARY +LIBRARY none SEE ALSO XXX - fill in - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: select,v 29.1 1999/12/14 09:16:06 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/select,v $ -## -## Under source code control: 1995/07/10 02:09:31 -## File existed as early as: 1995 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/sgn b/help/sgn index f7d3502..80c1a3d 100644 --- a/help/sgn +++ b/help/sgn @@ -33,34 +33,8 @@ EXAMPLE LIMITS none -LINK LIBRARY +LIBRARY NUMBER *qsign(NUMBER *x) SEE ALSO abs - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: sgn,v 29.1 1999/12/14 09:16:06 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/sgn,v $ -## -## Under source code control: 1995/10/25 04:03:46 -## File existed as early as: 1995 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/sha b/help/sha index 9023b38..c88da55 100644 --- a/help/sha +++ b/help/sha @@ -81,7 +81,7 @@ EXAMPLE LIMITS none -LINK LIBRARY +LIBRARY HASH* hash_init(int, HASH*); void hash_free(HASH*); HASH* hash_copy(HASH*); @@ -98,29 +98,3 @@ LINK LIBRARY SEE ALSO ishash, sha1 - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: sha,v 29.1 1999/12/14 09:16:06 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/sha,v $ -## -## Under source code control: 1997/03/22 06:25:51 -## File existed as early as: 1997 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/sha1 b/help/sha1 index 7ce2a01..6535a89 100644 --- a/help/sha1 +++ b/help/sha1 @@ -81,7 +81,7 @@ EXAMPLE LIMITS none -LINK LIBRARY +LIBRARY HASH* hash_init(int, HASH*); void hash_free(HASH*); HASH* hash_copy(HASH*); @@ -98,29 +98,3 @@ LINK LIBRARY SEE ALSO ishash, sha - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: sha1,v 29.1 1999/12/14 09:16:06 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/sha1,v $ -## -## Under source code control: 1997/03/23 00:01:18 -## File existed as early as: 1997 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/sin b/help/sin index 73aeaa6..4246219 100644 --- a/help/sin +++ b/help/sin @@ -28,35 +28,9 @@ EXAMPLE LIMITS eps > 0 -LINK LIBRARY +LIBRARY NUMBER *qsin(NUMBER *x, NUMBER *eps) COMPLEX *csin(COMPLEX *x, NUMBER *eps) SEE ALSO cos, tan, sec, csc, cot, epsilon - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: sin,v 29.1 1999/12/14 09:16:06 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/sin,v $ -## -## Under source code control: 1994/03/19 01:40:28 -## File existed as early as: 1994 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/sinh b/help/sinh index 892b1d2..eb4e27f 100644 --- a/help/sinh +++ b/help/sinh @@ -24,34 +24,8 @@ LIMITS unlike sin and cos, x must be real eps > 0 -LINK LIBRARY +LIBRARY NUMBER *qsinh(NUMBER *x, NUMBER *eps) SEE ALSO cosh, tanh, sech, csch, coth, epsilon - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: sinh,v 29.1 1999/12/14 09:16:07 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/sinh,v $ -## -## Under source code control: 1994/03/19 01:40:29 -## File existed as early as: 1994 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/size b/help/size index ff1976f..09f8aa9 100644 --- a/help/size +++ b/help/size @@ -51,34 +51,8 @@ EXAMPLE LIMITS none -LINK LIBRARY +LIBRARY none SEE ALSO list, mat, assoc, obj, sizeof, memsize - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: size,v 29.1 1999/12/14 09:16:07 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/size,v $ -## -## Under source code control: 1994/03/19 03:13:22 -## File existed as early as: 1994 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/sizeof b/help/sizeof index a2b3a71..6c61cea 100644 --- a/help/sizeof +++ b/help/sizeof @@ -79,34 +79,8 @@ EXAMPLES LIMITS It is assumed sizeof(x) will fit into a system long integer. -LINK LIBRARY +LIBRARY none SEE ALSO size, fsize, strlen, digits - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: sizeof,v 29.1 1999/12/14 09:16:07 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/sizeof,v $ -## -## Under source code control: 1996/05/24 02:04:04 -## File existed as early as: 1996 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/sort b/help/sort index 6a0b306..0eb69f1 100644 --- a/help/sort +++ b/help/sort @@ -243,34 +243,8 @@ EXAMPLES LIMITS none -LINK LIBRARY +LIBRARY none SEE ALSO join, reverse - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: sort,v 29.1 1999/12/14 09:16:07 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/sort,v $ -## -## Under source code control: 1995/07/09 19:41:26 -## File existed as early as: 1995 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/sqrt b/help/sqrt index 4498097..94a86d0 100644 --- a/help/sqrt +++ b/help/sqrt @@ -122,7 +122,7 @@ EXAMPLE LIMITS none -LINK LIBRARY +LIBRARY COMPLEX *csqrt(COMPLEX *x, NUMBER *ep, long z) NUMBER *qisqrt(NUMBER *q) NUMBER *qsqrt(NUMBER *x, NUMBER *ep, long z) @@ -130,29 +130,3 @@ LINK LIBRARY SEE ALSO appr, epsilon - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: sqrt,v 29.1 1999/12/14 09:16:07 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/sqrt,v $ -## -## Under source code control: 1995/09/18 03:54:32 -## File existed as early as: 1995 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/srand b/help/srand index 67eab6f..3e5c07c 100644 --- a/help/srand +++ b/help/srand @@ -143,35 +143,9 @@ EXAMPLE LIMITS for matrix arg, the matrix must have at least 55 integers -LINK LIBRARY +LIBRARY RAND *zsrand(ZVALUE *pseed, MATRIX *pmat55) RAND *zsetrand(RAND *state) SEE ALSO seed, srandom, randbit, isrand, random, srandom, israndom - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: srand,v 29.1 1999/12/14 09:16:07 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/srand,v $ -## -## Under source code control: 1996/01/01 04:19:07 -## File existed as early as: 1996 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/srandom b/help/srandom index 8fb7676..638c090 100644 --- a/help/srandom +++ b/help/srandom @@ -63,7 +63,7 @@ DESCRIPTION The seed value is used to compute the new quadratic residue. The seed passed will be successively squared mod the Blum modulus until we get a smaller value (modulus wrap). The - calc resource file produces an equivalent effect: + calc script produces an equivalent effect: /* assume n is the current Blum modulus */ r = seed; @@ -120,7 +120,7 @@ DESCRIPTION lcm(factors of p-1 and q-1) == lcm(2,fp,2,fq) = 2*fp*fq = ~n/2 - The following calc resource file: + The following calc script: /* find first Blum prime: p */ fp = int((ip-1)/2); @@ -159,11 +159,11 @@ DESCRIPTION number of pseudo prime tests that a candidate must pass before being considered a probable prime (must be >0, try 25) - The calc standard resource file seedrandom.cal will produce a - seed a generator. If the config value custom("resource_debug") - is 0 or 1, then the selected Blum modulus and quadratic residue - will be printed. If the global value is 1, then p and q are - also printed. The resource file defines the function: + The calc library script seedrandom.cal will produce a seed a + generator. If the global value lib_debug is 0 or 1, then + the selected Blum modulus and quadratic residue will be printed. + If the global value is 1, then p and q are also printed. + The script defines the function: seedrandom(seed1, seed2, size [, trials]) @@ -189,11 +189,11 @@ DESCRIPTION If you don't want to use a pre-compiled in Blum moduli you can compute your own values ahead of time. This can be done by a method of your own choosing, or by using the seedrandom.cal - resource file in the following way: + script in the following way: - 1) calc # run calc - 2) read seedrandom # load seedrandom - 3) config("resource_debug",0) # we want the modulus & quad res only + 1) calc # run calc + 2) read seedrandom # load seedrandom + 3) lib_debug=0 # we want the modulus and quad res only 4) seedrandom( ~pound out 20-93 random digits on the keyboard~, ~pound out 20-93 random digits on the keyboard~, 512 ) @@ -331,35 +331,9 @@ LIMITS ip >= 2^16 iq >= 2^16 -LINK LIBRARY +LIBRARY RAND *zsrandom(ZVALUE *pseed, MATRIX *pmat55) RAND *zsetrandom(RAND *state) SEE ALSO seed, srand, randbit, isrand, random, srandom, israndom - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: srandom,v 29.1 1999/12/14 09:16:07 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/srandom,v $ -## -## Under source code control: 1997/02/17 01:18:22 -## File existed as early as: 1997 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/ssq b/help/ssq index 6a01b9b..b594358 100644 --- a/help/ssq +++ b/help/ssq @@ -29,34 +29,8 @@ EXAMPLE LIMITS The number of arguments is not to exceed 100. -LINK LIBRARY +LIBRARY none SEE ALSO XXX - fill in - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: ssq,v 29.1 1999/12/14 09:16:07 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/ssq,v $ -## -## Under source code control: 1995/10/25 04:03:46 -## File existed as early as: 1995 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/statement b/help/statement index 3862f5b..3142d94 100644 --- a/help/statement +++ b/help/statement @@ -240,29 +240,3 @@ Statements expression calc expression syntax builtin calc builtin functions usage how to invoke the calc command and calc -options - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: statement,v 29.1 1999/12/14 09:16:07 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/statement,v $ -## -## Under source code control: 1991/07/21 04:37:23 -## File existed as early as: 1991 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/str b/help/str index 7f63a31..104bde7 100644 --- a/help/str +++ b/help/str @@ -31,7 +31,7 @@ EXAMPLE LIMITS none -LINK LIBRARY +LIBRARY void math_divertio(); qprintnum(NUMBER *x, int outmode); char *math_getdivertedio(); @@ -42,29 +42,3 @@ LINK LIBRARY SEE ALSO XXX - fill in - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: str,v 29.1 1999/12/14 09:16:07 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/str,v $ -## -## Under source code control: 1995/10/05 04:52:27 -## File existed as early as: 1995 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/strcat b/help/strcat index 102812c..a1b5e3b 100644 --- a/help/strcat +++ b/help/strcat @@ -23,34 +23,8 @@ EXAMPLE LIMITS The number of arguments may not to exceed 100. -LINK LIBRARY +LIBRARY none SEE ALSO XXX - fill in - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: strcat,v 29.1 1999/12/14 09:16:07 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/strcat,v $ -## -## Under source code control: 1995/10/05 04:52:27 -## File existed as early as: 1995 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/strerror b/help/strerror index 32241b2..8701dc8 100644 --- a/help/strerror +++ b/help/strerror @@ -45,34 +45,8 @@ EXAMPLE LIMITS none -LINK LIBRARY +LIBRARY none SEE ALSO errcount, errmax, error, iserror, errno, newerror, errorcodes - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: strerror,v 29.1 1999/12/14 09:16:08 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/strerror,v $ -## -## Under source code control: 1996/04/30 03:05:18 -## File existed as early as: 1996 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/strlen b/help/strlen index 58f39e3..2beb05a 100644 --- a/help/strlen +++ b/help/strlen @@ -19,34 +19,8 @@ EXAMPLE LIMITS none -LINK LIBRARY +LIBRARY none SEE ALSO XXX - fill in - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: strlen,v 29.1 1999/12/14 09:16:08 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/strlen,v $ -## -## Under source code control: 1995/10/05 04:52:27 -## File existed as early as: 1995 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/strpos b/help/strpos index 9b367ff..cfe2a47 100644 --- a/help/strpos +++ b/help/strpos @@ -33,34 +33,8 @@ EXAMPLE LIMITS none -LINK LIBRARY +LIBRARY none SEE ALSO XXX - fill in - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: strpos,v 29.1 1999/12/14 09:16:08 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/strpos,v $ -## -## Under source code control: 1995/07/09 03:48:57 -## File existed as early as: 1995 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/strprintf b/help/strprintf index 10e81fe..7ac63c0 100644 --- a/help/strprintf +++ b/help/strprintf @@ -30,34 +30,8 @@ EXAMPLE LIMITS The number of arguments of strprintf() is not to exceed 100. -LINK LIBRARY +LIBRARY none SEE ALSO printf, fprintf, print - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: strprintf,v 29.1 1999/12/14 09:16:08 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/strprintf,v $ -## -## Under source code control: 1996/03/12 22:50:41 -## File existed as early as: 1996 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/strscan b/help/strscan index 52aed40..f2d9c5e 100644 --- a/help/strscan +++ b/help/strscan @@ -29,34 +29,8 @@ EXAMPLE LIMITS none - XXX - is this correct? -LINK LIBRARY +LIBRARY none - XXX - is this correct? SEE ALSO scan, fscan, fscanf, strscanf, scanf, printf, fprintf - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: strscan,v 29.1 1999/12/14 09:16:08 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/strscan,v $ -## -## Under source code control: 1996/04/30 03:05:18 -## File existed as early as: 1996 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/strscanf b/help/strscanf index b26eb5c..da8acbf 100644 --- a/help/strscanf +++ b/help/strscanf @@ -108,34 +108,8 @@ EXAMPLE LIMITS none - XXX - is this correct? -LINK LIBRARY +LIBRARY none - XXX - is this correct? SEE ALSO fscanf, scanf, fscan, strscan, scan, print, printf - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: strscanf,v 29.1 1999/12/14 09:16:09 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/strscanf,v $ -## -## Under source code control: 1996/04/30 03:05:18 -## File existed as early as: 1996 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/substr b/help/substr index f00f8d2..33f5354 100644 --- a/help/substr +++ b/help/substr @@ -31,34 +31,8 @@ EXAMPLE LIMITS none -LINK LIBRARY +LIBRARY none SEE ALSO XXX - fill in - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: substr,v 29.1 1999/12/14 09:16:09 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/substr,v $ -## -## Under source code control: 1995/10/05 04:52:27 -## File existed as early as: 1995 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/sum b/help/sum index 26ecd02..c68653d 100644 --- a/help/sum +++ b/help/sum @@ -53,34 +53,8 @@ EXAMPLE LIMITS The number of arguments is not to exceed 100. -LINK LIBRARY +LIBRARY NUMBER *qmin(NUMBER *x1, NUMBER *x2) SEE ALSO max, obj - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: sum,v 29.1 1999/12/14 09:16:09 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/sum,v $ -## -## Under source code control: 1997/03/10 03:59:59 -## File existed as early as: 1997 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/swap b/help/swap index c521c0b..f8adf80 100644 --- a/help/swap +++ b/help/swap @@ -32,34 +32,8 @@ EXAMPLE LIMITS none -LINK LIBRARY +LIBRARY none SEE ALSO assign - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: swap,v 29.1 1999/12/14 09:16:09 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/swap,v $ -## -## Under source code control: 1995/12/18 12:34:58 -## File existed as early as: 1995 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/system b/help/system index 56dbc17..0667e32 100644 --- a/help/system +++ b/help/system @@ -38,34 +38,8 @@ EXAMPLE LIMITS none -LINK LIBRARY +LIBRARY none SEE ALSO XXX - fill in - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: system,v 29.1 1999/12/14 09:16:09 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/system,v $ -## -## Under source code control: 1995/07/09 03:48:57 -## File existed as early as: 1995 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/tail b/help/tail index 6f0a0cb..465661c 100644 --- a/help/tail +++ b/help/tail @@ -43,34 +43,8 @@ EXAMPLE LIMITS none -LINK LIBRARY +LIBRARY none SEE ALSO head, segment - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: tail,v 29.1 1999/12/14 09:16:09 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/tail,v $ -## -## Under source code control: 1995/07/10 02:09:30 -## File existed as early as: 1995 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/tan b/help/tan index b0a5d39..a5360b0 100644 --- a/help/tan +++ b/help/tan @@ -22,34 +22,8 @@ LIMITS unlike sin and cos, x must be real eps > 0 -LINK LIBRARY +LIBRARY NUMBER *qtan(NUMBER *x, NUMBER *eps) SEE ALSO sin, cos, sec, csc, cot, epsilon - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: tan,v 29.1 1999/12/14 09:16:09 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/tan,v $ -## -## Under source code control: 1994/03/19 01:40:29 -## File existed as early as: 1994 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/tanh b/help/tanh index d3f6c47..cf6491a 100644 --- a/help/tanh +++ b/help/tanh @@ -24,34 +24,8 @@ LIMITS unlike sin and cos, x must be real eps > 0 -LINK LIBRARY +LIBRARY NUMBER *qtanh(NUMBER *x, NUMBER *eps) SEE ALSO sinh, cosh, sech, csch, coth, epsilon - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: tanh,v 29.1 1999/12/14 09:16:09 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/tanh,v $ -## -## Under source code control: 1994/03/19 01:40:30 -## File existed as early as: 1994 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/test b/help/test index 1fc501a..f628a39 100644 --- a/help/test +++ b/help/test @@ -48,35 +48,9 @@ EXAMPLE LIMITS none -LINK LIBRARY +LIBRARY none SEE ALSO isassoc, isfile, isident, isnum, isint, islist, ismat, isnull, isobj, isreal, isstr, issimple, istype - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: test,v 29.1 1999/12/14 09:16:09 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/test,v $ -## -## Under source code control: 1996/07/11 01:05:13 -## File existed as early as: 1996 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/time b/help/time index ad82b9e..393e35b 100644 --- a/help/time +++ b/help/time @@ -20,34 +20,8 @@ EXAMPLE LIMITS none -LINK LIBRARY +LIBRARY none SEE ALSO ctime, runtime - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: time,v 29.1 1999/12/14 09:16:09 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/time,v $ -## -## Under source code control: 1996/05/01 16:57:20 -## File existed as early as: 1996 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/todo b/help/todo index 80a28e1..742523b 100644 --- a/help/todo +++ b/help/todo @@ -60,13 +60,15 @@ Very High priority items: * Fix any 'Known bugs' as noted in the BUGS file or as displayed by 'calc help bugs'. + * Copyleft calc and place it under a LGPL. + =-= High priority items: * Verify, complete or fix the 'SEE ALSO' help file sections. - * Verify, complete or fix the 'LINK LIBRARY' help file sections. + * Verify, complete or fix the 'LIBRARY' help file sections. * Verify, complete or fix the 'LIMITS' help file sections. @@ -82,6 +84,19 @@ High priority items: * Address, if possible and reasonable, any Calc Mis-features as noted in the BUGS file or as displayed by 'calc help bugs'. + * The shell script that is currently constructed to display a help + file (in help.c) is a gross hack. That code should be replaced + with code that looks for the help file in the pre-defined help + directories. When the specific help file is found and opened, + then a $PAGER should be forked and execed after doing things such + as closing open file descriptors that the $PAGER does not need. + + * The arg passdown to the lower level Makfiles should be reviewed + to determine which items really need to be passed down. The lower + level Makefiles should default to the shipped values. + + * Consider using configure to build the calc Makefile. + =-= Medium priority items: @@ -115,31 +130,3 @@ Medium priority items: * Add a builtin function to access the 64 bit FNV hash which is currently being used internally in seed.c. - - * Consider using configure to build the calc Makefile. - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: todo,v 29.1 1999/12/14 09:16:09 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/todo,v $ -## -## Under source code control: 1999/10/20 07:42:55 -## File existed as early as: 1999 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/trunc b/help/trunc index 6c3f81b..398a2af 100644 --- a/help/trunc +++ b/help/trunc @@ -29,34 +29,8 @@ EXAMPLE LIMITS 0 <= j < 2^31 -LINK LIBRARY +LIBRARY NUMBER *qtrunc(NUMBER *x, *j) SEE ALSO bround, btrunc, int, round - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: trunc,v 29.1 1999/12/14 09:16:10 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/trunc,v $ -## -## Under source code control: 1994/09/30 00:52:38 -## File existed as early as: 1994 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/types b/help/types index 55f2c64..9117d4e 100644 --- a/help/types +++ b/help/types @@ -100,29 +100,3 @@ Builtin types be copied by normal assignments between variables, or by using the result of the 'files' function. Such copies are indistinguishable from each other. - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: types,v 29.1 1999/12/14 09:16:10 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/types,v $ -## -## Under source code control: 1991/07/21 04:37:24 -## File existed as early as: 1991 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/unexpected b/help/unexpected index 25419c0..86e52d7 100644 --- a/help/unexpected +++ b/help/unexpected @@ -240,36 +240,3 @@ Unexpected should be those associated with epsilon(), and if it has been called, qpi(). - - - #! is also a comment - ==================== - - In addition to the C style /* comment lines */, lines that begin with - #! are treated as comments. - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: unexpected,v 29.1 1999/12/14 09:16:10 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/unexpected,v $ -## -## Under source code control: 1997/03/21 13:15:18 -## File existed as early as: 1997 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/usage b/help/usage index bbe248b..4f44c32 100644 --- a/help/usage +++ b/help/usage @@ -2,313 +2,187 @@ Calc command line Calc has the following command line: - calc [-c] [-C] [-d] [-D calc_debug[:resource_debug:[user_debug]]] - [-e] [-h] [-i] [-m mode] [-n] [-p] [-q] [-s] [-u] [-v] - [calc_cmd ...] + calc [-c] [-C] [-d] [-D calc_debug[:lib_debug:[user_debug]]] + [-e] [-h] [-i] [-m mode] [-n] [-p] [-q] [-u] [-v] [calc_cmd ...] - #!/usr/local/bin/calc -S [-other_flags ...] + -c Continue reading command lines even after an execution + error has caused the abandonment of a line. - -c Continue reading command lines even after an execution - error has caused the abandonment of a line. + For example: - For example: + calc read many_errors.cal - calc read many_errors.cal + will cause calc to abort on the first error, whereas: - will cause calc to abort on the first error, whereas: + calc -c read many_errors.cal - calc -c read many_errors.cal + will cause calc to try to process each line being read + despite the errors that it encounters. - will cause calc to try to process each line being read - despite the errors that it encounters. + By default, calc startup scripts ($CALCRC) are silently + ignored if not found. This flag will report missing + startup scripts unless -d is also given. - By default, calc startup resource files ($CALCRC) are - silently ignored if not found. This flag will report - missing startup scripts unless -d is also given. + -C Permit the execution of custom builtin functions. Without + this flag, calling the custom() builtin function will + simply generate an error. + Use if this flag may cause calc to execute functions that + are non-standard and that are not portable. Custom builtin + functions are disabled by default for this reason. - -C Permit the execution of custom builtin functions. - Without this flag, calling the custom() builtin - function will simply generate an error. + -d Disable the printing of the opening title. The printing + of library debug and informational messages is also disabled + as if config("lib_debug",0) had been executed. - Use if this flag may cause calc to execute functions - that are non-standard and that are not portable. - Custom builtin functions are disabled by default for - this reason. + For example: + calc 'read qtime; qtime(2)' - -d Disable the printing of the opening title. The - printing of resource file debug and informational messages is - also disabled as if config("resource_debug", 0) had been - executed. + will output something like: - For example: + qtime(utc_hr_offset) defined + It's nearly ten past six. - calc 'read qtime; qtime(2)' + whereas: - will output something like: + calc -d 'read qtime; qtime(2)' - qtime(utc_hr_offset) defined - It's nearly ten past six. + will just say: - whereas: + It's nearly ten past six. - calc -d 'read qtime; qtime(2)' + This flag disables the reporting of missing calc + startup scripts ($CALCRC). - will just say: + -D calc_debug[:lib_debug:[user_debug]] - It's nearly ten past six. + Force the initial value of config("calc_debug"), + config("lib_debug") and config("user_debug"). - This flag disables the reporting of missing calc - startup scripts ($CALCRC). + The : separated strings are interpreted as signed 32 bit values. + After an optional leading sign a leading zero indicates octal + conversion, and a leading ``0x'' or ``0X'' hexadecimal + conversion. Otherwise, decimal conversion is assumed. + By default, calc_debug is 0, lib_debug is 3 and lib_debug is 0. - -D calc_debug[:resource_debug:[user_debug]] - Force the initial value of config("calc_debug"), - config("resource_debug") and config("user_debug"). + For more information use the following calc command: - The : separated strings are interpreted as signed 32 - bit values. After an optional leading sign a leading - zero indicates octal conversion, and a leading ``0x'' - or ``0X'' hexadecimal conversion. Otherwise, decimal - conversion is assumed. + help config - By default, calc_debug is 0, resource_debug is 3 and - user_debug is 0. + -e Ignore any environment variables on startup. The + getenv() builtin will still return values, however. - For more information use the following calc command: + -h Print a help message. This option implies -q. This + is equivalent to the calc command help help. The help + facility is disabled unless the mode is 5 or 7. See -m. - help config + -i Become interactive if possible. Be default, if calc_cmd + args are given, calc will execute them and exit. This flag + will cause calc to drop into interactive mode after the + commands are executed. + For example: - -e Ignore any environment variables on startup. The - getenv() builtin will still return values, however. + calc 2+5 + will print the value 7 and exit whereas: - -h Print a help message. This option implies -q. This is - equivalent to the calc command help help. The help - facility is disabled unless the mode is 5 or 7. See - -m. + calc -i 2+5 + will print the value 7 and prompt the user for more + calc commands. - -i Become interactive if possible. Be default, if - calc_cmd args are given, calc will execute them and - exit. This flag args are given, calc will execute them - and exit. This flag will cause calc to drop into - interactive mode after the commands are executed. + -m mode + This flag sets the permission mode of calc. It + controls the ability for calc to open files and execute + programs. Mode may be a number from 0 to 7. - For example: + The mode value is interpreted in a way similar to that + of the chmod(1) octal mode: - calc 2+5 + 0 do not open any file, do not execute progs + 1 do not open any file + 2 do not open files for reading, do not execute progs + 3 do not open files for reading + 4 do not open files for writing, do not execute progs + 5 do not open files for writing + 6 do not execute any program + 7 allow everything (default mode) - will print the value 7 and exit whereas: + If one wished to run calc from a privileged user, one + might want to use -m 0 in an effort to make calc more + secure. - calc -i 2+5 + Mode bits for reading and writing apply only on an + open. Files already open are not effected. Thus if one + wanted to use the -m 0 in an effort to make calc more + secure, but still wanted to read and write a specific + file, one might want to do in sh, ksh, bash-like shells: - will print the value 7 and prompt the user for more - calc commands. + calc -m 0 3 /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/help/xor b/help/xor index 69929d1..28157cf 100644 --- a/help/xor +++ b/help/xor @@ -32,34 +32,8 @@ EXAMPLE LIMITS The number of arguments is not to exceed 100. -LINK LIBRARY +LIBRARY NUMBER *qxor(NUMBER *x1, NUMBER *x2) SEE ALSO XXX - fill in - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: xor,v 29.1 1999/12/14 09:16:10 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/xor,v $ -## -## Under source code control: 1995/10/05 04:52:27 -## File existed as early as: 1995 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/hist.c b/hist.c index 48ef353..0c81ec6 100644 --- a/hist.c +++ b/hist.c @@ -1,33 +1,8 @@ /* - * hist - interactive readline module + * Copyright (c) 1997 David I. Bell + * Permission is granted to use, distribute, or modify this source, + * provided that this copyright notice remains intact. * - * Copyright (C) 1999 David I. Bell - * - * Calc is open software; you can redistribute it and/or modify it under - * the terms of the version 2.1 of the GNU Lesser General Public License - * as published by the Free Software Foundation. - * - * Calc is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General - * Public License for more details. - * - * A copy of version 2.1 of the GNU Lesser General Public License is - * distributed with calc under the filename COPYING-LGPL. You should have - * received a copy with calc; if not, write to Free Software Foundation, Inc. - * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. - * - * @(#) $Revision: 29.1 $ - * @(#) $Id: hist.c,v 29.1 1999/12/14 09:16:10 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/hist.c,v $ - * - * Under source code control: 1993/05/02 20:09:19 - * File existed as early as: 1993 - * - * Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ - */ - -/* * Adapted from code written by Stephen Rothwell. * * GNU readline support added by Martin Buck @@ -37,7 +12,6 @@ * The key bindings for the editing commands are (slightly) configurable. */ - #include #include #include @@ -54,6 +28,7 @@ #include "calc.h" #include "hist.h" +#include "terminal.h" #include "have_string.h" #include "have_strdup.h" @@ -61,6 +36,21 @@ # define strdup(x) calc_strdup((CONST char *)(x)) #endif /* HAVE_STRDUP */ + +#if defined(USE_TERMIOS) +# include +# define TTYSTRUCT struct termios +#else /* USE_SGTTY */ +# if defined(USE_TERMIO) +# include +# define TTYSTRUCT struct termio +# else /* USE_TERMIO */ + /* assume USE_SGTTY */ +# include +# define TTYSTRUCT struct sgttyb +# endif /* USE_TERMIO */ +#endif /* USE_SGTTY */ + #ifdef HAVE_STRING_H # include #endif @@ -214,6 +204,7 @@ static int canedit; static int histused; static int key_count; static int save_len; +static TTYSTRUCT oldtty; static KEY_MAP *cur_map; static KEY_MAP *base_map; static KEY_ENT key_table[MAX_KEYS]; @@ -325,12 +316,14 @@ hist_getline(char *prompt, char *buf, int len) int hist_init(char *filename) { + TTYSTRUCT newtty; + /* * prevent multiple initializations */ if (inited) { if (conf->calc_debug & CALCDBG_TTY) - printf("hist_init: inited already set\n"); + printf("DEBUG: inited already set in hist_init\n"); return HIST_INITED; } @@ -340,7 +333,7 @@ hist_init(char *filename) inited = 1; canedit = 0; if (conf->calc_debug & CALCDBG_TTY) - printf("hist_init: Set inited, cleared canedit\n"); + printf("DEBUG: Set inited, cleared canedit in hist_init\n"); /* * open the bindings file @@ -361,16 +354,77 @@ hist_init(char *filename) */ closeinput(); - /* - * setup the calc TTY on STDIN - */ - if (!calc_tty(STDIN)) { +#ifdef USE_SGTTY + if (ioctl(STDIN, TIOCGETP, &oldtty) < 0) { + if (conf->calc_debug & CALCDBG_TTY) + printf("DEBUG: Cannot TIOCGETP stdin in hist_init\n"); return HIST_NOTTY; } + newtty = oldtty; + newtty.sg_flags &= ~ECHO; + newtty.sg_flags |= CBREAK; + + if (ioctl(STDIN, TIOCSETP, &newtty) < 0) { + if (conf->calc_debug & CALCDBG_TTY) + printf("DEBUG: Cannot TIOCSETP stdin in hist_init\n"); + return HIST_NOTTY; + } + if (conf->calc_debug & CALCDBG_TTY) + printf("DEBUG: stty -ECHO +CBREAK in hist_init\n"); +#endif + +#ifdef USE_TERMIO + if (ioctl(STDIN, TCGETA, &oldtty) < 0) { + if (conf->calc_debug & CALCDBG_TTY) + printf("DEBUG: Cannot TCGETA stdin in hist_init\n"); + return HIST_NOTTY; + } + + newtty = oldtty; + newtty.c_lflag &= ~(ECHO | ECHOE | ECHOK); + newtty.c_iflag |= ISTRIP; + newtty.c_lflag &= ~ICANON; + newtty.c_cc[VMIN] = 1; + newtty.c_cc[VTIME] = 0; + + if (ioctl(STDIN, TCSETAW, &newtty) < 0) { + if (conf->calc_debug & CALCDBG_TTY) + printf("DEBUG: Cannot TCSETAW stdin in hist_init\n"); + return HIST_NOTTY; + } + if (conf->calc_debug & CALCDBG_TTY) + printf("DEBUG: stty -ECHO -ECHOE -ECHOK -ICANON +ISTRIP " + "VMIN=1 VTIME=0 in hist_init\n"); +#endif + +#ifdef USE_TERMIOS + if (tcgetattr(STDIN, &oldtty) < 0) { + if (conf->calc_debug & CALCDBG_TTY) + printf("DEBUG: Cannot tcgetattr stdin in hist_init\n"); + return HIST_NOTTY; + } + + newtty = oldtty; + newtty.c_lflag &= ~(ECHO | ECHOE | ECHOK); + newtty.c_iflag |= ISTRIP; + newtty.c_lflag &= ~ICANON; + newtty.c_cc[VMIN] = 1; + newtty.c_cc[VTIME] = 0; + + if (tcsetattr(STDIN, TCSANOW, &newtty) < 0) { + if (conf->calc_debug & CALCDBG_TTY) + printf("DEBUG: Cannot tcsetattr stdin in hist_init\n"); + return HIST_NOTTY; + } + if (conf->calc_debug & CALCDBG_TTY) + printf("DEBUG: stty -ECHO -ECHOE -ECHOK -ICANON +ISTRIP " + "VMIN=1 VTIME=0 in hist_init\n"); +#endif + canedit = 1; if (conf->calc_debug & CALCDBG_TTY) - printf("hist_init: Set canedit\n"); + printf("DEBUG: Set canedit in hist_init\n"); return HIST_SUCCESS; } @@ -385,20 +439,35 @@ hist_term(void) if (!inited || !canedit) { if (conf->calc_debug & CALCDBG_TTY) { if (!inited) - printf("hist_term: inited already cleared\n"); + printf("DEBUG: inited already cleared " + "in hist_term\n"); if (!canedit) - printf("hist_term: canedit already cleared\n"); + printf("DEBUG: canedit already cleared " + "in hist_term\n"); } inited = 0; if (conf->calc_debug & CALCDBG_TTY) - printf("hist_term: Cleared inited\n"); + printf("DEBUG: Cleared inited in hist_term\n"); return; } - /* - * restore orignal tty state - */ - (void) orig_tty(STDIN); +#ifdef USE_SGTTY + (void) ioctl(STDIN, TIOCSETP, &oldtty); + if (conf->calc_debug & CALCDBG_TTY) + printf("DEBUG: TIOCSETP restored stdin in hist_term\n"); +#endif + +#ifdef USE_TERMIO + (void) ioctl(STDIN, TCSETAW, &oldtty); + if (conf->calc_debug & CALCDBG_TTY) + printf("DEBUG: TCSETAW restored stdin in hist_term\n"); +#endif + +#ifdef USE_TERMIOS + (void) tcsetattr(STDIN, TCSANOW, &oldtty); + if (conf->calc_debug & CALCDBG_TTY) + printf("DEBUG: TCSANOW restored stdin in hist_term\n"); +#endif } diff --git a/hist.h b/hist.h index ad098f8..5428a47 100644 --- a/hist.h +++ b/hist.h @@ -1,30 +1,9 @@ /* - * hist - definitions for command history module + * Copyright (c) 1997 David I. Bell + * Permission is granted to use, distribute, or modify this source, + * provided that this copyright notice remains intact. * - * Copyright (C) 1999 David I. Bell - * - * Calc is open software; you can redistribute it and/or modify it under - * the terms of the version 2.1 of the GNU Lesser General Public License - * as published by the Free Software Foundation. - * - * Calc is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General - * Public License for more details. - * - * A copy of version 2.1 of the GNU Lesser General Public License is - * distributed with calc under the filename COPYING-LGPL. You should have - * received a copy with calc; if not, write to Free Software Foundation, Inc. - * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. - * - * @(#) $Revision: 29.1 $ - * @(#) $Id: hist.h,v 29.1 1999/12/14 09:16:10 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/hist.h,v $ - * - * Under source code control: 1993/05/02 20:09:20 - * File existed as early as: 1993 - * - * Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ + * Definitions for command history module. */ diff --git a/input.c b/input.c index b5f2a8e..0155110 100644 --- a/input.c +++ b/input.c @@ -1,38 +1,12 @@ /* - * input - nsted input source file reader + * Copyright (c) 1995 David I. Bell + * Permission is granted to use, distribute, or modify this source, + * provided that this copyright notice remains intact. * - * Copyright (C) 1999 David I. Bell - * - * Calc is open software; you can redistribute it and/or modify it under - * the terms of the version 2.1 of the GNU Lesser General Public License - * as published by the Free Software Foundation. - * - * Calc is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General - * Public License for more details. - * - * A copy of version 2.1 of the GNU Lesser General Public License is - * distributed with calc under the filename COPYING-LGPL. You should have - * received a copy with calc; if not, write to Free Software Foundation, Inc. - * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. - * - * @(#) $Revision: 29.1 $ - * @(#) $Id: input.c,v 29.1 1999/12/14 09:16:10 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/input.c,v $ - * - * Under source code control: 1990/02/15 01:48:16 - * File existed as early as: before 1990 - * - * Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ - */ - -/* * Nested input source file reader. * For terminal input, this also provides a simple command stack. */ - #include #include #include diff --git a/jump.c b/jump.c index 1b60c7e..137ee8f 100644 --- a/jump.c +++ b/jump.c @@ -1,34 +1,29 @@ +/* + * Copyright (c) 1996 by Landon Curt Noll. All Rights Reserved. + * + * Permission to use, copy, modify, and distribute this software and + * its documentation for any purpose and without fee is hereby granted, + * provided that the above copyright, this permission notice and text + * this comment, and the disclaimer below appear in all of the following: + * + * supporting documentation + * source copies + * source works derived from this source + * binaries derived from this source or from derived source + * + * LANDON CURT NOLL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO + * EVENT SHALL LANDON CURT NOLL BE LIABLE FOR ANY SPECIAL, INDIRECT OR + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF + * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR + * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. + * + * chongo was here /\../\ + */ /* * jump - trivial prime jump table * - * Copyright (C) 1999 Landon Curt Noll - * - * Calc is open software; you can redistribute it and/or modify it under - * the terms of the version 2.1 of the GNU Lesser General Public License - * as published by the Free Software Foundation. - * - * Calc is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General - * Public License for more details. - * - * A copy of version 2.1 of the GNU Lesser General Public License is - * distributed with calc under the filename COPYING-LGPL. You should have - * received a copy with calc; if not, write to Free Software Foundation, Inc. - * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. - * - * @(#) $Revision: 29.1 $ - * @(#) $Id: jump.c,v 29.1 1999/12/14 09:16:10 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/jump.c,v $ - * - * Under source code control: 1994/06/29 04:03:54 - * File existed as early as: 1994 - * - * chongo /\oo/\ http://reality.sgi.com/chongo/ - * Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ - */ - -/* * If x is divisible by a trivial prime (2,3,5,7,11), then: * * x + jmpindx[ (x>>1)%JMPMOD ] @@ -51,7 +46,6 @@ * average reduces the values we need to test by a factor of at least 2.4. */ - #include "jump.h" /* diff --git a/jump.h b/jump.h index 5acfff7..6de9787 100644 --- a/jump.h +++ b/jump.h @@ -1,34 +1,29 @@ +/* + * Copyright (c) 1997 by Landon Curt Noll. All Rights Reserved. + * + * Permission to use, copy, modify, and distribute this software and + * its documentation for any purpose and without fee is hereby granted, + * provided that the above copyright, this permission notice and text + * this comment, and the disclaimer below appear in all of the following: + * + * supporting documentation + * source copies + * source works derived from this source + * binaries derived from this source or from derived source + * + * LANDON CURT NOLL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO + * EVENT SHALL LANDON CURT NOLL BE LIABLE FOR ANY SPECIAL, INDIRECT OR + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF + * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR + * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. + * + * chongo was here /\../\ + */ /* * jump - trivial prime jump table * - * Copyright (C) 1999 Landon Curt Noll - * - * Calc is open software; you can redistribute it and/or modify it under - * the terms of the version 2.1 of the GNU Lesser General Public License - * as published by the Free Software Foundation. - * - * Calc is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General - * Public License for more details. - * - * A copy of version 2.1 of the GNU Lesser General Public License is - * distributed with calc under the filename COPYING-LGPL. You should have - * received a copy with calc; if not, write to Free Software Foundation, Inc. - * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. - * - * @(#) $Revision: 29.1 $ - * @(#) $Id: jump.h,v 29.1 1999/12/14 09:16:10 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/jump.h,v $ - * - * Under source code control: 1994/06/29 04:03:55 - * File existed as early as: 1994 - * - * chongo /\oo/\ http://reality.sgi.com/chongo/ - * Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ - */ - -/* * If x is divisible by a trivial prime (2,3,5,7,11), then: * * x + jmpindx[ (x>>1)%JMPMOD ] @@ -61,7 +56,6 @@ * average reduces the values we need to test by a factor of at least 2.4. */ - #if !defined(__JUMP_H__) #define __JUMP_H__ diff --git a/label.c b/label.c index 73535e1..8d051e1 100644 --- a/label.c +++ b/label.c @@ -1,33 +1,11 @@ /* - * label - label handling routines + * Copyright (c) 1993 David I. Bell + * Permission is granted to use, distribute, or modify this source, + * provided that this copyright notice remains intact. * - * Copyright (C) 1999 David I. Bell - * - * Calc is open software; you can redistribute it and/or modify it under - * the terms of the version 2.1 of the GNU Lesser General Public License - * as published by the Free Software Foundation. - * - * Calc is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General - * Public License for more details. - * - * A copy of version 2.1 of the GNU Lesser General Public License is - * distributed with calc under the filename COPYING-LGPL. You should have - * received a copy with calc; if not, write to Free Software Foundation, Inc. - * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. - * - * @(#) $Revision: 29.1 $ - * @(#) $Id: label.c,v 29.1 1999/12/14 09:16:11 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/label.c,v $ - * - * Under source code control: 1990/02/15 01:48:17 - * File existed as early as: before 1990 - * - * Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ + * Label handling routines. */ - #include "calc.h" #include "token.h" #include "label.h" diff --git a/label.h b/label.h index 06aa04c..83f53d3 100644 --- a/label.h +++ b/label.h @@ -1,30 +1,7 @@ /* - * label - label handling routines - * - * Copyright (C) 1999 David I. Bell - * - * Calc is open software; you can redistribute it and/or modify it under - * the terms of the version 2.1 of the GNU Lesser General Public License - * as published by the Free Software Foundation. - * - * Calc is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General - * Public License for more details. - * - * A copy of version 2.1 of the GNU Lesser General Public License is - * distributed with calc under the filename COPYING-LGPL. You should have - * received a copy with calc; if not, write to Free Software Foundation, Inc. - * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. - * - * @(#) $Revision: 29.1 $ - * @(#) $Id: label.h,v 29.1 1999/12/14 09:16:11 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/label.h,v $ - * - * Under source code control: 1990/02/15 01:48:33 - * File existed as early as: before 1990 - * - * Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ + * Copyright (c) 1997 David I. Bell + * Permission is granted to use, distribute, or modify this source, + * provided that this copyright notice remains intact. */ diff --git a/cal/Makefile b/lib/Makefile similarity index 62% rename from cal/Makefile rename to lib/Makefile index cec3f7f..22599bc 100644 --- a/cal/Makefile +++ b/lib/Makefile @@ -1,35 +1,14 @@ -#!/bin/make # -# cal - makefile for calc standard resource files +# lib - makefile for calc library scripts # -# Copyright (C) 1999 Landon Curt Noll +# Copyright (c) 1997 David I. Bell and Landon Curt Noll +# Permission is granted to use, distribute, or modify this source, +# provided that this copyright notice remains intact. # -# Calc is open software; you can redistribute it and/or modify it under -# the terms of the version 2.1 of the GNU Lesser General Public License -# as published by the Free Software Foundation. +# Arbitrary precision calculator. # -# Calc is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -# Public License for more details. -# -# A copy of version 2.1 of the GNU Lesser General Public License is -# distributed with calc under the filename COPYING-LGPL. You should have -# received a copy with calc; if not, write to Free Software Foundation, Inc. -# 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -# -# @(#) $Revision: 29.1 $ -# @(#) $Id: Makefile,v 29.1 1999/12/14 09:15:30 chongo Exp $ -# @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/Makefile,v $ -# -# Under source code control: 1991/07/21 05:00:54 -# File existed as early as: 1991 -# -# chongo /\oo/\ http://reality.sgi.com/chongo/ -# Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ -# -# calculator by David I. Bell with help/mods from others -# Makefile by Landon Curt Noll +# calculator by David I. Bell +# makefile by Landon Curt Noll # required vars # @@ -54,10 +33,6 @@ LIBDIR= ${TOPDIR}/calc #Q= Q=@ -# standard tools -# -CHMOD= chmod - # The calc files to install # CALC_FILES= README bigprime.cal deg.cal ellip.cal lucas.cal lucas_chk.cal \ @@ -76,7 +51,7 @@ CALC_FILES= README bigprime.cal deg.cal ellip.cal lucas.cal lucas_chk.cal \ # DISTLIST= ${CALC_FILES} ${MAKE_FILE} -# These files are used to make (but not built) a calc .a link library +# These files are used to make (but not built) a calc .a library # CALCLIBLIST= @@ -94,7 +69,7 @@ all: ${CALC_FILES} ${MAKE_FILE} .all # # # We will form the names of source files as if they were in a -# sub-directory called calc/cal. +# sub-directory called calc/lib. # # NOTE: Due to bogus shells found on one common system we must have # an non-emoty else clause for every if condition. *sigh* @@ -103,16 +78,16 @@ all: ${CALC_FILES} ${MAKE_FILE} .all distlist: ${DISTLIST} ${Q}for i in ${DISTLIST}; do \ - echo cal/$$i; \ + echo lib/$$i; \ done distdir: - ${Q}echo cal + ${Q}echo lib calcliblist: ${Q}for i in ${CALCLIBLIST} /dev/null; do \ if [ X"$$i" != X"/dev/null" ]; then \ - echo cal/$$i; \ + echo lib/$$i; \ fi; \ done @@ -139,8 +114,8 @@ install: all rm -f ${LIBDIR}/$$i; \ echo cp $$i ${LIBDIR}; \ cp $$i ${LIBDIR}; \ - echo ${CHMOD} 0444 ${LIBDIR}/$$i; \ - ${CHMOD} 0444 ${LIBDIR}/$$i; \ + echo chmod 0444 ${LIBDIR}/$$i; \ + chmod 0444 ${LIBDIR}/$$i; \ done ${Q}echo remove files that are obsolete -rm -f nextprime.cal nextprim.cal diff --git a/cal/README b/lib/README similarity index 79% rename from cal/README rename to lib/README index f0c69dc..935f911 100644 --- a/cal/README +++ b/lib/README @@ -1,15 +1,12 @@ -Calc standard resource files ----------------------------- - -To load a reosurce file, try: +To load a library, try: read filename You do not need to add the .cal extension to the filename. Calc will search along the $CALCPATH (see ``help environment''). -Normally a resource file will simply define some functions. By default, -most resource files will print out a short message when they are read. +Normally a library will simply define some functions. By default, +most libraries will print out a short message when they are read. For example: > read lucas @@ -18,8 +15,8 @@ For example: gen_v1(h,n) defined ldebug(funct,str) defined -will cause calc to load and execute the 'lucas.cal' resource file. -Executing the resource file will cause several functions to be defined. +will cause calc to load and execute the 'lucas.cal' library. +Executing the library will cause several functions to be defined. Executing the lucas function: > lucas(149,60) @@ -31,9 +28,8 @@ shows that 149*2^60-1 is prime whereas 146*2^61-1 is not. =-= -Calc resource file files are provided because they serve as examples of -how use the calc language, and/or because the authors thought them to -be useful! +Calc library files are provided because they serve as examples of how use +the calc language, and/or because the authors thought them to be useful! If you write something that you think is useful, please send it to: @@ -41,29 +37,29 @@ If you write something that you think is useful, please send it to: [[ Replace 'at' with @, 'dot' is with . and remove the spaces ]] -By convention, a resource file only defines and/or initializes functions, +By convention, a lib file only defines and/or initializes functions, objects and variables. (The regress.cal and testxxx.cal regression test suite is an exception.) Also by convention, an additional usage message regarding important object and functions is printed. -If a resource file needs to load another resource file, it should use -the -once version of read: +If a lib file needs to load another lib file, it should use the -once +version of read: - /* pull in needed resource files */ + /* pull in needed library files */ read -once "surd" read -once "lucas" -This will cause the needed resource files to be read once. If these +This will cause the needed library files to be read once. If these files have already been read, the read -once will act as a noop. -The "resource_debug" parameter is intended for controlling the possible +The "lib_debug" parameter is intended for controlling the possible display of special information relating to functions, objects, and -other structures created by instructions in calc resoure files. -Zero value of config("resource_debug") means that no such information +other structures created by instructions in calc scripts. +Zero value of config("lib_debug") means that no such information is displayed. For other values, the non-zero bits which currently have meanings are as follows: - n Meaning of bit n of config("resource_debug") + n Meaning of bit n of config("lib_debug") 0 When a function is defined, redefined or undefined at interactive level, a message saying what has been done @@ -73,9 +69,9 @@ have meanings are as follows: the reading of a file, a message saying what has been done is displayed. -The value for config("resource_debug") in both oldstd and newstd is 3, +The value for config("lib_debug") in both oldstd and newstd is 3, but if calc is invoked with the -d flag, its initial value is zero. -Thus, if calc is started without the -d flag, until config("resource_debug") +Thus, if calc is started without the -d flag, until config("lib_debug") is changed, a message will be output when a function is defined either interactively or during the reading of a file. @@ -87,10 +83,10 @@ standard information, one might want to print: * functions with optional args where the param() interface is used For these cases we suggest that you place at the bottom of your code -something that prints extra information if config("resource_debug") has +something that prints extra information if config("lib_debug") has either of the bottom 2 bits set: - if (config("resource_debug") & 3) { + if (config("lib_debug") & 3) { print "obj xyz defined"; print "funcA([val1 [, val2]]) defined"; print "funcB(size, mass, ...) defined"; @@ -98,7 +94,7 @@ either of the bottom 2 bits set: =-= -The following is a brief description of some of the calc resource files +The following is a brief description of some of the calc library files that are shipped with calc. See above for example of how to read in and execute these files. @@ -311,7 +307,7 @@ pollard.cal poly.cal Calculate with polynomials of one variable. There are many functions. - Read the documentation in the resource file. + Read the documentation in the library file. prompt.cal @@ -419,8 +415,8 @@ randrun.cal regress.cal - Test the correct execution of the calculator by reading this resource file. - Errors are reported with '****' messages, or worse. :-) + Test the correct execution of the calculator by reading this library file. + Errors are reported with '****' messages, or worse. :-) seedrandom.cal @@ -488,7 +484,7 @@ test1700.cal value - This resoure files is used by regress.cal to test the read and use keywords. + This script is used by regress.cal to test the read and use keywords. test2600.cal @@ -513,7 +509,7 @@ test2600.cal checkresult(x, y, z, a) test2600(verbose, tnum) - This resoure files is used by regress.cal to test some of builtin functions + This script is used by regress.cal to test some of builtin functions in terms of accuracy and roundoff. @@ -536,8 +532,8 @@ test2700.cal iscomsq(x) test2700(verbose, tnum) - This resoure files is used by regress.cal to test sqrt() for real and - complex values. + This script is used by regress.cal to test sqrt() for real and complex + values. test3100.cal @@ -551,7 +547,7 @@ test3100.cal res_inv(a) res(x) - This resource file is used by regress.cal to test determinants of a matrix + This script is used by regress.cal to test determinants of a matrix test3300.cal @@ -562,8 +558,8 @@ test3300.cal testr(str, n, N, verbose) test3300(verbose, tnum) - This resource file is used by regress.cal to provide for more determinant - tests. + This script is used by regress.cal to provide for more determinant tests. + test3400.cal @@ -577,7 +573,7 @@ test3400.cal test6(str, n, eps, verbose) test3400(verbose, tnum) - This resource file is used by regress.cal to test trig functions. + This script is used by regress.cal to test trig functions. containing objects. test3500.cal @@ -591,7 +587,7 @@ test3500.cal testh(str, n, N, verbose) test3500(verbose, n, N) - This resource file is used by regress.cal to test the functions frem, + This script is used by regress.cal to test the functions frem, fcnt, gcdrem. test4000.cal @@ -623,7 +619,7 @@ test4000.cal testprev1(x, y, count, skip, residue, modulus) defined test4000(verbose, tnum) defined - This resource file is used by regress.cal to test ptest, nextcand and + This script is used by regress.cal to test ptest, nextcand and prevcand buildins. test4100.cal @@ -643,7 +639,7 @@ test4100.cal inittimes(str, N, n, verbose) defined test4100(verbose, tnum) defined - This resource file is used by regress.cal to test REDC operations. + This script is used by regress.cal to test REDC operations. test4600.cal @@ -654,7 +650,7 @@ test4600.cal findlineold(f,s) defined test4600(verbose, tnum) defined - This resource file is used by regress.cal to test searching in files. + This script is used by regress.cal to test searching in files. test5100.cal @@ -662,7 +658,7 @@ test5100.cal global b5100 test5100(x) defined - This resource file is used by regress.cal to test the new code generator + This script is used by regress.cal to test the new code generator declaration scope and order. test5200.cal @@ -673,8 +669,7 @@ test5200.cal g5200(x) defined h5200(x) defined - This resource file is used by regress.cal to test the fix of a - global/static bug. + This script is used by regress.cal to test the fix of a global/static bug. unitfrac.cal @@ -704,30 +699,8 @@ xx_print.cal Demo for the xx_print object routines. -## Copyright (C) 1999 David I. Bell and Landon Curt Noll -## -## Primary author: Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: README,v 29.1 1999/12/14 09:15:30 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/README,v $ -## -## Under source code control: 1990/02/15 01:50:32 -## File existed as early as: before 1990 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ +=-= + +# Copyright (c) 1999 David I. Bell and Landon Curt Noll +# Permission is granted to use, distribute, or modify this source, +# provided that this copyright notice remains intact. diff --git a/lib/beer.cal b/lib/beer.cal new file mode 100644 index 0000000..ec5c120 --- /dev/null +++ b/lib/beer.cal @@ -0,0 +1,22 @@ +/* + * 99 bottles of beer + * + * See: + * http://www.ionet.net/~timtroyr/funhouse/beer.html#calc + */ + +for (i=99; i > 0;) { + /* current wall state */ + some_bottles = (i != 1) ? "bottles" : "bottle"; + print i, some_bottles, "of beer on the wall,",; + print i, some_bottles, "of beer!"; + + /* glug, glug */ + --i; + print "Take one down and pass it around,",; + + /* new wall state */ + less = (i > 0) ? i : "no"; + bottles = (i!=1) ? "bottles" : "bottle"; + print less, bottles, "of beer on the wall!\n"; +} diff --git a/cal/bernoulli.cal b/lib/bernoulli.cal similarity index 54% rename from cal/bernoulli.cal rename to lib/bernoulli.cal index 6c0c055..8a2fabf 100644 --- a/cal/bernoulli.cal +++ b/lib/bernoulli.cal @@ -1,33 +1,8 @@ /* - * bernoulli - clculate the Nth Bernoulli number B(n) + * Copyright (c) 1995 David I. Bell + * Permission is granted to use, distribute, or modify this source, + * provided that this copyright notice remains intact. * - * Copyright (C) 1999 David I. Bell - * - * Calc is open software; you can redistribute it and/or modify it under - * the terms of the version 2.1 of the GNU Lesser General Public License - * as published by the Free Software Foundation. - * - * Calc is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General - * Public License for more details. - * - * A copy of version 2.1 of the GNU Lesser General Public License is - * distributed with calc under the filename COPYING-LGPL. You should have - * received a copy with calc; if not, write to Free Software Foundation, Inc. - * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. - * - * @(#) $Revision: 29.1 $ - * @(#) $Id: bernoulli.cal,v 29.1 1999/12/14 09:15:30 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/bernoulli.cal,v $ - * - * Under source code control: 1991/09/30 11:18:41 - * File existed as early as: 1991 - * - * Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ - */ - -/* * Calculate the Nth Bernoulli number B(n). * This uses the following symbolic formula to calculate B(n): * @@ -46,11 +21,10 @@ * Since all previous B(n)'s are needed to calculate a particular B(n), all * values obtained are saved in an array for ease in repeated calculations. */ - - static Bnmax; static mat Bn[1001]; + define B(n) { local nn, np1, i, sum, mulval, divval, combval; diff --git a/lib/bigprime.cal b/lib/bigprime.cal new file mode 100644 index 0000000..5ba472b --- /dev/null +++ b/lib/bigprime.cal @@ -0,0 +1,27 @@ +/* + * Copyright (c) 1995 David I. Bell + * Permission is granted to use, distribute, or modify this source, + * provided that this copyright notice remains intact. + * + * A prime test, base a, on p*2^x+1 for even x>m. + */ + +define bigprime(a, m, p) +{ + local n1, n; + + n1 = 2^m * p; + for (;;) { + m++; + n1 += n1; + n = n1 + 1; + if (isodd(m)) + continue; + print m; + if (pmod(a, n1 / 2, n) != n1) + continue; + if (pmod(a, n1 / p, n) == 1) + continue; + print " " : n; + } +} diff --git a/lib/bindings b/lib/bindings new file mode 100644 index 0000000..2ba8792 --- /dev/null +++ b/lib/bindings @@ -0,0 +1,49 @@ +# Default key bindings for calc line editing functions +# +# NOTE: This facility is ignored if calc was compiled with GNU-readline. +# In that case, the standard readline mechanisms (see readline(3)) +# are used in place of those found below. + +map base-map +default insert-char +^@ set-mark +^A start-of-line +^B backward-char +^D delete-char +^E end-of-line +^F forward-char +^H backward-kill-char +^J new-line +^K kill-line +^L refresh-line +^M new-line +^N forward-history +^O save-line +^P backward-history +^R reverse-search +^T swap-chars +^U flush-input +^V quote-char +^W kill-region +^Y yank +^? backward-kill-char +^[ ignore-char esc-map + +map esc-map +default ignore-char base-map +G start-of-line +H backward-history +P forward-history +K backward-char +M forward-char +O end-of-line +S delete-char +g goto-line +s backward-word +t forward-word +d forward-kill-word +u uppercase-word +l lowercase-word +h list-history +^[ flush-input +[ arrow-key diff --git a/cal/chrem.cal b/lib/chrem.cal similarity index 76% rename from cal/chrem.cal rename to lib/chrem.cal index 6237a4b..ea97571 100644 --- a/cal/chrem.cal +++ b/lib/chrem.cal @@ -1,35 +1,6 @@ /* - * chrem - chinese remainder theorem/problem solver + * chrem - Chinese remainder theorem/problem solver * - * Copyright (C) 1999 Ernest Bowen and Landon Curt Noll - * - * Primary author: Ernest Bowen - * - * Calc is open software; you can redistribute it and/or modify it under - * the terms of the version 2.1 of the GNU Lesser General Public License - * as published by the Free Software Foundation. - * - * Calc is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General - * Public License for more details. - * - * A copy of version 2.1 of the GNU Lesser General Public License is - * distributed with calc under the filename COPYING-LGPL. You should have - * received a copy with calc; if not, write to Free Software Foundation, Inc. - * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. - * - * @(#) $Revision: 29.1 $ - * @(#) $Id: chrem.cal,v 29.1 1999/12/14 09:15:31 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/chrem.cal,v $ - * - * Under source code control: 1992/09/26 01:00:47 - * File existed as early as: 1992 - * - * Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ - */ - -/* * When possible, chrem finds solutions for x of a set of congruences * of the form: * @@ -113,9 +84,11 @@ * chrem(list(0,1,1,1,1,1),list(7,2,3,4,5,6)) ---> (301,420) * * i.e., any value that is 301 mod 420. + * + * Written by: Ernest W Bowen + * Interface by: Landon Curt Noll http://reality.sgi.com/chongo/ */ - static defaultmlist = list(2,3,5,7,11,13,17,19); /* The first eight primes */ define chrem() @@ -201,7 +174,7 @@ define chrem() } } -if (config("resource_debug") & 3) { +if (config("lib_debug") & 3) { print "chrem(r1,m1 [,r2,m2 ...]) defined"; print "chrem(rlist [,mlist]) defined"; } diff --git a/cal/deg.cal b/lib/deg.cal similarity index 55% rename from cal/deg.cal rename to lib/deg.cal index 6539c20..9036f58 100644 --- a/cal/deg.cal +++ b/lib/deg.cal @@ -1,33 +1,11 @@ /* - * deg - calculate in degrees, minutes, and seconds + * Copyright (c) 1995 David I. Bell + * Permission is granted to use, distribute, or modify this source, + * provided that this copyright notice remains intact. * - * Copyright (C) 1999 David I. Bell - * - * Calc is open software; you can redistribute it and/or modify it under - * the terms of the version 2.1 of the GNU Lesser General Public License - * as published by the Free Software Foundation. - * - * Calc is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General - * Public License for more details. - * - * A copy of version 2.1 of the GNU Lesser General Public License is - * distributed with calc under the filename COPYING-LGPL. You should have - * received a copy with calc; if not, write to Free Software Foundation, Inc. - * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. - * - * @(#) $Revision: 29.1 $ - * @(#) $Id: deg.cal,v 29.1 1999/12/14 09:15:31 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/deg.cal,v $ - * - * Under source code control: 1990/02/15 01:50:33 - * File existed as early as: before 1990 - * - * Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ + * Calculate in degrees, minutes, and seconds. */ - obj dms {deg, min, sec}; define dms(deg, min, sec) @@ -133,6 +111,6 @@ define fixdms(a) a.deg %= 360; } -if (config("resource_debug") & 3) { +if (config("lib_debug") & 3) { print "obj dms {deg, min, sec} defined"; } diff --git a/cal/ellip.cal b/lib/ellip.cal similarity index 80% rename from cal/ellip.cal rename to lib/ellip.cal index 5ce8a5f..ce292b4 100644 --- a/cal/ellip.cal +++ b/lib/ellip.cal @@ -1,33 +1,8 @@ /* - * ellip - attempt to factor numbers using elliptic functions + * Copyright (c) 1995 David I. Bell + * Permission is granted to use, distribute, or modify this source, + * provided that this copyright notice remains intact. * - * Copyright (C) 1999 David I. Bell - * - * Calc is open software; you can redistribute it and/or modify it under - * the terms of the version 2.1 of the GNU Lesser General Public License - * as published by the Free Software Foundation. - * - * Calc is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General - * Public License for more details. - * - * A copy of version 2.1 of the GNU Lesser General Public License is - * distributed with calc under the filename COPYING-LGPL. You should have - * received a copy with calc; if not, write to Free Software Foundation, Inc. - * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. - * - * @(#) $Revision: 29.1 $ - * @(#) $Id: ellip.cal,v 29.1 1999/12/14 09:15:31 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/ellip.cal,v $ - * - * Under source code control: 1990/02/15 01:50:33 - * File existed as early as: before 1990 - * - * Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ - */ - -/* * Attempt to factor numbers using elliptic functions. * y^2 = x^3 + a*x + b (mod N). * @@ -84,7 +59,6 @@ * variable N. */ - obj point {x, y}; global N; /* number to factor */ global a; /* first coefficient */ diff --git a/lib/hello.cal b/lib/hello.cal new file mode 100644 index 0000000..c208bed --- /dev/null +++ b/lib/hello.cal @@ -0,0 +1,8 @@ +/* + * Hello world + * + * See: + * http://www.latech.edu/~acm/helloworld/calc.html + */ + +while(1) print "Hello World!"; diff --git a/cal/lucas.cal b/lib/lucas.cal similarity index 95% rename from cal/lucas.cal rename to lib/lucas.cal index 3e82bd5..6a76b8f 100644 --- a/cal/lucas.cal +++ b/lib/lucas.cal @@ -1,34 +1,32 @@ +/* + * Copyright (c) 1995 Landon Curt Noll + * + * Permission to use, copy, modify, and distribute this software and + * its documentation for any purpose and without fee is hereby granted, + * provided that the above copyright, this permission notice and text + * this comment, and the disclaimer below appear in all of the following: + * + * supporting documentation + * source copies + * source works derived from this source + * binaries derived from this source or from derived source + * + * LANDON CURT NOLL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO + * EVENT SHALL LANDON CURT NOLL BE LIABLE FOR ANY SPECIAL, INDIRECT OR + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF + * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR + * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. + * + * Landon Curt Noll + * http://reality.sgi.com/chongo/ + * + * chongo /\../\ + */ /* * lucas - perform a Lucas primality test on h*2^n-1 * - * Copyright (C) 1999 Landon Curt Noll - * - * Calc is open software; you can redistribute it and/or modify it under - * the terms of the version 2.1 of the GNU Lesser General Public License - * as published by the Free Software Foundation. - * - * Calc is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General - * Public License for more details. - * - * A copy of version 2.1 of the GNU Lesser General Public License is - * distributed with calc under the filename COPYING-LGPL. You should have - * received a copy with calc; if not, write to Free Software Foundation, Inc. - * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. - * - * @(#) $Revision: 29.1 $ - * @(#) $Id: lucas.cal,v 29.1 1999/12/14 09:15:31 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/lucas.cal,v $ - * - * Under source code control: 1990/05/03 16:49:51 - * File existed as early as: 1990 - * - * chongo /\oo/\ http://reality.sgi.com/chongo/ - * Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ - */ - -/* * HISTORICAL NOTE: * * On 6 August 1989 at 00:53 PDT, the 'Amdahl 6', a team consisting of @@ -126,7 +124,6 @@ * point is beyond the scope of this program. */ - global pprod256; /* product of "primes up to 256" / "primes up to 46" */ /* @@ -1030,7 +1027,7 @@ gen_v1(h, n) define ldebug(funct, str) { - if (config("resource_debug") & 3) { + if (config("lib_debug") & 3) { print "DEBUG:", funct:":", str; } return; diff --git a/cal/lucas_chk.cal b/lib/lucas_chk.cal similarity index 91% rename from cal/lucas_chk.cal rename to lib/lucas_chk.cal index 41dc6fa..702d94c 100644 --- a/cal/lucas_chk.cal +++ b/lib/lucas_chk.cal @@ -1,33 +1,29 @@ /* - * lucas_chk - test all primes of the form h*2^n-1, 1<=h<200 and n <= high_n + * Copyright (c) 1995 Landon Curt Noll * - * Copyright (C) 1999 Landon Curt Noll + * Permission to use, copy, modify, and distribute this software and + * its documentation for any purpose and without fee is hereby granted, + * provided that the above copyright, this permission notice and text + * this comment, and the disclaimer below appear in all of the following: * - * Calc is open software; you can redistribute it and/or modify it under - * the terms of the version 2.1 of the GNU Lesser General Public License - * as published by the Free Software Foundation. + * supporting documentation + * source copies + * source works derived from this source + * binaries derived from this source or from derived source * - * Calc is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General - * Public License for more details. + * LANDON CURT NOLL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO + * EVENT SHALL LANDON CURT NOLL BE LIABLE FOR ANY SPECIAL, INDIRECT OR + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF + * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR + * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. * - * A copy of version 2.1 of the GNU Lesser General Public License is - * distributed with calc under the filename COPYING-LGPL. You should have - * received a copy with calc; if not, write to Free Software Foundation, Inc. - * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. + * Landon Curt Noll + * http://reality.sgi.com/chongo/ * - * @(#) $Revision: 29.1 $ - * @(#) $Id: lucas_chk.cal,v 29.1 1999/12/14 09:15:31 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/lucas_chk.cal,v $ - * - * Under source code control: 1991/01/11 05:41:43 - * File existed as early as: 1991 - * - * chongo /\oo/\ http://reality.sgi.com/chongo/ - * Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ + * chongo /\../\ */ - /* * primes of the form h*2^n-1 for 1<=h<200 and 1<=n<1000 * @@ -49,7 +45,6 @@ * 199*2^221-1 is NOT prime */ - static prime_cnt = 1145; /* number of primes in the list */ /* h = prime parameters */ @@ -336,7 +331,7 @@ lucas_chk(high_n, quiet) /* skip primes where h>=2^n */ if (highbit(h_p[i]) >= n_p[i]) { - if (config("resource_debug") & 3) { + if (config("lib_debug") & 3) { print "h>=2^n skip:", h_p[i]:"*2^":n_p[i]:"-1"; } continue; diff --git a/cal/lucas_tbl.cal b/lib/lucas_tbl.cal similarity index 83% rename from cal/lucas_tbl.cal rename to lib/lucas_tbl.cal index fff61b2..92e2e4b 100644 --- a/cal/lucas_tbl.cal +++ b/lib/lucas_tbl.cal @@ -1,33 +1,29 @@ /* - * lucas_tbl - lucasian criteria for primality tables + * Copyright (c) 1995 Landon Curt Noll * - * Copyright (C) 1999 Landon Curt Noll + * Permission to use, copy, modify, and distribute this software and + * its documentation for any purpose and without fee is hereby granted, + * provided that the above copyright, this permission notice and text + * this comment, and the disclaimer below appear in all of the following: * - * Calc is open software; you can redistribute it and/or modify it under - * the terms of the version 2.1 of the GNU Lesser General Public License - * as published by the Free Software Foundation. + * supporting documentation + * source copies + * source works derived from this source + * binaries derived from this source or from derived source * - * Calc is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General - * Public License for more details. + * LANDON CURT NOLL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO + * EVENT SHALL LANDON CURT NOLL BE LIABLE FOR ANY SPECIAL, INDIRECT OR + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF + * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR + * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. * - * A copy of version 2.1 of the GNU Lesser General Public License is - * distributed with calc under the filename COPYING-LGPL. You should have - * received a copy with calc; if not, write to Free Software Foundation, Inc. - * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. + * Landon Curt Noll + * http://reality.sgi.com/chongo/ * - * @(#) $Revision: 29.1 $ - * @(#) $Id: lucas_tbl.cal,v 29.1 1999/12/14 09:15:31 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/lucas_tbl.cal,v $ - * - * Under source code control: 1991/01/26 02:43:43 - * File existed as early as: 1991 - * - * chongo /\oo/\ http://reality.sgi.com/chongo/ - * Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ + * chongo /\../\ */ - /* * Lucasian criteria for primality * @@ -49,7 +45,6 @@ * is not found in Table 1. */ - trymax = 100; mat d_val[trymax+1]; mat a_val[trymax+1]; @@ -157,7 +152,7 @@ d_val[97]=1045; a_val[97]=33; b_val[97]=1; r_val[97]=44; d_val[99]=9797; a_val[99]=97; b_val[99]=1; r_val[99]=388; d_val[100]= 51; a_val[100]= 7; b_val[100]=1; r_val[100]=2; -if (config("resource_debug") & 3) { +if (config("lib_debug") & 3) { print "d_val[100] defined"; print "a_val[100] defined"; print "b_val[100] defined"; diff --git a/lib/mersenne.cal b/lib/mersenne.cal new file mode 100644 index 0000000..9d480d3 --- /dev/null +++ b/lib/mersenne.cal @@ -0,0 +1,33 @@ +/* + * Copyright (c) 1997 David I. Bell + * Permission is granted to use, distribute, or modify this source, + * provided that this copyright notice remains intact. + * + * Perform a primality test of 2^p-1, for prime p>1. + */ + +define mersenne(p) +{ + local u, i, p_mask; + + /* firewall */ + if (! isint(p)) + quit "p is not an integer"; + + /* two is a special case */ + if (p == 2) + return 1; + + /* if p is not prime, then 2^p-1 is not prime */ + if (! ptest(p,1)) + return 0; + + /* lltest: u(i+1) = u(i)^2 - 2 mod 2^p-1 */ + u = 4; + for (i = 2; i < p; ++i) { + u = hnrmod(u^2 - 2, 1, p, -1); + } + + /* 2^p-1 is prime iff u(p) = 0 mod 2^p-1 */ + return (u == 0); +} diff --git a/cal/mfactor.cal b/lib/mfactor.cal similarity index 86% rename from cal/mfactor.cal rename to lib/mfactor.cal index 42557da..fb55ea1 100644 --- a/cal/mfactor.cal +++ b/lib/mfactor.cal @@ -1,33 +1,31 @@ /* - * mfactor - return the lowest factor of 2^n-1, for n > 0 + * Copyright (c) 1997 Landon Curt Noll * - * Copyright (C) 1999 Landon Curt Noll + * Permission to use, copy, modify, and distribute this software and + * its documentation for any purpose and without fee is hereby granted, + * provided that the above copyright, this permission notice and text + * this comment, and the disclaimer below appear in all of the following: * - * Calc is open software; you can redistribute it and/or modify it under - * the terms of the version 2.1 of the GNU Lesser General Public License - * as published by the Free Software Foundation. + * supporting documentation + * source copies + * source works derived from this source + * binaries derived from this source or from derived source * - * Calc is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General - * Public License for more details. + * LANDON CURT NOLL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO + * EVENT SHALL LANDON CURT NOLL BE LIABLE FOR ANY SPECIAL, INDIRECT OR + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF + * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR + * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. * - * A copy of version 2.1 of the GNU Lesser General Public License is - * distributed with calc under the filename COPYING-LGPL. You should have - * received a copy with calc; if not, write to Free Software Foundation, Inc. - * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. + * Landon Curt Noll + * http://reality.sgi.com/chongo/ * - * @(#) $Revision: 29.1 $ - * @(#) $Id: mfactor.cal,v 29.1 1999/12/14 09:15:31 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/mfactor.cal,v $ - * - * Under source code control: 1996/07/06 06:09:40 - * File existed as early as: 1996 - * - * chongo /\oo/\ http://reality.sgi.com/chongo/ - * Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ + * chongo /\../\ */ + /* * hset method * @@ -314,6 +312,6 @@ define mfactor(n, start_k, rept_loop, p_elim) return q; } -if (config("resource_debug") & 3) { +if (config("lib_debug") & 3) { print "mfactor(n [, start_k=1 [, rept_loop=10000 [, p_elim=17]]])" } diff --git a/cal/mod.cal b/lib/mod.cal similarity index 65% rename from cal/mod.cal rename to lib/mod.cal index 415a3eb..7fd7a52 100644 --- a/cal/mod.cal +++ b/lib/mod.cal @@ -1,33 +1,12 @@ /* - * mod - routines to handle numbers modulo a specified number + * Copyright (c) 1995 David I. Bell + * Permission is granted to use, distribute, or modify this source, + * provided that this copyright notice remains intact. * - * Copyright (C) 1999 David I. Bell - * - * Calc is open software; you can redistribute it and/or modify it under - * the terms of the version 2.1 of the GNU Lesser General Public License - * as published by the Free Software Foundation. - * - * Calc is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General - * Public License for more details. - * - * A copy of version 2.1 of the GNU Lesser General Public License is - * distributed with calc under the filename COPYING-LGPL. You should have - * received a copy with calc; if not, write to Free Software Foundation, Inc. - * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. - * - * @(#) $Revision: 29.1 $ - * @(#) $Id: mod.cal,v 29.1 1999/12/14 09:15:31 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/mod.cal,v $ - * - * Under source code control: 1990/02/15 01:50:34 - * File existed as early as: before 1990 - * - * Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ + * Routines to handle numbers modulo a specified number. + * a (mod N) */ - obj mod {a}; /* definition of the object */ global mod_value = 100; /* modulus value (value of N) */ @@ -210,7 +189,7 @@ define mod_pow(a, b) } -if (config("resource_debug") & 3) { +if (config("lib_debug") & 3) { print "obj mod {a} defined"; print "mod_value defined"; print "set mod_value as needed"; diff --git a/cal/natnumset.cal b/lib/natnumset.cal similarity index 90% rename from cal/natnumset.cal rename to lib/natnumset.cal index 58903fe..da85e1c 100644 --- a/cal/natnumset.cal +++ b/lib/natnumset.cal @@ -1,32 +1,10 @@ /* - * natnumset - functions for sets of natural numbers not exceeding a fixed bound + * Copyright (c) 1997 Ernest Bowen + * Permission is granted to use, distribute, or modify this source, + * provided that this copyright notice remains intact. * - * Copyright (C) 1999 Ernest Bowen - * - * Calc is open software; you can redistribute it and/or modify it under - * the terms of the version 2.1 of the GNU Lesser General Public License - * as published by the Free Software Foundation. - * - * Calc is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General - * Public License for more details. - * - * A copy of version 2.1 of the GNU Lesser General Public License is - * distributed with calc under the filename COPYING-LGPL. You should have - * received a copy with calc; if not, write to Free Software Foundation, Inc. - * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. - * - * @(#) $Revision: 29.1 $ - * @(#) $Id: natnumset.cal,v 29.1 1999/12/14 09:15:31 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/natnumset.cal,v $ - * - * Under source code control: 1997/09/07 23:53:51 - * File existed as early as: 1997 - * - * Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ + * By: Ernest Bowen */ - /* * Functions for sets of natural numbers not exceeding a fixed bound B. * diff --git a/lib/pell.cal b/lib/pell.cal new file mode 100644 index 0000000..56ad7c3 --- /dev/null +++ b/lib/pell.cal @@ -0,0 +1,68 @@ +/* + * Copyright (c) 1995 David I. Bell + * Permission is granted to use, distribute, or modify this source, + * provided that this copyright notice remains intact. + * + * Solve Pell's equation; Returns the solution X to: X^2 - D * Y^2 = 1. + * Type the solution to pells equation for a particular D. + */ + +define pell(D) +{ + local X, Y; + + X = pellx(D); + if (isnull(X)) { + print "D=":D:" is square"; + return; + } + Y = isqrt((X^2 - 1) / D); + print X : "^2 - " : D : "*" : Y : "^2 = " : X^2 - D*Y^2; +} + + +/* + * Function to solve Pell's equation + * Returns the solution X to: + * X^2 - D * Y^2 = 1 + */ +define pellx(D) +{ + local R, Rp, U, Up, V, Vp, A, T, Q1, Q2, n; + local mat ans[2,2]; + local mat tmp[2,2]; + + R = isqrt(D); + Vp = D - R^2; + if (Vp == 0) + return; + Rp = R + R; + U = Rp; + Up = U; + V = 1; + A = 0; + n = 0; + ans[0,0] = 1; + ans[1,1] = 1; + tmp[0,1] = 1; + tmp[1,0] = 1; + do { + T = V; + V = A * (Up - U) + Vp; + Vp = T; + A = U // V; + Up = U; + U = Rp - U % V; + tmp[0,0] = A; + ans *= tmp; + n++; + } while (A != Rp); + Q2 = ans[[1]]; + Q1 = isqrt(Q2^2 * D + 1); + if (isodd(n)) { + T = Q1^2 + D * Q2^2; + Q2 = Q1 * Q2 * 2; + Q1 = T; + } + return Q1; +} diff --git a/cal/pi.cal b/lib/pi.cal similarity index 66% rename from cal/pi.cal rename to lib/pi.cal index b3ad402..7ef766a 100644 --- a/cal/pi.cal +++ b/lib/pi.cal @@ -1,38 +1,12 @@ /* - * pi - various routines to calculate pi + * Copyright (c) 1995 David I. Bell + * Permission is granted to use, distribute, or modify this source, + * provided that this copyright notice remains intact. * - * Copyright (C) 1999 David I. Bell - * - * Calc is open software; you can redistribute it and/or modify it under - * the terms of the version 2.1 of the GNU Lesser General Public License - * as published by the Free Software Foundation. - * - * Calc is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General - * Public License for more details. - * - * A copy of version 2.1 of the GNU Lesser General Public License is - * distributed with calc under the filename COPYING-LGPL. You should have - * received a copy with calc; if not, write to Free Software Foundation, Inc. - * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. - * - * @(#) $Revision: 29.1 $ - * @(#) $Id: pi.cal,v 29.1 1999/12/14 09:15:31 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/pi.cal,v $ - * - * Under source code control: 1991/05/22 21:56:37 - * File existed as early as: 1991 - * - * Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ - */ - -/* * Calculate pi within the specified epsilon using the quartic convergence * iteration. */ - define qpi(epsilon) { local niter, yn, ym, tm, an, am, t, tn, sqrt2, epsilon2, count, digits; diff --git a/lib/pix.cal b/lib/pix.cal new file mode 100644 index 0000000..d388d36 --- /dev/null +++ b/lib/pix.cal @@ -0,0 +1,40 @@ +/* + * Here is an iterative method of finding the number of primes less than + * or equal to a given number. This method is from "Computer Recreations" + * June 1996 issue of Scientific American. + * + * NOTE: For reasonable values of x, the builtin function pix(x) is + * much faster. This code is provided because the method + * is interesting. + */ + +define pi_of_x(x) +{ + local An; /* A(n) */ + local An1; /* A(n-1) */ + local An2; /* A(n-2) */ + local An3; /* A(n-3) */ + local primes; /* number of primes found */ + local n; /* loop counter */ + + /* + * setup + */ + An1 = 2; + An2 = 0; + An3 = 3; + primes = 1; + + /* + * main A(n+1)=A(n-1)+A(n-2) sequence loop + */ + for (n = 3; n < x; ++n) { + An = An2 + An3; + An3 = An2; + An2 = An1; + An1 = An; + if (An % n == 0) + ++primes; + } + return primes; +} diff --git a/lib/pollard.cal b/lib/pollard.cal new file mode 100644 index 0000000..3159264 --- /dev/null +++ b/lib/pollard.cal @@ -0,0 +1,30 @@ +/* + * Copyright (c) 1995 David I. Bell + * Permission is granted to use, distribute, or modify this source, + * provided that this copyright notice remains intact. + * + * Factor using Pollard's p-1 method. + */ + +define pfactor(N, B, ai, af) +{ + local a, k, i, d; + + if (isnull(B)) + B = 1000; + if (isnull(ai)) + ai = 2; + if (isnull(af)) + af = ai + 20; + k = lcmfact(B); + d = lfactor(N, B); + if (d > 1) + return d; + for (a = ai; a <= af; a++) { + i = pmod(a, k, N); + d = gcd(i - 1, N); + if ((d > 1) && (d != N)) + return d; + } + return 1; +} diff --git a/cal/poly.cal b/lib/poly.cal similarity index 93% rename from cal/poly.cal rename to lib/poly.cal index c962e16..af397ae 100644 --- a/cal/poly.cal +++ b/lib/poly.cal @@ -1,32 +1,3 @@ -/* - * poly - calculate with polynomials of one variable - * - * Copyright (C) 1999 Ernest Bowen - * - * Calc is open software; you can redistribute it and/or modify it under - * the terms of the version 2.1 of the GNU Lesser General Public License - * as published by the Free Software Foundation. - * - * Calc is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General - * Public License for more details. - * - * A copy of version 2.1 of the GNU Lesser General Public License is - * distributed with calc under the filename COPYING-LGPL. You should have - * received a copy with calc; if not, write to Free Software Foundation, Inc. - * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. - * - * @(#) $Revision: 29.1 $ - * @(#) $Id: poly.cal,v 29.1 1999/12/14 09:15:31 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/poly.cal,v $ - * - * Under source code control: 1990/02/15 01:50:35 - * File existed as early as: before 1990 - * - * Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ - */ - /* * A collection of functions designed for calculations involving * polynomials in one variable (by Ernest W. Bowen). @@ -199,7 +170,6 @@ * should return the zero m x m matrix. */ - obj poly {p}; define pol() { @@ -718,6 +688,6 @@ a=pol(1,4,4,2,3,1); b=pol(5,16,8,1); c=pol(1+2i,3+4i,5+6i); -if (config("resource_debug") & 3) { +if (config("lib_debug") & 3) { print "obj poly {p} defined"; } diff --git a/cal/prompt.cal b/lib/prompt.cal similarity index 69% rename from cal/prompt.cal rename to lib/prompt.cal index 598ba73..462b4ae 100644 --- a/cal/prompt.cal +++ b/lib/prompt.cal @@ -1,32 +1,10 @@ /* - * prompt - eemonstration of some uses of prompt() and eval() + * Copyright (c) 1995 Ernest Bowen + * Permission is granted to use, distribute, or modify this source, + * provided that this copyright notice remains intact. * - * Copyright (C) 1999 Ernest Bowen - * - * Calc is open software; you can redistribute it and/or modify it under - * the terms of the version 2.1 of the GNU Lesser General Public License - * as published by the Free Software Foundation. - * - * Calc is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General - * Public License for more details. - * - * A copy of version 2.1 of the GNU Lesser General Public License is - * distributed with calc under the filename COPYING-LGPL. You should have - * received a copy with calc; if not, write to Free Software Foundation, Inc. - * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. - * - * @(#) $Revision: 29.1 $ - * @(#) $Id: prompt.cal,v 29.1 1999/12/14 09:15:32 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/prompt.cal,v $ - * - * Under source code control: 1995/12/18 04:43:25 - * File existed as early as: 1995 - * - * Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ + * By: Ernest Bowen */ - /* * Demonstration of some uses of prompt() and eval(). * @@ -83,7 +61,6 @@ * entering "end", "exit" or "quit". */ - define adder() { global sum = 0; local s, t; diff --git a/lib/psqrt.cal b/lib/psqrt.cal new file mode 100644 index 0000000..e77dc94 --- /dev/null +++ b/lib/psqrt.cal @@ -0,0 +1,50 @@ +/* + * Copyright (c) 1995 David I. Bell + * Permission is granted to use, distribute, or modify this source, + * provided that this copyright notice remains intact. + * + * Calculate square roots modulo a prime. + * + * Returns null if number is not prime or if there is no square root. + * The smaller square root is always returned. + */ + +define psqrt(u, p) +{ + local p1, q, n, y, r, v, w, t, k; + + p1 = p - 1; + r = lowbit(p1); + q = p >> r; + t = 1 << (r - 1); + for (n = 2; ; n++) { + if (ptest(n, 1) == 0) + continue; + y = pmod(n, q, p); + k = pmod(y, t, p); + if (k == 1) + continue; + if (k != p1) + return; + break; + } + t = pmod(u, (q - 1) / 2, p); + v = (t * u) % p; + w = (t^2 * u) % p; + while (w != 1) { + k = 0; + t = w; + do { + k++; + t = t^2 % p; + } while (t != 1); + if (k == r) + return; + t = pmod(y, 1 << (r - k - 1), p); + y = t^2 % p; + v = (v * t) % p; + w = (w * y) % p; + r = k; + } + return min(v, p - v); +} diff --git a/lib/qtime.cal b/lib/qtime.cal new file mode 100644 index 0000000..743e71e --- /dev/null +++ b/lib/qtime.cal @@ -0,0 +1,60 @@ +/* + * qtime - Display time as English sentence + * + * usage: + * qtime(utc_hr_offset) + * + * utc_hr_offset Offset from UTC in hours. + * + * Written by: Klaus Alexander Seistrup + * With minor mods by: Landon Curt Noll + * + * See: + * http://www.magnetic-ink.dk/download/qtime.html + * + * for examples of qtime() written on other languages. + */ + +/* + * qtime - Display time as English sentence + */ +define qtime(utc_hr_offset) +{ + static mat hr[12] = { + "twelve", "one", "two", "three", "four", "five", + "six", "seven", "eight", "nine", "ten", "eleven" + }; + static mat mn[7] = { + "", "five ", "ten ", "a quarter ", "twenty ", "twenty-five ", "half " + }; + static mat ny[5] = { + "nearly ", "almost ", "", "just after ", "after " + }; + static mat up[3] = { + "to ", "", "past " + }; + local adj_mins = (((time() + utc_hr_offset*3600) % 86400) + 30) // 60 + 27; + local hours = (adj_mins // 60) % 12; + local minutes = adj_mins % 60; + local almost = minutes % 5; + local divisions = (minutes // 5) - 5; + local to_past_idx = divisions > 0 ? 1 : 0; + + if (divisions < 0) { + divisions = -divisions; + to_past_idx = -1; + } + ++to_past_idx; + + /* + * Print the English sentence + * + * We avoid forward and back quotes just to show that the char() + * builtin function can be used in conjunction with a printf. + */ + printf("It%cs %s%s%s%s", + char(0x27), ny[almost], mn[divisions], up[to_past_idx], hr[hours]); + if (divisions == 0) + printf(" o%cclock", char(0x27)); + printf (".\n"); +} diff --git a/cal/quat.cal b/lib/quat.cal similarity index 65% rename from cal/quat.cal rename to lib/quat.cal index c61b12b..536e65a 100644 --- a/cal/quat.cal +++ b/lib/quat.cal @@ -1,33 +1,8 @@ /* - * quat - alculate using quaternions of the form: a + bi + cj + dk + * Copyright (c) 1995 David I. Bell + * Permission is granted to use, distribute, or modify this source, + * provided that this copyright notice remains intact. * - * Copyright (C) 1999 David I. Bell - * - * Calc is open software; you can redistribute it and/or modify it under - * the terms of the version 2.1 of the GNU Lesser General Public License - * as published by the Free Software Foundation. - * - * Calc is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General - * Public License for more details. - * - * A copy of version 2.1 of the GNU Lesser General Public License is - * distributed with calc under the filename COPYING-LGPL. You should have - * received a copy with calc; if not, write to Free Software Foundation, Inc. - * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. - * - * @(#) $Revision: 29.1 $ - * @(#) $Id: quat.cal,v 29.1 1999/12/14 09:15:32 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/quat.cal,v $ - * - * Under source code control: 1990/02/15 01:50:35 - * File existed as early as: before 1990 - * - * Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ - */ - -/* * Routines to handle quaternions of the form: * a + bi + cj + dk * @@ -36,7 +11,6 @@ * Where s is a scalar and v is a vector of size 3. */ - obj quat {s, v}; /* definition of the quaternion object */ @@ -221,6 +195,6 @@ define quat_shift(a, b) return x.s; } -if (config("resource_debug") & 3) { +if (config("lib_debug") & 3) { print "obj quat {s, v} defined"; } diff --git a/cal/randbitrun.cal b/lib/randbitrun.cal similarity index 66% rename from cal/randbitrun.cal rename to lib/randbitrun.cal index e1eb972..645b693 100644 --- a/cal/randbitrun.cal +++ b/lib/randbitrun.cal @@ -1,38 +1,30 @@ /* * randbitrun - check rand bit run lengths of the a55 generator * - * Copyright (C) 1999 Landon Curt Noll - * - * Calc is open software; you can redistribute it and/or modify it under - * the terms of the version 2.1 of the GNU Lesser General Public License - * as published by the Free Software Foundation. - * - * Calc is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General - * Public License for more details. - * - * A copy of version 2.1 of the GNU Lesser General Public License is - * distributed with calc under the filename COPYING-LGPL. You should have - * received a copy with calc; if not, write to Free Software Foundation, Inc. - * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. - * - * @(#) $Revision: 29.1 $ - * @(#) $Id: randbitrun.cal,v 29.1 1999/12/14 09:15:32 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/randbitrun.cal,v $ - * - * Under source code control: 1995/02/13 03:43:11 - * File existed as early as: 1995 - * - * chongo /\oo/\ http://reality.sgi.com/chongo/ - * Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ - */ - -/* * We will use randbit(1) to generate a stream if single bits. * The odds that we will have n bits the same in a row is 1/2^n. */ - +/* + * Copyright 1995 by Landon Curt Noll. All Rights Reserved. + * + * Permission to use, copy, modify, and distribute this software and + * its documentation for any purpose and without fee is hereby granted, + * provided that the above copyright, this permission notice, and the + * disclaimer below appear in all of the following: + * + * * supporting documentation + * * source copies + * * source works derived from this source + * * binaries derived from this source or from derived source + * + * LANDON CURT NOLL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO + * EVENT SHALL LANDON CURT NOLL BE LIABLE FOR ANY SPECIAL, INDIRECT OR + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF + * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR + * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. + */ define randbitrun(run_cnt) { diff --git a/cal/randmprime.cal b/lib/randmprime.cal similarity index 70% rename from cal/randmprime.cal rename to lib/randmprime.cal index 16c4762..23952d9 100644 --- a/cal/randmprime.cal +++ b/lib/randmprime.cal @@ -1,34 +1,32 @@ /* * randmprime - generate a random prime of the form h*2^n-1 * - * Copyright (C) 1999 Landon Curt Noll + * Copyright (c) 1997 by Landon Curt Noll. All Rights Reserved. * - * Calc is open software; you can redistribute it and/or modify it under - * the terms of the version 2.1 of the GNU Lesser General Public License - * as published by the Free Software Foundation. + * Permission to use, copy, modify, and distribute this software and + * its documentation for any purpose and without fee is hereby granted, + * provided that the above copyright, this permission notice and text + * this comment, and the disclaimer below appear in all of the following: * - * Calc is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General - * Public License for more details. + * supporting documentation + * source copies + * source works derived from this source + * binaries derived from this source or from derived source * - * A copy of version 2.1 of the GNU Lesser General Public License is - * distributed with calc under the filename COPYING-LGPL. You should have - * received a copy with calc; if not, write to Free Software Foundation, Inc. - * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. + * LANDON CURT NOLL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO + * EVENT SHALL LANDON CURT NOLL BE LIABLE FOR ANY SPECIAL, INDIRECT OR + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF + * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR + * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. * - * @(#) $Revision: 29.1 $ - * @(#) $Id: randmprime.cal,v 29.1 1999/12/14 09:15:32 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/randmprime.cal,v $ + * Landon Curt Noll + * http://reality.sgi.com/chongo/ * - * Under source code control: 1994/03/14 23:11:21 - * File existed as early as: 1994 - * - * chongo /\oo/\ http://reality.sgi.com/chongo/ - * Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ + * chongo /\../\ */ - /* obtain our required libs */ read -once "lucas.cal" diff --git a/cal/randombitrun.cal b/lib/randombitrun.cal similarity index 66% rename from cal/randombitrun.cal rename to lib/randombitrun.cal index 8ad2084..5d118f5 100644 --- a/cal/randombitrun.cal +++ b/lib/randombitrun.cal @@ -1,38 +1,30 @@ /* * randombitrun - check rand bit run lengths of random() * - * Copyright (C) 1999 Landon Curt Noll - * - * Calc is open software; you can redistribute it and/or modify it under - * the terms of the version 2.1 of the GNU Lesser General Public License - * as published by the Free Software Foundation. - * - * Calc is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General - * Public License for more details. - * - * A copy of version 2.1 of the GNU Lesser General Public License is - * distributed with calc under the filename COPYING-LGPL. You should have - * received a copy with calc; if not, write to Free Software Foundation, Inc. - * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. - * - * @(#) $Revision: 29.1 $ - * @(#) $Id: randombitrun.cal,v 29.1 1999/12/14 09:15:32 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/randombitrun.cal,v $ - * - * Under source code control: 1995/02/13 03:43:11 - * File existed as early as: 1995 - * - * chongo /\oo/\ http://reality.sgi.com/chongo/ - * Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ - */ - -/* * We will use randombit(1) to generate a stream if single bits. * The odds that we will have n bits the same in a row is 1/2^n. */ - +/* + * Copyright 1997 by Landon Curt Noll. All Rights Reserved. + * + * Permission to use, copy, modify, and distribute this software and + * its documentation for any purpose and without fee is hereby granted, + * provided that the above copyright, this permission notice, and the + * disclaimer below appear in all of the following: + * + * * supporting documentation + * * source copies + * * source works derived from this source + * * binaries derived from this source or from derived source + * + * LANDON CURT NOLL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO + * EVENT SHALL LANDON CURT NOLL BE LIABLE FOR ANY SPECIAL, INDIRECT OR + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF + * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR + * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. + */ define randombitrun(run_cnt) { diff --git a/cal/randomrun.cal b/lib/randomrun.cal similarity index 70% rename from cal/randomrun.cal rename to lib/randomrun.cal index 5f5c363..3889808 100644 --- a/cal/randomrun.cal +++ b/lib/randomrun.cal @@ -1,34 +1,6 @@ /* * randomrun - perform a run test on random() * - * Copyright (C) 1999 Landon Curt Noll - * - * Calc is open software; you can redistribute it and/or modify it under - * the terms of the version 2.1 of the GNU Lesser General Public License - * as published by the Free Software Foundation. - * - * Calc is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General - * Public License for more details. - * - * A copy of version 2.1 of the GNU Lesser General Public License is - * distributed with calc under the filename COPYING-LGPL. You should have - * received a copy with calc; if not, write to Free Software Foundation, Inc. - * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. - * - * @(#) $Revision: 29.1 $ - * @(#) $Id: randomrun.cal,v 29.1 1999/12/14 09:15:32 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/randomrun.cal,v $ - * - * Under source code control: 1997/02/19 03:35:59 - * File existed as early as: 1997 - * - * chongo /\oo/\ http://reality.sgi.com/chongo/ - * Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ - */ - -/* * If X(j) < X(j+1) < ... X(j+k) >= X(j+k+1), then we have a run of 'k'. * We ignore the run breaker, X(j+k+1), and start with X(j+k+2) when * considering a new run in order to make our runs chi independent. @@ -41,7 +13,27 @@ * We use the suggestion in problem #14 to allow an application of the * chi-square test and to make estimating the run length probs easy. */ - +/* + * Copyright 1997 by Landon Curt Noll. All Rights Reserved. + * + * Permission to use, copy, modify, and distribute this software and + * its documentation for any purpose and without fee is hereby granted, + * provided that the above copyright, this permission notice, and the + * disclaimer below appear in all of the following: + * + * * supporting documentation + * * source copies + * * source works derived from this source + * * binaries derived from this source or from derived source + * + * LANDON CURT NOLL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO + * EVENT SHALL LANDON CURT NOLL BE LIABLE FOR ANY SPECIAL, INDIRECT OR + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF + * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR + * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. + */ define randomrun(run_cnt) { diff --git a/cal/randrun.cal b/lib/randrun.cal similarity index 71% rename from cal/randrun.cal rename to lib/randrun.cal index 1150dae..e131279 100644 --- a/cal/randrun.cal +++ b/lib/randrun.cal @@ -1,33 +1,6 @@ /* * randrun - perform a run test on rand() * - * Copyright (C) 1999 David I. Bell - * - * Calc is open software; you can redistribute it and/or modify it under - * the terms of the version 2.1 of the GNU Lesser General Public License - * as published by the Free Software Foundation. - * - * Calc is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General - * Public License for more details. - * - * A copy of version 2.1 of the GNU Lesser General Public License is - * distributed with calc under the filename COPYING-LGPL. You should have - * received a copy with calc; if not, write to Free Software Foundation, Inc. - * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. - * - * @(#) $Revision: 29.1 $ - * @(#) $Id: randrun.cal,v 29.1 1999/12/14 09:15:32 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/randrun.cal,v $ - * - * Under source code control: 1995/02/12 20:00:06 - * File existed as early as: 1995 - * - * Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ - */ - -/* * If X(j) < X(j+1) < ... X(j+k) >= X(j+k+1), then we have a run of 'k'. * We ignore the run breaker, X(j+k+1), and start with X(j+k+2) when * considering a new run in order to make our runs chi independent. @@ -40,7 +13,27 @@ * We use the suggestion in problem #14 to allow an application of the * chi-square test and to make estimating the run length probs easy. */ - +/* + * Copyright 1995 by Landon Curt Noll. All Rights Reserved. + * + * Permission to use, copy, modify, and distribute this software and + * its documentation for any purpose and without fee is hereby granted, + * provided that the above copyright, this permission notice, and the + * disclaimer below appear in all of the following: + * + * * supporting documentation + * * source copies + * * source works derived from this source + * * binaries derived from this source or from derived source + * + * LANDON CURT NOLL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO + * EVENT SHALL LANDON CURT NOLL BE LIABLE FOR ANY SPECIAL, INDIRECT OR + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF + * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR + * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. + */ define randrun(run_cnt) { @@ -129,6 +122,6 @@ define randrun(run_cnt) printf("max length=%d\n", max_run); } -if (config("resource_debug") & 3) { +if (config("lib_debug") & 3) { print "randrun([run_length]) defined"; } diff --git a/cal/regress.cal b/lib/regress.cal similarity index 98% rename from cal/regress.cal rename to lib/regress.cal index 4cdbfa0..70262a1 100644 --- a/cal/regress.cal +++ b/lib/regress.cal @@ -1,43 +1,17 @@ /* - * regress - calc regression and correctness test suite + * Copyright (c) 1997 David I. Bell + * Permission is granted to use, distribute, or modify this source, + * provided that this copyright notice remains intact. * - * Copyright (C) 1999 David I. Bell - * - * Calc is open software; you can redistribute it and/or modify it under - * the terms of the version 2.1 of the GNU Lesser General Public License - * as published by the Free Software Foundation. - * - * Calc is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General - * Public License for more details. - * - * A copy of version 2.1 of the GNU Lesser General Public License is - * distributed with calc under the filename COPYING-LGPL. You should have - * received a copy with calc; if not, write to Free Software Foundation, Inc. - * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. - * - * @(#) $Revision: 29.1 $ - * @(#) $Id: regress.cal,v 29.1 1999/12/14 09:15:32 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/regress.cal,v $ - * - * Under source code control: 1990/02/15 01:50:36 - * File existed as early as: before 1990 - * - * Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ - */ - -/* - * Test the correct execution of the calculator by reading this resource file. + * Test the correct execution of the calculator by reading this library file. * Errors are reported with '****' messages, or worse. :-) * - * NOTE: Unlike most calc resource files, this one performs its work when + * NOTE: Unlike most calc lib files, this one performs its work when * it is read. Normally one would just define functions and * values for later use. In the case of the regression test, * we do not want to do this. */ - print '000: Beginning regression tests'; print '001: Some of these tests may take a while ...'; print '002: Within each section, output should be numbered sequentially'; @@ -53,7 +27,7 @@ global ecnt; /* expected value of errcount() */ ecnt = 0; /* clear expected errcount() value */ initcfg = config("all", "oldstd"); /* set config to startup default */ -config("resource_debug", 0),; /* disable resource startup messages */ +config("lib_debug", 0),; /* disable lib startup messages */ config("calc_debug", 0),; /* disable internal debugging */ config("verbose_quit", 0),; /* disable quit messages */ startcfg = config("all"); /* save state for later use */ @@ -411,10 +385,10 @@ define test_config() '516: config("pow2") == 40'); vrfy(config("redc2") == 50, '517: config("redc2") == 50'); - vrfy(config("tilde") == "true", - '518: config("tilde") == "true"'); - vrfy(config("tab") == "true", - '519: config("tab") == "true"'); + vrfy(config("tilde") == "on", + '518: config("tilde") == "on"'); + vrfy(config("tab") == "on", + '519: config("tab") == "on"'); vrfy(config("quomod") == 0, '520: config("quomod") == 0'); vrfy(config("quo") == 2, @@ -433,10 +407,10 @@ define test_config() '527: config("outround") == 2'); vrfy(config("round") == 24, '528: config("round") == 24'); - vrfy(config("leadzero") == "false", - '529: config("leadzero") == "false"'); - vrfy(config("fullzero") == "false", - '530: config("fullzero") == "false"'); + vrfy(config("leadzero") == "off", + '529: config("leadzero") == "off"'); + vrfy(config("fullzero") == "off", + '530: config("fullzero") == "off"'); vrfy(config("maxscan") == 20, '531: config("maxscan") == 20'); vrfy(config("prompt") == "> ", @@ -452,10 +426,10 @@ define test_config() vrfy(config("quo", 0) == 2, '536: config("quo", 0) == 2'); vrfy(config("outround", 24) == 2, '537: config("outround", 24) == 2'); - vrfy(config("leadzero","y") == "false", - '538: config("leadzero","y") == "false"'); - vrfy(config("fullzero", 1) == "false", - '539: config("fullzero", 1) == "false"'); + vrfy(config("leadzero","y") == "off", + '538: config("leadzero","y") == "off"'); + vrfy(config("fullzero", 1) == "off", + '539: config("fullzero", 1) == "off"'); vrfy(config("prompt", "; ") == "> ", '540: config("prompt", "; ") == "> "'); vrfy(config("more", ";; ") == ">> ", @@ -467,14 +441,14 @@ define test_config() '543: config("all",callcfg) == newcfg'); vrfy(config("display",2) == 20, '544: config("display",2) == 20'); - vrfy(config("fullzero",1) == "false", - '545: config("fullzero",1) == "false"'); + vrfy(config("fullzero",1) == "off", + '545: config("fullzero",1) == "off"'); vrfy(strprintf("%d %d %d", 0, 1, 2) == ".00 1.00 2.00", '546: strprintf("%d %d %d", 0, 1, 2) == ".00 1.00 2.00"'); vrfy(config("display",20) == 2, '547: config("display",20) == 2'); - vrfy(config("fullzero",0) == "true", - '548: config("fullzero",0) == "true"'); + vrfy(config("fullzero",0) == "on", + '548: config("fullzero",0) == "on"'); vrfy(strprintf("%d %d %d", 0, 1, 2) == "0 1 2", '549: strprintf("%d %d %d", 0, 1, 2) == "0 1 2"'); @@ -484,15 +458,7 @@ define test_config() vrfy(config("all") == callcfg, '551: config("all") == callcfg'); vrfy(config("all") == startcfg, '552: config("all") == startcfg'); - /* check read-only config values */ - vrfy(strlen(config("program")) > 0, - '553: strlen(config("program")) > 0'); - vrfy(strlen(config("basename")) > 0, - '554: strlen(config("basename")) > 0'); - vrfy(strlen(config("version")) > 0, - '555: strlen(config("version")) > 0'); - - print '556: Ending test_config'; + print '553: Ending test_config'; } print '010: parsed test_config()'; @@ -1716,7 +1682,7 @@ print '026: parsed test_mode()'; /* - * The 1700's contain tests for reading resource files. These tests are + * The 1700's contain tests for reading scripts. These tests are * done inline near the bottom. */ @@ -1980,9 +1946,9 @@ print '029: parsed test_prime()'; /* - * Test the Lucas primality test resource file + * Test the Lucas primality test library */ -read -once "lucas_chk"; /* obtain our needed Lucas resource file */ +read -once "lucas_chk"; /* obtain our needed Lucas library */ print '030: read lucas_chk'; /**/ define test_lucas() @@ -5007,7 +4973,7 @@ define test_is() { local loc; /* unassigned local variable */ local a; /* assoc */ - local ofd; /* open file desriptor */ + local ofd; /* open file descriptor */ local cfd; /* closed file descriptor */ local blk; /* unnamed block */ local nblk; /* named block */ @@ -7542,10 +7508,10 @@ read -once "test8500"; /* - * read various calc resource files + * read various calc libs * - * We read most of the standard calc resource files. There are a few - * resource files that are not read: + * We read most of the calc libs shipped with the distribution. + * There are a few lib files that are not read: * * beer.cal - prints a bunch of things when loaded * hello.cal - designed to go into an infinite loop @@ -7561,7 +7527,7 @@ read -once "test8500"; * all of real actions of regress.cal. */ print; -print '9800: Starting read of selected calc resource files'; +print '9800: Starting read of selected calc libs'; read -once bernoulli; print '9801: read -once bernoulli'; read -once bigprime; @@ -7618,7 +7584,7 @@ read -once varargs; print '9827: read -once varargs'; read -once qtime; print '9828: read -once qtime'; -print '9829: Ending read of selected calc resource files'; +print '9829: Ending read of selected calc libs'; /* diff --git a/cal/seedrandom.cal b/lib/seedrandom.cal similarity index 71% rename from cal/seedrandom.cal rename to lib/seedrandom.cal index 73f3590..5d88b59 100644 --- a/cal/seedrandom.cal +++ b/lib/seedrandom.cal @@ -1,35 +1,35 @@ /* - * seedrandom - seed the cryptographically strong Blum generator + * Copyright (c) 1996 Landon Curt Noll * - * Copyright (C) 1999 Landon Curt Noll + * Permission to use, copy, modify, and distribute this software and + * its documentation for any purpose and without fee is hereby granted, + * provided that the above copyright, this permission notice and text + * this comment, and the disclaimer below appear in all of the following: * - * Calc is open software; you can redistribute it and/or modify it under - * the terms of the version 2.1 of the GNU Lesser General Public License - * as published by the Free Software Foundation. + * supporting documentation + * source copies + * source works derived from this source + * binaries derived from this source or from derived source * - * Calc is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General - * Public License for more details. + * LANDON CURT NOLL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO + * EVENT SHALL LANDON CURT NOLL BE LIABLE FOR ANY SPECIAL, INDIRECT OR + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF + * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR + * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. * - * A copy of version 2.1 of the GNU Lesser General Public License is - * distributed with calc under the filename COPYING-LGPL. You should have - * received a copy with calc; if not, write to Free Software Foundation, Inc. - * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. + * Landon Curt Noll + * http://reality.sgi.com/chongo/ * - * @(#) $Revision: 29.1 $ - * @(#) $Id: seedrandom.cal,v 29.1 1999/12/14 09:15:33 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/seedrandom.cal,v $ - * - * Under source code control: 1996/01/01 08:21:00 - * File existed as early as: 1996 - * - * chongo /\oo/\ http://reality.sgi.com/chongo/ - * Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ + * chongo /\../\ */ /* - * The period of Blum generators with modulus 'n=p*q' (where p and + * seedrandom - seed the cryptographically strong Blum generator + * + * + * The period of a Blum generators with modulus 'n=p*q' (where p and * q are primes 3 mod 4) is: * * lambda(n) = lcm(factors of p-1 & q-1) @@ -53,8 +53,6 @@ * NOTE: The [10^20, 10^314) range comes from the fact that the 13th internal * modulus is ~10^315. We want the lower bound seed to be reasonably big. */ - - define seedrandom(seed1, seed2, size, trials) { local p; /* first Blum prime */ @@ -115,7 +113,7 @@ define seedrandom(seed1, seed2, size, trials) p = 2*fp+1; } while (ptest(p,1,0) == 0); } while(ptest(p, trials) == 0 || ptest(fp, trials) == 0); - if (config("resource_debug") & 3) { + if (config("lib_debug") & 3) { print "/* 1st Blum prime */ p=", p; } @@ -129,7 +127,7 @@ define seedrandom(seed1, seed2, size, trials) q = 2*fq+1; } while (ptest(q,1,0) == 0); } while(ptest(q, trials) == 0 || ptest(fq, trials) == 0); - if (config("resource_debug") & 3) { + if (config("lib_debug") & 3) { print "/* 2nd Blum prime */ q=", q; } @@ -139,7 +137,7 @@ define seedrandom(seed1, seed2, size, trials) n = p*q; /* the Blum modulus */ binsize = highbit(n)+1; /* smallest power of 2 > p*q */ r = pmod(rand(1< p) { + i = b % a; + b = a; + a = i; + } + print a : "^2 +" , b : "^2 =" , a^2 + b^2; +} diff --git a/cal/surd.cal b/lib/surd.cal similarity index 73% rename from cal/surd.cal rename to lib/surd.cal index 58188cb..4e18d25 100644 --- a/cal/surd.cal +++ b/lib/surd.cal @@ -1,33 +1,11 @@ /* - * surd - calculate using quadratic surds of the form: a + b * sqrt(D). + * Copyright (c) 1995 David I. Bell + * Permission is granted to use, distribute, or modify this source, + * provided that this copyright notice remains intact. * - * Copyright (C) 1999 David I. Bell - * - * Calc is open software; you can redistribute it and/or modify it under - * the terms of the version 2.1 of the GNU Lesser General Public License - * as published by the Free Software Foundation. - * - * Calc is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General - * Public License for more details. - * - * A copy of version 2.1 of the GNU Lesser General Public License is - * distributed with calc under the filename COPYING-LGPL. You should have - * received a copy with calc; if not, write to Free Software Foundation, Inc. - * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. - * - * @(#) $Revision: 29.1 $ - * @(#) $Id: surd.cal,v 29.1 1999/12/14 09:15:33 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/surd.cal,v $ - * - * Under source code control: 1990/02/15 01:50:38 - * File existed as early as: before 1990 - * - * Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ + * Calculate using quadratic surds of the form: a + b * sqrt(D). */ - obj surd {a, b}; /* definition of the surd object */ global surd_type = -1; /* type of surd (value of D) */ @@ -283,7 +261,7 @@ define surd_rel(a, b) return sgn(x^2 - y^2 * surd_type) * sgn(x); } -if (config("resource_debug") & 3) { +if (config("lib_debug") & 3) { print "obj surd {a, b} defined"; print "surd_type defined"; print "set surd_type as needed"; diff --git a/lib/test1700.cal b/lib/test1700.cal new file mode 100644 index 0000000..3c7610b --- /dev/null +++ b/lib/test1700.cal @@ -0,0 +1,14 @@ +/* + * Copyright (c) 1995 Landon Curt Noll + * Permission is granted to use, distribute, or modify this source, + * provided that this copyright notice remains intact. + * + * By: Landon Curt Noll + * http://reality.sgi.com/chongo/ + * + * chongo /\../\ + * + * This library is used by the 1700 series of the regress.cal test suite. + */ + +++value; diff --git a/cal/test2300.cal b/lib/test2300.cal similarity index 52% rename from cal/test2300.cal rename to lib/test2300.cal index 7f76ef9..fd1a511 100644 --- a/cal/test2300.cal +++ b/lib/test2300.cal @@ -1,31 +1,14 @@ /* - * test2300 - 2300 series of the regress.cal test suite + * Copyright (c) 1995 Landon Curt Noll + * Permission is granted to use, distribute, or modify this source, + * provided that this copyright notice remains intact. * - * Copyright (C) 1999 Landon Curt Noll + * By: Landon Curt Noll + * http://reality.sgi.com/chongo/ * - * Calc is open software; you can redistribute it and/or modify it under - * the terms of the version 2.1 of the GNU Lesser General Public License - * as published by the Free Software Foundation. + * chongo /\../\ * - * Calc is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General - * Public License for more details. - * - * A copy of version 2.1 of the GNU Lesser General Public License is - * distributed with calc under the filename COPYING-LGPL. You should have - * received a copy with calc; if not, write to Free Software Foundation, Inc. - * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. - * - * @(#) $Revision: 29.1 $ - * @(#) $Id: test2300.cal,v 29.1 1999/12/14 09:15:33 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/test2300.cal,v $ - * - * Under source code control: 1995/07/09 06:12:13 - * File existed as early as: 1995 - * - * chongo /\oo/\ http://reality.sgi.com/chongo/ - * Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ + * This library is used by the 2300 series of the regress.cal test suite. */ diff --git a/cal/test2600.cal b/lib/test2600.cal similarity index 89% rename from cal/test2600.cal rename to lib/test2600.cal index d93bce9..f9007b1 100644 --- a/cal/test2600.cal +++ b/lib/test2600.cal @@ -1,34 +1,13 @@ /* - * test2600 - 2600 series of the regress.cal test suite + * Copyright (c) 1996 Ernest Bowen and Landon Curt Noll + * Permission is granted to use, distribute, or modify this source, + * provided that this copyright notice remains intact. * - * Copyright (C) 1999 Ernest Bowen and Landon Curt Noll + * By: Ernest Bowen and Landon Curt Noll + * ernie@neumann.une.edu.au and http://reality.sgi.com/chongo/ * - * Primary author: Ernest Bowen - * - * Calc is open software; you can redistribute it and/or modify it under - * the terms of the version 2.1 of the GNU Lesser General Public License - * as published by the Free Software Foundation. - * - * Calc is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General - * Public License for more details. - * - * A copy of version 2.1 of the GNU Lesser General Public License is - * distributed with calc under the filename COPYING-LGPL. You should have - * received a copy with calc; if not, write to Free Software Foundation, Inc. - * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. - * - * @(#) $Revision: 29.1 $ - * @(#) $Id: test2600.cal,v 29.1 1999/12/14 09:15:33 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/test2600.cal,v $ - * - * Under source code control: 1995/10/13 00:13:14 - * File existed as early as: 1995 - * - * Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ + * This library is used by the 2600 series of the regress.cal test suite. */ - /* * Stringent tests of some of calc's builtin functions. * Most of the tests are concerned with the accuracy of the value @@ -70,7 +49,6 @@ * All functions return the number of errors that they detected. */ - global defaultverbose = 1; /* default verbose value */ global err; diff --git a/cal/test2700.cal b/lib/test2700.cal similarity index 82% rename from cal/test2700.cal rename to lib/test2700.cal index b18846a..56194fa 100644 --- a/cal/test2700.cal +++ b/lib/test2700.cal @@ -1,46 +1,25 @@ /* - * test2700 - 2700 series of the regress.cal test suite + * Copyright (c) 1996 Ernest Bowen and Landon Curt Noll + * Permission is granted to use, distribute, or modify this source, + * provided that this copyright notice remains intact. * - * Copyright (C) 1999 Ernest Bowen and Landon Curt Noll + * By: Ernest Bowen and Landon Curt Noll + * ernie@neumann.une.edu.au and http://reality.sgi.com/chongo/ * - * Primary author: Ernest Bowen - * - * Calc is open software; you can redistribute it and/or modify it under - * the terms of the version 2.1 of the GNU Lesser General Public License - * as published by the Free Software Foundation. - * - * Calc is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General - * Public License for more details. - * - * A copy of version 2.1 of the GNU Lesser General Public License is - * distributed with calc under the filename COPYING-LGPL. You should have - * received a copy with calc; if not, write to Free Software Foundation, Inc. - * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. - * - * @(#) $Revision: 29.1 $ - * @(#) $Id: test2700.cal,v 29.1 1999/12/14 09:15:33 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/test2700.cal,v $ - * - * Under source code control: 1995/11/01 22:52:25 - * File existed as early as: 1995 - * - * Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ + * This library is used by the 2700 series of the regress.cal test suite. */ - /* - * The following resource file gives a severe test of sqrt(x,y,z) for + * The following script gives a severe test of sqrt(x,y,z) for * all 128 values of z, randomly produced real and complex x, and randomly * produced nonzero values for y. After loading it, testcsqrt(n) will * test n combinations of x and y; testcsqrt(str,n,2) will print 1 2 3 ... * indicating work in process; testcsqrt(str,n,3) will give information about - * errors detected and will print values of x and y used. + * errors detected and will print values of x and y used. The + * number generators are essentially as in the script I sent yesterday. * I've also defined a function iscomsq(x) which does for complex as well * as real x what issq(x) currently does for real x. */ - global defaultverbose = 1; global err; diff --git a/lib/test3100.cal b/lib/test3100.cal new file mode 100644 index 0000000..bf8c52a --- /dev/null +++ b/lib/test3100.cal @@ -0,0 +1,19 @@ +/* + * Copyright (c) 1995 Ernest Bowen and Landon Curt Noll + * Permission is granted to use, distribute, or modify this source, + * provided that this copyright notice remains intact. + * + * By: Ernest Bowen and Landon Curt Noll + * ernie@neumann.une.edu.au and http://reality.sgi.com/chongo/ + * + * This library is used by the 3100 series of the regress.cal test suite. + */ + +obj res {r}; +global md; +define res_test(a) = !ismult(a.r, md); +define res_sub(a,b) {local obj res v = {(a.r - b.r) % md}; return v;}; +define res_mul(a,b) {local obj res v = {(a.r * b.r) % md}; return v;}; +define res_neg(a) {local obj res v = {(-a.r) % md}; return v;}; +define res_inv(a) {local obj res v = {minv(a.r, md)}; return v;}; +define res(x) {local obj res v = {x % md}; return v;}; diff --git a/cal/test3300.cal b/lib/test3300.cal similarity index 63% rename from cal/test3300.cal rename to lib/test3300.cal index 734cd0d..5ee7d77 100644 --- a/cal/test3300.cal +++ b/lib/test3300.cal @@ -1,35 +1,14 @@ /* - * test3300 - 3300 series of the regress.cal test suite + * Copyright (c) 1995 Ernest Bowen and Landon Curt Noll + * Permission is granted to use, distribute, or modify this source, + * provided that this copyright notice remains intact. * - * Copyright (C) 1999 Ernest Bowen and Landon Curt Noll + * By: Ernest Bowen and Landon Curt Noll + * ernie@neumann.une.edu.au and http://reality.sgi.com/chongo/ * - * Primary author: Ernest Bowen - * - * Calc is open software; you can redistribute it and/or modify it under - * the terms of the version 2.1 of the GNU Lesser General Public License - * as published by the Free Software Foundation. - * - * Calc is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General - * Public License for more details. - * - * A copy of version 2.1 of the GNU Lesser General Public License is - * distributed with calc under the filename COPYING-LGPL. You should have - * received a copy with calc; if not, write to Free Software Foundation, Inc. - * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. - * - * @(#) $Revision: 29.1 $ - * @(#) $Id: test3300.cal,v 29.1 1999/12/14 09:15:33 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/test3300.cal,v $ - * - * Under source code control: 1995/12/02 04:27:41 - * File existed as early as: 1995 - * - * Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ + * This library is used by the 3300 series of the regress.cal test suite. */ - global defaultverbose = 1; /* default verbose value */ global err; diff --git a/cal/test3400.cal b/lib/test3400.cal similarity index 83% rename from cal/test3400.cal rename to lib/test3400.cal index c90080a..d947729 100644 --- a/cal/test3400.cal +++ b/lib/test3400.cal @@ -1,34 +1,13 @@ /* - * test3400 - 3400 series of the regress.cal test suite + * Copyright (c) 1996 Ernest Bowen and Landon Curt Noll + * Permission is granted to use, distribute, or modify this source, + * provided that this copyright notice remains intact. * - * Copyright (C) 1999 Ernest Bowen and Landon Curt Noll + * By: Ernest Bowen and Landon Curt Noll + * ernie@neumann.une.edu.au and http://reality.sgi.com/chongo/ * - * Primary author: Ernest Bowen - * - * Calc is open software; you can redistribute it and/or modify it under - * the terms of the version 2.1 of the GNU Lesser General Public License - * as published by the Free Software Foundation. - * - * Calc is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General - * Public License for more details. - * - * A copy of version 2.1 of the GNU Lesser General Public License is - * distributed with calc under the filename COPYING-LGPL. You should have - * received a copy with calc; if not, write to Free Software Foundation, Inc. - * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. - * - * @(#) $Revision: 29.1 $ - * @(#) $Id: test3400.cal,v 29.1 1999/12/14 09:15:34 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/test3400.cal,v $ - * - * Under source code control: 1995/12/02 05:20:11 - * File existed as early as: 1995 - * - * Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ + * This library is used by the 3400 series of the regress.cal test suite. */ - /* * tests of performance of some trigonometric functions * @@ -53,7 +32,6 @@ * that the two sides might differ by eps. [[test changed to test eps error]] */ - global defaultverbose = 1; /* default verbose value */ global err; diff --git a/cal/test3500.cal b/lib/test3500.cal similarity index 81% rename from cal/test3500.cal rename to lib/test3500.cal index aac20e1..23d8818 100644 --- a/cal/test3500.cal +++ b/lib/test3500.cal @@ -1,34 +1,13 @@ /* - * test3500 - 3500 series of the regress.cal test suite + * Copyright (c) 1996 Ernest Bowen and Landon Curt Noll + * Permission is granted to use, distribute, or modify this source, + * provided that this copyright notice remains intact. * - * Copyright (C) 1999 Ernest Bowen and Landon Curt Noll + * By: Ernest Bowen and Landon Curt Noll + * ernie@neumann.une.edu.au and http://reality.sgi.com/chongo/ * - * Primary author: Ernest Bowen - * - * Calc is open software; you can redistribute it and/or modify it under - * the terms of the version 2.1 of the GNU Lesser General Public License - * as published by the Free Software Foundation. - * - * Calc is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General - * Public License for more details. - * - * A copy of version 2.1 of the GNU Lesser General Public License is - * distributed with calc under the filename COPYING-LGPL. You should have - * received a copy with calc; if not, write to Free Software Foundation, Inc. - * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. - * - * @(#) $Revision: 29.1 $ - * @(#) $Id: test3500.cal,v 29.1 1999/12/14 09:15:34 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/test3500.cal,v $ - * - * Under source code control: 1995/12/18 22:50:46 - * File existed as early as: 1995 - * - * Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ + * This library is used by the 3500 series of the regress.cal test suite. */ - /* * Stringent tests of the functions frem, fcnt, gcdrem. * @@ -52,7 +31,6 @@ * */ - global defaultverbose = 1; /* default verbose value */ global err; diff --git a/cal/test4000.cal b/lib/test4000.cal similarity index 88% rename from cal/test4000.cal rename to lib/test4000.cal index 1c770a2..3adcf85 100644 --- a/cal/test4000.cal +++ b/lib/test4000.cal @@ -1,34 +1,13 @@ /* - * test4000 - 4000 series of the regress.cal test suite + * Copyright (c) 1996 Ernest Bowen and Landon Curt Noll + * Permission is granted to use, distribute, or modify this source, + * provided that this copyright notice remains intact. * - * Copyright (C) 1999 Ernest Bowen and Landon Curt Noll + * By: Ernest Bowen and Landon Curt Noll + * ernie@neumann.une.edu.au and http://reality.sgi.com/chongo/ * - * Primary author: Ernest Bowen - * - * Calc is open software; you can redistribute it and/or modify it under - * the terms of the version 2.1 of the GNU Lesser General Public License - * as published by the Free Software Foundation. - * - * Calc is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General - * Public License for more details. - * - * A copy of version 2.1 of the GNU Lesser General Public License is - * distributed with calc under the filename COPYING-LGPL. You should have - * received a copy with calc; if not, write to Free Software Foundation, Inc. - * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. - * - * @(#) $Revision: 29.1 $ - * @(#) $Id: test4000.cal,v 29.1 1999/12/14 09:15:34 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/test4000.cal,v $ - * - * Under source code control: 1996/03/13 02:38:45 - * File existed as early as: 1996 - * - * Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ + * This library is used by the 4000 series of the regress.cal test suite. */ - /* * Functions for testing and timing ptest, nextcand, prevcand. * @@ -74,7 +53,6 @@ * modulus to 1. */ - global defaultverbose = 1; /* default verbose value */ global err; diff --git a/cal/test4100.cal b/lib/test4100.cal similarity index 89% rename from cal/test4100.cal rename to lib/test4100.cal index 8760f43..cee31bd 100644 --- a/cal/test4100.cal +++ b/lib/test4100.cal @@ -1,34 +1,13 @@ /* - * test4100 - 4100 series of the regress.cal test suite + * Copyright (c) 1996 Ernest Bowen and Landon Curt Noll + * Permission is granted to use, distribute, or modify this source, + * provided that this copyright notice remains intact. * - * Copyright (C) 1999 Ernest Bowen and Landon Curt Noll + * By: Ernest Bowen and Landon Curt Noll + * ernie@neumann.une.edu.au and http://reality.sgi.com/chongo/ * - * Primary author: Ernest Bowen - * - * Calc is open software; you can redistribute it and/or modify it under - * the terms of the version 2.1 of the GNU Lesser General Public License - * as published by the Free Software Foundation. - * - * Calc is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General - * Public License for more details. - * - * A copy of version 2.1 of the GNU Lesser General Public License is - * distributed with calc under the filename COPYING-LGPL. You should have - * received a copy with calc; if not, write to Free Software Foundation, Inc. - * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. - * - * @(#) $Revision: 29.1 $ - * @(#) $Id: test4100.cal,v 29.1 1999/12/14 09:15:34 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/test4100.cal,v $ - * - * Under source code control: 1996/03/13 03:53:22 - * File existed as early as: 1996 - * - * Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ + * This library is used by the 4100 series of the regress.cal test suite. */ - /* * Some severe tests and timing functions for REDC functions and pmod. * @@ -69,7 +48,6 @@ * */ - global defaultverbose = 1; /* default verbose value */ global err; diff --git a/cal/test4600.cal b/lib/test4600.cal similarity index 81% rename from cal/test4600.cal rename to lib/test4600.cal index 9a2d848..659e9bf 100644 --- a/cal/test4600.cal +++ b/lib/test4600.cal @@ -1,32 +1,12 @@ /* - * test4600 - 4600 series of the regress.cal test suite + * Copyright (c) 1996 Ernest Bowen and Landon Curt Noll + * Permission is granted to use, distribute, or modify this source, + * provided that this copyright notice remains intact. * - * Copyright (C) 1999 Ernest Bowen and Landon Curt Noll + * By: Ernest Bowen and Landon Curt Noll + * ernie@neumann.une.edu.au and http://reality.sgi.com/chongo/ * - * Primary author: Ernest Bowen - * - * Calc is open software; you can redistribute it and/or modify it under - * the terms of the version 2.1 of the GNU Lesser General Public License - * as published by the Free Software Foundation. - * - * Calc is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General - * Public License for more details. - * - * A copy of version 2.1 of the GNU Lesser General Public License is - * distributed with calc under the filename COPYING-LGPL. You should have - * received a copy with calc; if not, write to Free Software Foundation, Inc. - * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. - * - * @(#) $Revision: 29.1 $ - * @(#) $Id: test4600.cal,v 29.1 1999/12/14 09:15:34 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/test4600.cal,v $ - * - * Under source code control: 1996/07/02 20:04:40 - * File existed as early as: 1996 - * - * Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ + * This library is used by the 4600 series of the regress.cal test suite. */ diff --git a/lib/test5100.cal b/lib/test5100.cal new file mode 100644 index 0000000..892be2a --- /dev/null +++ b/lib/test5100.cal @@ -0,0 +1,50 @@ +/* + * Copyright (c) 1996 Ernest Bowen and Landon Curt Noll + * Permission is granted to use, distribute, or modify this source, + * provided that this copyright notice remains intact. + * + * By: Ernest Bowen and Landon Curt Noll + * ernie@neumann.une.edu.au and http://reality.sgi.com/chongo/ + * + * This library is used by the 5100 series of the regress.cal test suite. + */ + +global defaultverbose = 1; /* default verbose value */ +global err; + +/* + * test5100 - test the new code generator declaration scope and order + * + * In this function two static variables a5100 and b5100 are created, + * with zero value, when the definition is read. + * + * The variable a5100 is initialized with the value x if and when this + * function is first called with a positive even x. The varable b5100 + * is similarly initialized if and when this function is first called positive + * odd x. + * + * Each time this function is called with positive integer x, a5100 or + * b5100 is incremented. + * + * Finally the values of the static variables are assigned to the global + * variables a5100 and b5100. + * + * Immediately after the last of several calls to this function + * a5100 = 0 if none of the x's have been positive even, otherwise + * a5100 = the first positive even x + the number of positive even x's, + * and b5100 = 0 if none of the x's have been positive odd, otherwise + * b5100 = the first positive odd x + the number of positive odd x's. + */ +define test5100(x) +{ + if (isint(x) && x > 0) { + if (iseven(x)) { + static a5100 = x; + a5100++; + } else { + static b5100 = x; + b5100++; + } + } + global a5100 = a5100, b5100 = b5100; +} diff --git a/lib/test5200.cal b/lib/test5200.cal new file mode 100644 index 0000000..d2a2183 --- /dev/null +++ b/lib/test5200.cal @@ -0,0 +1,32 @@ +/* + * Copyright (c) 1996 Ernest Bowen and Landon Curt Noll + * Permission is granted to use, distribute, or modify this source, + * provided that this copyright notice remains intact. + * + * By: Ernest Bowen and Landon Curt Noll + * ernie@neumann.une.edu.au and http://reality.sgi.com/chongo/ + * + * This library is used by the 5200 series of the regress.cal test suite. + */ + +global defaultverbose = 1; /* default verbose value */ +global err; + +/* + * test the fix of a global/static bug + * + * Given the following: + * + * global a = 10; + * static a = 20; + * define f(x) = a + x; + * define g(x) {global a = 30; return a + x;} + * define h(x) = a + x; + * + * Older versions of + */ +global a5200 = 10; +static a5200 = 20; +define f5200(x) = a5200 + x; +define g5200(x) {global a5200 = 30; return a5200 + x;} +define h5200(x) = a5200 + x; diff --git a/lib/test8400.cal b/lib/test8400.cal new file mode 100644 index 0000000..6580500 --- /dev/null +++ b/lib/test8400.cal @@ -0,0 +1,30 @@ +/* + * Copyright (c) 1999 Landon Curt Noll + * Permission is granted to use, distribute, or modify this source, + * provided that this copyright notice remains intact. + * + * By: Landon Curt Noll + * http://reality.sgi.com/chongo/ + * + * chongo /\../\ + * + * This library is used by the 8400 series of the regress.cal test suite. + */ + +print "8401: in test8400.cal"; + +/* + * test8400 - dummy function to allow a check of quit-based memory leaks + */ +define test8400() +{ + local x8401 = 19937; /* watch for lost memory */ + static s8401 = 44497; /* watch for lost memory */ + + return x8401+s8401; +} +print "8402: parsed test8400()"; +vrfy(test8400() == 64434, '8403: test8400() == 64434'); + +quit; +prob('quit did not end test8400.cal'); diff --git a/cal/test8500.cal b/lib/test8500.cal similarity index 80% rename from cal/test8500.cal rename to lib/test8500.cal index 52653f3..3e28ed9 100644 --- a/cal/test8500.cal +++ b/lib/test8500.cal @@ -1,39 +1,17 @@ /* - * test8500 - 8500 series of the regress.cal test suite + * Copyright (c) 1996 Ernest Bowen and Landon Curt Noll + * Permission is granted to use, distribute, or modify this source, + * provided that this copyright notice remains intact. * - * Copyright (C) 1999 Ernest Bowen and Landon Curt Noll + * By: Ernest Bowen and Landon Curt Noll + * ernie@neumann.une.edu.au and http://reality.sgi.com/chongo/ * - * Primary author: Ernest Bowen - * - * Calc is open software; you can redistribute it and/or modify it under - * the terms of the version 2.1 of the GNU Lesser General Public License - * as published by the Free Software Foundation. - * - * Calc is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General - * Public License for more details. - * - * A copy of version 2.1 of the GNU Lesser General Public License is - * distributed with calc under the filename COPYING-LGPL. You should have - * received a copy with calc; if not, write to Free Software Foundation, Inc. - * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. - * - * @(#) $Revision: 29.1 $ - * @(#) $Id: test8500.cal,v 29.1 1999/12/14 09:15:34 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/test8500.cal,v $ - * - * Under source code control: 1999/11/12 20:59:59 - * File existed as early as: 1999 - * - * Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ + * This library is used by the 8500 series of the regress.cal test suite. */ - /* * Tests of // and % operators */ - global err_8500; /* divmod_8500 error count */ global L_8500; /* list of problem values */ global ver_8500; /* test verbosity - see setting comment near bottom */ diff --git a/lib/unitfrac.cal b/lib/unitfrac.cal new file mode 100644 index 0000000..91d2fd8 --- /dev/null +++ b/lib/unitfrac.cal @@ -0,0 +1,29 @@ +/* + * Copyright (c) 1995 David I. Bell + * Permission is granted to use, distribute, or modify this source, + * provided that this copyright notice remains intact. + * + * Represent a fraction as sum of distinct unit fractions. + * The output is the unit fractions themselves, and in square brackets, + * the number of digits in the numerator and denominator of the value left + * to be found. Numbers larger than 3.5 become very difficult to calculate. + */ + +define unitfrac(x) +{ + local d, di, n; + + if (x <= 0) + quit "Non-positive argument"; + d = 2; + do { + n = int(1 / x) + 1; + if (n > d) + d = n; + di = 1/d; + print ' [': digits(num(x)): '/': digits(den(x)): ']',, di; + x -= di; + d++; + } while ((num(x) > 1) || (x == di) || (x == 1)); + print ' [1/1]',, x; +} diff --git a/lib/varargs.cal b/lib/varargs.cal new file mode 100644 index 0000000..b17a214 --- /dev/null +++ b/lib/varargs.cal @@ -0,0 +1,28 @@ +/* + * Copyright (c) 1995 David I. Bell + * Permission is granted to use, distribute, or modify this source, + * provided that this copyright notice remains intact. + * + * Example program to use 'varargs'. + * + * Program to sum the cubes of all the specified numbers. + */ + +define sc() +{ + local s, i; + + s = 0; + for (i = 1; i <= param(0); i++) { + if (!isnum(param(i))) { + print "parameter",i,"is not a number"; + continue; + } + s += param(i)^3; + } + return s; +} + +if (config("lib_debug") & 3) { + print "sc(a, b, ...) defined"; +} diff --git a/cal/xx_print.cal b/lib/xx_print.cal similarity index 79% rename from cal/xx_print.cal rename to lib/xx_print.cal index 0f71937..91f9c7b 100644 --- a/cal/xx_print.cal +++ b/lib/xx_print.cal @@ -1,30 +1,12 @@ +/* + * Copyright (c) 1997 Ernest Bowen + * Permission is granted to use, distribute, or modify this source, + * provided that this copyright notice remains intact. + * + * By: Ernest Bowen + */ /* * xx_print - demo print object routines - * - * Copyright (C) 1999 Ernest Bowen - * - * Calc is open software; you can redistribute it and/or modify it under - * the terms of the version 2.1 of the GNU Lesser General Public License - * as published by the Free Software Foundation. - * - * Calc is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General - * Public License for more details. - * - * A copy of version 2.1 of the GNU Lesser General Public License is - * distributed with calc under the filename COPYING-LGPL. You should have - * received a copy with calc; if not, write to Free Software Foundation, Inc. - * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. - * - * @(#) $Revision: 29.1 $ - * @(#) $Id: xx_print.cal,v 29.1 1999/12/14 09:15:34 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/cal/RCS/xx_print.cal,v $ - * - * Under source code control: 1997/04/17 00:08:50 - * File existed as early as: 1997 - * - * Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ */ diff --git a/lib_calc.c b/lib_calc.c index 6a55737..10a4596 100644 --- a/lib_calc.c +++ b/lib_calc.c @@ -1,37 +1,29 @@ /* - * lib_calc - calc link library initialization and shutdown routines + * Copyright (c) 1997 by Landon Curt Noll. All Rights Reserved. * - * Copyright (C) 1999 Landon Curt Noll + * Permission to use, copy, modify, and distribute this software and + * its documentation for any purpose and without fee is hereby granted, + * provided that the above copyright, this permission notice and text + * this comment, and the disclaimer below appear in all of the following: * - * Calc is open software; you can redistribute it and/or modify it under - * the terms of the version 2.1 of the GNU Lesser General Public License - * as published by the Free Software Foundation. + * supporting documentation + * source copies + * source works derived from this source + * binaries derived from this source or from derived source * - * Calc is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General - * Public License for more details. + * LANDON CURT NOLL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO + * EVENT SHALL LANDON CURT NOLL BE LIABLE FOR ANY SPECIAL, INDIRECT OR + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF + * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR + * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. * - * A copy of version 2.1 of the GNU Lesser General Public License is - * distributed with calc under the filename COPYING-LGPL. You should have - * received a copy with calc; if not, write to Free Software Foundation, Inc. - * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. - * - * @(#) $Revision: 29.2 $ - * @(#) $Id: lib_calc.c,v 29.2 1999/12/14 19:37:46 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/lib_calc.c,v $ - * - * Under source code control: 1996/06/17 18:06:19 - * File existed as early as: 1996 - * - * chongo /\oo/\ http://reality.sgi.com/chongo/ - * Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ + * chongo was here /\../\ */ - #include #include -#include #include #include "calc.h" @@ -57,24 +49,6 @@ #include #endif -#include "terminal.h" -#if defined(USE_TERMIOS) - -# include -typedef struct termios ttystruct; - -#elif defined(USE_TERMIOS) - -# include -typedef struct termio ttystruct; - -#else /* assume USE_SGTTY */ - -# include -typedef struct sgttyb ttystruct; - -#endif - /* * in case we do not have certain .h files */ @@ -95,7 +69,6 @@ int abortlevel; /* current level of aborts */ BOOL inputwait; /* TRUE if in a terminal input wait */ jmp_buf jmpbuf; /* for errors */ char *program = "calc"; /* our name */ -char *base_name = "calc"; /* basename of our name */ char cmdbuf[MAXCMD+1+1+1]; /* command line expression + "\n\0" + guard */ run run_state = RUN_UNKNOWN; /* calc startup and run state */ @@ -114,10 +87,9 @@ int allow_exec = TRUE; /* FALSE => may not execute any commands */ int p_flag = FALSE; /* TRUE => pipe mode */ int q_flag = FALSE; /* TRUE => don't execute rc files */ int u_flag = FALSE; /* TRUE => unbuffer stdin and stdout */ -int d_flag = FALSE; /* TRUE => disable heading, resource_debug == 0 */ +int d_flag = FALSE; /* TRUE => disable heading, lib_debug == 0 */ int c_flag = FALSE; /* TRUE => continue on error if permitted */ int i_flag = FALSE; /* TRUE => go interactive if permitted */ -int s_flag = FALSE; /* TRUE => keep args as strings for argv() */ /* @@ -135,16 +107,13 @@ int stoponerror = FALSE; /* >0 => stop, <0 => continue on error */ int post_init = FALSE; /* TRUE setjmp for math_error is ready */ BOOL abort_now = FALSE; /* TRUE => go interactive now, if permitted */ -int argc_value = 0; /* count of argv[] strings for argv() builtin */ -char **argv_value = NULL; /* argv[] strings for argv() builtin */ - int no_env = FALSE; /* TRUE (-e) => ignore env vars on startup */ int errmax = ERRMAX; /* if >= 0, maximum value for errcount */ NUMBER *epsilon_default; /* default allowed error for float calcs */ char *calc_debug = NULL; /* !=NULL => value of config("calc_debug") */ -char *resource_debug = NULL; /* !=NULL => config("resource_debug") value */ +char *lib_debug = NULL; /* !=NULL => value of config("lib_debug") */ char *user_debug = NULL; /* !=NULL => value of config("user_debug") */ @@ -162,12 +131,7 @@ extern void reinitialize(void); * static declarations */ static int init_done = 0; /* 1 => we already initialized */ -static int *fd_setup = NULL; /* fd's setup for interaction or -1 */ -static int fd_setup_len = 0; /* number of fd's in fd_setup */ -static ttystruct *fd_orig = NULL; /* fd original state */ -static ttystruct *fd_cur = NULL; /* fd current atate */ -static void initenv(void); /* setup calc environment */ -static int find_tty_state(int fd); /* find slot for saved tty state */ +static void initenv(void); /* @@ -179,8 +143,6 @@ static int find_tty_state(int fd); /* find slot for saved tty state */ void libcalc_call_me_first(void) { - char *p; - /* * do nothing if we are initialized already */ @@ -189,30 +151,9 @@ libcalc_call_me_first(void) } /* - * Disable SIGPIPE so that the pipe to the help file pager will - * not stop calc. - */ - (void) signal(SIGPIPE, SIG_IGN); - - /* - * determine the basename - */ - if (program != NULL) { - p = strrchr(program, '/'); - if (p == NULL) { - base_name = program; - } else { - base_name = p+1; - } - } - - /* - * initialize old and new configuration values + * setup configuration values */ oldstd.epsilon = &_qonesqbase_; /* magic to fake early str2q() */ - oldstd.program = strdup(program); - oldstd.base_name = strdup(base_name); - oldstd.version = strdup(version()); conf = config_copy(&oldstd); /* more magic to fake early str2q() */ conf->tab_ok = FALSE; oldstd.epsilon = str2q(EPSILON_DEFAULT); @@ -229,10 +170,10 @@ libcalc_call_me_first(void) } /* - * -d turns off resource_debug + * -d turns off lib_debug */ if (d_flag) { - conf->resource_debug = 0; + conf->lib_debug = 0; } /* @@ -243,13 +184,13 @@ libcalc_call_me_first(void) } /* - * -D flags can change calc_debug, resource_debug of user_debug + * -D flags can change calc_debug, lib_debug of user_debug */ if (calc_debug) { conf->calc_debug = strtol(calc_debug, NULL, 0); } - if (resource_debug) { - conf->resource_debug = strtol(resource_debug, NULL, 0); + if (lib_debug) { + conf->lib_debug = strtol(lib_debug, NULL, 0); } if (user_debug) { conf->user_debug = strtol(user_debug, NULL, 0); @@ -264,7 +205,7 @@ libcalc_call_me_first(void) * ready to rock & roll .. */ if (conf->calc_debug & CALCDBG_RUNSTATE) { - printf("libcalc_call_me_first: run_state from %s to %s\n", + printf("DEBUG: run_state from %s to %s\n", run_state_name(run_state), run_state_name(RUN_BEGIN)); } @@ -439,8 +380,6 @@ initenv(void) void libcalc_call_me_last(void) { - int i; - /* * firewall */ @@ -458,21 +397,6 @@ libcalc_call_me_last(void) */ random_libcalc_cleanup(); - /* - * restore all changed descriptor states - */ - if (fd_setup_len > 0) { - for (i=0; i < fd_setup_len; ++i) { - if (fd_setup[i] >= 0) { - if (conf->calc_debug & CALCDBG_TTY) - printf("libcalc_call_me_last: fd %d " - "not in original state, " - "restoring it", fd_setup[i]); - orig_tty(fd_setup[i]); - } - } - } - /* * all done */ @@ -551,294 +475,3 @@ calc_strdup(CONST char *s1) #endif /* HAVE_STRDUP */ } - - -/* - * find_tty_state - establish a new tty state - * - * Given: - * fd file descriptor to establish a new tty state for - * - * Returns: - * indx The index into fd_setup[], fd_orig[] and fd_cur[] to use or -1 - */ -static int -find_tty_state(int fd) -{ - int *new_fd_setup; /* new fd_setup array */ - ttystruct *new_fd_orig; /* new fd_orig array */ - ttystruct *new_fd_cur; /* new fd_cur array */ - int i; - - /* - * firewall: must be > 0 - */ - if (fd < 0) { - /* bad descriptor */ - return -1; - } - - /* - * case: need to initlally malloc some state - */ - if (fd_setup_len <= 0 || fd_setup == NULL || fd_orig == NULL) { - - /* setup for a single descriptor */ - fd_setup = (int *)malloc(sizeof(fd_setup[0])); - if (fd_setup == NULL) { - return -1; - } - fd_setup[0] = -1; - fd_orig = (ttystruct *)malloc(sizeof(fd_orig[0])); - if (fd_orig == NULL) { - return -1; - } - fd_cur = (ttystruct *)malloc(sizeof(fd_orig[0])); - if (fd_cur == NULL) { - return -1; - } - fd_setup_len = 1; - } - - /* - * look for an existing tty state for the descriptor - */ - for (i=0; i < fd_setup_len; ++i) { - - /* case: found existing tty state, return index */ - if (fd_setup[i] == fd) { - return i; - } - } - - /* - * no tty state exists for the descriptor, look for empty slot - */ - for (i=0; i < fd_setup_len; ++i) { - - /* case: found an empty slot, so return it */ - if (fd_setup[i] < 0) { - return i; - } - } - - /* - * no empty slots exist, realloc another slot - */ - new_fd_setup = (int *)realloc(fd_setup, sizeof(fd_setup[0]) * - (fd_setup_len+1)); - if (new_fd_setup == NULL) { - return -1; - } - new_fd_setup[fd_setup_len] = -1; - new_fd_orig = (ttystruct *)realloc(fd_setup, sizeof(fd_orig[0]) * - (fd_setup_len+1)); - if (new_fd_orig == NULL) { - return -1; - } - new_fd_cur = (ttystruct *)realloc(fd_cur, sizeof(fd_cur[0]) * - (fd_setup_len+1)); - if (new_fd_cur == NULL) { - return -1; - } - fd_setup = new_fd_setup; - fd_orig = new_fd_orig; - fd_cur = new_fd_cur; - ++fd_setup_len; - /* return the new slot */ - return fd_setup_len-1; -} - - -/* - * calc_tty - setup a file descriptor for calc's interactive use - * - * Calc wants, in effect, cbreak on and echo off. - * - * Given: - * fd the descriptor for calc's interactive use - * - * Returns: - * TRUE state change was successful - * FALSE unable to change state of descriptor for interactive use - */ -BOOL -calc_tty(int fd) -{ - int slot; /* the saved descriptor slot or -1 */ - - /* - * grab the saved slot for this descriptor - */ - slot = find_tty_state(fd); - if (slot < 0) { - if (conf->calc_debug & CALCDBG_TTY) - printf("calc_tty: Cannot get saved descriptor slot\n"); - return FALSE; - } - -#if defined(USE_SGTTY) - - /* - * USE_SGTTY tty state method - */ - /* save original state if needed */ - if (fd_setup[slot] < 0 && ioctl(fd, TIOCGETP, fd_orig+slot) < 0) { - if (conf->calc_debug & CALCDBG_TTY) - printf("calc_tty: Cannot TIOCGETP fd %d\n", fd); - return FALSE; - } - /* setup for new state */ - fd_cur[slot] = fd_orig[slot]; - fd_cur[slot].sg_flags &= ~ECHO; - fd_cur[slot].sg_flags |= CBREAK; - /* enable new state */ - if (ioctl(fd, TIOCSETP, fd_cur+slot) < 0) { - if (conf->calc_debug & CALCDBG_TTY) - printf("calc_tty: Cannot TIOCSETP fd %d\n", fd); - return FALSE; - } - if (conf->calc_debug & CALCDBG_TTY) - printf("calc_tty: stty -ECHO +CBREAK: fd %d\n", fd); - -#elif defined(USE_TERMIO) - - /* - * USE_TERMIO tty state method - */ - if (fd_setup[slot] < 0 && ioctl(fd, TCGETA, fd_orig+slot) < 0) { - if (conf->calc_debug & CALCDBG_TTY) - printf("calc_tty: Cannot TCGETA fd %d\n", fd); - return FALSE; - } - /* setup for new state */ - fd_cur[slot] = fd_orig[slot]; - fd_cur[slot].c_lflag &= ~(ECHO | ECHOE | ECHOK); - fd_cur[slot].c_iflag |= ISTRIP; - fd_cur[slot].c_lflag &= ~ICANON; - fd_cur[slot].c_cc[VMIN] = 1; - fd_cur[slot].c_cc[VTIME] = 0; - /* enable new state */ - if (ioctl(fd, TCSETAW, fd_cur+slot) < 0) { - if (conf->calc_debug & CALCDBG_TTY) - printf("calc_tty: Cannot TCSETAW fd %d\n", fd); - return FALSE; - } - if (conf->calc_debug & CALCDBG_TTY) - printf("calc_tty: stty -ECHO -ECHOE -ECHOK -ICANON +ISTRIP " - "VMIN=1 VTIME=0: fd %d\n", fd); - -#else /* assume USE_SGTTY */ - - /* - * assume USE_SGTTY tty state method - */ - if (fd_setup[slot] < 0 && tcgetattr(fd, fd_orig+slot) < 0) { - if (conf->calc_debug & CALCDBG_TTY) - printf("calc_tty: Cannot tcgetattr fd %d\n", fd); - return FALSE; - } - /* setup for new state */ - fd_cur[slot] = fd_orig[slot]; - fd_cur[slot].c_lflag &= ~(ECHO | ECHOE | ECHOK); - fd_cur[slot].c_iflag |= ISTRIP; - fd_cur[slot].c_lflag &= ~ICANON; - fd_cur[slot].c_cc[VMIN] = 1; - fd_cur[slot].c_cc[VTIME] = 0; - /* enable new state */ - if (tcsetattr(fd, TCSANOW, fd_cur+slot) < 0) { - if (conf->calc_debug & CALCDBG_TTY) - printf("calc_tty: Cannot tcsetattr fd %d\n", fd); - return FALSE; - } - if (conf->calc_debug & CALCDBG_TTY) - printf("calc_tty: stty -ECHO -ECHOE -ECHOK -ICANON +ISTRIP " - "VMIN=1 VTIME=0: fd %d\n", fd); -#endif - - /* - * note that the tty slot is on use - */ - fd_setup[slot] = fd; - return TRUE; -} - - -/* - * orig_tty - restore the original state of a file descriptor - * - * This routine will restore the state of a descriptor to its calc - * startup value if it was set for interactive use by calc_tty(). - * - * Given: - * fd the descriptor to restore - * - * Returns: - * TRUE restore was successful - * FALSE unable to restore descriptor to original state - */ -BOOL -orig_tty(int fd) -{ - int slot; /* the saved descriptor slot or -1 */ - - /* - * find the saved slot for this descriptor - */ - slot = find_tty_state(fd); - if (slot < 0) { - if (conf->calc_debug & CALCDBG_TTY) - printf("orig_tty: Cannot get saved descriptor slot\n"); - return FALSE; - } - - /* - * do nothing if no state was saved for this descriptor - */ - if (fd_setup[slot] < 0) { - if (conf->calc_debug & CALCDBG_TTY) - printf("orig_tty: no state saved for fd %d\n", fd); - return FALSE; - } - -#if defined(USE_SGTTY) - - /* - * USE_SGTTY tty state method - */ - (void) ioctl(fd, TIOCSETP, fd_orig+slot); - if (conf->calc_debug & CALCDBG_TTY) - printf("orig_tty: TIOCSETP restored fd %d\n", fd); - -#elif defined(USE_TERMIO) - - /* - * USE_TERMIO tty state method - */ - (void) ioctl(fd, TCSETAW, fd_orig+slot); - if (conf->calc_debug & CALCDBG_TTY) - printf("orig_tty: TCSETAW restored fd %d\n", fd); - -#else /* assume USE_SGTTY */ - - /* - * assume USE_SGTTY tty state method - */ - (void) tcsetattr(fd, TCSANOW, fd_orig+slot); - if (conf->calc_debug & CALCDBG_TTY) - printf("orig_tty: TCSANOW restored fd %d\n", fd); -#endif - - /* - * note new current state - */ - fd_cur[slot] = fd_orig[slot]; - - /* - * Since current state is the orignal state, we can free up - * this slot. This also prevents functins such as the - * libcalc_call_me_last() function from re-restoring it. - */ - fd_setup[slot] = -1; - return TRUE; -} diff --git a/lib_util.c b/lib_util.c index d9ca406..9ad656b 100644 --- a/lib_util.c +++ b/lib_util.c @@ -1,36 +1,32 @@ /* * lib_util - calc library utility routines * - * Copyright (C) 1999 Landon Curt Noll - * - * Calc is open software; you can redistribute it and/or modify it under - * the terms of the version 2.1 of the GNU Lesser General Public License - * as published by the Free Software Foundation. - * - * Calc is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General - * Public License for more details. - * - * A copy of version 2.1 of the GNU Lesser General Public License is - * distributed with calc under the filename COPYING-LGPL. You should have - * received a copy with calc; if not, write to Free Software Foundation, Inc. - * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. - * - * @(#) $Revision: 29.1 $ - * @(#) $Id: lib_util.c,v 29.1 1999/12/14 09:16:11 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/lib_util.c,v $ - * - * Under source code control: 1997/04/19 21:38:30 - * File existed as early as: 1997 - * - * chongo /\oo/\ http://reality.sgi.com/chongo/ - * Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ + * These routines are here to support users of libcalc.a. These routines + * are not directly used by calc itself, however. */ /* - * These routines are here to support users of libcalc.a. These routines - * are not directly used by calc itself, however. + * Copyright (c) 1997 by Landon Curt Noll. All Rights Reserved. + * + * Permission to use, copy, modify, and distribute this software and + * its documentation for any purpose and without fee is hereby granted, + * provided that the above copyright, this permission notice and text + * this comment, and the disclaimer below appear in all of the following: + * + * supporting documentation + * source copies + * source works derived from this source + * binaries derived from this source or from derived source + * + * LANDON CURT NOLL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO + * EVENT SHALL LANDON CURT NOLL BE LIABLE FOR ANY SPECIAL, INDIRECT OR + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF + * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR + * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. + * + * chongo was here /\../\ */ diff --git a/lib_util.h b/lib_util.h index 1dc3bb2..3ade63b 100644 --- a/lib_util.h +++ b/lib_util.h @@ -1,36 +1,32 @@ /* - * lib_util - calc link library utility routines + * lib_util - calc library utility routines * - * Copyright (C) 1999 Landon Curt Noll - * - * Calc is open software; you can redistribute it and/or modify it under - * the terms of the version 2.1 of the GNU Lesser General Public License - * as published by the Free Software Foundation. - * - * Calc is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General - * Public License for more details. - * - * A copy of version 2.1 of the GNU Lesser General Public License is - * distributed with calc under the filename COPYING-LGPL. You should have - * received a copy with calc; if not, write to Free Software Foundation, Inc. - * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. - * - * @(#) $Revision: 29.1 $ - * @(#) $Id: lib_util.h,v 29.1 1999/12/14 09:16:11 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/lib_util.h,v $ - * - * Under source code control: 1997/04/19 21:38:30 - * File existed as early as: 1997 - * - * chongo /\oo/\ http://reality.sgi.com/chongo/ - * Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ + * These routines are here to support users of libcalc.a. These routines + * are not directly used by calc itself, however. */ /* - * These routines are here to support users of libcalc.a. These routines - * are not directly used by calc itself, however. + * Copyright (c) 1997 by Landon Curt Noll. All Rights Reserved. + * + * Permission to use, copy, modify, and distribute this software and + * its documentation for any purpose and without fee is hereby granted, + * provided that the above copyright, this permission notice and text + * this comment, and the disclaimer below appear in all of the following: + * + * supporting documentation + * source copies + * source works derived from this source + * binaries derived from this source or from derived source + * + * LANDON CURT NOLL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO + * EVENT SHALL LANDON CURT NOLL BE LIABLE FOR ANY SPECIAL, INDIRECT OR + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF + * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR + * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. + * + * chongo was here /\../\ */ diff --git a/lint.sed b/lint.sed new file mode 100644 index 0000000..69590a8 --- /dev/null +++ b/lint.sed @@ -0,0 +1,37 @@ +/: warning: conversion from long may lose accuracy$/d +/: warning: possible pointer alignment problem$/d +/^Lint pass[0-9][0-9]*:$/d +/^[a-zA-Z][a-zA-Z0-9_-]*\.c:[ ]*$/d +/^addglobal, arg\. 2 used inconsistently[ ]/d +/^addopptr, arg\. 2 used inconsistently[ ]/d +/^codegen\.c([0-9]*):getassignment returns value which is sometimes ignored$/d +/^errno used([ ]*func\.c([0-9]*)[ ]*), but not defined$/d +/^exit value declared inconsistently[ ]/d +/^fclose returns value which is sometimes ignored$/d +/^fflush returns value which is always ignored$/d +/^fprintf returns value which is always ignored$/d +/^fputc returns value which is always ignored$/d +/^fputs returns value which is always ignored$/d +/^free, arg\. 1 used inconsistently[ ]/d +/^geteuid value declared inconsistently[ ]/d +/^geteuid value used inconsistently[ ]/d +/^getpwuid, arg\. 1 used inconsistently[ ]/d +/^malloc, arg\. 1 used inconsistently[ ]/d +/^math_setdigits returns value which is always ignored$/d +/^math_setmode returns value which is sometimes ignored$/d +/^memcpy returns value which is always ignored$/d +/^memcpy value declared inconsistently[ ]/d +/^memcpy, arg\. [1-3] used inconsistently[ ]/d +/^memset value declared inconsistently[ ]/d +/^printf returns value which is always ignored$/d +/^putc returns value which is always ignored$/d +/^qcfappr, arg\. 2 used inconsistently[ ]/d +/^realloc, arg\. [1-2] used inconsistently[ ]/d +/^sprintf returns value which is always ignored/d +/^strcat returns value which is always ignored/d +/^strcpy returns value which is always ignored/d +/^strncpy returns value which is always ignored/d +/^strncpy, arg\. [1-3] used inconsistently[ ]/d +/^system returns value which is always ignored/d +/^times returns value which is always ignored/d +/^vsprintf returns value which is always ignored/d diff --git a/listfunc.c b/listfunc.c index e0a20f7..fcb9bd9 100644 --- a/listfunc.c +++ b/listfunc.c @@ -1,33 +1,8 @@ /* - * listfunc - list handling routines + * Copyright (c) 1997 David I. Bell + * Permission is granted to use, distribute, or modify this source, + * provided that this copyright notice remains intact. * - * Copyright (C) 1999 David I. Bell - * - * Calc is open software; you can redistribute it and/or modify it under - * the terms of the version 2.1 of the GNU Lesser General Public License - * as published by the Free Software Foundation. - * - * Calc is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General - * Public License for more details. - * - * A copy of version 2.1 of the GNU Lesser General Public License is - * distributed with calc under the filename COPYING-LGPL. You should have - * received a copy with calc; if not, write to Free Software Foundation, Inc. - * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. - * - * @(#) $Revision: 29.1 $ - * @(#) $Id: listfunc.c,v 29.1 1999/12/14 09:16:11 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/listfunc.c,v $ - * - * Under source code control: 1990/02/15 01:48:18 - * File existed as early as: before 1990 - * - * Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ - */ - -/* * List handling routines. * Lists can be composed of any types of values, mixed if desired. * Lists are doubly linked so that elements can be inserted or @@ -36,7 +11,6 @@ * accesses are fast. */ - #include "value.h" #include "zrand.h" diff --git a/longbits.c b/longbits.c index 17a9640..910ed0f 100644 --- a/longbits.c +++ b/longbits.c @@ -1,34 +1,6 @@ /* * longbits - Determine the number if bits in a char, short, int or long * - * Copyright (C) 1999 Landon Curt Noll - * - * Calc is open software; you can redistribute it and/or modify it under - * the terms of the version 2.1 of the GNU Lesser General Public License - * as published by the Free Software Foundation. - * - * Calc is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General - * Public License for more details. - * - * A copy of version 2.1 of the GNU Lesser General Public License is - * distributed with calc under the filename COPYING-LGPL. You should have - * received a copy with calc; if not, write to Free Software Foundation, Inc. - * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. - * - * @(#) $Revision: 29.1 $ - * @(#) $Id: longbits.c,v 29.1 1999/12/14 09:16:12 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/longbits.c,v $ - * - * Under source code control: 1994/03/18 03:06:18 - * File existed as early as: 1994 - * - * chongo /\oo/\ http://reality.sgi.com/chongo/ - * Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ - */ - -/* * usage: * longbits [long_bit_size] * @@ -86,7 +58,29 @@ * * We will exit 0 if all is well, non-zero with an error to stderr otherwise. */ - +/* + * Copyright (c) 1995 by Landon Curt Noll. All Rights Reserved. + * + * Permission to use, copy, modify, and distribute this software and + * its documentation for any purpose and without fee is hereby granted, + * provided that the above copyright, this permission notice and text + * this comment, and the disclaimer below appear in all of the following: + * + * supporting documentation + * source copies + * source works derived from this source + * binaries derived from this source or from derived source + * + * LANDON CURT NOLL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO + * EVENT SHALL LANDON CURT NOLL BE LIABLE FOR ANY SPECIAL, INDIRECT OR + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF + * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR + * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. + * + * chongo was here /\../\ + */ #include #include @@ -152,8 +146,8 @@ main(int argc, char **argv) * report size of long */ printf("#undef LONG_BITS\n"); - printf("#define LONG_BITS %d\t\t/%s/\n", - long_bits, "* bit length of a long *"); + printf("#define LONG_BITS %d\t\t%c%s%c\n", + long_bits, '/', "* bit length of a long *", '/'); putchar('\n'); /* @@ -166,36 +160,36 @@ main(int argc, char **argv) /* * note that the size was forced */ - printf("/%s/\n\n", "* size of long was forced *"); + printf("%c%s%c\n\n", '/', "* size of long was forced *", '/'); /* * forced forming of USB8, SB8, USB16 and SB16 */ - printf("typedef unsigned char USB8;\t/%s/\n", - "* unsigned 8 bits *"); - printf("typedef signed char SB8;\t/%s/\n\n", - "* signed 8 bits *"); + printf("typedef unsigned char USB8;\t%c%s%c\n", + '/', "* unsigned 8 bits *", '/'); + printf("typedef signed char SB8;\t%c%s%c\n\n", + '/', "* signed 8 bits *", '/'); - printf("typedef unsigned short USB16;\t/%s/\n", - "* unsigned 16 bits *"); - printf("typedef short SB16;\t\t/%s/\n\n", - "* signed 16 bits *"); + printf("typedef unsigned short USB16;\t%c%s%c\n", + '/', "* unsigned 16 bits *", '/'); + printf("typedef short SB16;\t\t%c%s%c\n\n", + '/', "* signed 16 bits *", '/'); /* * forced forming of USB32 and SB32 */ if (long_bits == 32) { /* forced 32 bit long mode assumptions */ - printf("typedef unsigned long USB32;\t/%s/\n", - "* unsigned 32 bits *"); - printf("typedef long SB32;\t\t/%s/\n\n", - "* signed 32 bits *"); + printf("typedef unsigned long USB32;\t%c%s%c\n", + '/', "* unsigned 32 bits *", '/'); + printf("typedef long SB32;\t\t%c%s%c\n\n", + '/', "* signed 32 bits *", '/'); } else { /* forced 64 bit long mode assumptions */ - printf("typedef unsigned int USB32;\t/%s/\n", - "* unsigned 32 bits *"); - printf("typedef int SB32;\t\t/%s/\n\n", - "* signed 32 bits *"); + printf("typedef unsigned int USB32;\t%c%s%c\n", + '/', "* unsigned 32 bits *", '/'); + printf("typedef int SB32;\t\t%c%s%c\n\n", + '/', "* signed 32 bits *", '/'); } /* @@ -203,14 +197,15 @@ main(int argc, char **argv) */ #if defined(HAVE_LONGLONG) && LONGLONG_BITS == 64 printf("#undef HAVE_B64\n"); - printf("#define HAVE_B64\t\t/%s/\n", - "* have USB64 and SB64 types *"); - printf("typedef unsigned long long USB64;\t/%s/\n", - "* unsigned 64 bits *"); - printf("typedef long long SB64;\t\t/%s/\n", - "* signed 64 bits *"); + printf("#define HAVE_B64\t\t%c%s%c\n", + '/', "* have USB64 and SB64 types *", '/'); + printf("#define BOOL_B64 TRUE\n"); + printf("typedef unsigned long long USB64;\t%c%s%c\n", + '/', "* unsigned 64 bits *", '/'); + printf("typedef long long SB64;\t\t%c%s%c\n", + '/', "* signed 64 bits *", '/'); putchar('\n'); - printf("/%s/\n","* how to form 64 bit constants *"); + printf("%c%s%c\n", '/',"* how to form 64 bit constants *",'/'); #if defined(FORCE_STDC) || (defined(__STDC__) && __STDC__ != 0) || defined(__cplusplus) printf("#define U(x) x ## ULL\n"); printf("#define L(x) x ## LL\n"); @@ -219,10 +214,11 @@ main(int argc, char **argv) printf("#define L(x) ((long long)x)\n"); #endif #else - printf("#undef HAVE_B64\t\t\t/%s/\n", - "* we have no USB64 and no SB64 types *"); + printf("#undef HAVE_B64\t\t\t%c%s%c\n", + '/', "* we have no USB64 and no SB64 types *", '/'); + printf("#define BOOL_B64 FALSE\n"); putchar('\n'); - printf("/%s/\n", "* no 64 bit constants *"); + printf("%c%s%c\n", '/', "* no 64 bit constants *", '/'); printf("#define U(x) no 33 to 64 bit constants %s\n", "- do not use this macro!"); printf("#define L(x) no 33 to 64 bit constants %s\n", @@ -244,25 +240,25 @@ main(int argc, char **argv) "%s: OUCH!!! - char is not a single byte!\n", program); fprintf(stderr, "%s: fix the USB8 typedef by hand\n", program); - printf("typedef unsigned char USB8;\t/* XX%s/ -=*#*=-\n", - "X - should be 8 unsigned bits but is not *"); + printf("typedef unsigned char USB8;\t%c* XX%s%c -=*#*=-\n", + '/', "X - should be 8 unsigned bits but is not *", '/'); if (value < 1) { - printf("typedef char SB8;\t/* XX%s/ -=*#*=-\n", - "X - should be 8 signed bits but is not *"); + printf("typedef char SB8;\t%c* XX%s%c -=*#*=-\n", + '/', "X - should be 8 signed bits but is not *", '/'); } else { - printf("typedef signed char SB8;\t/* XX%s/ -=*#*=-\n", - "X - should be 8 signed bits but is not *"); + printf("typedef signed char SB8;\t%c* XX%s%c -=*#*=-\n", + '/', "X - should be 8 signed bits but is not *", '/'); } exitcode = 3; } else { - printf("typedef unsigned char USB8;\t/%s/\n", - "* unsigned 8 bits *"); + printf("typedef unsigned char USB8;\t%c%s%c\n", + '/', "* unsigned 8 bits *", '/'); if (value < 1) { - printf("typedef char SB8;\t/%s/\n", - "* signed 8 bits *"); + printf("typedef char SB8;\t%c%s%c\n", + '/', "* signed 8 bits *", '/'); } else { - printf("typedef signed char SB8;\t/%s/\n", - "* signed 8 bits *"); + printf("typedef signed char SB8;\t%c%s%c\n", + '/', "* signed 8 bits *", '/'); } } putchar('\n'); @@ -275,16 +271,16 @@ main(int argc, char **argv) "%s: OUCH!!! - short is not a 2 bytes!\n", program); fprintf(stderr, "%s: fix the USB16 typedef by hand\n", program); - printf("typedef unsigned short USB16;\t/* XX%s/ -=*#*=-\n", - "X - should be 16 unsigned bits but is not *"); - printf("typedef signed char SB16;\t/* XX%s/ -=*#*=-\n", - "X - should be 16 signed bits but is not *"); + printf("typedef unsigned short USB16;\t%c* XX%s%c -=*#*=-\n", + '/', "X - should be 16 unsigned bits but is not *", '/'); + printf("typedef signed char SB16;\t%c* XX%s%c -=*#*=-\n", + '/', "X - should be 16 signed bits but is not *", '/'); exitcode = 4; } else { - printf("typedef unsigned short USB16;\t/%s/\n", - "* unsigned 16 bits *"); - printf("typedef short SB16;\t\t/%s/\n", - "* signed 16 bits *"); + printf("typedef unsigned short USB16;\t%c%s%c\n", + '/', "* unsigned 16 bits *", '/'); + printf("typedef short SB16;\t\t%c%s%c\n", + '/', "* signed 16 bits *", '/'); } putchar('\n'); @@ -292,22 +288,22 @@ main(int argc, char **argv) * look for 32 bit values */ if (sizeof(long) == 4) { - printf("typedef unsigned long USB32;\t/%s/\n", - "* unsigned 32 bits *"); - printf("typedef long SB32;\t\t/%s/\n", - "* signed 32 bits *"); + printf("typedef unsigned long USB32;\t%c%s%c\n", + '/', "* unsigned 32 bits *", '/'); + printf("typedef long SB32;\t\t%c%s%c\n", + '/', "* signed 32 bits *", '/'); } else if (sizeof(int) == 4) { - printf("typedef unsigned int USB32;\t/%s/\n", - "* unsigned 32 bits *"); - printf("typedef int SB32;\t\t/%s/\n", - "* signed 32 bits *"); + printf("typedef unsigned int USB32;\t%c%s%c\n", + '/', "* unsigned 32 bits *", '/'); + printf("typedef int SB32;\t\t%c%s%c\n", + '/', "* signed 32 bits *", '/'); } else { fprintf(stderr, "%s: OUCH!!! - neither int nor long are 4 bytes!\n", program); - printf("typedef unsigned int USB32;\t/* XX%s/ -=*#*=-\n", - "X - should be 32 unsigned bits but is not *"); - printf("typedef signed int SB32;\t/* XX%s/ -=*#*=-\n", - "X - should be 32 signed bits but is not *"); + printf("typedef unsigned int USB32;\t%c* XX%s%c -=*#*=-\n", + '/', "X - should be 32 unsigned bits but is not *", '/'); + printf("typedef signed int SB32;\t%c* XX%s%c -=*#*=-\n", + '/', "X - should be 32 signed bits but is not *", '/'); exitcode = 5; } putchar('\n'); @@ -317,14 +313,15 @@ main(int argc, char **argv) */ if (sizeof(long) == 8) { printf("#undef HAVE_B64\n"); - printf("#define HAVE_B64\t\t/%s/\n", - "* have USB64 and SB64 types *"); - printf("typedef unsigned long USB64;\t/%s/\n", - "* unsigned 64 bits *"); - printf("typedef long SB64;\t\t/%s/\n", - "* signed 64 bits *"); + printf("#define HAVE_B64\t\t%c%s%c\n", + '/', "* have USB64 and SB64 types *", '/'); + printf("#define BOOL_B64 TRUE\n"); + printf("typedef unsigned long USB64;\t%c%s%c\n", + '/', "* unsigned 64 bits *", '/'); + printf("typedef long SB64;\t\t%c%s%c\n", + '/', "* signed 64 bits *", '/'); putchar('\n'); - printf("/%s/\n","* how to form 64 bit constants *"); + printf("%c%s%c\n", '/',"* how to form 64 bit constants *",'/'); #if defined(FORCE_STDC) || (defined(__STDC__) && __STDC__ != 0) || defined(__cplusplus) printf("#define U(x) x ## UL\n"); printf("#define L(x) x ## L\n"); @@ -335,14 +332,15 @@ main(int argc, char **argv) } else { #if defined(HAVE_LONGLONG) && LONGLONG_BITS == 64 printf("#undef HAVE_B64\n"); - printf("#define HAVE_B64\t\t/%s/\n", - "* have USB64 and SB64 types *"); - printf("typedef unsigned long long USB64;\t/%s/\n", - "* unsigned 64 bits *"); - printf("typedef long long SB64;\t\t/%s/\n", - "* signed 64 bits *"); + printf("#define HAVE_B64\t\t%c%s%c\n", + '/', "* have USB64 and SB64 types *", '/'); + printf("#define BOOL_B64 TRUE\n"); + printf("typedef unsigned long long USB64;\t%c%s%c\n", + '/', "* unsigned 64 bits *", '/'); + printf("typedef long long SB64;\t\t%c%s%c\n", + '/', "* signed 64 bits *", '/'); putchar('\n'); - printf("/%s/\n","* how to form 64 bit constants *"); + printf("%c%s%c\n", '/',"* how to form 64 bit constants *",'/'); #if defined(FORCE_STDC) || (defined(__STDC__) && __STDC__ != 0) || defined(__cplusplus) printf("#define U(x) x ## ULL\n"); printf("#define L(x) x ## LL\n"); @@ -351,10 +349,11 @@ main(int argc, char **argv) printf("#define L(x) ((long long)x)\n"); #endif #else - printf("#undef HAVE_B64\t\t\t/%s/\n", - "* we have no USB64 and no SB64 types *"); + printf("#undef HAVE_B64\t\t\t%c%s%c\n", + '/', "* we have no USB64 and no SB64 types *", '/'); + printf("#define BOOL_B64 FALSE\n"); putchar('\n'); - printf("/%s/\n", "* no 64 bit constants *"); + printf("%c%s%c\n", '/', "* no 64 bit constants *", '/'); printf("#define U(x) no 33 to 64 bit constants %s\n", "- do not use this macro!"); printf("#define L(x) no 33 to 64 bit constants %s\n", diff --git a/longlong.c b/longlong.c index a345216..ff19a25 100644 --- a/longlong.c +++ b/longlong.c @@ -1,34 +1,6 @@ /* - * longlong - determine the number of bits in a long long, if is exists + * longlong - Determine the number if bits in a long long, if is exists * - * Copyright (C) 1999 Landon Curt Noll - * - * Calc is open software; you can redistribute it and/or modify it under - * the terms of the version 2.1 of the GNU Lesser General Public License - * as published by the Free Software Foundation. - * - * Calc is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General - * Public License for more details. - * - * A copy of version 2.1 of the GNU Lesser General Public License is - * distributed with calc under the filename COPYING-LGPL. You should have - * received a copy with calc; if not, write to Free Software Foundation, Inc. - * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. - * - * @(#) $Revision: 29.1 $ - * @(#) $Id: longlong.c,v 29.1 1999/12/14 09:16:12 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/longlong.c,v $ - * - * Under source code control: 1994/08/05 01:09:19 - * File existed as early as: 1994 - * - * chongo /\oo/\ http://reality.sgi.com/chongo/ - * Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ - */ - -/* * usage: * longlong [bits] * @@ -49,6 +21,29 @@ * 0 ==> do not use long long, even if they exist * != 0 ==> bits in an unsigned long long */ +/* + * Copyright (c) 1995 by Landon Curt Noll. All Rights Reserved. + * + * Permission to use, copy, modify, and distribute this software and + * its documentation for any purpose and without fee is hereby granted, + * provided that the above copyright, this permission notice and text + * this comment, and the disclaimer below appear in all of the following: + * + * supporting documentation + * source copies + * source works derived from this source + * binaries derived from this source or from derived source + * + * LANDON CURT NOLL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO + * EVENT SHALL LANDON CURT NOLL BE LIABLE FOR ANY SPECIAL, INDIRECT OR + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF + * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR + * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. + * + * chongo was here /\../\ + */ #include @@ -75,7 +70,6 @@ int main(int argc, char **argv) { int longlong_bits; /* bits in a long long, or <=0 => dont use */ - char buf[BUFSIZ+1]; /* scan buffer */ /* * parse args @@ -106,38 +100,10 @@ main(int argc, char **argv) printf("#define LONGLONG_BITS %d /* yes */\n", longlong_bits); - printf("\n/*\n"); - printf(" * how should 64 bit values be formatted?\n"); - printf(" *\n"); - - /* it is OK to get a printf format type warning here */ - sprintf(buf, "%ld", val); - - printf(" * sprintf \"%%ld\" of 0x1234567890123456ULL " - "is %s\n", buf); - printf(" *\n"); - printf(" * if defined(L64_FORMAT), ok to use %%ld\n"); - printf(" * if !defined(L64_FORMAT), use %%lld\n"); - printf(" */\n"); - if (buf[0] == '-') { - printf("#undef L64_FORMAT\n"); - } else { - printf("#define L64_FORMAT\n"); - } - - /* - * We have no useful 64 bit values - */ - } else { - if (longlong_bits <= sizeof(unsigned long)*8) { - printf("/* long long size <= long size */\n"); - } else { - printf("/* unsigned long long constants " - "don't work */\n"); - } - printf("#undef HAVE_LONGLONG\n"); - printf("#define LONGLONG_BITS 0\t/%s/\n", "* no *"); - printf("#undef L64_FORMAT\n"); + printf("\n/* does %%lld work or does %%ld? */\n"); + printf("#if defined(CHECK_L_FORMAT)\n"); + printf("long long l_format = %ld;\n", val); + printf("#endif /* CHECK_L_FORMAT */\n"); } } /* exit(0); */ diff --git a/matfunc.c b/matfunc.c index d858552..4ab8e0c 100644 --- a/matfunc.c +++ b/matfunc.c @@ -1,33 +1,8 @@ /* - * matfunc - extended precision rational arithmetic matrix functions + * Copyright (c) 1995 David I. Bell + * Permission is granted to use, distribute, or modify this source, + * provided that this copyright notice remains intact. * - * Copyright (C) 1999 David I. Bell - * - * Calc is open software; you can redistribute it and/or modify it under - * the terms of the version 2.1 of the GNU Lesser General Public License - * as published by the Free Software Foundation. - * - * Calc is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General - * Public License for more details. - * - * A copy of version 2.1 of the GNU Lesser General Public License is - * distributed with calc under the filename COPYING-LGPL. You should have - * received a copy with calc; if not, write to Free Software Foundation, Inc. - * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. - * - * @(#) $Revision: 29.1 $ - * @(#) $Id: matfunc.c,v 29.1 1999/12/14 09:16:12 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/matfunc.c,v $ - * - * Under source code control: 1990/02/15 01:48:18 - * File existed as early as: before 1990 - * - * Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ - */ - -/* * Extended precision rational arithmetic matrix functions. * Matrices can contain arbitrary types of elements. */ diff --git a/math_error.c b/math_error.c index efa75d3..b5baef9 100644 --- a/math_error.c +++ b/math_error.c @@ -1,33 +1,29 @@ /* * math_error - a simple libcalc math error routine - * - * Copyright (C) 1999 Landon Curt Noll - * - * Calc is open software; you can redistribute it and/or modify it under - * the terms of the version 2.1 of the GNU Lesser General Public License - * as published by the Free Software Foundation. - * - * Calc is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General - * Public License for more details. - * - * A copy of version 2.1 of the GNU Lesser General Public License is - * distributed with calc under the filename COPYING-LGPL. You should have - * received a copy with calc; if not, write to Free Software Foundation, Inc. - * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. - * - * @(#) $Revision: 29.1 $ - * @(#) $Id: math_error.c,v 29.1 1999/12/14 09:16:12 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/math_error.c,v $ - * - * Under source code control: 1994/08/03 05:08:22 - * File existed as early as: 1994 - * - * chongo /\oo/\ http://reality.sgi.com/chongo/ - * Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ */ - +/* + * Copyright (c) 1997 by Landon Curt Noll. All Rights Reserved. + * + * Permission to use, copy, modify, and distribute this software and + * its documentation for any purpose and without fee is hereby granted, + * provided that the above copyright, this permission notice and text + * this comment, and the disclaimer below appear in all of the following: + * + * supporting documentation + * source copies + * source works derived from this source + * binaries derived from this source or from derived source + * + * LANDON CURT NOLL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO + * EVENT SHALL LANDON CURT NOLL BE LIABLE FOR ANY SPECIAL, INDIRECT OR + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF + * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR + * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. + * + * chongo was here /\../\ + */ /* * Your program MUST provide a function called math_error. This is called * by the math routines on an error condition, such as malloc failures or a diff --git a/math_error.h b/math_error.h index 7e899a3..617cab8 100644 --- a/math_error.h +++ b/math_error.h @@ -1,31 +1,36 @@ /* * math_error - a simple libcalc math error routine + */ +/* + * Copyright (c) 1997 by Landon Curt Noll. All Rights Reserved. * - * Copyright (C) 1999 Landon Curt Noll + * Permission to use, copy, modify, and distribute this software and + * its documentation for any purpose and without fee is hereby granted, + * provided that the above copyright, this permission notice and text + * this comment, and the disclaimer below appear in all of the following: * - * Calc is open software; you can redistribute it and/or modify it under - * the terms of the version 2.1 of the GNU Lesser General Public License - * as published by the Free Software Foundation. + * supporting documentation + * source copies + * source works derived from this source + * binaries derived from this source or from derived source * - * Calc is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General - * Public License for more details. + * LANDON CURT NOLL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO + * EVENT SHALL LANDON CURT NOLL BE LIABLE FOR ANY SPECIAL, INDIRECT OR + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF + * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR + * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. * - * A copy of version 2.1 of the GNU Lesser General Public License is - * distributed with calc under the filename COPYING-LGPL. You should have - * received a copy with calc; if not, write to Free Software Foundation, Inc. - * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. + * Comments, suggestions, bug fixes and questions about these routines + * are welcome. Send EMail to the address given below. * - * @(#) $Revision: 29.1 $ - * @(#) $Id: math_error.h,v 29.1 1999/12/14 09:16:12 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/math_error.h,v $ + * Happy bit twiddling, * - * Under source code control: 1997/03/23 18:37:10 - * File existed as early as: 1997 + * Landon Curt Noll + * http://reality.sgi.com/chongo/ * - * chongo /\oo/\ http://reality.sgi.com/chongo/ - * Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ + * chongo /\../\ */ diff --git a/md5.c b/md5.c index f242579..caf532a 100644 --- a/md5.c +++ b/md5.c @@ -1,3 +1,4 @@ +/* @(#)md5.c 12.1 17 Nov 1995 04:22:34 */ /* * md5 - RSA Data Security, Inc. MD5 Message-Digest Algorithm * @@ -9,12 +10,6 @@ * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - * - * @(#) $Revision: 29.1 $ - * @(#) $Id: md5.c,v 29.1 1999/12/14 09:16:12 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/md5.c,v $ - * - * This file is not covered under version 2.1 of the GNU LGPL. */ /* diff --git a/md5.h b/md5.h index 814d991..8d6fe14 100644 --- a/md5.h +++ b/md5.h @@ -1,3 +1,4 @@ +/* @(#)md5.h 12.1 17 Nov 1995 04:22:35 */ /* * md5 - RSA Data Security, Inc. MD5 Message-Digest Algorithm * @@ -9,12 +10,6 @@ * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - * - * @(#) $Revision: 29.1 $ - * @(#) $Id: md5.h,v 29.1 1999/12/14 09:16:12 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/md5.h,v $ - * - * This file is not covered under version 2.1 of the GNU LGPL. */ /* diff --git a/nametype.h b/nametype.h index e450ad1..5137f81 100644 --- a/nametype.h +++ b/nametype.h @@ -1,31 +1,37 @@ /* - * nametype - associate names with values + * Copyright (c) 1997 by Landon Curt Noll. All Rights Reserved. * - * Copyright (C) 1999 Landon Curt Noll + * Permission to use, copy, modify, and distribute this software and + * its documentation for any purpose and without fee is hereby granted, + * provided that the above copyright, this permission notice and text + * this comment, and the disclaimer below appear in all of the following: * - * Calc is open software; you can redistribute it and/or modify it under - * the terms of the version 2.1 of the GNU Lesser General Public License - * as published by the Free Software Foundation. + * supporting documentation + * source copies + * source works derived from this source + * binaries derived from this source or from derived source * - * Calc is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General - * Public License for more details. + * LANDON CURT NOLL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO + * EVENT SHALL LANDON CURT NOLL BE LIABLE FOR ANY SPECIAL, INDIRECT OR + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF + * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR + * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. * - * A copy of version 2.1 of the GNU Lesser General Public License is - * distributed with calc under the filename COPYING-LGPL. You should have - * received a copy with calc; if not, write to Free Software Foundation, Inc. - * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. + * Prior to calc 2.9.3t9, these routines existed as a calc library called + * cryrand.cal. They have been rewritten in C for performance as well + * as to make them available directly from libcalc.a. * - * @(#) $Revision: 29.1 $ - * @(#) $Id: nametype.h,v 29.1 1999/12/14 09:16:12 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/nametype.h,v $ + * Comments, suggestions, bug fixes and questions about these routines + * are welcome. Send EMail to the address given below. * - * Under source code control: 1997/03/08 13:44:55 - * File existed as early as: 1997 + * Happy bit twiddling, * - * chongo /\oo/\ http://reality.sgi.com/chongo/ - * Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ + * Landon Curt Noll + * http://reality.sgi.com/chongo/ + * + * chongo /\../\ */ diff --git a/obj.c b/obj.c index 3c875f7..ec1d15a 100644 --- a/obj.c +++ b/obj.c @@ -1,38 +1,13 @@ /* - * obj - object handling primitives + * Copyright (c) 1997 David I. Bell + * Permission is granted to use, distribute, or modify this source, + * provided that this copyright notice remains intact. * - * Copyright (C) 1999 David I. Bell - * - * Calc is open software; you can redistribute it and/or modify it under - * the terms of the version 2.1 of the GNU Lesser General Public License - * as published by the Free Software Foundation. - * - * Calc is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General - * Public License for more details. - * - * A copy of version 2.1 of the GNU Lesser General Public License is - * distributed with calc under the filename COPYING-LGPL. You should have - * received a copy with calc; if not, write to Free Software Foundation, Inc. - * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. - * - * @(#) $Revision: 29.1 $ - * @(#) $Id: obj.c,v 29.1 1999/12/14 09:16:12 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/obj.c,v $ - * - * Under source code control: 1990/02/15 01:48:19 - * File existed as early as: before 1990 - * - * Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ - */ -/* * "Object" handling primitives. * This simply means that user-specified routines are called to perform * the indicated operations. */ - #include #include "calc.h" #include "opcodes.h" diff --git a/opcodes.c b/opcodes.c index 54ce853..3b30ad6 100644 --- a/opcodes.c +++ b/opcodes.c @@ -1,35 +1,11 @@ /* - * opcodes - opcode execution module + * Copyright (c) 1997 David I. Bell + * Permission is granted to use, distribute, or modify this source, + * provided that this copyright notice remains intact. * - * Copyright (C) 1999 David I. Bell and Ernest Bowen - * - * Primary author: David I. Bell - * - * Calc is open software; you can redistribute it and/or modify it under - * the terms of the version 2.1 of the GNU Lesser General Public License - * as published by the Free Software Foundation. - * - * Calc is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General - * Public License for more details. - * - * A copy of version 2.1 of the GNU Lesser General Public License is - * distributed with calc under the filename COPYING-LGPL. You should have - * received a copy with calc; if not, write to Free Software Foundation, Inc. - * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. - * - * @(#) $Revision: 29.1 $ - * @(#) $Id: opcodes.c,v 29.1 1999/12/14 09:16:12 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/opcodes.c,v $ - * - * Under source code control: 1990/02/15 01:48:19 - * File existed as early as: before 1990 - * - * Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ + * Opcode execution module */ - #include #include #include diff --git a/opcodes.h b/opcodes.h index aba460f..d44aa39 100644 --- a/opcodes.h +++ b/opcodes.h @@ -1,30 +1,7 @@ /* - * opcodes - opcode execution module definition - * - * Copyright (C) 1999 David I. Bell - * - * Calc is open software; you can redistribute it and/or modify it under - * the terms of the version 2.1 of the GNU Lesser General Public License - * as published by the Free Software Foundation. - * - * Calc is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General - * Public License for more details. - * - * A copy of version 2.1 of the GNU Lesser General Public License is - * distributed with calc under the filename COPYING-LGPL. You should have - * received a copy with calc; if not, write to Free Software Foundation, Inc. - * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. - * - * @(#) $Revision: 29.1 $ - * @(#) $Id: opcodes.h,v 29.1 1999/12/14 09:16:12 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/opcodes.h,v $ - * - * Under source code control: 1990/02/15 01:48:35 - * File existed as early as: before 1990 - * - * Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ + * Copyright (c) 1997 David I. Bell + * Permission is granted to use, distribute, or modify this source, + * provided that this copyright notice remains intact. */ diff --git a/pix.c b/pix.c index 4df2fd2..068bc74 100644 --- a/pix.c +++ b/pix.c @@ -1,34 +1,27 @@ /* - * pix - number of primes less than a small value + * Copyright (c) 1995 by Landon Curt Noll. All Rights Reserved. * - * Copyright (C) 1999 Landon Curt Noll + * Permission to use, copy, modify, and distribute this software and + * its documentation for any purpose and without fee is hereby granted, + * provided that the above copyright, this permission notice and text + * this comment, and the disclaimer below appear in all of the following: * - * Calc is open software; you can redistribute it and/or modify it under - * the terms of the version 2.1 of the GNU Lesser General Public License - * as published by the Free Software Foundation. + * supporting documentation + * source copies + * source works derived from this source + * binaries derived from this source or from derived source * - * Calc is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General - * Public License for more details. + * LANDON CURT NOLL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO + * EVENT SHALL LANDON CURT NOLL BE LIABLE FOR ANY SPECIAL, INDIRECT OR + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF + * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR + * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. * - * A copy of version 2.1 of the GNU Lesser General Public License is - * distributed with calc under the filename COPYING-LGPL. You should have - * received a copy with calc; if not, write to Free Software Foundation, Inc. - * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. - * - * @(#) $Revision: 29.1 $ - * @(#) $Id: pix.c,v 29.1 1999/12/14 09:16:12 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/pix.c,v $ - * - * Under source code control: 1994/07/01 19:44:21 - * File existed as early as: 1994 - * - * chongo /\oo/\ http://reality.sgi.com/chongo/ - * Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ + * chongo was here /\../\ */ - #include "zmath.h" #include "prime.h" #include "have_const.h" diff --git a/poly.c b/poly.c index 9dcdccd..c65d085 100644 --- a/poly.c +++ b/poly.c @@ -1,36 +1,12 @@ /* - * poly - polynomial functions + * Copyright (c) 1995 Ernest Bowen and Landon Curt Noll + * Permission is granted to use, distribute, or modify this source, + * provided that this copyright notice remains intact. * - * Copyright (C) 1999 Ernest Bowen and Landon Curt Noll - * - * Primary author: Ernest Bowen - * - * Calc is open software; you can redistribute it and/or modify it under - * the terms of the version 2.1 of the GNU Lesser General Public License - * as published by the Free Software Foundation. - * - * Calc is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General - * Public License for more details. - * - * A copy of version 2.1 of the GNU Lesser General Public License is - * distributed with calc under the filename COPYING-LGPL. You should have - * received a copy with calc; if not, write to Free Software Foundation, Inc. - * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. - * - * @(#) $Revision: 29.1 $ - * @(#) $Id: poly.c,v 29.1 1999/12/14 09:16:12 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/poly.c,v $ - * - * Under source code control: 1995/12/02 03:10:28 - * File existed as early as: 1995 - * - * chongo /\oo/\ http://reality.sgi.com/chongo/ - * Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ + * By: Ernest Bowen and Landon Curt Noll + * ernie@neumann.une.edu.au and http://reality.sgi.com/chongo/ */ - #include "value.h" @@ -160,3 +136,6 @@ addlistinv(LIST *lp, VALUE *vres) return; } } + + +/* END CODE */ diff --git a/prime.c b/prime.c index b104ab0..d84c8cb 100644 --- a/prime.c +++ b/prime.c @@ -1,34 +1,27 @@ /* - * prime - quickly determine if a small number is prime + * Copyright (c) 1995 by Landon Curt Noll. All Rights Reserved. * - * Copyright (C) 1999 Landon Curt Noll + * Permission to use, copy, modify, and distribute this software and + * its documentation for any purpose and without fee is hereby granted, + * provided that the above copyright, this permission notice and text + * this comment, and the disclaimer below appear in all of the following: * - * Calc is open software; you can redistribute it and/or modify it under - * the terms of the version 2.1 of the GNU Lesser General Public License - * as published by the Free Software Foundation. + * supporting documentation + * source copies + * source works derived from this source + * binaries derived from this source or from derived source * - * Calc is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General - * Public License for more details. + * LANDON CURT NOLL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO + * EVENT SHALL LANDON CURT NOLL BE LIABLE FOR ANY SPECIAL, INDIRECT OR + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF + * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR + * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. * - * A copy of version 2.1 of the GNU Lesser General Public License is - * distributed with calc under the filename COPYING-LGPL. You should have - * received a copy with calc; if not, write to Free Software Foundation, Inc. - * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. - * - * @(#) $Revision: 29.1 $ - * @(#) $Id: prime.c,v 29.1 1999/12/14 09:16:12 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/prime.c,v $ - * - * Under source code control: 1994/06/04 03:26:14 - * File existed as early as: 1994 - * - * chongo /\oo/\ http://reality.sgi.com/chongo/ - * Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ + * chongo was here /\../\ */ - #include "qmath.h" #include "prime.h" #include "jump.h" @@ -41,7 +34,7 @@ * pr_map[i] & (1< i*16 + j*2 + 1 is prime * 0 ==> i*16 + j*2 + 1 is not prime * - * This table is useful to quickly determine if a 16 bit odd number + * This table is useful to quickly determining if a 16 bit odd number * is prime. Use the prime[] array to quickly walk thru the 16 bit * off primes. */ diff --git a/prime.h b/prime.h index b8bb567..75647de 100644 --- a/prime.h +++ b/prime.h @@ -1,31 +1,25 @@ /* - * prime - quickly determine if a small number is prime + * Copyright (c) 1997 by Landon Curt Noll. All Rights Reserved. * - * Copyright (C) 1999 Landon Curt Noll + * Permission to use, copy, modify, and distribute this software and + * its documentation for any purpose and without fee is hereby granted, + * provided that the above copyright, this permission notice and text + * this comment, and the disclaimer below appear in all of the following: * - * Calc is open software; you can redistribute it and/or modify it under - * the terms of the version 2.1 of the GNU Lesser General Public License - * as published by the Free Software Foundation. + * supporting documentation + * source copies + * source works derived from this source + * binaries derived from this source or from derived source * - * Calc is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General - * Public License for more details. + * LANDON CURT NOLL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO + * EVENT SHALL LANDON CURT NOLL BE LIABLE FOR ANY SPECIAL, INDIRECT OR + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF + * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR + * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. * - * A copy of version 2.1 of the GNU Lesser General Public License is - * distributed with calc under the filename COPYING-LGPL. You should have - * received a copy with calc; if not, write to Free Software Foundation, Inc. - * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. - * - * @(#) $Revision: 29.1 $ - * @(#) $Id: prime.h,v 29.1 1999/12/14 09:16:14 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/prime.h,v $ - * - * Under source code control: 1994/06/04 03:26:15 - * File existed as early as: 1994 - * - * chongo /\oo/\ http://reality.sgi.com/chongo/ - * Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ + * chongo was here /\../\ */ diff --git a/qfunc.c b/qfunc.c index 58d840d..8fff4d3 100644 --- a/qfunc.c +++ b/qfunc.c @@ -1,35 +1,11 @@ /* - * qfunc - extended precision rational arithmetic non-primitive functions + * Copyright (c) 1997 David I. Bell + * Permission is granted to use, distribute, or modify this source, + * provided that this copyright notice remains intact. * - * Copyright (C) 1999 David I. Bell and Ernest Bowen - * - * Primary author: David I. Bell - * - * Calc is open software; you can redistribute it and/or modify it under - * the terms of the version 2.1 of the GNU Lesser General Public License - * as published by the Free Software Foundation. - * - * Calc is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General - * Public License for more details. - * - * A copy of version 2.1 of the GNU Lesser General Public License is - * distributed with calc under the filename COPYING-LGPL. You should have - * received a copy with calc; if not, write to Free Software Foundation, Inc. - * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. - * - * @(#) $Revision: 29.1 $ - * @(#) $Id: qfunc.c,v 29.1 1999/12/14 09:16:14 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/qfunc.c,v $ - * - * Under source code control: 1990/02/15 01:48:20 - * File existed as early as: before 1990 - * - * Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ + * Extended precision rational arithmetic non-primitive functions */ - #include "qmath.h" #include "config.h" #include "prime.h" diff --git a/qio.c b/qio.c index e6c8014..b8b502e 100644 --- a/qio.c +++ b/qio.c @@ -1,33 +1,11 @@ /* - * qio - scanf and printf routines for arbitrary precision rational numbers + * Copyright (c) 1996 David I. Bell + * Permission is granted to use, distribute, or modify this source, + * provided that this copyright notice remains intact. * - * Copyright (C) 1999 David I. Bell - * - * Calc is open software; you can redistribute it and/or modify it under - * the terms of the version 2.1 of the GNU Lesser General Public License - * as published by the Free Software Foundation. - * - * Calc is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General - * Public License for more details. - * - * A copy of version 2.1 of the GNU Lesser General Public License is - * distributed with calc under the filename COPYING-LGPL. You should have - * received a copy with calc; if not, write to Free Software Foundation, Inc. - * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. - * - * @(#) $Revision: 29.1 $ - * @(#) $Id: qio.c,v 29.1 1999/12/14 09:16:14 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/qio.c,v $ - * - * Under source code control: 1993/07/30 19:42:46 - * File existed as early as: 1993 - * - * Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ + * Scanf and printf routines for arbitrary precision rational numbers */ - #include "qmath.h" #include "config.h" #include "args.h" diff --git a/qmath.c b/qmath.c index a9b12f9..64a67d0 100644 --- a/qmath.c +++ b/qmath.c @@ -1,35 +1,11 @@ /* - * qmath - extended precision rational arithmetic primitive routines + * Copyright (c) 1997 David I. Bell + * Permission is granted to use, distribute, or modify this source, + * provided that this copyright notice remains intact. * - * Copyright (C) 1999 David I. Bell and Ernest Bowen - * - * Primary author: David I. Bell - * - * Calc is open software; you can redistribute it and/or modify it under - * the terms of the version 2.1 of the GNU Lesser General Public License - * as published by the Free Software Foundation. - * - * Calc is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General - * Public License for more details. - * - * A copy of version 2.1 of the GNU Lesser General Public License is - * distributed with calc under the filename COPYING-LGPL. You should have - * received a copy with calc; if not, write to Free Software Foundation, Inc. - * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. - * - * @(#) $Revision: 29.1 $ - * @(#) $Id: qmath.c,v 29.1 1999/12/14 09:16:14 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/qmath.c,v $ - * - * Under source code control: 1990/02/15 01:48:21 - * File existed as early as: before 1990 - * - * Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ + * Extended precision rational arithmetic primitive routines */ - #include #include "qmath.h" #include "config.h" @@ -839,6 +815,10 @@ qscale(NUMBER *q, long pow) if (qiszero(q) || (pow == 0)) return qlink(q); + if ((pow > 1000000L) || (pow < -1000000L)) { + math_error("Very large scale value"); + /*NOTREACHED*/ + } numshift = zisodd(q->num) ? 0 : zlowbit(q->num); denshift = zisodd(q->den) ? 0 : zlowbit(q->den); if (pow > 0) { diff --git a/qmath.h b/qmath.h index d106d04..9eb772e 100644 --- a/qmath.h +++ b/qmath.h @@ -1,30 +1,9 @@ /* - * qmath - declarations for extended precision rational arithmetic + * Copyright (c) 1997 David I. Bell + * Permission is granted to use, distribute, or modify this source, + * provided that this copyright notice remains intact. * - * Copyright (C) 1999 David I. Bell - * - * Calc is open software; you can redistribute it and/or modify it under - * the terms of the version 2.1 of the GNU Lesser General Public License - * as published by the Free Software Foundation. - * - * Calc is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General - * Public License for more details. - * - * A copy of version 2.1 of the GNU Lesser General Public License is - * distributed with calc under the filename COPYING-LGPL. You should have - * received a copy with calc; if not, write to Free Software Foundation, Inc. - * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. - * - * @(#) $Revision: 29.1 $ - * @(#) $Id: qmath.h,v 29.1 1999/12/14 09:16:14 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/qmath.h,v $ - * - * Under source code control: 1993/07/30 19:42:47 - * File existed as early as: 1993 - * - * Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ + * Data structure declarations for extended precision rational arithmetic. */ diff --git a/qmod.c b/qmod.c index 9eb62ef..70d7d9f 100644 --- a/qmod.c +++ b/qmod.c @@ -1,35 +1,12 @@ /* - * qmod - modular arithmetic routines for normal numbers and REDC numbers + * Copyright (c) 1995 David I. Bell + * Permission is granted to use, distribute, or modify this source, + * provided that this copyright notice remains intact. * - * Copyright (C) 1999 David I. Bell and Ernest Bowen - * - * Primary author: David I. Bell - * - * Calc is open software; you can redistribute it and/or modify it under - * the terms of the version 2.1 of the GNU Lesser General Public License - * as published by the Free Software Foundation. - * - * Calc is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General - * Public License for more details. - * - * A copy of version 2.1 of the GNU Lesser General Public License is - * distributed with calc under the filename COPYING-LGPL. You should have - * received a copy with calc; if not, write to Free Software Foundation, Inc. - * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. - * - * @(#) $Revision: 29.1 $ - * @(#) $Id: qmod.c,v 29.1 1999/12/14 09:16:14 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/qmod.c,v $ - * - * Under source code control: 1991/05/22 23:15:07 - * File existed as early as: 1991 - * - * Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ + * Modular arithmetic routines for normal numbers, and also using + * the faster REDC algorithm. */ - #include #include "qmath.h" #include "config.h" diff --git a/qtrans.c b/qtrans.c index 7dbe04c..4c50c17 100644 --- a/qtrans.c +++ b/qtrans.c @@ -1,40 +1,12 @@ /* - * qtrans - transcendental functions for real numbers + * Copyright (c) 1995 David I. Bell + * Permission is granted to use, distribute, or modify this source, + * provided that this copyright notice remains intact. * - * Copyright (C) 1999 David I. Bell and Ernest Bowen - * - * Primary author: David I. Bell - * - * Calc is open software; you can redistribute it and/or modify it under - * the terms of the version 2.1 of the GNU Lesser General Public License - * as published by the Free Software Foundation. - * - * Calc is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General - * Public License for more details. - * - * A copy of version 2.1 of the GNU Lesser General Public License is - * distributed with calc under the filename COPYING-LGPL. You should have - * received a copy with calc; if not, write to Free Software Foundation, Inc. - * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. - * - * @(#) $Revision: 29.1 $ - * @(#) $Id: qtrans.c,v 29.1 1999/12/14 09:16:14 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/qtrans.c,v $ - * - * Under source code control: 1990/02/15 01:48:22 - * File existed as early as: before 1990 - * - * Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ - */ - -/* * Transcendental functions for real numbers. * These are sin, cos, exp, ln, power, cosh, sinh. */ - #include "qmath.h" HALF _qlgenum_[] = { 36744 }; @@ -173,7 +145,7 @@ qcos(NUMBER *q, NUMBER *epsilon) /*NOTREACHED*/ } if (qiszero(q)) - return qlink(&_qone_); + return qmappr(&_qone_, epsilon, 24); n = -qilog2(epsilon); if (n < 0) return qlink(&_qzero_); @@ -311,7 +283,7 @@ qsec(NUMBER *q, NUMBER *epsilon) /*NOTREACHED*/ } if (qiszero(q)) - return qlink(&_qone_); + return qmappr(&_qone_, epsilon, 24); n = qilog2(epsilon); k = (n > 0) ? 4 + n/2 : 4; for (;;) { @@ -781,22 +753,17 @@ qexp(NUMBER *q, NUMBER *epsilon) /*NOTREACHED*/ } if (qiszero(q)) - return qlink(&_qone_); + return qmappr(&_qone_, epsilon, 24); tmp1 = qmul(q, &_qlge_); - m = qtoi(tmp1); /* exp(q) < 2^(m+1) or m == MAXLONG */ + m = qtoi(tmp1) + 1; /* exp(q) < 2^m */ qfree(tmp1); - if (m > (1 << 30)) - return NULL; - n = qilog2(epsilon); /* 2^n <= epsilon < 2^(n+1) */ if (m < n) return qlink(&_qzero_); tmp1 = qqabs(q); - tmp2 = qexprel(tmp1, m - n + 1); + tmp2 = qexprel(tmp1, m - n + 2); qfree(tmp1); - if (tmp2 == NULL) - return NULL; if (qisneg(q)) { tmp1 = qinv(tmp2); qfree(tmp2); @@ -812,7 +779,6 @@ qexp(NUMBER *q, NUMBER *epsilon) * Calculate the exponential function with relative error corresponding * to a specified number of significant bits * Requires *q >= 0, bitnum >= 0. - * This returns NULL if more than 2^30 working bits would be required. */ static NUMBER * qexprel(NUMBER *q, long bitnum) @@ -838,8 +804,6 @@ qexprel(NUMBER *q, long bitnum) s = -h; n = h + s; /* n is number of squarings that will be required */ m = bitnum + n; - if (m > (1 << 30)) - return NULL; while (s > 0) { /* increasing m by ilog2(s) */ s >>= 1; m++; @@ -1022,16 +986,18 @@ qpower(NUMBER *q1, NUMBER *q2, NUMBER *epsilon) math_error("Negative power of zero"); /*NOTREACHED*/ } - if (qiszero(q2) || qisone(q1)) - return qlink(&_qone_); + if (qiszero(q2) || qisone(q1)) { + return qmappr(&_qone_, epsilon, 24L); + } if (qiszero(q1)) return qlink(&_qzero_); if (qisneg(q1)) { math_error("Negative base for qpower"); /*NOTREACHED*/ } - if (qisone(q2)) - return qmappr(q1, epsilon, 24); + if (qisone(q2)) { + return qmappr(q1, epsilon, 24L); + } if (zrel(q1->num, q1->den) < 0) { q1tmp = qinv(q1); q2tmp = qneg(q2); @@ -1040,10 +1006,11 @@ qpower(NUMBER *q1, NUMBER *q2, NUMBER *epsilon) q2tmp = qlink(q2); } if (qisone(q2tmp)) { + tmp1 = q1tmp; qfree(q2tmp); - q2tmp = qmappr(q1tmp, epsilon, 24); - qfree(q1tmp); - return q2tmp; + tmp2 = qmappr(tmp1, epsilon, 24L); + qfree(tmp1); + return tmp2; } m = qilog2(q1tmp); n = qilog2(epsilon); @@ -1076,11 +1043,6 @@ qpower(NUMBER *q1, NUMBER *q2, NUMBER *epsilon) } qfree(tmp1); qfree(tmp2); - if (m > (1 << 30)) { - qfree(q1tmp); - qfree(q2tmp); - return NULL; - } m += 1; if (m < n) { qfree(q1tmp); @@ -1102,18 +1064,10 @@ qpower(NUMBER *q1, NUMBER *q2, NUMBER *epsilon) tmp1 = qneg(tmp2); qfree(tmp2); tmp2 = qexprel(tmp1, m - n + 3); - if (tmp2 == NULL) { - qfree(tmp1); - return NULL; - } qfree(tmp1); tmp1 = qinv(tmp2); } else { tmp1 = qexprel(tmp2, m - n + 3) ; - if (tmp1 == NULL) { - qfree(tmp2); - return NULL; - } } qfree(tmp2); tmp2 = qmappr(tmp1, epsilon, 24L); @@ -1154,8 +1108,6 @@ qroot(NUMBER *q1, NUMBER *q2, NUMBER *epsilon) tmp2 = qinv(q2); tmp1 = qpower(q1, tmp2, epsilon); qfree(tmp2); - if (tmp1 == NULL) - return NULL; if (neg) { tmp2 = qneg(tmp1); qfree(tmp1); @@ -1179,8 +1131,6 @@ qcosh(NUMBER *q, NUMBER *epsilon) tmp2 = qexp(tmp1, epsilon1); qfree(tmp1); qfree(epsilon1); - if (tmp2 == NULL) - return NULL; tmp1 = qinv(tmp2); tmp3 = qqadd(tmp1, tmp2); qfree(tmp1) @@ -1210,8 +1160,6 @@ qsinh(NUMBER *q, NUMBER *epsilon) tmp2 = qexp(tmp1, epsilon1); qfree(tmp1); qfree(epsilon1); - if (tmp2 == NULL) - return NULL; tmp1 = qinv(tmp2); tmp3 = qispos(q) ? qsub(tmp2, tmp1) : qsub(tmp1, tmp2); qfree(tmp1) @@ -1227,46 +1175,29 @@ qsinh(NUMBER *q, NUMBER *epsilon) /* * Calculate the hyperbolic tangent to the nearest or next to nearest * multiple of epsilon. - * This is calculated using the formulae: - * tanh(x) = 1 or -1 for very large abs(x) - * tanh(x) = (+ or -)(1 - 2 * exp(2 * x)) for large abx(x) - * tanh(x) = (exp(2*x) - 1)/(exp(2*x) + 1) otherwise + * This is calculated using the formula: + * tanh(x) = (exp(2*x) - 1)/(exp(2*x) + 1). */ NUMBER * qtanh(NUMBER *q, NUMBER *epsilon) { NUMBER *tmp1, *tmp2, *tmp3; - long n, m; + long n; n = qilog2(epsilon); if (n > 0 || qiszero(q)) return qlink(&_qzero_); - n = -n; tmp1 = qqabs(q); - tmp2 = qmul(tmp1, &_qlge_); - m = qtoi(tmp2); /* exp(|q|) < 2^(m+1) or m == MAXLONG */ - qfree(tmp2); - if (m > 1 + n/2) { - qfree(tmp1); - return q->num.sign ? qlink(&_qnegone_) : qlink(&_qone_); - } tmp2 = qscale(tmp1, 1); qfree(tmp1); - tmp1 = qexprel(tmp2, 2 + n); + tmp1 = qexprel(tmp2, 2 - n); qfree(tmp2); - if (m > 1 + n/4) { - tmp2 = qqdiv(&_qtwo_, tmp1); - qfree(tmp1); - tmp1 = qsub(&_qone_, tmp2); - qfree(tmp2); - } else { - tmp2 = qdec(tmp1); - tmp3 = qinc(tmp1); - qfree(tmp1); - tmp1 = qqdiv(tmp2, tmp3); - qfree(tmp2); - qfree(tmp3); - } + tmp2 = qdec(tmp1); + tmp3 = qinc(tmp1); + qfree(tmp1); + tmp1 = qqdiv(tmp2, tmp3); + qfree(tmp2); + qfree(tmp3); tmp2 = qmappr(tmp1, epsilon, 24L); qfree(tmp1); if (qisneg(q)) { @@ -1347,7 +1278,7 @@ qsech(NUMBER *q, NUMBER *epsilon) /*NOTREACHED*/ } if (qiszero(q)) - return qlink(&_qone_); + return qmappr(&_qone_, epsilon, 24L); tmp1 = qqabs(q); k = 0; diff --git a/quickhash.c b/quickhash.c index 03e1cf1..aacc314 100644 --- a/quickhash.c +++ b/quickhash.c @@ -1,34 +1,33 @@ /* - * quickhash - quickly hash a calc value using a partial Fowler/Noll/Vo hash + * Copyright (c) 1997 by Landon Curt Noll. All Rights Reserved. * - * Copyright (C) 1999 Landon Curt Noll + * Permission to use, copy, modify, and distribute this software and + * its documentation for any purpose and without fee is hereby granted, + * provided that the above copyright, this permission notice and text + * this comment, and the disclaimer below appear in all of the following: * - * Calc is open software; you can redistribute it and/or modify it under - * the terms of the version 2.1 of the GNU Lesser General Public License - * as published by the Free Software Foundation. + * supporting documentation + * source copies + * source works derived from this source + * binaries derived from this source or from derived source * - * Calc is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General - * Public License for more details. + * LANDON CURT NOLL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO + * EVENT SHALL LANDON CURT NOLL BE LIABLE FOR ANY SPECIAL, INDIRECT OR + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF + * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR + * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. * - * A copy of version 2.1 of the GNU Lesser General Public License is - * distributed with calc under the filename COPYING-LGPL. You should have - * received a copy with calc; if not, write to Free Software Foundation, Inc. - * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. + * Landon Curt Noll + * http://reality.sgi.com/chongo/ * - * @(#) $Revision: 29.2 $ - * @(#) $Id: quickhash.c,v 29.2 1999/12/14 19:37:46 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/quickhash.c,v $ - * - * Under source code control: 1995/03/04 11:34:23 - * File existed as early as: 1995 - * - * chongo /\oo/\ http://reality.sgi.com/chongo/ - * Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ + * chongo /\../\ */ /* + * quickhash - quickly hash a calc value using a partial Fowler/Noll/Vo hash + * * NOTE: This file does not contain a hash interface. It is used by * associative arrays and other internal processes. * @@ -53,7 +52,6 @@ * for information on 32bit and 64bit Fowler/Noll/Vo hashs. */ - #include "value.h" #include "zrand.h" #include "zrandom.h" @@ -411,13 +409,10 @@ config_hash(CONFIG *cfg, QCKHASH val) value = (((value>>5) | (value<<27)) ^ (USB32)cfg->blkbase); value = (((value>>5) | (value<<27)) ^ (USB32)cfg->blkfmt); value = (((value>>5) | (value<<27)) ^ (USB32)cfg->calc_debug); - value = (((value>>5) | (value<<27)) ^ (USB32)cfg->resource_debug); + value = (((value>>5) | (value<<27)) ^ (USB32)cfg->lib_debug); value = (((value>>5) | (value<<27)) ^ (USB32)cfg->user_debug); value = (((value>>5) | (value<<27)) ^ (USB32)cfg->verbose_quit); value = (((value>>5) | (value<<27)) ^ (USB32)cfg->ctrl_d); - /* program is handeled out of order */ - /* basename is handeled out of order */ - /* version is handeled out of order */ /* * hash the built up scalar @@ -433,15 +428,6 @@ config_hash(CONFIG *cfg, QCKHASH val) if (cfg->prompt2) { val = fnv_strhash(cfg->prompt2, val); } - if (cfg->program) { - val = fnv_strhash(cfg->program, val); - } - if (cfg->base_name) { - val = fnv_strhash(cfg->base_name, val); - } - if (cfg->version) { - val = fnv_strhash(cfg->version, val); - } /* * hash the epsilon if possible diff --git a/sample/Makefile b/sample/Makefile index 8cf410a..63338f1 100644 --- a/sample/Makefile +++ b/sample/Makefile @@ -1,34 +1,35 @@ # # sample - makefile for calc sample programs # -# Copyright (C) 1999 Landon Curt Noll +# Copyright (c) 1997 Landon Curt Noll # -# Calc is open software; you can redistribute it and/or modify it under -# the terms of the version 2.1 of the GNU Lesser General Public License -# as published by the Free Software Foundation. +# Permission to use, copy, modify, and distribute this software and +# its documentation for any purpose and without fee is hereby granted, +# provided that the above copyright, this permission notice and text +# this comment, and the disclaimer below appear in all of the following: # -# Calc is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -# Public License for more details. +# supporting documentation +# source copies +# source works derived from this source +# binaries derived from this source or from derived source # -# A copy of version 2.1 of the GNU Lesser General Public License is -# distributed with calc under the filename COPYING-LGPL. You should have -# received a copy with calc; if not, write to Free Software Foundation, Inc. -# 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. +# LANDON CURT NOLL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, +# INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO +# EVENT SHALL LANDON CURT NOLL BE LIABLE FOR ANY SPECIAL, INDIRECT OR +# CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF +# USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +# OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +# PERFORMANCE OF THIS SOFTWARE. # -# @(#) $Revision: 29.1 $ -# @(#) $Id: Makefile,v 29.1 1999/12/14 09:16:15 chongo Exp $ -# @(#) $Source: /usr/local/src/cmd/calc/sample/RCS/Makefile,v $ +# Comments, suggestions, bug fixes and questions about these routines +# are welcome. Send EMail to the address given below. # -# Under source code control: 1997/04/19 22:46:49 -# File existed as early as: 1997 +# Happy bit twiddling, # -# chongo /\oo/\ http://reality.sgi.com/chongo/ -# Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ +# Landon Curt Noll +# http://reality.sgi.com/chongo/ # -# calculator by David I. Bell with help/mods from others -# Makefile by Landon Curt Noll +# chongo /\../\ ############################################################################## #-=-=-=-=-=-=-=-=- You may want to change some values below -=-=-=-=-=-=-=-=-# @@ -142,7 +143,7 @@ NO_SHARED= # a default here just in case you want to build from this directory. # # Some systems require one to use ranlib to add a symbol table to -# a *.a link library. Set RANLIB to the utility that performs this action. +# a *.a library. Set RANLIB to the utility that performs this action. # Set RANLIB to : if your system does not need such a utility. # #RANLIB=ranlib @@ -191,7 +192,7 @@ ALLOW_CUSTOM= -DCUSTOM # a default here just in case you want to build from this directory. # # The sample routines need to be compiled with libcalc.a. The ${CALC_LIBS} -# variable tells where this link library may be found +# variable tells where this library may be found # # CALC_LIBS= ../libcalc.a ... # compile with libcalc.a in dir above # CALC_LIBS= ${LIBDIR}/libcalc.a ... # compile the installed libcalc.a @@ -212,6 +213,7 @@ CALC_LIBS= ../libcalc.a ../custom/libcustcalc.a # CFLAGS are all flags given to ${CC} [[often includes CCOPT, CCWARN, CCMISC]] # ICFLAGS are given to ${CC} for intermediate progs # +# LCFLAGS are CC-style flags for ${LINT} # LDFLAGS are flags given to ${CC} for linking .o files # ILDFLAGS are flags given to ${CC} for linking .o files for intermediate progs # @@ -235,6 +237,7 @@ CCMISC= CFLAGS= ${CCWARN} ${CCOPT} ${CCMISC} ICFLAGS= ${CCWARN} ${CCMISC} # +LCFLAGS= LDFLAGS= ${NO_SHARED} ${LD_NO_SHARED} ILDFLAGS= # @@ -260,7 +263,7 @@ H_SRC= ${SAMPLE_H_SRC} # DISTLIST= ${C_SRC} ${H_SRC} ${MAKE_FILE} README_SAMPLE -# These files are used to make (but not built) a calc .a link library +# These files are used to make (but not built) a calc .a library # CALCLIBLIST= ${C_SRC} ${H_SRC} ${MAKE_FILE} README_SAMPLE @@ -270,14 +273,9 @@ TARGETS= many_random test_random # required vars # -SHELL= /bin/sh -MAKE_FILE= Makefile - -# standard tools -# +SHELL = /bin/sh SED= sed MAKEDEPEND= makedepend -CHMOD= chmod SORT= sort ## diff --git a/sample/README_SAMPLE b/sample/README_SAMPLE index 97d5231..3ff9941 100644 --- a/sample/README_SAMPLE +++ b/sample/README_SAMPLE @@ -1,6 +1,3 @@ -Sample usage of libcalc.a -------------------------- - This directory contains a few examples of how to use libcalc.a. For more details on how to use libcalc.a, see the file ../LIBRARY. @@ -53,29 +50,3 @@ many_random bitlen number of random bits per line set (default: 128 bits) seed_string seed using this ASCII string (default: use default seed) - -## Copyright (C) 1999 Landon Curt Noll -## -## Calc is open software; you can redistribute it and/or modify it under -## the terms of the version 2.1 of the GNU Lesser General Public License -## as published by the Free Software Foundation. -## -## Calc is distributed in the hope that it will be useful, but WITHOUT -## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -## Public License for more details. -## -## A copy of version 2.1 of the GNU Lesser General Public License is -## distributed with calc under the filename COPYING-LGPL. You should have -## received a copy with calc; if not, write to Free Software Foundation, Inc. -## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -## -## @(#) $Revision: 29.1 $ -## @(#) $Id: README_SAMPLE,v 29.1 1999/12/14 09:16:15 chongo Exp $ -## @(#) $Source: /usr/local/src/cmd/calc/sample/RCS/README_SAMPLE,v $ -## -## Under source code control: 1997/04/19 23:15:42 -## File existed as early as: 1997 -## -## chongo /\oo/\ http://reality.sgi.com/chongo/ -## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ diff --git a/sample/many_random.c b/sample/many_random.c index 93fb48b..5efc427 100644 --- a/sample/many_random.c +++ b/sample/many_random.c @@ -1,34 +1,6 @@ /* * many_random - generate many random values via random number generator * - * Copyright (C) 1999 Landon Curt Noll - * - * Calc is open software; you can redistribute it and/or modify it under - * the terms of the version 2.1 of the GNU Lesser General Public License - * as published by the Free Software Foundation. - * - * Calc is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General - * Public License for more details. - * - * A copy of version 2.1 of the GNU Lesser General Public License is - * distributed with calc under the filename COPYING-LGPL. You should have - * received a copy with calc; if not, write to Free Software Foundation, Inc. - * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. - * - * @(#) $Revision: 29.1 $ - * @(#) $Id: many_random.c,v 29.1 1999/12/14 09:16:15 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/sample/RCS/many_random.c,v $ - * - * Under source code control: 1997/04/19 22:46:49 - * File existed as early as: 1997 - * - * chongo /\oo/\ http://reality.sgi.com/chongo/ - * Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ - */ - -/* * usage: * many_random [[bits] seed_string] * @@ -36,6 +8,30 @@ * bits number of bits to generate */ +/* + * Copyright (c) 1997 by Landon Curt Noll. All Rights Reserved. + * + * Permission to use, copy, modify, and distribute this software and + * its documentation for any purpose and without fee is hereby granted, + * provided that the above copyright, this permission notice and text + * this comment, and the disclaimer below appear in all of the following: + * + * supporting documentation + * source copies + * source works derived from this source + * binaries derived from this source or from derived source + * + * LANDON CURT NOLL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO + * EVENT SHALL LANDON CURT NOLL BE LIABLE FOR ANY SPECIAL, INDIRECT OR + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF + * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR + * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. + * + * chongo was here /\../\ + */ + #include #include diff --git a/sample/test_random.c b/sample/test_random.c index fbd5386..b39f12c 100644 --- a/sample/test_random.c +++ b/sample/test_random.c @@ -1,34 +1,6 @@ /* * test_random - test the libcalc random number generator * - * Copyright (C) 1999 Landon Curt Noll - * - * Calc is open software; you can redistribute it and/or modify it under - * the terms of the version 2.1 of the GNU Lesser General Public License - * as published by the Free Software Foundation. - * - * Calc is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General - * Public License for more details. - * - * A copy of version 2.1 of the GNU Lesser General Public License is - * distributed with calc under the filename COPYING-LGPL. You should have - * received a copy with calc; if not, write to Free Software Foundation, Inc. - * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. - * - * @(#) $Revision: 29.1 $ - * @(#) $Id: test_random.c,v 29.1 1999/12/14 09:16:15 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/sample/RCS/test_random.c,v $ - * - * Under source code control: 1997/04/19 22:46:49 - * File existed as early as: 1997 - * - * chongo /\oo/\ http://reality.sgi.com/chongo/ - * Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ - */ - -/* * usage: * test_random [[bits] seed_string] * @@ -36,6 +8,30 @@ * bits number of bits to generate */ +/* + * Copyright (c) 1997 by Landon Curt Noll. All Rights Reserved. + * + * Permission to use, copy, modify, and distribute this software and + * its documentation for any purpose and without fee is hereby granted, + * provided that the above copyright, this permission notice and text + * this comment, and the disclaimer below appear in all of the following: + * + * supporting documentation + * source copies + * source works derived from this source + * binaries derived from this source or from derived source + * + * LANDON CURT NOLL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO + * EVENT SHALL LANDON CURT NOLL BE LIABLE FOR ANY SPECIAL, INDIRECT OR + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF + * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR + * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. + * + * chongo was here /\../\ + */ + #include #include diff --git a/seed.c b/seed.c index ca2a9e1..3ea0126 100644 --- a/seed.c +++ b/seed.c @@ -1,43 +1,41 @@ /* * seed - produce a pseudo-random seeds * - * Copyright (C) 1999 Landon Curt Noll - * - * Calc is open software; you can redistribute it and/or modify it under - * the terms of the version 2.1 of the GNU Lesser General Public License - * as published by the Free Software Foundation. - * - * Calc is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General - * Public License for more details. - * - * A copy of version 2.1 of the GNU Lesser General Public License is - * distributed with calc under the filename COPYING-LGPL. You should have - * received a copy with calc; if not, write to Free Software Foundation, Inc. - * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. - * - * @(#) $Revision: 29.1 $ - * @(#) $Id: seed.c,v 29.1 1999/12/14 09:16:15 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/seed.c,v $ - * - * Under source code control: 1999/10/03 10:06:53 - * File existed as early as: 1999 - * - * chongo /\oo/\ http://reality.sgi.com/chongo/ - * Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ - */ - -/* * Generate a quasi-random seed based on system and process information. * * NOTE: This is not a good source of chaotic data. The lavarand * system does a much better job of that. See: * * http://lavarand.sgi.com/index.html + * + * Copyright (c) 1999 by Landon Curt Noll. All Rights Reserved. + * + * Permission to use, copy, modify, and distribute this software and + * its documentation for any purpose and without fee is hereby granted, + * provided that the above copyright, this permission notice and text + * this comment, and the disclaimer below appear in all of the following: + * + * supporting documentation + * source copies + * source works derived from this source + * binaries derived from this source or from derived source + * + * LANDON CURT NOLL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO + * EVENT SHALL LANDON CURT NOLL BE LIABLE FOR ANY SPECIAL, INDIRECT OR + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF + * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR + * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. + * + * Landon Curt Noll + * http://reality.sgi.com/chongo/ + * + * chongo /\../\ + * + * Share and enjoy! :-) */ - #include #include #include @@ -281,7 +279,7 @@ pseudo_seed(void) prid_t getprid; /* project ID */ #endif /* HAVE_GETPRID */ #if defined(HAVE_URANDOM) - int urandom_fd; /* open descriptor for /dev/urandom */ + int urandom_fd; /* open scriptor for /dev/urandom */ int urandom_ret; /* read() of /dev/random */ char urandom_pool[DEV_URANDOM_POOL]; /* /dev/urandom data pool */ #endif /* HAVE_URANDOM */ diff --git a/shs.c b/shs.c index 85eef37..a779956 100644 --- a/shs.c +++ b/shs.c @@ -31,12 +31,6 @@ * Based on Version 2.11 (09 Mar 1995) from Landon Curt Noll's * (http://reality.sgi.com/chongo/) shs hash program. * - * @(#) $Revision: 29.1 $ - * @(#) $Id: shs.c,v 29.1 1999/12/14 09:16:15 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/shs.c,v $ - * - * This file is not covered under version 2.1 of the GNU LGPL. - * **** * * The SHS algorithm hashes 32 bit unsigned values, 16 at a time. diff --git a/shs.h b/shs.h index 758817c..8aa6be8 100644 --- a/shs.h +++ b/shs.h @@ -27,12 +27,6 @@ * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - * - * @(#) $Revision: 29.1 $ - * @(#) $Id: shs.h,v 29.1 1999/12/14 09:16:15 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/shs.h,v $ - * - * This file is not covered under version 2.1 of the GNU LGPL. */ diff --git a/shs1.c b/shs1.c index 4844516..58ba093 100644 --- a/shs1.c +++ b/shs1.c @@ -3,7 +3,7 @@ * * Written 2 September 1992, Peter C. Gutmann. * - * This file has been extensively modified by: + * This file was Modified/Re-written by: * * Landon Curt Noll * http://reality.sgi.com/chongo/ @@ -21,15 +21,8 @@ * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - * - * @(#) $Revision: 29.1 $ - * @(#) $Id: shs1.c,v 29.1 1999/12/14 09:16:15 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/shs1.c,v $ - * - * This file is not covered under version 2.1 of the GNU LGPL. */ - #include #include "longbits.h" #include "align32.h" diff --git a/shs1.h b/shs1.h index bdfe41d..94096f1 100644 --- a/shs1.h +++ b/shs1.h @@ -3,7 +3,7 @@ * * Written 2 September 1992, Peter C. Gutmann. * - * This file and been extensively modified by: + * This file was Modified by: * * Landon Curt Noll * http://reality.sgi.com/chongo/ @@ -21,12 +21,6 @@ * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - * - * @(#) $Revision: 29.1 $ - * @(#) $Id: shs1.h,v 29.1 1999/12/14 09:16:15 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/shs1.h,v $ - * - * This file is not covered under version 2.1 of the GNU LGPL. */ diff --git a/size.c b/size.c index 8bc29c2..b8edeea 100644 --- a/size.c +++ b/size.c @@ -1,30 +1,9 @@ /* - * size - size and sizeof functions are implemented here + * Copyright (c) 1997 David I. Bell + * Permission is granted to use, distribute, or modify this source, + * provided that this copyright notice remains intact. * - * Copyright (C) 1999 David I. Bell - * - * Calc is open software; you can redistribute it and/or modify it under - * the terms of the version 2.1 of the GNU Lesser General Public License - * as published by the Free Software Foundation. - * - * Calc is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General - * Public License for more details. - * - * A copy of version 2.1 of the GNU Lesser General Public License is - * distributed with calc under the filename COPYING-LGPL. You should have - * received a copy with calc; if not, write to Free Software Foundation, Inc. - * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. - * - * @(#) $Revision: 29.1 $ - * @(#) $Id: size.c,v 29.1 1999/12/14 09:16:15 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/size.c,v $ - * - * Under source code control: 1997/03/10 01:56:51 - * File existed as early as: 1997 - * - * Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ + * Size and sizeof functions are implemented here */ diff --git a/string.c b/string.c index bc5442f..b279d26 100644 --- a/string.c +++ b/string.c @@ -1,35 +1,11 @@ /* - * string - string list routines + * Copyright (c) 1997 David I. Bell + * Permission is granted to use, distribute, or modify this source, + * provided that this copyright notice remains intact. * - * Copyright (C) 1999 David I. Bell and Ernest Bowen - * - * Primary author: David I. Bell - * - * Calc is open software; you can redistribute it and/or modify it under - * the terms of the version 2.1 of the GNU Lesser General Public License - * as published by the Free Software Foundation. - * - * Calc is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General - * Public License for more details. - * - * A copy of version 2.1 of the GNU Lesser General Public License is - * distributed with calc under the filename COPYING-LGPL. You should have - * received a copy with calc; if not, write to Free Software Foundation, Inc. - * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. - * - * @(#) $Revision: 29.1 $ - * @(#) $Id: string.c,v 29.1 1999/12/14 09:16:16 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/string.c,v $ - * - * Under source code control: 1990/02/15 01:48:10 - * File existed as early as: before 1990 - * - * Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ + * String list routines. */ - #include #include "calc.h" #include "string.h" diff --git a/string.h b/string.h index 1051445..2d26ec7 100644 --- a/string.h +++ b/string.h @@ -1,30 +1,7 @@ /* - * string - string list routines - * - * Copyright (C) 1999 David I. Bell - * - * Calc is open software; you can redistribute it and/or modify it under - * the terms of the version 2.1 of the GNU Lesser General Public License - * as published by the Free Software Foundation. - * - * Calc is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General - * Public License for more details. - * - * A copy of version 2.1 of the GNU Lesser General Public License is - * distributed with calc under the filename COPYING-LGPL. You should have - * received a copy with calc; if not, write to Free Software Foundation, Inc. - * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. - * - * @(#) $Revision: 29.1 $ - * @(#) $Id: string.h,v 29.1 1999/12/14 09:16:16 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/string.h,v $ - * - * Under source code control: 1990/02/15 01:48:36 - * File existed as early as: before 1990 - * - * Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ + * Copyright (c) 1997 David I. Bell + * Permission is granted to use, distribute, or modify this source, + * provided that this copyright notice remains intact. */ diff --git a/symbol.c b/symbol.c index 7d73d5c..0ecb780 100644 --- a/symbol.c +++ b/symbol.c @@ -1,35 +1,11 @@ /* - * symbol - global and local symbol routines + * Copyright (c) 1997 David I. Bell + * Permission is granted to use, distribute, or modify this source, + * provided that this copyright notice remains intact. * - * Copyright (C) 1999 David I. Bell and Ernest Bowen - * - * Primary author: David I. Bell - * - * Calc is open software; you can redistribute it and/or modify it under - * the terms of the version 2.1 of the GNU Lesser General Public License - * as published by the Free Software Foundation. - * - * Calc is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General - * Public License for more details. - * - * A copy of version 2.1 of the GNU Lesser General Public License is - * distributed with calc under the filename COPYING-LGPL. You should have - * received a copy with calc; if not, write to Free Software Foundation, Inc. - * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. - * - * @(#) $Revision: 29.1 $ - * @(#) $Id: symbol.c,v 29.1 1999/12/14 09:16:16 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/symbol.c,v $ - * - * Under source code control: 1990/02/15 01:48:23 - * File existed as early as: before 1990 - * - * Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ + * Global and local symbol routines. */ - #include #include "calc.h" #include "token.h" diff --git a/symbol.h b/symbol.h index 4b23d37..3263ecc 100644 --- a/symbol.h +++ b/symbol.h @@ -1,30 +1,7 @@ /* - * symbol - global and local symbol routines - * - * Copyright (C) 1999 David I. Bell - * - * Calc is open software; you can redistribute it and/or modify it under - * the terms of the version 2.1 of the GNU Lesser General Public License - * as published by the Free Software Foundation. - * - * Calc is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General - * Public License for more details. - * - * A copy of version 2.1 of the GNU Lesser General Public License is - * distributed with calc under the filename COPYING-LGPL. You should have - * received a copy with calc; if not, write to Free Software Foundation, Inc. - * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. - * - * @(#) $Revision: 29.1 $ - * @(#) $Id: symbol.h,v 29.1 1999/12/14 09:16:16 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/symbol.h,v $ - * - * Under source code control: 1990/02/15 01:48:37 - * File existed as early as: before 1990 - * - * Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ + * Copyright (c) 1997 David I. Bell + * Permission is granted to use, distribute, or modify this source, + * provided that this copyright notice remains intact. */ diff --git a/token.c b/token.c index a8bcb7c..7c5df66 100644 --- a/token.c +++ b/token.c @@ -1,32 +1,9 @@ /* - * token - read input file characters into tokens + * Copyright (c) 1997 David I. Bell + * Permission is granted to use, distribute, or modify this source, + * provided that this copyright notice remains intact. * - * Copyright (C) 1999 David I. Bell and Ernest Bowen - * - * Primary author: David I. Bell - * - * Calc is open software; you can redistribute it and/or modify it under - * the terms of the version 2.1 of the GNU Lesser General Public License - * as published by the Free Software Foundation. - * - * Calc is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General - * Public License for more details. - * - * A copy of version 2.1 of the GNU Lesser General Public License is - * distributed with calc under the filename COPYING-LGPL. You should have - * received a copy with calc; if not, write to Free Software Foundation, Inc. - * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. - * - * @(#) $Revision: 29.1 $ - * @(#) $Id: token.c,v 29.1 1999/12/14 09:16:16 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/token.c,v $ - * - * Under source code control: 1990/02/15 01:48:25 - * File existed as early as: before 1990 - * - * Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ + * Read input file characters into tokens */ @@ -113,7 +90,6 @@ static struct keyword keywords[] = { static void eatcomment(void); static void eatstring(int quotechar); -static void eatline(void); static int eatsymbol(void); static int eatnumber(void); @@ -178,8 +154,7 @@ gettoken(void) type = T_NULL; while (type == T_NULL) { ch = nextchar(); - if (allsyms && ((ch!=' ') && - (ch!=';') && (ch!='"') && (ch!='\n'))) { + if (allsyms && ((ch!=' ') && (ch!=';') && (ch!='"') && (ch!='\n'))) { reread(); type = eatsymbol(); break; @@ -244,10 +219,8 @@ gettoken(void) case '=': type = T_MULTEQUALS; break; case '*': switch (nextchar()) { - case '=': - type = T_POWEREQUALS; break; - default: - type = T_POWER; reread(); + case '=': type = T_POWEREQUALS; break; + default: type = T_POWER; reread(); } break; default: type = T_MULT; reread(); @@ -257,13 +230,8 @@ gettoken(void) switch (nextchar()) { case '/': switch (nextchar()) { - case '=': - type = T_SLASHSLASHEQUALS; - break; - default: - reread(); - type = T_SLASHSLASH; - break; + case '=': type = T_SLASHSLASHEQUALS; break; + default: reread(); type = T_SLASHSLASH; break; } break; case '=': type = T_DIVEQUALS; break; @@ -282,13 +250,8 @@ gettoken(void) case '=': type = T_LE; break; case '<': switch (nextchar()) { - case '=': - type = T_LSHIFTEQUALS; - break; - default: - reread(); - type = T_LEFTSHIFT; - break; + case '=': type = T_LSHIFTEQUALS; break; + default: reread(); type = T_LEFTSHIFT; break; } break; default: type = T_LT; reread(); @@ -299,13 +262,8 @@ gettoken(void) case '=': type = T_GE; break; case '>': switch (nextchar()) { - case '=': - type = T_RSHIFTEQUALS; - break; - default: - reread(); - type = T_RIGHTSHIFT; - break; + case '=': type = T_RSHIFTEQUALS; break; + default: reread(); type = T_RIGHTSHIFT; break; } break; default: type = T_GT; reread(); @@ -334,12 +292,6 @@ gettoken(void) case '#': switch(nextchar()) { case '=': type = T_HASHEQUALS; break; - case '!': type = T_POUNDBANG; eatline(); break; - case ' ': type = T_POUNDCOMMENT; eatline(); - break; - case '\t': type = T_POUNDCOMMENT; eatline(); - break; - case '\n': type = T_POUNDCOMMENT; break; default: type = T_HASH; reread(); } break; @@ -402,23 +354,6 @@ eatcomment(void) } -/* - * Continue to eat up a the current line - * Typically a #! will require the rest of the line to be eaten as if - * it were a comment. - */ -static void -eatline(void) -{ - int ch; /* chars being eaten */ - - do { - ch = nextchar(); - } while (ch != '\n' && ch != EOF && ch != '\0'); - reread(); -} - - /* * Read in a string and add it to the literal string pool. * The leading single or double quote has been read in at this point. @@ -450,8 +385,7 @@ eatstring(int quotechar) break; case EOF: reread(); - scanerror(T_NULL, - "Unterminated string constant"); + scanerror(T_NULL, "Unterminated string constant"); done = TRUE; ch = '\0'; break; @@ -769,3 +703,5 @@ scanerror(int skip, char *fmt, ...) } } } + +/* END CODE */ diff --git a/token.h b/token.h index 25cc689..80ab300 100644 --- a/token.h +++ b/token.h @@ -1,30 +1,7 @@ /* - * token - token defines - * - * Copyright (C) 1999 David I. Bell - * - * Calc is open software; you can redistribute it and/or modify it under - * the terms of the version 2.1 of the GNU Lesser General Public License - * as published by the Free Software Foundation. - * - * Calc is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General - * Public License for more details. - * - * A copy of version 2.1 of the GNU Lesser General Public License is - * distributed with calc under the filename COPYING-LGPL. You should have - * received a copy with calc; if not, write to Free Software Foundation, Inc. - * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. - * - * @(#) $Revision: 29.1 $ - * @(#) $Id: token.h,v 29.1 1999/12/14 09:16:16 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/token.h,v $ - * - * Under source code control: 1990/02/15 01:48:37 - * File existed as early as: before 1990 - * - * Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ + * Copyright (c) 1997 David I. Bell + * Permission is granted to use, distribute, or modify this source, + * provided that this copyright notice remains intact. */ @@ -74,7 +51,7 @@ #define T_COMMA 33 /* comma "," */ #define T_ANDAND 34 /* logical and "&&" */ #define T_OROR 35 /* logical or "||" */ -#define T_OLDVALUE 36 /* old value from prev calculation */ +#define T_OLDVALUE 36 /* old value from previous calculation */ #define T_SLASHSLASH 37 /* integer divide "//" */ #define T_NEWLINE 38 /* newline character */ #define T_SLASHSLASHEQUALS 39 /* integer divide equals "//=" */ @@ -102,8 +79,6 @@ #define T_TILDEEQUALS 61 /* tilde equals "~=" */ #define T_BACKSLASH 62 /* backslash or setminus "\" */ #define T_BACKSLASHEQUALS 63 /* backslash equals "\=" */ -#define T_POUNDBANG 64 /* #!/usr/local/bin/calc comment */ -#define T_POUNDCOMMENT 65 /* #[whitespace] comment */ /* diff --git a/value.c b/value.c index 05e362b..24439f4 100644 --- a/value.c +++ b/value.c @@ -1,33 +1,11 @@ /* - * value - generic value manipulation routines + * Copyright (c) 1997 David I. Bell + * Permission is granted to use, distribute, or modify this source, + * provided that this copyright notice remains intact. * - * Copyright (C) 1999 David I. Bell - * - * Calc is open software; you can redistribute it and/or modify it under - * the terms of the version 2.1 of the GNU Lesser General Public License - * as published by the Free Software Foundation. - * - * Calc is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General - * Public License for more details. - * - * A copy of version 2.1 of the GNU Lesser General Public License is - * distributed with calc under the filename COPYING-LGPL. You should have - * received a copy with calc; if not, write to Free Software Foundation, Inc. - * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. - * - * @(#) $Revision: 29.1 $ - * @(#) $Id: value.c,v 29.1 1999/12/14 09:16:16 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/value.c,v $ - * - * Under source code control: 1990/02/15 01:48:25 - * File existed as early as: before 1990 - * - * Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ + * Generic value manipulation routines. */ - #include #include #include "value.h" @@ -1625,10 +1603,11 @@ sqrtvalue(VALUE *v1, VALUE *v2, VALUE *v3, VALUE *vres) void rootvalue(VALUE *v1, VALUE *v2, VALUE *v3, VALUE *vres) { - NUMBER *q2, *q3; - COMPLEX ctmp; + NUMBER *q1, *q2; + COMPLEX *ctmp; COMPLEX *c; + vres->v_type = v1->v_type; vres->v_subtype = V_NOSUBTYPE; if (v1->v_type < 0) { copyvalue(v1, vres); @@ -1638,8 +1617,8 @@ rootvalue(VALUE *v1, VALUE *v2, VALUE *v3, VALUE *vres) *vres = error_value(E_ROOT2); return; } - q2 = v2->v_num; - if (qisneg(q2) || qiszero(q2) || qisfrac(q2)) { + q1 = v2->v_num; + if (qisneg(q1) || qiszero(q1) || qisfrac(q1)) { *vres = error_value(E_ROOT2); return; } @@ -1647,23 +1626,22 @@ rootvalue(VALUE *v1, VALUE *v2, VALUE *v3, VALUE *vres) *vres = error_value(E_ROOT3); return; } - q3 = v3->v_num; + q2 = v3->v_num; switch (v1->v_type) { case V_NUM: - if (!qisneg(v1->v_num)) { - vres->v_num = qroot(v1->v_num, q2, q3); - if (vres->v_num == NULL) - *vres = error_value(E_ROOT4); - vres->v_type = V_NUM; + if (!qisneg(v1->v_num) || zisodd(q1->num)) { + vres->v_num = qroot(v1->v_num, q1, q2); return; } - ctmp.real = v1->v_num; - ctmp.imag = &_qzero_; - ctmp.links = 1; - c = croot(&ctmp, q2, q3); + ctmp = comalloc(); + qfree(ctmp->real); + ctmp->real = v1->v_num; + vres->v_com = croot(ctmp, q1, q2); + comfree(ctmp); + vres->v_type = V_COM; break; case V_COM: - c = croot(v1->v_com, q2, q3); + vres->v_com = croot(v1->v_com, q1, q2); break; case V_OBJ: *vres = objcall(OBJ_ROOT, v1, v2, v3); @@ -1672,12 +1650,7 @@ rootvalue(VALUE *v1, VALUE *v2, VALUE *v3, VALUE *vres) *vres = error_value(E_ROOT); return; } - if (c == NULL) { - *vres = error_value(E_ROOT4); - return; - } - vres->v_com = c; - vres->v_type = V_COM; + c = vres->v_com; if (cisreal(c)) { vres->v_num = qlink(c->real); vres->v_type = V_NUM; @@ -1979,7 +1952,7 @@ void powervalue(VALUE *v1, VALUE *v2, VALUE *v3, VALUE *vres) { NUMBER *epsilon; - COMPLEX *c, ctmp1, ctmp2; + COMPLEX *c, ctmp; vres->v_subtype = V_NOSUBTYPE; if (v1->v_type < 0) { @@ -2000,37 +1973,25 @@ powervalue(VALUE *v1, VALUE *v2, VALUE *v3, VALUE *vres) return; } epsilon = v3->v_num; + vres->v_type = v1->v_type; switch (TWOVAL(v1->v_type, v2->v_type)) { case TWOVAL(V_NUM, V_NUM): - if (qisneg(v1->v_num)) { - ctmp1.real = v1->v_num; - ctmp1.imag = &_qzero_; - ctmp1.links = 1; - ctmp2.real = v2->v_num; - ctmp2.imag = &_qzero_; - ctmp2.links = 1; - c = cpower(&ctmp1, &ctmp2, epsilon); - break; - } vres->v_num = qpower(v1->v_num, v2->v_num, epsilon); - vres->v_type = V_NUM; - if (vres->v_num == NULL) - *vres = error_value(E_POWER4); return; case TWOVAL(V_NUM, V_COM): - ctmp1.real = v1->v_num; - ctmp1.imag = &_qzero_; - ctmp1.links = 1; - c = cpower(&ctmp1, v2->v_com, epsilon); + ctmp.real = v1->v_num; + ctmp.imag = &_qzero_; + ctmp.links = 1; + vres->v_com = cpower(&ctmp, v2->v_com, epsilon); break; case TWOVAL(V_COM, V_NUM): - ctmp2.real = v2->v_num; - ctmp2.imag = &_qzero_; - ctmp2.links = 1; - c = cpower(v1->v_com, &ctmp2, epsilon); + ctmp.real = v2->v_num; + ctmp.imag = &_qzero_; + ctmp.links = 1; + vres->v_com = cpower(v1->v_com, &ctmp, epsilon); break; case TWOVAL(V_COM, V_COM): - c = cpower(v1->v_com, v2->v_com, epsilon); + vres->v_com = cpower(v1->v_com, v2->v_com, epsilon); break; default: *vres = error_value(E_POWER); @@ -2040,12 +2001,12 @@ powervalue(VALUE *v1, VALUE *v2, VALUE *v3, VALUE *vres) * Here for any complex result. */ vres->v_type = V_COM; - vres->v_com = c; - if (cisreal(c)) { - vres->v_num = qlink(c->real); - vres->v_type = V_NUM; - comfree(c); - } + c = vres->v_com; + if (!cisreal(c)) + return; + vres->v_num = qlink(c->real); + vres->v_type = V_NUM; + comfree(c); } diff --git a/value.h b/value.h index 0de43ca..9a6c92f 100644 --- a/value.h +++ b/value.h @@ -1,30 +1,9 @@ /* - * value - definitions of general values and related routines used by calc + * Copyright (c) 1997 David I. Bell + * Permission is granted to use, distribute, or modify this source, + * provided that this copyright notice remains intact. * - * Copyright (C) 1999 David I. Bell - * - * Calc is open software; you can redistribute it and/or modify it under - * the terms of the version 2.1 of the GNU Lesser General Public License - * as published by the Free Software Foundation. - * - * Calc is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General - * Public License for more details. - * - * A copy of version 2.1 of the GNU Lesser General Public License is - * distributed with calc under the filename COPYING-LGPL. You should have - * received a copy with calc; if not, write to Free Software Foundation, Inc. - * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. - * - * @(#) $Revision: 29.1 $ - * @(#) $Id: value.h,v 29.1 1999/12/14 09:16:17 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/value.h,v $ - * - * Under source code control: 1993/07/30 19:42:47 - * File existed as early as: 1993 - * - * Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ + * Definitions of general values and related routines used by the calculator. */ @@ -439,7 +418,7 @@ extern VALUE *associndex(ASSOC *ap, BOOL create, long dim, VALUE *indices); typedef struct { int oa_index; /* index of object type */ int oa_count; /* number of elements defined */ - long oa_indices[OBJ_MAXFUNC+1]; /* function indices for actions */ + long oa_indices[OBJ_MAXFUNC+1]; /* function indices for actions */ int oa_elements[1]; /* element indices (MUST BE LAST) */ } OBJECTACTIONS; diff --git a/version.c b/version.c index 8dddb43..6f8d591 100644 --- a/version.c +++ b/version.c @@ -1,36 +1,11 @@ /* + * Copyright (c) 1999 David I. Bell + * Permission is granted to use, distribute, or modify this source, + * provided that this copyright notice remains intact. + * * version - determine the version of calc - * - * Copyright (C) 1999 David I. Bell and Landon Curt Noll - * - * Primary author: David I. Bell - * - * Calc is open software; you can redistribute it and/or modify it under - * the terms of the version 2.1 of the GNU Lesser General Public License - * as published by the Free Software Foundation. - * - * Calc is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General - * Public License for more details. - * - * A copy of version 2.1 of the GNU Lesser General Public License is - * distributed with calc under the filename COPYING-LGPL. You should have - * received a copy with calc; if not, write to Free Software Foundation, Inc. - * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. - * - * @(#) $Revision: 29.2 $ - * @(#) $Id: version.c,v 29.2 1999/12/14 19:37:46 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/version.c,v $ - * - * Under source code control: 1990/05/22 11:00:58 - * File existed as early as: 1990 - * - * chongo /\oo/\ http://reality.sgi.com/chongo/ - * Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ */ - #include #if defined(CALC_VER) #include @@ -42,8 +17,8 @@ static char *program; #define MAJOR_VER 2 /* major version */ #define MINOR_VER 11 /* minor version */ -#define MAJOR_PATCH 1 /* patch level or 0 if no patch */ -#define MINOR_PATCH "0" /* test number or empty string if no patch */ +#define MAJOR_PATCH 0 /* patch level or 0 if no patch */ +#define MINOR_PATCH "10.5.1" /* test number or empty string if no patch */ /* * calc version constants @@ -60,35 +35,6 @@ char *calc_minor_patch = MINOR_PATCH; static char *stored_version = NULL; /* version formed if != NULL */ -/* - * stored license info - has a side effect of copyrighting the binary - */ -char *Copyright = "\n" - "calc - arbitrary precision calculator\n" - "\n" - "@(#) Copyright (C) 1999 David I. Bell, Landon Curt Noll and Ernest Bowen\n" - "\n" - "Primary author: David I. Bell\n" - "\n" - "Calc is open software; you can redistribute it and/or modify it under\n" - "the terms of the version 2.1 of the GNU Lesser General Public License\n" - "as published by the Free Software Foundation.\n" - "\n" - "Calc is distributed in the hope that it will be useful, but WITHOUT\n" - "ANY WARRANTY; without even the implied warranty of MERCHANTABILITY\n" - "or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General\n" - "Public License for more details.\n" - "\n" - "A copy of version 2.1 of the GNU Lesser General Public License is\n" - "distributed with calc under the filename COPYING-LGPL. You should have\n" - "received a copy with calc; if not, write to Free Software Foundation, Inc.\n" - "59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.\n" - "\n" - "@(#) For license details use the command:\thelp copying\n" - "The COPYING-LGPL file may be viewed with:\thelp copying-lgpl\n" - "\n"; - - /* * version - return version string * diff --git a/zfunc.c b/zfunc.c index 0435a45..c64a176 100644 --- a/zfunc.c +++ b/zfunc.c @@ -1,35 +1,11 @@ /* - * zfunc - extended precision integral arithmetic non-primitive routines + * Copyright (c) 1997 David I. Bell + * Permission is granted to use, distribute, or modify this source, + * provided that this copyright notice remains intact. * - * Copyright (C) 1999 David I. Bell, Landon Curt Noll and Ernest Bowen - * - * Primary author: David I. Bell - * - * Calc is open software; you can redistribute it and/or modify it under - * the terms of the version 2.1 of the GNU Lesser General Public License - * as published by the Free Software Foundation. - * - * Calc is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General - * Public License for more details. - * - * A copy of version 2.1 of the GNU Lesser General Public License is - * distributed with calc under the filename COPYING-LGPL. You should have - * received a copy with calc; if not, write to Free Software Foundation, Inc. - * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. - * - * @(#) $Revision: 29.1 $ - * @(#) $Id: zfunc.c,v 29.1 1999/12/14 09:16:17 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/zfunc.c,v $ - * - * Under source code control: 1990/02/15 01:48:27 - * File existed as early as: before 1990 - * - * Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ + * Extended precision integral arithmetic non-primitive routines */ - #include "zmath.h" ZVALUE _tenpowers_[TEN_MAX+1]; /* table of 10^2^n */ diff --git a/zio.c b/zio.c index 0fb8da1..fad1747 100644 --- a/zio.c +++ b/zio.c @@ -1,33 +1,11 @@ /* - * zio - scanf and printf routines for arbitrary precision integers + * Copyright (c) 1996 David I. Bell + * Permission is granted to use, distribute, or modify this source, + * provided that this copyright notice remains intact. * - * Copyright (C) 1999 David I. Bell - * - * Calc is open software; you can redistribute it and/or modify it under - * the terms of the version 2.1 of the GNU Lesser General Public License - * as published by the Free Software Foundation. - * - * Calc is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General - * Public License for more details. - * - * A copy of version 2.1 of the GNU Lesser General Public License is - * distributed with calc under the filename COPYING-LGPL. You should have - * received a copy with calc; if not, write to Free Software Foundation, Inc. - * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. - * - * @(#) $Revision: 29.1 $ - * @(#) $Id: zio.c,v 29.1 1999/12/14 09:16:17 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/zio.c,v $ - * - * Under source code control: 1993/07/30 19:42:48 - * File existed as early as: 1993 - * - * Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ + * Scanf and printf routines for arbitrary precision integers. */ - #include #include "config.h" #include "zmath.h" diff --git a/zmath.c b/zmath.c index 4ed4222..036b349 100644 --- a/zmath.c +++ b/zmath.c @@ -1,35 +1,11 @@ /* - * zmath - extended precision integral arithmetic primitives + * Copyright (c) 1997 David I. Bell + * Permission is granted to use, distribute, or modify this source, + * provided that this copyright notice remains intact. * - * Copyright (C) 1999 David I. Bell and Ernest Bowen - * - * Primary author: David I. Bell - * - * Calc is open software; you can redistribute it and/or modify it under - * the terms of the version 2.1 of the GNU Lesser General Public License - * as published by the Free Software Foundation. - * - * Calc is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General - * Public License for more details. - * - * A copy of version 2.1 of the GNU Lesser General Public License is - * distributed with calc under the filename COPYING-LGPL. You should have - * received a copy with calc; if not, write to Free Software Foundation, Inc. - * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. - * - * @(#) $Revision: 29.1 $ - * @(#) $Id: zmath.c,v 29.1 1999/12/14 09:16:17 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/zmath.c,v $ - * - * Under source code control: 1990/02/15 01:48:28 - * File existed as early as: before 1990 - * - * Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ + * Extended precision integral arithmetic primitives */ - #include #include "zmath.h" diff --git a/zmath.h b/zmath.h index c68568e..5c0e66f 100644 --- a/zmath.h +++ b/zmath.h @@ -1,33 +1,8 @@ /* - * zmath - declarations for extended precision integer arithmetic + * Copyright (c) 1997 David I. Bell + * Permission is granted to use, distribute, or modify this source, + * provided that this copyright notice remains intact. * - * Copyright (C) 1999 David I. Bell - * - * Calc is open software; you can redistribute it and/or modify it under - * the terms of the version 2.1 of the GNU Lesser General Public License - * as published by the Free Software Foundation. - * - * Calc is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General - * Public License for more details. - * - * A copy of version 2.1 of the GNU Lesser General Public License is - * distributed with calc under the filename COPYING-LGPL. You should have - * received a copy with calc; if not, write to Free Software Foundation, Inc. - * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. - * - * @(#) $Revision: 29.1 $ - * @(#) $Id: zmath.h,v 29.1 1999/12/14 09:16:17 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/zmath.h,v $ - * - * Under source code control: 1993/07/30 19:42:48 - * File existed as early as: 1993 - * - * Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ - */ - -/* * Data structure declarations for extended precision integer arithmetic. * The assumption made is that a long is 32 bits and shorts are 16 bits, * and longs must be addressible on word boundaries. diff --git a/zmod.c b/zmod.c index d536083..72da090 100644 --- a/zmod.c +++ b/zmod.c @@ -1,35 +1,8 @@ /* - * zmod - modulo arithmetic routines + * Copyright (c) 1997 David I. Bell + * Permission is granted to use, distribute, or modify this source, + * provided that this copyright notice remains intact. * - * Copyright (C) 1999 David I. Bell, Landon Curt Noll and Ernest Bowen - * - * Primary author: David I. Bell - * - * Calc is open software; you can redistribute it and/or modify it under - * the terms of the version 2.1 of the GNU Lesser General Public License - * as published by the Free Software Foundation. - * - * Calc is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General - * Public License for more details. - * - * A copy of version 2.1 of the GNU Lesser General Public License is - * distributed with calc under the filename COPYING-LGPL. You should have - * received a copy with calc; if not, write to Free Software Foundation, Inc. - * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. - * - * @(#) $Revision: 29.1 $ - * @(#) $Id: zmod.c,v 29.1 1999/12/14 09:16:17 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/zmod.c,v $ - * - * Under source code control: 1991/05/22 23:03:55 - * File existed as early as: 1991 - * - * Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ - */ - -/* * Routines to do modulo arithmetic both normally and also using the REDC * algorithm given by Peter L. Montgomery in Mathematics of Computation, * volume 44, number 170 (April, 1985). For multiple multiplies using @@ -1877,7 +1850,7 @@ zredcpower(REDC *rp, ZVALUE z1, ZVALUE z2, ZVALUE *res) * * Therefore, v mod h*2^n+r == (2^n)*(b mod h) + a - r*int(b/h). * - * The above proof leads to the following calc resource file which computes + * The above proof leads to the following calc script which computes * the value z mod h*2^n+r: * * define hnrmod(v,h,n,r) @@ -1945,7 +1918,7 @@ zredcpower(REDC *rp, ZVALUE z1, ZVALUE z2, ZVALUE *res) * return ret; * } * - * This function implements the above calc resource file. + * This function implements the above calc script. * * given: * v take mod of this value, v >= 0 diff --git a/zmul.c b/zmul.c index 5e2f979..b346980 100644 --- a/zmul.c +++ b/zmul.c @@ -1,33 +1,8 @@ /* - * zmul - faster than usual multiplying and squaring routines + * Copyright (c) 1995 David I. Bell + * Permission is granted to use, distribute, or modify this source, + * provided that this copyright notice remains intact. * - * Copyright (C) 1999 David I. Bell - * - * Calc is open software; you can redistribute it and/or modify it under - * the terms of the version 2.1 of the GNU Lesser General Public License - * as published by the Free Software Foundation. - * - * Calc is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General - * Public License for more details. - * - * A copy of version 2.1 of the GNU Lesser General Public License is - * distributed with calc under the filename COPYING-LGPL. You should have - * received a copy with calc; if not, write to Free Software Foundation, Inc. - * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. - * - * @(#) $Revision: 29.1 $ - * @(#) $Id: zmul.c,v 29.1 1999/12/14 09:16:17 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/zmul.c,v $ - * - * Under source code control: 1991/01/09 20:01:31 - * File existed as early as: 1991 - * - * Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ - */ - -/* * Faster than usual multiplying and squaring routines. * The algorithm used is the reasonably simple one from Knuth, volume 2, * section 4.3.3. These recursive routines are of speed O(N^1.585) @@ -304,7 +279,7 @@ domul(HALF *v1, LEN size1, HALF *v2, LEN size2, HALF *ans) */ baseA = v1 + shift; baseB = v1; - baseC = v2 + ((shift <= size2) ? shift : size2); + baseC = v2 + ((shift <= size2) ? shift : size2); baseD = v2; baseAB = ans; baseDC = ans + shift; diff --git a/zprime.c b/zprime.c index 055cbfc..9ff4655 100644 --- a/zprime.c +++ b/zprime.c @@ -1,34 +1,27 @@ /* - * zprime - rapid small prime routines + * Copyright (c) 1996 by Landon Curt Noll. All Rights Reserved. * - * Copyright (C) 1999 Landon Curt Noll + * Permission to use, copy, modify, and distribute this software and + * its documentation for any purpose and without fee is hereby granted, + * provided that the above copyright, this permission notice and text + * this comment, and the disclaimer below appear in all of the following: * - * Calc is open software; you can redistribute it and/or modify it under - * the terms of the version 2.1 of the GNU Lesser General Public License - * as published by the Free Software Foundation. + * supporting documentation + * source copies + * source works derived from this source + * binaries derived from this source or from derived source * - * Calc is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General - * Public License for more details. + * LANDON CURT NOLL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO + * EVENT SHALL LANDON CURT NOLL BE LIABLE FOR ANY SPECIAL, INDIRECT OR + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF + * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR + * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. * - * A copy of version 2.1 of the GNU Lesser General Public License is - * distributed with calc under the filename COPYING-LGPL. You should have - * received a copy with calc; if not, write to Free Software Foundation, Inc. - * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. - * - * @(#) $Revision: 29.1 $ - * @(#) $Id: zprime.c,v 29.1 1999/12/14 09:16:18 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/zprime.c,v $ - * - * Under source code control: 1994/05/29 04:34:36 - * File existed as early as: 1994 - * - * chongo /\oo/\ http://reality.sgi.com/chongo/ - * Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ + * chongo was here /\../\ */ - #include "zmath.h" #include "prime.h" #include "jump.h" diff --git a/zrand.c b/zrand.c index 3b38c75..020ef2e 100644 --- a/zrand.c +++ b/zrand.c @@ -1,31 +1,37 @@ /* - * zrand - additive 55 shuffle generator + * Copyright (c) 1997 by Landon Curt Noll. All Rights Reserved. * - * Copyright (C) 1999 Landon Curt Noll + * Permission to use, copy, modify, and distribute this software and + * its documentation for any purpose and without fee is hereby granted, + * provided that the above copyright, this permission notice and text + * this comment, and the disclaimer below appear in all of the following: * - * Calc is open software; you can redistribute it and/or modify it under - * the terms of the version 2.1 of the GNU Lesser General Public License - * as published by the Free Software Foundation. + * supporting documentation + * source copies + * source works derived from this source + * binaries derived from this source or from derived source * - * Calc is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General - * Public License for more details. + * LANDON CURT NOLL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO + * EVENT SHALL LANDON CURT NOLL BE LIABLE FOR ANY SPECIAL, INDIRECT OR + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF + * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR + * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. * - * A copy of version 2.1 of the GNU Lesser General Public License is - * distributed with calc under the filename COPYING-LGPL. You should have - * received a copy with calc; if not, write to Free Software Foundation, Inc. - * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. + * Prior to calc 2.9.3t9, these routines existed as a calc library called + * cryrand.cal. They have been rewritten in C for performance as well + * as to make them available directly from libcalc.a. * - * @(#) $Revision: 29.1 $ - * @(#) $Id: zrand.c,v 29.1 1999/12/14 09:16:18 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/zrand.c,v $ + * Comments, suggestions, bug fixes and questions about these routines + * are welcome. Send EMail to the address given below. * - * Under source code control: 1995/01/07 09:45:25 - * File existed as early as: 1994 + * Happy bit twiddling, * - * chongo /\oo/\ http://reality.sgi.com/chongo/ - * Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ + * Landon Curt Noll + * http://reality.sgi.com/chongo/ + * + * chongo /\../\ */ /* @@ -271,7 +277,7 @@ * physical device. * * A final "truth in advertising" issue deals with how the magic numbers - * found in this file were generated. Detains can be found in the + * found in this library were generated. Detains can be found in the * various functions, while a overview can be found in the "SOURCE FOR * MAGIC NUMBERS" section below. */ diff --git a/zrand.h b/zrand.h index b9bcb71..e61d4ce 100644 --- a/zrand.h +++ b/zrand.h @@ -1,33 +1,38 @@ /* - * zrand - additive 55 shuffle generator + * Copyright (c) 1997 by Landon Curt Noll. All Rights Reserved. * - * Copyright (C) 1999 Landon Curt Noll + * Permission to use, copy, modify, and distribute this software and + * its documentation for any purpose and without fee is hereby granted, + * provided that the above copyright, this permission notice and text + * this comment, and the disclaimer below appear in all of the following: * - * Calc is open software; you can redistribute it and/or modify it under - * the terms of the version 2.1 of the GNU Lesser General Public License - * as published by the Free Software Foundation. + * supporting documentation + * source copies + * source works derived from this source + * binaries derived from this source or from derived source * - * Calc is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General - * Public License for more details. + * LANDON CURT NOLL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO + * EVENT SHALL LANDON CURT NOLL BE LIABLE FOR ANY SPECIAL, INDIRECT OR + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF + * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR + * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. * - * A copy of version 2.1 of the GNU Lesser General Public License is - * distributed with calc under the filename COPYING-LGPL. You should have - * received a copy with calc; if not, write to Free Software Foundation, Inc. - * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. + * Prior to calc 2.9.3t9, these routines existed as a calc library called + * cryrand.cal. They have been rewritten in C for performance as well + * as to make them available directly from libcalc.a. * - * @(#) $Revision: 29.1 $ - * @(#) $Id: zrand.h,v 29.1 1999/12/14 09:16:18 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/zrand.h,v $ + * Comments, suggestions, bug fixes and questions about these routines + * are welcome. Send EMail to the address given below. * - * Under source code control: 1995/01/07 09:45:26 - * File existed as early as: 1994 + * Happy bit twiddling, * - * chongo /\oo/\ http://reality.sgi.com/chongo/ - * Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ + * Landon Curt Noll + * http://reality.sgi.com/chongo/ + * + * chongo /\../\ */ - /* * random number generator - see zrand.c for details */ diff --git a/zrandom.c b/zrandom.c index 933fb95..8141077 100644 --- a/zrandom.c +++ b/zrandom.c @@ -1,31 +1,37 @@ /* - * zrandom - Blum-Blum-Shub pseudo-random generator + * Copyright (c) 1997 by Landon Curt Noll. All Rights Reserved. * - * Copyright (C) 1999 Landon Curt Noll + * Permission to use, copy, modify, and distribute this software and + * its documentation for any purpose and without fee is hereby granted, + * provided that the above copyright, this permission notice and text + * this comment, and the disclaimer below appear in all of the following: * - * Calc is open software; you can redistribute it and/or modify it under - * the terms of the version 2.1 of the GNU Lesser General Public License - * as published by the Free Software Foundation. + * supporting documentation + * source copies + * source works derived from this source + * binaries derived from this source or from derived source * - * Calc is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General - * Public License for more details. + * LANDON CURT NOLL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO + * EVENT SHALL LANDON CURT NOLL BE LIABLE FOR ANY SPECIAL, INDIRECT OR + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF + * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR + * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. * - * A copy of version 2.1 of the GNU Lesser General Public License is - * distributed with calc under the filename COPYING-LGPL. You should have - * received a copy with calc; if not, write to Free Software Foundation, Inc. - * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. + * Prior to calc 2.9.3t9, these routines existed as a calc library called + * cryrand.cal. They have been rewritten in C for performance as well + * as to make them available directly from libcalc.a. * - * @(#) $Revision: 29.1 $ - * @(#) $Id: zrandom.c,v 29.1 1999/12/14 09:16:18 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/zrandom.c,v $ + * Comments, suggestions, bug fixes and questions about these routines + * are welcome. Send EMail to the address given below. * - * Under source code control: 1997/02/15 04:01:56 - * File existed as early as: 1997 + * Happy bit twiddling, * - * chongo /\oo/\ http://reality.sgi.com/chongo/ - * Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ + * Landon Curt Noll + * http://reality.sgi.com/chongo/ + * + * chongo /\../\ */ /* @@ -206,7 +212,7 @@ * the current Blum modulus. We will successively square mod Blum * modulus until we get a smaller value (modulus wrap). * - * The follow calc resource file produces an equivalent effect: + * The follow calc script produces an equivalent effect: * * n = default_modulus; (* n is the new Blum modulus *) * r = seed; @@ -232,7 +238,7 @@ * have not been disclosed, use srandom(seed, newn) with the * appropriate args as noted below. * - * The follow calc resource file produces an equivalent effect: + * The follow calc script produces an equivalent effect: * * n = default_modulus; (* as used by the initial state *) * r = default_residue; (* as used by the initial state *) @@ -266,7 +272,7 @@ * We will successively square it mod Blum modulus until we get * a smaller value (modulus wrap). * - * The follow calc resource file produces an equivalent effect: + * The follow calc script produces an equivalent effect: * * if (newn % 4 == 1) { * n = newn; (* n is the new Blum modulus *) @@ -291,7 +297,7 @@ * The initial quadratic residue will be as if the default initial * quadratic residue arg was given. * - * The follow calc resource file produces an equivalent effect: + * The follow calc script produces an equivalent effect: * * srandom(default_residue, newn) * @@ -326,7 +332,7 @@ * We will successively square it mod Blum modulus until we get * a smaller value (modulus wrap). * - * The follow calc resource file produces an equivalent effect: + * The follow calc script produces an equivalent effect: * * n = n[newn]; (* n is new Blum modulus, see below *) * r = seed; @@ -345,7 +351,7 @@ * The new quadratic residue will also be set to one of * the pre-defined quadratic residues. * - * The follow calc resource file produces an equivalent effect: + * The follow calc script produces an equivalent effect: * * srandom(r[newn], n[newn]) * @@ -652,7 +658,7 @@ * We will successively square it mod Blum modulus until we get * a smaller value (modulus wrap). * - * The follow calc resource file produces an equivalent effect: + * The follow calc script produces an equivalent effect: * * p = nextcand(ip-2, trials, 0, 3, 4); (* find the 1st Blum prime *) * q = nextcand(iq-2, trials, 0, 3, 4); (* find the 2nd Blum prime *) @@ -680,7 +686,7 @@ * The initial quadratic residue will be as if the default initial * quadratic residue arg was given. * - * The follow calc resource file produces an equivalent effect: + * The follow calc script produces an equivalent effect: * * srandom(default_residue, ip, iq, trials) * @@ -760,7 +766,7 @@ * the "Blum-Blum-Shub generator" section above. * * A final "truth in advertising" issue deals with how the magic numbers - * found in this file were generated. Detains can be found in the + * found in this library were generated. Detains can be found in the * various functions, while a overview can be found in the "SOURCE FOR * MAGIC NUMBERS" section below. */ @@ -856,8 +862,8 @@ * q = 2*fq+1; * } while (ptest(q, 25) == 0); * - * The above resource file produces the Blum probable primes and initial - * quadratic residue (line wrapped for readability): + * The above script produces the Blum probable primes and initial quadratic + * residue (line wrapped for readability): * * p= 0x798ac934c7a3318ad446190f3474e57 * @@ -912,7 +918,7 @@ * lambda(n) = lcm(factors of p-1 & q-1) * * since 'p' and 'q' are both odd, 'p-1' and 'q-1' have 2 as - * a factor. The calc resource file above ensures that '(p-1)/2' and + * a factor. The calc script above ensures that '(p-1)/2' and * '(q-1)/2' are probable prime, thus maximizing the period * of the default generator to: * @@ -962,7 +968,7 @@ * *** * - * One could take issue with the above resource file that produced a 260 bit + * One could take issue with the above script that produced a 260 bit * Blum modulus. So if that bothers you, then seed your generator * with your own Blum modulus and initial quadratic residue. And * if you are truly paranoid, why would you want to use the default seed, diff --git a/zrandom.h b/zrandom.h index de004b8..42aac53 100644 --- a/zrandom.h +++ b/zrandom.h @@ -1,31 +1,40 @@ /* - * zrandom - Blum-Blum-Shub pseudo-random generator + * Copyright (c) 1997 by Landon Curt Noll. All Rights Reserved. * - * Copyright (C) 1999 Landon Curt Noll + * Permission to use, copy, modify, and distribute this software and + * its documentation for any purpose and without fee is hereby granted, + * provided that the above copyright, this permission notice and text + * this comment, and the disclaimer below appear in all of the following: * - * Calc is open software; you can redistribute it and/or modify it under - * the terms of the version 2.1 of the GNU Lesser General Public License - * as published by the Free Software Foundation. + * supporting documentation + * source copies + * source works derived from this source + * binaries derived from this source or from derived source * - * Calc is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General - * Public License for more details. + * LANDON CURT NOLL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO + * EVENT SHALL LANDON CURT NOLL BE LIABLE FOR ANY SPECIAL, INDIRECT OR + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF + * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR + * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. * - * A copy of version 2.1 of the GNU Lesser General Public License is - * distributed with calc under the filename COPYING-LGPL. You should have - * received a copy with calc; if not, write to Free Software Foundation, Inc. - * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. + * Prior to calc 2.9.3t9, these routines existed as a calc library called + * cryrand.cal. They have been rewritten in C for performance as well + * as to make them available directly from libcalc.a. * - * @(#) $Revision: 29.1 $ - * @(#) $Id: zrandom.h,v 29.1 1999/12/14 09:16:18 chongo Exp $ - * @(#) $Source: /usr/local/src/cmd/calc/RCS/zrandom.h,v $ + * Comments, suggestions, bug fixes and questions about these routines + * are welcome. Send EMail to the address given below. * - * Under source code control: 1997/02/15 04:01:56 - * File existed as early as: 1997 + * Happy bit twiddling, * - * chongo /\oo/\ http://reality.sgi.com/chongo/ - * Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/ + * Landon Curt Noll + * http://reality.sgi.com/chongo/ + * + * chongo /\../\ + */ +/* + * random number generator - see zrandom.c for details */