|Home • About • Community • Download • Documentation • Planet|
[[!format rawhtml """
The module's raw argument string is stored in
The arguments should be given as key-value pairs so that the pairs are separated with whitespace and the key and the value are separated with '='. The value can be enclosed in ticks (') or double quotes (").
Since the arguments are given with the rules specified above, you should parse them using the same rules. Obeying the rules has the additional advantage that you can use ready-made utilities for the parsing task.
I'll walk you through the interface, see pulsecore/modargs.h for the complete but compact reference.
pa_modargs structure's fields are not your concern, so they don't appear in the header file either. (
pa_modargs is currently really a
pa_hashmap, in case you're curious.)
* This returns the arguments split to key-value pairs (at this point the values are just strings). You can use
argument field as the first parameter. The second parameter is a NULL-terminated array of the argument keys your module accepts. If the user gives any argument key is that is unknown,
pa_modargs_new returns NULL, as is the case with generally malformed arguments too.
* I think the comments in the header file are quite sufficient. The functions that return an
int return 0 on success and -1 on failure. Documentation for
pa_channel_map_def_t is available here and for