summaryrefslogtreecommitdiff
path: root/common/flatpak-utils-private.h
diff options
context:
space:
mode:
Diffstat (limited to 'common/flatpak-utils-private.h')
-rw-r--r--common/flatpak-utils-private.h129
1 files changed, 1 insertions, 128 deletions
diff --git a/common/flatpak-utils-private.h b/common/flatpak-utils-private.h
index b37302f0..7de1233c 100644
--- a/common/flatpak-utils-private.h
+++ b/common/flatpak-utils-private.h
@@ -31,6 +31,7 @@
#include "flatpak-document-dbus-generated.h"
#include "flatpak-context-private.h"
#include "flatpak-error.h"
+#include "flatpak-glib-backports-private.h"
#include "flatpak-utils-http-private.h"
#include "flatpak-variant-private.h"
#include "flatpak-dir-private.h"
@@ -247,130 +248,6 @@ gboolean flatpak_utils_ascii_string_to_unsigned (const gchar *str,
guint64 *out_num,
GError **error);
-
-#if !GLIB_CHECK_VERSION (2, 40, 0)
-static inline gboolean
-g_key_file_save_to_file (GKeyFile *key_file,
- const gchar *filename,
- GError **error)
-{
- gchar *contents;
- gboolean success;
- gsize length;
-
- contents = g_key_file_to_data (key_file, &length, NULL);
- success = g_file_set_contents (filename, contents, length, error);
- g_free (contents);
-
- return success;
-}
-#endif
-
-#if !GLIB_CHECK_VERSION (2, 50, 0)
-static inline gboolean
-g_key_file_load_from_bytes (GKeyFile *key_file,
- GBytes *bytes,
- GKeyFileFlags flags,
- GError **error)
-{
- const guchar *data;
- gsize size;
-
- data = g_bytes_get_data (bytes, &size);
- return g_key_file_load_from_data (key_file, (const gchar *) data, size, flags, error);
-}
-#endif
-
-#if !GLIB_CHECK_VERSION (2, 54, 0)
-static inline gboolean
-g_ptr_array_find_with_equal_func (GPtrArray *haystack,
- gconstpointer needle,
- GEqualFunc equal_func,
- guint *index_)
-{
- guint i;
-
- g_return_val_if_fail (haystack != NULL, FALSE);
-
- if (equal_func == NULL)
- equal_func = g_direct_equal;
-
- for (i = 0; i < haystack->len; i++)
- {
- if (equal_func (g_ptr_array_index (haystack, i), needle))
- {
- if (index_ != NULL)
- *index_ = i;
- return TRUE;
- }
- }
-
- return FALSE;
-}
-#endif
-
-#if !GLIB_CHECK_VERSION (2, 56, 0)
-GDateTime *flatpak_g_date_time_new_from_iso8601 (const gchar *text,
- GTimeZone *default_tz);
-
-static inline GDateTime *
-g_date_time_new_from_iso8601 (const gchar *text, GTimeZone *default_tz)
-{
- return flatpak_g_date_time_new_from_iso8601 (text, default_tz);
-}
-#endif
-
-
-#if !GLIB_CHECK_VERSION (2, 56, 0)
-typedef void (* GClearHandleFunc) (guint handle_id);
-
-static inline void
-g_clear_handle_id (guint *tag_ptr,
- GClearHandleFunc clear_func)
-{
- guint _handle_id;
-
- _handle_id = *tag_ptr;
- if (_handle_id > 0)
- {
- *tag_ptr = 0;
- clear_func (_handle_id);
- }
-}
-#endif
-
-
-#if !GLIB_CHECK_VERSION (2, 58, 0)
-static inline gboolean
-g_hash_table_steal_extended (GHashTable *hash_table,
- gconstpointer lookup_key,
- gpointer *stolen_key,
- gpointer *stolen_value)
-{
- if (g_hash_table_lookup_extended (hash_table, lookup_key, stolen_key, stolen_value))
- {
- g_hash_table_steal (hash_table, lookup_key);
- return TRUE;
- }
- else
- return FALSE;
-}
-#endif
-
-#if !GLIB_CHECK_VERSION (2, 62, 0)
-void g_ptr_array_extend (GPtrArray *array_to_extend,
- GPtrArray *array,
- GCopyFunc func,
- gpointer user_data);
-#endif
-
-#if !GLIB_CHECK_VERSION (2, 68, 0)
-guint g_string_replace (GString *string,
- const gchar *find,
- const gchar *replace,
- guint limit);
-#endif
-
gboolean flatpak_g_ptr_array_contains_string (GPtrArray *array,
const char *str);
@@ -758,10 +635,6 @@ G_DEFINE_AUTOPTR_CLEANUP_FUNC (JsonPath, g_object_unref)
G_DEFINE_AUTOPTR_CLEANUP_FUNC (JsonReader, g_object_unref)
#endif
-#if !GLIB_CHECK_VERSION (2, 43, 4)
-G_DEFINE_AUTOPTR_CLEANUP_FUNC (GUnixFDList, g_object_unref)
-#endif
-
/* This uses a weird Auto prefix to avoid conflicts with later added autogenerated autoptr support, per:
* https://git.gnome.org/browse/glib/commit/?id=1c6cd5f0a3104aa9b62c7f1d3086181f63e71b59
*/