Modulemd

Modulemd — Functions for managing Module Metadata

Functions

Description

Functions

modulemd_get_version ()

const gchar *
modulemd_get_version (void);

Returns

The version of libmodulemd.

Since: 1.5


modulemd_objects_from_file ()

GPtrArray *
modulemd_objects_from_file (const gchar *yaml_file,
                            GError **error);

Allocates a GPtrArray of various supported subdocuments from a file.

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 GPtrArray of various supported subdocuments from a YAML file. These subdocuments will all be GObjects and their type can be identified with G_OBJECT_TYPE(object).

[array zero-terminated=1][element-type GObject][transfer container]

Since: 1.2


modulemd_objects_from_file_ext ()

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

Allocates a GPtrArray of various supported subdocuments from a file.

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 GPtrArray of various supported subdocuments from a YAML file. These subdocuments will all be GObjects and their type can be identified with G_OBJECT_TYPE(object). This array must be freed with g_ptr_array_unref().

[array zero-terminated=1][element-type GObject][transfer container]

Since: 1.4


modulemd_index_from_file ()

GHashTable *
modulemd_index_from_file (const gchar *yaml_file,
                          GPtrArray **failures,
                          GError **error);

Allocates a GHashTable of module data from a file.

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 GHashTable containing all of the subdocuments from a YAML file, indexed by module name. This hash table must be freed with g_hash_table_unref().

[element-type utf8 ModulemdImprovedModule][transfer container]

Since: 1.6


modulemd_objects_from_string ()

GPtrArray *
modulemd_objects_from_string (const gchar *yaml_string,
                              GError **error);

Allocates a GPtrArray of various supported subdocuments from a file.

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 GPtrArray of various supported subdocuments from a YAML file. These subdocuments will all be GObjects and their type can be identified with G_OBJECT_TYPE(object).

[array zero-terminated=1][element-type GObject][transfer container]

Since: 1.2


modulemd_objects_from_string_ext ()

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

Allocates a GPtrArray of various supported subdocuments from a file.

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 GPtrArray of various supported subdocuments from a YAML file. These subdocuments will all be GObjects and their type can be identified with G_OBJECT_TYPE(object).

[array zero-terminated=1][element-type GObject][transfer container]

Since: 1.4


modulemd_index_from_string ()

GHashTable *
modulemd_index_from_string (const gchar *yaml_string,
                            GPtrArray **failures,
                            GError **error);

Allocates a GHashTable of module data from a string.

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 string 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 GHashTable containing all of the subdocuments from a YAML file, indexed by module name. This hash table must be freed with g_hash_table_unref().

[element-type utf8 ModulemdImprovedModule][transfer container]

Since: 1.6


modulemd_objects_from_stream ()

GPtrArray *
modulemd_objects_from_stream (FILE *stream,
                              GError **error);

Allocates a GPtrArray of various supported subdocuments from a file.

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 GPtrArray of various supported subdocuments from a YAML file. These subdocuments will all be GObjects and their type can be identified with G_OBJECT_TYPE(object).

[array zero-terminated=1][element-type GObject][transfer container]

Since: 1.4


modulemd_objects_from_stream_ext ()

GPtrArray *
modulemd_objects_from_stream_ext (FILE *stream,
                                  GPtrArray **failures,
                                  GError **error);

Allocates a GPtrArray of various supported subdocuments from a file.

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 GPtrArray of various supported subdocuments from a YAML file. These subdocuments will all be GObjects and their type can be identified with G_OBJECT_TYPE(object).

[array zero-terminated=1][element-type GObject][transfer container]

Since: 1.4


modulemd_index_from_stream ()

GHashTable *
modulemd_index_from_stream (FILE *yaml_stream,
                            GPtrArray **failures,
                            GError **error);

Allocates a GHashTable of module data from a stream.

Parameters

yaml_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 stream 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 GHashTable containing all of the subdocuments from a YAML file, indexed by module name. This hash table must be freed with g_hash_table_unref().

[element-type utf8 ModulemdImprovedModule][transfer container]

Since: 1.6


modulemd_dump_index ()

gboolean
modulemd_dump_index (GHashTable *index,
                     const gchar *yaml_file,
                     GError **error);

Parameters

index

The index of ModulemdImprovedModule objects to dump to a YAML file.

[element-type utf8 ModulemdImprovedModule][transfer none]

yaml_file

The path to the file that should contain the resulting YAML.

[transfer none]

Returns

TRUE if the file was written successfully. In the event of an error, sets error appropriately and returns FALSE.

Since: 1.6


modulemd_dumps_index ()

gchar *
modulemd_dumps_index (GHashTable *index,
                      GError **error);

Parameters

index

The index of ModulemdImprovedModule objects to dump to a string.

[element-type utf8 ModulemdImprovedModule][transfer none]

Returns

A YAML representation of the index as a string, which must be freed with g_free(). In the event of an error, sets error appropriately and returns NULL.

Since: 1.6


modulemd_dump ()

void
modulemd_dump (GPtrArray *objects,
               const gchar *yaml_file,
               GError **error);

Creates a file containing a series of YAML subdocuments, one per object passed in.

Parameters

objects

A GPtrArray of modulemd or related objects to dump to YAML.

[array zero-terminated=1][element-type GObject]

yaml_file

The path to the file that should contain the resulting YAML

 

error

A GError containing additional information if this function fails.

[out]

Since: 1.2


modulemd_dumps ()

gchar *
modulemd_dumps (GPtrArray *objects,
                GError **error);

Creates a string containing a series of YAML subdocuments, one per object passed in. This string must be freed with g_free() when no longer needed.

Parameters

objects

A GPtrArray of modulemd or related objects to dump to YAML.

[array zero-terminated=1][element-type GObject]

error

A GError containing additional information if this function fails.

[out]

Since: 1.2


modulemd_merge_defaults ()

GPtrArray *
modulemd_merge_defaults (const GPtrArray *first,
                         const GPtrArray *second,
                         gboolean override,
                         GError **error);

This function will process the lists of objects, merging duplicated modulemd-defaults objects as needed. If the object lists have different priorities, the conflicting values will be replaced by the ones from the higher-priority list rather than merged.

This function will return an error if the merge cannot be completed safely.

Parameters

first

A GPtrArray of modulemd-related objects.

[array zero-terminated=1][element-type GObject]

second

Optional. A GPtrArray of modulemd-related objects to be merged into the first list.

[array zero-terminated=1][element-type GObject][nullable]

override

Whether entries in second should override those of first in the event of a conflict or whether they should attempt to merge instead.

 

Returns

A list of module-related objects with defaults deduplicated and merged. This array is newly-allocated and must be freed with g_ptr_array_unref().

[element-type GObject][transfer container]

Since: 1.3

Types and Values