f3e117afcc
watchdog: upgrade to rearm rather than die on initial timeout
...
This makes watchdog reusable.
Signed-off-by: Simon Rozman <simon@rozman.si>
2024-01-19 14:48:23 +01:00
528ea5fffe
pool: add clear
...
Signed-off-by: Simon Rozman <simon@rozman.si>
2024-01-19 14:44:37 +01:00
8839c80fec
debug: add benchmark
...
Signed-off-by: Simon Rozman <simon@rozman.si>
2024-01-18 12:19:44 +01:00
ab94d7014f
stream: cleanup
...
Signed-off-by: Simon Rozman <simon@rozman.si>
2024-01-16 08:24:37 +01:00
59a53e10f4
string: update documentation
...
Signed-off-by: Simon Rozman <simon@rozman.si>
2024-01-11 09:09:46 +01:00
9f3d65d910
zlib: add
...
Signed-off-by: Simon Rozman <simon@rozman.si>
2024-01-09 20:07:06 +01:00
790c26789a
sys_info: add is_screen_reader
...
Signed-off-by: Simon Rozman <simon@rozman.si>
2024-01-09 20:06:02 +01:00
c5feba2ed0
string: add unit test for sprintf
...
Signed-off-by: Simon Rozman <simon@rozman.si>
2024-01-09 19:31:07 +01:00
38c6b40b21
Bump Copyright year
...
Signed-off-by: Simon Rozman <simon@rozman.si>
2024-01-06 10:55:09 +01:00
b42aa969dc
unicode: Write directly into std::string buffer
...
This removes extra memory allocation.
Signed-off-by: Simon Rozman <simon@rozman.si>
2024-01-05 22:55:15 +01:00
114609274f
string: address Code Analysis warnings
...
Signed-off-by: Simon Rozman <simon@rozman.si>
2024-01-05 22:45:41 +01:00
293da738b9
string: upgrade sprintf to write directly into std::string buffer
...
This removes extra memory allocation.
Signed-off-by: Simon Rozman <simon@rozman.si>
2024-01-05 20:32:00 +01:00
1685cd3283
string: fix sprintf
...
Signed-off-by: Simon Rozman <simon@rozman.si>
2024-01-05 17:01:43 +01:00
0eebde6d81
parser::http_media_type: fix stack overflow
...
Signed-off-by: Simon Rozman <simon@rozman.si>
2024-01-03 15:49:01 +01:00
b96d909cfe
html: fix to build
...
Signed-off-by: Simon Rozman <simon@rozman.si>
2024-01-03 13:16:35 +01:00
d981225ba8
sgml: add sgmlerr
...
Signed-off-by: Simon Rozman <simon@rozman.si>
2023-12-23 08:19:43 +01:00
fdf16a65b6
string: add is7bit
...
Signed-off-by: Simon Rozman <simon@rozman.si>
2023-12-23 08:19:26 +01:00
e1f53f31ad
string: add glyphrlen
...
Signed-off-by: Simon Rozman <simon@rozman.si>
2023-12-22 21:36:21 +01:00
9c9fd9d05a
math: add muldiv
...
Signed-off-by: Simon Rozman <simon@rozman.si>
2023-12-22 21:35:56 +01:00
024f3f7172
string: add strncpy for fixed-size buffers
...
Signed-off-by: Simon Rozman <simon@rozman.si>
2023-12-22 14:17:10 +01:00
61bf25ac6a
string: switch from intptr_t to ptrdiff_t at strtoi()
...
strtoi() is complementary to strtoui() returning size_t. But, intptr_t
is complementary to uintptr_t, and ptrdiff_t is complementary to size_t.
I know it doesn't matter on flat-memory platforms, but nevertheless, we
try to keep things organized in a portable way.
Signed-off-by: Simon Rozman <simon@rozman.si>
2023-12-22 14:17:10 +01:00
ba38dad49d
string: add strrcmp and strrncmp
...
Signed-off-by: Simon Rozman <simon@rozman.si>
2023-12-22 14:17:10 +01:00
09b59e698d
Refactor
...
Signed-off-by: Simon Rozman <simon@rozman.si>
2023-12-22 14:17:09 +01:00
c212e68bb5
debug: add
...
Signed-off-by: Simon Rozman <simon@rozman.si>
2023-12-22 14:17:09 +01:00
088dd86d63
string: add strtod
...
Signed-off-by: Simon Rozman <simon@rozman.si>
2023-12-22 14:17:09 +01:00
441a2ae9d5
compat: add _Verify_
...
This eases porting of legacy code.
Signed-off-by: Simon Rozman <simon@rozman.si>
2023-12-22 14:17:09 +01:00
2020fa2eec
locale: add UTF8 and ACP/OCP locales
...
Those are frequently used:
- UTF8: for exception message formatting
- ACP(OCP): for generic (console) output
Signed-off-by: Simon Rozman <simon@rozman.si>
2023-12-22 14:17:09 +01:00
a5193c9738
string: remove excessive std::string_view helpers
...
The standard C++ approach is preferred over legacy C-style string
operations. Some helpers have clean standard C++ implementation on
std::string(_view) classes. All were just a simple .data() and .size()
wrappers for legacy C functions.
The main concern is the amount of helpers that require maintenance.
Signed-off-by: Simon Rozman <simon@rozman.si>
2023-12-22 14:17:09 +01:00
37891e8a2a
Simplify and unify template parameter naming
...
Signed-off-by: Simon Rozman <simon@rozman.si>
2023-12-22 14:17:08 +01:00
f5bce32d06
Use std::string_view where possible
...
Unfortunately, MSVC cannot deduce template parameters properly where
`const std::basic_string_view<...>` is the parameter. It requires
explicit type cast or explicit template type specification. Which kind
of voids the whole purpose of using std::basic_string_view to make the
client code simpler.
Example: https://gist.github.com/rozmansi/493911be70bdac08dc6826c976c5bbe4
Signed-off-by: Simon Rozman <simon@rozman.si>
2023-12-22 14:17:08 +01:00
da9dcc9c1a
parser: move virtual match() to do_match() and provide frontend
...
This allows to call match() method equally by using char T* or
std::basic_string_view<T>.
Signed-off-by: Simon Rozman <simon@rozman.si>
2023-12-22 14:17:08 +01:00
bce104d97b
locale: redesign locale to behave like locale_t on demand
...
This avoids painful `.get()` in every `stdex::sprintf()` call. We could
use C++ polymorphism to add other sprintf variants, but the argument
combinations would explode.
Signed-off-by: Simon Rozman <simon@rozman.si>
2023-12-22 14:17:08 +01:00
2610547137
Cleanup
...
Signed-off-by: Simon Rozman <simon@rozman.si>
2023-12-21 09:21:32 +01:00
2e65d0351c
Trim excessive inline
...
Methods and templates are implicitly marked as inline already.
Signed-off-by: Simon Rozman <simon@rozman.si>
2023-12-11 11:33:27 +01:00
7eba65813e
stream: fix cache::read() to return state_t::eof correctly
...
Signed-off-by: Simon Rozman <simon@rozman.si>
2023-12-11 09:55:20 +01:00
91ffe3f633
wav: cleanup
...
Signed-off-by: Simon Rozman <simon@rozman.si>
2023-12-08 18:53:08 +01:00
bdd76b302d
wav: fix cue loading
...
Signed-off-by: Simon Rozman <simon@rozman.si>
2023-12-08 18:53:07 +01:00
6fc378ff61
idrec: fix reading from limited streams
...
Signed-off-by: Simon Rozman <simon@rozman.si>
2023-12-08 18:53:04 +01:00
0ec86f6161
idrec: cleanup
2023-12-08 18:47:05 +01:00
d5bf60447b
Cleanup
2023-12-08 16:22:09 +01:00
bb9988933e
unicode: add unit test for normalize
...
Signed-off-by: Simon Rozman <simon@rozman.si>
2023-12-08 14:21:52 +01:00
6d1d9bd1b8
sgml: fix unit tests
2023-12-08 14:21:20 +01:00
5d7e44a3cd
parser: address Code Analysis warning
...
Nice catch: when calling with basic_bol::match(nullptr, 5, 5), the
method addresses null[4].
Turned this condition into debug assert, as (nullptr, 5, 5) is invalid
input parameter combination.
2023-12-08 14:20:56 +01:00
8ba5a06379
parser: update SAL
...
Signed-off-by: Simon Rozman <simon@rozman.si>
2023-12-08 14:03:26 +01:00
5215d5e6dc
unicode: add normalize
...
Signed-off-by: Simon Rozman <simon@rozman.si>
2023-12-07 18:43:14 +01:00
475f05b6d2
string: add strrchr and stricmp variants
2023-12-07 18:42:52 +01:00
2440e5baca
Cleanup
...
Signed-off-by: Simon Rozman <simon@rozman.si>
2023-12-07 18:41:55 +01:00
72bab6d6b2
string: add strlwr variants
2023-12-07 12:27:38 +01:00
0d3785850b
html: add (un)escaping function variants
2023-12-07 12:26:41 +01:00
b15ab697c2
string: add strnlen variant for known fixed-size buffers
2023-12-07 12:25:35 +01:00