34 Commits

Author SHA1 Message Date
George Kiagiadakis
c2d125b0da Merge branch 'master' into next 2023-12-23 18:34:00 +02:00
George Kiagiadakis
6eed30cf77 properties: update doc to mention that it's possible to use JSON in _new_string() 2023-11-07 20:26:16 +02:00
George Kiagiadakis
f878e2f62d properties: add json to properties converters 2023-06-20 12:39:29 +03:00
George Kiagiadakis
4736d56557 log: implement a log topics system, like pipewire
The intention is to make checks for enabled log topics faster.

Every topic has its own structure that is statically defined in the file
where the logs are printed from. The structure is initialized transparently
when it is first used and it contains all the log level flags for the levels
that this topic should print messages. It is then checked on the wp_log()
macro before printing the message.

Topics from SPA/PipeWire are also handled natively, so messages are printed
directly without checking if the topic is enabled, since the PipeWire and SPA
macros do the checking themselves.

Messages coming from GLib are checked inside the handler.

An internal WpLogFields object is used to manage the state of each log
message, populating all the fields appropriately from the place they
are coming from (wp_log, spa_log, glib log), formatting the message and
then printing it. For printing to the journald, we still use the glib
message handler, converting all the needed fields to GLogField on demand.
That message handler does not do any checks for the topic or the level, so
we can just call it to send the message.
2023-05-16 20:42:28 +03:00
Julian Bouzas
102792527a lib: remove deprecated APIs 2023-04-17 07:48:18 -04:00
George Kiagiadakis
dacc586898 properties: improve documentation of _get_count() 2022-05-10 15:27:31 +03:00
Ashok Sidipotu
f032ac00cf properties: Add get count API
This API returns the count of the number of properties or items.
2022-03-24 06:59:39 +00:00
George Kiagiadakis
b9b722c125 properties: adjust documentation for the recent WpPropertiesItem changes 2021-08-11 20:25:16 +03:00
Julian Bouzas
2792cecbcf properties: use a boxed WpPropertiesItem type when iterating
Needed for JavaScript bindings
2021-07-15 08:55:00 -04:00
George Kiagiadakis
1075d23fab lib: fix some issues found by coverity 2021-06-15 17:43:22 +03:00
Jason Francis
ed8346e77d docs: Add brief descriptions to all functions
This ensures all of these functions are picked up by g-ir-scanner.
2021-06-02 17:38:34 +00:00
George Kiagiadakis
b812e912d2 docs: fix C API documentation to work nicely with doxygen & sphinx 2021-05-25 14:19:53 +03:00
Raghavendra
d692f06f0d docs: api: Replace hotdoc specific commands with Doxygen specific commands 2021-05-25 14:19:53 +03:00
George Kiagiadakis
eeccb24017 properties: add wp_properties_sort()
Depends on pipewire!555 to avoid breaking stuff
2021-03-26 19:06:06 +02:00
George Kiagiadakis
7eed2acd76 lib: documentation fixes 2021-03-04 19:10:10 +02:00
Julian Bouzas
dc2ad1f25d rename all foo_iterate APIs to foo_new_iterator
Avoids confusion with LUA iterate API
2021-02-05 11:33:23 -05:00
George Kiagiadakis
7f40a8152d iterator: add version field in the methods struct
Similar to how pipewire interfaces are versioned.
Keeps the struct extensible without breaking ABI.
2020-11-16 11:16:35 +02:00
George Kiagiadakis
37134df7c8 iterator: make private stuff public, cleanup private.h further
There is no good reason to keep them private
2020-11-15 20:26:15 +02:00
Julian Bouzas
322094565f properties: all properties from other must be included in self for the match to be valid 2020-06-16 12:56:04 +03:00
George Kiagiadakis
0d1fcd48a1 properties: add wp_properties_unref_and_take_pw_properties()
a method to take the internal pw_properties without copying
2020-06-15 17:22:47 +03:00
George Kiagiadakis
c72d126374 properties: const-ify the pw_properties in _new_wrap()
and do not allow writing to wrapped pw_properties,
since they are const now
2020-06-15 17:20:10 +03:00
George Kiagiadakis
0bba0c0df1 properties: fix const-ness warnings 2020-06-02 13:09:00 +03:00
George Kiagiadakis
6aba49f9e3 properties: implement a wp_properties_iterate() method 2020-06-01 12:07:36 +03:00
George Kiagiadakis
9ca342f89f debug: update all library code to use the new debug system
+ enable the new log writer on the executables
+ enable structured logging in the tests
2020-04-14 18:31:17 +03:00
George Kiagiadakis
fe82ce9f0d properties: add wp_properties_ensure_unique_owner() method 2020-03-31 16:11:08 +03:00
George Kiagiadakis
1f1c690b42 properties: remove _copy_keys and add update/add methods similar to the ones in pw_properties 2020-03-31 16:11:08 +03:00
George Kiagiadakis
d7ef39d2d1 properties: rename _copy_all() to _update() to match the pw_properties API
... and use pw_properties_update() underneath
2020-03-31 16:11:08 +03:00
George Kiagiadakis
d4973363ac lib: add extensive API documentation 2020-02-19 10:43:07 +02:00
Julian Bouzas
59580e7c84 properties: add wp_properties_copy_all API 2020-01-07 09:00:46 -05:00
George Kiagiadakis
7a214e8fab wp_properties_match: use wildcard pattern matching instad of strict string comparison 2019-12-05 12:41:45 +02:00
Julian Bouzas
ea3b58c2cd properties: add wp_properties_matches API 2019-12-04 16:38:35 -05:00
George Kiagiadakis
0c6ef834b2 lib: properties: add wp_properties_copy_keys
A method to copy specific keys from one properties set to another
2019-09-17 16:35:14 +03:00
George Kiagiadakis
ff59fc06db lib: properties: add update() and copy_from_dict() API 2019-08-29 19:41:04 +03:00
George Kiagiadakis
2031809d60 lib: add new WpProperties object to wrap pw_properties & spa_dict 2019-08-24 16:19:12 +03:00