PipeWire  0.3.33
properties.c File Reference

Functions

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

Function Documentation

◆ pw_properties_setf()

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, and pw_properties_setva().

◆ pw_properties_setva()

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

References spa_dict_item::value.

Referenced by pw_properties_setf().