From 4a28b164d162bd99659653f78b057f5d0019f977 Mon Sep 17 00:00:00 2001 From: Georg Chini Date: Tue, 14 Jan 2020 11:31:39 +0100 Subject: [PATCH] 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: --- doxygen/doxygen.conf.in | 1 + man/pactl.1.xml.in | 4 +- shell-completion/bash/pulseaudio | 2 +- shell-completion/zsh/_pulseaudio | 1 + src/Makefile.am | 1 + src/map-file | 2 + src/pulse/introspect.c | 11 ++- src/pulse/introspect.h | 2 +- src/pulse/meson.build | 2 + src/pulse/message-params.c | 118 +++++++++++++++++++++++++++++++ src/pulse/message-params.h | 42 +++++++++++ src/pulsecore/core.c | 2 +- src/pulsecore/message-handler.c | 9 ++- src/pulsecore/message-handler.h | 2 +- src/utils/pactl.c | 66 ++++++++++++++++- 15 files changed, 253 insertions(+), 12 deletions(-) create mode 100644 src/pulse/message-params.c create mode 100644 src/pulse/message-params.h diff --git a/doxygen/doxygen.conf.in b/doxygen/doxygen.conf.in index a97c16543..c32543413 100644 --- a/doxygen/doxygen.conf.in +++ b/doxygen/doxygen.conf.in @@ -683,6 +683,7 @@ INPUT = @top_srcdir@/src/pulse/channelmap.h \ @top_srcdir@/src/pulse/mainloop-api.h \ @top_srcdir@/src/pulse/mainloop-signal.h \ @top_srcdir@/src/pulse/mainloop.h \ + @top_srcdir@/src/pulse/message-params.h \ @top_srcdir@/src/pulse/operation.h \ @top_srcdir@/src/pulse/proplist.h \ @top_srcdir@/src/pulse/pulseaudio.h \ diff --git a/man/pactl.1.xml.in b/man/pactl.1.xml.in index 9f4b7abd3..1f094df42 100644 --- a/man/pactl.1.xml.in +++ b/man/pactl.1.xml.in @@ -80,8 +80,8 @@ License along with PulseAudio; if not, see .