Modulemd.Module (Private)

Modulemd.Module (Private) — ModulemdModule methods that should be used only by internal consumers.

Stability Level

Private, unless otherwise indicated

Functions

Description

Functions

modulemd_module_new ()

ModulemdModule *
modulemd_module_new (const gchar *module_name);

Parameters

module_name

The name of the module.

[in][not nullable]

Returns

A newly-allocated ModulemdModule.

[transfer full]

Since: 2.0


modulemd_module_set_defaults ()

ModulemdDefaultsVersionEnum
modulemd_module_set_defaults (ModulemdModule *self,
                              ModulemdDefaults *defaults,
                              ModulemdDefaultsVersionEnum index_mdversion,
                              GError **error);

This function takes a defaults object, upgrades it to index_mdversion if it is lower and adds it to the ModulemdModule. If it cannot upgrade it safely or the defaults are not for this module, it will return an appropriate error.

Parameters

self

This ModulemdModule object.

[in]

defaults

A ModulemdDefaults object to associate with this ModulemdModule. If the module_name in the ModulemdDefaults object does not match this module, it will be rejected.

[in]

index_mdversion

The ModulemdDefaultsVersionEnum of the highest defaults version added so far in the ModulemdModuleIndex. If non-zero, perform an upgrade to this version while adding defaults to self . If the defaults already has a higher version, just copy it.

[in]

error

A GError containing information about why this fucntion failed.

[out]

Returns

The mdversion of the defaults that were added. Returns MD_DEFAULTS_VERSION_ERROR and sets error if the default name didn't match or the Defaults object couldn't be upgraded successfully to the index_mdversion . Returns MD_DEFAULTS_VERSION_UNSET if defaults was NULL.

Since: 2.0


modulemd_module_add_translation ()

void
modulemd_module_add_translation (ModulemdModule *self,
                                 ModulemdTranslation *translation);

modulemd_module_get_translated_streams ()

GPtrArray *
modulemd_module_get_translated_streams
                               (ModulemdModule *self);

Parameters

self

This ModulemdModule object

 

Returns

A list of streams for which translations have been added, sorted by stream name.

[transfer container]

Since: 2.0


modulemd_module_get_translation ()

ModulemdTranslation *
modulemd_module_get_translation (ModulemdModule *self,
                                 const gchar *stream);

modulemd_module_add_stream ()

ModulemdModuleStreamVersionEnum
modulemd_module_add_stream (ModulemdModule *self,
                            ModulemdModuleStream *stream,
                            ModulemdModuleStreamVersionEnum index_mdversion,
                            GError **error);

This function takes a stream object, upgrades it to index_mdversion if needed and then adds it to the ModulemdModule. If it cannot upgrade it safely or the defaults are not for this module, it will return an appropriate error.

Parameters

self

This ModulemdModule object

 

stream

A ModulemdModuleStream object to associate with this ModulemdModule. A stream added to a ModulemdModule must have a module name and stream name set on it or it will be rejected. If the module name does not match this module, it will also be rejected.

 

index_mdversion

The ModulemdModuleStreamVersionEnum of the highest stream version added so far in the ModulemdModuleIndex. If non-zero, perform an upgrade to this version while adding stream to self . If the stream already has the same or a higher version, just copy it.

[in]

error

A GError containing information about why this fucntion failed.

[out]

Returns

The mdversion of the stream that was added. Returns MD_MODULE_STREAM_VERSION_ERROR and sets error if the module name didn't match, the module and stream names were unset or the stream object couldn't be upgraded successfully to the index_mdversion . Returns MD_MODULE_STREAM_VERSION_UNSET if stream was NULL.

Since: 2.0


modulemd_module_upgrade_streams ()

gboolean
modulemd_module_upgrade_streams (ModulemdModule *self,
                                 ModulemdModuleStreamVersionEnum mdversion,
                                 GError **error);

Parameters

self

This ModulemdModule object

 

mdversion

The metadata version to upgrade to

 

error

A GError containing the reason a stream failed to upgrade.

[out]

Returns

TRUE if all upgrades completed successfully. FALSE and sets error if an upgrade error occurs, including attempts to downgrade a stream.

Since: 2.0

Types and Values