Release calc version 2.11.1

This commit is contained in:
Landon Curt Noll
1999-12-14 01:33:40 -08:00
parent 2c9b160dc5
commit 867002aa77
519 changed files with 18131 additions and 4296 deletions

View File

@@ -1,31 +1,11 @@
#
# 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/
Custom calc resource files
--------------------------
The following custom calc library files are provided because they serve
The following custom calc resource 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
library files are shipped with calc to provide you with examples.
resource files are shipped with calc to provide you with examples.
By default, the custom builtin returns an error. Calc have been
built with:
@@ -39,8 +19,8 @@ must be invoked with a -C argument:
when it is run.
See the ../lib/README or "help stdlib" for information about
calc library standards and guidelines.
See the ../cal/README or "help resource" for information about
calc resource standards and guidelines.
=-=
@@ -60,3 +40,29 @@ 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 <was here> /\oo/\ http://reality.sgi.com/chongo/
## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/

View File

@@ -1,4 +1,5 @@
Guidelines for adding custom functions
--------------------------------------
Step 0: Determine if is should it be done?
@@ -17,9 +18,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 library script?
+ Can I implement this as a calc resource file or calc shell script?
If Yes, write the script and be done with it.
If Yes, write the shell script or resource file and be done with it.
If No, continue to the next question ...
+ Does it require the use of non-portable features,
@@ -617,3 +618,29 @@ 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 <was here> /\oo/\ http://reality.sgi.com/chongo/
## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/

View File

@@ -1,43 +1,44 @@
#!/bin/make
#
# custom - makefile for calc custom routines
#
# 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.
#
# Comments, suggestions, bug fixes and questions about these routines
# are welcome. Send EMail to the address given below.
# @(#) $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 $
#
# 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 <was here> /\oo/\ http://reality.sgi.com/chongo/
# Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/
#
# chongo <was here> /\../\
# calculator by David I. Bell with help/mods from others
# Makefile by Landon Curt Noll
##############################################################################
#-=-=-=-=-=-=-=-=- You may want to change some values below -=-=-=-=-=-=-=-=-#
##############################################################################
# The custom calc library files to install
# The custom calc resource files to install
#
# Put your custom calc library files here.
# Put your custom calc resource files here.
#
CUSTOM_CALC_FILES= argv.cal halflen.cal pzasusb8.cal
@@ -158,7 +159,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 library. Set RANLIB to the utility that performs this action.
# 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.
#
#RANLIB=ranlib
@@ -217,7 +218,6 @@ 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,7 +234,6 @@ CCMISC=
CFLAGS= ${CCWARN} ${CCOPT} ${CCMISC} ${ALLOW_CUSTOM}
ICFLAGS= ${CCWARN} ${CCMISC}
#
LCFLAGS=
LDFLAGS= ${NO_SHARED} ${LD_NO_SHARED}
ILDFLAGS=
#
@@ -285,7 +284,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 library
# These files are used to make (but not built) a calc .a link library
#
CALCLIBLIST= ${CUSTCALC_SRC} ${INSTALL_H_SRC} ${MAKE_FILE} HOW_TO_ADD
@@ -295,9 +294,14 @@ TARGETS= libcustcalc.a ${CUSTCALC_OBJ}
# required vars
#
SHELL = /bin/sh
SHELL= /bin/sh
MAKE_FILE= Makefile
# standard tools
#
SED= sed
MAKEDEPEND= makedepend
CHMOD= chmod
SORT= sort
##
@@ -387,7 +391,7 @@ depend:
${Q}mkdir skel
${Q}mkdir skel/custom
-${Q}for i in ${C_SRC}; do \
${SED} -n '/^#[ ]*include[ ]*"/p' \
${SED} -n '/^#[ ]*include[ ]*"/p' \
"$$i" > "skel/custom/$$i"; \
done
-${Q}for i in /dev/null ${H_SRC}; do \
@@ -395,7 +399,7 @@ depend:
continue; \
fi; \
tag="`echo $$i | ${SED} 's/[\.+,:]/_/g'`"; \
echo "#ifndef $$tag" > "skel/custom/$$i"; \
echo "#if !defined($$tag)" > "skel/custom/$$i"; \
echo "#define $$tag" >> "skel/custom/$$i"; \
${SED} -n '/^#[ ]*include[ ]*"/p' "$$i" \
>> "skel/custom/$$i"; \
@@ -404,7 +408,7 @@ depend:
${Q}(cd ..; ${MAKE} hsrc)
${Q}for i in `cd ..; ${MAKE} h_list`; do \
tag="`echo $$i | ${SED} 's/[\.+,:]/_/g'`"; \
echo "#ifndef $$tag" > "skel/$$i"; \
echo "#if !defined($$tag)" > "skel/$$i"; \
echo "#define $$tag" >> "skel/$$i"; \
${SED} -n '/^#[ ]*include[ ]*"/p' "../$$i" \
>> "skel/$$i"; \
@@ -417,10 +421,8 @@ depend:
skel/custom/makedep.out
${Q}cd skel/custom; ${MAKEDEPEND} -w 1 -m -f makedep.out ${C_SRC}
-${Q}for i in ${C_SRC}; do \
echo "$$i" | \
${SED} 's/^\(.*\)\.c/\1.o: \1.c/' \
>> skel/custom/makedep.out; \
done
echo "$$i" | ${SED} 's/^\(.*\)\.c/\1.o: \1.c/'; \
done >> skel/custom/makedep.out
${Q}echo custom dependency list formed
${Q}echo forming new custom/Makefile
-${Q}rm -f Makefile.bak
@@ -494,32 +496,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

View File

@@ -39,3 +39,29 @@ 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 <was here> /\oo/\ http://reality.sgi.com/chongo/
## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/

View File

@@ -1,25 +1,41 @@
/*
* 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 <was here> /\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 */
@@ -39,6 +55,6 @@ define argv()
return i-1;
}
if (config("lib_debug") >= 0) {
if (config("resource_debug") >= 0) {
print "argv(var, ...) defined";
}

View File

@@ -1,26 +1,34 @@
/*
* Permission to use, copy, modify, and distribute this software and
* its documentation for any purpose and without fee is hereby granted.
* c_argv - a custom function display info about its args
*
* 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.
* Copyright (C) 1999 Landon Curt Noll
*
* Comments, suggestions, bug fixes and questions about these routines
* are welcome. Send EMail to the address given below.
* Calc is open software; you can redistribute it and/or modify it under
* the terms of the version 2.1 of the GNU Lesser General Public License
* as published by the Free Software Foundation.
*
* Happy bit twiddling,
* Calc is distributed in the hope that it will be useful, but WITHOUT
* ANY 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
* http://reality.sgi.com/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.
*
* chongo <was here> /\../\
* @(#) $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 <was here> /\oo/\ http://reality.sgi.com/chongo/
* Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/
*/
#if defined(CUSTOM)
#include <stdio.h>

View File

@@ -1,26 +1,34 @@
/*
* Permission to use, copy, modify, and distribute this software and
* its documentation for any purpose and without fee is hereby granted.
* c_devnull - a custom function that does nothing
*
* 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.
* Copyright (C) 1999 Landon Curt Noll
*
* Comments, suggestions, bug fixes and questions about these routines
* are welcome. Send EMail to the address given below.
* Calc is open software; you can redistribute it and/or modify it under
* the terms of the version 2.1 of the GNU Lesser General Public License
* as published by the Free Software Foundation.
*
* Happy bit twiddling,
* Calc is distributed in the hope that it will be useful, but WITHOUT
* ANY 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
* http://reality.sgi.com/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.
*
* chongo <was here> /\../\
* @(#) $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 <was here> /\oo/\ http://reality.sgi.com/chongo/
* Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/
*/
#if defined(CUSTOM)

View File

@@ -1,26 +1,34 @@
/*
* Permission to use, copy, modify, and distribute this software and
* its documentation for any purpose and without fee is hereby granted.
* c_help - custom help function
*
* 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.
* Copyright (C) 1999 Landon Curt Noll
*
* Comments, suggestions, bug fixes and questions about these routines
* are welcome. Send EMail to the address given below.
* Calc is open software; you can redistribute it and/or modify it under
* the terms of the version 2.1 of the GNU Lesser General Public License
* as published by the Free Software Foundation.
*
* Happy bit twiddling,
* Calc is distributed in the hope that it will be useful, but WITHOUT
* ANY 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
* http://reality.sgi.com/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.
*
* chongo <was here> /\../\
* @(#) $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 <was here> /\oo/\ http://reality.sgi.com/chongo/
* Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/
*/
#if defined(CUSTOM)

View File

@@ -1,10 +1,33 @@
/*
* Permission to use, copy, modify, and distribute this software and
* its documentation for any purpose and without fee is hereby granted.
* c_pzasusb8 - print numereator as a string of USB8s
*
* Ernest Bowen, following Landon Curt Noll
* 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/
*/
#if defined(CUSTOM)
#include <stdio.h>
@@ -15,8 +38,7 @@
#include "../zmath.h"
/*
* c_pzasusb8 - print numereator of real as if its array of HALFs were
* a string of USB8s
* c_pzasusb8 - print numereator as a string of USB8s
*
* given:
* count = 1;

View File

@@ -1,26 +1,34 @@
/*
* Permission to use, copy, modify, and distribute this software and
* its documentation for any purpose and without fee is hereby granted.
* c_sysinfo - names and values of selected #defines
*
* 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.
* Copyright (C) 1999 Landon Curt Noll
*
* Comments, suggestions, bug fixes and questions about these routines
* are welcome. Send EMail to the address given below.
* Calc is open software; you can redistribute it and/or modify it under
* the terms of the version 2.1 of the GNU Lesser General Public License
* as published by the Free Software Foundation.
*
* Happy bit twiddling,
* Calc is distributed in the hope that it will be useful, but WITHOUT
* ANY 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
* http://reality.sgi.com/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.
*
* chongo <was here> /\../\
* @(#) $Revision: 29.1 $
* @(#) $Id: c_sysinfo.c,v 29.1 1999/12/14 09:15:37 chongo Exp $
* @(#) $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 <was here> /\oo/\ http://reality.sgi.com/chongo/
* Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/
*/
#if defined(CUSTOM)
#include <stdio.h>
@@ -65,7 +73,6 @@ 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},
@@ -77,7 +84,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", "where the echo command is located", ECHO, (FULL)0},
{"ECHO_PROG", "where the echo command is located", ECHO_PROG, (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},
@@ -307,7 +314,6 @@ 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) {
@@ -326,17 +332,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 (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,
# if defined(L64_FORMAT)
printf("%s%-23s\t%-8lu\t(0x%lx)\n".
(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",
@@ -354,36 +360,29 @@ 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)
fmt = "%s%-36.36s\t%-8lu\t(0x%lx)\n";
printf(fmt,
printf("%s%-36.36s\t%-8lu\t(0x%lx)\n",
(conf->tab_ok ? "\t" : ""), p->meaning,
(unsigned long)p->nmbr,
(unsigned long)p->nmbr);
#else
/*
* 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,
# if defined(L64_FORMAT)
/* %ld prints all 64 bits, use %ld */
printf("%s%-36.36s\t%-8lu\t(0x%lx)\n",
(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",

View File

@@ -1,33 +1,31 @@
/*
* Copyright (c) 1997 by Landon Curt Noll. All Rights Reserved.
* custtbl - custom interface table
*
* 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:
* Copyright (C) 1999 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: custtbl.c,v 29.1 1999/12/14 09:15:37 chongo Exp $
* @(#) $Source: /usr/local/src/cmd/calc/custom/RCS/custtbl.c,v $
*
* Landon Curt Noll
* http://reality.sgi.com/chongo/
* Under source code control: 1997/03/09 02:28:54
* File existed as early as: 1997
*
* chongo <was here> /\../\
* chongo <was here> /\oo/\ http://reality.sgi.com/chongo/
* Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/
*/

View File

@@ -25,3 +25,29 @@ 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 <was here> /\oo/\ http://reality.sgi.com/chongo/
## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/

View File

@@ -1,25 +1,41 @@
/*
* 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 <was here> /\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 */
@@ -48,6 +64,6 @@ define halflen(num)
}
}
if (config("lib_debug") >= 0) {
if (config("resource_debug") >= 0) {
print "halflen(num) defined";
}

View File

@@ -26,3 +26,29 @@ 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 <was here> /\oo/\ http://reality.sgi.com/chongo/
## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/

View File

@@ -48,3 +48,29 @@ 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 <was here> /\oo/\ http://reality.sgi.com/chongo/
## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/

View File

@@ -1,10 +1,36 @@
/*
* Permission to use, copy, modify, and distribute this software and
* its documentation for any purpose and without fee is hereby granted.
* pzasusb8 - print numereator as a string of USB8s
*
* Ernest Bowen, following Landon Curt Noll
* 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 <was here> /\oo/\ http://reality.sgi.com/chongo/
* Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/
*/
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";

View File

@@ -52,3 +52,29 @@ 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 <was here> /\oo/\ http://reality.sgi.com/chongo/
## Share and enjoy! :-) http://reality.sgi.com/chongo/tech/comp/calc/