File: modulemd-build-config.h

package info (click to toggle)
libmodulemd 2.15.2-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 5,592 kB
  • sloc: ansic: 38,286; python: 3,263; xml: 1,739; sh: 389; makefile: 42
file content (341 lines) | stat: -rw-r--r-- 9,222 bytes parent folder | download | duplicates (4)
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
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
/*
 * This file is part of libmodulemd
 * Copyright (C) 2020 Red Hat, Inc.
 *
 * Fedora-License-Identifier: MIT
 * SPDX-2.0-License-Identifier: MIT
 * SPDX-3.0-License-Identifier: MIT
 *
 * This program is free software.
 * For more information on the license, see COPYING.
 * For more information on free software, see <https://www.gnu.org/philosophy/free-sw.en.html>.
 */

#pragma once

#include "modulemd-buildopts.h"
#include <glib-object.h>

G_BEGIN_DECLS

/**
 * SECTION: modulemd-build-config
 * @title: Modulemd.BuildConfig
 * @stability: stable
 * @short_description: The data to represent a configuration for building a
 * module stream.
 */

#define MODULEMD_TYPE_BUILD_CONFIG (modulemd_build_config_get_type ())

G_DECLARE_FINAL_TYPE (
  ModulemdBuildConfig, modulemd_build_config, MODULEMD, BUILD_CONFIG, GObject)


/**
 * modulemd_build_config_new:
 *
 * Initialize a new #ModulemdBuildConfig representing a module build
 * configuration.
 *
 * Since: 2.11
 */
ModulemdBuildConfig *
modulemd_build_config_new (void);


/**
 * modulemd_build_config_set_context:
 * @self: This #ModulemdBuildConfig object.
 * @context: A string of up to ten alphanumeric characters.
 *
 * Set the context that this build configuration produces.
 *
 * Note: For consistency in the API, this function does not validate the input
 * @context. This validation will be performed as part of the
 * modulemd_build_config_validate() routine where it can be reported cleanly.
 *
 * Since: 2.11
 */
void
modulemd_build_config_set_context (ModulemdBuildConfig *self,
                                   const gchar *context);


/**
 * modulemd_build_config_get_context:
 * @self: This #ModulemdBuildConfig object.
 *
 * Get the context that this build configuration produces.
 *
 * Note: This function returns the context as stored internally. If you want to
 * be sure that it is in the correct format, call
 * modulemd_build_config_validate() first.
 *
 * Returns: (transfer none): The string representing the context that this
 * build configuration produces.
 *
 * Since: 2.11
 */
const gchar *
modulemd_build_config_get_context (ModulemdBuildConfig *self);


/**
 * modulemd_build_config_set_platform:
 * @self: This #ModulemdBuildConfig object.
 * @platform: A string of up to ten alphanumeric characters.
 *
 * Set the platform that this build configuration applies to.
 *
 * Since: 2.11
 */
void
modulemd_build_config_set_platform (ModulemdBuildConfig *self,
                                    const gchar *platform);


/**
 * modulemd_build_config_get_platform:
 * @self: This #ModulemdBuildConfig object.
 *
 * Get the platform that this build configuration applies to.
 *
 * Returns: (transfer none): The string representing the platform that this
 * build configuration applies to.
 *
 * Since: 2.11
 */
const gchar *
modulemd_build_config_get_platform (ModulemdBuildConfig *self);


/**
 * modulemd_build_config_add_runtime_requirement:
 * @self: (in): This #ModulemdBuildConfig object.
 * @module_name: (in): The name of the module to depend on.
 * @stream_name: (in): The name of the module stream to depend on.
 *
 * Add a build-time dependency for this module.
 *
 * Since: 2.11
 */
void
modulemd_build_config_add_runtime_requirement (ModulemdBuildConfig *self,
                                               const gchar *module_name,
                                               const gchar *stream_name);


/**
 * modulemd_build_config_remove_runtime_requirement:
 * @self: (in): This #ModulemdBuildConfig object.
 * @module_name: (in): The name of the module to be removed.
 *
 * Remove a run-time dependency for this module.
 *
 * Since: 2.11
 */
void
modulemd_build_config_remove_runtime_requirement (ModulemdBuildConfig *self,
                                                  const gchar *module_name);


/**
 * modulemd_build_config_clear_runtime_requirements
 * @self: (in): This #ModulemdBuildConfig object.
 *
 * Remove all run-time dependencies for this module.
 *
 * Since: 2.11
 */
void
modulemd_build_config_clear_runtime_requirements (ModulemdBuildConfig *self);


/**
 * modulemd_build_config_get_runtime_requirement_stream:
 * @self: (in): This #ModulemdBuildConfig object.
 * @module_name: (in): The name of the module this module depends on.
 *
 * Returns: (transfer none): The name of the stream matching this module name
 * in the run-time dependencies.
 *
 * Since: 2.11
 */
const gchar *
modulemd_build_config_get_runtime_requirement_stream (
  ModulemdBuildConfig *self, const gchar *module_name);


/**
 * modulemd_build_config_get_runtime_modules_as_strv:
 * @self: (in): This #ModulemdBuildConfig object.
 *
 * Returns: (transfer full): An ordered #GStrv list of module names that this
 * module depends on at run-time.
 *
 * Since: 2.11
 */
GStrv
modulemd_build_config_get_runtime_modules_as_strv (ModulemdBuildConfig *self);


/**
 * modulemd_build_config_add_buildtime_requirement:
 * @self: (in): This #ModulemdBuildConfig object.
 * @module_name: (in): The name of the module to depend on.
 * @stream_name: (in): The name of the module stream to depend on.
 *
 * Add a build-time dependency for this module.
 *
 * Since: 2.11
 */
void
modulemd_build_config_add_buildtime_requirement (ModulemdBuildConfig *self,
                                                 const gchar *module_name,
                                                 const gchar *stream_name);


/**
 * modulemd_build_config_remove_buildtime_requirement:
 * @self: (in): This #ModulemdBuildConfig object.
 * @module_name: (in): The name of the module to be removed.
 *
 * Remove a build-time dependency for this module.
 *
 * Since: 2.11
 */
void
modulemd_build_config_remove_buildtime_requirement (ModulemdBuildConfig *self,
                                                    const gchar *module_name);


/**
 * modulemd_build_config_clear_buildtime_requirements
 * @self: (in): This #ModulemdBuildConfig object.
 *
 * Remove all build-time dependencies for this module.
 *
 * Since: 2.11
 */
void
modulemd_build_config_clear_buildtime_requirements (ModulemdBuildConfig *self);


/**
 * modulemd_build_config_get_buildtime_requirement_stream:
 * @self: (in): This #ModulemdBuildConfig object.
 * @module_name: (in): The name of the module this module depends on.
 *
 * Returns: (transfer none): The name of the stream matching this module name
 * in the build-time dependencies.
 *
 * Since: 2.11
 */
const gchar *
modulemd_build_config_get_buildtime_requirement_stream (
  ModulemdBuildConfig *self, const gchar *module_name);


/**
 * modulemd_build_config_get_buildtime_modules_as_strv:
 * @self: (in): This #ModulemdBuildConfig object.
 *
 * Returns: (transfer full): An ordered #GStrv list of module names that this
 * module depends on at build-time.
 *
 * Since: 2.11
 */
GStrv
modulemd_build_config_get_buildtime_modules_as_strv (
  ModulemdBuildConfig *self);


/**
 * modulemd_build_config_set_buildopts:
 * @self: (in): This #ModulemdBuildConfig object.
 * @buildopts: (in) (transfer none): A #ModulemdBuildopts object describing
 * build options that apply globally to components in this module.
 *
 * Set build options for this module's components.
 *
 * Since: 2.11
 */
void
modulemd_build_config_set_buildopts (ModulemdBuildConfig *self,
                                     ModulemdBuildopts *buildopts);


/**
 * modulemd_build_config_get_buildopts:
 * @self: (in): This #ModulemdBuildConfig object.
 *
 * Returns: (transfer none): The build options for this module's components.
 *
 * Since: 2.11
 */
ModulemdBuildopts *
modulemd_build_config_get_buildopts (ModulemdBuildConfig *self);


/**
 * modulemd_build_config_validate:
 * @self: (in): This #ModulemdBuildConfig object.
 * @error: (out): A #GError explaining any validation failure.
 *
 * Determine if this #ModulemdBuildConfig is valid according to the YAML
 * specification.
 *
 * Returns: TRUE if validation passes. Returns FALSE and sets @error
 * appropriately on validation failure.
 *
 * Since: 2.11
 */

gboolean
modulemd_build_config_validate (ModulemdBuildConfig *self, GError **error);


/**
 * modulemd_build_config_copy:
 * @self: (in): This #ModulemdBuildConfig object
 *
 * Returns: (transfer full): A deep copy of @self
 *
 * Since: 2.11
 */
ModulemdBuildConfig *
modulemd_build_config_copy (ModulemdBuildConfig *self);


/**
 * modulemd_build_config_equals:
 * @self_1: A pointer to a #ModulemdBuildConfig object.
 * @self_2: A pointer to a #ModulemdBuildConfig object.
 *
 * Returns: TRUE, if @self_1 and @self_2 are pointers to #ModulemdBuildConfig
 * objects containing equivalent data. FALSE, otherwise.
 *
 * Since: 2.11
 */

gboolean
modulemd_build_config_equals (ModulemdBuildConfig *self_1,
                              ModulemdBuildConfig *self_2);


/**
 * modulemd_build_config_compare:
 * @self_1: (in): A pointer to a #ModulemdBuildConfig object.
 * @self_2: (in): A pointer to a #ModulemdBuildConfig object.
 *
 * Returns: Less than zero if @self_1 sorts less than @self_2, zero for equal,
 * greater than zero if @self_1 is greater than @self_2.
 *
 * Since: 2.11
 */
gint
modulemd_build_config_compare (ModulemdBuildConfig *self_1,
                               ModulemdBuildConfig *self_2);

G_END_DECLS