ngfd-plugin: /build/ngfd/src/ngfd-1.4.1/src/include/ngf/proplist.h Source File

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
26 typedef struct _NProplist NProplist;
27
28#include <ngf/value.h>
29
35 typedef void (*NProplistFunc) (const char *key, const NValue *value, gpointer userdata);
36
40 NProplist* n_proplist_new ();
41
46 NProplist* n_proplist_copy (const NProplist *source);
47
53 NProplist* n_proplist_copy_keys (const NProplist *source, GList *keys);
54
59 void n_proplist_merge (NProplist *target, const NProplist *source);
60
66 void n_proplist_merge_keys (NProplist *target, const NProplist *source, GList *keys);
67
71 void n_proplist_free (NProplist *proplist);
72
77 int n_proplist_size (const NProplist *proplist);
78
84 void 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
111 void n_proplist_set (NProplist *proplist, const char *key, const NValue *value);
112
118 NValue* n_proplist_get (const NProplist *proplist, const char *key);
119
120/* helpers */
121
126 void n_proplist_unset (NProplist *proplist, const char *key);
127
133 void n_proplist_set_string (NProplist *proplist, const char *key, const char *value);
134
140 const char* n_proplist_get_string (const NProplist *proplist, const char *key);
141
147gchar* n_proplist_dup_string (const NProplist *proplist, const char *key);
148
154 void n_proplist_set_int (NProplist *proplist, const char *key, gint value);
155
161gint n_proplist_get_int (const NProplist *proplist, const char *key);
162
168 void n_proplist_set_uint (NProplist *proplist, const char *key, guint value);
169
175guint n_proplist_get_uint (const NProplist *proplist, const char *key);
176
182 void n_proplist_set_bool (NProplist *proplist, const char *key, gboolean value);
183
189gboolean n_proplist_get_bool (const NProplist *proplist, const char *key);
190
196 void n_proplist_set_pointer (NProplist *proplist, const char *key, gpointer value);
197
203gpointer n_proplist_get_pointer (const NProplist *proplist, const char *key);
204
209 void n_proplist_dump (const NProplist *proplist);
210
211#endif /* N_PROPLIST_H */
n_proplist_copy
NProplist * n_proplist_copy(const NProplist *source)
Create copy of existing proplist.
NProplist
struct _NProplist NProplist
Internal proplist structure.
Definition proplist.h:26
n_proplist_has_key
gboolean n_proplist_has_key(const NProplist *proplist, const char *key)
Check if the proplist has key.
n_proplist_get_bool
gboolean n_proplist_get_bool(const NProplist *proplist, const char *key)
Get boolean value from proplist.
n_proplist_get_uint
guint n_proplist_get_uint(const NProplist *proplist, const char *key)
Get uint value from proplist.
n_proplist_copy_keys
NProplist * n_proplist_copy_keys(const NProplist *source, GList *keys)
Create copy of existing proplist, copying only selected keys.
n_proplist_dump
void n_proplist_dump(const NProplist *proplist)
Dump contents of proplist to debug log.
n_proplist_get_string
const char * n_proplist_get_string(const NProplist *proplist, const char *key)
Get string value from proplist.
n_proplist_unset
void n_proplist_unset(NProplist *proplist, const char *key)
Remove key from proplist.
n_proplist_set_string
void n_proplist_set_string(NProplist *proplist, const char *key, const char *value)
Set or update string value in proplist.
n_proplist_new
NProplist * n_proplist_new()
Initializes new proplist.
n_proplist_merge
void n_proplist_merge(NProplist *target, const NProplist *source)
Merge two proplists.
n_proplist_get_pointer
gpointer n_proplist_get_pointer(const NProplist *proplist, const char *key)
Get pointer value from proplist.
n_proplist_match_exact
gboolean n_proplist_match_exact(const NProplist *a, const NProplist *b)
Check if two proplists are identical.
n_proplist_set_pointer
void n_proplist_set_pointer(NProplist *proplist, const char *key, gpointer value)
Set or update pointer value in proplist.
n_proplist_get_int
gint n_proplist_get_int(const NProplist *proplist, const char *key)
Get int value from proplist.
n_proplist_is_empty
gboolean n_proplist_is_empty(const NProplist *proplist)
Check if the proplist is empty.
n_proplist_get
NValue * n_proplist_get(const NProplist *proplist, const char *key)
Get value from proplist.
n_proplist_set_int
void n_proplist_set_int(NProplist *proplist, const char *key, gint value)
Set or update int value in proplist.
NProplistFunc
void(* NProplistFunc)(const char *key, const NValue *value, gpointer userdata)
Proplist manipulation function definition.
Definition proplist.h:35
n_proplist_merge_keys
void n_proplist_merge_keys(NProplist *target, const NProplist *source, GList *keys)
Merge only selected keys on proplists.
n_proplist_set
void n_proplist_set(NProplist *proplist, const char *key, const NValue *value)
Insert or update key/value pair in proplist.
n_proplist_set_uint
void n_proplist_set_uint(NProplist *proplist, const char *key, guint value)
Set or update uint value in proplist.
n_proplist_dup_string
gchar * n_proplist_dup_string(const NProplist *proplist, const char *key)
Get duplicate of string value from proplist.
n_proplist_foreach
void n_proplist_foreach(const NProplist *proplist, NProplistFunc func, gpointer userdata)
Run function on each key in the proplist.
n_proplist_size
int n_proplist_size(const NProplist *proplist)
Return number of keys in the proplist.
n_proplist_free
void n_proplist_free(NProplist *proplist)
Free proplist.
n_proplist_set_bool
void n_proplist_set_bool(NProplist *proplist, const char *key, gboolean value)
Set or update boolean value in proplist.
value.h
NValue
struct _NValue NValue
Internal NValue structure.
Definition value.h:44