]> code.delx.au - pulseaudio/blob - polyp/props.h
954d2540489ca10015bae28a395e3944c7bb4c57
[pulseaudio] / polyp / props.h
1 #ifndef foopropshfoo
2 #define foopropshfoo
3
4 /* $Id$ */
5
6 /***
7 This file is part of polypaudio.
8
9 polypaudio is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published
11 by the Free Software Foundation; either version 2 of the License,
12 or (at your option) any later version.
13
14 polypaudio is distributed in the hope that it will be useful, but
15 WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 General Public License for more details.
18
19 You should have received a copy of the GNU General Public License
20 along with polypaudio; if not, write to the Free Software
21 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
22 USA.
23 ***/
24
25 #include "core.h"
26 #include "strbuf.h"
27
28 /* The property subsystem is to be used to share data between
29 * modules. Consider them to be kind of "global" variables for a
30 * core. Why not use the hashmap functions directly? The hashmap
31 * functions copy neither the key nor value, while this property
32 * system copies the key. Users of this system have to think about
33 * reference counting themselves. */
34
35 /* Return a pointer to the value of the specified property. */
36 void* pa_property_get(struct pa_core *c, const char *name);
37
38 /* Set the property 'name' to 'data'. This function fails in case a
39 * property by this name already exists. The property data is not
40 * copied or reference counted. This is the caller's job. */
41 int pa_property_set(struct pa_core *c, const char *name, void *data);
42
43 /* Remove the specified property. Return non-zero on failure */
44 int pa_property_remove(struct pa_core *c, const char *name);
45
46 /* A combination of pa_property_remove() and pa_property_set() */
47 int pa_property_replace(struct pa_core *c, const char *name, void *data);
48
49 /* Free all memory used by the property system */
50 void pa_property_cleanup(struct pa_core *c);
51
52 /* Initialize the properties subsystem */
53 void pa_property_init(struct pa_core *c);
54
55 /* Dump the current set of properties */
56 void pa_property_dump(struct pa_core *c, struct pa_strbuf *s);
57
58 #endif