25 #ifndef PIPEWIRE_PROPERTIES_H
26 #define PIPEWIRE_PROPERTIES_H
34 #include <spa/utils/dict.h>
70 const
char *str,
size_t size);
87 const
char *key, const
char *format, ...) SPA_PRINTF_FUNC(3, 4);
90 const
char *key, const
char *format, va_list
args) SPA_PRINTF_FUNC(3,0);
99 static inline
bool pw_properties_parse_bool(const
char *value) {
100 return (strcmp(value,
"true") == 0 || atoi(value) == 1);
103 static inline int pw_properties_parse_int(
const char *value) {
104 return strtol(value, NULL, 0);
107 static inline int64_t pw_properties_parse_int64(
const char *value) {
108 return strtoll(value, NULL, 0);
111 static inline uint64_t pw_properties_parse_uint64(
const char *value) {
112 return strtoull(value, NULL, 0);
115 static inline float pw_properties_parse_float(
const char *value) {
116 return strtof(value, NULL);
119 static inline double pw_properties_parse_double(
const char *value) {
120 return strtod(value, NULL);
static uint32_t int int const char va_list args
Definition: core.h:327
int pw_properties_update_string(struct pw_properties *props, const char *str, size_t size)
Definition: properties.c:150
int pw_properties_update_ignore(struct pw_properties *props, const struct spa_dict *dict, const char *ignore[])
Definition: properties.c:263
int int pw_properties_setva(struct pw_properties *properties, const char *key, const char *format, va_list args) SPA_PRINTF_FUNC(3
int pw_properties_serialize_dict(FILE *f, const struct spa_dict *dict, uint32_t flags)
Definition: properties.c:546
A collection of key/value pairs.
Definition: properties.h:45
SPA_EXPORT int pw_properties_add(struct pw_properties *props, const struct spa_dict *dict)
Add properties.
Definition: properties.c:329
SPA_EXPORT int pw_properties_update(struct pw_properties *props, const struct spa_dict *dict)
Update properties.
Definition: properties.c:306
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:130
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:479
SPA_EXPORT int pw_properties_set(struct pw_properties *properties, const char *key, const char *value)
Set a property value.
Definition: properties.c:446
SPA_EXPORT void pw_properties_free(struct pw_properties *properties)
Free a properties object.
Definition: properties.c:378
SPA_EXPORT struct pw_properties * pw_properties_copy(const struct pw_properties *properties)
Copy a properties object.
Definition: properties.c:224
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:239
struct spa_dict dict
dictionary of key/values
Definition: properties.h:46
SPA_EXPORT int pw_properties_add_keys(struct pw_properties *props, const struct spa_dict *dict, const char *keys[])
Add keys.
Definition: properties.c:355
SPA_EXPORT void pw_properties_clear(struct pw_properties *properties)
Clear a properties object.
Definition: properties.c:283
uint32_t flags
extra flags
Definition: properties.h:47
SPA_EXPORT struct pw_properties * pw_properties_new_string(const char *object)
Make a new properties object from the given str.
Definition: properties.c:197
SPA_EXPORT const char * pw_properties_iterate(const struct pw_properties *properties, void **state)
Iterate property values.
Definition: properties.c:527
SPA_EXPORT struct pw_properties * pw_properties_new(const char *key,...)
Make a new properties object.
Definition: properties.c:100
SPA_EXPORT const char * pw_properties_get(const struct pw_properties *properties, const char *key)
Get a property.
Definition: properties.c:502
Update client properties.