Commit Graph

50 Commits

Author SHA1 Message Date
Landon Curt Noll
b97093e58c Fix calc man page \-escape, add cal/comma.cal
Fixed a \-escape bug in calc(1) man page.

Added cal/comma.cal:

    Convert numbers into strings with 3-digit group and integer-fraction
    separators.

    If the value is an integer, the integer-fraction separator is not used.

    str_comma(x, [group, [decimal]])

	Convert x into a string.

	If group is given and is a string, group will be used as
	the 3-digit group separator, otherwise the default 3-digit
	group separator will be used.

	If decimal is given and is a string, group will be used as
	the integer-fraction separator, otherwise the default
	integer-fraction separator will be used.

	The decimal and group arguments are optional.

    set_default_group_separator(group)

	Change the default 3-digit group separator if group is a string,
	otherwise the default 3-digit group separator will not be
	changed.  Return the old 3-digit group separator.

    set_default_decimal_separator(decimal)

	Change the default 3-digit group separator if decimal is a
	string, otherwise the default integer-fraction separator
	will not be changed.  Return the old integer-fraction separator.

    print_comma(x, [group, [decimal]])

	Print the value produced by str_comma(x, [group, [decimal]])
	followed by a newline.

	If the str_comma() does not return a string, nothing is printed.

	The decimal and group arguments are optional.

	The value produced by str_comma() is returned.

    fprint_comma(fd, x, [group, [decimal]])

	Print the value produced by str_comma(x, [group, [decimal]]),
	without a trailing newline, on file fd.

	If the str_comma() does not return a string, nothing is printed.

	If fd is not an open file, nothing is printed.

	The decimal and group arguments are optional.

	The value produced by str_comma() is returned.
2022-06-20 18:25:12 -07:00
Landon Curt Noll
de47c960d3 Change remaining Email addresses to use at and dot 2021-12-05 21:29:46 -08:00
Landon Curt Noll
f5c5cea8b0 Correct typos 2021-12-05 18:23:27 -08:00
Landon Curt Noll
04861939fc Release v2.13.0.0
The following are the changes in this release:

    Fixed typo (missing quotes) in the env rule.

    Fixed intendation problem in CHANGES.

    Combined 2.12.9.1 changes into the 2.12.8.2 to 2.12.9.0
    range, and thus renamed the range to 2.12.8.2 to 2.12.9.1.

    Fixed issues related to building Makefile.simple.

    Fixed how the Makefile variable MANPATH is set for macOS.

    Added a bunch of information to the near bottom of HOWTO.INSTALL
    on calc Makefiles.  This information discusses the various
    Makefiles found in the calc source.

    Added comments in various calc Makefiles about their origin.
    In particular, for Makefiles that are constructed such as
    Makefile.simple, custom/Makefile and custom/Makefile.simple
    there are comments about how they were made.

    For all calc Makefiles, including those in sub-directories,
    near the top there is now a line of the form:

	# SRC: ... some message about the origin ...

    Fixed how the calc(1) man page is installed under macOS.

    Fixed how calc man page in ${CATDIR} is formed.

    Fixed how Makefile.simple is formed.

    Fixed the #! calc script argument processing.  The initial #!
    line must end in a -f.  For example, if calc is in /usr/local/bin/calc,
    then the following would be the first line of a calc script:

	#!/usr/local/bin/calc -f
	...

    It is common that -q be usde with a calc script, so assuming the
    same /usr/local/bin/calc path:

	#!/usr/local/bin/calc -q -f
	...

    Use of -s in the #! first line of a calc script is not needed
    since -f implies -f.

    The argv() will now return values more typical of C's main().
    Before it returned one less than the number of arguments.  Now,
    for example, when calc is given 2 args, argv() will return 3.

    The value of argv(0) will be the path to calc, or in the
    case of a #! calc cscript, it will return the name of the script.

    Updated the calc man page and help/argv to reflect the
    above changes.

    Improved the formatting of the calc man page.

    Fixed the formation of the win32 sub-directory via the win32_hsrc
    Makefile rule.

    Due to incompatible changes to the argv() function, and #! calc
    scripts, we are setting the version to the next minor number:

	2.13.0
2021-03-27 05:55:50 -07:00
Landon Curt Noll
507fe026e5 Fix many spelling errors 2021-02-12 22:09:47 -08:00
Landon Curt Noll
91991bb729 Checkpoint on calc version 2.12.8.0
Fixed a mistake in "help intro" where some inserted text
    changed the value of "." and thus made the next result
    incorrect.

    Clarified in "help factor" that 1 is returned if no
    factor below the limit was found.

    Removed Makefile variable ${MAKEFILE_REV}.

    The missing cscript/square.calc file has been restored.

    Fixed compiler errors and warnings related to GCC.
    In particular, gcc/9.3.1 and gcc/10.2.1 now compile
    calc without any compiler errors or warnings,
    even with -Werror -Wextra -pedantic.

    To print out information about the calc compliation
    environment, we added the following make rule:

	make calcinfo

    Improved how 'make debug' operates.

    Moved help/contrib to CONTRIB-CODE.  The help/contrib file
    is now build from a copy of CONTRIB-CODE.

    Created a new calc bug report Email address.  Created a new calc
    question Email address.  Created a new calc contribution Email
    address.  See the BUGS file for details.

    Added "help questions" to print the QUESIONS help file.

    If the environment variable $CALCHELP is defined and is non-empty,
    then calc help files will be in the direcgory by the $CALCHISTFILE
    environment variable.

    If the environment variable $CALCCUSTOMHELP is defined and is
    non-empty, then custom calc help files will be in the direcgory
    by the $CALCCUSTOMHELP environment variable.

    The calc-tester mailing list has been retired.  See:

	* How to submit a calc bug report:

	    http://www.isthe.com/chongo/tech/comp/calc/calc-bugrept.html

	* How to contribute code to calc:

	    http://www.isthe.com/chongo/tech/comp/calc/calc-contrib.html

	* How to submit a question about calc:

	    http://www.isthe.com/chongo/tech/comp/calc/calc-question.html
2021-02-12 15:50:39 -08:00
Landon Curt Noll
ae3a6129b2 Release 2.12.7.5
Final cleanup for the calc version 2.12.7.5 release.
2021-02-03 03:24:47 -08:00
Landon Curt Noll
41803b878e Added use of $CALCHISTFILE and start of 2.12.7.5
By default, the calc history file is located in ~/.calc_history.
Now, if the environment variable $CALCHISTFILE is defined
and is non-empty, then calc history file will be defined
by the $CALCHISTFILE environment variable.
2021-02-03 00:51:56 -08:00
Landon Curt Noll
ccfa797b68 Changes as per calc 2.12.7.3 2021-02-02 20:33:59 -08:00
Landon Curt Noll
c8705c1198 Release calc 2.12.6.8
The following are the changes in this release:

    For historical purposes, in lucas.cal, gen_v1(1, n) always returns 4.

    Fixed some compiler warnings, thanks to a report by Mike
    <michael dot d dot ince at gmail dot com>.

    Added work around for a gcc warning bug, thanks to a report by Mike
    <michael dot d dot ince at gmail dot com>.

    Fixed errors in various help files such as:

	mat randbit seed srandom types

    Removed the MAXSTRING symbol because it was no longer used by calc.

    Increased HIST_SIZE (depth of the history stack) from 10k to 32k.

    Increased TTYSIZE (reallocation size for terminal buffers) from 100 to 8191.

    Increased MAXDEPTH (maximum depth of input stack) from 10 to 255.

    Increased interactive input buffer size from 1024 to 256k.  This has the
    effect of increasing the maximum length of an input line from a tty.
    This helps with an interactive bug that was reported by Ruslan Kabatsayev
    (b7 dot 10110111 at gmail dot com).

    The calc man page indicates that -d also disables the printing of the
    leading tilde.

    Added information to "help command" about how to silence messages
    while reading calc resource files.

    Fixed an error message buffer overflow thanks to a report by
    Frank Peters <nlp at northernlightsphoto dot biz>.

    Replaced all use of the C funcion sprintf() with snprintf().
    Replaced all use of the C funcion vsprintf() with vsnprintf().
    Replaced all DONT_HAVE_VSPRINTF with DONT_HAVE_VSNPRINTF.
    Replaced all Makefile var ${HAVE_VSPRINTF} with ${HAVE_VSNPRINTF}.
2018-09-30 10:25:18 -07:00
Landon Curt Noll
1c20261b93 Fixed macro warning about ./myfile 2017-09-07 14:28:54 -07:00
Landon Curt Noll
1363b58060 Fixed reading from stdin with calc -p 2017-05-25 17:24:57 -07:00
Landon Curt Noll
a31078bbec Remove all RCS @(#) lines and RCS strings
Some folks might think: “you still use RCS”?!?  And we will say,
hey, at least we switched from SCCS to RCS back in … I think it was
around 1994 ... at least we are keeping up! :-) :-) :-)

Logs say that SCCS version 18 became RCS version 19 on 1994 March 18.

RCS served us well.  But now it is time to move on.   And so we are
switching to git.

Calc releases produce a lot of file changes.  In the 125 releases
of calc since 1996, when I started managing calc releases, there
have been 15473 file mods!
2017-05-23 01:33:23 -07:00
Landon Curt Noll
1ae2f953d3 Release calc version 2.12.5.0 2017-05-21 15:39:00 -07:00
Landon Curt Noll
17e3535595 Release calc version 2.12.4.10 2017-05-21 15:38:58 -07:00
Landon Curt Noll
7f125396c1 Release calc version 2.12.4.9 2017-05-21 15:38:57 -07:00
Landon Curt Noll
c9fce6a5bb Release calc version 2.12.4.1 2017-05-21 15:38:56 -07:00
Landon Curt Noll
5bada5fefd Release calc version 2.12.4.6 2017-05-21 15:38:55 -07:00
Landon Curt Noll
b3648f030f Release calc version 2.12.2.2 2017-05-21 15:38:51 -07:00
Landon Curt Noll
ca0dd4560b Release calc version 2.12.2 2017-05-21 15:38:50 -07:00
Landon Curt Noll
810e541281 Release calc version 2.12.1.8 2017-05-21 15:38:49 -07:00
Landon Curt Noll
9d62873a02 Release calc version 2.12.0.2 2017-05-21 15:38:46 -07:00
Landon Curt Noll
7165fa17c7 Release calc version 2.11.11 2017-05-21 15:38:45 -07:00
Landon Curt Noll
64a732b678 Release calc version 2.11.10.1 2017-05-21 15:38:45 -07:00
Landon Curt Noll
a6a37f9cad Release calc version 2.11.10 2017-05-21 15:38:45 -07:00
Landon Curt Noll
66c3d26611 Release calc version 2.11.9 2017-05-21 15:38:44 -07:00
Landon Curt Noll
b4952bd44f Release calc version 2.11.8.1 2017-05-21 15:38:44 -07:00
Landon Curt Noll
0d06d90751 Release calc version 2.11.8 2017-05-21 15:38:43 -07:00
Landon Curt Noll
8db4e7af47 Release calc version 2.11.6.3 2017-05-21 15:38:43 -07:00
Landon Curt Noll
383290a844 Release calc version 2.11.5.8 2017-05-21 15:38:42 -07:00
Landon Curt Noll
7e40db44e3 Release calc version 2.11.5.7 2017-05-21 15:38:42 -07:00
Landon Curt Noll
ad44f1e3ab Release calc version 2.11.5t4.2 2017-05-21 15:38:41 -07:00
Landon Curt Noll
59837e385c Release calc version 2.11.5t2.1 2017-05-21 15:38:40 -07:00
Landon Curt Noll
61dd47526f Release calc version 2.11.2t1.0 2017-05-21 15:38:38 -07:00
Landon Curt Noll
0521ed202f Release calc version 2.11.1t2 2017-05-21 15:38:37 -07:00
Landon Curt Noll
6f5e8bf1b6 Release calc version 2.11.1t1 2017-05-21 15:38:36 -07:00
Landon Curt Noll
0514dc0de9 Release calc version 2.11.0t10.5.1 2017-05-21 15:38:36 -07:00
Landon Curt Noll
867002aa77 Release calc version 2.11.1 2017-05-21 15:38:35 -07:00
Landon Curt Noll
2c9b160dc5 Release calc version 2.11.0t10.4 2017-05-21 15:38:35 -07:00
Landon Curt Noll
96c34adee3 Release calc version 2.11.0t10 2017-05-21 15:38:33 -07:00
Landon Curt Noll
86c8e6dcf1 Release calc version 2.11.0t9.4.5 2017-05-21 15:38:33 -07:00
Landon Curt Noll
7cb0a77c25 Release calc version 2.11.0t9.4.1 2017-05-21 15:38:32 -07:00
Landon Curt Noll
df32e3956d Release calc version 2.11.0t9.3.1 2017-05-21 15:38:32 -07:00
Landon Curt Noll
75e742c716 Release calc version 2.11.0t9.2 2017-05-21 15:38:32 -07:00
Landon Curt Noll
9b6c308b42 Release calc version 2.11.0t8.9 2017-05-21 15:38:31 -07:00
Landon Curt Noll
2c72ea9339 Release calc version 2.11.0t8 2017-05-21 15:38:29 -07:00
Landon Curt Noll
0ffc341b10 Release calc version 2.11.0t7.5 2017-05-21 15:38:29 -07:00
Landon Curt Noll
9204d2fb8c Release calc version 2.11.0t7.2 2017-05-21 15:38:28 -07:00
Landon Curt Noll
6e10e97592 Release calc version 2.10.3t5.45 2017-05-21 15:38:25 -07:00
Landon Curt Noll
4618313a82 Release calc version 2.10.2t30 2017-05-21 15:38:25 -07:00