Compare commits

...

239 Commits

Author SHA1 Message Date
Carsten Sonne Larsen 811644f4c7 Zero out allocated memory 2021-01-30 17:42:13 +01:00
Carsten Sonne Larsen d7fe11d56a Take advantage of memory pools 2021-01-30 17:00:55 +01:00
Carsten Sonne Larsen d7add409cd Identify systems more uniquely 2021-01-17 11:13:42 +01:00
Carsten Sonne Larsen d910b98571 Cleanup and avoid OS conflicts (REQ #3) 2021-01-15 15:56:07 +01:00
Carsten Sonne Larsen ea2bf72d7b MorphOS compatibility (REQ #4) 2021-01-15 15:49:26 +01:00
Carsten Sonne Larsen e788fec496 ARexx only instance 2021-01-15 00:21:28 +01:00
Carsten Sonne Larsen ffa586c694 Allow to quit console with CTRL + C 2021-01-15 00:20:47 +01:00
Carsten Sonne Larsen 0240d3a439 Only show result when using ARexx 2021-01-15 00:01:10 +01:00
Carsten Sonne Larsen 93c8fdbef4 To ensure compatibility, set fraction point to full stop / period 2021-01-14 23:51:15 +01:00
Carsten Sonne Larsen dd7884bc22 Cleanup after building catalogs 2021-01-12 15:03:13 +01:00
Carsten Sonne Larsen 65fafb750f Improved install script 2021-01-12 14:31:35 +01:00
Carsten Sonne Larsen 2164e79aef Distribution files 2021-01-12 14:30:49 +01:00
Carsten Sonne Larsen 87c65aa678 Include Debian build in source 2021-01-11 22:30:56 +01:00
Carsten Sonne Larsen 2c9e8bece3 Update copyright text 2021-01-11 22:30:27 +01:00
Carsten Sonne Larsen ee26a57960 Release 1.9.0 2021-01-11 21:10:34 +01:00
Carsten Sonne Larsen 538ad4ac23 ARexx test script 2021-01-11 21:01:49 +01:00
Carsten Sonne Larsen 524f83f22f Cleanup Amiga specific code 2021-01-11 20:59:15 +01:00
Carsten Sonne Larsen 9e712377a4 Update copyright 2021-01-11 20:37:42 +01:00
Carsten Sonne Larsen 6eb56b056e ARexx support 2021-01-11 20:33:26 +01:00
Carsten Sonne Larsen 3a52c27a9c new AppendNumber method 2021-01-11 20:32:07 +01:00
Carsten Larsen f8cf191a46 Fix PowerPC build 2018-10-31 20:40:07 +01:00
Carsten Sonne Larsen aeb7f2e92c Detect system name 2018-08-12 23:22:44 +02:00
Carsten Sonne Larsen 49b36ce2a3 Remove search option 2018-08-12 23:22:14 +02:00
Carsten Sonne Larsen f7de7b1447 Update links 2018-08-12 23:21:37 +02:00
Carsten Sonne Larsen d4ad72d17f Fix wrong year 2018-08-07 20:32:26 +02:00
Carsten Sonne Larsen 8632644b9d Update to version 1.8.5 2018-08-07 19:54:19 +02:00
Carsten Sonne Larsen 9c70be649b Fix build on compilers with broken endian detection 2018-08-07 19:51:28 +02:00
Carsten Sonne Larsen fb19bb560d Fix GCC 7 warnings 2018-08-07 19:46:15 +02:00
Carsten Sonne Larsen 527376a92a Merge branch 'master' of https://gitlab.com/rnger/amath 2018-08-05 22:42:43 +02:00
Carsten Sonne Larsen 970ae6456f Merge branch 'master' of https://gitlab.com/rnger/amath 2017-10-14 09:24:55 +02:00
Carsten Sonne Larsen 56d9566000 rebase and change commit email to cs@innolan.net 2017-10-14 09:21:56 +02:00
Carsten Sonne Larsen 16530a94d1 Merge branch 'master' of https://gitlab.com/rnger/amath 2017-10-14 08:56:34 +02:00
Carsten Sonne Larsen 882eb43a4f Update headers 2017-08-03 22:03:35 +02:00
Carsten Sonne Larsen 7114efc1cc Update script 2017-08-03 22:03:20 +02:00
Carsten Sonne Larsen e64c56123d Add debian build script 2017-08-03 21:25:17 +02:00
Carsten Sonne Larsen 2cdc5b8aae Release 1.8.3 2017-07-21 22:41:58 +02:00
Carsten Sonne Larsen b76a2dccc5 Add more CC BY-SA texts 2017-07-21 22:38:58 +02:00
Carsten Sonne Larsen 656038d482 Cleanup man page 2017-07-21 22:36:04 +02:00
Carsten Larsen c625ec29f7 Cleanup help texts 2017-07-21 01:25:08 +02:00
Carsten Larsen 4aae661801 Include less common abbreviations 2017-07-17 00:29:31 +02:00
Carsten Larsen 3f75c41166 Add known bugs 2017-07-16 23:07:14 +02:00
Carsten Larsen 51e6ece52d ANSI mode is alway changeable as default 2017-07-16 22:52:52 +02:00
Carsten Larsen 1a2ef9b018 Stress with explicit in clang option 2017-07-16 22:49:27 +02:00
Carsten Larsen 012c0ee1a6 Cleanup history 2017-07-14 13:57:32 +02:00
Carsten Larsen f78304c8e1 Fix build error in shared clib 2017-07-14 13:54:39 +02:00
Carsten Larsen 9e2d708eb7 Allow man-dir and doc-dir while configuring 2017-07-14 13:54:07 +02:00
Carsten Larsen 36fd6e090d Release 1.8.2 2017-07-14 12:10:13 +02:00
Carsten Larsen 49b6ecd09d Update project homepage 2017-07-14 11:30:24 +02:00
Carsten Larsen 4b44d05953 Improve endianness detection 2017-07-14 10:53:37 +02:00
Carsten Larsen 263636bb04 Update release date 2017-04-22 00:56:52 +02:00
Carsten Larsen 70c6ae9579 Hint GCC6 2017-04-22 00:55:06 +02:00
Carsten Larsen 4085981ca7 Update changelog 2017-04-22 00:54:47 +02:00
Carsten Larsen 69377b26ed Update release date 2017-04-22 00:54:26 +02:00
Carsten Larsen 7431e61c3c Improved configuration 2017-04-22 00:53:41 +02:00
Carsten Larsen e73cce1894 Fix haiku bug 2017-04-22 00:52:57 +02:00
Carsten Larsen 2a00f9556d Fix clear statement 2017-04-15 22:33:46 +02:00
Carsten Larsen a1b521840a Option for Position Independent Code 2017-04-15 22:32:42 +02:00
Carsten Larsen 30a23a4e0f Bumped version 2017-04-15 20:43:33 +02:00
Carsten Larsen 258188d994 Cleanup defines 2017-04-15 20:36:40 +02:00
Carsten Larsen bf39a0c868 Release 1.8.0 2017-04-13 00:50:51 +02:00
Carsten Larsen 0118d94326 Fix wrong version number 2017-03-24 20:23:58 +01:00
Carsten Larsen f3dd6d8baa Release 1.7.1 2017-03-24 20:09:05 +01:00
Carsten Larsen a301c85e15 Release 1.7.0 2017-03-11 23:37:45 +01:00
Carsten Larsen 87f0d88b26 Fix Makefiles 2017-02-27 23:33:54 +01:00
Carsten Larsen dd6e11cdb4 Prerelease 1.7.0 2017-02-27 23:31:21 +01:00
Carsten Larsen 9144b77c70 Prerelease 1.7.0 2017-02-27 23:23:06 +01:00
Carsten Larsen e7b46a06be Improved tests 2017-02-13 21:07:06 +01:00
Carsten Larsen 8c1a88ebe7 Cleanup debug code 2017-02-13 21:02:55 +01:00
Carsten Larsen 217d70e23a Fix file permissions 2017-02-11 12:00:51 +01:00
Carsten Larsen 28c1559ed0 Fix typo 2017-02-10 23:09:43 +01:00
Carsten Larsen dc26550dd5 Remove old build defs 2017-02-10 23:00:01 +01:00
Carsten Larsen 397c6c37c9 Include test and install target 2017-02-10 22:49:49 +01:00
Carsten Larsen dadd23aea8 Take advantage of exec 2017-02-10 22:29:49 +01:00
Carsten Larsen 34c843f2b5 Fix build definitions 2017-02-10 22:29:19 +01:00
Carsten Larsen 3483dd5283 Correct Debian version 2017-02-04 19:39:00 +01:00
Carsten Larsen 667fe2baeb Release 1.6.4 2017-02-04 15:58:49 +01:00
Carsten Larsen 88301bafc5 Fix MSVC++ memory allocation 2017-02-04 15:35:32 +01:00
Carsten Larsen b896dab8a8 Update Makefile 2017-02-04 14:41:54 +01:00
Carsten Larsen 818df0fc87 Fix 64 bit warnings 2017-02-04 14:41:34 +01:00
Carsten Larsen d148be57b3 Remove old binaries 2017-02-04 14:40:54 +01:00
Carsten Larsen e988bbbd9f Fix 64 bit alignment errors 2017-02-04 12:55:27 +01:00
Carsten Larsen af7bf8a97a Fixed truncation bug 2017-02-04 12:52:26 +01:00
Carsten Larsen a56173487f Release 1.6.3 2017-02-03 19:31:26 +01:00
Carsten Larsen 62f29f1e0e Update change list 2017-02-02 23:04:18 +01:00
Carsten Larsen aec499543d Fix Debian version number 2017-02-02 22:59:35 +01:00
Carsten Larsen e10734c005 Haiku support 2017-02-02 22:58:07 +01:00
Carsten Larsen abd4bb8929 Cleanup tests 2017-02-02 22:57:26 +01:00
Carsten Larsen eb1d7f74e4 Add NetBSD link 2017-02-02 22:56:51 +01:00
Carsten Larsen bd4baa277f Cleanup headers 2017-02-02 22:56:33 +01:00
Carsten Larsen 3f94ebc6b0 Fix Debian build 2017-02-02 22:53:00 +01:00
Carsten Larsen 11b4bdc70d Detect endianness for more CPUs 2017-02-02 22:52:10 +01:00
Carsten Larsen 83760eb15a Test fraction point character 2017-01-29 14:53:14 +01:00
Carsten Larsen 57e74e12b0 Debian multiarch support 2017-01-29 14:09:58 +01:00
Carsten Larsen 1551700ec1 Debian build script 2017-01-29 13:42:31 +01:00
Carsten Larsen 81ba8a83e2 Extend tests 2017-01-29 01:00:29 +01:00
Carsten Larsen 5c041e7762 Update documentation 2017-01-29 00:59:55 +01:00
Carsten Larsen dc5d092c4e Move documentation to own repository 2017-01-28 22:36:21 +01:00
Carsten Larsen 7a63687d4b Prepare release 1.6.3 2017-01-28 22:30:57 +01:00
Carsten Larsen 86d5a56fa7 Update scan-build report 2017-01-28 22:14:35 +01:00
Carsten Larsen 848b9f1987 Improve error handling 2017-01-28 22:04:35 +01:00
Carsten Larsen 8b81543eed Optimize for 64 bit PowerPC 2017-01-28 22:03:36 +01:00
Carsten Larsen 2bbebe575f Fix typo 2017-01-28 22:02:52 +01:00
Carsten Larsen 7d48450bbf Fix error in fraction point parsing 2017-01-28 22:02:01 +01:00
Carsten Larsen b173f42b65 64 bit PowerPC detection 2017-01-28 19:08:44 +01:00
Carsten Larsen 637b9396d9 Fix AROS build errors 2017-01-28 19:06:45 +01:00
Carsten Larsen 3776c6e02e Update documentation 2017-01-25 21:01:17 +01:00
Carsten Larsen c53ef12905 Add Icaros Desktop top distributions 2017-01-25 20:36:34 +01:00
Carsten Larsen b3ac61bae3 Documentation cleanup 2017-01-25 20:35:25 +01:00
Carsten Larsen d134ad9765 Documentation cleanup 2017-01-25 20:34:54 +01:00
Carsten Larsen 9e2c66af53 Update documentation 2017-01-24 22:03:15 +01:00
Carsten Larsen 1392de9ad7 Windows 1.6.2 binaries 2017-01-24 22:00:11 +01:00
Carsten Larsen 7e218a1b70 Update to version 1.6.2 2017-01-24 20:55:35 +01:00
Carsten Larsen 4c25f8d2fb Native character input 2017-01-24 20:48:02 +01:00
Carsten Larsen 543f813251 Update build definitions 2017-01-24 20:46:46 +01:00
Carsten Larsen bdae119905 Update version texts 2017-01-24 20:40:35 +01:00
Carsten Larsen a16a3b7419 Simplify memory allocation 2017-01-24 20:39:55 +01:00
Carsten Larsen 9ebb77637f Update documentation 2017-01-22 18:21:56 +01:00
Carsten Larsen 95057d82db Fix newline in Windows test 2017-01-22 01:18:14 +01:00
Carsten Larsen 75c588f51b 64 bit Windows support 2017-01-22 01:14:01 +01:00
Carsten Larsen 462ea4ceba 64 bit support on Windows 2017-01-22 00:51:35 +01:00
Carsten Larsen 672712ab49 Cleanup Visual Studio structure 2017-01-22 00:51:01 +01:00
Carsten Larsen ab0c5db51d Cleanup Visual Studio structure 2017-01-22 00:50:47 +01:00
Carsten Larsen b85a008fb2 Updated broken links 2017-01-21 21:21:00 +01:00
Carsten Larsen 40cc850093 64 bit optimizations 2017-01-21 20:51:25 +01:00
Carsten Larsen afbfd236a4 Clarify source origin 2017-01-21 20:50:01 +01:00
Carsten Larsen 25c618d57f arm 64 bit support 2017-01-21 20:26:14 +01:00
Carsten Larsen 4aefa785ad ARM support 2017-01-21 20:21:18 +01:00
Carsten Larsen 957355545e Fixed broken link 2017-01-21 14:06:41 +01:00
Carsten Larsen 927fc656dd Release 1.6.1 2017-01-21 13:53:51 +01:00
Carsten Larsen f1e2979d7a Update documentation 2017-01-21 13:51:39 +01:00
Carsten Larsen d7eca35395 Update documentation 2017-01-21 13:29:45 +01:00
Carsten Larsen 281317d503 Disable language on Windows 2017-01-21 13:29:11 +01:00
Carsten Larsen 3ae8e58f2b Prepare release 2017-01-21 13:28:39 +01:00
Carsten Larsen f4d99b69de Update documentation 2017-01-20 22:21:51 +01:00
Carsten Larsen bcb3611f14 Update documentation 2017-01-20 22:17:15 +01:00
Carsten Larsen ded1be8026 Documentation 2017-01-19 20:46:15 +01:00
Carsten Larsen b402fff504 Update makefile 2017-01-11 21:00:10 +01:00
Carsten Larsen a1a5aea15e Fix potential memory leak 2017-01-11 20:59:21 +01:00
Carsten Larsen aff002dbda scan-build results 2017-01-11 20:58:08 +01:00
Carsten Larsen 259f73d19e Fix Microsoft Visual C++ version string 2017-01-11 20:13:41 +01:00
Carsten Larsen 41ae34644d Simplify test 2017-01-11 19:35:58 +01:00
Carsten Larsen e83f879211 Updated toolset 2017-01-11 19:29:27 +01:00
Carsten Larsen 70fee59186 Updated Copyright text 2017-01-11 19:27:01 +01:00
Carsten Larsen 79c0de3575 Fix GCC compiler error 2017-01-10 23:52:26 +01:00
Carsten Larsen 441bed5c99 Fix GCC 2.x compiler error 2017-01-10 23:46:29 +01:00
Carsten Larsen 910b5a7cd9 Fix AmigaOS build 2017-01-10 23:45:46 +01:00
Carsten Larsen a08d724997 Include copyright text 2017-01-10 21:17:35 +01:00
Carsten Larsen bc94803f91 Compiler version string 2017-01-10 20:58:47 +01:00
Carsten Larsen 2b786bef20 clang support 2017-01-09 21:30:46 +01:00
Carsten Larsen cbb6c747f6 Fix method signature 2017-01-09 20:59:54 +01:00
Carsten Larsen 65f9d88562 Use correct deallocator 2017-01-08 13:13:39 +01:00
Carsten Larsen 4ea2b3af84 Code cleanup
modified:   app/lib/ntext.cpp
	modified:   app/main/lexer.cpp
	modified:   app/system/language.cpp
	modified:   app/system/language_posix.cpp
	modified:   app/system/preferences_stdc.cpp
	modified:   lib/real/pow.c
	modified:   lib/platform.h
2017-01-08 12:05:28 +01:00
Carsten Larsen 340a99d861 Updated readme 2016-08-19 18:15:29 +00:00
Carsten Sonne Larsen 3ea3222b91 Added build dependecy 2016-04-03 12:05:52 +02:00
Carsten Sonne Larsen 0651330e08 Cleanup 2016-04-03 11:56:10 +02:00
Carsten Sonne Larsen 3010a67d7f Fixed memory bug 2016-04-03 11:55:35 +02:00
Carsten 4228b95303 Fixed hardcoded local 2016-03-28 17:16:57 +02:00
llsth bf8cc0b222 Basic implementation of POSIX localization 2015-04-15 14:41:33 +02:00
llsth ffe9553471 Merge branch 'master' of https://github.com/llsth/amath 2015-04-14 19:22:06 +02:00
llsth b711e8aeab Added text author 2015-04-14 19:20:24 +02:00
Carsten Sonne Larsen 1752f2c546 Update README.md 2015-04-14 18:52:44 +02:00
llsth 2478847bd9 Clarified license details 2015-04-14 18:38:03 +02:00
llsth b26c5c81c9 Clarified license details 2015-04-14 18:32:44 +02:00
llsth e310c982d0 Clarified license details 2015-04-14 18:23:49 +02:00
llsth 9780e8b1c5 Clarified license details 2015-04-14 18:22:43 +02:00
llsth 617a418a91 Clarified license details 2015-04-14 18:21:58 +02:00
llsth 0760eaa798 Clarified license details 2015-04-14 18:14:57 +02:00
llsth 28b94bfaf4 Win32 texts 2015-04-14 14:19:38 +02:00
llsth e00ce964ae Win32 fixes 2015-04-14 14:00:01 +02:00
llsth 9d85d4c699 Updated Makefile 2015-04-14 00:05:11 +02:00
llsth cba2829664 Fixed AmigaOS build 2015-04-14 00:03:33 +02:00
llsth 7bb7b4e955 Localization on Standard C platforms 2015-04-13 23:48:08 +02:00
llsth f9a09c4bad Bugfixes 2015-04-13 23:44:17 +02:00
llsth 390ff27017 Updated catalog text 2015-04-12 00:17:20 +02:00
llsth b5ca35438d Fixed read of wrong address in empty strings 2015-04-12 00:00:43 +02:00
llsth 2adc0edd4c Fixed wrong memory management with new 2015-04-11 23:52:57 +02:00
llsth 37d2ba4794 Updated catalogs 2015-04-10 23:36:25 +02:00
llsth a633d5d06a Updated README.md 2015-04-10 15:42:17 +02:00
llsth be6681d3f0 Fixed memory bug 2015-04-10 15:41:52 +02:00
llsth b3753232f2 Implemented localized keywords 2015-04-10 15:41:29 +02:00
llsth fa1f153127 Updated project files 2015-04-10 00:04:58 +02:00
llsth 4c512addad Updated make logic 2015-04-10 00:02:57 +02:00
llsth 2f28be077b Moved catalog generation files 2015-04-10 00:00:56 +02:00
llsth af1681cc87 localized keywords 2015-04-09 23:59:17 +02:00
llsth 9121566b52 Included catalog and dist targets 2015-04-09 19:00:51 +02:00
llsth 26eb3d5cda Changed to buffered output 2015-04-09 18:59:44 +02:00
llsth 385073a256 Updated national letters 2015-04-09 18:59:22 +02:00
llsth 58121f8c01 Update catalog generation 2015-04-09 15:08:54 +02:00
llsth b35b9acde3 Updated language descriptions 2015-04-09 15:08:30 +02:00
llsth f30729980e Alias in function help 2015-04-09 14:42:16 +02:00
llsth 194830b64c Updated descriptions 2015-04-09 14:38:47 +02:00
llsth 12657aab90 Updated descriptions 2015-04-09 11:28:25 +02:00
llsth 6af581bbe4 Removed needless delimiters 2015-04-09 01:33:24 +02:00
Carsten Sonne Larsen c325bd29bc Fixes spelling mistakes 2015-04-09 01:22:02 +02:00
llsth 9cb7ef34a8 Initial commit 2015-04-09 01:19:27 +02:00
llsth 449e0c8473 Initial language support 2015-04-09 01:07:50 +02:00
llsth 4a0cba78cc Updated version info 2015-04-09 01:07:19 +02:00
llsth 048f20a717 Minor bugfixes 2015-04-08 23:03:42 +02:00
llsth 9a7af719d6 Minor bugfixes 2015-04-08 23:01:23 +02:00
llsth 76c315bfd0 Changed faulty language logic 2015-04-08 20:01:42 +02:00
llsth 6b4ae56c8a Updated with configure 2015-04-08 19:23:10 +02:00
llsth c647e003d2 Updated with configure 2015-04-08 19:20:51 +02:00
llsth c27ee67707 Updated with configure 2015-04-08 19:14:56 +02:00
llsth f1bcdda6dc Adjusted localization 2015-04-08 19:10:18 +02:00
llsth 5b851eee7c Fixed localization bug 2015-04-08 19:08:36 +02:00
llsth 8624d62494 Updated catalog keys 2015-04-08 19:08:07 +02:00
llsth 5886946f1d Basic multilingual support 2015-04-08 16:27:35 +02:00
llsth 9d2de4b700 Included flexcat in Makefile 2015-04-08 13:01:33 +02:00
llsth 4efc38b6b8 Accept newline as delimiter 2015-04-08 12:59:08 +02:00
llsth f29f311ff6 Cleaned up in platform defs 2015-04-08 11:13:17 +02:00
llsth 05efc36c6f Fixes in preferences 2015-04-08 11:05:41 +02:00
llsth d7f8c6cbd3 Cleaned up definitions 2015-04-08 01:15:36 +02:00
llsth c80e7c0101 Cleaned up definitions 2015-04-08 01:10:10 +02:00
llsth f445eef190 Fixed wrong debug comparison 2015-04-08 00:42:32 +02:00
llsth e45fae685c Fixed memory leak 2015-04-08 00:41:24 +02:00
llsth 2c2671df31 Clean up in cross compilation 2015-04-07 21:51:26 +02:00
llsth c918ff89e8 Fixed GCC define 2015-04-07 21:50:52 +02:00
llsth 00acfc11e7 clean up defines 2015-04-07 21:18:39 +02:00
llsth bcf936f4a8 License clean up 2015-04-07 20:36:00 +02:00
llsth 280e020a20 pragma clean up 2015-04-07 20:25:11 +02:00
llsth 5cc10f9e38 Removed GPL licensed file 2015-04-07 19:59:35 +02:00
llsth 10860fb996 Fixed AmigaOS 3 defines 2015-04-07 19:57:28 +02:00
llsth e73a42b69a Support for Visual Studio 2015-04-07 18:51:26 +02:00
llsth e8b7ad9720 Support for Visual Studio 2015-04-07 18:50:44 +02:00
llsth a99e32c5df Removed text under wrong license 2015-04-05 12:09:47 +02:00
llsth bc4d88d894 Updated license details 2015-04-05 12:04:55 +02:00
carsten da3ea85e80 Cross-compiler changes 2015-04-01 16:58:18 +02:00
llsth d7b73eb2d2 Fixed AROS typecasting 2015-04-01 15:29:25 +02:00
llsth 7b88f3119c Uncommented unfinished code 2015-04-01 15:23:37 +02:00
llsth c19d50f03e Removed deprecated files 2015-04-01 14:51:50 +02:00
llsth 89f78a5cdc amath-1.6.0 initial commit 2015-04-01 14:43:50 +02:00
llsth 3ab236f0b0 Included MorphOS patch 2015-03-26 13:00:37 +01:00
llsth 2ee6693905 Included MorphOS patch 2015-03-26 12:49:27 +01:00
Carsten Sonne Larsen cef3b88d61 Update README.md 2015-03-24 01:04:29 +01:00
Carsten Sonne Larsen 1ca6893513 Update README.md 2015-03-24 01:03:17 +01:00
Carsten Sonne Larsen 02deed1853 Update README.md 2015-03-24 00:25:29 +01:00
Carsten Sonne Larsen a60b55e01b Update README.md 2015-03-24 00:22:55 +01:00
Carsten Sonne Larsen 904620e599 Update HISTORY 2015-03-23 22:58:24 +01:00
Carsten Sonne Larsen b077d77668 Update README.md 2015-03-23 22:55:44 +01:00
441 changed files with 2372 additions and 1562 deletions

1
.gitignore vendored
View File

@ -17,3 +17,4 @@ doxygen.warn
*.deb *.deb
*.zip *.zip
Makefile Makefile
/dist

19
.vscode/c_cpp_properties.json vendored Normal file
View File

@ -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
View File

@ -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.

View File

@ -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.

View File

@ -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

View File

@ -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 =

4
arexx/test.rx Normal file
View File

@ -0,0 +1,4 @@
/* Test program */
Options RESULTS
Address AMATH.1 '1.1+1.8'
SAY (RESULT)

166
bin/amath.doc Normal file
View File

@ -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

41
bin/amath.readme Normal file
View File

@ -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

BIN
bin/catalog/english.info Normal file

Binary file not shown.

BIN
bin/prog/Catalog.info Normal file

Binary file not shown.

BIN
bin/prog/HISTORY.info Normal file

Binary file not shown.

BIN
bin/prog/LICENSE.info Normal file

Binary file not shown.

BIN
bin/prog/Script.info Normal file

Binary file not shown.

BIN
bin/prog/Test.info Normal file

Binary file not shown.

BIN
bin/prog/amath.020.info Normal file

Binary file not shown.

BIN
bin/prog/amath.030.info Normal file

Binary file not shown.

BIN
bin/prog/amath.doc.info Normal file

Binary file not shown.

BIN
bin/prog/amath.info Normal file

Binary file not shown.

BIN
bin/root/amath.info Normal file

Binary file not shown.

BIN
bin/script/complex1.info Normal file

Binary file not shown.

BIN
bin/script/complex2.info Normal file

Binary file not shown.

BIN
bin/script/complex3.info Normal file

Binary file not shown.

BIN
bin/script/function1.info Normal file

Binary file not shown.

BIN
bin/script/function2.info Normal file

Binary file not shown.

BIN
bin/script/function3.info Normal file

Binary file not shown.

BIN
bin/script/operators.info Normal file

Binary file not shown.

BIN
bin/script/userfuncs.info Normal file

Binary file not shown.

BIN
bin/script/variables.info Normal file

Binary file not shown.

32
build/doc Executable file
View File

@ -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;
}
'

View File

@ -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"

View File

@ -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
View File

@ -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}/

View File

@ -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}/

View File

@ -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 ..."

View File

@ -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

View File

@ -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

23
configure vendored
View File

@ -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"

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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"

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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);
} }

View File

@ -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
* *
*/ */
/** /**

View File

@ -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
* *
*/ */
/** /**

View File

@ -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
* *
*/ */
/** /**

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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

View File

@ -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--;

View File

@ -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

View File

@ -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

View File

@ -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
* *
*/ */
/* /*

View File

@ -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
* *
*/ */
/* /*

View File

@ -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';
}

View File

@ -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;

View File

@ -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

View File

@ -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);

View File

@ -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

View File

@ -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()
{ {

View File

@ -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

View File

@ -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