Commit Graph

4 Commits

Author SHA1 Message Date
Ashok Sidipotu
ad8d7aaf75 json-utils: correct typo 2024-02-12 13:15:02 +05:30
George Kiagiadakis
42b64bfc28 spa-json: rename _from_string() to _wrap_string() and add new "from" variants
The previous naming convention was confusing because it did not make
it explicit that the string is not being copied. We had this wrong already
in the Lua bindings and thanks to some miracle it hasn't backfired so far
(it was using the "wrap" behaviour with a string that doesn't stay alive).

In some places we actually need the "copy" behaviour and in some other
places we need the "wrap" behaviour, so let's have both variants available.
2023-11-14 12:36:10 +02:00
George Kiagiadakis
96eae7d523 json-utils: add wp_json_utils_merge_containers(), factored out of conf.c 2023-11-14 12:02:31 +02:00
George Kiagiadakis
89ac416e99 lib: add new json-utils set of functions
The purpose is to wrap some utilities that pipewire provides that use JSON.

Start by wrapping pw_conf_match_rules(), which despite its name, it has nothing
to do with the configuration object. It operates directly on JSON and can be
useful to work with match rules outside the context of configuration files.
2023-11-07 16:36:49 +02:00