as-utils
as-utils — Helper functions that are used inside libappstream
|
|
Includes
#include <appstream.h>
Description
Functions which are used in libappstream and might be useful for others
as well.
Functions
as_markup_convert_simple ()
gchar *
as_markup_convert_simple (const gchar *markup
,
GError **error
);
as_utils_locale_is_compatible ()
gboolean
as_utils_locale_is_compatible (const gchar *locale1
,
const gchar *locale2
);
Calculates if one locale is compatible with another.
When doing the calculation the locale and language code is taken into
account if possible.
Returns
TRUE
if the locale is compatible.
Since: 0.9.5
as_utils_is_category_name ()
gboolean
as_utils_is_category_name (const gchar *category_name
);
as_utils_is_tld ()
gboolean
as_utils_is_tld (const gchar *tld
);
Searches the known list of TLDs we allow for AppStream IDs.
This excludes internationalized names.
Returns
TRUE
if the TLD is valid
Since: 0.9.8
as_utils_is_desktop_environment ()
gboolean
as_utils_is_desktop_environment (const gchar *desktop
);
Searches the known list of desktop environments AppStream
knows about.
Returns
TRUE
if the desktop-id is valid
Since: 0.10.0
as_utils_sort_components_into_categories ()
void
as_utils_sort_components_into_categories
(GPtrArray *cpts
,
GPtrArray *categories
,
gboolean check_duplicates
);
Sorts all components in cpts
into the AsCategory categories listed in categories
.
as_utils_compare_versions ()
gint
as_utils_compare_versions (const gchar *a
,
const gchar *b
);
Compare alpha and numeric segments of two versions.
The version compare algorithm is also used by RPM.
Returns
1: a is newer than b
0: a and b are the same version
-1: b is newer than a