Commit Graph

295 Commits

Author SHA1 Message Date
e0aea0be19 core: slight changes to allow compilation under c++ 2026-02-03 17:40:45 +00:00
84df46489a meta: update clang-format config 2026-02-03 14:47:36 +00:00
0d5a186d80 test: core: add bstr tests; update rope tests 2026-02-03 14:47:25 +00:00
2632feac32 cmd: add support for dynamically generating command options at runtime 2026-02-03 14:46:40 +00:00
f5c4fa561f ds: uuid: convert uuid bytes struct to union 2026-02-03 14:45:30 +00:00
5639aefd61 ds: string: set iterator value to B_WCHAR_INVALID when end of string is reached 2026-02-03 14:44:36 +00:00
30a9db17dc ds: list: update iterator interface 2026-02-03 14:43:35 +00:00
ce50cfd18b ds: hashmap: update iterator interface 2026-02-03 14:43:17 +00:00
9b48fc2b45 ds: convert (stub) bitbuffer implementation to (stub) b_object sub-class 2026-02-03 14:42:05 +00:00
5889426478 core: rope: add bstr support 2026-02-03 14:39:33 +00:00
c13b7a7e3a core: stream: add bstr support
despite not being a b_object, the b_stream interface can now detect when
a b_bstr instance has been passed as a stream parameter and use the correct
functions to handle writing to it.

this allows any function that expects a b_stream parameter to be called
with a b_bstr instance instead, allowing complex stream-based I/O operations
to be directed towards bounded character arrays with no heap allocation
required.
2026-02-03 14:36:48 +00:00
23aba2a27f core: add bstr data structure
bstr is very similar to b_stringstream, with the key difference being it can be
stack-allocated. this allows you to write a complex formatted string to a
stack-allocated character buffer with no heap memory allocation required.
bstr also supports automatically-managed dynamic string buffers for unbounded
string construction.
2026-02-03 14:34:58 +00:00
bdcd4163c7 core: stringstream: added read-support
any characters written to a stringstream can be optionally read back again
using the b_stream read API.

this functions similar to a ringbuffer, with two key differences:
 1) the buffer is not circular, and will continuously expand to accomodate all incoming data.
 2) reading data from the stringstream does not remove it from the buffer.
2026-02-03 14:33:06 +00:00
add05ef478 core: iterator: added inline definition of is_valid() 2026-02-03 14:32:15 +00:00
68ab79fe2a core: hash: add support for hashing the contents of ropes 2026-02-03 14:31:35 +00:00
ce9195c130 core: queue: implement moving queue entries
this works exactly the same as moving btree nodes.
2026-02-03 14:30:53 +00:00
837a42e249 core: btree: implement moving btree nodes
moving a btree node is similar to simply using memmove() or memcpy(), with the added
bonus of updating the pointers in the wider data structure to the new node memory
and zeroing the old node memory so that it isn't used accidentally after the move
is complete.
2026-02-03 14:28:58 +00:00
d14a1fc61f io: directory: update error api usage 2025-11-04 10:03:21 +00:00
6b65727535 core: error: rename b_error_release to b_error_discard 2025-11-04 10:03:10 +00:00
5c6030488b test: fix some memory leaks 2025-11-03 21:29:59 +00:00
bd2fe50ec9 test: move all module tests to the test/ directory 2025-11-01 10:12:18 +00:00
a68b9f7ba7 test: update tests 2025-11-01 10:04:41 +00:00
9e21e0c4b2 serial: toml: update iterator usage 2025-11-01 10:04:28 +00:00
5d3a987b0e io: directory: implement new b_iterator interface 2025-11-01 10:03:59 +00:00
ec500c04ad cmd: remove internal usage of legacy iterator interface 2025-11-01 10:02:42 +00:00
c94f976751 ds: string: implement b_iterable interface 2025-11-01 10:01:59 +00:00
3db808d4c4 ds: array: fix iterable_begin not setting iterator status 2025-11-01 10:01:17 +00:00
734c80c527 ds: dict: fix iterable_begin not setting iterator status 2025-11-01 10:00:57 +00:00
493b9ec4a4 core: iterator: implement const iterators 2025-11-01 09:58:18 +00:00
0cbab62391 core: type: fix interface type components not being initialised properly 2025-11-01 09:57:32 +00:00
abf1d45602 core: class: validate magic number in class header 2025-11-01 09:56:52 +00:00
360428c8e8 core: object: validate magic number in object header 2025-11-01 09:56:22 +00:00
053dd26304 ds: dict: re-implement dict_fini and dict_to_string 2025-10-29 15:01:03 +00:00
2d5da8605d ds: tree: update iterator interface 2025-10-29 14:35:46 +00:00
b292168c70 ds: string: update iterator interface 2025-10-29 14:35:36 +00:00
0f89901239 ds: list: update iterator interface 2025-10-29 14:35:18 +00:00
bae95909ca ds: dict: update iterator interface 2025-10-29 14:35:07 +00:00
824d436a1c ds: hashmap: update iterator interface 2025-10-29 14:34:57 +00:00
d8abd54b89 ds: array: update iterator interface 2025-10-29 14:34:38 +00:00
144c3a4c68 core: error: clean up includes and formatting 2025-10-29 14:32:19 +00:00
2ee2f8c115 core: object: remove legacy iterator interface usage 2025-10-29 14:31:09 +00:00
1e4b5bc4e6 core: btree: replace legacy iterator interface 2025-10-29 14:30:33 +00:00
c2b894ef22 core: queue: replace legacy iterator interface 2025-10-29 14:29:05 +00:00
009b6c6292 core: iterator: re-design b_iterator as a b_object interface 2025-10-29 13:52:27 +00:00
71069a6ebb meta: update clang-format config 2025-10-28 15:21:38 +00:00
6639a84a78 test: update tests 2025-10-28 15:21:19 +00:00
2d29713f57 serial: convert b_serial_ctx to a b_object interface 2025-10-28 15:20:57 +00:00
e63095c458 io: file: update b_stream interface 2025-10-28 15:20:37 +00:00
7ba396933a compress: cstream: convert to a b_object type 2025-10-28 15:20:08 +00:00
f3dd0ddd48 compress: compressor: convert b_compressor to a b_object interface 2025-10-28 15:19:30 +00:00