add new property list implementation
[pulseaudio.git] / src / pulse / proplist.h
blobf74b3aa1f73cc4f473aad1e9afbc6e5fb77d6161
1 #ifndef foopulseproplisthfoo
2 #define foopulseproplisthfoo
4 /* $Id$ */
6 /***
7 This file is part of PulseAudio.
9 Copyright 2007 Lennart Poettering
11 PulseAudio is free software; you can redistribute it and/or modify
12 it under the terms of the GNU Lesser General Public License as
13 published by the Free Software Foundation; either version 2.1 of the
14 License, or (at your option) any later version.
16 PulseAudio is distributed in the hope that it will be useful, but
17 WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 Lesser General Public License for more details.
21 You should have received a copy of the GNU Lesser General Public
22 License along with PulseAudio; if not, write to the Free Software
23 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
24 USA.
25 ***/
27 #include <pulsecore/macro.h>
29 /* Defined properties:
31 * x11.xid
32 * x11.display
33 * x11.x_pointer
34 * x11.y_pointer
35 * x11.button
36 * media.name
37 * media.title
38 * media.artist
39 * media.language
40 * media.filename
41 * media.icon
42 * media.icon_name
43 * media.role video, music, game, event, phone, production
44 * application.name
45 * application.version
46 * application.icon
47 * application.icon_name
50 #define PA_PROP_X11_XID "x11.xid"
51 #define PA_PROP_X11_DISPLAY "x11.display"
52 #define PA_PROP_X11_X_POINTER "x11.x_pointer"
53 #define PA_PROP_X11_Y_POINTER "x11.y_pointer"
54 #define PA_PROP_X11_BUTTON "x11.button"
55 #define PA_PROP_MEDIA_NAME "media.name"
56 #define PA_PROP_MEDIA_TITLE "media.title"
57 #define PA_PROP_MEDIA_ARTIST "media.artist"
58 #define PA_PROP_MEDIA_LANGUAGE "media.language"
59 #define PA_PROP_MEDIA_FILENAME "media.filename"
60 #define PA_PROP_MEDIA_ICON "media.icon"
61 #define PA_PROP_MEDIA_ICON_NAME "media.icon_name"
62 #define PA_PROP_MEDIA_ROLE "media.role"
63 #define PA_PROP_APPLICATION_NAME "application.name"
64 #define PA_PROP_APPLICATION_VERSION "application.version"
65 #define PA_PROP_APPLICATION_ICON "application.icon"
66 #define PA_PROP_APPLICATION_ICON_NAME "application.icon_name"
68 typedef struct pa_proplist pa_proplist;
70 pa_proplist* pa_proplist_new(void);
71 void pa_proplist_free(pa_proplist* p);
73 /** Will accept only valid UTF-8 */
74 int pa_proplist_puts(pa_proplist *p, const char *key, const char *value);
75 int pa_proplist_put(pa_proplist *p, const char *key, const void *data, size_t nbytes);
77 /* Will return NULL if the data is not valid UTF-8 */
78 const char *pa_proplist_gets(pa_proplist *p, const char *key);
79 int pa_proplist_get(pa_proplist *p, const char *key, const void **data, size_t *nbytes);
81 void pa_proplist_merge(pa_proplist *p, pa_proplist *other);
82 int pa_proplist_remove(pa_proplist *p, const char *key);
84 const char *pa_proplist_iterate(pa_proplist *p, void **state);
86 char *pa_proplist_to_string(pa_proplist *p);
88 #endif