mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-02 09:01:50 -05:00
utils: expose pw_split_ip
This commit is contained in:
parent
72f5dbe6a6
commit
87d2719148
3 changed files with 34 additions and 20 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue