[pulseaudio-discuss] [PATCH v6 04/37] raop: Add pulsecore/core-utils a pa_str_in_list function

Arun Raghavan arun at accosted.net
Wed Feb 10 03:34:27 UTC 2016


On 10-Feb-2016 8:59 AM, "Hajime Fujita" <crisp.fujita at nifty.com> wrote:
>
> Arun Raghavan wrote:
> > On Sun, 2016-01-31 at 22:16 -0600, Hajime Fujita wrote:
> >> From: Martin Blanchard <tinram at gmx.fr>
> >>
> >> ---
> >>  src/pulsecore/core-util.c | 20 ++++++++++++++++++++
> >>  src/pulsecore/core-util.h |  5 +++--
> >>  2 files changed, 23 insertions(+), 2 deletions(-)
> >>
> >> diff --git a/src/pulsecore/core-util.c b/src/pulsecore/core-util.c
> >> index 19c89a9..9fd4301 100644
> >> --- a/src/pulsecore/core-util.c
> >> +++ b/src/pulsecore/core-util.c
> >> @@ -2977,6 +2977,26 @@ bool pa_in_system_mode(void) {
> >>      return !!atoi(e);
> >>  }
> >>
> >> +/* Checks a delimiters-separated list of words in haystack for needle
*/
> >> +bool pa_str_in_list(const char *haystack, const char *delimiters,
const char *needle) {
> >> +    char *s;
> >> +    const char *state = NULL;
> >> +
> >> +    if (!haystack || !needle)
> >> +        return false;
> >> +
> >> +    while ((s = pa_split(haystack, delimiters, &state))) {
> >
> > Would be nicer to use pa_split_in_place() here.
>
> Sure. Actually there is another function pa_str_in_list_spaces() right
after this, which has almost the same structure including use of pa_split.
I think pa_str_in_list() was written based on pa_str_in_list_spaces().
>
> Do you also want to modify pa_str_in_list_spaces() so it uses
pa_split_in_places()? Perhaps in a separate commit.
>

Yep, that would be great, and should be in a different commit.

-- Arun
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/pulseaudio-discuss/attachments/20160210/369cb001/attachment.html>


More information about the pulseaudio-discuss mailing list