modargs: Add a mechanism to append modargs

This allows us to parse an extra set of modargs to tack on to an
existing set. Duplicates in the second set are ignored, since this fits
our use best. In the future, this could be extended to support different
merge modes (ignore dupes vs. replace with dupes), but I've left this
out since there isn't a clear need and it would be dead code for now.
This commit is contained in:
Arun Raghavan 2016-05-03 18:26:51 +05:30 committed by Arun Raghavan
parent b793f68f2e
commit 06fbdcaa3e
2 changed files with 38 additions and 18 deletions

View file

@ -34,6 +34,8 @@ typedef struct pa_modargs pa_modargs;
/* Parse the string args. The NULL-terminated array keys contains all valid arguments. */
pa_modargs *pa_modargs_new(const char *args, const char* const keys[]);
/* Parse the string args, and add any keys that are not already present. */
int pa_modargs_append(pa_modargs *ma, const char *args, const char* const* valid_keys);
void pa_modargs_free(pa_modargs*ma);
/* Return the module argument for the specified name as a string. If