Dirk-Jan C. Binnema
eafc81f168
utils: fix non-cld2 build
2023-05-12 21:52:32 +03:00
Dirk-Jan C. Binnema
ad64093183
utils: implement language-detector
...
A thing wrapper around CLD2 with which we can detect the language of an
e-mail message.
2023-05-11 23:23:52 +03:00
Dirk-Jan C. Binnema
3a05dd8725
lib/utils: implement read_from_stdin
2023-04-29 23:01:12 +03:00
Dirk-Jan C. Binnema
e4af910d04
utils: implement g_cancellable_new_with_timeout
2023-04-29 23:01:12 +03:00
Dirk-Jan C. Binnema
3c578d7a3b
utils: add thread_dep for logger test
...
Needed on some systems
Fixes #2473
2023-04-14 12:48:03 +03:00
Dirk-Jan C. Binnema
8762ac27dc
mu: improve error numbers
...
Ensure they match what mu expects.
2023-04-11 20:47:48 +03:00
Dirk-Jan C. Binnema
ec942a988d
tests: always log to file during tests
...
And set the cachedir (for logging and other things) to a random tmpdir.
2023-04-09 14:43:36 +03:00
Dirk-Jan C. Binnema
9b8a0146e0
logger: create logdir if non-existent
2023-04-09 14:43:17 +03:00
Dirk-Jan C. Binnema
e43452fa18
test: don't "uniqify" link names during test
2023-04-09 11:02:58 +03:00
Dirk-Jan C. Binnema
2aa0d20f39
mu-logger: Add lock for file-logger and stress test
...
Add a lock to the file logger and add a unit-test to stress test it.
(It does fail without the lock, and passed with it).
Should help for: #2469 .
2023-04-08 10:26:15 +03:00
Dirk-Jan C. Binnema
ff1e06c7c8
mu-find: restore JSON output
...
Fixes #2453
2023-03-30 18:12:33 +03:00
Dirk-Jan C. Binnema
39101cf583
mu-find: brush off --format=links unit test
...
Enable it by default, and modernize it a little bit
2023-03-28 22:26:56 +03:00
Dirk-Jan C. Binnema
3ec960c609
mu: improve mu-error
...
Add specific error-code for SchemaMismatch
Combine find/cfind no-matches
2023-01-29 15:38:40 +02:00
Dirk-Jan C. Binnema
cc664b8128
utils: add missing mu-regex.cc
...
Fixes #2425
2023-01-29 12:49:52 +02:00
Dirk-Jan C. Binnema
40c3d3568e
utils: improve xapian exception handling / reporting
2023-01-29 11:25:02 +02:00
Dirk-Jan C. Binnema
a8daec9598
lib: use join_paths
...
Convert some manual concatenation to the new join_paths helper.
2023-01-29 10:13:29 +02:00
Dirk-Jan C. Binnema
25635c5cfe
utils: add join_paths + tests
2023-01-29 10:13:29 +02:00
Dirk-Jan C. Binnema
daef904ca1
utils: add Regex::replace + unit tests
2023-01-29 10:13:29 +02:00
Dirk-Jan C. Binnema
ba69e2104a
utils: remove some dead test code
2023-01-29 10:13:29 +02:00
Arsen Arsenović
ce94464652
mu-error: Add missing <cstdint> include
...
GCC 13s libstdc++ reduced its dependency on some headers like <cstdint>, so it's
no longer transitively included through various headers. Include it explicitly.
See also: https://gcc.gnu.org/gcc-13/porting_to.html#header-dep-changes
../lib/utils/mu-error.hh:36:26: error: ‘uint32_t’ does not name a type
36 | static constexpr uint32_t SoftError = 1 << 23;
| ^~~~~~~~
2023-01-21 19:48:57 +01:00
Dirk-Jan C. Binnema
201fe45edc
server: add a few stopwatches
...
For measuring performance.
2023-01-19 22:37:50 +02:00
Dirk-Jan C. Binnema
6979a66630
utils: get rid of mu-util.[ch]
...
It was getting old...
Remove the unused parts, refactor the few parts still in use.
2023-01-14 20:02:05 +02:00
Dirk-Jan C. Binnema
ef2ec7d5a5
server: split off new server command 'queries'
...
Instead of being part of the ping command, create a separate
queries command, which is easier for updating. Ie. 'ping' implies "show
main screen" but we don't always want that side-effect.
2023-01-07 15:40:30 +02:00
Dirk-Jan C. Binnema
60e9d54a7c
mu-regex: make backward-compatible with older glib
2022-12-31 00:10:24 +02:00
Dirk-Jan C. Binnema
27ecbbdd65
many: use Mu::Regex instead of std::regex
...
The former is PCRE-compatible, and faster than std::regex.
2022-12-30 11:15:03 +02:00
Dirk-Jan C. Binnema
e97bbb83e3
utils/mu-regex: add PCRE Regex wrapper
...
Add a thin c++ wrapper for GLib's GRegex (which is a PCRE wrapper
itself). PCRE is much faster than C++ std::regex, it may even matter in
some use-cases.
2022-12-30 11:15:03 +02:00
Dirk-Jan C. Binnema
27ffaba817
mu-utils: use const char* from for time_to_string
...
To avoid lifetime problems with some(?) compilers.
2022-12-10 19:22:00 +02:00
Dirk-Jan C. Binnema
cec08ab1ea
script: Rework guile script with new CLI support
...
Integrate the guile scripting a bit better into the mu cmdline.
Rework the old script module for that.
2022-11-17 11:00:06 +02:00
Dirk-Jan C. Binnema
64f08149bc
lib: remove mu-runtime
...
Remove runtime; update the logger for that, and move the runtime-paths
stuff to utils.
2022-11-16 23:31:51 +02:00
Dirk-Jan C. Binnema
ed08118652
utils/command-handler: fix symbol-arg copy-pasta
...
Fixes #2361 .
2022-11-13 15:03:07 +02:00
Dirk-Jan C. Binnema
aa6fd3e757
utils/mu-utils-format: add missing includes
2022-11-12 08:30:46 +02:00
Dirk-Jan C. Binnema
dbd3c1309a
command-handler: rework for new sexp
...
Rework / cleanup the command-handler (and rename for command-parser).
Update tests (and integrate with sources)
2022-11-07 18:38:03 +02:00
Dirk-Jan C. Binnema
dfc2cb12d7
sexp: major rework / API improvements
...
Use a bit nicer/modern c++, since we're using C++17 now. Add more tests.
2022-11-07 18:37:23 +02:00
Dirk-Jan C. Binnema
cb4e893f3a
mu-error: add missing string include
2022-10-30 15:51:03 +02:00
Dirk-Jan C. Binnema
9e60ebb683
utils: add helpers for assoc-pairs
...
Add some unit-test, too.
2022-10-02 18:24:23 +03:00
Dirk-Jan C. Binnema
e416a5215f
autotools: remove
...
Since 2008, autotools has served us well - thank you!
However, mu is now using meson build, and it's time to remove the
autotools support -- one build system is enough.
2022-08-20 11:19:29 +03:00
Dirk-Jan C. Binnema
317fe53ff7
tests: update test helpers and users
...
Move test-mu-common to mu-test-utils. Use mu_test_init as a wrapper for
g_test_init. Update users.
2022-08-11 22:55:10 +03:00
Dirk-Jan C. Binnema
cade7493fd
build: fix some compiler warnings
2022-06-18 15:21:26 +03:00
Dirk-Jan C. Binnema
f69ad37e7a
utils: add regex-split
2022-06-16 22:49:46 +03:00
Dirk-Jan C. Binnema
646a672ae0
test-utils: add error test
2022-06-09 00:39:34 +03:00
Dirk-Jan C. Binnema
015a7ee0cb
utils: improve locale_workaround
...
Fixes : #2270 .
2022-06-04 00:41:28 +03:00
Dirk-Jan C. Binnema
0fe8f9a613
mu-util-play: simplify
...
Remove some unused options
2022-06-04 00:41:28 +03:00
Dirk-Jan C. Binnema
13f0e24241
lib: improve test coverage
...
Add a bunch of tests
2022-06-02 21:07:41 +03:00
Dirk-Jan C. Binnema
022ae9c2e3
result: make assert_valid_result a bit more informative
...
For unit tests.
2022-05-31 23:39:50 +03:00
Dirk-Jan C. Binnema
734445f78d
mu-server: add a bit more debugging info
2022-05-30 20:30:33 +03:00
Dirk-Jan C. Binnema
ffcb59bfd3
utils: add fallback for time_to_string
...
Still don't understand issue #2230
2022-05-28 00:51:08 +03:00
Dirk-Jan C. Binnema
91dcd19dad
tests: improve coverage a bit
2022-05-24 19:36:39 +03:00
Dirk-Jan C. Binnema
046398b1ae
utils: avoid compiler warning
2022-05-24 19:36:21 +03:00
Dirk-Jan C. Binnema
9c9f9ecae3
lib: improve coverage a bit
2022-05-23 23:55:11 +03:00
Dirk-Jan C. Binnema
cc63eca8ad
autotools: improve build
...
*almost* works (except for guile/, which does work yet anyway).
2022-05-19 23:38:49 +03:00
Dirk-Jan C. Binnema
cea3167f3e
lib: remove some dead code (mu-str/utils)
...
Remove unused library code; recycle some electrons.
2022-05-19 23:38:49 +03:00
Dirk-Jan C. Binnema
2fd133761f
utils: fix unsetting timezone
2022-05-18 01:12:20 +03:00
Dirk-Jan C. Binnema
b03590cca8
tests: skip missing timezones in queries, too
2022-05-18 01:08:40 +03:00
Dirk-Jan C. Binnema
33d30775ee
test-utils: Skip test if timezone is not available
2022-05-18 00:52:28 +03:00
Dirk-Jan C. Binnema
c4cc9795dc
utils: add locale_workaround
...
Attempt to work around some locale handling throwing in some systems.
"locale::facet::_S_create_c_locale name not valid"
Ugly, but maybe it helps.
2022-05-17 22:31:03 +03:00
Dirk-Jan C. Binnema
6e37790012
mu: improve error reporting
2022-05-15 13:40:44 +03:00
Dirk-Jan C. Binnema
9e78d3d13f
utils: insist on semicolon after MU_ENABLE_BITOPS
2022-05-14 12:47:26 +03:00
Dirk-Jan C. Binnema
34c5ca1627
mu-error: encode retval/flags in enum
2022-05-12 08:56:13 +03:00
Dirk-Jan C. Binnema
da8489d0f6
sexp: allow for some prettified string output
...
Allow for adding newlines between list items
2022-05-06 22:17:53 +03:00
Dirk-Jan C. Binnema
6126d7ee62
store: ensure updates update message sexp too
...
And turn all "add" into "replace" so old messages get removed.
Update tests too.
2022-05-05 01:40:17 +03:00
Dirk-Jan C. Binnema
30e7b5d9ec
lib: move 3rd party code to thirdparty; add tabulate.hpp
...
Move 3rd-party code to their own dir, and add the nice tabulate.hpp
2022-04-30 10:40:45 +03:00
Dirk-Jan C. Binnema
b7a30c0a36
utils: update date/size parsing, factor out format
...
And update tests
2022-04-30 10:40:45 +03:00
Dirk-Jan C. Binnema
3ac3ce7828
error: Add some more error codes
2022-04-30 10:40:45 +03:00
Dirk-Jan C. Binnema
9e9e16a7ec
lib/tests: rework in terms of Mu::Message
2022-04-30 10:40:45 +03:00
Dirk-Jan C. Binnema
1ff161d91b
utils: add mu-option.cc
...
Was missing.
2022-04-18 22:54:33 +03:00
Dirk-Jan C. Binnema
15decf6327
mu-utils: avoid compiler warning
2022-04-18 22:26:13 +03:00
Dirk-Jan C. Binnema
4ac66baccc
mu-result: add assert_valid_result
...
Useful for unit tests
2022-04-18 22:26:04 +03:00
Dirk-Jan C. Binnema
7c51bc68d4
option: rename to to_string_opt and to_string_view_opt
...
to_option_string -> to_string_opt
to_string_view -> to_string_view_opt
2022-04-18 22:04:33 +03:00
Dirk-Jan C. Binnema
4f9c154d1a
utils: add deletable_unique_ptr
2022-04-16 16:20:38 +03:00
Dirk-Jan C. Binnema
43c71c7698
error: Add crypto error code
2022-04-16 16:20:38 +03:00
Dirk-Jan C. Binnema
e9fdf7f01d
utils: add extra check for #2230
2022-04-16 16:20:38 +03:00
Dirk-Jan C. Binnema
acbcbc0b43
utils: include unistd.h
2022-04-14 23:04:42 +03:00
Dirk-Jan C. Binnema
a7e6d57286
utils: add TempDir RAII class
...
For tests
2022-04-14 17:06:33 +03:00
Dirk-Jan C. Binnema
55489cc0d1
mu-error: make fill_g_error const
...
And add some more error codes.
2022-03-28 22:53:05 +03:00
Dirk-Jan C. Binnema
dc2be0b442
utils: add seq_some
2022-03-28 22:53:05 +03:00
Dirk-Jan C. Binnema
27ebfb3b3c
lib+guile: use Mu::Option, not std::optional
...
We need the extensions, and/or let's use _one_ optional implementation everywhere.
2022-03-28 08:58:04 +03:00
Dirk-Jan C. Binnema
55402622b9
result: add Err which takes a GError
...
Convenience
2022-03-26 17:19:10 +02:00
Dirk-Jan C. Binnema
f7c84006d7
many: update for lib/message updates
...
Adapt to the new names / directory. Big commit, but mostly just very boring renaming.
2022-03-26 17:19:10 +02:00
Dirk-Jan C. Binnema
33dbcbb25f
mu-error: fix typo
2022-03-26 17:19:10 +02:00
Dirk-Jan C. Binnema
a23c99ff7e
utils: add some handy STL conveniences
2022-03-26 17:19:10 +02:00
Dirk-Jan C. Binnema
e0096c3dee
utils: improve split / join
2022-03-19 10:58:13 +02:00
Dirk-Jan C. Binnema
2fb6356ab6
xapian-utils: xapian_try: also catch std::exception
2022-03-13 07:49:31 +02:00
Dirk-Jan C. Binnema
673929f169
logger: with MU_LOG_STDOUTERR, write logs to console
...
For debugging
2022-03-13 07:49:31 +02:00
Dirk-Jan C. Binnema
5b121352c2
utils: Handle failing g_date_time_new_...
...
Possibly, this caused a crashed under some scenarios (though couldn't reproduce).
2022-03-07 22:28:40 +02:00
Dirk-Jan C. Binnema
00d9fb121f
utils: add rename has_flag into one_if in BITOPS
2022-03-07 06:50:18 +02:00
Dirk-Jan C. Binnema
5417928c1e
utils: add has_flag to MU_ENABLE_BITOPS
2022-02-26 10:09:31 +02:00
Dirk-Jan C. Binnema
38d08bad85
utils: add STR_V macro for printing string_view
2022-02-26 10:09:31 +02:00
Dirk-Jan C. Binnema
273f84483a
utils: some more convenience for error/result
2022-02-22 23:07:30 +02:00
Dirk-Jan C. Binnema
4990792f02
utils: rework Mu::split
...
And add some tests, cleanups.
2022-02-22 23:07:30 +02:00
Dirk-Jan C. Binnema
af87cde217
utils/mu-date: remove
...
Remove mu-date.[ch] and convert its last users to use time_to_string instead.
2022-02-22 23:07:29 +02:00
Dirk-Jan C. Binnema
0e117fd6ab
utils: improve assert_equal macro
...
make it a macro so we get line numbers etc
2022-02-21 23:51:46 +02:00
Dirk-Jan C. Binnema
ec826cd838
tests: update naming
2022-02-21 23:51:46 +02:00
Dirk-Jan C. Binnema
69a465d849
mu-sexp: add some small conveniences
2022-02-20 14:08:53 +02:00
Dirk-Jan C. Binnema
8cea933a51
mu-store: take mu_util_get_hash
...
mu-store is the only user left, move the implementation there.
2022-02-19 19:09:25 +02:00
Dirk-Jan C. Binnema
c0da564bba
lib: fix clang compatibility / warnings
2022-02-18 10:49:56 +02:00
Dirk-Jan C. Binnema
4eabf1a64a
*: update for for mu-maildir changes
...
Update the dependencies.
2022-02-17 23:48:59 +02:00
Dirk-Jan C. Binnema
1db70c05e6
utils/async-queue: appease helgrind
...
We used notify_one _outside_ the lock; that should be just fine... but helgrind
doesn't like it, so let's appease it.
2022-02-17 23:48:59 +02:00
Dirk-Jan C. Binnema
c5538d5b14
utils: update optional & expected
...
Use the latest upstream versions.
2022-02-16 23:18:16 +02:00
Dirk-Jan C. Binnema
bc44666d88
mu-str: Remove some dead code
2022-02-16 21:55:02 +02:00
Dirk-Jan C. Binnema
dce924da9c
mu-error: Better support for GError
...
Allow filling a GError from a Mu::Error
2022-02-16 21:55:02 +02:00