mirror of https://gitlab.com/rnger/amath
Compare commits
239 Commits
Author | SHA1 | Date |
---|---|---|
Carsten Sonne Larsen | 811644f4c7 | |
Carsten Sonne Larsen | d7fe11d56a | |
Carsten Sonne Larsen | d7add409cd | |
Carsten Sonne Larsen | d910b98571 | |
Carsten Sonne Larsen | ea2bf72d7b | |
Carsten Sonne Larsen | e788fec496 | |
Carsten Sonne Larsen | ffa586c694 | |
Carsten Sonne Larsen | 0240d3a439 | |
Carsten Sonne Larsen | 93c8fdbef4 | |
Carsten Sonne Larsen | dd7884bc22 | |
Carsten Sonne Larsen | 65fafb750f | |
Carsten Sonne Larsen | 2164e79aef | |
Carsten Sonne Larsen | 87c65aa678 | |
Carsten Sonne Larsen | 2c9e8bece3 | |
Carsten Sonne Larsen | ee26a57960 | |
Carsten Sonne Larsen | 538ad4ac23 | |
Carsten Sonne Larsen | 524f83f22f | |
Carsten Sonne Larsen | 9e712377a4 | |
Carsten Sonne Larsen | 6eb56b056e | |
Carsten Sonne Larsen | 3a52c27a9c | |
Carsten Larsen | f8cf191a46 | |
Carsten Sonne Larsen | aeb7f2e92c | |
Carsten Sonne Larsen | 49b36ce2a3 | |
Carsten Sonne Larsen | f7de7b1447 | |
Carsten Sonne Larsen | d4ad72d17f | |
Carsten Sonne Larsen | 8632644b9d | |
Carsten Sonne Larsen | 9c70be649b | |
Carsten Sonne Larsen | fb19bb560d | |
Carsten Sonne Larsen | 527376a92a | |
Carsten Sonne Larsen | 970ae6456f | |
Carsten Sonne Larsen | 56d9566000 | |
Carsten Sonne Larsen | 16530a94d1 | |
Carsten Sonne Larsen | 882eb43a4f | |
Carsten Sonne Larsen | 7114efc1cc | |
Carsten Sonne Larsen | e64c56123d | |
Carsten Sonne Larsen | 2cdc5b8aae | |
Carsten Sonne Larsen | b76a2dccc5 | |
Carsten Sonne Larsen | 656038d482 | |
Carsten Larsen | c625ec29f7 | |
Carsten Larsen | 4aae661801 | |
Carsten Larsen | 3f75c41166 | |
Carsten Larsen | 51e6ece52d | |
Carsten Larsen | 1a2ef9b018 | |
Carsten Larsen | 012c0ee1a6 | |
Carsten Larsen | f78304c8e1 | |
Carsten Larsen | 9e2d708eb7 | |
Carsten Larsen | 36fd6e090d | |
Carsten Larsen | 49b6ecd09d | |
Carsten Larsen | 4b44d05953 | |
Carsten Larsen | 263636bb04 | |
Carsten Larsen | 70c6ae9579 | |
Carsten Larsen | 4085981ca7 | |
Carsten Larsen | 69377b26ed | |
Carsten Larsen | 7431e61c3c | |
Carsten Larsen | e73cce1894 | |
Carsten Larsen | 2a00f9556d | |
Carsten Larsen | a1b521840a | |
Carsten Larsen | 30a23a4e0f | |
Carsten Larsen | 258188d994 | |
Carsten Larsen | bf39a0c868 | |
Carsten Larsen | 0118d94326 | |
Carsten Larsen | f3dd6d8baa | |
Carsten Larsen | a301c85e15 | |
Carsten Larsen | 87f0d88b26 | |
Carsten Larsen | dd6e11cdb4 | |
Carsten Larsen | 9144b77c70 | |
Carsten Larsen | e7b46a06be | |
Carsten Larsen | 8c1a88ebe7 | |
Carsten Larsen | 217d70e23a | |
Carsten Larsen | 28c1559ed0 | |
Carsten Larsen | dc26550dd5 | |
Carsten Larsen | 397c6c37c9 | |
Carsten Larsen | dadd23aea8 | |
Carsten Larsen | 34c843f2b5 | |
Carsten Larsen | 3483dd5283 | |
Carsten Larsen | 667fe2baeb | |
Carsten Larsen | 88301bafc5 | |
Carsten Larsen | b896dab8a8 | |
Carsten Larsen | 818df0fc87 | |
Carsten Larsen | d148be57b3 | |
Carsten Larsen | e988bbbd9f | |
Carsten Larsen | af7bf8a97a | |
Carsten Larsen | a56173487f | |
Carsten Larsen | 62f29f1e0e | |
Carsten Larsen | aec499543d | |
Carsten Larsen | e10734c005 | |
Carsten Larsen | abd4bb8929 | |
Carsten Larsen | eb1d7f74e4 | |
Carsten Larsen | bd4baa277f | |
Carsten Larsen | 3f94ebc6b0 | |
Carsten Larsen | 11b4bdc70d | |
Carsten Larsen | 83760eb15a | |
Carsten Larsen | 57e74e12b0 | |
Carsten Larsen | 1551700ec1 | |
Carsten Larsen | 81ba8a83e2 | |
Carsten Larsen | 5c041e7762 | |
Carsten Larsen | dc5d092c4e | |
Carsten Larsen | 7a63687d4b | |
Carsten Larsen | 86d5a56fa7 | |
Carsten Larsen | 848b9f1987 | |
Carsten Larsen | 8b81543eed | |
Carsten Larsen | 2bbebe575f | |
Carsten Larsen | 7d48450bbf | |
Carsten Larsen | b173f42b65 | |
Carsten Larsen | 637b9396d9 | |
Carsten Larsen | 3776c6e02e | |
Carsten Larsen | c53ef12905 | |
Carsten Larsen | b3ac61bae3 | |
Carsten Larsen | d134ad9765 | |
Carsten Larsen | 9e2c66af53 | |
Carsten Larsen | 1392de9ad7 | |
Carsten Larsen | 7e218a1b70 | |
Carsten Larsen | 4c25f8d2fb | |
Carsten Larsen | 543f813251 | |
Carsten Larsen | bdae119905 | |
Carsten Larsen | a16a3b7419 | |
Carsten Larsen | 9ebb77637f | |
Carsten Larsen | 95057d82db | |
Carsten Larsen | 75c588f51b | |
Carsten Larsen | 462ea4ceba | |
Carsten Larsen | 672712ab49 | |
Carsten Larsen | ab0c5db51d | |
Carsten Larsen | b85a008fb2 | |
Carsten Larsen | 40cc850093 | |
Carsten Larsen | afbfd236a4 | |
Carsten Larsen | 25c618d57f | |
Carsten Larsen | 4aefa785ad | |
Carsten Larsen | 957355545e | |
Carsten Larsen | 927fc656dd | |
Carsten Larsen | f1e2979d7a | |
Carsten Larsen | d7eca35395 | |
Carsten Larsen | 281317d503 | |
Carsten Larsen | 3ae8e58f2b | |
Carsten Larsen | f4d99b69de | |
Carsten Larsen | bcb3611f14 | |
Carsten Larsen | ded1be8026 | |
Carsten Larsen | b402fff504 | |
Carsten Larsen | a1a5aea15e | |
Carsten Larsen | aff002dbda | |
Carsten Larsen | 259f73d19e | |
Carsten Larsen | 41ae34644d | |
Carsten Larsen | e83f879211 | |
Carsten Larsen | 70fee59186 | |
Carsten Larsen | 79c0de3575 | |
Carsten Larsen | 441bed5c99 | |
Carsten Larsen | 910b5a7cd9 | |
Carsten Larsen | a08d724997 | |
Carsten Larsen | bc94803f91 | |
Carsten Larsen | 2b786bef20 | |
Carsten Larsen | cbb6c747f6 | |
Carsten Larsen | 65f9d88562 | |
Carsten Larsen | 4ea2b3af84 | |
Carsten Larsen | 340a99d861 | |
Carsten Sonne Larsen | 3ea3222b91 | |
Carsten Sonne Larsen | 0651330e08 | |
Carsten Sonne Larsen | 3010a67d7f | |
Carsten | 4228b95303 | |
llsth | bf8cc0b222 | |
llsth | ffe9553471 | |
llsth | b711e8aeab | |
Carsten Sonne Larsen | 1752f2c546 | |
llsth | 2478847bd9 | |
llsth | b26c5c81c9 | |
llsth | e310c982d0 | |
llsth | 9780e8b1c5 | |
llsth | 617a418a91 | |
llsth | 0760eaa798 | |
llsth | 28b94bfaf4 | |
llsth | e00ce964ae | |
llsth | 9d85d4c699 | |
llsth | cba2829664 | |
llsth | 7bb7b4e955 | |
llsth | f9a09c4bad | |
llsth | 390ff27017 | |
llsth | b5ca35438d | |
llsth | 2adc0edd4c | |
llsth | 37d2ba4794 | |
llsth | a633d5d06a | |
llsth | be6681d3f0 | |
llsth | b3753232f2 | |
llsth | fa1f153127 | |
llsth | 4c512addad | |
llsth | 2f28be077b | |
llsth | af1681cc87 | |
llsth | 9121566b52 | |
llsth | 26eb3d5cda | |
llsth | 385073a256 | |
llsth | 58121f8c01 | |
llsth | b35b9acde3 | |
llsth | f30729980e | |
llsth | 194830b64c | |
llsth | 12657aab90 | |
llsth | 6af581bbe4 | |
Carsten Sonne Larsen | c325bd29bc | |
llsth | 9cb7ef34a8 | |
llsth | 449e0c8473 | |
llsth | 4a0cba78cc | |
llsth | 048f20a717 | |
llsth | 9a7af719d6 | |
llsth | 76c315bfd0 | |
llsth | 6b4ae56c8a | |
llsth | c647e003d2 | |
llsth | c27ee67707 | |
llsth | f1bcdda6dc | |
llsth | 5b851eee7c | |
llsth | 8624d62494 | |
llsth | 5886946f1d | |
llsth | 9d2de4b700 | |
llsth | 4efc38b6b8 | |
llsth | f29f311ff6 | |
llsth | 05efc36c6f | |
llsth | d7f8c6cbd3 | |
llsth | c80e7c0101 | |
llsth | f445eef190 | |
llsth | e45fae685c | |
llsth | 2c2671df31 | |
llsth | c918ff89e8 | |
llsth | 00acfc11e7 | |
llsth | bcf936f4a8 | |
llsth | 280e020a20 | |
llsth | 5cc10f9e38 | |
llsth | 10860fb996 | |
llsth | e73a42b69a | |
llsth | e8b7ad9720 | |
llsth | a99e32c5df | |
llsth | bc4d88d894 | |
carsten | da3ea85e80 | |
llsth | d7b73eb2d2 | |
llsth | 7b88f3119c | |
llsth | c19d50f03e | |
llsth | 89f78a5cdc | |
llsth | 3ab236f0b0 | |
llsth | 2ee6693905 | |
Carsten Sonne Larsen | cef3b88d61 | |
Carsten Sonne Larsen | 1ca6893513 | |
Carsten Sonne Larsen | 02deed1853 | |
Carsten Sonne Larsen | a60b55e01b | |
Carsten Sonne Larsen | 904620e599 | |
Carsten Sonne Larsen | b077d77668 |
|
@ -17,3 +17,4 @@ doxygen.warn
|
||||||
*.deb
|
*.deb
|
||||||
*.zip
|
*.zip
|
||||||
Makefile
|
Makefile
|
||||||
|
/dist
|
||||||
|
|
|
@ -0,0 +1,19 @@
|
||||||
|
{
|
||||||
|
"configurations": [
|
||||||
|
{
|
||||||
|
"name": "amiga",
|
||||||
|
"includePath": [
|
||||||
|
"/opt/amiga/m68k-amigaos/ndk-include/",
|
||||||
|
"/opt/amiga/m68k-amigaos/clib2/include/",
|
||||||
|
"${workspaceFolder}/src/lib/"
|
||||||
|
],
|
||||||
|
"defines": ["AMIGA"],
|
||||||
|
"compilerPath": "/opt/amiga/bin/m68k-amigaos-gcc",
|
||||||
|
"cStandard": "c99",
|
||||||
|
"cppStandard": "c++98",
|
||||||
|
"intelliSenseMode": "${default}",
|
||||||
|
"compilerArgs": []
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"version": 4
|
||||||
|
}
|
8
HISTORY
8
HISTORY
|
@ -1,6 +1,12 @@
|
||||||
amath release history
|
amath release history
|
||||||
|
|
||||||
v1.8.4 August 05 2017
|
v1.9.0 January 11 2021
|
||||||
|
- AmigaOS ARexx interface.
|
||||||
|
|
||||||
|
v1.8.5 August 07 2018
|
||||||
|
- Fix build on compilers with broken endian detection.
|
||||||
|
|
||||||
|
v1.8.4 August 05 2018
|
||||||
- Ignore casing in hexadecimal numbers.
|
- Ignore casing in hexadecimal numbers.
|
||||||
|
|
||||||
v1.8.3 July 21 2017
|
v1.8.3 July 21 2017
|
||||||
|
|
2
LICENSE
2
LICENSE
|
@ -1,5 +1,5 @@
|
||||||
|
|
||||||
Copyright (c) 2014-2018 Carsten Sonne Larsen <cs@innolan.net>
|
Copyright (c) 2014-2021 Carsten Sonne Larsen <cs@innolan.net>
|
||||||
Copyright (c) 2007 The NetBSD Foundation, Inc.
|
Copyright (c) 2007 The NetBSD Foundation, Inc.
|
||||||
Copyright (c) 1990, 1993 The Regents of the University of California.
|
Copyright (c) 1990, 1993 The Regents of the University of California.
|
||||||
All rights reserved.
|
All rights reserved.
|
||||||
|
|
4
amath.1
4
amath.1
|
@ -1,4 +1,4 @@
|
||||||
.\" Copyright (c) 2014-2018 Carsten Sonne Larsen <cs@innolan.net>
|
.\" Copyright (c) 2014-2021 Carsten Sonne Larsen <cs@innolan.net>
|
||||||
.\" All rights reserved.
|
.\" All rights reserved.
|
||||||
.\"
|
.\"
|
||||||
.\" Redistribution and use in source and binary forms, with or without
|
.\" Redistribution and use in source and binary forms, with or without
|
||||||
|
@ -20,7 +20,7 @@
|
||||||
.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||||
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
.TH amath 1 "Version 1.8.4" "August 05 2018"
|
.TH amath 1 "Version 1.9.0" "January 11 2021"
|
||||||
.SH NAME
|
.SH NAME
|
||||||
amath \- Simple command line calculator
|
amath \- Simple command line calculator
|
||||||
.SH SYNOPSIS
|
.SH SYNOPSIS
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
|
|
||||||
DOXYFILE_ENCODING = UTF-8
|
DOXYFILE_ENCODING = UTF-8
|
||||||
PROJECT_NAME = "amath"
|
PROJECT_NAME = "amath"
|
||||||
PROJECT_NUMBER = "1.8.4"
|
PROJECT_NUMBER = "1.9.0"
|
||||||
PROJECT_BRIEF = "Simple command line calculator"
|
PROJECT_BRIEF = "Simple command line calculator"
|
||||||
PROJECT_LOGO =
|
PROJECT_LOGO =
|
||||||
OUTPUT_DIRECTORY = ../amath-doc
|
OUTPUT_DIRECTORY = ../amath-doc
|
||||||
|
@ -156,12 +156,12 @@ EXT_LINKS_IN_WINDOW = NO
|
||||||
FORMULA_FONTSIZE = 10
|
FORMULA_FONTSIZE = 10
|
||||||
FORMULA_TRANSPARENT = YES
|
FORMULA_TRANSPARENT = YES
|
||||||
USE_MATHJAX = NO
|
USE_MATHJAX = NO
|
||||||
SEARCHENGINE = YES
|
SEARCHENGINE = NO
|
||||||
SERVER_BASED_SEARCH = NO
|
SERVER_BASED_SEARCH = NO
|
||||||
EXTERNAL_SEARCH = NO
|
EXTERNAL_SEARCH = NO
|
||||||
SEARCHDATA_FILE = searchdata.xml
|
SEARCHDATA_FILE = searchdata.xml
|
||||||
|
|
||||||
GENERATE_MAN = YES
|
GENERATE_MAN = NO
|
||||||
MAN_OUTPUT = man
|
MAN_OUTPUT = man
|
||||||
MAN_EXTENSION = .3
|
MAN_EXTENSION = .3
|
||||||
MAN_SUBDIR =
|
MAN_SUBDIR =
|
||||||
|
|
|
@ -0,0 +1,4 @@
|
||||||
|
/* Test program */
|
||||||
|
Options RESULTS
|
||||||
|
Address AMATH.1 '1.1+1.8'
|
||||||
|
SAY (RESULT)
|
|
@ -0,0 +1,166 @@
|
||||||
|
NAME
|
||||||
|
amath - Simple command line calculator
|
||||||
|
|
||||||
|
SYNOPSIS
|
||||||
|
[ --noansi ] [ --shell | expression ]
|
||||||
|
|
||||||
|
DESCRIPTION
|
||||||
|
amath features a case sensitive command line interface, internal IEEE
|
||||||
|
754 calculations with 15 significant digits, calculations with real and
|
||||||
|
complex numbers, variables and user defined functions, logarithmic and
|
||||||
|
exponential functions, trigonometric and hyperbolic function and
|
||||||
|
selected mathematical constants and rounding functions.
|
||||||
|
|
||||||
|
OPTIONS
|
||||||
|
--noansi
|
||||||
|
Disable output of ANSI escape codes. Default is enable.
|
||||||
|
|
||||||
|
--shell
|
||||||
|
Open an interactive shell.
|
||||||
|
|
||||||
|
OPERATORS
|
||||||
|
+ Mathematical addition
|
||||||
|
- Mathematical subtraction
|
||||||
|
* Mathematical multiplication
|
||||||
|
/ Mathematical division
|
||||||
|
^ Mathematical exponentiation
|
||||||
|
= Assignment of variable values
|
||||||
|
| Absolute value of number
|
||||||
|
|
||||||
|
VARIABLES AND CONSTANT
|
||||||
|
pi Trigonometric constant
|
||||||
|
e Euler's number
|
||||||
|
i Imaginary unit
|
||||||
|
ins Result of last calculation
|
||||||
|
|
||||||
|
MISCELLANEOUS FUNCTIONS
|
||||||
|
abs Absolute value of number
|
||||||
|
sgn Mathematical signum function
|
||||||
|
round Round to nearest integer number
|
||||||
|
trunc Discard fraction part of number
|
||||||
|
floor Mathematical floor function
|
||||||
|
ceil Mathematical ceiling function
|
||||||
|
sqrt Square root function (exp 1/2)
|
||||||
|
cbrt Cube root function (exp 1/3)
|
||||||
|
lb Binary logarithm function (base 2)
|
||||||
|
ln Natural logarithm function (base e)
|
||||||
|
lg Common logarithm function (base 10)
|
||||||
|
|
||||||
|
TRIGONOMETRIC FUNCTIONS
|
||||||
|
sin Trigonometric sine function
|
||||||
|
cos Trigonometric cosine function
|
||||||
|
tan Trigonometric tangent function
|
||||||
|
cot Trigonometric cotangent function
|
||||||
|
sec Trigonometric secant function
|
||||||
|
csc Trigonometric cosecant function
|
||||||
|
crd Trigonometric chord function
|
||||||
|
exsec Trigonometric exsecant function
|
||||||
|
excsc Trigonometric excosecant function
|
||||||
|
arcsin Inverse trigonometric sine function
|
||||||
|
arccos Inverse trigonometric cosine function
|
||||||
|
arctan Inverse trigonometric tangent function
|
||||||
|
arccot Inverse trigonometric cotangent function
|
||||||
|
arcsec Inverse trigonometric secant function
|
||||||
|
arccsc Inverse trigonometric cosecant function
|
||||||
|
arccrd Inverse trigonometric chord function
|
||||||
|
arcexsec Inverse trigonometric exsecant function
|
||||||
|
arcexcsc Inverse trigonometric excosecant function
|
||||||
|
|
||||||
|
HYPERBOLIC FUNCTIONS
|
||||||
|
sinh Hyperbolic sine function
|
||||||
|
cosh Hyperbolic cosine function
|
||||||
|
tanh Hyperbolic tangent function
|
||||||
|
coth Hyperbolic cotangent function
|
||||||
|
sech Hyperbolic secant function
|
||||||
|
csch Hyperbolic cosecant function
|
||||||
|
arcsinh Inverse hyperbolic sine function
|
||||||
|
arccosh Inverse hyperbolic cosine function
|
||||||
|
arctanh Inverse hyperbolic tangent function
|
||||||
|
arccoth Inverse hyperbolic cotangent function
|
||||||
|
arcsech Inverse hyperbolic secant function
|
||||||
|
arccsch Inverse hyperbolic cosecant function
|
||||||
|
|
||||||
|
EARLY TRIGONOMETRIC FUNCTIONS
|
||||||
|
ver Versed sine function
|
||||||
|
vcs Versed cosine function
|
||||||
|
cvs Coversed sine function
|
||||||
|
cvc Coversed cosine function
|
||||||
|
hv Haversed sine function
|
||||||
|
hvc Haversed cosine function
|
||||||
|
hcv Hacoversed sine function
|
||||||
|
hcc Hacoversed cosine function
|
||||||
|
arcver Inverse versed sine function
|
||||||
|
arcvcs Inverse versed cosine function
|
||||||
|
arccvs Inverse coversed sine function
|
||||||
|
arccvc Inverse coversed cosine function
|
||||||
|
archv Inverse haversed sine function
|
||||||
|
archvc Inverse haversed cosine function
|
||||||
|
archcv Inverse hacoversed sine function
|
||||||
|
archcc Inverse hacoversed cosine function
|
||||||
|
|
||||||
|
STATEMENTS
|
||||||
|
about Show about text
|
||||||
|
clear Clear console window
|
||||||
|
def Define function
|
||||||
|
delete Delete variable or function
|
||||||
|
digits Set number of significant digits
|
||||||
|
eval Evaluate arithmetic expression
|
||||||
|
execute Execute statements in a file
|
||||||
|
functions Show list of user defined functions
|
||||||
|
input Change numeral input system
|
||||||
|
help Show basic help text
|
||||||
|
output Change numeral output system
|
||||||
|
list Show content of a directory
|
||||||
|
show Show content of a file
|
||||||
|
load Load variable and functions from file
|
||||||
|
save Save variable and functions to file
|
||||||
|
variables Show list of variables
|
||||||
|
version Show version string
|
||||||
|
license Show copyright and license texts
|
||||||
|
memory Show internal memory usage
|
||||||
|
exit Exit program
|
||||||
|
|
||||||
|
EXIT STATUS
|
||||||
|
amath exits 0 on success and >0 if an error occurs.
|
||||||
|
|
||||||
|
EXAMPLES
|
||||||
|
Add two numbers:
|
||||||
|
$ amath 1.3 + 2.6
|
||||||
|
|
||||||
|
Find cosine of pi/2:
|
||||||
|
$ amath "cos(pi/2)"
|
||||||
|
|
||||||
|
Find square root of minus 25:
|
||||||
|
$ amath "sqrt(-25)"
|
||||||
|
|
||||||
|
Show only 5 digits in the result of a division:
|
||||||
|
$ amath "digits 5;34/11"
|
||||||
|
|
||||||
|
Script block with functions:
|
||||||
|
round(1.5461);round(-1.5461);
|
||||||
|
ceil(43.5461);ceil(-43.5461);
|
||||||
|
floor(39.9531);floor(-39.9531);
|
||||||
|
trunc(23.827);trunc(-23.827);
|
||||||
|
sqrt(100);sqrt(52.23);
|
||||||
|
|
||||||
|
Script block with user defined functions:
|
||||||
|
f(x)=x*2+1;
|
||||||
|
g(y)=y^2+y*1.5+2;
|
||||||
|
a=2;b=3;c=a+b;
|
||||||
|
f(2.2);c+1.1;
|
||||||
|
|
||||||
|
BUGS
|
||||||
|
Please report any other bugs that you encounter via:
|
||||||
|
https://gitlab.com/rnger/amath/issues.
|
||||||
|
|
||||||
|
HOMEPAGE
|
||||||
|
https://amath.innolan.net/
|
||||||
|
|
||||||
|
AUTHORS
|
||||||
|
Written by Carsten Sonne Larsen <cs@innolan.net>. Floating point to
|
||||||
|
string conversion is based on software written by Ryan Juckett. The
|
||||||
|
code in complex calculations is derived from software written by
|
||||||
|
Stephen L. Moshier. The code in MemSet and MemCopy is derived from
|
||||||
|
software contributed to Berkeley by Mike Hibler and Chris Torek.
|
||||||
|
|
||||||
|
January 11 2021 Version 1.9.0
|
|
@ -0,0 +1,41 @@
|
||||||
|
Short: Simple command line calculator
|
||||||
|
Author: Carsten Larsen
|
||||||
|
Uploader: carsten.larsen@mail.com
|
||||||
|
Type: misc/math
|
||||||
|
Version: 1.9.0
|
||||||
|
Architecture: m68k-amigaos >= 2.04
|
||||||
|
URL: https://amath.innolan.net
|
||||||
|
|
||||||
|
Features
|
||||||
|
========
|
||||||
|
|
||||||
|
- Case sensitive command line interface
|
||||||
|
- Native IEEE 754 with 15 significant digits
|
||||||
|
- Calculations with real and complex numbers
|
||||||
|
- Variables and user defined functions
|
||||||
|
- Logarithmic and exponential functions
|
||||||
|
- Trigonometric and hyperbolic functions
|
||||||
|
- Mathematical constants and rounding functions
|
||||||
|
- Disk functions to load, save and view content
|
||||||
|
- Comprehensive and easy to use builtin help
|
||||||
|
- Optimized 68000, 68020 and 68030 versions
|
||||||
|
- Unlimited number of ARexx interfaces
|
||||||
|
- Freely distributable sources (BSD license)
|
||||||
|
|
||||||
|
Usage
|
||||||
|
=====
|
||||||
|
|
||||||
|
Open amath in its own window:
|
||||||
|
> amath
|
||||||
|
|
||||||
|
Do a calculation in shell:
|
||||||
|
> amath 1.2+1.4
|
||||||
|
|
||||||
|
Get an interactive prompt in shell:
|
||||||
|
> amath shell
|
||||||
|
|
||||||
|
Show version string:
|
||||||
|
> amath version
|
||||||
|
|
||||||
|
Run regression tests:
|
||||||
|
> amath --test
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -0,0 +1,32 @@
|
||||||
|
#! /bin/sh
|
||||||
|
|
||||||
|
# This file is in the public domain, so clarified as of
|
||||||
|
# 2009-05-17 by Arthur David Olson.
|
||||||
|
|
||||||
|
# Tell groff not to emit SGR escape sequences (ANSI color escapes).
|
||||||
|
GROFF_NO_SGR=1
|
||||||
|
export GROFF_NO_SGR
|
||||||
|
|
||||||
|
echo ".am TH
|
||||||
|
.hy 0
|
||||||
|
.na
|
||||||
|
..
|
||||||
|
.rm }H
|
||||||
|
.rm }F" | nroff -man - ${1+"$@"} | perl -ne '
|
||||||
|
binmode STDIN, '\'':encoding(utf8)'\'';
|
||||||
|
binmode STDOUT, '\'':encoding(utf8)'\'';
|
||||||
|
chomp;
|
||||||
|
s/.\010//g;
|
||||||
|
s/\s*$//;
|
||||||
|
if (/^$/) {
|
||||||
|
$sawblank = 1;
|
||||||
|
next;
|
||||||
|
} else {
|
||||||
|
if ($sawblank && $didprint) {
|
||||||
|
print "\n";
|
||||||
|
$sawblank = 0;
|
||||||
|
}
|
||||||
|
print "$_\n";
|
||||||
|
$didprint = 1;
|
||||||
|
}
|
||||||
|
'
|
6
builddeb
6
builddeb
|
@ -1,6 +1,6 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
#
|
#
|
||||||
# Copyright {c} 2014-2018 Carsten Sonne Larsen <cs@innolan.net>
|
# Copyright {c} 2014-2021 Carsten Sonne Larsen <cs@innolan.net>
|
||||||
# All rights reserved.
|
# All rights reserved.
|
||||||
#
|
#
|
||||||
# Redistribution and use in source and binary forms, with or without
|
# Redistribution and use in source and binary forms, with or without
|
||||||
|
@ -30,7 +30,7 @@
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
version="1.8.4"
|
version="1.9.0"
|
||||||
|
|
||||||
build_package () {
|
build_package () {
|
||||||
|
|
||||||
|
@ -105,7 +105,7 @@ echo "Upstream-Name: amath"
|
||||||
echo "Source: https://amath.innolan.net"
|
echo "Source: https://amath.innolan.net"
|
||||||
echo
|
echo
|
||||||
echo "Files: *"
|
echo "Files: *"
|
||||||
echo "Copyright: 2014-2018 Carsten Sonne Larsen <cs@innolan.net>"
|
echo "Copyright: 2014-2021 Carsten Sonne Larsen <cs@innolan.net>"
|
||||||
echo " 2007 The NetBSD Foundation, Inc."
|
echo " 2007 The NetBSD Foundation, Inc."
|
||||||
echo " 1990, 1993 The Regents of the University of California."
|
echo " 1990, 1993 The Regents of the University of California."
|
||||||
echo "License: BSD-2-Clause"
|
echo "License: BSD-2-Clause"
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
#
|
#
|
||||||
# Copyright {c} 2014-2018 Carsten Sonne Larsen <cs@innolan.net>
|
# Copyright {c} 2014-2021 Carsten Sonne Larsen <cs@innolan.net>
|
||||||
# All rights reserved.
|
# All rights reserved.
|
||||||
#
|
#
|
||||||
# Redistribution and use in source and binary forms, with or without
|
# Redistribution and use in source and binary forms, with or without
|
||||||
|
@ -32,7 +32,7 @@
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
version="1.8.4"
|
version="1.9.0"
|
||||||
|
|
||||||
build_package () {
|
build_package () {
|
||||||
|
|
||||||
|
@ -149,7 +149,7 @@ echo "Upstream-Name: amath-dev"
|
||||||
echo "Source: https://amath.innolan.net"
|
echo "Source: https://amath.innolan.net"
|
||||||
echo
|
echo
|
||||||
echo "Files: *"
|
echo "Files: *"
|
||||||
echo "Copyright: 2014-2018 Carsten Sonne Larsen <cs@innolan.net>"
|
echo "Copyright: 2014-2021 Carsten Sonne Larsen <cs@innolan.net>"
|
||||||
echo " 2007 The NetBSD Foundation, Inc."
|
echo " 2007 The NetBSD Foundation, Inc."
|
||||||
echo " 1990, 1993 The Regents of the University of California."
|
echo " 1990, 1993 The Regents of the University of California."
|
||||||
echo "License: BSD-2-Clause"
|
echo "License: BSD-2-Clause"
|
||||||
|
|
107
builddist
107
builddist
|
@ -1,69 +1,128 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
#
|
#
|
||||||
|
# Build Classic AmigaOS distribtion package
|
||||||
# This file is public domain
|
# This file is public domain
|
||||||
#
|
#
|
||||||
# Project homepage:
|
# Project homepage:
|
||||||
# https://amath.innolan.net
|
# https://amath.innolan.net
|
||||||
#
|
#
|
||||||
|
|
||||||
|
# Add compiler path before invoking. Fx:
|
||||||
|
# export PATH="/opt/m68k-amigaos/bin/:$PATH"
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
rm -f amath.lha
|
distdir="dist"
|
||||||
rm -Rf amath
|
builddir="tmp"
|
||||||
rm -Rf dist
|
bindir="bin"
|
||||||
mkdir dist
|
stamp="202101120000"
|
||||||
|
|
||||||
|
rm -Rf ${distdir}
|
||||||
|
rm -Rf ${builddir}
|
||||||
|
mkdir -p ${builddir}
|
||||||
|
|
||||||
|
# Build binaries
|
||||||
./configure --disable-test --disable-pic --cross-compile="m68k-amigaos" CFLAGS="-m68000 -noixemul"
|
./configure --disable-test --disable-pic --cross-compile="m68k-amigaos" CFLAGS="-m68000 -noixemul"
|
||||||
make clean
|
make clean
|
||||||
make static
|
make static
|
||||||
mv amath dist/amath.000
|
mv amath ${builddir}/amath
|
||||||
make clean
|
make clean
|
||||||
./configure --disable-test --disable-pic --cross-compile="m68k-amigaos" CFLAGS="-m68020 -noixemul"
|
./configure --disable-test --disable-pic --cross-compile="m68k-amigaos" CFLAGS="-m68020 -noixemul"
|
||||||
make static
|
make static
|
||||||
mv amath dist/amath.020
|
mv amath ${builddir}/amath.020
|
||||||
make clean
|
make clean
|
||||||
./configure --disable-test --disable-pic --cross-compile="m68k-amigaos" CFLAGS="-m68030 -noixemul"
|
./configure --disable-test --disable-pic --cross-compile="m68k-amigaos" CFLAGS="-m68030 -noixemul"
|
||||||
make static
|
make static
|
||||||
mv amath dist/amath.030
|
mv amath ${builddir}/amath.030
|
||||||
make clean
|
make clean
|
||||||
|
|
||||||
|
# Build test binaries
|
||||||
./configure --enable-test --disable-pic --cross-compile="m68k-amigaos" CFLAGS="-m68000 -noixemul"
|
./configure --enable-test --disable-pic --cross-compile="m68k-amigaos" CFLAGS="-m68000 -noixemul"
|
||||||
make static
|
make static
|
||||||
mv amath dist/amath-test.000
|
mv amath ${builddir}/amath-test
|
||||||
make clean
|
make clean
|
||||||
./configure --enable-test --disable-pic --cross-compile="m68k-amigaos" CFLAGS="-m68020 -noixemul"
|
./configure --enable-test --disable-pic --cross-compile="m68k-amigaos" CFLAGS="-m68020 -noixemul"
|
||||||
make static
|
make static
|
||||||
mv amath dist/amath-test.020
|
mv amath ${builddir}/amath-test.020
|
||||||
make clean
|
make clean
|
||||||
./configure --enable-test --disable-pic --cross-compile="m68k-amigaos" CFLAGS="-m68030 -noixemul"
|
./configure --enable-test --disable-pic --cross-compile="m68k-amigaos" CFLAGS="-m68030 -noixemul"
|
||||||
make static
|
make static
|
||||||
mv amath dist/amath-test.030
|
mv amath ${builddir}/amath-test.030
|
||||||
make clean
|
make clean
|
||||||
|
|
||||||
cd dist
|
# Build catalogs
|
||||||
|
make catalogs
|
||||||
|
make clean
|
||||||
|
|
||||||
|
# Build documentation
|
||||||
|
#./build/doc >${builddir}/amath.doc amath.1
|
||||||
|
groff >${builddir}/amath.html amath.1 -mandoc -Thtml
|
||||||
|
|
||||||
|
# Generate hashkeys
|
||||||
|
cd ${builddir}
|
||||||
touch hashkeys
|
touch hashkeys
|
||||||
sha1sum amath.000 >>hashkeys
|
sha1sum amath >>hashkeys
|
||||||
sha1sum amath.020 >>hashkeys
|
sha1sum amath.020 >>hashkeys
|
||||||
sha1sum amath.030 >>hashkeys
|
sha1sum amath.030 >>hashkeys
|
||||||
sha1sum amath-test.000 >>hashkeys
|
sha1sum amath-test >>hashkeys
|
||||||
sha1sum amath-test.020 >>hashkeys
|
sha1sum amath-test.020 >>hashkeys
|
||||||
sha1sum amath-test.030 >>hashkeys
|
sha1sum amath-test.030 >>hashkeys
|
||||||
sha256sum amath.000 >>hashkeys
|
sha256sum amath >>hashkeys
|
||||||
sha256sum amath.020 >>hashkeys
|
sha256sum amath.020 >>hashkeys
|
||||||
sha256sum amath.030 >>hashkeys
|
sha256sum amath.030 >>hashkeys
|
||||||
sha256sum amath-test.000 >>hashkeys
|
sha256sum amath-test >>hashkeys
|
||||||
sha256sum amath-test.020 >>hashkeys
|
sha256sum amath-test.020 >>hashkeys
|
||||||
sha256sum amath-test.030 >>hashkeys
|
sha256sum amath-test.030 >>hashkeys
|
||||||
cd ..
|
cd ..
|
||||||
|
|
||||||
make catalogs
|
# Build distribution directory structure
|
||||||
cp LICENSE dist/
|
mkdir -m 775 ${distdir}
|
||||||
cp HISTORY dist/
|
mkdir -m 775 ${distdir}/amath
|
||||||
|
mkdir -m 775 ${distdir}/amath/ARexx
|
||||||
|
mkdir -m 775 ${distdir}/amath/Catalog
|
||||||
|
mkdir -m 775 ${distdir}/amath/Catalog/english
|
||||||
|
mkdir -m 775 ${distdir}/amath/Script
|
||||||
|
mkdir -m 775 ${distdir}/amath/Test
|
||||||
|
|
||||||
mkdir dist/script
|
# Install icons
|
||||||
cp script/* dist/script/
|
install -m 664 ${bindir}/root/*.info ${distdir}/
|
||||||
date -Ru >dist/build_date
|
install -m 664 ${bindir}/prog/*.info ${distdir}/amath/
|
||||||
#uname -srmo >dist/build_host
|
install -m 664 ${bindir}/catalog/*.info ${distdir}/amath/Catalog/
|
||||||
|
install -m 664 ${bindir}/script/*.info ${distdir}/amath/Script/
|
||||||
|
|
||||||
mv dist amath
|
# Install documentation
|
||||||
#lha-ac a amath.lha amath
|
install -m 664 HISTORY ${distdir}/amath/
|
||||||
|
install -m 664 LICENSE ${distdir}/amath/
|
||||||
|
install -m 664 ${builddir}/hashkeys ${distdir}/amath/
|
||||||
|
install -m 664 ${builddir}/amath.html ${distdir}/amath/
|
||||||
|
install -m 664 ${bindir}/amath.doc ${distdir}/amath/
|
||||||
|
install -m 664 ${bindir}/amath.readme ${distdir}/amath/
|
||||||
|
|
||||||
|
# Install scripts
|
||||||
|
install -m 755 arexx/* ${distdir}/amath/ARexx/
|
||||||
|
install -m 755 script/* ${distdir}/amath/Script/
|
||||||
|
|
||||||
|
# Install binaries
|
||||||
|
install -m 755 ${builddir}/amath ${distdir}/amath/
|
||||||
|
install -m 755 ${builddir}/amath.020 ${distdir}/amath/
|
||||||
|
install -m 755 ${builddir}/amath.030 ${distdir}/amath/
|
||||||
|
install -m 755 ${builddir}/amath-test ${distdir}/amath/Test/
|
||||||
|
install -m 755 ${builddir}/amath-test.020 ${distdir}/amath/Test/
|
||||||
|
install -m 755 ${builddir}/amath-test.030 ${distdir}/amath/Test/
|
||||||
|
|
||||||
|
# Install catalogs
|
||||||
|
install -m 755 distcat/catalog/english/*.catalog ${distdir}/amath/Catalog/english/
|
||||||
|
|
||||||
|
# Sign build with date
|
||||||
|
date -Ru >${distdir}/amath/build_date
|
||||||
|
#uname -srmo >${distdir}/amath/build_host
|
||||||
|
|
||||||
|
for f in $(find ${distdir} -name '*'); do touch -amt ${stamp}.00 $f; done
|
||||||
|
|
||||||
|
# Cleanup
|
||||||
|
rm -Rf distcat
|
||||||
|
rm -Rf ${builddir}
|
||||||
|
|
||||||
|
# Install source
|
||||||
|
./buildsrc
|
||||||
|
mv amath-1.9.0 ${distdir}/
|
||||||
|
|
11
buildsrc
11
buildsrc
|
@ -1,5 +1,6 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
#
|
#
|
||||||
|
# Build source distribtion package
|
||||||
# This file is public domain
|
# This file is public domain
|
||||||
#
|
#
|
||||||
# Project homepage:
|
# Project homepage:
|
||||||
|
@ -8,14 +9,13 @@
|
||||||
|
|
||||||
# DO NOT USE THIS SCRIPT UNLESS YOU KNOW WHAT YOU ARE DOING !
|
# DO NOT USE THIS SCRIPT UNLESS YOU KNOW WHAT YOU ARE DOING !
|
||||||
|
|
||||||
version='1.8.4'
|
version='1.9.0'
|
||||||
stamp="201808050000"
|
stamp="202101120000"
|
||||||
srcdir="amath-rc"
|
srcdir="."
|
||||||
distdir="amath-${version}"
|
distdir="amath-${version}"
|
||||||
cd ..
|
|
||||||
|
|
||||||
rm -f amath-${version}.tar.gz
|
rm -f amath-${version}.tar.gz
|
||||||
rm -Rf amath-${version}
|
rm -Rf ${distdir}
|
||||||
|
|
||||||
mkdir -m 775 ${distdir}
|
mkdir -m 775 ${distdir}
|
||||||
mkdir -m 775 ${distdir}/src/
|
mkdir -m 775 ${distdir}/src/
|
||||||
|
@ -56,6 +56,7 @@ install -m 664 ${srcdir}/LICENSE ${distdir}/
|
||||||
install -m 664 ${srcdir}/README ${distdir}/
|
install -m 664 ${srcdir}/README ${distdir}/
|
||||||
install -m 664 ${srcdir}/amath.1 ${distdir}/
|
install -m 664 ${srcdir}/amath.1 ${distdir}/
|
||||||
install -m 775 ${srcdir}/configure ${distdir}/
|
install -m 775 ${srcdir}/configure ${distdir}/
|
||||||
|
install -m 775 ${srcdir}/builddeb ${distdir}/
|
||||||
install -m 775 ${srcdir}/builddist ${distdir}/
|
install -m 775 ${srcdir}/builddist ${distdir}/
|
||||||
install -m 775 ${srcdir}/buildwin ${distdir}/
|
install -m 775 ${srcdir}/buildwin ${distdir}/
|
||||||
|
|
||||||
|
|
2
buildwin
2
buildwin
|
@ -8,7 +8,7 @@
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
version="1.8.4"
|
version="1.9.0"
|
||||||
|
|
||||||
echo "Building amath ${version} for Windows ..."
|
echo "Building amath ${version} for Windows ..."
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
## language english
|
## language english
|
||||||
## codeset 0
|
## codeset 0
|
||||||
; #############################################################################
|
; #############################################################################
|
||||||
; Copyright (c) 2014-2018 Carsten Sonne Larsen <cs@innolan.net>
|
; Copyright (c) 2014-2021 Carsten Sonne Larsen <cs@innolan.net>
|
||||||
; All rights reserved.
|
; All rights reserved.
|
||||||
;
|
;
|
||||||
; Redistribution and use in source and binary forms, with or without
|
; Redistribution and use in source and binary forms, with or without
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
## language english
|
## language english
|
||||||
## codeset 0
|
## codeset 0
|
||||||
; #############################################################################
|
; #############################################################################
|
||||||
; Copyright (c) 2014-2018 Carsten Sonne Larsen <cs@innolan.net>
|
; Copyright (c) 2014-2021 Carsten Sonne Larsen <cs@innolan.net>
|
||||||
; All rights reserved.
|
; All rights reserved.
|
||||||
;
|
;
|
||||||
; Redistribution and use in source and binary forms, with or without
|
; Redistribution and use in source and binary forms, with or without
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
#
|
#
|
||||||
# Copyright {c} 2014-2018 Carsten Sonne Larsen <cs@innolan.net>
|
# Copyright {c} 2014-2021 Carsten Sonne Larsen <cs@innolan.net>
|
||||||
# All rights reserved.
|
# All rights reserved.
|
||||||
#
|
#
|
||||||
# Redistribution and use in source and binary forms, with or without
|
# Redistribution and use in source and binary forms, with or without
|
||||||
|
@ -27,7 +27,7 @@
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
version="1.8.4"
|
version="1.9.0"
|
||||||
|
|
||||||
clang=false
|
clang=false
|
||||||
debugsym=false
|
debugsym=false
|
||||||
|
@ -306,6 +306,7 @@ values.cpp
|
||||||
viewer.cpp
|
viewer.cpp
|
||||||
'
|
'
|
||||||
SYSSRCS='
|
SYSSRCS='
|
||||||
|
amiga_arexx.cpp
|
||||||
console.cpp
|
console.cpp
|
||||||
console_amiga.cpp
|
console_amiga.cpp
|
||||||
console_stdc.cpp
|
console_stdc.cpp
|
||||||
|
@ -1193,10 +1194,10 @@ echo " cd src/cplex && \${MAKE} doc"
|
||||||
echo
|
echo
|
||||||
echo "catalogs:"
|
echo "catalogs:"
|
||||||
echo " cd build/flexcat && \${MAKE}"
|
echo " cd build/flexcat && \${MAKE}"
|
||||||
echo " \${MKDIR} dist/catalog/english"
|
echo " \${MKDIR} distcat/catalog/english"
|
||||||
echo " \${FLXCAT} text/help.cd catalog/english/amath-help.ct CATALOG dist/catalog/english/amath-help.catalog"
|
echo " \${FLXCAT} text/help.cd catalog/english/amath-help.ct CATALOG distcat/catalog/english/amath-help.catalog"
|
||||||
echo " \${FLXCAT} text/ident.cd catalog/english/amath-ident.ct CATALOG dist/catalog/english/amath-ident.catalog"
|
echo " \${FLXCAT} text/ident.cd catalog/english/amath-ident.ct CATALOG distcat/catalog/english/amath-ident.catalog"
|
||||||
echo " \${FLXCAT} text/text.cd catalog/english/amath-text.ct CATALOG dist/catalog/english/amath-text.catalog"
|
echo " \${FLXCAT} text/text.cd catalog/english/amath-text.ct CATALOG distcat/catalog/english/amath-text.catalog"
|
||||||
echo
|
echo
|
||||||
echo "shared-libs:"
|
echo "shared-libs:"
|
||||||
echo " cd src/lib && \${MAKE} shared"
|
echo " cd src/lib && \${MAKE} shared"
|
||||||
|
|
164
src/amath.h
164
src/amath.h
|
@ -1,5 +1,5 @@
|
||||||
/*-
|
/*-
|
||||||
* Copyright (c) 2014-2018 Carsten Sonne Larsen <cs@innolan.net>
|
* Copyright (c) 2014-2021 Carsten Sonne Larsen <cs@innolan.net>
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
@ -29,61 +29,90 @@
|
||||||
|
|
||||||
#ifndef AMATH_H
|
#ifndef AMATH_H
|
||||||
#define AMATH_H
|
#define AMATH_H
|
||||||
/******************************************************************************/
|
|
||||||
#ifdef __AMIGA__
|
/* Operating System */
|
||||||
# ifndef AOS3
|
#if defined(__MORPHOS__)
|
||||||
# define AOS3
|
# define SYS_NAME "MorphOS"
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
/******************************************************************************/
|
|
||||||
#ifdef __AROS__
|
|
||||||
# ifndef AROS
|
|
||||||
# define AROS
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
/******************************************************************************/
|
|
||||||
#ifdef __MORPHOS__
|
|
||||||
# ifndef MORPHOS
|
# ifndef MORPHOS
|
||||||
# define MORPHOS
|
# define MORPHOS
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#elif defined(__amigaos4__)
|
||||||
/******************************************************************************/
|
# define SYS_NAME "AmigaOS 4"
|
||||||
#ifdef __amigaos4__
|
|
||||||
# ifndef AOS4
|
# ifndef AOS4
|
||||||
# define AOS4
|
# define AOS4
|
||||||
# endif
|
# endif
|
||||||
|
#elif defined(__AMIGA__) || defined(__amigaos3__)
|
||||||
|
# define SYS_NAME "AmigaOS 3"
|
||||||
|
# ifndef AOS3
|
||||||
|
# define AOS3
|
||||||
# endif
|
# endif
|
||||||
/******************************************************************************/
|
#elif defined(__AROS__)
|
||||||
#ifdef __HAIKU__
|
# define SYS_NAME "AROS"
|
||||||
|
# ifndef AROS
|
||||||
|
# define AROS
|
||||||
|
# endif
|
||||||
|
#elif defined(__HAIKU__)
|
||||||
|
# define SYS_NAME "Haiku"
|
||||||
# ifndef HAIKU
|
# ifndef HAIKU
|
||||||
# define HAIKU
|
# define HAIKU
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#elif defined(__APPLE__) && defined(__MACH__)
|
||||||
/******************************************************************************/
|
# define SYS_NAME "Apple"
|
||||||
#ifdef __APPLE__
|
|
||||||
# ifndef APPLE
|
# ifndef APPLE
|
||||||
# define APPLE
|
# define APPLE
|
||||||
# endif
|
# endif
|
||||||
|
#elif defined(__FreeBSD__)
|
||||||
|
# define SYS_NAME "FreeBSD"
|
||||||
|
# ifndef FREEBSD
|
||||||
|
# define FREEBSD
|
||||||
# endif
|
# endif
|
||||||
/******************************************************************************/
|
#elif defined(__NetBSD__)
|
||||||
#if defined(_WIN32) || defined(_WIN64)
|
# define SYS_NAME "NetBSD"
|
||||||
|
# ifndef NETBSD
|
||||||
|
# define NETBSD
|
||||||
|
# endif
|
||||||
|
#elif defined(__OpenBSD__)
|
||||||
|
# define SYS_NAME "OpenBSD"
|
||||||
|
# ifndef OPENBSD
|
||||||
|
# define OPENBSD
|
||||||
|
# endif
|
||||||
|
#elif defined(__DragonFly__)
|
||||||
|
# define SYS_NAME "DragonFly BSD"
|
||||||
|
# ifndef DRAGONFLY
|
||||||
|
# define DRAGONFLY
|
||||||
|
# endif
|
||||||
|
#elif defined(__linux__)
|
||||||
|
# define SYS_NAME "Linux"
|
||||||
|
# ifndef LINUX
|
||||||
|
# define LINUX
|
||||||
|
# endif
|
||||||
|
#elif defined(_WIN32)
|
||||||
|
# define SYS_NAME "Windows"
|
||||||
|
# ifndef WINDOWS
|
||||||
|
# define WINDOWS
|
||||||
|
# endif
|
||||||
|
#elif defined(_WIN64)
|
||||||
|
# define SYS_NAME "Windows 64 bit"
|
||||||
# ifndef WINDOWS
|
# ifndef WINDOWS
|
||||||
# define WINDOWS
|
# define WINDOWS
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
/******************************************************************************/
|
|
||||||
#if defined(AOS3) || defined(AOS4) || defined(AROS) || defined (MORPHOS)
|
#if defined(AOS3) || defined(AOS4) || defined(AROS) || defined (MORPHOS)
|
||||||
# ifndef AMIGA
|
# ifndef AMIGA
|
||||||
# define AMIGA
|
# define AMIGA
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
/******************************************************************************/
|
|
||||||
#if defined(unix) || defined(__unix__) || defined(__unix)
|
#if defined(unix) || defined(__unix__) || defined(__unix)
|
||||||
# ifndef UNIX
|
# ifndef UNIX
|
||||||
# define UNIX
|
# define UNIX
|
||||||
# endif
|
# endif
|
||||||
|
# ifndef SYS_NAME
|
||||||
|
# define SYS_NAME "Unix variant"
|
||||||
# endif
|
# endif
|
||||||
/******************************************************************************/
|
#endif
|
||||||
|
|
||||||
#if defined(HAIKU) || defined(UNIX) || defined(APPLE)
|
#if defined(HAIKU) || defined(UNIX) || defined(APPLE)
|
||||||
# ifndef TERMIOS
|
# ifndef TERMIOS
|
||||||
# define TERMIOS
|
# define TERMIOS
|
||||||
|
@ -91,26 +120,25 @@
|
||||||
# include <stdint.h>
|
# include <stdint.h>
|
||||||
# include <unistd.h>
|
# include <unistd.h>
|
||||||
#endif
|
#endif
|
||||||
/******************************************************************************/
|
|
||||||
#if defined(WINDOWS)
|
#if defined(WINDOWS)
|
||||||
# include <stdint.h>
|
# include <stdint.h>
|
||||||
#endif
|
#endif
|
||||||
/******************************************************************************/
|
|
||||||
#if defined(AROS) || defined(MORPHOS) || defined(AOS4)
|
#if defined(AROS) || defined(MORPHOS) || defined(AOS4)
|
||||||
# include <stdint.h>
|
# include <stdint.h>
|
||||||
# include <sys/types.h>
|
# include <sys/types.h>
|
||||||
#endif
|
#endif
|
||||||
/******************************************************************************/
|
|
||||||
#if defined(AOS3)
|
#if defined(AOS3)
|
||||||
# include <sys/types.h>
|
# include <sys/types.h>
|
||||||
# define IPTR LONG*
|
|
||||||
# define uintptr_t uint32_t
|
# define uintptr_t uint32_t
|
||||||
typedef u_int8_t uint8_t;
|
typedef u_int8_t uint8_t;
|
||||||
typedef u_int16_t uint16_t;
|
typedef u_int16_t uint16_t;
|
||||||
typedef u_int32_t uint32_t;
|
typedef u_int32_t uint32_t;
|
||||||
typedef u_int64_t uint64_t;
|
typedef u_int64_t uint64_t;
|
||||||
#endif
|
#endif
|
||||||
/******************************************************************************/
|
|
||||||
#if (__cplusplus <= 199711L && !defined(WINDOWS)) || !defined(__cplusplus)
|
#if (__cplusplus <= 199711L && !defined(WINDOWS)) || !defined(__cplusplus)
|
||||||
# ifndef nullptr
|
# ifndef nullptr
|
||||||
# define nullptr 0
|
# define nullptr 0
|
||||||
|
@ -120,9 +148,9 @@ typedef u_int64_t uint64_t;
|
||||||
# define nullptr 0
|
# define nullptr 0
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
/******************************************************************************/
|
|
||||||
#define assert(x)
|
#define assert(x)
|
||||||
/******************************************************************************/
|
|
||||||
/* Compilers */
|
/* Compilers */
|
||||||
#if defined(__clang__)
|
#if defined(__clang__)
|
||||||
/* Clang */
|
/* Clang */
|
||||||
|
@ -176,7 +204,9 @@ typedef u_int64_t uint64_t;
|
||||||
# elif (_MSC_VER == 1900)
|
# elif (_MSC_VER == 1900)
|
||||||
# define COMP_VERS "14.0"
|
# define COMP_VERS "14.0"
|
||||||
# elif (_MSC_VER > 1900)
|
# elif (_MSC_VER > 1900)
|
||||||
# define COMP_VERS "15.0+"
|
# define COMP_VERS "15.x"
|
||||||
|
# elif (_MSC_VER > 1920)
|
||||||
|
# define COMP_VERS "16.0+"
|
||||||
# else
|
# else
|
||||||
# define str(x) #x
|
# define str(x) #x
|
||||||
# define MSC_VER_STR(x) str(x)
|
# define MSC_VER_STR(x) str(x)
|
||||||
|
@ -209,29 +239,29 @@ typedef u_int64_t uint64_t;
|
||||||
# define COMP_VERS GCC_VER_STR(__GNUC__) DOT GCC_VER_STR(__GNUC_MINOR__)
|
# define COMP_VERS GCC_VER_STR(__GNUC__) DOT GCC_VER_STR(__GNUC_MINOR__)
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
/******************************************************************************/
|
|
||||||
#define EMPTYSTRING ""
|
#define EMPTYSTRING ""
|
||||||
#define SPACE " "
|
#define SPACE " "
|
||||||
#define DOT "."
|
#define DOT "."
|
||||||
/******************************************************************************/
|
|
||||||
#if defined(WINDOWS)
|
#if defined(WINDOWS)
|
||||||
#define NEWLINE "\r\n"
|
#define NEWLINE "\r\n"
|
||||||
#elif defined(APPLE)
|
#elif defined(APPLE)
|
||||||
#define NEWLINE "\r"
|
#define NEWLINE "\n"
|
||||||
#else
|
#else
|
||||||
#define NEWLINE "\n"
|
#define NEWLINE "\n"
|
||||||
#endif
|
#endif
|
||||||
/******************************************************************************/
|
|
||||||
#ifndef __cplusplus
|
#ifndef __cplusplus
|
||||||
typedef int bool;
|
typedef int bool;
|
||||||
#define true 1
|
#define true 1
|
||||||
#define false 0
|
#define false 0
|
||||||
#endif
|
#endif
|
||||||
/******************************************************************************/
|
|
||||||
#define LONG_BIT 32
|
#define LONG_BIT 32
|
||||||
#define wsize sizeof(unsigned int)
|
#define wsize sizeof(unsigned int)
|
||||||
#define wmask (wsize - 1)
|
#define wmask (wsize - 1)
|
||||||
/******************************************************************************/
|
|
||||||
#if defined(INTELCPU) || defined(i386) || defined(i486) || \
|
#if defined(INTELCPU) || defined(i386) || defined(i486) || \
|
||||||
defined(intel) || defined(x86) || defined(i86pc) || \
|
defined(intel) || defined(x86) || defined(i86pc) || \
|
||||||
defined(__i386__) || defined(_M_IX86)
|
defined(__i386__) || defined(_M_IX86)
|
||||||
|
@ -243,18 +273,18 @@ typedef int bool;
|
||||||
#if defined(__x86_64__) || defined(_M_AMD64)
|
#if defined(__x86_64__) || defined(_M_AMD64)
|
||||||
# define TXTCPU "amd64"
|
# define TXTCPU "amd64"
|
||||||
#endif
|
#endif
|
||||||
/******************************************************************************/
|
|
||||||
#if defined(__powerpc__) || defined(__powerpc64__)
|
#if defined(__powerpc__) || defined(__powerpc64__)
|
||||||
# define TXTCPU "PowerPC"
|
# define TXTCPU "PowerPC"
|
||||||
#endif
|
#endif
|
||||||
/******************************************************************************/
|
|
||||||
#if defined(__arm__) || defined(_M_ARM) || defined(__ARM_ARCH_6__)
|
#if defined(__arm__) || defined(_M_ARM) || defined(__ARM_ARCH_6__)
|
||||||
# define TXTCPU "arm"
|
# define TXTCPU "arm"
|
||||||
#endif
|
#endif
|
||||||
#if defined(__aarch64__) || defined(_M_ARM64)
|
#if defined(__aarch64__) || defined(_M_ARM64)
|
||||||
# define TXTCPU "arm64"
|
# define TXTCPU "arm64"
|
||||||
#endif
|
#endif
|
||||||
/******************************************************************************/
|
|
||||||
#if defined(m68060) || defined(mc68060)
|
#if defined(m68060) || defined(mc68060)
|
||||||
# define TXTCPU "68060"
|
# define TXTCPU "68060"
|
||||||
#elif defined(m68040) || defined(mc68040)
|
#elif defined(m68040) || defined(mc68040)
|
||||||
|
@ -268,47 +298,33 @@ typedef int bool;
|
||||||
#elif defined(m68000) || defined(mc68000)
|
#elif defined(m68000) || defined(mc68000)
|
||||||
# define TXTCPU "68000+"
|
# define TXTCPU "68000+"
|
||||||
#endif
|
#endif
|
||||||
/******************************************************************************/
|
|
||||||
#ifndef TXTCPU
|
#ifndef TXTCPU
|
||||||
//#error what cpu is this ?!
|
//#error what cpu is this ?!
|
||||||
# define TXTCPU EMPTYSTRING
|
# define TXTCPU EMPTYSTRING
|
||||||
#endif
|
#endif
|
||||||
/******************************************************************************/
|
|
||||||
#if defined(TXTCPU) && defined(__HAVE_68881__)
|
#if defined(TXTCPU) && defined(__HAVE_68881__)
|
||||||
# define TXTFPU SPACE "FPU"
|
# define TXTFPU SPACE "FPU"
|
||||||
#else
|
#else
|
||||||
# define TXTFPU EMPTYSTRING
|
# define TXTFPU EMPTYSTRING
|
||||||
#endif
|
#endif
|
||||||
/******************************************************************************/
|
|
||||||
#define TXTARCH TXTCPU TXTFPU
|
#define TXTARCH TXTCPU TXTFPU
|
||||||
#define RELDATESTAMP "(05-08-2018)"
|
#define RELDATESTAMP "(11-01-2021)"
|
||||||
#define TXTDOSVERSION "\0$VER: amath 1.84" SPACE RELDATESTAMP SPACE TXTARCH
|
#define TXTDOSVERSION "\0$VER: amath 1.90" SPACE RELDATESTAMP SPACE TXTARCH
|
||||||
#define TXTTITLE "amath version 1.8.4"
|
#define TXTTITLE "amath version 1.9.0"
|
||||||
#define TXTCOPYRIGHT "(c) 2018 Carsten Sonne Larsen"
|
#define TXTCOPYRIGHT "(c) 2021 Carsten Sonne Larsen"
|
||||||
#define TXTSTARTMSG TXTTITLE SPACE TXTCOPYRIGHT
|
#define TXTSTARTMSG TXTTITLE SPACE TXTCOPYRIGHT
|
||||||
/******************************************************************************/
|
|
||||||
#define TXTVERSMSG TXTTITLE SPACE RELDATESTAMP SPACE TXTARCH
|
#define TXTVERSMSG TXTTITLE SPACE RELDATESTAMP SPACE TXTARCH
|
||||||
#define TXTCOMPMSG "Compiled with " COMP_NAME SPACE COMP_VERS
|
#define TXTCOMPMSG "Compiled with " COMP_NAME SPACE COMP_VERS
|
||||||
/******************************************************************************/
|
|
||||||
#define CPROCNAME "amath_console"
|
#ifdef SYS_NAME
|
||||||
/******************************************************************************/
|
# define TXTSYSMSG TXTCOMPMSG " for " SYS_NAME
|
||||||
#if defined(AMIGA)
|
# define SYSKNOWN 1
|
||||||
#define AMIGADOS_NAME "dos.library"
|
#else
|
||||||
#define AMIGADOS_REV 33L
|
# define TXTSYSMSG TXTCOMPMSG
|
||||||
#define INTUITION_REV 37L
|
|
||||||
#define INTUITION_NAME "intuition.library"
|
|
||||||
#define GRAPHICS_REV 37L
|
|
||||||
#define GRAPHICS_NAME "graphics.library"
|
|
||||||
#define LOCALE_REV 38L
|
|
||||||
#define LOCALE_NAME "locale.library"
|
|
||||||
#define DEVCONSOLE "console.device"
|
|
||||||
#define PORTCR "RKM.console.read"
|
|
||||||
#define PORTCW "RKM.console.write"
|
|
||||||
#define CATALOG_HELP "amath-help.catalog"
|
|
||||||
#define CATALOG_IDEN "amath-ident.catalog"
|
|
||||||
#define CATALOG_TEXT "amath-text.catalog"
|
|
||||||
#define CATALOG_KEYW "amath-keyword.catalog"
|
|
||||||
#define CATALOG_DEF OC_BuiltInLanguage, "english"
|
|
||||||
#endif
|
#endif
|
||||||
/******************************************************************************/
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*-
|
/*-
|
||||||
* Copyright (c) 2014-2018 Carsten Sonne Larsen <cs@innolan.net>
|
* Copyright (c) 2014-2021 Carsten Sonne Larsen <cs@innolan.net>
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*-
|
/*-
|
||||||
* Copyright (c) 2014-2018 Carsten Sonne Larsen <cs@innolan.net>
|
* Copyright (c) 2014-2021 Carsten Sonne Larsen <cs@innolan.net>
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*-
|
/*-
|
||||||
* Copyright (c) 2014-2018 Carsten Sonne Larsen <cs@innolan.net>
|
* Copyright (c) 2014-2021 Carsten Sonne Larsen <cs@innolan.net>
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
.\" Copyright (c) 2014-2018 Carsten Sonne Larsen <cs@innolan.net>
|
.\" Copyright (c) 2014-2021 Carsten Sonne Larsen <cs@innolan.net>
|
||||||
.\" All rights reserved.
|
.\" All rights reserved.
|
||||||
.\"
|
.\"
|
||||||
.\" Redistribution and use in source and binary forms, with or without
|
.\" Redistribution and use in source and binary forms, with or without
|
||||||
|
@ -20,7 +20,7 @@
|
||||||
.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||||
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
.TH "amathc.h" 3 "Version 1.8.4" "August 05 2018"
|
.TH "amathc.h" 3 "Version 1.9.0" "January 11 2021"
|
||||||
.SH NAME
|
.SH NAME
|
||||||
amathc.h \- C functions for manipulating strings and memory
|
amathc.h \- C functions for manipulating strings and memory
|
||||||
.SH SYNOPSIS
|
.SH SYNOPSIS
|
||||||
|
@ -479,7 +479,7 @@ Written by Carsten Sonne Larsen <cs@innolan.net>. The code in MemSet and
|
||||||
MemCopy is derived from software contributed to Berkeley by Mike Hibler and
|
MemCopy is derived from software contributed to Berkeley by Mike Hibler and
|
||||||
Chris Torek.
|
Chris Torek.
|
||||||
.SH COPYRIGHT
|
.SH COPYRIGHT
|
||||||
Copyright (c) 2014-2018 Carsten Sonne Larsen <cs@innolan.net>
|
Copyright (c) 2014-2021 Carsten Sonne Larsen <cs@innolan.net>
|
||||||
.br
|
.br
|
||||||
Copyright (c) 2007 The NetBSD Foundation, Inc.
|
Copyright (c) 2007 The NetBSD Foundation, Inc.
|
||||||
.br
|
.br
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
|
|
||||||
DOXYFILE_ENCODING = UTF-8
|
DOXYFILE_ENCODING = UTF-8
|
||||||
PROJECT_NAME = "amathc"
|
PROJECT_NAME = "amathc"
|
||||||
PROJECT_NUMBER = "1.8.4"
|
PROJECT_NUMBER = "1.9.0"
|
||||||
PROJECT_BRIEF = "C functions for manipulating strings and memory"
|
PROJECT_BRIEF = "C functions for manipulating strings and memory"
|
||||||
PROJECT_LOGO =
|
PROJECT_LOGO =
|
||||||
OUTPUT_DIRECTORY =
|
OUTPUT_DIRECTORY =
|
||||||
|
|
|
@ -5,6 +5,6 @@ libdir=${exec_prefix}/lib
|
||||||
|
|
||||||
Name: amath C library
|
Name: amath C library
|
||||||
Description: C functions for manipulating strings and memory
|
Description: C functions for manipulating strings and memory
|
||||||
Version: 1.8.4
|
Version: 1.9.0
|
||||||
Cflags: -I${includedir}
|
Cflags: -I${includedir}
|
||||||
Libs: -L${libdir} -lamathc
|
Libs: -L${libdir} -lamathc
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*-
|
/*-
|
||||||
* Copyright (c) 2014-2018 Carsten Sonne Larsen <cs@innolan.net>
|
* Copyright (c) 2014-2021 Carsten Sonne Larsen <cs@innolan.net>
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
@ -35,13 +35,17 @@
|
||||||
#include <exec/memory.h>
|
#include <exec/memory.h>
|
||||||
#include <exec/semaphores.h>
|
#include <exec/semaphores.h>
|
||||||
#include <clib/exec_protos.h>
|
#include <clib/exec_protos.h>
|
||||||
#define ALLOC_MEM(x) AllocVec(x, MEMF_ANY | MEMF_CLEAR)
|
#define ALLOC_LIST(x) AllocVec(x, MEMF_ANY | MEMF_CLEAR)
|
||||||
#define FREE_MEM(x) FreeVec(x)
|
#define FREE_LIST(x) FreeVec(x)
|
||||||
|
#define ALLOC_MEM(x, y) AllocPooledZero(x, y)
|
||||||
|
#define FREE_MEM(x, y, z) FreePooled(x, y, z)
|
||||||
#define Debug(x, y, z)
|
#define Debug(x, y, z)
|
||||||
#else
|
#else
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#define ALLOC_MEM(x) calloc(1L,x)
|
#define ALLOC_LIST(x) calloc(1L, x)
|
||||||
#define FREE_MEM(x) free(x)
|
#define FREE_LIST(x) free(x)
|
||||||
|
#define ALLOC_MEM(x, y) calloc(1L, y)
|
||||||
|
#define FREE_MEM(x, y, z) free(y)
|
||||||
#define Debug(x, y, z)
|
#define Debug(x, y, z)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -67,6 +71,7 @@ struct MemoryBlock
|
||||||
struct MemoryList
|
struct MemoryList
|
||||||
{
|
{
|
||||||
struct MemoryBlock *first;
|
struct MemoryBlock *first;
|
||||||
|
void *pool;
|
||||||
size_t peak;
|
size_t peak;
|
||||||
size_t size;
|
size_t size;
|
||||||
long count;
|
long count;
|
||||||
|
@ -80,6 +85,31 @@ struct MemoryList* list = nullptr;
|
||||||
void alloc_error(char *, size_t);
|
void alloc_error(char *, size_t);
|
||||||
void dealloc_error(char *, void *);
|
void dealloc_error(char *, void *);
|
||||||
|
|
||||||
|
#if defined(AMIGA)
|
||||||
|
|
||||||
|
static void MemZero(void *address, ULONG size)
|
||||||
|
{
|
||||||
|
char *c = (char *)address;
|
||||||
|
int n = size;
|
||||||
|
do
|
||||||
|
{
|
||||||
|
*c++ = '\0';
|
||||||
|
} while (--n);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void *AllocPooledZero(void *pool, size_t size)
|
||||||
|
{
|
||||||
|
ULONG memSize = (ULONG)size;
|
||||||
|
void *memory = AllocPooled(pool, memSize);
|
||||||
|
if (memory != NULL)
|
||||||
|
{
|
||||||
|
MemZero(memory, memSize);
|
||||||
|
}
|
||||||
|
return memory;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Allocate memory and add it to the global memory list.
|
* @brief Allocate memory and add it to the global memory list.
|
||||||
*/
|
*/
|
||||||
|
@ -90,13 +120,16 @@ void* AllocMemSafe(size_t size)
|
||||||
|
|
||||||
if (list == nullptr)
|
if (list == nullptr)
|
||||||
{
|
{
|
||||||
list = (struct MemoryList*)ALLOC_MEM(sizeof(struct MemoryList));
|
list = (struct MemoryList *)ALLOC_LIST(sizeof(struct MemoryList));
|
||||||
if (!list)
|
if (!list)
|
||||||
{
|
{
|
||||||
alloc_error("list", sizeof(struct MemoryList));
|
alloc_error("list", sizeof(struct MemoryList));
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if defined(AMIGA)
|
||||||
|
list->pool = CreatePool(MEMF_ANY, 4096, 512);
|
||||||
|
#endif
|
||||||
list->first = nullptr;
|
list->first = nullptr;
|
||||||
list->peak = 0;
|
list->peak = 0;
|
||||||
list->size = 0;
|
list->size = 0;
|
||||||
|
@ -104,24 +137,24 @@ void* AllocMemSafe(size_t size)
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef P64BIT
|
#ifdef P64BIT
|
||||||
// Align to bytes of 8
|
// Align to bytes of 8, remove 0 bytes allocations
|
||||||
allocsize = (size + 7) & ~0x07;
|
allocsize = (size + 8) & ~0x07;
|
||||||
#else
|
#else
|
||||||
// Align to bytes of 4
|
// Align to bytes of 4, remove 0 bytes allocations
|
||||||
allocsize = (size + 3) & ~0x03;
|
allocsize = (size + 4) & ~0x03;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
newblock = (struct MemoryBlock*)ALLOC_MEM(sizeof(struct MemoryBlock));
|
newblock = (struct MemoryBlock *)ALLOC_MEM(list->pool, sizeof(struct MemoryBlock));
|
||||||
if (!newblock)
|
if (newblock == NULL)
|
||||||
{
|
{
|
||||||
alloc_error("block", sizeof(struct MemoryBlock));
|
alloc_error("block", sizeof(struct MemoryBlock));
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
newblock->address = (struct MemoryBlock*)ALLOC_MEM(allocsize);
|
newblock->address = (struct MemoryBlock *)ALLOC_MEM(list->pool, allocsize);
|
||||||
if (!newblock->address)
|
if (newblock->address == NULL)
|
||||||
{
|
{
|
||||||
FREE_MEM(newblock);
|
FREE_MEM(list->pool, newblock, sizeof(struct MemoryBlock));
|
||||||
alloc_error("memory", allocsize);
|
alloc_error("memory", allocsize);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -185,13 +218,13 @@ void RemoveMemSafe(void* block, bool deallocate)
|
||||||
|
|
||||||
if (deallocate)
|
if (deallocate)
|
||||||
{
|
{
|
||||||
FREE_MEM(current->address);
|
FREE_MEM(list->pool, current->address, current->size);
|
||||||
}
|
}
|
||||||
|
|
||||||
current->address = nullptr;
|
current->address = nullptr;
|
||||||
current->next = nullptr;
|
current->next = nullptr;
|
||||||
current->size = 0;
|
current->size = 0;
|
||||||
FREE_MEM(current);
|
FREE_MEM(list->pool, current, sizeof(struct MemoryBlock));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -227,12 +260,16 @@ void FreeAllSafe()
|
||||||
while (current != nullptr)
|
while (current != nullptr)
|
||||||
{
|
{
|
||||||
next = current->next;
|
next = current->next;
|
||||||
FREE_MEM(current->address);
|
FREE_MEM(list->pool, current->address, current->size);
|
||||||
FREE_MEM(current);
|
FREE_MEM(list->pool, current, sizeof(struct MemoryBlock));
|
||||||
current = next;
|
current = next;
|
||||||
}
|
}
|
||||||
|
|
||||||
FREE_MEM(list);
|
#if defined(AMIGA)
|
||||||
|
DeletePool(list->pool);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
FREE_LIST(list);
|
||||||
list = nullptr;
|
list = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -243,7 +280,8 @@ void MemUsage(long* blocks, long* size, long* peak)
|
||||||
{
|
{
|
||||||
*blocks = list->count;
|
*blocks = list->count;
|
||||||
*size = (long)list->size;
|
*size = (long)list->size;
|
||||||
*peak = (long)list->peak;;
|
*peak = (long)list->peak;
|
||||||
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*-
|
/*-
|
||||||
* Copyright (c) 2014-2018 Carsten Sonne Larsen <cs@innolan.net>
|
* Copyright (c) 2014-2021 Carsten Sonne Larsen <cs@innolan.net>
|
||||||
* Copyright (c) 1990, 1993 The Regents of the University of California.
|
* Copyright (c) 1990, 1993 The Regents of the University of California.
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*-
|
/*-
|
||||||
* Copyright (c) 2014-2018 Carsten Sonne Larsen <cs@innolan.net>
|
* Copyright (c) 2014-2021 Carsten Sonne Larsen <cs@innolan.net>
|
||||||
* Copyright (c) 1990, 1993 The Regents of the University of California.
|
* Copyright (c) 1990, 1993 The Regents of the University of California.
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*-
|
/*-
|
||||||
* Copyright (c) 2014-2018 Carsten Sonne Larsen <cs@innolan.net>
|
* Copyright (c) 2014-2021 Carsten Sonne Larsen <cs@innolan.net>
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*-
|
/*-
|
||||||
* Copyright (c) 2014-2018 Carsten Sonne Larsen <cs@innolan.net>
|
* Copyright (c) 2014-2021 Carsten Sonne Larsen <cs@innolan.net>
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
.\" Copyright (c) 2014-2018 Carsten Sonne Larsen <cs@innolan.net>
|
.\" Copyright (c) 2014-2021 Carsten Sonne Larsen <cs@innolan.net>
|
||||||
.\" All rights reserved.
|
.\" All rights reserved.
|
||||||
.\"
|
.\"
|
||||||
.\" Redistribution and use in source and binary forms, with or without
|
.\" Redistribution and use in source and binary forms, with or without
|
||||||
|
@ -20,7 +20,7 @@
|
||||||
.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||||
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
.TH "mathi.h" 3 "Version 1.8.4" "August 05 2018"
|
.TH "mathi.h" 3 "Version 1.9.0" "January 11 2021"
|
||||||
.SH NAME
|
.SH NAME
|
||||||
mathi.h \- Complex numbers math library
|
mathi.h \- Complex numbers math library
|
||||||
.SH SYNOPSIS
|
.SH SYNOPSIS
|
||||||
|
@ -1745,7 +1745,7 @@ https://amath.innolan.net/
|
||||||
Written by Carsten Sonne Larsen <cs@innolan.net>. Some code in the
|
Written by Carsten Sonne Larsen <cs@innolan.net>. Some code in the
|
||||||
library is derived from software written by Stephen L. Moshier.
|
library is derived from software written by Stephen L. Moshier.
|
||||||
.SH COPYRIGHT
|
.SH COPYRIGHT
|
||||||
Copyright (c) 2014-2018 Carsten Sonne Larsen <cs@innolan.net>
|
Copyright (c) 2014-2021 Carsten Sonne Larsen <cs@innolan.net>
|
||||||
.br
|
.br
|
||||||
Copyright (c) 2007 The NetBSD Foundation, Inc.
|
Copyright (c) 2007 The NetBSD Foundation, Inc.
|
||||||
.SH "See also"
|
.SH "See also"
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
|
|
||||||
DOXYFILE_ENCODING = UTF-8
|
DOXYFILE_ENCODING = UTF-8
|
||||||
PROJECT_NAME = "amathi"
|
PROJECT_NAME = "amathi"
|
||||||
PROJECT_NUMBER = "1.8.4"
|
PROJECT_NUMBER = "1.9.0"
|
||||||
PROJECT_BRIEF = "Complex numbers math library"
|
PROJECT_BRIEF = "Complex numbers math library"
|
||||||
PROJECT_LOGO =
|
PROJECT_LOGO =
|
||||||
OUTPUT_DIRECTORY =
|
OUTPUT_DIRECTORY =
|
||||||
|
|
|
@ -5,6 +5,6 @@ libdir=${exec_prefix}/lib
|
||||||
|
|
||||||
Name: amath complex library
|
Name: amath complex library
|
||||||
Description: Complex numbers math library
|
Description: Complex numbers math library
|
||||||
Version: 1.8.4
|
Version: 1.9.0
|
||||||
Cflags: -I${includedir}
|
Cflags: -I${includedir}
|
||||||
Libs: -L${libdir} -lamathi
|
Libs: -L${libdir} -lamathi
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*-
|
/*-
|
||||||
* Copyright (c) 2014-2018 Carsten Sonne Larsen <cs@innolan.net>
|
* Copyright (c) 2014-2021 Carsten Sonne Larsen <cs@innolan.net>
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*-
|
/*-
|
||||||
* Copyright (c) 2014-2018 Carsten Sonne Larsen <cs@innolan.net>
|
* Copyright (c) 2014-2021 Carsten Sonne Larsen <cs@innolan.net>
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*-
|
/*-
|
||||||
* Copyright (c) 2014-2018 Carsten Sonne Larsen <cs@innolan.net>
|
* Copyright (c) 2014-2021 Carsten Sonne Larsen <cs@innolan.net>
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*-
|
/*-
|
||||||
* Copyright (c) 2014-2018 Carsten Sonne Larsen <cs@innolan.net>
|
* Copyright (c) 2014-2021 Carsten Sonne Larsen <cs@innolan.net>
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*-
|
/*-
|
||||||
* Copyright (c) 2014-2018 Carsten Sonne Larsen <cs@innolan.net>
|
* Copyright (c) 2014-2021 Carsten Sonne Larsen <cs@innolan.net>
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*-
|
/*-
|
||||||
* Copyright (c) 2014-2018 Carsten Sonne Larsen <cs@innolan.net>
|
* Copyright (c) 2014-2021 Carsten Sonne Larsen <cs@innolan.net>
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*-
|
/*-
|
||||||
* Copyright (c) 2014-2018 Carsten Sonne Larsen <cs@innolan.net>
|
* Copyright (c) 2014-2021 Carsten Sonne Larsen <cs@innolan.net>
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*-
|
/*-
|
||||||
* Copyright (c) 2014-2018 Carsten Sonne Larsen <cs@innolan.net>
|
* Copyright (c) 2014-2021 Carsten Sonne Larsen <cs@innolan.net>
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*-
|
/*-
|
||||||
* Copyright (c) 2014-2018 Carsten Sonne Larsen <cs@innolan.net>
|
* Copyright (c) 2014-2021 Carsten Sonne Larsen <cs@innolan.net>
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*-
|
/*-
|
||||||
* Copyright (c) 2014-2018 Carsten Sonne Larsen <cs@innolan.net>
|
* Copyright (c) 2014-2021 Carsten Sonne Larsen <cs@innolan.net>
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*-
|
/*-
|
||||||
* Copyright (c) 2014-2018 Carsten Sonne Larsen <cs@innolan.net>
|
* Copyright (c) 2014-2021 Carsten Sonne Larsen <cs@innolan.net>
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*-
|
/*-
|
||||||
* Copyright (c) 2014-2018 Carsten Sonne Larsen <cs@innolan.net>
|
* Copyright (c) 2014-2021 Carsten Sonne Larsen <cs@innolan.net>
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*-
|
/*-
|
||||||
* Copyright (c) 2014-2018 Carsten Sonne Larsen <cs@innolan.net>
|
* Copyright (c) 2014-2021 Carsten Sonne Larsen <cs@innolan.net>
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*-
|
/*-
|
||||||
* Copyright (c) 2014-2018 Carsten Sonne Larsen <cs@innolan.net>
|
* Copyright (c) 2014-2021 Carsten Sonne Larsen <cs@innolan.net>
|
||||||
* Copyright (c) 2007 The NetBSD Foundation, Inc.
|
* Copyright (c) 2007 The NetBSD Foundation, Inc.
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*-
|
/*-
|
||||||
* Copyright (c) 2014-2018 Carsten Sonne Larsen <cs@innolan.net>
|
* Copyright (c) 2014-2021 Carsten Sonne Larsen <cs@innolan.net>
|
||||||
* Copyright (c) 2007 The NetBSD Foundation, Inc.
|
* Copyright (c) 2007 The NetBSD Foundation, Inc.
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*-
|
/*-
|
||||||
* Copyright (c) 2014-2018 Carsten Sonne Larsen <cs@innolan.net>
|
* Copyright (c) 2014-2021 Carsten Sonne Larsen <cs@innolan.net>
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*-
|
/*-
|
||||||
* Copyright (c) 2014-2018 Carsten Sonne Larsen <cs@innolan.net>
|
* Copyright (c) 2014-2021 Carsten Sonne Larsen <cs@innolan.net>
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*-
|
/*-
|
||||||
* Copyright (c) 2014-2018 Carsten Sonne Larsen <cs@innolan.net>
|
* Copyright (c) 2014-2021 Carsten Sonne Larsen <cs@innolan.net>
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*-
|
/*-
|
||||||
* Copyright (c) 2014-2018 Carsten Sonne Larsen <cs@innolan.net>
|
* Copyright (c) 2014-2021 Carsten Sonne Larsen <cs@innolan.net>
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*-
|
/*-
|
||||||
* Copyright (c) 2014-2018 Carsten Sonne Larsen <cs@innolan.net>
|
* Copyright (c) 2014-2021 Carsten Sonne Larsen <cs@innolan.net>
|
||||||
* Copyright (c) 2007 The NetBSD Foundation, Inc.
|
* Copyright (c) 2007 The NetBSD Foundation, Inc.
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*-
|
/*-
|
||||||
* Copyright (c) 2014-2018 Carsten Sonne Larsen <cs@innolan.net>
|
* Copyright (c) 2014-2021 Carsten Sonne Larsen <cs@innolan.net>
|
||||||
* Copyright (c) 2007 The NetBSD Foundation, Inc.
|
* Copyright (c) 2007 The NetBSD Foundation, Inc.
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*-
|
/*-
|
||||||
* Copyright (c) 2014-2018 Carsten Sonne Larsen <cs@innolan.net>
|
* Copyright (c) 2014-2021 Carsten Sonne Larsen <cs@innolan.net>
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*-
|
/*-
|
||||||
* Copyright (c) 2014-2018 Carsten Sonne Larsen <cs@innolan.net>
|
* Copyright (c) 2014-2021 Carsten Sonne Larsen <cs@innolan.net>
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*-
|
/*-
|
||||||
* Copyright (c) 2014-2018 Carsten Sonne Larsen <cs@innolan.net>
|
* Copyright (c) 2014-2021 Carsten Sonne Larsen <cs@innolan.net>
|
||||||
* Copyright (c) 2007 The NetBSD Foundation, Inc.
|
* Copyright (c) 2007 The NetBSD Foundation, Inc.
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*-
|
/*-
|
||||||
* Copyright (c) 2014-2018 Carsten Sonne Larsen <cs@innolan.net>
|
* Copyright (c) 2014-2021 Carsten Sonne Larsen <cs@innolan.net>
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*-
|
/*-
|
||||||
* Copyright (c) 2014-2018 Carsten Sonne Larsen <cs@innolan.net>
|
* Copyright (c) 2014-2021 Carsten Sonne Larsen <cs@innolan.net>
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*-
|
/*-
|
||||||
* Copyright (c) 2014-2018 Carsten Sonne Larsen <cs@innolan.net>
|
* Copyright (c) 2014-2021 Carsten Sonne Larsen <cs@innolan.net>
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*-
|
/*-
|
||||||
* Copyright (c) 2014-2018 Carsten Sonne Larsen <cs@innolan.net>
|
* Copyright (c) 2014-2021 Carsten Sonne Larsen <cs@innolan.net>
|
||||||
* Copyright (c) 2007 The NetBSD Foundation, Inc.
|
* Copyright (c) 2007 The NetBSD Foundation, Inc.
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*-
|
/*-
|
||||||
* Copyright (c) 2014-2018 Carsten Sonne Larsen <cs@innolan.net>
|
* Copyright (c) 2014-2021 Carsten Sonne Larsen <cs@innolan.net>
|
||||||
* Copyright (c) 2007 The NetBSD Foundation, Inc.
|
* Copyright (c) 2007 The NetBSD Foundation, Inc.
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*-
|
/*-
|
||||||
* Copyright (c) 2014-2018 Carsten Sonne Larsen <cs@innolan.net>
|
* Copyright (c) 2014-2021 Carsten Sonne Larsen <cs@innolan.net>
|
||||||
* Copyright (c) 2007 The NetBSD Foundation, Inc.
|
* Copyright (c) 2007 The NetBSD Foundation, Inc.
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*-
|
/*-
|
||||||
* Copyright (c) 2014-2018 Carsten Sonne Larsen <cs@innolan.net>
|
* Copyright (c) 2014-2021 Carsten Sonne Larsen <cs@innolan.net>
|
||||||
* Copyright (c) 2007 The NetBSD Foundation, Inc.
|
* Copyright (c) 2007 The NetBSD Foundation, Inc.
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*-
|
/*-
|
||||||
* Copyright (c) 2014-2018 Carsten Sonne Larsen <cs@innolan.net>
|
* Copyright (c) 2014-2021 Carsten Sonne Larsen <cs@innolan.net>
|
||||||
* Copyright (c) 2007 The NetBSD Foundation, Inc.
|
* Copyright (c) 2007 The NetBSD Foundation, Inc.
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*-
|
/*-
|
||||||
* Copyright (c) 2014-2018 Carsten Sonne Larsen <cs@innolan.net>
|
* Copyright (c) 2014-2021 Carsten Sonne Larsen <cs@innolan.net>
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*-
|
/*-
|
||||||
* Copyright (c) 2014-2018 Carsten Sonne Larsen <cs@innolan.net>
|
* Copyright (c) 2014-2021 Carsten Sonne Larsen <cs@innolan.net>
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*-
|
/*-
|
||||||
* Copyright (c) 2014-2018 Carsten Sonne Larsen <cs@innolan.net>
|
* Copyright (c) 2014-2021 Carsten Sonne Larsen <cs@innolan.net>
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*-
|
/*-
|
||||||
* Copyright (c) 2014-2018 Carsten Sonne Larsen <cs@innolan.net>
|
* Copyright (c) 2014-2021 Carsten Sonne Larsen <cs@innolan.net>
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
|
|
@ -5,6 +5,6 @@ libdir=${exec_prefix}/lib
|
||||||
|
|
||||||
Name: amath application library
|
Name: amath application library
|
||||||
Description: C++ library for handling numbers
|
Description: C++ library for handling numbers
|
||||||
Version: 1.8.4
|
Version: 1.9.0
|
||||||
Cflags: -I${includedir}
|
Cflags: -I${includedir}
|
||||||
Libs: -L${libdir} -lamathapp -lamathr -lamathi -lamathc
|
Libs: -L${libdir} -lamathapp -lamathr -lamathi -lamathc
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*-
|
/*-
|
||||||
* Copyright (c) 2014-2018 Carsten Sonne Larsen <cs@innolan.net>
|
* Copyright (c) 2014-2021 Carsten Sonne Larsen <cs@innolan.net>
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*-
|
/*-
|
||||||
* Copyright (c) 2014-2018 Carsten Sonne Larsen <cs@innolan.net>
|
* Copyright (c) 2014-2021 Carsten Sonne Larsen <cs@innolan.net>
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*-
|
/*-
|
||||||
* Copyright (c) 2014-2018 Carsten Sonne Larsen <cs@innolan.net>
|
* Copyright (c) 2014-2021 Carsten Sonne Larsen <cs@innolan.net>
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
@ -185,8 +185,7 @@ bool CharBuffer::IsEmpty() const
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
i++;
|
i++;
|
||||||
}
|
} while (i != ptr);
|
||||||
while (i != ptr);
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -209,8 +208,7 @@ bool CharBuffer::Contains(const char c) const
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
i++;
|
i++;
|
||||||
}
|
} while (i != ptr);
|
||||||
while (i != ptr);
|
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -237,7 +235,8 @@ void CharBuffer::Copy(CharBuffer* source)
|
||||||
|
|
||||||
ptr = buf;
|
ptr = buf;
|
||||||
// ReSharper disable once CppPossiblyErroneousEmptyStatements
|
// ReSharper disable once CppPossiblyErroneousEmptyStatements
|
||||||
while ((*ptr++ = *s++));
|
while ((*ptr++ = *s++))
|
||||||
|
;
|
||||||
|
|
||||||
ptr--;
|
ptr--;
|
||||||
}
|
}
|
||||||
|
@ -262,11 +261,46 @@ void CharBuffer::Append(const char c, unsigned int count)
|
||||||
void CharBuffer::Append(const char *source)
|
void CharBuffer::Append(const char *source)
|
||||||
{
|
{
|
||||||
// ReSharper disable once CppPossiblyErroneousEmptyStatements
|
// ReSharper disable once CppPossiblyErroneousEmptyStatements
|
||||||
while ((*ptr++ = *source++));
|
while ((*ptr++ = *source++))
|
||||||
|
;
|
||||||
|
|
||||||
ptr--;
|
ptr--;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CharBuffer::AppendNumber(signed long value)
|
||||||
|
{
|
||||||
|
static const char *alphaNumerics = "0123456789";
|
||||||
|
unsigned int count = 0;
|
||||||
|
unsigned long current = value;
|
||||||
|
char chars[12];
|
||||||
|
char *p = chars;
|
||||||
|
bool negative = false;
|
||||||
|
|
||||||
|
if (value < 0)
|
||||||
|
{
|
||||||
|
current = -value;
|
||||||
|
negative = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
do
|
||||||
|
{
|
||||||
|
unsigned long remainder = current % 10;
|
||||||
|
*p++ = alphaNumerics[remainder];
|
||||||
|
current /= 10;
|
||||||
|
count++;
|
||||||
|
} while (current >= 1);
|
||||||
|
|
||||||
|
p--;
|
||||||
|
|
||||||
|
if (negative)
|
||||||
|
{
|
||||||
|
*ptr++ = '-';
|
||||||
|
}
|
||||||
|
|
||||||
|
while (count-- != 0)
|
||||||
|
*ptr++ = *p--;
|
||||||
|
}
|
||||||
|
|
||||||
bool CharBuffer::RemoveTrailing(const char c)
|
bool CharBuffer::RemoveTrailing(const char c)
|
||||||
{
|
{
|
||||||
if (ptr == buf)
|
if (ptr == buf)
|
||||||
|
@ -308,3 +342,16 @@ char* CharBuffer::GetString() const
|
||||||
*ptr = '\0';
|
*ptr = '\0';
|
||||||
return buf;
|
return buf;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CharBuffer::CopyTo(char *string)
|
||||||
|
{
|
||||||
|
char *q = buf;
|
||||||
|
char *p = string;
|
||||||
|
|
||||||
|
*ptr = '\0';
|
||||||
|
|
||||||
|
while ((*p++ = *q++))
|
||||||
|
;
|
||||||
|
|
||||||
|
*p = '\0';
|
||||||
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*-
|
/*-
|
||||||
* Copyright (c) 2014-2018 Carsten Sonne Larsen <cs@innolan.net>
|
* Copyright (c) 2014-2021 Carsten Sonne Larsen <cs@innolan.net>
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
@ -69,11 +69,14 @@ public:
|
||||||
void Append(const char* source);
|
void Append(const char* source);
|
||||||
void Append(const char c);
|
void Append(const char c);
|
||||||
void Append(const char c, unsigned int count);
|
void Append(const char c, unsigned int count);
|
||||||
|
void AppendNumber(signed long value);
|
||||||
|
|
||||||
void DeleteLastChar();
|
void DeleteLastChar();
|
||||||
bool RemoveTrailing(const char c);
|
bool RemoveTrailing(const char c);
|
||||||
bool RemoveTrailing(const char* string);
|
bool RemoveTrailing(const char* string);
|
||||||
char* GetString() const;
|
char* GetString() const;
|
||||||
|
void CopyTo(char *string);
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
friend class AnsiConoleEngine;
|
friend class AnsiConoleEngine;
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*-
|
/*-
|
||||||
* Copyright (c) 2014-2018 Carsten Sonne Larsen <cs@innolan.net>
|
* Copyright (c) 2014-2021 Carsten Sonne Larsen <cs@innolan.net>
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*-
|
/*-
|
||||||
* Copyright (c) 2014-2018 Carsten Sonne Larsen <cs@innolan.net>
|
* Copyright (c) 2014-2021 Carsten Sonne Larsen <cs@innolan.net>
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*-
|
/*-
|
||||||
* Copyright (c) 2014-2018 Carsten Sonne Larsen <cs@innolan.net>
|
* Copyright (c) 2014-2021 Carsten Sonne Larsen <cs@innolan.net>
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*-
|
/*-
|
||||||
* Copyright (c) 2014-2018 Carsten Sonne Larsen <cs@innolan.net>
|
* Copyright (c) 2014-2021 Carsten Sonne Larsen <cs@innolan.net>
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*-
|
/*-
|
||||||
* Copyright (c) 2014-2018 Carsten Sonne Larsen <cs@innolan.net>
|
* Copyright (c) 2014-2021 Carsten Sonne Larsen <cs@innolan.net>
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*-
|
/*-
|
||||||
* Copyright (c) 2014-2018 Carsten Sonne Larsen <cs@innolan.net>
|
* Copyright (c) 2014-2021 Carsten Sonne Larsen <cs@innolan.net>
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue