Modulemd.Defaults

Modulemd.Defaults — Represents the default stream, profiles and other global data for a module.

Functions

GQuark modulemd_defaults_error_quark ()
ModulemdDefaults * modulemd_defaults_new ()
void modulemd_defaults_set_version ()
guint64 modulemd_defaults_peek_version ()
void modulemd_defaults_set_module_name ()
const gchar * modulemd_defaults_peek_module_name ()
gchar * modulemd_defaults_dup_module_name ()
void modulemd_defaults_set_default_stream ()
const gchar * modulemd_defaults_peek_default_stream ()
gchar * modulemd_defaults_dup_default_stream ()
void modulemd_defaults_set_profiles_for_stream ()
void modulemd_defaults_assign_profiles_for_stream ()
void modulemd_defaults_set_profile_defaults ()
gchar ** modulemd_defaults_dup_profiles_for_stream ()
GHashTable * modulemd_defaults_peek_profile_defaults ()
GHashTable * modulemd_defaults_dup_profile_defaults ()
void modulemd_defaults_add_intent ()
void modulemd_defaults_set_intents ()
GHashTable * modulemd_defaults_peek_intents ()
GHashTable * modulemd_defaults_dup_intents ()
void modulemd_defaults_set_modified ()
guint64 modulemd_defaults_get_modified ()
ModulemdDefaults * modulemd_defaults_new_from_file ()
ModulemdDefaults * modulemd_defaults_new_from_file_ext ()
ModulemdDefaults * modulemd_defaults_new_from_string ()
ModulemdDefaults * modulemd_defaults_new_from_string_ext ()
ModulemdDefaults * modulemd_defaults_new_from_stream ()
ModulemdDefaults * modulemd_defaults_new_from_stream_ext ()
void modulemd_defaults_dump ()
void modulemd_defaults_dumps ()
ModulemdDefaults * modulemd_defaults_copy ()
ModulemdDefaults * modulemd_defaults_merge ()

Types and Values

Description

Functions

modulemd_defaults_error_quark ()

GQuark
modulemd_defaults_error_quark (void);

modulemd_defaults_new ()

ModulemdDefaults *
modulemd_defaults_new (void);

Returns

A newly-allocated ModulemdDefaults object. This must be freed with g_object_unref().

[transfer full]

Since: 1.1


modulemd_defaults_set_version ()

void
modulemd_defaults_set_version (ModulemdDefaults *self,
                               guint64 version);

Sets the version of the metadata in use.

Parameters

version

The metadata file format version

 

Since: 1.1


modulemd_defaults_peek_version ()

guint64
modulemd_defaults_peek_version (ModulemdDefaults *self);

Retrieves the metadata file format version.

Returns

a 64-bit unsigned integer containing the file format version.

Since: 1.1


modulemd_defaults_set_module_name ()

void
modulemd_defaults_set_module_name (ModulemdDefaults *self,
                                   const gchar *name);

Sets the "module-name" property.

Parameters

name

The module name to which these defaults apply

 

Since: 1.1


modulemd_defaults_peek_module_name ()

const gchar *
modulemd_defaults_peek_module_name (ModulemdDefaults *self);

Retrieves the module name to which these defaults apply.

Returns

a string containing the "module-name" property. This string must not be modified or freed. If you need to do so, use modulemd_defaults_dup_module_name() instead.

Since: 1.1


modulemd_defaults_dup_module_name ()

gchar *
modulemd_defaults_dup_module_name (ModulemdDefaults *self);

Retrieves the module name to which these defaults apply.

Returns

a string containing the "module-name" property. This string must be freed with g_free() when the caller is done with it.

Since: 1.1


modulemd_defaults_set_default_stream ()

void
modulemd_defaults_set_default_stream (ModulemdDefaults *self,
                                      const gchar *stream);

Sets the "default-stream" property.

Parameters

stream

The default stream for this module

 

Since: 1.1


modulemd_defaults_peek_default_stream ()

const gchar *
modulemd_defaults_peek_default_stream (ModulemdDefaults *self);

Retrieves the default stream.

Returns

a string containing the "default-stream" property. This string must not be modified or freed. If you need to do so, use modulemd_defaults_dup_default_stream() instead.

Since: 1.1


modulemd_defaults_dup_default_stream ()

gchar *
modulemd_defaults_dup_default_stream (ModulemdDefaults *self);

Retrieves the default stream.

Returns

a string containing the "default-stream" property. This string must be freed with g_free() when the caller is done with it.

Since: 1.1


modulemd_defaults_set_profiles_for_stream ()

void
modulemd_defaults_set_profiles_for_stream
                               (ModulemdDefaults *self,
                                const gchar *stream,
                                gchar **profiles);

Parameters

stream

The name of the stream getting default profiles

 

profiles

The set of profile names to install by default when installing this stream of the module.

[array zero-terminated=1][transfer none]

Since: 1.1


modulemd_defaults_assign_profiles_for_stream ()

void
modulemd_defaults_assign_profiles_for_stream
                               (ModulemdDefaults *self,
                                const gchar *stream,
                                ModulemdSimpleSet *profiles);

Parameters

stream

The name of the stream getting default profiles

 

profiles

A ModulemdSimpleSet of profile names to install by default when installing this stream of the module.

 

Since: 1.1


modulemd_defaults_set_profile_defaults ()

void
modulemd_defaults_set_profile_defaults
                               (ModulemdDefaults *self,
                                GHashTable *profile_defaults);

Assigns the hash table of streams and their default profiles

Parameters

profile_defaults

.

[nullable][element-type utf8 ModulemdSimpleSet][transfer none]

Since: 1.1


modulemd_defaults_dup_profiles_for_stream ()

gchar **
modulemd_defaults_dup_profiles_for_stream
                               (ModulemdDefaults *self,
                                const gchar *stream);

Parameters

stream

The name of the stream from which to retrieve defaults

 

Returns

A zero-terminated array of strings that provides the list of profiles that should be installed by default when this stream is specified.

[array zero-terminated=1][transfer full]

Since: 1.1


modulemd_defaults_peek_profile_defaults ()

GHashTable *
modulemd_defaults_peek_profile_defaults
                               (ModulemdDefaults *self);

Retrieves a hash table of the profile defaults.

Returns

A GHashTable containing the set of profile defaults for streams of this module. This hash table is maintained by the ModulemdDefaults object and must not be freed or modified. If modification is necessary, use modulemd_defaults_dup_profile_defaults() instead.

[element-type utf8 ModulemdSimpleSet][transfer none]

Since: 1.1


modulemd_defaults_dup_profile_defaults ()

GHashTable *
modulemd_defaults_dup_profile_defaults
                               (ModulemdDefaults *self);

Retrieves a copy of the hash table of profile defaults.

Returns

A GHashTable containing the set of profile defaults for streams of this module. This hash table is a copy and must be freed with g_hash_table_unref() when the caller is finished with it. The elements it contains are maintained by the hash table and will be automatically freed when their key is removed or the hash table is freed.

[element-type utf8 ModulemdSimpleSet][transfer container]

Since: 1.1


modulemd_defaults_add_intent ()

void
modulemd_defaults_add_intent (ModulemdDefaults *self,
                              ModulemdIntent *intent);

Adds an intent object to the hash table.

Parameters

intent

The ModulemdIntent to add to the intents table.

[transfer none][not nullable]

Since: 1.5


modulemd_defaults_set_intents ()

void
modulemd_defaults_set_intents (ModulemdDefaults *self,
                               GHashTable *intents);

Parameters

intents

A GHashTable containing defaults for individual system intents.

[element-type utf8 ModulemdIntent][nullable][transfer none]

Since: 1.5


modulemd_defaults_peek_intents ()

GHashTable *
modulemd_defaults_peek_intents (ModulemdDefaults *self);

Get a pointer to the intents hash table. The returned table is managed by the ModulemdDefaults object and must not be modified or freed.

Returns

A pointer to the intents hash table.

[element-type utf8 ModulemdIntent][transfer none]

Since: 1.5


modulemd_defaults_dup_intents ()

GHashTable *
modulemd_defaults_dup_intents (ModulemdDefaults *self);

Get a copy of the intents hash table. The returned table is managed by the caller and must be freed with g_hash_table_unref()

Returns

A copy of the intents hash table.

[element-type utf8 ModulemdIntent][transfer container]

Since: 1.5


modulemd_defaults_set_modified ()

void
modulemd_defaults_set_modified (ModulemdDefaults *self,
                                guint64 modified);

Sets the modified field for these defaults.

Since: 1.8


modulemd_defaults_get_modified ()

guint64
modulemd_defaults_get_modified (ModulemdDefaults *self);

Returns

The modified field for these defaults.

Since: 1.8


modulemd_defaults_new_from_file ()

ModulemdDefaults *
modulemd_defaults_new_from_file (const gchar *yaml_file,
                                 GError **error);

Constructs a new ModulemdDefaults object from the first valid modulemd-defaults document in the given module stream. This will ignore any documents of other types, malformed documents and defaults that appear later in the stream.

Parameters

yaml_file

A YAML file containing the module metadata and other related information such as default streams.

 

error

A GError containing additional information if this function fails.

[out]

Returns

A ModulemdDefaults object constructed the first valid modulemd-defaults document in the given module stream. This must be freed with g_object_unref() when no longer needed.

Since: 1.2


modulemd_defaults_new_from_file_ext ()

ModulemdDefaults *
modulemd_defaults_new_from_file_ext (const gchar *yaml_file,
                                     GPtrArray **failures,
                                     GError **error);

Constructs a new ModulemdDefaults object from the first valid modulemd-defaults document in the given module stream. This will ignore any documents of other types, malformed documents and defaults that appear later in the stream.

Parameters

yaml_file

A YAML file containing the module metadata and other related information such as default streams.

 

failures

An array containing any subdocuments from the YAML file that failed to parse. This must be freed with g_ptr_array_unref().

[element-type ModulemdSubdocument][transfer container][out]

error

A GError containing additional information if this function fails.

[out]

Returns

A ModulemdDefaults object constructed the first valid modulemd-defaults document in the given module stream. This must be freed with g_object_unref() when no longer needed.

Since: 1.4


modulemd_defaults_new_from_string ()

ModulemdDefaults *
modulemd_defaults_new_from_string (const gchar *yaml_string,
                                   GError **error);

Constructs a new ModulemdDefaults object from the first valid modulemd-defaults document in the given module stream. This will ignore any documents of other types, malformed documents and defaults that appear later in the stream.

Parameters

yaml_string

A YAML string containing the module metadata and other related information such as default streams.

 

error

A GError containing additional information if this function fails.

[out]

Returns

A ModulemdDefaults object constructed the first valid modulemd-defaults document in the given module stream. This must be freed with g_object_unref() when no longer needed.

Since: 1.2


modulemd_defaults_new_from_string_ext ()

ModulemdDefaults *
modulemd_defaults_new_from_string_ext (const gchar *yaml_string,
                                       GPtrArray **failures,
                                       GError **error);

Constructs a new ModulemdDefaults object from the first valid modulemd-defaults document in the given module stream. This will ignore any documents of other types, malformed documents and defaults that appear later in the stream.

Parameters

yaml_string

A YAML string containing the module metadata and other related information such as default streams.

 

failures

An array containing any subdocuments from the YAML file that failed to parse. This must be freed with g_ptr_array_unref().

[element-type ModulemdSubdocument][transfer container][out]

error

A GError containing additional information if this function fails.

[out]

Returns

A ModulemdDefaults object constructed the first valid modulemd-defaults document in the given module stream. This must be freed with g_object_unref() when no longer needed.

Since: 1.4


modulemd_defaults_new_from_stream ()

ModulemdDefaults *
modulemd_defaults_new_from_stream (FILE *stream,
                                   GError **error);

Constructs a new ModulemdDefaults object from the first valid modulemd-defaults document in the given module stream. This will ignore any documents of other types, malformed documents and defaults that appear later in the stream.

Parameters

stream

A YAML stream containing the module metadata and other related information such as default streams.

 

error

A GError containing additional information if this function fails.

[out]

Returns

A ModulemdDefaults object constructed the first valid modulemd-defaults document in the given module stream. This must be freed with g_object_unref() when no longer needed.

Since: 1.4


modulemd_defaults_new_from_stream_ext ()

ModulemdDefaults *
modulemd_defaults_new_from_stream_ext (FILE *stream,
                                       GPtrArray **failures,
                                       GError **error);

Constructs a new ModulemdDefaults object from the first valid modulemd-defaults document in the given module stream. This will ignore any documents of other types, malformed documents and defaults that appear later in the stream.

Parameters

stream

A YAML stream containing the module metadata and other related information such as default streams.

 

failures

An array containing any subdocuments from the YAML file that failed to parse. This must be freed with g_ptr_array_unref().

[element-type ModulemdSubdocument][transfer container][out]

error

A GError containing additional information if this function fails.

[out]

Returns

A ModulemdDefaults object constructed the first valid modulemd-defaults document in the given module stream. This must be freed with g_object_unref() when no longer needed.

Since: 1.4


modulemd_defaults_dump ()

void
modulemd_defaults_dump (ModulemdDefaults *self,
                        const gchar *file_path);

Exports the YAML representation of this defaults object to a file.

Parameters

file_path

File path for exporting the YAML representation of this defaults object

 

Since: 1.1


modulemd_defaults_dumps ()

void
modulemd_defaults_dumps (ModulemdDefaults *self,
                         gchar **yaml_string);

Exports the YAML representation of this defaults object to a string. The caller is responsible for calling g_free() on this string when they are finished with it.

Parameters

yaml_string

File path for exporting the YAML representation of this defaults object.

[out]

Since: 1.1


modulemd_defaults_copy ()

ModulemdDefaults *
modulemd_defaults_copy (ModulemdDefaults *self);

Returns

A deep-copied ModulemdDefaults object. This object must be freed with g_object_unref().

[transfer full]

Since: 1.3


modulemd_defaults_merge ()

ModulemdDefaults *
modulemd_defaults_merge (ModulemdDefaults *first,
                         ModulemdDefaults *second,
                         gboolean override,
                         GError **error);

Parameters

first

A ModulemdDefaults object providing the base for the merge.

 

second

A ModulemdDefaults object being merged onto first .

 

override

In the case of a conflict, should second completely replace the contents of first .

 

Returns

A merged or replaced ModulemdDefaults object. In case of unresolvable merge, NULL will be returned and an error will be set. This object must be freed with g_object_unref().

[transfer full]

Since: 1.3

Types and Values

MD_DEFAULTS_VERSION_LATEST

#define MD_DEFAULTS_VERSION_LATEST MD_DEFAULTS_VERSION_1

MODULEMD_DEFAULTS_ERROR

#define MODULEMD_DEFAULTS_ERROR modulemd_defaults_error_quark ()

MODULEMD_TYPE_DEFAULTS

#define MODULEMD_TYPE_DEFAULTS (modulemd_defaults_get_type ())

ModulemdDefaults

typedef struct _ModulemdDefaults ModulemdDefaults;