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

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
34 typedef enum
35{
36 N_VALUE_TYPE_STRING = 1,
37 N_VALUE_TYPE_INT,
38 N_VALUE_TYPE_UINT,
39 N_VALUE_TYPE_BOOL,
40 N_VALUE_TYPE_POINTER
41} NValueType;
42
44 typedef struct _NValue NValue;
45
49 NValue* n_value_new ();
50
54 void n_value_free (NValue *value);
55
59 void n_value_init (NValue *value);
60
64 void n_value_clean (NValue *value);
65
70 NValue* n_value_copy (const NValue *value);
71
77 int n_value_type (const NValue *value);
78
84gboolean n_value_equals (const NValue *a, const NValue *b);
85
90 void n_value_set_string (NValue *value, const char *in_value);
91
96 const gchar* n_value_get_string (const NValue *value);
97
102gchar* n_value_dup_string (const NValue *value);
103
108 void n_value_set_int (NValue *value, const gint in_value);
109
114gint n_value_get_int (const NValue *value);
115
120 void n_value_set_uint (NValue *value, const guint in_value);
121
126guint n_value_get_uint (const NValue *value);
127
132 void n_value_set_bool (NValue *value, const gboolean in_value);
133
138gboolean n_value_get_bool (const NValue *value);
139
144 void 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 */
n_value_set_string
void n_value_set_string(NValue *value, const char *in_value)
Set string value to NValue.
n_value_free
void n_value_free(NValue *value)
Free NValue.
n_value_set_pointer
void n_value_set_pointer(NValue *value, const gpointer in_value)
Set pointer to NValue.
n_value_copy
NValue * n_value_copy(const NValue *value)
Copy NValue.
n_value_get_uint
guint n_value_get_uint(const NValue *value)
Get uint value from NValue.
n_value_get_int
gint n_value_get_int(const NValue *value)
Get int value from NValue.
NValue
struct _NValue NValue
Internal NValue structure.
Definition value.h:44
n_value_to_string
gchar * n_value_to_string(const NValue *value)
Return string representation of contents.
n_value_type
int n_value_type(const NValue *value)
Return type of contents of NValue.
n_value_set_uint
void n_value_set_uint(NValue *value, const guint in_value)
Set uint value to NValue.
n_value_get_bool
gboolean n_value_get_bool(const NValue *value)
Get boolean value from NValue.
n_value_get_string
const gchar * n_value_get_string(const NValue *value)
Get string value from NValue.
n_value_dup_string
gchar * n_value_dup_string(const NValue *value)
Return copy of string from NValue.
n_value_init
void n_value_init(NValue *value)
Re-init NValue.
n_value_new
NValue * n_value_new()
Return new NValue.
NValueType
NValueType
NValue type enum.
Definition value.h:35
N_VALUE_TYPE_INT
@ N_VALUE_TYPE_INT
Definition value.h:37
N_VALUE_TYPE_BOOL
@ N_VALUE_TYPE_BOOL
Definition value.h:39
N_VALUE_TYPE_POINTER
@ N_VALUE_TYPE_POINTER
Definition value.h:40
N_VALUE_TYPE_STRING
@ N_VALUE_TYPE_STRING
Definition value.h:36
N_VALUE_TYPE_UINT
@ N_VALUE_TYPE_UINT
Definition value.h:38
n_value_set_int
void n_value_set_int(NValue *value, const gint in_value)
Set int value to NValue.
n_value_clean
void n_value_clean(NValue *value)
Clean NValue.
n_value_set_bool
void n_value_set_bool(NValue *value, const gboolean in_value)
Set boolean value to NValue.
n_value_equals
gboolean n_value_equals(const NValue *a, const NValue *b)
Compare two NValues.
n_value_get_pointer
gpointer n_value_get_pointer(const NValue *value)
Get pointer from NValue.