mirror of
https://gitlab.freedesktop.org/pipewire/pipewire
synced 2024-10-04 15:10:20 +00:00
d4581755e6
Add struct spa_error_location that holds information about some parsing context such as the line and column number, error and line fragment with the error. Make spa_json_get_error() fill in the spa_error_location instead. Add some error codes to the error state and use this to add a parsing reason to the location. Add a debug function to log the error location in a nice way. Also add a FILE based debug context to log to any FILE. Replace pw_properties_check_string() with pw_properties_update_string_checked() and add pw_properties_new_string_checked(). The check string behaviour can still be done by setting props to NULL but the main purpose is to be able to avoid parsing the json file twice in the future. When using the old pw_properties_update_string(), log a warning to the log when we fail to parse the complete string. Use the new checked functions and the debug functions to report about parsing errors in the tools and conf parsing. This gives errors like: ``` > pw-loopback --playback-props '{ foo = [ f : g ] }' error: syntax error in --playback-props: Invalid array separator line: 1 | { foo = [ f : g ] } col: 14 | ^ ``` |
||
---|---|---|
.. | ||
data | ||
meson.build | ||
pwtest-compat.c | ||
pwtest-implementation.h | ||
pwtest.c | ||
pwtest.h | ||
test-array.c | ||
test-client.c | ||
test-config.c | ||
test-context.c | ||
test-example.c | ||
test-functional.c | ||
test-lib.c | ||
test-logger.c | ||
test-loop.c | ||
test-map.c | ||
test-properties.c | ||
test-pwtest.c | ||
test-spa-buffer.c | ||
test-spa-json.c | ||
test-spa-log.c | ||
test-spa-node.c | ||
test-spa-pod.c | ||
test-spa-utils.c | ||
test-support.c | ||
test-utils.c |