pactl: Implement list message-handlers

For better readability, "pactl list message-handlers" is introduced which
prints a formatted output of "pactl send-message /core list-handlers".

The patch also adds the functions pa_message_params_read_raw() and
pa_message_params_read_string() for easy parsing of the message response
string. Because the functions need to modify the parameter string,
the message handler and the pa_context_string_callback function now
receive a char* instead of a const char* as parameter argument.

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/51>
This commit is contained in:
Georg Chini 2020-01-14 11:31:39 +01:00 committed by Tanu Kaskinen
parent 5c0ab52145
commit 4a28b164d1
15 changed files with 253 additions and 12 deletions

View file

@ -86,7 +86,7 @@ static char *message_handler_list(pa_core *c) {
return pa_strbuf_to_string_free(buf);
}
static int core_message_handler(const char *object_path, const char *message, const char *message_parameters, char **response, void *userdata) {
static int core_message_handler(const char *object_path, const char *message, char *message_parameters, char **response, void *userdata) {
pa_core *c;
pa_assert(c = (pa_core *) userdata);