20 #ifndef __PIPEWIRE_UTILS_H__ 21 #define __PIPEWIRE_UTILS_H__ 28 #include <spa/pod-utils.h> 39 pw_split_walk(
const char *str,
const char *delimiter,
size_t *len,
const char **state);
42 pw_split_strv(
const char *str,
const char *delimiter,
int max_tokens,
int *n_tokens);
48 pw_strip(
char *str,
const char *whitespace);
51 static inline struct spa_pod *
54 return pod ? memcpy(malloc(SPA_POD_SIZE(pod)), pod, SPA_POD_SIZE(pod)) : NULL;
57 #define spa_format_copy(f) ((struct spa_format*)pw_spa_pod_copy(&(f)->pod)) 58 #define spa_props_copy(p) ((struct spa_prop*)pw_spa_pod_copy(&(p)->object.pod)) 59 #define spa_param_copy(p) ((struct spa_param*)pw_spa_pod_copy(&(p)->object.pod)) void(* pw_destroy_t)(void *object)
a function to destroy an item
Definition: utils.h:36
const char * pw_split_walk(const char *str, const char *delimiter, size_t *len, const char **state)
Split a string based on delimiters.
Definition: utils.c:39
static struct spa_pod * pw_spa_pod_copy(const struct spa_pod *pod)
Copy a pod structure.
Definition: utils.h:52
char ** pw_split_strv(const char *str, const char *delimiter, int max_tokens, int *n_tokens)
Split a string based on delimiters.
Definition: utils.c:64
char * pw_strip(char *str, const char *whitespace)
Strip all whitespace before and after a string.
Definition: utils.c:115
void pw_free_strv(char **str)
Free a NULL terminated array of strings.
Definition: utils.c:97