PipeWire  0.3.31
properties.c File Reference

Functions

SPA_EXPORT struct pw_propertiespw_properties_new (const char *key,...)
 Make a new properties object. More...
 
SPA_EXPORT struct pw_propertiespw_properties_new_dict (const struct spa_dict *dict)
 Make a new properties object from the given dictionary. More...
 
SPA_EXPORT 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 str. More...
 
SPA_EXPORT struct pw_propertiespw_properties_new_string (const char *object)
 Make a new properties object from the given str. More...
 
SPA_EXPORT struct pw_propertiespw_properties_copy (const struct pw_properties *properties)
 Copy a properties object. More...
 
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. More...
 
SPA_EXPORT int pw_properties_update_ignore (struct pw_properties *props, const struct spa_dict *dict, const char *ignore[])
 
SPA_EXPORT void pw_properties_clear (struct pw_properties *properties)
 Clear a properties object. More...
 
SPA_EXPORT int pw_properties_update (struct pw_properties *props, const struct spa_dict *dict)
 Update properties. More...
 
SPA_EXPORT int pw_properties_add (struct pw_properties *props, const struct spa_dict *dict)
 Add properties. More...
 
SPA_EXPORT int pw_properties_add_keys (struct pw_properties *props, const struct spa_dict *dict, const char *keys[])
 Add keys. More...
 
SPA_EXPORT void pw_properties_free (struct pw_properties *properties)
 Free a properties object. More...
 
SPA_EXPORT int pw_properties_set (struct pw_properties *properties, const char *key, const char *value)
 Set a property value. More...
 
SPA_EXPORT int pw_properties_setva (struct pw_properties *properties, const char *key, const char *format, va_list args)
 
SPA_EXPORT int pw_properties_setf (struct pw_properties *properties, const char *key, const char *format,...)
 Set a property value by format. More...
 
SPA_EXPORT const char * pw_properties_get (const struct pw_properties *properties, const char *key)
 Get a property. More...
 
SPA_EXPORT const char * pw_properties_iterate (const struct pw_properties *properties, void **state)
 Iterate property values. More...
 
SPA_EXPORT int pw_properties_serialize_dict (FILE *f, const struct spa_dict *dict, uint32_t flags)
 

Function Documentation

◆ pw_properties_setf()

SPA_EXPORT int pw_properties_setf ( struct pw_properties properties,
const char *  key,
const char *  format,
  ... 
)

Set a property value by format.

Parameters
propertiesa Key-Value pairs
keya key
formata value
...extra arguments
Returns
1 if the property was changed. 0 if nothing was changed because the property already existed with the same value or because the key to remove did not exist.

Set the property in properties with key to the value in printf style format Any previous value of key will be overwritten.

References spa_dict_item::key, pw_properties_setva(), res, va_end(), and va_start().

◆ pw_properties_setva()

SPA_EXPORT int pw_properties_setva ( struct pw_properties properties,
const char *  key,
const char *  format,
va_list  args 
)

References args, and spa_dict_item::value.

Referenced by pw_properties_setf().