as-provides: AppStream Library Reference Manual

## as-provides as-provides — Description of the provides-types in components |

## Functions

const gchar * | as_provides_kind_to_string ()
AsProvidesKind | as_provides_kind_from_string ()
gchar * | as_provides_item_create ()
AsProvidesKind | as_provides_item_get_kind ()
gchar * | as_provides_item_get_value ()

## Types and Values

enum | AsProvidesKind

## Includes

    #include <appstream.h>

## 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

## Functions

### as_provides_kind_to_string ()

    const gchar *
    as_provides_kind_to_string (AsProvidesKind kind);

Converts the enumerated value to an text representation.

#### Parameters

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.

#### Parameters

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,
                             const gchar *data);

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;" A provides-item might also contain a "data" part, describing additional information about it. For example, for a KIND_DBUS provides type, the item might look like: dbus;org.freedesktop.PackageKit;system (specifying that the service name is on the system bus)

`kind` a AsProvidesKind describing the type of the item string `value` the name of the item as string `data` (allow-none) (default NULL): additional data associated with this item

#### 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

## Types and Values

### enum AsProvidesKind

Public interfaces components can provide.

#### Members

AS_PROVIDES_KIND_UNKNOWN | Unknown kind |
AS_PROVIDES_KIND_LIBRARY | A shared library |
AS_PROVIDES_KIND_BINARY | A binary installed into a directory in PATH |
AS_PROVIDES_KIND_FONT | A font |
AS_PROVIDES_KIND_MODALIAS | A modalias |
AS_PROVIDES_KIND_FIRMWARE | Runtime or flashed firmware |
AS_PROVIDES_KIND_PYTHON2 | A Python2 module |
AS_PROVIDES_KIND_PYTHON3 | A Python3 module |
AS_PROVIDES_KIND_MIMETYPE | Provides a handler for a mimetype |
AS_PROVIDES_KIND_DBUS | A DBus service name |