pulse-server: improve module argument checking

Make the module valid_args a structure that includes the argument key,
description and some flags. Use this to enforce mandatory properties
in a more central place.

We should be able to generate the module usage from this as wel later to
have things a bit more structured.
This commit is contained in:
Wim Taymans 2026-05-13 10:21:19 +02:00
parent a5a3eaf2cb
commit e5ff44910e
9 changed files with 122 additions and 68 deletions

View file

@ -17,6 +17,13 @@ struct client;
struct message;
struct extension;
struct module_args {
const char *key;
const char *description;
#define MODULE_ARG_MANDATORY (1u<<0)
uint32_t flags;
};
struct module_info {
const char *name;
@ -27,7 +34,7 @@ struct module_info {
int (*unload) (struct module *module);
const struct extension *extension;
const char* const *valid_args;
const struct module_args *valid_args;
const struct spa_dict *properties;
size_t data_size;
};