Go to the documentation of this file.
25 #ifndef PIPEWIRE_PROPERTIES_H
26 #define PIPEWIRE_PROPERTIES_H
34 #include <spa/utils/dict.h>
63 const struct spa_dict *
dict, const
char *keys[]);
66 const struct spa_dict *
dict);
69 const struct spa_dict *
dict);
71 const struct spa_dict *
dict, const
char *keys[]);
83 const
char *key, const
char *format, ...) SPA_PRINTF_FUNC(3, 4);
86 const
char *key, const
char *format, va_list
args) SPA_PRINTF_FUNC(3,0);
93 static inline
bool pw_properties_parse_bool(const
char *value) {
94 return (strcmp(value,
"true") == 0 || atoi(value) == 1);
97 static inline int pw_properties_parse_int(
const char *value) {
98 return strtol(value, NULL, 0);
101 static inline int64_t pw_properties_parse_int64(
const char *value) {
102 return strtoll(value, NULL, 0);
105 static inline uint64_t pw_properties_parse_uint64(
const char *value) {
106 return strtoull(value, NULL, 0);
109 static inline float pw_properties_parse_float(
const char *value) {
110 return strtof(value, NULL);
113 static inline double pw_properties_parse_double(
const char *value) {
114 return strtod(value, NULL);
static uint32_t int int res
Definition: core.h:326
uint32_t flags
extra flags
Definition: properties.h:47
const SPA_EXPORT 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:45
#define pw_array_for_each(pos, array)
Definition: array.h:67
SPA_EXPORT struct pw_properties * pw_properties_new_string(const char *str)
Make a new properties object from the given str.
Definition: properties.c:159
struct spa_dict dict
dictionary of key/values
Definition: properties.h:46
An array object.
Definition: array.h:43
SPA_EXPORT int pw_properties_setf(struct pw_properties *properties, const char *key, const char *format,...)
Set a property value by format.
Definition: properties.c:433
static int pw_array_ensure_size(struct pw_array *arr, size_t size)
Make sure size bytes can be added to the array.
Definition: array.h:105
SPA_EXPORT struct pw_properties * pw_properties_new_dict(const struct spa_dict *dict)
Make a new properties object from the given dictionary.
Definition: properties.c:128
SPA_EXPORT int pw_properties_update(struct pw_properties *props, const struct spa_dict *dict)
Update properties.
Definition: properties.c:263
const SPA_EXPORT char * pw_properties_get(const struct pw_properties *properties, const char *key)
Get a property.
Definition: properties.c:456
static uint32_t int int const char va_list args
Definition: core.h:327
static void * pw_array_add(struct pw_array *arr, size_t size)
Add ref size bytes to arr.
Definition: array.h:127
#define pw_array_get_len(a, t)
Get the number of items of type t in array.
Definition: array.h:57
SPA_EXPORT struct pw_properties * pw_properties_copy(const struct pw_properties *properties)
Copy a properties object.
Definition: properties.c:205
SPA_EXPORT int pw_properties_set(struct pw_properties *properties, const char *key, const char *value)
Set a property value.
Definition: properties.c:400
const SPA_EXPORT char * pw_properties_iterate(const struct pw_properties *properties, void **state)
Iterate property values.
Definition: properties.c:481
SPA_EXPORT void pw_properties_clear(struct pw_properties *properties)
Clear a properties object.
Definition: properties.c:240
#define pw_array_get_unchecked(a, idx, t)
Get the item with index idx and type t from array.
Definition: array.h:59
SPA_EXPORT int pw_properties_add(struct pw_properties *props, const struct spa_dict *dict)
Add properties.
Definition: properties.c:286
struct pw_control this
Definition: control.c:34
SPA_EXPORT struct pw_properties * pw_properties_new(const char *key,...)
Make a new properties object.
Definition: properties.c:98
#define pw_array_check_index(a, idx, t)
Check if an item with index idx and type t exist in array.
Definition: array.h:61
SPA_EXPORT int pw_properties_add_keys(struct pw_properties *props, const struct spa_dict *dict, const char *keys[])
Add keys.
Definition: properties.c:312
SPA_EXPORT int pw_properties_update_keys(struct pw_properties *props, const struct spa_dict *dict, const char *keys[])
Copy multiple keys from one property to another.
Definition: properties.c:220
A collection of key/value pairs.
Definition: properties.h:45
SPA_EXPORT void pw_properties_free(struct pw_properties *properties)
Free a properties object.
Definition: properties.c:335
int int pw_properties_setva(struct pw_properties *properties, const char *key, const char *format, va_list args) SPA_PRINTF_FUNC(3
SPA_EXPORT int pw_properties_setva(struct pw_properties *properties, const char *key, const char *format, va_list args)
Definition: properties.c:406
static void pw_array_init(struct pw_array *arr, size_t extend)
Initialize the array with given extend.
Definition: array.h:85