![]() |
![]() |
![]() |
AppStream-glib Reference Manual | ![]() |
---|---|---|---|---|
Top | Description |
#include <appstream-glib.h> #define AS_TYPE_RELEASE struct AsReleaseClass; enum AsReleaseKind; enum AsReleaseState; AsRelease * as_release_new (void
); gint as_release_vercmp (AsRelease *rel1
,AsRelease *rel2
); AsReleaseKind as_release_kind_from_string (const gchar *kind_str
); const gchar * as_release_kind_to_string (AsReleaseKind kind
); AsReleaseState as_release_state_from_string (const gchar *state
); const gchar * as_release_state_to_string (AsReleaseState state
); const gchar * as_release_get_version (AsRelease *release
); GBytes * as_release_get_blob (AsRelease *release
,const gchar *filename
); guint64 as_release_get_timestamp (AsRelease *release
); const gchar * as_release_get_description (AsRelease *release
,const gchar *locale
); GPtrArray * as_release_get_locations (AsRelease *release
); const gchar * as_release_get_location_default (AsRelease *release
); AsChecksum * as_release_get_checksum_by_fn (AsRelease *release
,const gchar *fn
); AsChecksum * as_release_get_checksum_by_target (AsRelease *release
,AsChecksumTarget target
); GPtrArray * as_release_get_checksums (AsRelease *release
); AsUrgencyKind as_release_get_urgency (AsRelease *release
); AsReleaseKind as_release_get_kind (AsRelease *release
); AsReleaseState as_release_get_state (AsRelease *release
); guint64 as_release_get_size (AsRelease *release
,AsSizeKind kind
); void as_release_set_version (AsRelease *release
,const gchar *version
); void as_release_set_blob (AsRelease *release
,const gchar *filename
,GBytes *blob
); void as_release_set_timestamp (AsRelease *release
,guint64 timestamp
); void as_release_set_description (AsRelease *release
,const gchar *locale
,const gchar *description
); void as_release_add_location (AsRelease *release
,const gchar *location
); void as_release_add_checksum (AsRelease *release
,AsChecksum *checksum
); void as_release_set_urgency (AsRelease *release
,AsUrgencyKind urgency
); void as_release_set_kind (AsRelease *release
,AsReleaseKind kind
); void as_release_set_state (AsRelease *release
,AsReleaseState state
); void as_release_set_size (AsRelease *release
,AsSizeKind kind
,guint64 size
);
This object represents a single upstream release, typically a minor update. Releases can contain a localized description of paragraph and list elements and also have a version number and timestamp.
Releases can be automatically generated by parsing upstream ChangeLogs or .spec files, or can be populated using AppData files.
See also: AsApp
typedef enum { AS_RELEASE_KIND_UNKNOWN, /* Since: 0.7.6 */ AS_RELEASE_KIND_STABLE, /* Since: 0.7.6 */ AS_RELEASE_KIND_DEVELOPMENT, /* Since: 0.7.6 */ } AsReleaseKind;
The release size kind.
Unknown release type | |
A stable release | |
A development release |
Since 0.7.6
typedef enum { AS_RELEASE_STATE_UNKNOWN, /* Since: 0.5.8 */ AS_RELEASE_STATE_INSTALLED, /* Since: 0.5.8 */ AS_RELEASE_STATE_AVAILABLE, /* Since: 0.5.8 */ } AsReleaseState;
The release state.
AsRelease * as_release_new (void
);
Creates a new AsRelease.
Returns : |
a AsRelease. [transfer full] |
Since 0.1.0
gint as_release_vercmp (AsRelease *rel1
,AsRelease *rel2
);
Compares two release.
|
a AsRelease instance. |
|
a AsRelease instance. |
Returns : |
-1 if rel1 > rel2, +1 if rel1 < rel2, 0 otherwise |
Since 0.4.2
AsReleaseKind as_release_kind_from_string (const gchar *kind_str
);
Converts the text representation to an enumerated value.
|
the string. |
Returns : |
an AsReleaseKind or AS_RELEASE_KIND_UNKNOWN for unknown |
Since 0.7.6
const gchar * as_release_kind_to_string (AsReleaseKind kind
);
Converts the enumerated value to an text representation.
|
the AsReleaseKind. |
Returns : |
string version of kind
|
Since 0.7.6
AsReleaseState as_release_state_from_string (const gchar *state
);
Converts the text representation to an enumerated value.
|
a string |
Returns : |
A AsReleaseState, e.g. AS_RELEASE_STATE_INSTALLED . |
Since 0.6.6
const gchar * as_release_state_to_string (AsReleaseState state
);
Converts the enumerated value to an text representation.
|
the AsReleaseState, e.g. AS_RELEASE_STATE_INSTALLED
|
Returns : |
string version of state , or NULL for unknown |
Since 0.6.6
const gchar * as_release_get_version (AsRelease *release
);
Gets the release version.
|
a AsRelease instance. |
Returns : |
string, or NULL for not set or invalid |
Since 0.1.0
GBytes * as_release_get_blob (AsRelease *release
,const gchar *filename
);
Gets the release blob, which is typically firmware file data.
|
a AsRelease instance. |
|
a filename |
Returns : |
a GBytes, or NULL for not set |
Since 0.5.2
guint64 as_release_get_timestamp (AsRelease *release
);
Gets the release timestamp.
|
a AsRelease instance. |
Returns : |
timestamp, or 0 for unset |
Since 0.1.0
const gchar * as_release_get_description (AsRelease *release
,const gchar *locale
);
Gets the release description markup for a given locale.
|
a AsRelease instance. |
|
the locale. e.g. "en_GB". [nullable] |
Returns : |
markup, or NULL for not set or invalid |
Since 0.1.0
GPtrArray * as_release_get_locations (AsRelease *release
);
Gets the release locations, typically URLs.
|
a AsRelease instance. |
Returns : |
list of locations. [transfer none][element-type utf8] |
Since 0.3.5
const gchar * as_release_get_location_default (AsRelease *release
);
Gets the default release location, typically a URL.
|
a AsRelease instance. |
Returns : |
string, or NULL for not set or invalid |
Since 0.3.5
AsChecksum * as_release_get_checksum_by_fn (AsRelease *release
,const gchar *fn
);
Gets the checksum for a release.
|
a AsRelease instance |
|
a file basename |
Returns : |
an AsChecksum, or NULL for not found. [transfer none]
|
Since 0.4.2
AsChecksum * as_release_get_checksum_by_target (AsRelease *release
,AsChecksumTarget target
);
Gets the checksum for a release.
|
a AsRelease instance |
|
a AsChecksumTarget, e.g. AS_CHECKSUM_TARGET_CONTAINER
|
Returns : |
an AsChecksum, or NULL for not found. [transfer none]
|
Since 0.4.2
GPtrArray * as_release_get_checksums (AsRelease *release
);
Gets the release checksums.
|
a AsRelease instance. |
Returns : |
list of checksums. [transfer none][element-type AsChecksum] |
Since 0.4.2
AsUrgencyKind as_release_get_urgency (AsRelease *release
);
Gets the release urgency.
|
a AsRelease instance. |
Returns : |
enumberated value, or AS_URGENCY_KIND_UNKNOWN for not set or invalid |
Since 0.5.1
AsReleaseKind as_release_get_kind (AsRelease *release
);
Gets the type of the release.
|
a AsRelease instance. |
Returns : |
enumerated value, e.g. AS_RELEASE_KIND_STABLE
|
Since 0.7.6
AsReleaseState as_release_get_state (AsRelease *release
);
Gets the release state.
|
a AsRelease instance. |
Returns : |
enumberated value, or AS_RELEASE_STATE_UNKNOWN for not set or invalid |
Since 0.5.8
guint64 as_release_get_size (AsRelease *release
,AsSizeKind kind
);
Gets the release size.
|
a AsRelease instance |
|
a AsSizeKind, e.g. AS_SIZE_KIND_DOWNLOAD |
Returns : |
The size in bytes, or 0 for unknown. |
Since 0.5.2
void as_release_set_version (AsRelease *release
,const gchar *version
);
Sets the release version.
|
a AsRelease instance. |
|
the version string. |
Since 0.1.0
void as_release_set_blob (AsRelease *release
,const gchar *filename
,GBytes *blob
);
Sets a release blob, which is typically firmware data or a detached signature.
NOTE: This is not stored in the XML file, and is only available in-memory.
|
a AsRelease instance. |
|
a filename |
|
the GBytes data blob |
Since 0.5.2
void as_release_set_timestamp (AsRelease *release
,guint64 timestamp
);
Sets the release timestamp.
|
a AsRelease instance. |
|
the timestamp value. |
Since 0.1.0
void as_release_set_description (AsRelease *release
,const gchar *locale
,const gchar *description
);
Sets the description release markup.
|
a AsRelease instance. |
|
the locale. e.g. "en_GB". [nullable] |
|
the description markup. |
Since 0.1.0
void as_release_add_location (AsRelease *release
,const gchar *location
);
Adds a release location.
|
a AsRelease instance. |
|
the location string. |
Since 0.3.5
void as_release_add_checksum (AsRelease *release
,AsChecksum *checksum
);
Adds a release checksum.
|
a AsRelease instance. |
|
a AsChecksum instance. |
Since 0.4.2
void as_release_set_urgency (AsRelease *release
,AsUrgencyKind urgency
);
Sets the release urgency.
|
a AsRelease instance. |
|
the release urgency, e.g. AS_URGENCY_KIND_CRITICAL
|
Since 0.5.1
void as_release_set_kind (AsRelease *release
,AsReleaseKind kind
);
Sets the release kind.
|
a AsRelease instance. |
|
the AsReleaseKind |
Since 0.7.6
void as_release_set_state (AsRelease *release
,AsReleaseState state
);
Sets the release state.
|
a AsRelease instance. |
|
the release state, e.g. AS_RELEASE_STATE_INSTALLED
|
Since 0.5.8
void as_release_set_size (AsRelease *release
,AsSizeKind kind
,guint64 size
);
Sets the release size.
|
a AsRelease instance |
|
a AsSizeKind, e.g. AS_SIZE_KIND_DOWNLOAD |
|
a size in bytes, or 0 for unknown |
Since 0.5.2