Commit Graph

186 Commits

Author SHA1 Message Date
ff2ff6f136 core: stream: update generic pointer usage for stdio streams 2025-10-19 11:26:04 +01:00
b3de59ae24 ds: datetime: convert to new object system 2025-10-19 11:25:15 +01:00
dacbc5e9c2 ds: buffer: convert to new object system 2025-10-19 11:03:44 +01:00
0a9eb4a085 ds: array: convert to new object system 2025-10-19 11:02:59 +01:00
3eebdddc21 ds: string: convert to new object system 2025-10-19 11:02:36 +01:00
3ee9de74f0 meta: add .cache to gitignore 2025-10-19 10:22:53 +01:00
d5bd8fa32a core: stream: add a second generic pointer to b_stream 2025-10-19 10:22:35 +01:00
c389e32dc6 core: add B_NPOS definition 2025-10-19 10:22:11 +01:00
379bd048b2 core: object: make interface query functions const; remove type parameters 2025-10-19 10:21:43 +01:00
e1e4544b67 core: macros: fix bad return type on unref() function template 2025-10-18 21:54:34 +01:00
4044961478 core: rename b_retain/b_release to b_object_ref/b_object_unref 2025-10-18 21:51:51 +01:00
6b5f0319c3 format: improve type definition BEGIN/END macro recognition 2025-10-18 21:50:24 +01:00
503dc56328 core: add macros for performing non-virtual class method dispatch 2025-10-18 21:41:40 +01:00
4d75a572c4 ds: memove legacy object system 2025-10-18 21:19:21 +01:00
a0b7b5b85b core: remove type parameter from object interface query functions 2025-10-18 21:06:20 +01:00
c8b8111487 meta: remove cache files 2025-10-18 21:02:21 +01:00
06add543bf Merge branch 'main' into feature/new-object-system 2025-10-15 11:13:00 +01:00
9d2ebfce2e core: move new object system to core module
this will allow a wider range of data structures (e.g. b_error, b_stream, b_stringstream) to make use
of the new object system, and other modules and library users can use the object system without
depending on the blue-object or blue-ds modules.

blue-ds will become a simple library of data structures (string, hashmap, etc), built on top of the
core object system.
2025-10-15 10:38:18 +01:00
407a0972c1 io: file: implement tell() callback for file streams 2025-10-12 17:29:49 +01:00
57f21020fc cmd: add asserts to b_arglist_report_missing_args 2025-10-12 17:29:22 +01:00
31cdc7064d cmd: fix coloured arg usage string output 2025-10-12 17:29:03 +01:00
b4360e9bdc test: add and update a few tests 2025-09-22 10:55:20 +01:00
11fd147031 term: tty: update hash api usage 2025-09-22 10:55:04 +01:00
30210d67e0 serial: add toml parser 2025-09-22 10:54:33 +01:00
9fa2168599 serial: json: update b_dict usage 2025-09-22 10:54:11 +01:00
d90291c0b1 io: path: add function to query the path used to open a file 2025-09-22 10:53:23 +01:00
49ad80bcf2 io: path: use new to_string() and b_string apis 2025-09-22 10:52:56 +01:00
15cb225533 object: number: add support for positive/negative infinite and NaN values 2025-09-22 10:52:02 +01:00
be47176524 object: dict: use b_strings as keys rather than plain c-strings.
now that strings can contain UTF-8 codepoints and null chars, the b_dict
api has been enhanced to accept keys as b_strings as well as regular c-strings.

keys are now stored as b_strings internally, to allow a wider range of
keys to be used.
2025-09-22 10:50:07 +01:00
b7da91ac93 object: hashmap: implement integer-based hashmap keys
rather than always interpreting a b_hashmap_key as a buffer to be hashed,
b_hashmap can now be told to consider the value of the key_data pointer itself
as the key, treating it as a buffer of size sizeof(void*).
2025-09-22 10:48:05 +01:00
d9041cda3f object: to_string() now takes a const object pointer 2025-09-22 10:47:33 +01:00
16b68b6fba object: add a type for storing, parsing, and stringifying date/time values 2025-09-22 10:44:56 +01:00
2fcadf7f39 core: string: add UTF-8 and null-char support; and some new string functions
b_string now uses UTF-8 internally, and can correctly manipulate strings
that contain non-ASCII and multi-byte codepoints.

b_string now tracks the length of a string in both bytes and unicode codepoints.

string insertion functions have been updated to correctly handle strings with
multi-byte codepoints, so the index parameter of each function now refers to codepoints
rather than bytes. inserting single-byte chars into a string with no multi-byte codepoints
is still optimised to used array indexing and memmove.

a b_string_iterator has been added to simplify iterating through a UTF-8 string, without
having to use a charAt()-style interface that would incur performance penalties.

strings can now also contain null bytes.

new functions include:
  - b_string_tokenise: a b_iterator interface for iterating through tokens
    in a string. similar to strtok except that:
    * it is re-entrant, and uses no global state.
    * it supports delimiters that are longer than one character and/or contain
      multi-byte UTF-8 codepoints.
    * it doesn't modify the string that is being iterated over.
    * it correctly handles strings with multi-byte UTF-8 codepoints and null chars.
  - b_string_compare: for comparing strings. necessary to use this rather than strcpy
    as b_strings can now contain null chars.
2025-09-22 10:36:26 +01:00
cbaeb002f8 core: stream: b_stream_read_line_s now includes linefeed in output and correctly reports EOF condition 2025-09-22 10:32:37 +01:00
bc5986150c core: stream: fix buffer overflow in stream indentation stack 2025-09-22 10:31:53 +01:00
4ab524a66b core: hash: rename b_hash_string to avoid conflict with b_string 2025-09-22 10:31:30 +01:00
d52992c8ba core: printf: switch to an enhanced version of embedded printf 2025-09-22 10:30:40 +01:00
072903f896 core: error: fix b_error_caused_by_code calling an undefined function 2025-09-22 10:29:48 +01:00
0a2a1c695a core: error: add function to test if an error has a particular vendor/code 2025-09-22 10:29:01 +01:00
db3d1e3183 core: add a type to store unicode characters, as well as functions to query them 2025-09-22 10:28:03 +01:00
bdf201dedc TEMP: add toml parser 2025-09-19 15:47:59 +01:00
2108277061 format: configure clang-format to support type definitions BEGIN/END macros 2025-08-16 16:04:44 +01:00
a3ee146b4d test: object: add simple string test 2025-08-16 16:04:11 +01:00
c65541ac62 core: add new enhanced object module 2025-08-16 16:03:55 +01:00
3f2558cac3 core: add B_BTREE_INIT macro 2025-08-16 16:00:33 +01:00
2c15d5cd45 core: add new object related status codes 2025-08-16 16:00:04 +01:00
0751ef469f meta: rename legacy object module to 'ds' 2025-08-09 19:57:42 +01:00
a5e3e06306 core: add basic mutex and per-thread data support 2025-08-09 19:49:06 +01:00
ee2611c678 core: error: fix double free of errors released with b_error_release 2025-08-09 19:48:40 +01:00
ed8e51ed5e core: bitop: add atomic compare-exchange 2025-08-09 19:48:01 +01:00