62 Commits

Author SHA1 Message Date
176079e7e9 Rename & reorder readed bytes arg in string funcs 2025-11-09 19:36:06 +03:00
aa402de368 Add string compare functions 2025-11-09 19:11:54 +03:00
6d02598e20 Add IO type checking functions, add ReadLine 2025-11-08 18:50:13 +03:00
44057e96f3 Add string duplication function (strdup) 2025-11-08 11:02:01 +03:00
d559d3f66b Small fixes in src/String 2025-10-13 14:34:39 +03:00
364d3a32ec Add benchmarks, change project structure 2025-10-12 10:20:09 +03:00
b1870bd709 Add timers for measuring elapsed time 2025-09-21 22:07:54 +03:00
9bd2007023 Add BH_ThreadSleep, fix Timespec.h 2025-09-21 21:20:31 +03:00
8064ec2aff Fix TSS code, fix CV for Win32 platform 2025-09-07 10:32:57 +03:00
ec83067184 Fix Win32 _beginthreadex call 2025-09-07 09:32:07 +03:00
8d18e8020c Convert static func naming to same style
Previously, some modules used BH_<Module> prefix in the names of static
functions (some used just <Module> prefix). Now every static function
should start from lowercase.
2025-09-06 23:40:32 +03:00
a4c5ce98ce Minor fixes and refactors 2025-08-28 22:01:36 +03:00
12a00c3515 Fix TestThread.c and POSIX semaphore 2025-08-28 17:28:07 +03:00
2843ecd3f7 Fix indentation in Args.c 2025-08-26 10:41:17 +03:00
3bba87d8dc Refactor bitmap, add RGBA5551 format 2025-08-26 10:40:43 +03:00
dd63b19f71 Remove extra whitespace, add size checks 2025-08-24 16:18:26 +03:00
d05efc5f85 Refactor bitmap, add extra accessor for color data 2025-08-07 22:05:12 +03:00
4ce443f0d9 Add input checks, fix overflow/wrap related bugs 2025-08-04 20:35:19 +03:00
deb4ec00f4 Add macro functions for checking unsigned wraps 2025-08-04 20:30:30 +03:00
0da77c00d6 Refactor bitmap, add new formats
Small refactoring of the bitmap module and added more indexed formats.
2025-08-04 12:38:17 +03:00
f9feb23d4d Add bitmap support 2025-08-03 19:23:41 +03:00
682abc5664 Add configure script 2025-07-29 21:10:26 +03:00
92fab9dbba Add color manipulation utilities 2025-07-25 10:41:15 +03:00
d527bd4686 Remove extra whitespace before EOL 2025-06-29 22:15:21 +03:00
f82f87cc41 Fix semaphore implementation for MacOS 2025-06-27 12:39:55 +03:00
703fb0f240 Rename MT functions, add tests, fix bugs
Renamed multithreaded related functions, added simple unit tests and fix
bugs caught by said tests :)
2025-06-24 16:48:21 +03:00
9212dbc7c2 Fix memory leak in BH_Bytes 2025-06-22 20:34:14 +03:00
7bfbcd0de5 Use macro for setting vectors 2025-06-22 20:32:46 +03:00
77470adbcd Remove trailing whitespace 2025-06-22 18:48:26 +03:00
6e643403b4 Fix timedwait operations 2025-06-21 21:39:37 +03:00
fc774fd0ff Refactor, separate docs from headers, add ru docs
Doxygen kind'a sucks and I need multilanguage documentation, so I did
that. Also, separated massive Math.h file into smaller files.
2025-06-21 20:12:15 +03:00
7ee69fc397 Add array sizes to math functions 2025-04-29 18:17:00 +03:00
1b6c858a1b Refactor IO, add buffered IO
I wasn't happy with existing implementation of the IO, so I decided
to change it - as a result there is no longer BH_IOOpen and BH_IOClose
and many IO operations are now optional (behind BH_IOCtl).

Finnally implemented buffered IO and fixed size memory buffer IO.
2025-04-26 10:42:22 +03:00
48ddd91dd4 Fix MacOS and POSIX semaphores related issues
Recently got a MacBook Pro and decided to check how things build on
MacOS. Discovered that POSIX unnamed semaphores weren't implemented, so
I reimplemented them with conditional variable and mutex.

Additionally, fixed scripts and CMake on MacOS
2025-04-25 22:38:33 +03:00
dd15b42b44 Add Unicode tests, fix whitespace, fix docs
Added Unicode tests (and fixed few bugs), changed whitespace script to
proccess markdown files, added new guide to showcase how to work with
Unicode.
2025-04-06 14:11:38 +03:00
6aee5a83aa Refactor string functions, add unicode support
Refactored existing functions. Added Unicode support and UTF-8, UTF-16,
and UTF-32 encoding/decoding.
2025-04-05 13:56:00 +03:00
f9ebeabb18 Refactor strings (avoid using dynamically allocated memory)
Refactored strings functions to make them use supplied string
instead of allocating new ones.

Additionally, split String/Int.c into several files to avoid define
mess that was present before.
2025-04-05 13:56:00 +03:00
9025c3d945 Fix bug related to char being signed or unsigned on different platforms 2025-04-05 13:56:00 +03:00
4b2e3da567 Add int tests, fix bugs, add docs
Added tests for string to/from integers and added documentation.
While adding tests caught few bugs and shortcomings (now everything
works as expected)
2025-04-05 13:56:00 +03:00
b7fc93a490 Refactor string to/from double conversion, fix bugs, use bigger ints
Finally, fixed bugs in bigint implementation as well as switched to
32/64 bit integer implementation (gained 2x speed up in some cases).

Additionally, I decided to split Float.c into Float.c and BInt.h for
better readability.
2025-04-05 13:56:00 +03:00
b943135d71 Fix whitespace, add asserts, add string to double function, fix bugs
Finally added StringToDouble function (should work for the majority of
the cases). Additionally fixed bug in StringFromDouble related to
incorrect rounding and added asserts (should add more asserts in the
following commits).

Also implemented some optimizations from Burger and Dybvig paper.
2025-04-05 13:56:00 +03:00
82bea0ebf8 Refactor bigints, add int and float conv functions
Added functions to convert from/to ints/floats. Floats are converted
according to basic Steele&White algorithm (without speedup).
2025-04-05 13:56:00 +03:00
69515af77f Fix styling issues, rename scripts 2025-04-05 13:56:00 +03:00
8009498331 Fix bug in setting precomputed power-of-10 2025-04-05 13:56:00 +03:00
fc3d4e22d5 Add initial bigint implementation for the fmt library 2025-04-05 13:56:00 +03:00
0683389d7b Improved build system and POSIX compatibility
Fixed few bugs related to build system and POSIX compatabilty.
2025-04-05 13:55:06 +03:00
83a4e723bf Fix build error on Linux/POSIX 2025-03-03 17:43:13 +03:00
fe2f39d489 Move include from BH/Thread.h to impls' Thread.h 2025-03-03 10:25:45 +03:00
d403d41f2c Add initial implementation of threads/mutexes/semaphores/cvs/spinlocks
Added initial implementation (or wrapper) of the threading library.
It's rather basic, but should work for most of the tasks.

Unfortunately, spinlock implementation relies on GCC/Clang compiler
built-ins (or in-worst-case-scenario on Win32 - InterlockExchange).
In the future, I should revisit this code and fix/reimplement some stuff
(or add support for Windows XP).
2025-03-02 23:18:23 +03:00
a2d0913c79 Add utils for working with endianness, more documentation, refactor CMake
Decided to update the docs, as well as adding few new features and small
refactoring.
2025-02-28 21:44:22 +03:00