ngfd-plugin
value.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_VALUE_H
23#define N_VALUE_H
24
25#include <glib.h>
26
27#define N_VALUE_STR_STRING "(string)"
28#define N_VALUE_STR_INT "(int)"
29#define N_VALUE_STR_UINT "(uint)"
30#define N_VALUE_STR_BOOL "(bool)"
31#define N_VALUE_STR_POINTER "(pointer)"
32
42
44typedef struct _NValue NValue;
45
50
54void n_value_free (NValue *value);
55
59void n_value_init (NValue *value);
60
64void n_value_clean (NValue *value);
65
70NValue* n_value_copy (const NValue *value);
71
77int n_value_type (const NValue *value);
78
84gboolean n_value_equals (const NValue *a, const NValue *b);
85
90void n_value_set_string (NValue *value, const char *in_value);
91
96const gchar* n_value_get_string (const NValue *value);
97
102gchar* n_value_dup_string (const NValue *value);
103
108void n_value_set_int (NValue *value, const gint in_value);
109
114gint n_value_get_int (const NValue *value);
115
120void n_value_set_uint (NValue *value, const guint in_value);
121
126guint n_value_get_uint (const NValue *value);
127
132void n_value_set_bool (NValue *value, const gboolean in_value);
133
138gboolean n_value_get_bool (const NValue *value);
139
144void n_value_set_pointer (NValue *value, const gpointer in_value);
145
150gpointer n_value_get_pointer (const NValue *value);
151
156gchar* n_value_to_string (const NValue *value);
157
158#endif /* N_VALUE_H */
void n_value_set_string(NValue *value, const char *in_value)
Set string value to NValue.
void n_value_free(NValue *value)
Free NValue.
void n_value_set_pointer(NValue *value, const gpointer in_value)
Set pointer to NValue.
NValue * n_value_copy(const NValue *value)
Copy NValue.
guint n_value_get_uint(const NValue *value)
Get uint value from NValue.
gint n_value_get_int(const NValue *value)
Get int value from NValue.
struct _NValue NValue
Internal NValue structure.
Definition value.h:44
gchar * n_value_to_string(const NValue *value)
Return string representation of contents.
int n_value_type(const NValue *value)
Return type of contents of NValue.
void n_value_set_uint(NValue *value, const guint in_value)
Set uint value to NValue.
gboolean n_value_get_bool(const NValue *value)
Get boolean value from NValue.
const gchar * n_value_get_string(const NValue *value)
Get string value from NValue.
gchar * n_value_dup_string(const NValue *value)
Return copy of string from NValue.
void n_value_init(NValue *value)
Re-init NValue.
NValue * n_value_new()
Return new NValue.
NValueType
NValue type enum.
Definition value.h:35
@ N_VALUE_TYPE_INT
Definition value.h:37
@ N_VALUE_TYPE_BOOL
Definition value.h:39
@ N_VALUE_TYPE_POINTER
Definition value.h:40
@ N_VALUE_TYPE_STRING
Definition value.h:36
@ N_VALUE_TYPE_UINT
Definition value.h:38
void n_value_set_int(NValue *value, const gint in_value)
Set int value to NValue.
void n_value_clean(NValue *value)
Clean NValue.
void n_value_set_bool(NValue *value, const gboolean in_value)
Set boolean value to NValue.
gboolean n_value_equals(const NValue *a, const NValue *b)
Compare two NValues.
gpointer n_value_get_pointer(const NValue *value)
Get pointer from NValue.