Modulemd.ModuleStream

Modulemd.ModuleStream — A parent class for all versions of ModulemdModuleStream objects.

Stability Level

Stable, unless otherwise indicated

Functions

Types and Values

Description

Functions

modulemd_module_stream_new ()

ModulemdModuleStream *
modulemd_module_stream_new (guint64 mdversion,
                            const gchar *module_name,
                            const gchar *module_stream);

Parameters

mdversion

The metadata version of ModuleStream to create.

[in]

module_name

The name of the module.

[in][nullable]

module_stream

The name of this stream. Optional.

[in][nullable]

Returns

A newly-allocated ModulemdModuleStream object of the requested metadata version.

[transfer full]

Since: 2.0


modulemd_module_stream_read_file ()

ModulemdModuleStream *
modulemd_module_stream_read_file (const gchar *path,
                                  gboolean strict,
                                  const gchar *module_name,
                                  const gchar *module_stream,
                                  GError **error);

Create a ModulemdModuleStream object from a YAML file.

Parameters

path

The path to a YAML document containing a module stream definition.

[in]

module_name

An optional module name to override the document on disk. Mostly useful in cases where the name is being auto-detected from git.

[in][nullable]

module_stream

An optional module stream name to override the document on disk. Mostly useful in cases where the name is being auto-detected from git.

[in][nullable]

strict

Whether the parser should return failure if it encounters an unknown mapping key or if it should ignore it.

[in]

error

A GError that will return the reason for a failed read.

[out]

Returns

A newly-allocated ModulemdModuleStream object if the YAML file was valid and contained exactly one document: modulemd subdocument. NULL if the document fails validation or multiple documents are encountered and sets NULL appropriately. See ModulemdModuleIndex for functions to read in multiple-subdocument YAML.

[transfer full]

Since: 2.0


modulemd_module_stream_read_string ()

ModulemdModuleStream *
modulemd_module_stream_read_string (const gchar *yaml_string,
                                    gboolean strict,
                                    const gchar *module_name,
                                    const gchar *module_stream,
                                    GError **error);

Create a ModulemdModuleStream object from a YAML string.

Parameters

yaml_string

A YAML document string containing a module stream definition.

[in]

module_name

An optional module name to override the document on disk. Mostly useful in cases where the name is being auto-detected from git.

[in][nullable]

module_stream

An optional module stream name to override the document on disk. Mostly useful in cases where the name is being auto-detected from git.

[in][nullable]

strict

Whether the parser should return failure if it encounters an unknown mapping key or if it should ignore it.

[in]

error

A GError that will return the reason for a failed read.

[out]

Returns

A newly-allocated ModulemdModuleStream object if the YAML string was valid and contained exactly one document: modulemd subdocument. NULL if the document fails validation or multiple documents are encountered and sets NULL appropriately. See ModulemdModuleIndex for functions to read in multiple-subdocument YAML.

[transfer full]

Since: 2.0


modulemd_module_stream_read_stream ()

ModulemdModuleStream *
modulemd_module_stream_read_stream (FILE *stream,
                                    gboolean strict,
                                    const gchar *module_name,
                                    const gchar *module_stream,
                                    GError **error);

Create a ModulemdModuleStream object from a YAML file.

[skip]

Parameters

stream

A YAML document as a FILE * containing a module stream definition.

[in]

module_name

An optional module name to override the document on disk. Mostly useful in cases where the name is being auto-detected from git.

[in][nullable]

module_stream

An optional module stream name to override the document on disk. Mostly useful in cases where the name is being auto-detected from git.

[in][nullable]

strict

Whether the parser should return failure if it encounters an unknown mapping key or if it should ignore it.

[in]

error

A GError that will return the reason for a failed read.

[out]

Returns

A newly-allocated ModulemdModuleStream object if the YAML file was valid and contained exactly one document: modulemd subdocument. NULL if the document fails validation or multiple documents are encountered and sets NULL appropriately. See ModulemdModuleIndex for functions to read in multiple-subdocument YAML.

[transfer full]

Since: 2.0


modulemd_module_stream_copy ()

ModulemdModuleStream *
modulemd_module_stream_copy (ModulemdModuleStream *self,
                             const gchar *module_name,
                             const gchar *module_stream);

Copies a ModulemdModuleStream, optionally assigning it a new stream name in the process.

Parameters

self

This ModulemdModuleStream.

[in]

module_name

An optional new name for the module of the copied stream.

[in][nullable]

module_stream

An optional new name for the copied stream.

[in][nullable]

Returns

A newly-allocated ModulemdModuleStream object that is a complete copy of self , optionally with a new stream name.

[transfer full]

Since: 2.0


modulemd_module_stream_upgrade ()

ModulemdModuleStream *
modulemd_module_stream_upgrade (ModulemdModuleStream *self,
                                guint64 mdversion,
                                GError **error);

Return an upgraded copy of this object. Does not modify the original.

Parameters

self

This ModulemdModuleStream.

[in]

mdversion

The metadata version to upgrade to. If zero, upgrades to the highest-supported version.

[in]

error

A GError that will return the reason for an upgrade error.

[out]

Returns

A newly-allocated ModulemdModuleStream copy of this object upgraded to the requested version. Returns NULL and sets error appropriately if the upgrade could not be completed automatically.

[transfer full]

Since: 2.0


modulemd_module_stream_validate ()

gboolean
modulemd_module_stream_validate (ModulemdModuleStream *self,
                                 GError **error);

Verifies that all stored values are internally consistent and that the module is sufficiently-complete for emitting. This function is called implicitly before attempting to emit the contents.

Parameters

self

This ModulemdModuleStream.

[in]

error

A GError that will return the reason for a validation error.

[out]

Returns

TRUE if the ModulemdModuleStream passed validation. FALSE and sets error appropriately if validation fails.

Since: 2.0


modulemd_module_stream_get_mdversion ()

guint64
modulemd_module_stream_get_mdversion (ModulemdModuleStream *self);

Parameters

self

This ModulemdModuleStream.

[in]

Returns

The metadata version of this ModulemdModuleStream.

Since: 2.0


modulemd_module_stream_get_module_name ()

const gchar *
modulemd_module_stream_get_module_name
                               (ModulemdModuleStream *self);

Parameters

self

This ModulemdModuleStream.

[in]

Returns

The name of the module.

[transfer none]

Since: 2.0


modulemd_module_stream_get_stream_name ()

const gchar *
modulemd_module_stream_get_stream_name
                               (ModulemdModuleStream *self);

Parameters

self

This ModulemdModuleStream.

[in]

Returns

The name of this stream.

[transfer none]

Since: 2.0


modulemd_module_stream_set_version ()

void
modulemd_module_stream_set_version (ModulemdModuleStream *self,
                                    guint64 version);

Parameters

self

This ModulemdModuleStream.

[in]

version

The version of this ModulemdModuleStream.

[in]

Since: 2.0


modulemd_module_stream_get_version ()

guint64
modulemd_module_stream_get_version (ModulemdModuleStream *self);

Parameters

self

This ModulemdModuleStream.

[in]

Returns

The version of this ModulemdModuleStream.


modulemd_module_stream_set_context ()

void
modulemd_module_stream_set_context (ModulemdModuleStream *self,
                                    const gchar *context);

Parameters

self

This ModulemdModuleStream.

[in]

context

Module context flag. The context flag serves to distinguish module builds with the same name, stream and version and plays an important role in automatic module stream name expansion.

[in][nullable]

Since: 2.0


modulemd_module_stream_get_context ()

const gchar *
modulemd_module_stream_get_context (ModulemdModuleStream *self);

Parameters

self

This ModulemdModuleStream.

[in]

Returns

Module context flag. The context flag serves to distinguish module builds with the same name, stream and version and plays an important role in automatic module stream name expansion.

[transfer none]

Since: 2.0


modulemd_module_stream_set_arch ()

void
modulemd_module_stream_set_arch (ModulemdModuleStream *self,
                                 const gchar *arch);

Parameters

self

This ModulemdModuleStream.

[in]

arch

Module architecture. Indicates to which processor architecture this ModulemdModuleStream applies.

[in][nullable]

Since: 2.2


modulemd_module_stream_get_arch ()

const gchar *
modulemd_module_stream_get_arch (ModulemdModuleStream *self);

Parameters

self

This ModulemdModuleStream.

[in]

Returns

Module architecture. Indicates to which processor architecture this ModulemdModuleStream applies.

[transfer none]

Since: 2.2


modulemd_module_stream_get_nsvc_as_string ()

gchar *
modulemd_module_stream_get_nsvc_as_string
                               (ModulemdModuleStream *self);

modulemd_module_stream_get_nsvc_as_string has been deprecated since version 2.2 and should not be used in newly-written code.

[rename-to modulemd_module_stream_get_nsvc]

Parameters

self

This ModulemdModuleStream.

[in]

Returns

The NSVC (name:stream:version[:context]) of this module stream. NULL if module name or stream stream is unknown.

[transfer full]

Since: 2.0


modulemd_module_stream_get_NSVCA_as_string ()

gchar *
modulemd_module_stream_get_NSVCA_as_string
                               (ModulemdModuleStream *self);

[rename-to modulemd_module_stream_get_NSVCA]

Parameters

self

This ModulemdModuleStream.

[in]

Returns

The NSVCA of this module stream. The returned format is described here. NULL if module name or stream stream is unknown.

[transfer full]

Since: 2.2


modulemd_module_stream_depends_on_stream ()

gboolean
modulemd_module_stream_depends_on_stream
                               (ModulemdModuleStream *self,
                                const gchar *module_name,
                                const gchar *stream_name);

Parameters

self

This ModulemdModuleStream.

[not nullable]

module_name

A module name.

[not nullable]

stream_name

The stream of the module.

[not nullable]

Returns

TRUE if any of the ModulemdDependencies objects associated with this module applies to the provided module name and stream in the runtime dependencies.

Since: 2.1

Stability Level: Unstable


modulemd_module_stream_build_depends_on_stream ()

gboolean
modulemd_module_stream_build_depends_on_stream
                               (ModulemdModuleStream *self,
                                const gchar *module_name,
                                const gchar *stream_name);

Parameters

self

This ModulemdModuleStream.

[not nullable]

module_name

A module name.

[not nullable]

stream_name

The stream of the module.

[not nullable]

Returns

TRUE if any of the ModulemdDependencies objects associated with this module applies to the provided module name and stream in the build-time dependencies.

Since: 2.1

Stability Level: Unstable

Types and Values

enum ModulemdModuleStreamVersionEnum

Members

MD_MODULESTREAM_VERSION_ERROR

   

MD_MODULESTREAM_VERSION_UNSET

   

MD_MODULESTREAM_VERSION_ONE

Represents v1 of the Modulemd.ModuleStream metadata format.

 

MD_MODULESTREAM_VERSION_TWO

Represents v2 of the Modulemd.ModuleStream metadata format.

 

MD_MODULESTREAM_VERSION_LATEST

Represents the highest-supported version of the Modulemd.ModuleStream metadata format.

 

Since: 2.0


MODULEMD_TYPE_MODULE_STREAM

#define MODULEMD_TYPE_MODULE_STREAM (modulemd_module_stream_get_type ())

struct ModulemdModuleStreamClass

struct ModulemdModuleStreamClass {
  GObjectClass parent_class;

  ModulemdModuleStream *(*copy) (ModulemdModuleStream *self,
                                 const gchar *module_name,
                                 const gchar *module_stream);

  gboolean (*validate) (ModulemdModuleStream *self, GError **error);

  guint64 (*get_mdversion) (ModulemdModuleStream *self);

  gboolean (*depends_on_stream) (ModulemdModuleStream *self,
                                 const gchar *module_name,
                                 const gchar *stream_name);

  gboolean (*build_depends_on_stream) (ModulemdModuleStream *self,
                                       const gchar *module_name,
                                       const gchar *stream_name);

  /* Padding to allow adding up to 8 new virtual functions without
   * breaking ABI. */
  gpointer padding[8];
};

ModulemdModuleStream

typedef struct _ModulemdModuleStream ModulemdModuleStream;