mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-05 13:30:02 -05:00
properties: add generic property bag
Add a structure to hold string key/value pairs. This is basically a thin wrapper around GHashTable with some extra API.
This commit is contained in:
parent
81924afc39
commit
c77d7718a2
4 changed files with 261 additions and 0 deletions
54
src/client/properties.h
Normal file
54
src/client/properties.h
Normal file
|
|
@ -0,0 +1,54 @@
|
|||
/* Pinos
|
||||
* Copyright (C) 2015 Wim Taymans <wim.taymans@gmail.com>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this library; if not, write to the
|
||||
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
|
||||
* Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#ifndef __PINOS_PROPERTIES_H__
|
||||
#define __PINOS_PROPERTIES_H__
|
||||
|
||||
#include <glib.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
typedef struct _PinosProperties PinosProperties;
|
||||
|
||||
#define PINOS_TYPE_PROPERTIES (pinos_properties_get_type())
|
||||
GType pinos_properties_get_type (void);
|
||||
|
||||
PinosProperties * pinos_properties_new (const gchar *key, ...);
|
||||
PinosProperties * pinos_properties_copy (PinosProperties *properties);
|
||||
void pinos_properties_free (PinosProperties *properties);
|
||||
|
||||
void pinos_properties_set (PinosProperties *properties,
|
||||
const gchar *key,
|
||||
const gchar *value);
|
||||
const gchar * pinos_properties_get (PinosProperties *properties,
|
||||
const gchar *key);
|
||||
void pinos_properties_remove (PinosProperties *properties,
|
||||
const gchar *key);
|
||||
|
||||
const gchar * pinos_properties_iterate (PinosProperties *properties,
|
||||
gpointer *state);
|
||||
|
||||
GVariant * pinos_properties_to_variant (PinosProperties *properties);
|
||||
PinosProperties * pinos_properties_from_variant (GVariant *variant);
|
||||
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __PINOS_PROPERTIES_H__ */
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue