as-provides

as-provides — Description of the provides-types of components

Synopsis

#include <appstream.h>

enum                AsProvidesKind;
const gchar *       as_provides_kind_to_string          (AsProvidesKind kind);
AsProvidesKind      as_provides_kind_from_string        (const gchar *kind_str);
gchar *             as_provides_item_create             (AsProvidesKind kind,
                                                         const gchar *value);
AsProvidesKind      as_provides_item_get_kind           (const gchar *item);
gchar *             as_provides_item_get_value          (const gchar *item);

Description

Components can provide various items, like libraries, Python-modules, firmware, binaries, etc. Functions to work with these items are provided here.

See also: AsComponent

Details

enum AsProvidesKind

typedef enum {
	AS_PROVIDES_KIND_UNKNOWN,
	AS_PROVIDES_KIND_LIBRARY,
	AS_PROVIDES_KIND_BINARY,
	AS_PROVIDES_KIND_FONT,
	AS_PROVIDES_KIND_MODALIAS,
	AS_PROVIDES_KIND_FIRMWARE,
	AS_PROVIDES_KIND_PYTHON2,
	AS_PROVIDES_KIND_PYTHON3,
	AS_PROVIDES_KIND_LAST
} AsProvidesKind;

AS_PROVIDES_KIND_UNKNOWN

AS_PROVIDES_KIND_LIBRARY

AS_PROVIDES_KIND_BINARY

AS_PROVIDES_KIND_FONT

AS_PROVIDES_KIND_MODALIAS

AS_PROVIDES_KIND_FIRMWARE

AS_PROVIDES_KIND_PYTHON2

AS_PROVIDES_KIND_PYTHON3

AS_PROVIDES_KIND_LAST


as_provides_kind_to_string ()

const gchar *       as_provides_kind_to_string          (AsProvidesKind kind);

Converts the enumerated value to an text representation.

kind :

the AsProvidesKind.

Returns :

string version of kind

as_provides_kind_from_string ()

AsProvidesKind      as_provides_kind_from_string        (const gchar *kind_str);

Converts the text representation to an enumerated value.

kind_str :

the string.

Returns :

a AsProvidesKind or AS_PROVIDES_KIND_UNKNOWN for unknown

as_provides_item_create ()

gchar *             as_provides_item_create             (AsProvidesKind kind,
                                                         const gchar *value);

Creates a new provides-item string, which consists of a type-part describing the items type, and a name-part, containing the name of the item. Both are separated by a semicolon, so an item of type KIND_LIBRARY and name libappstream.so.0 will become "lib;libappstream.so.0"

kind a AsProvidesKind describing the type of the item string value the name of the item as string

Returns :

a new provides-item string. Free with g_free

as_provides_item_get_kind ()

AsProvidesKind      as_provides_item_get_kind           (const gchar *item);

Returns the type (kind) of a provides-item string as AsProvidesKind

item a valid provides-item string

Returns :

the kind of the given item

as_provides_item_get_value ()

gchar *             as_provides_item_get_value          (const gchar *item);

Returns the value (name) of a provides-item string

item a valid provides-item string

Returns :

the value of the given item, or NULL if the item was invalid