summaryrefslogtreecommitdiffstats
path: root/trunk/bitbake-ng/include/bitbake/data.h
blob: 24357dbae2717ec34ffd2abaf9e1972d249ac28c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
/* ex:ts=4:sw=4:sts=4:et
 * -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
 *
 * Copyright (C) 2004, 2005 Chris Larson <kergoth@handhelds.org>
 *
 * Permission is hereby granted, free of charge, to any person obtaining a
 * copy of this software and associated documentation files (the "Software"),
 * to deal in the Software without restriction, including without limitation
 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
 * and/or sell copies of the Software, and to permit persons to whom the
 * Software is furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
 * DEALINGS IN THE SOFTWARE.
 */

#ifndef _BB_DATA_H
# define _BB_DATA_H

# include <bitbake/common.h>
# include <glib/gtypes.h>

BITBAKE_HDR_BEGIN


/** @file data.h
 *  @brief Header for bitbake metadata handling */

/**
 *@brief Creates a new bitbake metadata store
 *
 *@return An empty bitbake metadata store
 */
BBAPI gpointer bb_data_new(void);

/**
 *Obtains the value of an bitbake variable
 *
 *@param data      The bitbake metadata store in question.
 *@param var       The variable name.
 *
 *@return The variable's value.
 */
BBAPI gchar *bb_data_lookup(gconstpointer data, gchar *var);


/**
 *Sets the value of an bitbake variable
 *
 *@param data      The bitbake metadata store in question.
 *@param var       The variable name.
 *@param val       The value to be set the variable to.
 *
 *@return TRUE if succeeded, FALSE if failed.
 */
BBAPI gboolean bb_data_insert(gpointer data, gchar *var, gchar *val);


/**
 *Deletes an bitbake variable
 *
 *@param data      The bitbake metadata store in question.
 *@param var       The variable name.
 *
 *@return TRUE if succeeded, FALSE if failed.
 */
BBAPI gboolean bb_data_remove(gpointer data, gchar *var);


#if 0
/**
 *Obtains a certain conditional value associated with an bitbake variable.
 *
 *An bitbake variable has a default value (that which is
 *accessed by the usual bb_data_insert api), and any
 *number of possible values which are bound to conditions.
 *
 *This function obtains one of those conditional values.
 *
 *@param data       The bitbake metadata store in question.
 *@param var        The variable name.
 *@param conditions The conditions which apply to the value we're
 *                  attempting to get.
 *
 *@return The conditional value.
 */
BBAPI gchar *bb_data_lookup_cond(gconstpointer data, gchar *var, gchar *conditions[2]);


/**
 *Sets a certain conditional value associated with an bitbake variable.
 *
 *An bitbake variable has a default value (that which is
 *accessed by the usual bb_data_insert api), and any
 *number of possible values which are bound to conditions.
 *
 *This function removes one of those conditional values.
 *
 *@param data       The bitbake metadata store in question.
 *@param var        The variable name.
 *@param val        The value to set this variable to when these conditions are true.
 *@param conditions The conditions which apply to the value we're
 *                  attempting to remove.
 *
 *@return TRUE if succeeded, FALSE if failed.
 */
BBAPI gboolean bb_data_insert_cond(gpointer data, gchar *var, gchar *val, gchar *conditions[2]);


/**
 *Deletes a certain conditional value associated with an bitbake variable.
 *
 *An bitbake variable has a default value (that which is
 *accessed by the usual bb_data_insert api), and any
 *number of possible values which are bound to conditions.
 *
 *This function removes one of those conditional values.
 *
 *@param data       The bitbake metadata store in question.
 *@param var        The variable name.
 *@param conditions The conditions which apply to the value we're
 *                  attempting to remove.
 *
 *@return TRUE if succeeded, FALSE if failed.
 */
BBAPI gboolean bb_data_remove_cond(gpointer data, gchar *var, gchar *conditions[2]);
#endif


/**
 *Obtains the value of one of the attributes of an bitbake variable.
 *
 *@param data      The bitbake metadata store in question.
 *@param var       The variable name.
 *@param attr      The attribute name.
 *
 *@return The attribute in question.
 */
BBAPI gchar *bb_data_lookup_attr(gconstpointer data, gchar *var, gchar *attr);


/**
 *Sets the value of one of the attributes of an bitbake variable.
 *
 *@param data      The bitbake metadata store in question.
 *@param var       The variable name.
 *@param val       The value to set this attribute to.
 *@param attr      The attribute name.
 *
 *@return TRUE if succeeded, FALSE if failed.
 */
BBAPI gboolean bb_data_insert_attr(gpointer data, gchar *var, gchar *attr, gchar *val);


/**
 *Deletes a given attribute from an bitbake variable
 *
 *@param data      The bitbake metadata store in question.
 *@param var       The variable name.
 *@param attr      The attribute name.
 *
 *@return TRUE if succeeded, FALSE if failed.
 */
BBAPI gboolean bb_data_remove_attr(gpointer data, gchar *var, gchar *attr);

/**
 *Destroys a bitbake metadata store and all of its variables
 *
 */
BBAPI void bb_data_destroy(gpointer data);


BITBAKE_HDR_END

#endif /*_BB_DATA_H */