25 #ifndef PIPEWIRE_PROPERTIES_H
26 #define PIPEWIRE_PROPERTIES_H
76 const
char *str,
size_t size);
105 static inline
bool pw_properties_parse_bool(const
char *value) {
109 static inline int pw_properties_parse_int(
const char *value) {
114 static inline int64_t pw_properties_parse_int64(
const char *value) {
119 static inline uint64_t pw_properties_parse_uint64(
const char *value) {
124 static inline float pw_properties_parse_float(
const char *value) {
126 return spa_atof(value, &v) ? v : 0.0f;
129 static inline double pw_properties_parse_double(
const char *value) {
131 return spa_atod(value, &v) ? v : 0.0;
static uint32_t int int const char va_list args
Definition: core.h:330
int pw_properties_update_string(struct pw_properties *props, const char *str, size_t size)
Update the properties from the given string, overwriting any existing keys with the new values from s...
Definition: properties.c:158
int pw_properties_update_ignore(struct pw_properties *props, const struct spa_dict *dict, const char *ignore[])
Definition: properties.c:271
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:597
bool spa_atoi32(const char *str, int32_t *val, int base)
Convert str to an int32_t with the given base and store the result in val.
Definition: string.h:73
bool spa_atod(const char *str, double *val)
Convert str to a double and store the result in val.
Definition: string.h:257
bool spa_atof(const char *str, float *val)
Convert str to a float and store the result in val.
Definition: string.h:233
#define SPA_PRINTF_FUNC(fmt, arg1)
Definition: defs.h:204
bool spa_atob(const char *str)
Convert str to a boolean.
Definition: string.h:177
#define SPA_SENTINEL
Definition: defs.h:208
bool spa_atou64(const char *str, uint64_t *val, int base)
Convert str to an uint64_t with the given base and store the result in val.
Definition: string.h:154
bool spa_atoi64(const char *str, int64_t *val, int base)
Convert str to an int64_t with the given base and store the result in val.
Definition: string.h:129
Definition: properties.h:49
SPA_EXPORT int pw_properties_add(struct pw_properties *props, const struct spa_dict *dict)
Add properties.
Definition: properties.c:337
SPA_EXPORT int pw_properties_update(struct pw_properties *props, const struct spa_dict *dict)
Update properties.
Definition: properties.c:314
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:492
SPA_EXPORT int pw_properties_set(struct pw_properties *properties, const char *key, const char *value)
Set a property value.
Definition: properties.c:459
SPA_EXPORT void pw_properties_free(struct pw_properties *properties)
Free a properties object.
Definition: properties.c:386
SPA_EXPORT struct pw_properties * pw_properties_copy(const struct pw_properties *properties)
Copy a properties object.
Definition: properties.c:232
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:247
struct spa_dict dict
dictionary of key/values
Definition: properties.h:50
SPA_EXPORT int pw_properties_add_keys(struct pw_properties *props, const struct spa_dict *dict, const char *keys[])
Add keys.
Definition: properties.c:363
SPA_EXPORT void pw_properties_clear(struct pw_properties *properties)
Clear a properties object.
Definition: properties.c:291
uint32_t flags
extra flags
Definition: properties.h:51
SPA_EXPORT struct pw_properties * pw_properties_new_string(const char *object)
Make a new properties object from the given str.
Definition: properties.c:205
SPA_EXPORT const char * pw_properties_iterate(const struct pw_properties *properties, void **state)
Iterate property values.
Definition: properties.c:540
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:515
Definition: utils/dict.h:48