PipeWire  0.1.4
properties.h
Go to the documentation of this file.
1 /* PipeWire
2  * Copyright (C) 2015 Wim Taymans <wim.taymans@gmail.com>
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Library General Public
6  * License as published by the Free Software Foundation; either
7  * version 2 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  * Library General Public License for more details.
13  *
14  * You should have received a copy of the GNU Library General Public
15  * License along with this library; if not, write to the
16  * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
17  * Boston, MA 02110-1301, USA.
18  */
19 
20 #ifndef __PIPEWIRE_PROPERTIES_H__
21 #define __PIPEWIRE_PROPERTIES_H__
22 
23 #ifdef __cplusplus
24 //extern "C" {
25 #endif
26 
27 #include <spa/dict.h>
28 
38 struct pw_properties {
39  struct spa_dict dict;
40 };
41 
42 struct pw_properties *
43 pw_properties_new(const char *key, ...);
44 
45 struct pw_properties *
46 pw_properties_new_dict(const struct spa_dict *dict);
47 
48 struct pw_properties *
49 pw_properties_copy(const struct pw_properties *properties);
50 
51 struct pw_properties *
52 pw_properties_merge(const struct pw_properties *oldprops,
53  struct pw_properties *newprops);
54 
55 void
56 pw_properties_free(struct pw_properties *properties);
57 
58 void
59 pw_properties_set(struct pw_properties *properties, const char *key, const char *value);
60 
61 void
62 pw_properties_setf(struct pw_properties *properties,
63  const char *key, const char *format, ...) SPA_PRINTF_FUNC(3, 4);
64 const char *
65 pw_properties_get(const struct pw_properties *properties, const char *key);
66 
67 const char *
68 pw_properties_iterate(const struct pw_properties *properties, void **state);
69 
70 #ifdef __cplusplus
71 }
72 #endif
73 
74 #endif /* __PIPEWIRE_PROPERTIES_H__ */
void pw_properties_free(struct pw_properties *properties)
Free a properties object.
Definition: properties.c:188
A collection of key/value pairs.
Definition: properties.h:38
struct pw_properties * pw_properties_merge(const struct pw_properties *oldprops, struct pw_properties *newprops)
Merge properties into one.
Definition: properties.c:155
void pw_properties_setf(struct pw_properties *properties, const char *key, const char *format,...)
Set a property value by format.
Definition: properties.c:258
struct pw_properties * pw_properties_copy(const struct pw_properties *properties)
Copy a properties object.
Definition: properties.c:128
struct spa_dict dict
Definition: properties.h:39
const char * pw_properties_get(const struct pw_properties *properties, const char *key)
Get a property.
Definition: properties.c:280
void pw_properties_set(struct pw_properties *properties, const char *key, const char *value)
Set a property value.
Definition: properties.c:241
struct pw_properties * pw_properties_new_dict(const struct spa_dict *dict)
Make a new properties object from the given dictionary.
Definition: properties.c:104
const char * pw_properties_iterate(const struct pw_properties *properties, void **state)
Iterate property values.
Definition: properties.c:304
struct pw_properties * pw_properties_new(const char *key,...)
Make a new properties object.
Definition: properties.c:74