File: modulemd-defaults-v1.h

package info (click to toggle)
libmodulemd 2.15.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 5,180 kB
  • sloc: ansic: 37,927; python: 3,233; xml: 1,739; sh: 389; makefile: 42
file content (186 lines) | stat: -rw-r--r-- 6,717 bytes parent folder | download | duplicates (2)
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
/*
 * This file is part of libmodulemd
 * Copyright (C) 2017-2018 Stephen Gallagher
 *
 * 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-defaults.h"
#include <glib-object.h>

G_BEGIN_DECLS

/**
 * SECTION: modulemd-defaults-v1
 * @title: Modulemd.DefaultsV1
 * @stability: stable
 * @short_description: Object representing a defaults document (version 1)
 */

#define MODULEMD_TYPE_DEFAULTS_V1 (modulemd_defaults_v1_get_type ())

G_DECLARE_FINAL_TYPE (ModulemdDefaultsV1,
                      modulemd_defaults_v1,
                      MODULEMD,
                      DEFAULTS_V1,
                      ModulemdDefaults)


/**
 * modulemd_defaults_v1_new:
 * @module_name: (in): The name of the module to which these defaults apply.
 *
 * Returns: (transfer full): A newly-allocated #ModulemdDefaultsV1 object.
 *
 * Since: 2.0
 */
ModulemdDefaultsV1 *
modulemd_defaults_v1_new (const gchar *module_name);


/**
 * modulemd_defaults_v1_set_default_stream:
 * @self: (in): This #ModulemdDefaultsV1 object.
 * @default_stream: (in) (nullable): The name of the default stream for this
 * module. If NULL, it will remove the default stream.
 * @intent: (in) (nullable): If non-NULL, this indicates the system intent to
 * apply this default stream. If NULL, it will be added as common defaults.
 * System intents are deprecated and calls with this non-NULL argument will
 * become void in the future.
 *
 * Set the default stream for this module.
 *
 * Since: 2.0
 */
void
modulemd_defaults_v1_set_default_stream (ModulemdDefaultsV1 *self,
                                         const gchar *default_stream,
                                         const gchar *intent);


/**
 * modulemd_defaults_v1_get_default_stream:
 * @self: (in): This #ModulemdDefaultsV1 object.
 * @intent: (in) (nullable): The name of the system intent whose default stream
 * will be retrieved. If left NULL or the specified intent has no different
 * default, it will return the generic default stream for this module.
 * System intents are deprecated and this argument will be ignored in the
 * future.
 *
 * Returns: (transfer none): The name of the default stream for this module.
 *
 * Since: 2.0
 */
const gchar *
modulemd_defaults_v1_get_default_stream (ModulemdDefaultsV1 *self,
                                         const gchar *intent);


/**
 * modulemd_defaults_v1_get_streams_with_default_profiles_as_strv: (rename-to modulemd_defaults_v1_get_streams_with_default_profiles)
 * @self: (in): This #ModulemdDefaultsV1 object.
 * @intent: (in) (nullable): The name of the system intent whose stream
 * profiles will be retrieved. If left NULL or the specified intent has no
 * separate defaults for this module, it will return the generic stream
 * profiles. System intents are deprecated and this argument will be ignored
 * in the future.
 *
 * Returns: (transfer full): A sorted #GStrv list of unique stream names for
 * which default profiles have been assigned.
 *
 * Since: 2.0
 */
GStrv
modulemd_defaults_v1_get_streams_with_default_profiles_as_strv (
  ModulemdDefaultsV1 *self, const gchar *intent);


/**
 * modulemd_defaults_v1_add_default_profile_for_stream:
 * @self: (in): This #ModulemdDefaultsV1 object.
 * @stream_name: (in): The name of the module stream to which to add this
 * default profile.
 * @profile_name: (in): The name of the default profile to add.
 * @intent: (in) (nullable): The name of the system intent to add profile
 * defaults to. If NULL, this sets the generic fallback profiles for the
 * stream. System intents are deprecated and calls with this non-NULL argument
 * will become void in the future.
 *
 * Add a profile that will be installed for this stream if none are explicitly
 * specified by the user. This function may be called any number of times for
 * the same stream and will deduplicate input.
 *
 * Since: 2.0
 */
void
modulemd_defaults_v1_add_default_profile_for_stream (ModulemdDefaultsV1 *self,
                                                     const gchar *stream_name,
                                                     const gchar *profile_name,
                                                     const gchar *intent);


/**
 * modulemd_defaults_v1_set_empty_default_profiles_for_stream:
 * @self: (in): This #ModulemdDefaultsV1 object.
 * @stream_name: (in): The name of the module stream for which to empty
 * default profiles.
 * @intent: (in) (nullable): The name of the system intent from which to clear
 * the profile defaults for this stream. System intents are deprecated and
 * calls with this non-NULL argument will become void in the future.
 *
 * Sets the default profiles for @stream_name to the empty set. When output to
 * a file, it will appear as `stream_name: []`.
 *
 * Since: 2.0
 */
void
modulemd_defaults_v1_set_empty_default_profiles_for_stream (
  ModulemdDefaultsV1 *self, const gchar *stream_name, const gchar *intent);

/**
 * modulemd_defaults_v1_remove_default_profiles_for_stream:
 * @self: (in): This #ModulemdDefaultsV1 object.
 * @stream_name: (in): The name of the module stream from which to remove
 * default profiles.
 * @intent: (in) (nullable): The name of the system intent from which to remove
 * the profile defaults for this stream. System intents are deprecated and
 * calls with this non-NULL arugment will become void in the future.
 *
 * Removes this stream from the list of profiles entirely. It will not appear
 * in the output document.
 *
 * Since: 2.0
 */
void
modulemd_defaults_v1_remove_default_profiles_for_stream (
  ModulemdDefaultsV1 *self, const gchar *stream_name, const gchar *intent);


/**
 * modulemd_defaults_v1_get_default_profiles_for_stream_as_strv: (rename-to modulemd_defaults_v1_get_default_profiles_for_stream)
 * @self: (in): This #ModulemdDefaultsV1 object.
 * @stream_name: (in): The name of the string to retrieve the default profiles
 * for.
 * @intent: (in) (nullable): The name of the system intent for which to
 * retrieve the profile defaults for this stream. System intents are
 * deprecated and this argument will be ignored in the future.
 *
 * Returns: (transfer full): A sorted #GStrv list of unique profiles to be
 * installed by default for this stream. NULL, if this stream_name is not
 * present in the defaults.
 *
 * Since: 2.0
 */
GStrv
modulemd_defaults_v1_get_default_profiles_for_stream_as_strv (
  ModulemdDefaultsV1 *self, const gchar *stream_name, const gchar *intent);

G_END_DECLS