ngfd-plugin
proplist.h
Go to the documentation of this file.
1/*
2 * ngfd - Non-graphic feedback daemon
3 *
4 * Copyright (C) 2010 Nokia Corporation.
5 * Contact: Xun Chen <xun.chen@nokia.com>
6 *
7 * This work is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
11 *
12 * This work is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this work; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 */
21
22#ifndef N_PROPLIST_H
23#define N_PROPLIST_H
24
26typedef struct _NProplist NProplist;
27
28#include <ngf/value.h>
29
35typedef void (*NProplistFunc) (const char *key, const NValue *value, gpointer userdata);
36
41
47
53NProplist* n_proplist_copy_keys (const NProplist *source, GList *keys);
54
59void n_proplist_merge (NProplist *target, const NProplist *source);
60
66void n_proplist_merge_keys (NProplist *target, const NProplist *source, GList *keys);
67
71void n_proplist_free (NProplist *proplist);
72
77int n_proplist_size (const NProplist *proplist);
78
84void n_proplist_foreach (const NProplist *proplist, NProplistFunc func, gpointer userdata);
85
90gboolean n_proplist_is_empty (const NProplist *proplist);
91
97gboolean n_proplist_has_key (const NProplist *proplist, const char *key);
98
104gboolean n_proplist_match_exact (const NProplist *a, const NProplist *b);
105
111void n_proplist_set (NProplist *proplist, const char *key, NValue *value);
112
118NValue* n_proplist_get (const NProplist *proplist, const char *key);
119
120/* helpers */
121
126void n_proplist_unset (NProplist *proplist, const char *key);
127
133void n_proplist_set_string (NProplist *proplist, const char *key, const char *value);
134
140const char* n_proplist_get_string (const NProplist *proplist, const char *key);
141
147gchar* n_proplist_dup_string (const NProplist *proplist, const char *key);
148
154void n_proplist_set_int (NProplist *proplist, const char *key, gint value);
155
161gint n_proplist_get_int (const NProplist *proplist, const char *key);
162
168void n_proplist_set_uint (NProplist *proplist, const char *key, guint value);
169
175guint n_proplist_get_uint (const NProplist *proplist, const char *key);
176
182void n_proplist_set_bool (NProplist *proplist, const char *key, gboolean value);
183
189gboolean n_proplist_get_bool (const NProplist *proplist, const char *key);
190
196void n_proplist_set_pointer (NProplist *proplist, const char *key, gpointer value);
197
203gpointer n_proplist_get_pointer (const NProplist *proplist, const char *key);
204
209void n_proplist_dump (const NProplist *proplist);
210
211#endif /* N_PROPLIST_H */
NProplist * n_proplist_copy(const NProplist *source)
Create copy of existing proplist.
struct _NProplist NProplist
Internal proplist structure.
Definition proplist.h:26
gboolean n_proplist_has_key(const NProplist *proplist, const char *key)
Check if the proplist has key.
gboolean n_proplist_get_bool(const NProplist *proplist, const char *key)
Get boolean value from proplist.
guint n_proplist_get_uint(const NProplist *proplist, const char *key)
Get uint value from proplist.
NProplist * n_proplist_copy_keys(const NProplist *source, GList *keys)
Create copy of existing proplist, copying only selected keys.
void n_proplist_dump(const NProplist *proplist)
Dump contents of proplist to debug log.
const char * n_proplist_get_string(const NProplist *proplist, const char *key)
Get string value from proplist.
void n_proplist_unset(NProplist *proplist, const char *key)
Remove key from proplist.
void n_proplist_set_string(NProplist *proplist, const char *key, const char *value)
Set or update string value in proplist.
NProplist * n_proplist_new()
Initializes new proplist.
void n_proplist_merge(NProplist *target, const NProplist *source)
Merge two proplists.
gpointer n_proplist_get_pointer(const NProplist *proplist, const char *key)
Get pointer value from proplist.
gboolean n_proplist_match_exact(const NProplist *a, const NProplist *b)
Check if two proplists are identical.
void n_proplist_set_pointer(NProplist *proplist, const char *key, gpointer value)
Set or update pointer value in proplist.
gint n_proplist_get_int(const NProplist *proplist, const char *key)
Get int value from proplist.
gboolean n_proplist_is_empty(const NProplist *proplist)
Check if the proplist is empty.
NValue * n_proplist_get(const NProplist *proplist, const char *key)
Get value from proplist.
void n_proplist_set_int(NProplist *proplist, const char *key, gint value)
Set or update int value in proplist.
void(* NProplistFunc)(const char *key, const NValue *value, gpointer userdata)
Proplist manipulation function definition.
Definition proplist.h:35
void n_proplist_merge_keys(NProplist *target, const NProplist *source, GList *keys)
Merge only selected keys on proplists.
void n_proplist_set_uint(NProplist *proplist, const char *key, guint value)
Set or update uint value in proplist.
gchar * n_proplist_dup_string(const NProplist *proplist, const char *key)
Get duplicate of string value from proplist.
void n_proplist_foreach(const NProplist *proplist, NProplistFunc func, gpointer userdata)
Run function on each key in the proplist.
int n_proplist_size(const NProplist *proplist)
Return number of keys in the proplist.
void n_proplist_free(NProplist *proplist)
Free proplist.
void n_proplist_set_bool(NProplist *proplist, const char *key, gboolean value)
Set or update boolean value in proplist.
void n_proplist_set(NProplist *proplist, const char *key, NValue *value)
Insert or update key/value pair in proplist.
struct _NValue NValue
Internal NValue structure.
Definition value.h:44