From fa6fb1033f6c7bf03d1eb719953a690f71d7b6dc Mon Sep 17 00:00:00 2001 From: Alexander Larsson Date: Thu, 23 Jun 2016 11:05:49 +0200 Subject: [PATCH] lib: Add flatpak_get_supported_arches --- lib/flatpak-installation.c | 15 +++++++++++++++ lib/flatpak-installation.h | 2 ++ 2 files changed, 17 insertions(+) diff --git a/lib/flatpak-installation.c b/lib/flatpak-installation.c index 8a3d885a..cc558a76 100644 --- a/lib/flatpak-installation.c +++ b/lib/flatpak-installation.c @@ -160,6 +160,21 @@ flatpak_get_default_arch (void) return flatpak_get_arch (); } +/** + * flatpak_get_supported_arches: + * + * Returns the canonical names for the arches that are supported (i.e. can run) + * on the current machine, in order of priority (default is first). + * + * Returns: a zero terminated array of arch strings + */ +const char * const * +flatpak_get_supported_arches (void) +{ + return (const char * const *)flatpak_get_arches (); +} + + /** * flatpak_installation_new_system: * @cancellable: (nullable): a #GCancellable diff --git a/lib/flatpak-installation.h b/lib/flatpak-installation.h index e8fed73a..106fda3b 100644 --- a/lib/flatpak-installation.h +++ b/lib/flatpak-installation.h @@ -78,6 +78,8 @@ G_DEFINE_AUTOPTR_CLEANUP_FUNC (FlatpakInstallation, g_object_unref) FLATPAK_EXTERN const char *flatpak_get_default_arch (void); +FLATPAK_EXTERN const char *const *flatpak_get_supported_arches (void); + FLATPAK_EXTERN FlatpakInstallation *flatpak_installation_new_system (GCancellable *cancellable, GError **error); FLATPAK_EXTERN FlatpakInstallation *flatpak_installation_new_user (GCancellable *cancellable,