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
|
||||||
|
}
|
10
HISTORY
10
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
|
||||||
|
@ -105,7 +111,7 @@ v1.5.3 October 26 2014
|
||||||
v1.5.2 October 11 2014
|
v1.5.2 October 11 2014
|
||||||
- Modified character handling code to comply with licenses.
|
- Modified character handling code to comply with licenses.
|
||||||
- Modified complex math code to comply with licenses.
|
- Modified complex math code to comply with licenses.
|
||||||
- Modified code base to work with Kickstart 2.04.
|
- Modified code base to work with Kickstart 2.04.
|
||||||
- Square root of negative numbers now yields correct result.
|
- Square root of negative numbers now yields correct result.
|
||||||
- Implemented scientific notation of numbers.
|
- Implemented scientific notation of numbers.
|
||||||
- Infinity is now shown in division with 0.
|
- Infinity is now shown in division with 0.
|
||||||
|
|
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.
|
||||||
|
|
8
amath.1
8
amath.1
|
@ -1,6 +1,6 @@
|
||||||
.\" 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
|
||||||
.\" modification, are permitted provided that the following conditions
|
.\" modification, are permitted provided that the following conditions
|
||||||
.\" are met:
|
.\" are met:
|
||||||
|
@ -9,7 +9,7 @@
|
||||||
.\" 2. Redistributions in binary form must reproduce the above copyright
|
.\" 2. Redistributions in binary form must reproduce the above copyright
|
||||||
.\" notice, this list of conditions and the following disclaimer in the
|
.\" notice, this list of conditions and the following disclaimer in the
|
||||||
.\" documentation and/or other materials provided with the distribution.
|
.\" documentation and/or other materials provided with the distribution.
|
||||||
.\"
|
.\"
|
||||||
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
||||||
.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||||
.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||||
|
@ -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;
|
||||||
|
}
|
||||||
|
'
|
18
builddeb
18
builddeb
|
@ -1,8 +1,8 @@
|
||||||
#!/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
|
||||||
# modification, are permitted provided that the following conditions
|
# modification, are permitted provided that the following conditions
|
||||||
# are met:
|
# are met:
|
||||||
|
@ -11,7 +11,7 @@
|
||||||
# 2. Redistributions in binary form must reproduce the above copyright
|
# 2. Redistributions in binary form must reproduce the above copyright
|
||||||
# notice, this list of conditions and the following disclaimer in the
|
# notice, this list of conditions and the following disclaimer in the
|
||||||
# documentation and/or other materials provided with the distribution.
|
# documentation and/or other materials provided with the distribution.
|
||||||
#
|
#
|
||||||
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
||||||
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
@ -23,14 +23,14 @@
|
||||||
# LIABILITY, OR TORT {INCLUDING NEGLIGENCE OR OTHERWISE} ARISING IN ANY WAY
|
# LIABILITY, OR TORT {INCLUDING NEGLIGENCE OR OTHERWISE} ARISING IN ANY WAY
|
||||||
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
# SUCH DAMAGE.
|
# SUCH DAMAGE.
|
||||||
#
|
#
|
||||||
# Project homepage:
|
# Project homepage:
|
||||||
# https://amath.innolan.net
|
# https://amath.innolan.net
|
||||||
#
|
#
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
version="1.8.4"
|
version="1.9.0"
|
||||||
|
|
||||||
build_package () {
|
build_package () {
|
||||||
|
|
||||||
|
@ -103,9 +103,9 @@ chmod 0755 amath/DEBIAN/control
|
||||||
echo "Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/"
|
echo "Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/"
|
||||||
echo "Upstream-Name: amath"
|
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"
|
||||||
|
|
18
builddebdev
18
builddebdev
|
@ -1,8 +1,8 @@
|
||||||
#!/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
|
||||||
# modification, are permitted provided that the following conditions
|
# modification, are permitted provided that the following conditions
|
||||||
# are met:
|
# are met:
|
||||||
|
@ -11,7 +11,7 @@
|
||||||
# 2. Redistributions in binary form must reproduce the above copyright
|
# 2. Redistributions in binary form must reproduce the above copyright
|
||||||
# notice, this list of conditions and the following disclaimer in the
|
# notice, this list of conditions and the following disclaimer in the
|
||||||
# documentation and/or other materials provided with the distribution.
|
# documentation and/or other materials provided with the distribution.
|
||||||
#
|
#
|
||||||
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
||||||
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
@ -23,16 +23,16 @@
|
||||||
# LIABILITY, OR TORT {INCLUDING NEGLIGENCE OR OTHERWISE} ARISING IN ANY WAY
|
# LIABILITY, OR TORT {INCLUDING NEGLIGENCE OR OTHERWISE} ARISING IN ANY WAY
|
||||||
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
# SUCH DAMAGE.
|
# SUCH DAMAGE.
|
||||||
#
|
#
|
||||||
# Project homepage:
|
# Project homepage:
|
||||||
# https://amath.innolan.net
|
# https://amath.innolan.net
|
||||||
#
|
#
|
||||||
|
|
||||||
# THIS SCRIPT IS NOT READY FOR PRODUCTION !
|
# THIS SCRIPT IS NOT READY FOR PRODUCTION !
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
version="1.8.4"
|
version="1.9.0"
|
||||||
|
|
||||||
build_package () {
|
build_package () {
|
||||||
|
|
||||||
|
@ -147,9 +147,9 @@ chmod 0755 amath/DEBIAN/control
|
||||||
echo "Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/"
|
echo "Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/"
|
||||||
echo "Upstream-Name: amath-dev"
|
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"
|
||||||
|
|
113
builddist
113
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}/
|
||||||
|
|
17
buildsrc
17
buildsrc
|
@ -1,21 +1,21 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
#
|
#
|
||||||
|
# Build source distribtion package
|
||||||
# This file is public domain
|
# This file is public domain
|
||||||
#
|
#
|
||||||
# Project homepage:
|
# Project homepage:
|
||||||
# https://amath.innolan.net
|
# https://amath.innolan.net
|
||||||
#
|
#
|
||||||
|
|
||||||
# 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}/
|
||||||
|
|
||||||
|
|
8
buildwin
8
buildwin
|
@ -1,14 +1,14 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
#
|
#
|
||||||
# This file is public domain
|
# This file is public domain
|
||||||
#
|
#
|
||||||
# Project homepage:
|
# Project homepage:
|
||||||
# https://amath.innolan.net
|
# https://amath.innolan.net
|
||||||
#
|
#
|
||||||
|
|
||||||
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,19 +2,19 @@
|
||||||
## 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
|
||||||
; modification, are permitted provided that the following conditions are met:
|
; modification, are permitted provided that the following conditions are met:
|
||||||
;
|
;
|
||||||
; * Redistributions of source code must retain the above copyright notice, this
|
; * Redistributions of source code must retain the above copyright notice, this
|
||||||
; list of conditions and the following disclaimer.
|
; list of conditions and the following disclaimer.
|
||||||
;
|
;
|
||||||
; * Redistributions in binary form must reproduce the above copyright notice,
|
; * Redistributions in binary form must reproduce the above copyright notice,
|
||||||
; this list of conditions and the following disclaimer in the documentation
|
; this list of conditions and the following disclaimer in the documentation
|
||||||
; and/or other materials provided with the distribution.
|
; and/or other materials provided with the distribution.
|
||||||
;
|
;
|
||||||
; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
|
|
|
@ -2,19 +2,19 @@
|
||||||
## 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
|
||||||
; modification, are permitted provided that the following conditions are met:
|
; modification, are permitted provided that the following conditions are met:
|
||||||
;
|
;
|
||||||
; * Redistributions of source code must retain the above copyright notice, this
|
; * Redistributions of source code must retain the above copyright notice, this
|
||||||
; list of conditions and the following disclaimer.
|
; list of conditions and the following disclaimer.
|
||||||
;
|
;
|
||||||
; * Redistributions in binary form must reproduce the above copyright notice,
|
; * Redistributions in binary form must reproduce the above copyright notice,
|
||||||
; this list of conditions and the following disclaimer in the documentation
|
; this list of conditions and the following disclaimer in the documentation
|
||||||
; and/or other materials provided with the distribution.
|
; and/or other materials provided with the distribution.
|
||||||
;
|
;
|
||||||
; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
#!/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
|
||||||
# modification, are permitted provided that the following conditions
|
# modification, are permitted provided that the following conditions
|
||||||
# are met:
|
# are met:
|
||||||
|
@ -11,7 +11,7 @@
|
||||||
# 2. Redistributions in binary form must reproduce the above copyright
|
# 2. Redistributions in binary form must reproduce the above copyright
|
||||||
# notice, this list of conditions and the following disclaimer in the
|
# notice, this list of conditions and the following disclaimer in the
|
||||||
# documentation and/or other materials provided with the distribution.
|
# documentation and/or other materials provided with the distribution.
|
||||||
#
|
#
|
||||||
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
||||||
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
@ -23,11 +23,11 @@
|
||||||
# LIABILITY, OR TORT {INCLUDING NEGLIGENCE OR OTHERWISE} ARISING IN ANY WAY
|
# LIABILITY, OR TORT {INCLUDING NEGLIGENCE OR OTHERWISE} ARISING IN ANY WAY
|
||||||
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
# SUCH DAMAGE.
|
# SUCH DAMAGE.
|
||||||
#
|
#
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
version="1.8.4"
|
version="1.9.0"
|
||||||
|
|
||||||
clang=false
|
clang=false
|
||||||
debugsym=false
|
debugsym=false
|
||||||
|
@ -264,7 +264,7 @@ if $stdlibm; then
|
||||||
mflags="-DLIBM "
|
mflags="-DLIBM "
|
||||||
dlibm=true
|
dlibm=true
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if $openlibm; then
|
if $openlibm; then
|
||||||
libm="-lopenlibm "
|
libm="-lopenlibm "
|
||||||
mflags="-DLIBM "
|
mflags="-DLIBM "
|
||||||
|
@ -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"
|
||||||
|
|
184
src/amath.h
184
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
|
||||||
|
@ -24,66 +24,95 @@
|
||||||
*
|
*
|
||||||
* Project homepage:
|
* Project homepage:
|
||||||
* https://amath.innolan.net
|
* https://amath.innolan.net
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#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
|
||||||
#endif
|
#elif defined(__AMIGA__) || defined(__amigaos3__)
|
||||||
/******************************************************************************/
|
# define SYS_NAME "AmigaOS 3"
|
||||||
#ifdef __HAIKU__
|
# ifndef AOS3
|
||||||
|
# define AOS3
|
||||||
|
# endif
|
||||||
|
#elif defined(__AROS__)
|
||||||
|
# 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
|
||||||
#endif
|
#elif defined(__FreeBSD__)
|
||||||
/******************************************************************************/
|
# define SYS_NAME "FreeBSD"
|
||||||
#if defined(_WIN32) || defined(_WIN64)
|
# ifndef FREEBSD
|
||||||
|
# define FREEBSD
|
||||||
|
# endif
|
||||||
|
#elif defined(__NetBSD__)
|
||||||
|
# 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,39 +120,38 @@
|
||||||
# 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
|
||||||
#endif
|
# endif
|
||||||
#elif (__cplusplus <= 199711L) && (defined(__GNUC__) || defined(__GNUG__))
|
#elif (__cplusplus <= 199711L) && (defined(__GNUC__) || defined(__GNUG__))
|
||||||
#ifndef nullptr
|
# ifndef nullptr
|
||||||
#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 */
|
||||||
# if defined(__apple_build_version__)
|
# if defined(__apple_build_version__)
|
||||||
|
@ -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
|
||||||
|
@ -24,7 +24,7 @@
|
||||||
*
|
*
|
||||||
* Project homepage:
|
* Project homepage:
|
||||||
* https://amath.innolan.net
|
* https://amath.innolan.net
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef AMATHC_H
|
#ifndef AMATHC_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
|
||||||
|
@ -24,7 +24,7 @@
|
||||||
*
|
*
|
||||||
* Project homepage:
|
* Project homepage:
|
||||||
* https://amath.innolan.net
|
* https://amath.innolan.net
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef AMATHT_H
|
#ifndef AMATHT_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
|
||||||
|
@ -24,7 +24,7 @@
|
||||||
*
|
*
|
||||||
* Project homepage:
|
* Project homepage:
|
||||||
* https://amath.innolan.net
|
* https://amath.innolan.net
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "amathc.h"
|
#include "amathc.h"
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
.\" 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
|
||||||
.\" modification, are permitted provided that the following conditions
|
.\" modification, are permitted provided that the following conditions
|
||||||
.\" are met:
|
.\" are met:
|
||||||
|
@ -9,7 +9,7 @@
|
||||||
.\" 2. Redistributions in binary form must reproduce the above copyright
|
.\" 2. Redistributions in binary form must reproduce the above copyright
|
||||||
.\" notice, this list of conditions and the following disclaimer in the
|
.\" notice, this list of conditions and the following disclaimer in the
|
||||||
.\" documentation and/or other materials provided with the distribution.
|
.\" documentation and/or other materials provided with the distribution.
|
||||||
.\"
|
.\"
|
||||||
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
||||||
.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||||
.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||||
|
@ -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
|
||||||
|
@ -82,7 +82,7 @@ amathc.h \- C functions for manipulating strings and memory
|
||||||
.PP
|
.PP
|
||||||
.SS "unsigned int AllocAndCopy (char ** destination, const char * source)"
|
.SS "unsigned int AllocAndCopy (char ** destination, const char * source)"
|
||||||
.PP
|
.PP
|
||||||
Allocate memory and copy a string into the array\&.
|
Allocate memory and copy a string into the array\&.
|
||||||
.PP
|
.PP
|
||||||
Definition at line 40 of file alloccpy\&.c\&.
|
Definition at line 40 of file alloccpy\&.c\&.
|
||||||
.PP
|
.PP
|
||||||
|
@ -90,32 +90,32 @@ Definition at line 40 of file alloccpy\&.c\&.
|
||||||
41 {
|
41 {
|
||||||
42 char *i, *s, *d;
|
42 char *i, *s, *d;
|
||||||
43 unsigned int n, size;
|
43 unsigned int n, size;
|
||||||
44
|
44
|
||||||
45 if (source == nullptr)
|
45 if (source == nullptr)
|
||||||
46 {
|
46 {
|
||||||
47 *destination = nullptr;
|
47 *destination = nullptr;
|
||||||
48 return 0;
|
48 return 0;
|
||||||
49 }
|
49 }
|
||||||
50
|
50
|
||||||
51 i = (char*)source;
|
51 i = (char*)source;
|
||||||
52 s = (char*)source;
|
52 s = (char*)source;
|
||||||
53 while (*i)
|
53 while (*i)
|
||||||
54 i++;
|
54 i++;
|
||||||
55
|
55
|
||||||
56 n = (unsigned int)(i - s + 1);
|
56 n = (unsigned int)(i - s + 1);
|
||||||
57 size = n;
|
57 size = n;
|
||||||
58 *destination = AllocMemSafe(size);
|
58 *destination = AllocMemSafe(size);
|
||||||
59 d = *destination;
|
59 d = *destination;
|
||||||
60
|
60
|
||||||
64 while (n--)
|
64 while (n--)
|
||||||
65 *d++ = *s++;
|
65 *d++ = *s++;
|
||||||
67
|
67
|
||||||
68 return size;
|
68 return size;
|
||||||
69 }
|
69 }
|
||||||
.fi
|
.fi
|
||||||
.SS "void* AllocMemSafe (size_t)"
|
.SS "void* AllocMemSafe (size_t)"
|
||||||
.PP
|
.PP
|
||||||
Allocate memory and add it to the global memory list\&.
|
Allocate memory and add it to the global memory list\&.
|
||||||
.PP
|
.PP
|
||||||
Definition at line 86 of file mem\&.c\&.
|
Definition at line 86 of file mem\&.c\&.
|
||||||
.PP
|
.PP
|
||||||
|
@ -123,7 +123,7 @@ Definition at line 86 of file mem\&.c\&.
|
||||||
87 {
|
87 {
|
||||||
88 struct MemoryBlock* newblock;
|
88 struct MemoryBlock* newblock;
|
||||||
89 size_t allocsize;
|
89 size_t allocsize;
|
||||||
90
|
90
|
||||||
91 if (list == nullptr)
|
91 if (list == nullptr)
|
||||||
92 {
|
92 {
|
||||||
93 list = (struct MemoryList*)ALLOC_MEM(sizeof(struct MemoryList));
|
93 list = (struct MemoryList*)ALLOC_MEM(sizeof(struct MemoryList));
|
||||||
|
@ -132,13 +132,13 @@ Definition at line 86 of file mem\&.c\&.
|
||||||
96 alloc_error("list", sizeof(struct MemoryList));
|
96 alloc_error("list", sizeof(struct MemoryList));
|
||||||
97 return 0;
|
97 return 0;
|
||||||
98 }
|
98 }
|
||||||
99
|
99
|
||||||
100 list->first = nullptr;
|
100 list->first = nullptr;
|
||||||
101 list->peak = 0;
|
101 list->peak = 0;
|
||||||
102 list->size = 0;
|
102 list->size = 0;
|
||||||
103 list->count = 0;
|
103 list->count = 0;
|
||||||
104 }
|
104 }
|
||||||
105
|
105
|
||||||
106 #ifdef P64BIT
|
106 #ifdef P64BIT
|
||||||
107 // Align to bytes of 8
|
107 // Align to bytes of 8
|
||||||
108 allocsize = (size + 7) & ~0x07;
|
108 allocsize = (size + 7) & ~0x07;
|
||||||
|
@ -146,14 +146,14 @@ Definition at line 86 of file mem\&.c\&.
|
||||||
110 // Align to bytes of 4
|
110 // Align to bytes of 4
|
||||||
111 allocsize = (size + 3) & ~0x03;
|
111 allocsize = (size + 3) & ~0x03;
|
||||||
112 #endif
|
112 #endif
|
||||||
113
|
113
|
||||||
114 newblock = (struct MemoryBlock*)ALLOC_MEM(sizeof(struct MemoryBlock));
|
114 newblock = (struct MemoryBlock*)ALLOC_MEM(sizeof(struct MemoryBlock));
|
||||||
115 if (!newblock)
|
115 if (!newblock)
|
||||||
116 {
|
116 {
|
||||||
117 alloc_error("block", sizeof(struct MemoryBlock));
|
117 alloc_error("block", sizeof(struct MemoryBlock));
|
||||||
118 return 0;
|
118 return 0;
|
||||||
119 }
|
119 }
|
||||||
120
|
120
|
||||||
121 newblock->address = (struct MemoryBlock*)ALLOC_MEM(allocsize);
|
121 newblock->address = (struct MemoryBlock*)ALLOC_MEM(allocsize);
|
||||||
122 if (!newblock->address)
|
122 if (!newblock->address)
|
||||||
123 {
|
123 {
|
||||||
|
@ -161,25 +161,25 @@ Definition at line 86 of file mem\&.c\&.
|
||||||
125 alloc_error("memory", allocsize);
|
125 alloc_error("memory", allocsize);
|
||||||
126 return 0;
|
126 return 0;
|
||||||
127 }
|
127 }
|
||||||
128
|
128
|
||||||
129 newblock->size = allocsize;
|
129 newblock->size = allocsize;
|
||||||
130 newblock->next = list->first;
|
130 newblock->next = list->first;
|
||||||
131 list->first = newblock;
|
131 list->first = newblock;
|
||||||
132 list->size += allocsize;
|
132 list->size += allocsize;
|
||||||
133 list->count++;
|
133 list->count++;
|
||||||
134
|
134
|
||||||
135 if (list->size > list->peak)
|
135 if (list->size > list->peak)
|
||||||
136 {
|
136 {
|
||||||
137 list->peak = list->size;
|
137 list->peak = list->size;
|
||||||
138 }
|
138 }
|
||||||
139
|
139
|
||||||
140 // Memory allocated
|
140 // Memory allocated
|
||||||
141 return newblock->address;
|
141 return newblock->address;
|
||||||
142 }
|
142 }
|
||||||
.fi
|
.fi
|
||||||
.SS "void DetachMemSafe (void * block)"
|
.SS "void DetachMemSafe (void * block)"
|
||||||
.PP
|
.PP
|
||||||
Detach an allocated memory from the global memory list\&. The memory block is only detached, not deallocated\&.
|
Detach an allocated memory from the global memory list\&. The memory block is only detached, not deallocated\&.
|
||||||
.PP
|
.PP
|
||||||
Definition at line 209 of file mem\&.c\&.
|
Definition at line 209 of file mem\&.c\&.
|
||||||
.PP
|
.PP
|
||||||
|
@ -190,19 +190,19 @@ Definition at line 209 of file mem\&.c\&.
|
||||||
.fi
|
.fi
|
||||||
.SS "void FreeAllSafe ()"
|
.SS "void FreeAllSafe ()"
|
||||||
.PP
|
.PP
|
||||||
Deallocate all memory in the global memory list\&.
|
Deallocate all memory in the global memory list\&.
|
||||||
.PP
|
.PP
|
||||||
Definition at line 217 of file mem\&.c\&.
|
Definition at line 217 of file mem\&.c\&.
|
||||||
.PP
|
.PP
|
||||||
.nf
|
.nf
|
||||||
218 {
|
218 {
|
||||||
219 struct MemoryBlock *current, *next;
|
219 struct MemoryBlock *current, *next;
|
||||||
220
|
220
|
||||||
221 if (list == nullptr)
|
221 if (list == nullptr)
|
||||||
222 {
|
222 {
|
||||||
223 return;
|
223 return;
|
||||||
224 }
|
224 }
|
||||||
225
|
225
|
||||||
226 current = list->first;
|
226 current = list->first;
|
||||||
227 while (current != nullptr)
|
227 while (current != nullptr)
|
||||||
228 {
|
228 {
|
||||||
|
@ -211,14 +211,14 @@ Definition at line 217 of file mem\&.c\&.
|
||||||
231 FREE_MEM(current);
|
231 FREE_MEM(current);
|
||||||
232 current = next;
|
232 current = next;
|
||||||
233 }
|
233 }
|
||||||
234
|
234
|
||||||
235 FREE_MEM(list);
|
235 FREE_MEM(list);
|
||||||
236 list = nullptr;
|
236 list = nullptr;
|
||||||
237 }
|
237 }
|
||||||
.fi
|
.fi
|
||||||
.SS "void FreeMemSafe (void *)"
|
.SS "void FreeMemSafe (void *)"
|
||||||
.PP
|
.PP
|
||||||
Deallocate memory from the global memory list\&.
|
Deallocate memory from the global memory list\&.
|
||||||
.PP
|
.PP
|
||||||
Definition at line 200 of file mem\&.c\&.
|
Definition at line 200 of file mem\&.c\&.
|
||||||
.PP
|
.PP
|
||||||
|
@ -229,7 +229,7 @@ Definition at line 200 of file mem\&.c\&.
|
||||||
.fi
|
.fi
|
||||||
.SS "void MemCopy (void * destination, const void * source, unsigned int length)"
|
.SS "void MemCopy (void * destination, const void * source, unsigned int length)"
|
||||||
.PP
|
.PP
|
||||||
Copy a block of memory, handling overlap\&.
|
Copy a block of memory, handling overlap\&.
|
||||||
.PP
|
.PP
|
||||||
Definition at line 75 of file memcpy\&.c\&.
|
Definition at line 75 of file memcpy\&.c\&.
|
||||||
.PP
|
.PP
|
||||||
|
@ -238,10 +238,10 @@ Definition at line 75 of file memcpy\&.c\&.
|
||||||
77 char* dst = (char*) destination;
|
77 char* dst = (char*) destination;
|
||||||
78 const char* src = (const char*) source;
|
78 const char* src = (const char*) source;
|
||||||
79 unsigned int t;
|
79 unsigned int t;
|
||||||
80
|
80
|
||||||
81 if (length == 0 || dst == src) // nothing to do
|
81 if (length == 0 || dst == src) // nothing to do
|
||||||
82 return;
|
82 return;
|
||||||
83
|
83
|
||||||
84 if ((mem_ptr)dst < (mem_ptr)src)
|
84 if ((mem_ptr)dst < (mem_ptr)src)
|
||||||
85 {
|
85 {
|
||||||
86 // Copy forward
|
86 // Copy forward
|
||||||
|
@ -254,14 +254,14 @@ Definition at line 75 of file memcpy\&.c\&.
|
||||||
96 else
|
96 else
|
||||||
97 t = wsize - (t & wmask);
|
97 t = wsize - (t & wmask);
|
||||||
98 length -= t;
|
98 length -= t;
|
||||||
99
|
99
|
||||||
100 TLOOP1(*dst++ = *src++);
|
100 TLOOP1(*dst++ = *src++);
|
||||||
101 }
|
101 }
|
||||||
102
|
102
|
||||||
103 // Copy whole words, then mop up any trailing bytes\&.
|
103 // Copy whole words, then mop up any trailing bytes\&.
|
||||||
104 t = length / wsize;
|
104 t = length / wsize;
|
||||||
105 TLOOP(*(word *)dst = *(word *)src; src += wsize; dst += wsize);
|
105 TLOOP(*(word *)dst = *(word *)src; src += wsize; dst += wsize);
|
||||||
106
|
106
|
||||||
107 t = length & wmask;
|
107 t = length & wmask;
|
||||||
108 TLOOP(*dst++ = *src++);
|
108 TLOOP(*dst++ = *src++);
|
||||||
110 }
|
110 }
|
||||||
|
@ -280,13 +280,13 @@ Definition at line 75 of file memcpy\&.c\&.
|
||||||
123 else
|
123 else
|
||||||
124 t &= wmask;
|
124 t &= wmask;
|
||||||
125 length -= t;
|
125 length -= t;
|
||||||
126
|
126
|
||||||
127 TLOOP1(*--dst = *--src);
|
127 TLOOP1(*--dst = *--src);
|
||||||
128 }
|
128 }
|
||||||
129
|
129
|
||||||
130 t = length / wsize;
|
130 t = length / wsize;
|
||||||
131 TLOOP(src -= wsize; dst -= wsize; *(word *)dst = *(word *)src);
|
131 TLOOP(src -= wsize; dst -= wsize; *(word *)dst = *(word *)src);
|
||||||
132
|
132
|
||||||
133 t = length & wmask;
|
133 t = length & wmask;
|
||||||
134 TLOOP(*--dst = *--src);
|
134 TLOOP(*--dst = *--src);
|
||||||
135 }
|
135 }
|
||||||
|
@ -294,7 +294,7 @@ Definition at line 75 of file memcpy\&.c\&.
|
||||||
.fi
|
.fi
|
||||||
.SS "void MemSet (void * destination, int c0, unsigned int length)"
|
.SS "void MemSet (void * destination, int c0, unsigned int length)"
|
||||||
.PP
|
.PP
|
||||||
Fill block of memory with a constant value\&.
|
Fill block of memory with a constant value\&.
|
||||||
.PP
|
.PP
|
||||||
Definition at line 56 of file memset\&.c\&.
|
Definition at line 56 of file memset\&.c\&.
|
||||||
.PP
|
.PP
|
||||||
|
@ -303,7 +303,7 @@ Definition at line 56 of file memset\&.c\&.
|
||||||
58 unsigned char* dst = (unsigned char*) dst0;
|
58 unsigned char* dst = (unsigned char*) dst0;
|
||||||
59 unsigned int t;
|
59 unsigned int t;
|
||||||
60 unsigned int c;
|
60 unsigned int c;
|
||||||
61
|
61
|
||||||
62 /*
|
62 /*
|
||||||
63 * If not enough words, just fill bytes\&. A length >= 2 words
|
63 * If not enough words, just fill bytes\&. A length >= 2 words
|
||||||
64 * guarantees that at least one of them is `complete' after
|
64 * guarantees that at least one of them is `complete' after
|
||||||
|
@ -325,7 +325,7 @@ Definition at line 56 of file memset\&.c\&.
|
||||||
80 --length;
|
80 --length;
|
||||||
81 }
|
81 }
|
||||||
82 }
|
82 }
|
||||||
83
|
83
|
||||||
84 if ((c = (unsigned char)c0) != 0)
|
84 if ((c = (unsigned char)c0) != 0)
|
||||||
85 { /* Fill the word\&. */
|
85 { /* Fill the word\&. */
|
||||||
86 c = (c << 8) | c; /* u_int is 16 bits\&. */
|
86 c = (c << 8) | c; /* u_int is 16 bits\&. */
|
||||||
|
@ -336,7 +336,7 @@ Definition at line 56 of file memset\&.c\&.
|
||||||
91 c = (c << 32) | c; /* u_int is 64 bits\&. */
|
91 c = (c << 32) | c; /* u_int is 64 bits\&. */
|
||||||
92 #endif
|
92 #endif
|
||||||
93 }
|
93 }
|
||||||
94
|
94
|
||||||
95 /* Align destination by filling in bytes\&. */
|
95 /* Align destination by filling in bytes\&. */
|
||||||
96 if ((t = (mem_ptr)dst & wmask) != 0)
|
96 if ((t = (mem_ptr)dst & wmask) != 0)
|
||||||
97 {
|
97 {
|
||||||
|
@ -348,7 +348,7 @@ Definition at line 56 of file memset\&.c\&.
|
||||||
103 }
|
103 }
|
||||||
104 while (--t != 0);
|
104 while (--t != 0);
|
||||||
105 }
|
105 }
|
||||||
106
|
106
|
||||||
107 /* Fill words\&. Length was >= 2*words so we know t >= 1 here\&. */
|
107 /* Fill words\&. Length was >= 2*words so we know t >= 1 here\&. */
|
||||||
108 t = length / wsize;
|
108 t = length / wsize;
|
||||||
109 do
|
109 do
|
||||||
|
@ -357,7 +357,7 @@ Definition at line 56 of file memset\&.c\&.
|
||||||
112 dst += wsize;
|
112 dst += wsize;
|
||||||
113 }
|
113 }
|
||||||
114 while (--t != 0);
|
114 while (--t != 0);
|
||||||
115
|
115
|
||||||
116 /* Mop up trailing bytes, if any\&. */
|
116 /* Mop up trailing bytes, if any\&. */
|
||||||
117 t = length & wmask;
|
117 t = length & wmask;
|
||||||
118 if (t != 0)
|
118 if (t != 0)
|
||||||
|
@ -370,7 +370,7 @@ Definition at line 56 of file memset\&.c\&.
|
||||||
.fi
|
.fi
|
||||||
.SS "void MemUsage (long *, long *, long *)"
|
.SS "void MemUsage (long *, long *, long *)"
|
||||||
.PP
|
.PP
|
||||||
Get memory usage in the global memory list\&.
|
Get memory usage in the global memory list\&.
|
||||||
.PP
|
.PP
|
||||||
Definition at line 242 of file mem\&.c\&.
|
Definition at line 242 of file mem\&.c\&.
|
||||||
.PP
|
.PP
|
||||||
|
@ -383,26 +383,26 @@ Definition at line 242 of file mem\&.c\&.
|
||||||
.fi
|
.fi
|
||||||
.SS "bool StrIsEqual (const char * s1, const char * s2)"
|
.SS "bool StrIsEqual (const char * s1, const char * s2)"
|
||||||
.PP
|
.PP
|
||||||
Compare two null terminated strings to each other\&.
|
Compare two null terminated strings to each other\&.
|
||||||
.PP
|
.PP
|
||||||
Definition at line 50 of file strcmp\&.c\&.
|
Definition at line 50 of file strcmp\&.c\&.
|
||||||
.PP
|
.PP
|
||||||
.nf
|
.nf
|
||||||
51 {
|
51 {
|
||||||
52 int r;
|
52 int r;
|
||||||
53
|
53
|
||||||
54 while (*s1 == *s2++)
|
54 while (*s1 == *s2++)
|
||||||
55 if (*s1++ == '\0')
|
55 if (*s1++ == '\0')
|
||||||
56 return true;
|
56 return true;
|
||||||
57
|
57
|
||||||
58 r = (*(const unsigned char *)s1 - *(const unsigned char *)(s2 - 1));
|
58 r = (*(const unsigned char *)s1 - *(const unsigned char *)(s2 - 1));
|
||||||
59
|
59
|
||||||
60 return r == 0;
|
60 return r == 0;
|
||||||
61 }
|
61 }
|
||||||
.fi
|
.fi
|
||||||
.SS "int StrLen (const char * string)"
|
.SS "int StrLen (const char * string)"
|
||||||
.PP
|
.PP
|
||||||
Get the length of a null terminated string\&.
|
Get the length of a null terminated string\&.
|
||||||
.PP
|
.PP
|
||||||
Definition at line 34 of file strlen\&.c\&.
|
Definition at line 34 of file strlen\&.c\&.
|
||||||
.PP
|
.PP
|
||||||
|
@ -424,10 +424,10 @@ Definition at line 32 of file untag\&.c\&.
|
||||||
34 const char *pos, *tmp, *tag;
|
34 const char *pos, *tmp, *tag;
|
||||||
35 char* dest;
|
35 char* dest;
|
||||||
36 int unsigned i, j, found;
|
36 int unsigned i, j, found;
|
||||||
37
|
37
|
||||||
38 pos = source;
|
38 pos = source;
|
||||||
39 dest = destination;
|
39 dest = destination;
|
||||||
40
|
40
|
||||||
41 while (*pos != '\0')
|
41 while (*pos != '\0')
|
||||||
42 {
|
42 {
|
||||||
43 if (*pos != '#')
|
43 if (*pos != '#')
|
||||||
|
@ -449,7 +449,7 @@ Definition at line 32 of file untag\&.c\&.
|
||||||
59 tag++;
|
59 tag++;
|
||||||
60 j++;
|
60 j++;
|
||||||
61 }
|
61 }
|
||||||
62
|
62
|
||||||
63 if (j > 1 && *(--tag) == '#')
|
63 if (j > 1 && *(--tag) == '#')
|
||||||
64 {
|
64 {
|
||||||
65 // Tag found\&. Now replace\&.
|
65 // Tag found\&. Now replace\&.
|
||||||
|
@ -461,7 +461,7 @@ Definition at line 32 of file untag\&.c\&.
|
||||||
71 break;
|
71 break;
|
||||||
72 }
|
72 }
|
||||||
73 }
|
73 }
|
||||||
74
|
74
|
||||||
75 if (!found)
|
75 if (!found)
|
||||||
76 {
|
76 {
|
||||||
77 (*dest++ = *pos++);
|
77 (*dest++ = *pos++);
|
||||||
|
@ -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,10 +1,10 @@
|
||||||
|
|
||||||
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 =
|
||||||
CREATE_SUBDIRS = NO
|
CREATE_SUBDIRS = NO
|
||||||
ALLOW_UNICODE_NAMES = NO
|
ALLOW_UNICODE_NAMES = NO
|
||||||
OUTPUT_LANGUAGE = English
|
OUTPUT_LANGUAGE = English
|
||||||
|
|
|
@ -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
|
||||||
|
|
116
src/clib/mem.c
116
src/clib/mem.c
|
@ -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
|
||||||
|
@ -24,7 +24,7 @@
|
||||||
*
|
*
|
||||||
* Project homepage:
|
* Project homepage:
|
||||||
* https://amath.innolan.net
|
* https://amath.innolan.net
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "amathc.h"
|
#include "amathc.h"
|
||||||
|
@ -35,18 +35,22 @@
|
||||||
#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 Debug(x,y,z)
|
#define ALLOC_MEM(x, y) AllocPooledZero(x, y)
|
||||||
|
#define FREE_MEM(x, y, z) FreePooled(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 Debug(x,y,z)
|
#define ALLOC_MEM(x, y) calloc(1L, y)
|
||||||
|
#define FREE_MEM(x, y, z) free(y)
|
||||||
|
#define Debug(x, y, z)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(__x86_64__) || defined(__aarch64__) || \
|
#if defined(__x86_64__) || defined(__aarch64__) || \
|
||||||
defined(_M_AMD64) || defined(_M_ARM64) || \
|
defined(_M_AMD64) || defined(_M_ARM64) || \
|
||||||
defined(__powerpc64__)
|
defined(__powerpc64__)
|
||||||
#define P64BIT
|
#define P64BIT
|
||||||
#endif
|
#endif
|
||||||
|
@ -56,9 +60,9 @@
|
||||||
*/
|
*/
|
||||||
struct MemoryBlock
|
struct MemoryBlock
|
||||||
{
|
{
|
||||||
struct MemoryBlock* next;
|
struct MemoryBlock *next;
|
||||||
size_t size;
|
size_t size;
|
||||||
void* address;
|
void *address;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -66,7 +70,8 @@ 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;
|
||||||
|
@ -75,28 +80,56 @@ struct MemoryList
|
||||||
/**
|
/**
|
||||||
* @brief Global list of allocated memory.
|
* @brief Global list of allocated memory.
|
||||||
*/
|
*/
|
||||||
struct MemoryList* list = nullptr;
|
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.
|
||||||
*/
|
*/
|
||||||
void* AllocMemSafe(size_t size)
|
void *AllocMemSafe(size_t size)
|
||||||
{
|
{
|
||||||
struct MemoryBlock* newblock;
|
struct MemoryBlock *newblock;
|
||||||
size_t allocsize;
|
size_t allocsize;
|
||||||
|
|
||||||
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;
|
||||||
}
|
}
|
||||||
|
@ -141,7 +174,7 @@ void* AllocMemSafe(size_t size)
|
||||||
return newblock->address;
|
return newblock->address;
|
||||||
}
|
}
|
||||||
|
|
||||||
void RemoveMemSafe(void* block, bool deallocate)
|
void RemoveMemSafe(void *block, bool deallocate)
|
||||||
{
|
{
|
||||||
struct MemoryBlock *current, *previous;
|
struct MemoryBlock *current, *previous;
|
||||||
|
|
||||||
|
@ -185,19 +218,19 @@ 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));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Deallocate memory from the global memory list.
|
* @brief Deallocate memory from the global memory list.
|
||||||
*/
|
*/
|
||||||
void FreeMemSafe(void* block)
|
void FreeMemSafe(void *block)
|
||||||
{
|
{
|
||||||
RemoveMemSafe(block, true);
|
RemoveMemSafe(block, true);
|
||||||
}
|
}
|
||||||
|
@ -206,7 +239,7 @@ void FreeMemSafe(void* block)
|
||||||
* @brief Detach an allocated memory from the global memory list.
|
* @brief Detach an allocated memory from the global memory list.
|
||||||
* @details The memory block is only detached, not deallocated.
|
* @details The memory block is only detached, not deallocated.
|
||||||
*/
|
*/
|
||||||
void DetachMemSafe(void* block)
|
void DetachMemSafe(void *block)
|
||||||
{
|
{
|
||||||
RemoveMemSafe(block, false);
|
RemoveMemSafe(block, false);
|
||||||
}
|
}
|
||||||
|
@ -227,29 +260,34 @@ 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;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Get memory usage in the global memory list.
|
* @brief Get memory usage in the global memory list.
|
||||||
*/
|
*/
|
||||||
void MemUsage(long* blocks, long* size, long* peak)
|
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;
|
||||||
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Log a memory allocation error
|
* @brief Log a memory allocation error
|
||||||
*/
|
*/
|
||||||
void alloc_error(char* descr, size_t size)
|
void alloc_error(char *descr, size_t size)
|
||||||
{
|
{
|
||||||
Debug("Memory allocation error (%s) with size (%d)\n", descr, size);
|
Debug("Memory allocation error (%s) with size (%d)\n", descr, size);
|
||||||
//if (size == 0)
|
//if (size == 0)
|
||||||
|
@ -259,7 +297,7 @@ void alloc_error(char* descr, size_t size)
|
||||||
/**
|
/**
|
||||||
* @brief Log a memory deallocation error
|
* @brief Log a memory deallocation error
|
||||||
*/
|
*/
|
||||||
void dealloc_error(char* descr, void* p)
|
void dealloc_error(char *descr, void *p)
|
||||||
{
|
{
|
||||||
Debug("Memory deallocation error (%s) address (%x)\n", descr, p);
|
Debug("Memory deallocation error (%s) address (%x)\n", descr, p);
|
||||||
}
|
}
|
||||||
|
|
|
@ -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.
|
||||||
*
|
*
|
||||||
|
@ -28,7 +28,7 @@
|
||||||
*
|
*
|
||||||
* Project homepage:
|
* Project homepage:
|
||||||
* https://amath.innolan.net
|
* https://amath.innolan.net
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -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.
|
||||||
*
|
*
|
||||||
|
@ -28,7 +28,7 @@
|
||||||
*
|
*
|
||||||
* Project homepage:
|
* Project homepage:
|
||||||
* https://amath.innolan.net
|
* https://amath.innolan.net
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -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
|
||||||
|
@ -24,7 +24,7 @@
|
||||||
*
|
*
|
||||||
* Project homepage:
|
* Project homepage:
|
||||||
* https://amath.innolan.net
|
* https://amath.innolan.net
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -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
|
||||||
|
@ -24,7 +24,7 @@
|
||||||
*
|
*
|
||||||
* Project homepage:
|
* Project homepage:
|
||||||
* https://amath.innolan.net
|
* https://amath.innolan.net
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "amathc.h"
|
#include "amathc.h"
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1,10 +1,10 @@
|
||||||
|
|
||||||
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 =
|
||||||
CREATE_SUBDIRS = NO
|
CREATE_SUBDIRS = NO
|
||||||
ALLOW_UNICODE_NAMES = NO
|
ALLOW_UNICODE_NAMES = NO
|
||||||
OUTPUT_LANGUAGE = English
|
OUTPUT_LANGUAGE = English
|
||||||
|
|
|
@ -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
|
||||||
|
@ -24,7 +24,7 @@
|
||||||
*
|
*
|
||||||
* Project homepage:
|
* Project homepage:
|
||||||
* https://amath.innolan.net
|
* https://amath.innolan.net
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "prim.h"
|
#include "prim.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
|
||||||
|
@ -24,7 +24,7 @@
|
||||||
*
|
*
|
||||||
* Project homepage:
|
* Project homepage:
|
||||||
* https://amath.innolan.net
|
* https://amath.innolan.net
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "prim.h"
|
#include "prim.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
|
||||||
|
@ -24,7 +24,7 @@
|
||||||
*
|
*
|
||||||
* Project homepage:
|
* Project homepage:
|
||||||
* https://amath.innolan.net
|
* https://amath.innolan.net
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "prim.h"
|
#include "prim.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
|
||||||
|
@ -24,7 +24,7 @@
|
||||||
*
|
*
|
||||||
* Project homepage:
|
* Project homepage:
|
||||||
* https://amath.innolan.net
|
* https://amath.innolan.net
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "prim.h"
|
#include "prim.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
|
||||||
|
@ -24,7 +24,7 @@
|
||||||
*
|
*
|
||||||
* Project homepage:
|
* Project homepage:
|
||||||
* https://amath.innolan.net
|
* https://amath.innolan.net
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "prim.h"
|
#include "prim.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
|
||||||
|
@ -24,7 +24,7 @@
|
||||||
*
|
*
|
||||||
* Project homepage:
|
* Project homepage:
|
||||||
* https://amath.innolan.net
|
* https://amath.innolan.net
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "prim.h"
|
#include "prim.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
|
||||||
|
@ -24,7 +24,7 @@
|
||||||
*
|
*
|
||||||
* Project homepage:
|
* Project homepage:
|
||||||
* https://amath.innolan.net
|
* https://amath.innolan.net
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "prim.h"
|
#include "prim.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
|
||||||
|
@ -24,7 +24,7 @@
|
||||||
*
|
*
|
||||||
* Project homepage:
|
* Project homepage:
|
||||||
* https://amath.innolan.net
|
* https://amath.innolan.net
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "prim.h"
|
#include "prim.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
|
||||||
|
@ -24,7 +24,7 @@
|
||||||
*
|
*
|
||||||
* Project homepage:
|
* Project homepage:
|
||||||
* https://amath.innolan.net
|
* https://amath.innolan.net
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "prim.h"
|
#include "prim.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
|
||||||
|
@ -24,7 +24,7 @@
|
||||||
*
|
*
|
||||||
* Project homepage:
|
* Project homepage:
|
||||||
* https://amath.innolan.net
|
* https://amath.innolan.net
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "prim.h"
|
#include "prim.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
|
||||||
|
@ -24,7 +24,7 @@
|
||||||
*
|
*
|
||||||
* Project homepage:
|
* Project homepage:
|
||||||
* https://amath.innolan.net
|
* https://amath.innolan.net
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "prim.h"
|
#include "prim.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
|
||||||
|
@ -24,7 +24,7 @@
|
||||||
*
|
*
|
||||||
* Project homepage:
|
* Project homepage:
|
||||||
* https://amath.innolan.net
|
* https://amath.innolan.net
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "prim.h"
|
#include "prim.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
|
||||||
|
@ -24,7 +24,7 @@
|
||||||
*
|
*
|
||||||
* Project homepage:
|
* Project homepage:
|
||||||
* https://amath.innolan.net
|
* https://amath.innolan.net
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "prim.h"
|
#include "prim.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>
|
||||||
* Copyright (c) 2007 The NetBSD Foundation, Inc.
|
* Copyright (c) 2007 The NetBSD Foundation, Inc.
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
|
@ -28,7 +28,7 @@
|
||||||
*
|
*
|
||||||
* Project homepage:
|
* Project homepage:
|
||||||
* https://amath.innolan.net
|
* https://amath.innolan.net
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "prim.h"
|
#include "prim.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>
|
||||||
* Copyright (c) 2007 The NetBSD Foundation, Inc.
|
* Copyright (c) 2007 The NetBSD Foundation, Inc.
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
|
@ -31,7 +31,7 @@
|
||||||
*
|
*
|
||||||
* Project homepage:
|
* Project homepage:
|
||||||
* https://amath.innolan.net
|
* https://amath.innolan.net
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "prim.h"
|
#include "prim.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
|
||||||
|
@ -24,7 +24,7 @@
|
||||||
*
|
*
|
||||||
* Project homepage:
|
* Project homepage:
|
||||||
* https://amath.innolan.net
|
* https://amath.innolan.net
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "prim.h"
|
#include "prim.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
|
||||||
|
@ -24,7 +24,7 @@
|
||||||
*
|
*
|
||||||
* Project homepage:
|
* Project homepage:
|
||||||
* https://amath.innolan.net
|
* https://amath.innolan.net
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "prim.h"
|
#include "prim.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
|
||||||
|
@ -24,7 +24,7 @@
|
||||||
*
|
*
|
||||||
* Project homepage:
|
* Project homepage:
|
||||||
* https://amath.innolan.net
|
* https://amath.innolan.net
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "prim.h"
|
#include "prim.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
|
||||||
|
@ -24,7 +24,7 @@
|
||||||
*
|
*
|
||||||
* Project homepage:
|
* Project homepage:
|
||||||
* https://amath.innolan.net
|
* https://amath.innolan.net
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "prim.h"
|
#include "prim.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>
|
||||||
* Copyright (c) 2007 The NetBSD Foundation, Inc.
|
* Copyright (c) 2007 The NetBSD Foundation, Inc.
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
|
@ -31,7 +31,7 @@
|
||||||
*
|
*
|
||||||
* Project homepage:
|
* Project homepage:
|
||||||
* https://amath.innolan.net
|
* https://amath.innolan.net
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "prim.h"
|
#include "prim.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>
|
||||||
* Copyright (c) 2007 The NetBSD Foundation, Inc.
|
* Copyright (c) 2007 The NetBSD Foundation, Inc.
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
|
@ -31,7 +31,7 @@
|
||||||
*
|
*
|
||||||
* Project homepage:
|
* Project homepage:
|
||||||
* https://amath.innolan.net
|
* https://amath.innolan.net
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "prim.h"
|
#include "prim.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
|
||||||
|
@ -24,7 +24,7 @@
|
||||||
*
|
*
|
||||||
* Project homepage:
|
* Project homepage:
|
||||||
* https://amath.innolan.net
|
* https://amath.innolan.net
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "prim.h"
|
#include "prim.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
|
||||||
|
@ -24,7 +24,7 @@
|
||||||
*
|
*
|
||||||
* Project homepage:
|
* Project homepage:
|
||||||
* https://amath.innolan.net
|
* https://amath.innolan.net
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "prim.h"
|
#include "prim.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>
|
||||||
* Copyright (c) 2007 The NetBSD Foundation, Inc.
|
* Copyright (c) 2007 The NetBSD Foundation, Inc.
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
|
@ -31,7 +31,7 @@
|
||||||
*
|
*
|
||||||
* Project homepage:
|
* Project homepage:
|
||||||
* https://amath.innolan.net
|
* https://amath.innolan.net
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "prim.h"
|
#include "prim.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
|
||||||
|
@ -24,7 +24,7 @@
|
||||||
*
|
*
|
||||||
* Project homepage:
|
* Project homepage:
|
||||||
* https://amath.innolan.net
|
* https://amath.innolan.net
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "prim.h"
|
#include "prim.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
|
||||||
|
@ -24,7 +24,7 @@
|
||||||
*
|
*
|
||||||
* Project homepage:
|
* Project homepage:
|
||||||
* https://amath.innolan.net
|
* https://amath.innolan.net
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "prim.h"
|
#include "prim.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
|
||||||
|
@ -24,7 +24,7 @@
|
||||||
*
|
*
|
||||||
* Project homepage:
|
* Project homepage:
|
||||||
* https://amath.innolan.net
|
* https://amath.innolan.net
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "prim.h"
|
#include "prim.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>
|
||||||
* Copyright (c) 2007 The NetBSD Foundation, Inc.
|
* Copyright (c) 2007 The NetBSD Foundation, Inc.
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
|
@ -31,7 +31,7 @@
|
||||||
*
|
*
|
||||||
* Project homepage:
|
* Project homepage:
|
||||||
* https://amath.innolan.net
|
* https://amath.innolan.net
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "prim.h"
|
#include "prim.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>
|
||||||
* Copyright (c) 2007 The NetBSD Foundation, Inc.
|
* Copyright (c) 2007 The NetBSD Foundation, Inc.
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
|
@ -31,7 +31,7 @@
|
||||||
*
|
*
|
||||||
* Project homepage:
|
* Project homepage:
|
||||||
* https://amath.innolan.net
|
* https://amath.innolan.net
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "prim.h"
|
#include "prim.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>
|
||||||
* Copyright (c) 2007 The NetBSD Foundation, Inc.
|
* Copyright (c) 2007 The NetBSD Foundation, Inc.
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
|
@ -31,7 +31,7 @@
|
||||||
*
|
*
|
||||||
* Project homepage:
|
* Project homepage:
|
||||||
* https://amath.innolan.net
|
* https://amath.innolan.net
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "prim.h"
|
#include "prim.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>
|
||||||
* Copyright (c) 2007 The NetBSD Foundation, Inc.
|
* Copyright (c) 2007 The NetBSD Foundation, Inc.
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
|
@ -31,7 +31,7 @@
|
||||||
*
|
*
|
||||||
* Project homepage:
|
* Project homepage:
|
||||||
* https://amath.innolan.net
|
* https://amath.innolan.net
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "prim.h"
|
#include "prim.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>
|
||||||
* Copyright (c) 2007 The NetBSD Foundation, Inc.
|
* Copyright (c) 2007 The NetBSD Foundation, Inc.
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
|
@ -31,7 +31,7 @@
|
||||||
*
|
*
|
||||||
* Project homepage:
|
* Project homepage:
|
||||||
* https://amath.innolan.net
|
* https://amath.innolan.net
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "prim.h"
|
#include "prim.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
|
||||||
|
@ -24,7 +24,7 @@
|
||||||
*
|
*
|
||||||
* Project homepage:
|
* Project homepage:
|
||||||
* https://amath.innolan.net
|
* https://amath.innolan.net
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "prim.h"
|
#include "prim.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
|
||||||
|
@ -24,7 +24,7 @@
|
||||||
*
|
*
|
||||||
* Project homepage:
|
* Project homepage:
|
||||||
* https://amath.innolan.net
|
* https://amath.innolan.net
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef AMATH_LIB_COMPLEX_PRIM_H
|
#ifndef AMATH_LIB_COMPLEX_PRIM_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
|
||||||
|
@ -24,7 +24,7 @@
|
||||||
*
|
*
|
||||||
* Project homepage:
|
* Project homepage:
|
||||||
* https://amath.innolan.net
|
* https://amath.innolan.net
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "amath.h"
|
#include "amath.h"
|
||||||
|
@ -190,7 +190,7 @@ const char* AnsiConoleEngine::ProcessChar(const unsigned char character)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
out->Append(DELETE1CHARASC);
|
out->Append(DELETE1CHARASC);
|
||||||
}
|
}
|
||||||
endpos--;
|
endpos--;
|
||||||
linebuf->ptr = endpos;
|
linebuf->ptr = endpos;
|
||||||
|
@ -234,7 +234,7 @@ const char* AnsiConoleEngine::ProcessChar(const unsigned char character)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
out->Append(DELETE1CHARASC);
|
out->Append(DELETE1CHARASC);
|
||||||
}
|
}
|
||||||
cursor--;
|
cursor--;
|
||||||
endpos--;
|
endpos--;
|
||||||
|
|
|
@ -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
|
||||||
|
@ -24,7 +24,7 @@
|
||||||
*
|
*
|
||||||
* Project homepage:
|
* Project homepage:
|
||||||
* https://amath.innolan.net
|
* https://amath.innolan.net
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef AMATH_ANSI_CONSOLE_ENGINE
|
#ifndef AMATH_ANSI_CONSOLE_ENGINE
|
||||||
|
|
|
@ -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
|
||||||
|
@ -24,7 +24,7 @@
|
||||||
*
|
*
|
||||||
* Project homepage:
|
* Project homepage:
|
||||||
* https://amath.innolan.net
|
* https://amath.innolan.net
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -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
|
||||||
|
@ -24,7 +24,7 @@
|
||||||
*
|
*
|
||||||
* Project homepage:
|
* Project homepage:
|
||||||
* https://amath.innolan.net
|
* https://amath.innolan.net
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -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
|
||||||
|
@ -24,7 +24,7 @@
|
||||||
*
|
*
|
||||||
* Project homepage:
|
* Project homepage:
|
||||||
* https://amath.innolan.net
|
* https://amath.innolan.net
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "amath.h"
|
#include "amath.h"
|
||||||
|
@ -66,7 +66,7 @@ void CharBuffer::ClearBuffer()
|
||||||
{
|
{
|
||||||
if (buf != nullptr)
|
if (buf != nullptr)
|
||||||
{
|
{
|
||||||
delete [] buf;
|
delete[] buf;
|
||||||
}
|
}
|
||||||
|
|
||||||
buf = nullptr;
|
buf = nullptr;
|
||||||
|
@ -78,7 +78,7 @@ void CharBuffer::ClearBuffer()
|
||||||
* @brief Release memory, allocate and copy source.
|
* @brief Release memory, allocate and copy source.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
void CharBuffer::ClearAndCopy(const char* source)
|
void CharBuffer::ClearAndCopy(const char *source)
|
||||||
{
|
{
|
||||||
ClearBuffer();
|
ClearBuffer();
|
||||||
cursize = AllocAndCopy(&buf, source);
|
cursize = AllocAndCopy(&buf, source);
|
||||||
|
@ -125,7 +125,7 @@ void CharBuffer::EnsureSize(unsigned int size)
|
||||||
}
|
}
|
||||||
else if (buf == ptr)
|
else if (buf == ptr)
|
||||||
{ // Already allocated but buffer is empty.
|
{ // Already allocated but buffer is empty.
|
||||||
delete [] buf;
|
delete[] buf;
|
||||||
buf = new char[cursize];
|
buf = new char[cursize];
|
||||||
ptr = buf;
|
ptr = buf;
|
||||||
}
|
}
|
||||||
|
@ -134,9 +134,9 @@ void CharBuffer::EnsureSize(unsigned int size)
|
||||||
// Make at least double size
|
// Make at least double size
|
||||||
cursize = cursize < tempsize * 2 ? tempsize * 2 : cursize;
|
cursize = cursize < tempsize * 2 ? tempsize * 2 : cursize;
|
||||||
unsigned int offset = (unsigned int)(ptr - buf);
|
unsigned int offset = (unsigned int)(ptr - buf);
|
||||||
char* temp = new char[cursize];
|
char *temp = new char[cursize];
|
||||||
MemCopy(temp, buf, tempsize);
|
MemCopy(temp, buf, tempsize);
|
||||||
delete [] buf;
|
delete[] buf;
|
||||||
buf = temp;
|
buf = temp;
|
||||||
ptr = buf + offset;
|
ptr = buf + offset;
|
||||||
}
|
}
|
||||||
|
@ -156,9 +156,9 @@ void CharBuffer::EnsureSize(unsigned int blocksize, unsigned int blocks)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
unsigned int tptr = (unsigned int)(ptr - buf);
|
unsigned int tptr = (unsigned int)(ptr - buf);
|
||||||
char* temp = new char[blocksize * blocks];
|
char *temp = new char[blocksize * blocks];
|
||||||
MemCopy(temp, buf, cursize);
|
MemCopy(temp, buf, cursize);
|
||||||
delete [] buf;
|
delete[] buf;
|
||||||
cursize = blocksize * blocks;
|
cursize = blocksize * blocks;
|
||||||
buf = temp;
|
buf = temp;
|
||||||
ptr = buf + tptr;
|
ptr = buf + tptr;
|
||||||
|
@ -173,7 +173,7 @@ void CharBuffer::EnsureGrowth(unsigned int size)
|
||||||
|
|
||||||
bool CharBuffer::IsEmpty() const
|
bool CharBuffer::IsEmpty() const
|
||||||
{
|
{
|
||||||
char* i = buf;
|
char *i = buf;
|
||||||
|
|
||||||
if (i == nullptr || buf == ptr)
|
if (i == nullptr || buf == ptr)
|
||||||
return true;
|
return true;
|
||||||
|
@ -185,20 +185,19 @@ bool CharBuffer::IsEmpty() const
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
i++;
|
i++;
|
||||||
}
|
} while (i != ptr);
|
||||||
while (i != ptr);
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CharBuffer::Is(const char* string) const
|
bool CharBuffer::Is(const char *string) const
|
||||||
{
|
{
|
||||||
return StrIsEqual(GetString(), string);
|
return StrIsEqual(GetString(), string);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CharBuffer::Contains(const char c) const
|
bool CharBuffer::Contains(const char c) const
|
||||||
{
|
{
|
||||||
char* i = buf;
|
char *i = buf;
|
||||||
|
|
||||||
if (i == nullptr || buf == ptr)
|
if (i == nullptr || buf == ptr)
|
||||||
return false;
|
return false;
|
||||||
|
@ -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;
|
||||||
}
|
}
|
||||||
|
@ -230,14 +228,15 @@ void CharBuffer::DeleteLastChar()
|
||||||
ptr--;
|
ptr--;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CharBuffer::Copy(CharBuffer* source)
|
void CharBuffer::Copy(CharBuffer *source)
|
||||||
{
|
{
|
||||||
EnsureSize(source->cursize);
|
EnsureSize(source->cursize);
|
||||||
const char* s = source->GetString();
|
const char *s = source->GetString();
|
||||||
|
|
||||||
ptr = buf;
|
ptr = buf;
|
||||||
// ReSharper disable once CppPossiblyErroneousEmptyStatements
|
// ReSharper disable once CppPossiblyErroneousEmptyStatements
|
||||||
while ((*ptr++ = *s++));
|
while ((*ptr++ = *s++))
|
||||||
|
;
|
||||||
|
|
||||||
ptr--;
|
ptr--;
|
||||||
}
|
}
|
||||||
|
@ -259,14 +258,49 @@ void CharBuffer::Append(const char c, unsigned int count)
|
||||||
*ptr++ = c;
|
*ptr++ = c;
|
||||||
}
|
}
|
||||||
|
|
||||||
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)
|
||||||
|
@ -283,10 +317,10 @@ bool CharBuffer::RemoveTrailing(const char c)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CharBuffer::RemoveTrailing(const char* string)
|
bool CharBuffer::RemoveTrailing(const char *string)
|
||||||
{
|
{
|
||||||
int len = StrLen(string) * sizeof(char);
|
int len = StrLen(string) * sizeof(char);
|
||||||
char* s = ptr - len;
|
char *s = ptr - len;
|
||||||
if (s < buf)
|
if (s < buf)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
|
@ -303,8 +337,21 @@ bool CharBuffer::RemoveTrailing(const char* string)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
char* CharBuffer::GetString() const
|
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
|
||||||
|
@ -24,7 +24,7 @@
|
||||||
*
|
*
|
||||||
* Project homepage:
|
* Project homepage:
|
||||||
* https://amath.innolan.net
|
* https://amath.innolan.net
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef AMATH_CHAR_BUFFER_H
|
#ifndef AMATH_CHAR_BUFFER_H
|
||||||
|
@ -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
|
||||||
|
@ -24,7 +24,7 @@
|
||||||
*
|
*
|
||||||
* Project homepage:
|
* Project homepage:
|
||||||
* https://amath.innolan.net
|
* https://amath.innolan.net
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef AMATH_CHAR_VALIDATOR_H
|
#ifndef AMATH_CHAR_VALIDATOR_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
|
||||||
|
@ -24,7 +24,7 @@
|
||||||
*
|
*
|
||||||
* Project homepage:
|
* Project homepage:
|
||||||
* https://amath.innolan.net
|
* https://amath.innolan.net
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "mathr.h"
|
#include "mathr.h"
|
||||||
|
@ -139,7 +139,7 @@ bool ComplexNumber::IsInfinite()
|
||||||
double b = cimag(z);
|
double b = cimag(z);
|
||||||
|
|
||||||
// Handle subnormal values
|
// Handle subnormal values
|
||||||
bool subInf =
|
bool subInf =
|
||||||
(a > 0 && a <= 1e-308) || (a < 0 && a >= -1e-308) ||
|
(a > 0 && a <= 1e-308) || (a < 0 && a >= -1e-308) ||
|
||||||
(b > 0 && b <= 1e-308) || (b < 0 && b >= -1e-308);
|
(b > 0 && b <= 1e-308) || (b < 0 && b >= -1e-308);
|
||||||
|
|
||||||
|
|
|
@ -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
|
||||||
|
@ -24,7 +24,7 @@
|
||||||
*
|
*
|
||||||
* Project homepage:
|
* Project homepage:
|
||||||
* https://amath.innolan.net
|
* https://amath.innolan.net
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef AMATH_COMPLEX_NUMBER_H
|
#ifndef AMATH_COMPLEX_NUMBER_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
|
||||||
|
@ -24,7 +24,7 @@
|
||||||
*
|
*
|
||||||
* Project homepage:
|
* Project homepage:
|
||||||
* https://amath.innolan.net
|
* https://amath.innolan.net
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "numb.h"
|
#include "numb.h"
|
||||||
|
@ -202,12 +202,12 @@ Number* NonNumber::Secant()
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Trigonometric tangent function
|
* @brief Trigonometric tangent function
|
||||||
*
|
*
|
||||||
* Tangent of +INF and -INF is NaN (with signals).
|
* Tangent of +INF and -INF is NaN (with signals).
|
||||||
* Tangent of NaN is NaN.
|
* Tangent of NaN is NaN.
|
||||||
*
|
*
|
||||||
* Signals are not implemented.
|
* Signals are not implemented.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
Number* NonNumber::Tangent()
|
Number* NonNumber::Tangent()
|
||||||
{
|
{
|
||||||
|
|
|
@ -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
|
||||||
|
@ -24,7 +24,7 @@
|
||||||
*
|
*
|
||||||
* Project homepage:
|
* Project homepage:
|
||||||
* https://amath.innolan.net
|
* https://amath.innolan.net
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef AMATH_NON_NUMBER_H
|
#ifndef AMATH_NON_NUMBER_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
|
||||||
|
@ -24,7 +24,7 @@
|
||||||
*
|
*
|
||||||
* Project homepage:
|
* Project homepage:
|
||||||
* https://amath.innolan.net
|
* https://amath.innolan.net
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "ntext.h"
|
#include "ntext.h"
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue