utils: expose pw_split_ip

This commit is contained in:
Wim Taymans 2022-12-12 16:45:30 +01:00
parent 72f5dbe6a6
commit 87d2719148
3 changed files with 34 additions and 20 deletions

View file

@ -142,26 +142,6 @@ static struct global * obj_global(struct remote_data *rd, uint32_t id);
static int children_of(struct remote_data *rd, uint32_t parent_id,
const char *child_type, uint32_t **children);
static int pw_split_ip(char *str, const char *delimiter, int max_tokens, char *tokens[])
{
const char *state = NULL;
char *s, *t;
size_t len, l2;
int n = 0;
s = (char *)pw_split_walk(str, delimiter, &len, &state);
while (s && n + 1 < max_tokens) {
t = (char*)pw_split_walk(str, delimiter, &l2, &state);
s[len] = '\0';
tokens[n++] = s;
s = t;
len = l2;
}
if (s)
tokens[n++] = s;
return n;
}
static void print_properties(struct spa_dict *props, char mark, bool header)
{
const struct spa_dict_item *item;