Aardvark Calculator
v 0.0.48

Aardvark Calculator is a simple RPN calculator, intended to be used for the
simple arithmetic that I always find myself doing while coding.

Five types of tokens are recognized:
	decimal integers
		Any string of digits.
	hexadecimal integers
		An 'X', followed by the hex digits.  If you type in a string
		that might be a hexadecimal number, the program will parse
		it as one if it doesn't meet the criteria for any other type
		of token.
	decimal floating point
		A string of digits including a decimal point, optionally 
		followed by 'e' or 'E' and an exponent.
	strings
		Any set of characters, delimited by double quotes.
	functions
		The name or shortcut for any function.  Not case-sensitive.

Most of the functions are fairly self-explanatory; you can type 'help'
to get a listing of all functions available, along with any associated
shortcut keys.  (If you find that you want more shortcuts, they are defined
in keys_?.c, in the array keys[].)  The functions are:
	+, -, *, /, ^, log, ln, sqr, sqrt, inv, neg, exp, sin, asin, cos, 
	acos, tan, atan, ipart, fpart
		Arithmetic commands
	sl, sr
		Bit-shift operations
	and, or, xor
		Bitwise operators
	swap, drop, rot, clr, dropn, dup
		Stack manipulation commands
	deg, rad
		Change to degree or radian mode.  An indicator at the left 
		shows D/R for the current mode
	todeg, torad, hex, dec
		Convert back and forth between degrees/radians and 
		decimal/hexadecimal
	flt
		Internally, convert from integer to floating point representation.
		Probably unneeded, but if you want to guarantee that arithmetic is done
		in floating-point...
	fix
		Set the number of significant figures in floating-point numbers
	num
		Cause line numbers to be printed on the stack
	sto, rcl, del
		Stores/recalls a number to/from a given register; del deletes
		anything in a specified register.
	stack
		The calculator can handle multiple stacks; the default stack 
		is given an ID of 0.  This command switches to another stack.
	save
		Save the state of the calculator.  (Give the filename to it as
		a string argument.)  Note that this saves both the stacks and
		the registers, but the load/loadregs commands only load one of
		the two.
	load
		Restore the state of the calculator, EXCEPT registers
	loadregs
		Restore the state of the registers
	sc, setsc, delsc
		Shortcut (macro) commands.  Shortcuts are defined as a string, bound to
		an ID.  Executing the sc command with the shortcut id as its argument
		has the same effect as if you had entered the full macro string.  Note
		that the keys F1-F12 are bound to shortcuts 1-12, for quick access.
	help
		Get a listing of all functions and shortcut keys
	quit

Options can be specified on the command line, or in the file "~/.acalcrc".
("acalcrc" in the current directory for DOS.)  The general format for the rc
file is:
	option_name[=arg]
Command-line parameters may be specified with GNU long-style options,
preceded by a double dash, or using single-character options.  The available
options are:
	-r, --radians
		Start in radians mode (default)
	-d, --degrees
		Start in degrees mode
	-n, --numbers
		Start with a numbered stack
	-f [num], --fix=[num]
		Start with the specified precision
	-t button1,button2,button3,..., --toolbar=button1,button2,button3,...
		Make a toolbar containing buttons with the specified labels.  Pressing a
		button will execute the corresponding shortcut (The first button
		executes shortcut 1, etc.)  Only available when using the GTK+
		interface.
	-s n:string, --shortcut=n:string
		set shortcut with index 'n' to the given string

For an example, here's what my .acalcrc looks like:
--
shortcut=1:0 stack
shortcut=2:1 stack
shortcut=3:2 stack
shortcut=4:3 stack
shortcut=5:dup 1 sto
shortcut=6:1 rcl
shortcut=7:quit
toolbar=1,2,3,4,mem,rcl,quit
--

By default, the Makefile has been set up to use GTK+ under Linux.  By
changing the indicated lines in the makefile, you may also select a ncurses
interface for Linux or compile a version using pdcurses under DOS, with
DJGPP.

NOTE: It seems that the compiling using DOS has some problems now,
especially related to the getopt() functions.  You may be able to get a
working copy by removing the pieces that deal with parsing the command line,
but it's untested.

License Terms
=============
Copyright (c) 2001 Jared Minch

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
