### Namespace

# AppStream – 1.0

Library to work with AppStream metadata

Version | 1.1.2
Authors | AppStream Developers
License | LGPL-2.1-or-later
Website | https://www.freedesktop.org/software/appstream/docs/
Source | https://github.com/ximion/appstream

#### Build

C headers | `appstream.h`
pkg-config files | `appstream`

#### Dependencies

GObject—2.0 | The base type system library
| Browse documentation
Gio—2.0 | A modern, easy-to-use VFS API
| Browse documentation

#### Related libraries

AppStreamCompose | Library to compose AppStream catalog metadata
| Browse documentation

#### Additional documentation

- Classes Hierarchy

#### Classes

Agreement |
AgreementSection |
Artifact |
Branding |
Bundle |
Category |
Checksum |
Component |
ComponentBox |
ContentRating |
Context |
Developer |
Icon |
Image |
Issue |
Launchable |
Metadata |
Pool |
Provided |
Reference |
Relation |
RelationCheckResult |
Release |
ReleaseList |
Review |
Screenshot |
Suggested |
SystemInfo |
Translation |
Validator |
ValidatorIssue |
Video |

#### Structs

BrandingColorIter | A `AsBrandingColorIter` structure represents an iterator that can be used to iterate over the accent colors of an `AsBranding` object. `AsBrandingColorIter` structures are typically allocated on the stack and then initialized with as_branding_color_iter_init().

#### Enumerations

AgreementKind | The kind of the agreement.
ArtifactKind | The artifact type.
BundleKind | The bundle type.
ChassisKind | The type of chassis a computing device is built into.
CheckResult | Result of a check operation.
ChecksumKind | Checksums supported by `AsRelease`.
ColorKind | A branding color type.
ColorSchemeKind | A color scheme type.
ComponentKind | The type of an `AsComponent`.
ComponentScope | Scope of the `AsComponent` (system-wide or user-scope).
ContentRatingSystem | A content rating system for a particular territory. since: 0.12.12
ContentRatingValue | The specified level of an content_rating rating ID.
ControlKind | Kind of an input method for users to control software.
DisplaySideKind | Side a display_length requirement is for.
FormatKind | Format of the AppStream metadata.
FormatStyle | There are a few differences between AppStream’s metainfo files (shipped by upstream projects) and the catalog metadata (shipped by distributors). The data source kind indicates which style we should process. Usually you do not want to set this explicitly.
FormatVersion | Format version / API level of the AppStream metadata.
IconKind | The icon type.
ImageKind | The image type.
InternetKind | Different internet connectivity requirements or recommendations for an application. since: 0.15.5
IssueKind | Checksums supported by `AsRelease`.
IssueSeverity | The severity of an issue found by `AsValidator`.
LaunchableKind | Type of launch system the entries belong to.
MarkupKind | Text markup types.
MergeKind | Defines how `AsComponent` data should be merged if the component is set for merge.
MetadataLocation | The flags used when installing and removing metadata files.
ProvidedKind | Type of the public interface components can provide.
ReferenceKind | A reference type.
RelationCompare | The relational comparison type.
RelationItemKind | Type of the item an `AsRelation` is for.
RelationKind | Type of a component’s relation to other items.
RelationStatus | Status of a relation check result.
ReleaseKind | The release kind. since: 0.12.0
ReleaseListKind | The kind of a releases block. since: 0.16.0
ReleaseUrlKind | `AS_RELEASE_URL_KIND_UNKNOWN` Unknown release web URL type The release URL kinds. since: 0.12.5
ScreenshotKind | The screenshot type.
ScreenshotMediaKind | The media kind contained in this screenshot.
SizeKind | The artifact size kind. since: 0.8.6
SuggestedKind | The suggested type.
TranslationKind | The translation type.
UrgencyKind | The urgency of an `AsRelease`.
UrlKind | The URL type.
VideoCodecKind | Supported video codecs.
VideoContainerKind | Supported video codecs.

#### Bitfields

CacheFlags | Flags on how caching should be used.
ComponentBoxFlags | Flags controlling the component box behavior.
DataIdMatchFlags | The flags used when matching unique IDs.
ParseFlags | Influence certain aspects of how AppStream metadata is parsed.
PoolFlags | Flags controlling the metadata pool behavior.
ReviewFlags | The flags for the review. since: 0.14.0
ValueFlags | Set how values assigned to an `AsComponent` should be treated when they are set or retrieved.
VercmpFlags | The flags used when matching unique IDs.

#### Error Domains

MetadataError | A metadata processing error.
PoolError | A metadata pool error.
RelationError | The error type.
SystemInfoError | The error type.
UtilsError | The error type.
ValidatorError | The error type.

#### Functions

get_current_distro_component_id | Returns the component-ID of the current distribution based on contents of the `/etc/os-release` file. This function is a shorthand for %as_distro_details_get_cid.
get_default_categories | Get a list of the default Freedesktop and AppStream categories that software components (especially GUI applications) can be sorted into in software centers.
get_default_categories_gi | Get a list of the default Freedesktop and AppStream categories that software components (especially GUI applications) can be sorted into in software centers.
get_license_name | Get a translated license name for the given SPDX ID. since: 1.0.0
get_license_url | Get a web URL to the license text and more license information for an SPDX license identifier. since: 0.12.7
gstring_replace | Replaces the string `find` with the string `replace` in a `GString` up to `limit` times. If the number of instances of `find` in the `GString` is less than `limit`, all instances are replaced. If `limit` is `0`, all instances of `find` are replaced.
is_spdx_license_exception_id | Searches the known list of SPDX license exception IDs. since: 0.12.10
is_spdx_license_expression | Checks the licence string to check it being a valid licence. NOTE: SPDX licenses can’t typically contain brackets. since: 0.9.8
is_spdx_license_id | Searches the known list of SPDX license IDs. since: 0.9.8
license_is_free_license | Check if the given license is for free-as-in-freedom software. A free software license is either approved by the Free Software Foundation or the Open Source Initiative. since: 0.12.10
license_is_metadata_license | Check if the metadata license is suitable for mixing with other metadata and redistributing the bundled result (this means we prefer permissive licenses here, to not require people shipping catalog metadata to perform a full license review).
license_is_metadata_license_id | Tests license ID against the vetted list of licenses that can be used for metainfo metadata. This function will not work for license expressions, if you need to test an SPDX license expression for compliance, please use %as_license_is_metadata_license insread.
license_to_spdx_id | Converts a non-SPDX license into an SPDX format string where possible. since: 0.9.8
markup_convert | Converts XML description markup into other forms of text.
markup_strsplit_words | Splits up a long line into an array of smaller strings, each being no longer than `line_len`. Words are not split. since: 0.14.0
spdx_license_detokenize | De-tokenizes the SPDX licenses into a string. since: 0.9.8
spdx_license_tokenize | Tokenizes the SPDX license string (or any simarly formatted string) into parts. Any license parts of the string e.g. “LGPL-2.0+” are prefexed with “@”, the conjunctive replaced with “&”, the disjunctive replaced with “|” and the WITH operator for license exceptions replaced with “^”. Brackets are added as indervidual tokens and other strings are appended into single tokens where possible. since: 0.9.8
utils_build_data_id | Builds an identifier string unique to the individual dataset using the supplied information. since: 0.14.0
utils_data_id_equal | Checks two component data IDs for equality allowing globs to match. since: 0.14.0
utils_data_id_get_cid | Get the component-id part of the data-id.
utils_data_id_hash | Converts a data-id to a hash value. since: 0.14.0
utils_data_id_match | Checks two data IDs for equality allowing globs to match, whilst also allowing clients to whitelist sections that have to match. since: 0.14.0
utils_data_id_valid | Checks if a data ID is valid i.e. has the correct number of sections. since: 0.14.0
utils_get_desktop_environment_name | Get a human-readable, translated name of the desktop environment represented by the given ID. since: 1.0.0
utils_get_gui_environment_style_name | Get a human-readable, translated name of the combination of GUI environment and style. E.g. “plasma:dark” becomes “Plasma (Dark)”. since: 1.0.0
utils_get_tag_search_weight | Retrieve the raw search token weight for the given tag name that AppStream uses internally for searching. This can be used to implement separate, but compatible search logic.
utils_guess_scope_from_path | Guess the `AsComponentScope` that applies to a given path. since: 0.15.0
utils_install_metadata_file | Installs an AppStream MetaInfo, AppStream Metadata Catalog or AppStream Icon tarball file to the right place on the filesystem. Please note that this function does almost no validation and may guess missing values such as icon sizes and origin names. Ensure your metadata is good before installing it. since: 0.14.0
utils_is_category_name | Searches the known list of registered XDG category names. See https://specifications.freedesktop.org/menu-spec/latest/category-registry.html for a reference. since: 0.9.7
utils_is_desktop_environment | Checks if the submitted desktop environment ID is known and valid. since: 0.10.0
utils_is_gui_environment_style | Checks if the given identifier is a valid, known GUI environment style. since: 1.0.0
utils_is_platform_triplet | Test if the given string is a valid platform triplet recognized by AppStream. since: 0.14.0
utils_is_tld | Searches the known list of TLDs we allow for AppStream IDs. This excludes internationalized names. since: 0.9.8
utils_locale_is_compatible | Calculates if one locale is compatible with another. When doing the calculation the locale and language code is taken into account if possible. since: 0.9.5
utils_posix_locale_to_bcp47 | Converts a POSIX locale string to the corresponding IETF BCP47 format. If the given locale is already in BCP47 format, no change will be done.
utils_sort_components_into_categories | Sorts all components in `cpts` into the `AsCategory` categories listed in `categories`.
vercmp | Compare alpha and numeric segments of two software versions, considering `flags`.
vercmp_simple | Compare alpha and numeric segments of two software versions.
vercmp_test_match | Compare two version numbers and check if the given version comparator matches. since: 0.16.0
version_string | Get the version of the AppStream library that is currently used at runtime as a string. since: 0.14.0

#### Function Macros

CHECK_VERSION |
component_box_index | Returns the `AsComponent` at the given index of the array.
component_box_len | Get the amount of components in its box array.
flags_add |
flags_contains |
flags_invert |
flags_remove |
release_list_index | Returns the `AsRelease` at the given index of the array.
release_list_len | Get the amount of release entries present.

#### Constants

MAJOR_VERSION |
MICRO_VERSION |
MINOR_VERSION |