+/** The lopsub user_data pointer. Only the command handler at the moment. */
+struct audiod_command_info {
+ audiod_cmd_handler_t handler; /**< Implementation of the command. */
+};
+
+/** Define the user_data pointer as expected by lopsub. */
+#define EXPORT_AUDIOD_CMD_HANDLER(_cmd) \
+ /** Implementation of _cmd. */ \
+ const struct audiod_command_info lsg_audiod_cmd_com_ ## _cmd ## _user_data = { \
+ .handler = com_ ## _cmd \
+ };
+
+/** Flags used for the stat command of para_audiod. */
+enum stat_client_flags {
+ /** Enable parser-friendly output. */
+ SCF_PARSER_FRIENDLY = 1,
+};
+
+/**
+ * Describes a status client of para_audiod.
+ *
+ * There's one such structure per audiod client that sent the 'stat' command.
+ *
+ * A status client is identified by its file descriptor. para_audiod
+ * keeps a list of connected status clients.
+ */
+struct stat_client {
+ /** The stat client's file descriptor. */
+ int fd;
+ /** Bitmask of those status items the client is interested in. */
+ uint64_t item_mask;
+ /** See \ref stat_client flags. */
+ unsigned flags;
+ /** Its entry in the list of stat clients. */
+ struct list_head node;
+};
+
+static INITIALIZED_LIST_HEAD(client_list);
+static int num_clients;
+
+/** The list of all status items used by para_{server,audiod,gui}. */
+const char *status_item_list[] = {STATUS_ITEM_ARRAY};
+
+static void dump_stat_client_list(void)